CN110716804A - Method and device for automatically deleting useless resources, storage medium and electronic equipment - Google Patents

Method and device for automatically deleting useless resources, storage medium and electronic equipment Download PDF

Info

Publication number
CN110716804A
CN110716804A CN201910822804.2A CN201910822804A CN110716804A CN 110716804 A CN110716804 A CN 110716804A CN 201910822804 A CN201910822804 A CN 201910822804A CN 110716804 A CN110716804 A CN 110716804A
Authority
CN
China
Prior art keywords
resource file
resource
deleted
files
file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910822804.2A
Other languages
Chinese (zh)
Inventor
廖琼
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN201910822804.2A priority Critical patent/CN110716804A/en
Publication of CN110716804A publication Critical patent/CN110716804A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5022Mechanisms to release resources

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The disclosure relates to an automatic deleting method, device, storage medium and electronic equipment of useless resources, belonging to the technical field of resource management, wherein the method comprises the following steps: in the running process of a target system, calibrating labels for the called resource files in a resource file library of the target system to obtain a calibrated label resource file set; acquiring other resource files in the resource file library except the calibrated label resource file set to obtain a pre-deleted resource file set; determining available resource files from the set of pre-deleted resource files; and determining other resource files except the available resource files in the pre-deleted resource file set as useless resources, and deleting the useless resources. According to the method and the device, the future performance of the application system is guaranteed while the accuracy of deleting the useless resources is effectively guaranteed through the accurate judgment of the useless resources and the available resources.

Description

Method and device for automatically deleting useless resources, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of resource management technologies, and in particular, to an automatic deleting method and apparatus for a useless resource, a storage medium, and an electronic device.
Background
The application system completes corresponding tasks by referring to various resource files, for example, a mobile phone application needs to complete starting of application system resource files such as picture resources and animation resources which need to be referred to. Usually, the application system will be continuously changed such as version upgrade and modification, and a large amount of useless resource files will remain after a plurality of changes, that is, no contribution is made to various operations of the application system, and simultaneously, the application system will have unsmooth and unsmooth redundant resources.
In the prior art, useless files in system resources are usually searched manually, that is, a worker judges the useless resources in the system according to system development experience, application requirements and the like and then deletes the useless resources, so that the useless resource files are judged inaccurately and deleted incompletely. And further, the useless code reference of the system cannot be accurately judged and deleted.
Therefore, it is desirable to provide a new automatic deleting method, apparatus, storage medium, and electronic device for useless resources.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present disclosure, and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
The invention aims to provide an automatic useless resource deleting scheme, so that the running efficiency of an application system is effectively improved at least to a certain extent by accurately and reasonably deleting useless resources of the application system.
According to one aspect of the present disclosure, there is provided a method for automatically deleting a useless resource, including:
in the running process of a target system, calibrating labels for the called resource files in a resource file library of the target system to obtain a calibrated label resource file set;
acquiring other resource files in the resource file library except the calibrated label resource file set to obtain a pre-deleted resource file set;
determining available resource files from the set of pre-deleted resource files;
and determining other resource files except the available resource files in the pre-deleted resource file set as useless resources, and deleting the useless resources.
In an exemplary embodiment of the present disclosure, in an operating process of a target system, calibrating a tag for a resource file called in a resource file library of the target system to obtain a tagged resource file set, includes:
controlling the target system to complete a target task;
and calibrating the label for the resource file called by the target system in the process of completing the target task in the resource file library of the target system to obtain the calibrated label resource file set.
In an exemplary embodiment of the disclosure, the determining available resource files from the set of pre-deleted resource files includes:
acquiring first operation efficiency when the target system calls the resource files in the calibration label resource file set to complete a target task;
acquiring a pre-deleted resource file in the pre-deleted resource file set, wherein the pre-deleted resource file is used for replacing a target calibration label resource file in the calibration label resource file set, so as to obtain a backup resource file;
after the backup resource file is used for replacing the target calibration label resource file corresponding to the backup resource file, acquiring second operation efficiency of the target system for calling the backup resource file to complete the target task;
and when the first operating efficiency is smaller than the second operating efficiency, judging that the backup resource file is an available resource file.
In an exemplary embodiment of the present disclosure, the obtaining of the pre-deleted resource file in the pre-deleted resource file set used for replacing the target tagged resource file in the tagged resource file set to obtain the backup resource file includes:
acquiring the file name of each pre-deleted resource file;
acquiring the file name of each target calibration label resource file;
and comparing the file name of each pre-deleted resource file with the file name of each target calibration label resource file in sequence to obtain pre-deleted resource files containing the file names of the target calibration label resource files in the pre-deleted resource file set, wherein the pre-deleted resource files are used as the backup resource files.
In an exemplary embodiment of the present disclosure, the obtaining of the pre-deleted resource file in the pre-deleted resource file set used for replacing the target tagged resource file in the tagged resource file set to obtain the backup resource file includes:
acquiring a keyword of each pre-deleted resource file;
obtaining keywords of each target calibration label resource file;
comparing the keywords of the pre-deleted resource files with the keywords of the target calibration label resource files in sequence;
and when the keywords of the pre-deleted resource file are consistent with the keywords of the target calibration label resource file, judging that the pre-deleted resource file is a pre-deleted resource file for replacing the target calibration label resource file.
In an exemplary embodiment of the present disclosure, after replacing the target calibration label resource file corresponding to the backup resource file with the backup resource file, obtaining a second operating efficiency of the target system calling the backup resource file to complete the target task includes:
replacing the target calibration label resource file corresponding to the backup resource file with the backup resource file;
replacing the reference file name of the target calibration label resource file in the system code of the target system by the file name of the backup resource file;
and acquiring second operation efficiency of the target system for calling the backup resource file to complete the target task.
In an exemplary embodiment of the disclosure, the determining available resource files from the set of pre-deleted resource files includes:
classifying all the pre-deleted resource files in the pre-deleted resource file set according to file attributes to obtain pre-deleted resource file subsets of multiple categories;
determining available resource files from the pre-deleted resource file subset for each category, respectively.
In an exemplary embodiment of the present disclosure, the method further comprises:
adding a label to a system code of a target system at a position for calling a resource file reference code in the running process of the target system;
and acquiring the reference code without the added label in the system code of the target system, and deleting the reference code as useless reference.
According to an aspect of the present disclosure, there is provided an apparatus for automatically deleting a useless resource, including:
the calibration module is used for calibrating the labels for the resource files called from the resource file library of the target system in the running process of the target system to obtain a calibrated label resource file set;
the acquisition module is used for acquiring other resource files in the resource file library except the calibrated label resource file set to obtain a pre-deleted resource file set;
a determining module, configured to determine available resource files from the set of pre-deleted resource files;
and the deleting module is used for determining other resource files except the available resource files in the pre-deleted resource file set as useless resources and deleting the useless resources.
According to an aspect of the present disclosure, there is provided a computer-readable storage medium having stored thereon an automatic garbage removal program, wherein the automatic garbage removal program implements any one of the above methods when executed by a processor.
According to an aspect of the present disclosure, there is provided an electronic apparatus, comprising:
a processor; and
a memory for storing an automatic delete program of a garbage resource of the processor; wherein the processor is configured to perform any of the methods described above via execution of an automatic delete program of the garbage resource.
The invention discloses a method and a device for automatically deleting useless resources, firstly, in the running process of a target system, a resource file called in a resource file library of the target system is marked with a label to obtain a marked resource file set; by marking the resource files called by the system in the operation process with labels, the resource files which are absolutely needed to be called for realizing the operation of the system, namely the necessary resource files, can be accurately judged, so that the deletion of the resource files in the subsequent steps can be effectively ensured without adverse effect on the operation of the system, and the deletion accuracy is ensured. Then, acquiring other resource files in the resource file library except the calibrated label resource file set to obtain a pre-deleted resource file set; the resource files except the calibrated label resource file set are the resource files which can not be called in the system operation process, and the resource files serving as the pre-deleted resource files can be used for further judging the resource files with potential functions in the subsequent steps, so that the stability of the system after the useless resources are deleted is effectively ensured. Then, determining available resource files from the set of pre-deleted resource files; the resource files in the resource file set are deleted in advance, although the system can not be called in normal operation, backup or preset resource files, namely available resource files, exist for ensuring the future performance of the system, and the future performance of the system after useless resources are deleted in the subsequent steps can be effectively ensured by acquiring the available resource files. Determining other resource files except the available resource files in the pre-deleted resource file set as useless resources, and deleting the useless resources; therefore, the method can effectively ensure the accuracy of deleting the useless resources to a certain extent and ensure the future performance of the system at the same time.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure. It is to be understood that the drawings in the following description are merely exemplary of the disclosure, and that other drawings may be derived from those drawings by one of ordinary skill in the art without the exercise of inventive faculty.
Fig. 1 schematically shows a flow chart of a method for automatic deletion of a useless resource.
Fig. 2 schematically shows an application scenario example of an automatic deletion method of a useless resource.
Fig. 3 schematically illustrates a flow chart of a method of determining available resource files.
Fig. 4 is a block diagram schematically showing an automatic deleting apparatus of a useless resource.
Fig. 5 schematically shows an example block diagram of an electronic device for implementing the above-described automatic deletion method of a useless resource.
Fig. 6 schematically shows a computer-readable storage medium for implementing the above-described automatic deletion method of a useless resource.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and the like. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repetitive description will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
In the present exemplary embodiment, an automatic useless resource deleting method is first provided, and the automatic useless resource deleting method may be executed by a server, a server cluster, a cloud server, or the like. Referring to fig. 1, the automatic deleting method of the useless resources may include the steps of:
step S110, in the running process of a target system, calibrating labels for the called resource files in a resource file library of the target system to obtain a calibrated label resource file set;
step S120, acquiring other resource files in the resource file library except the calibrated label resource file set to obtain a pre-deleted resource file set;
step S130, determining available resource files from the pre-deleted resource file set;
step S140, determining other resource files except the available resource files in the pre-deleted resource file set as useless resources, and deleting the useless resources.
In the method for automatically deleting useless resources, firstly, in the running process of a target system, a label is calibrated for a resource file called in a resource file library of the target system to obtain a labeled resource file set; by marking the resource files called by the system in the operation process with labels, the resource files which are absolutely needed to be called for realizing the operation of the system, namely the necessary resource files, can be accurately judged, so that the deletion of the resource files in the subsequent steps can be effectively ensured without adverse effect on the operation of the system, and the deletion accuracy is ensured. Then, acquiring other resource files in the resource file library except the calibrated label resource file set to obtain a pre-deleted resource file set; the resource files except the calibrated label resource file set are the resource files which can not be called in the system operation process, and the resource files serving as the pre-deleted resource files can be used for further judging the resource files with potential functions in the subsequent steps, so that the stability of the system after the useless resources are deleted is effectively ensured. Then, determining available resource files from the set of pre-deleted resource files; the resource files in the resource file set are deleted in advance, although the system can not be called in normal operation, backup or preset resource files, namely available resource files, exist for ensuring the future performance of the system, and the future performance of the system after useless resources are deleted in the subsequent steps can be effectively ensured by acquiring the available resource files. Determining other resource files except the available resource files in the pre-deleted resource file set as useless resources, and deleting the useless resources; therefore, the method can effectively ensure the accuracy of deleting the useless resources to a certain extent and ensure the future performance of the system at the same time.
Hereinafter, each step in the above-described automatic useless resource deletion method in the present exemplary embodiment will be explained and explained in detail with reference to the drawings.
In step S110, in the running process of the target system, a label is calibrated for the resource file called in the resource file library of the target system, so as to obtain a labeled resource file set.
In the embodiment of this example, referring to fig. 2, after receiving a request for deleting useless resources from a target system sent by a terminal device 202, a server 201 marks a resource file called in an operation process of the target system in a resource file library of the target system by monitoring the operation of the target system, so that necessary resource files of the system in the resource file library of the target system can be accurately marked, and further, resource files that are insufficient in a normal operation process of other systems, that is, resource files to which no label is added, can be accurately determined. The server 201 may be any terminal having program instructions executed thereon, such as a mobile phone, a computer, etc.; the terminal device 202 may be any terminal having an application executing function, such as a mobile phone, a computer, and the like.
The system realizes the smooth running of the whole running process by continuously calling the resource files of the system in the running process, and the resource files called by the system in the running process of the system are marked by monitoring the running of the system, so that the resource files can be accurately judged, and the absolute calling of the running of the system is realized.
In an implementation manner of this example, in an operation process of a target system, tagging a resource file called in a resource file library of the target system to obtain a tagged resource file set includes:
controlling the target system to complete a target task;
and calibrating the label for the resource file called by the target system in the target system resource file library in the target system task completing process to obtain a calibrated label resource file set.
The control of the target system to complete the target task is to control the target system to complete the calling of all basic commands, that is, the target system can realize all functions required to be realized by system design, and the completion of the operation of the system is judged, so that the completeness of the system function can be ensured; then, in a resource file library of the target system, calibrating a label for a resource file called in the process that the target system completes the target task; the resource files required by the complete functions of the application system can be effectively ensured to be tagged. And the accuracy of deleting the useless resources is ensured.
In step S120, other resource files in the resource file library except the calibrated tagged resource file set are obtained, so as to obtain a pre-deleted resource file set.
In the embodiment of the present example, the resource files other than the resource file with the tag removed in the resource file of the whole system, that is, the system can complete the whole running process without calling these files, so that these resource files other than the resource file with the tag removed can be deleted as useless resources to be prepared, but in order to ensure higher deletion accuracy, these resource files are first used as pre-deleted resource files, and in the following steps, available resources that may be used are further excluded, so that the deletion accuracy can be effectively ensured, and the stability of the application system after the useless resources are deleted can be effectively ensured.
In step S130, an available resource file is determined from the set of pre-deleted resource files.
In the embodiment of the present example, the pre-deleted resource file is a resource file to be deleted as a useless resource, but in order to ensure higher deletion accuracy, that is, although some resource files are determined as pre-deleted resource files, these resource files may be available later or cannot be determined by whether to be called when determining the pre-deleted resource file, so that available resource files that may be used need to be further excluded, which may effectively ensure the deletion accuracy, and at the same time, the available resource files may be acquired to effectively ensure the future performance of the system after deleting the useless resource in the subsequent step.
In an implementation manner of this example, referring to fig. 3, determining an available resource file from the set of pre-deleted resource files includes the following steps:
step S310, acquiring a first operating efficiency when the target system calls the target calibration label resource files in the calibration label resource file set to complete target tasks;
step S320, acquiring the pre-deleted resource files in the pre-deleted resource file set for replacing the target calibration label resource files in the calibration label resource file set to obtain backup resource files;
step S330, after replacing the target calibration label resource file corresponding to the backup resource file with the backup resource file, obtaining a second operation efficiency of the target system for calling the backup resource file to complete the target task;
step S340, when the first operating efficiency is smaller than the second operating efficiency, determining that the backup resource file is an available resource file.
Generally, in order to improve the operating efficiency of a system, resource files capable of improving the operating efficiency are developed, and the resource files are called at a critical moment by discarding a part of functions to effectively improve the operating efficiency. Therefore, the resources are not called at the beginning, so that the resources can be directly judged as the pre-deleted resource files, the resource files are usually directly deleted in the existing method and are reestablished when needed later, the available resource files can be accurately and effectively monitored through the method in the example, and the subsequent workload is reduced.
In an embodiment of this example, obtaining the pre-deleted resource file in the pre-deleted resource file set for replacing the target tagged resource file in the tagged resource file set to obtain the backup resource file includes:
acquiring the file name of each pre-deleted resource file;
acquiring the file name of each target calibration label resource file;
and comparing the file name of each pre-deleted resource file with the file name of each target calibration label resource file in sequence to obtain pre-deleted resource files containing the file names of the target calibration label resource files in the pre-deleted resource file set, wherein the pre-deleted resource files are used as the backup resource files.
In general, when a resource file is backed up, the file names of the backup resource files are named in a series manner according to the file names of the source resource files corresponding to the backup resource files, for example, a file 1 is named as "a-B", and a series file 2 is named as "a-B-2". Comparing the file name of each pre-deleted resource file with the file name of each target calibration label resource file in sequence, and by comparing the file names, accurately judging the pre-deleted resource files in the pre-deleted resource file set, which contain the file names of the target calibration label resource files, so as to obtain the pre-deleted resource files in the pre-deleted resource file set, which are used for replacing the target calibration label resource files in the calibration label resource file set, as backup resource files, and then judging whether the pre-deleted resource files are available resources.
In an embodiment of this example, obtaining the pre-deleted resource file in the pre-deleted resource file set for replacing the target tagged resource file in the tagged resource file set to obtain the backup resource file includes:
acquiring a keyword of each pre-deleted resource file;
obtaining keywords of each target calibration label resource file;
comparing the keywords of the pre-deleted resource files with the keywords of the target calibration label resource files in sequence;
and when the keywords of the pre-deleted resource file are consistent with the keywords of the target calibration label resource file, judging that the pre-deleted resource file is a pre-deleted resource file for replacing the target calibration label resource file.
Usually, some standby resource files are established in the system resource files, and after the used resource files are damaged, automatic replacement is carried out, so that the operation of the system is effectively guaranteed, and the resource files are usually determined as one part of the system resource files when being judged to be pre-deleted in the previous step; however, the files are usually resources which are necessary to be redundant, that is, files which cannot be deleted are usually not called, and are saved in file names different from file names in system resource files, and the resource files can be accurately matched through special keywords of the resource files, so that the resource files are determined to be available resources, and the accuracy and the reliability of deletion are effectively guaranteed. Acquiring keywords of each pre-deleted resource file; the obtaining of the keywords of the target labeled resource files may be, for example, obtaining content in a text form in the resource files, then performing word segmentation, and further counting words with the largest occurrence number as the keywords of each resource file.
In an embodiment of this example, after replacing the target calibration label resource file corresponding to the backup resource file with the backup resource file, obtaining a second operating efficiency at which the target system calls the backup resource file to complete the target task includes:
replacing the target calibration label resource file corresponding to the backup resource file with the backup resource file;
replacing the reference file name of the target calibration label resource file in the system code of the target system by the file name of the backup resource file;
and acquiring second operation efficiency of the target system for calling the backup resource file to complete the target task.
When the application system calls a resource file, the calling is realized by using a reference code in the system code to reference the file name of the target calibration label resource file. Replacing the target calibration label resource file corresponding to the backup resource file with the backup resource file; and then, replacing the reference file name of the target calibration label resource file in the system code of the target system by using the file name of the backup resource file, so that the calling of the backup resource file in the operation process of the application system can be ensured, and the second operation efficiency of the target system for calling the backup resource file to complete the target task can be accurately obtained.
In one embodiment of this example, determining available resource files from the set of pre-deleted resource files comprises:
classifying the pre-deleted resource files in the pre-deleted resource file set according to all file attributes;
available resource files are determined from the pre-deleted resource files of each category respectively.
The calling mode and the use of each type of resource file are different, and how to determine whether each type of resource file is available, namely whether the resource file is an available resource file, the difference can be realized according to the calling mode, the pre-deleted resource files are classified, the available resource files can be determined according to the type of the resource files, and the judgment accuracy of the available resource files is effectively improved. The classification according to the file attribute may be that the resource file generally includes resources of script file type, such as html and js files; cascading style sheet type files, such as css style; the files of the picture type, such as jpg, are classified into files of corresponding categories. Determining available resource files according to the types of the resource files, for example, the resource files with picture attributes are usually relatively disordered, and when the called resource files are eliminated in the previous step to obtain the pre-deleted resource files, some pictures which are not called are judged as the pre-deleted resource files at the same time, usually, pictures without a standard naming format are unnecessary, and the pictures are not greatly influenced after deletion, but pictures named by the standard format, for example, < imgart >, < src >, <./. jpgjpgje >, < width:450 px; height:300 px; ">", which shows that the pictures have the calling probability, namely the pictures which are not required to be called in some special links can be called after the pictures are deleted, so that the resource files with the standard picture names are obtained by matching the file names of the resource files in the third class of resource files by using the standard picture name template, and then the resource files with the standard picture names are determined as available resource files; therefore, the accuracy of deleting the resource file can be effectively improved, and the error rate is reduced.
In step S140, the other resource files except the available resource file in the set of pre-deleted resource files are determined as useless resources, and are deleted.
In the embodiment of the example, the pre-deleted resource files are collected, other resource files except the available resource files are judged to be useless resources, the useless resources are deleted, and the available resources are reserved, so that the accuracy of deleting the useless resources can be effectively ensured to a certain extent, and the future performance of the system can be ensured.
Further, the method further comprises:
adding a label to a reference code of a calling resource file in the system code of a target system in the running process of the target system;
and acquiring the reference code without the added label in the system code of the target system, and deleting the reference code as useless reference.
The application system usually has a lot of useless reference codes after being upgraded and changed for many times to become redundant codes of the system, labels are added to the reference codes of calling resource files in the running process of the target system in the system codes of the target system, and then the reference codes in the system can be accurately judged to be useless, and then the reference codes are deleted, so that the useless resource files can be deleted and the useless redundant codes can be accurately deleted.
The disclosure also provides an automatic deleting device of the useless resources. Referring to fig. 4, the apparatus for automatically deleting useless resources may include a calibration module 410, an obtaining module 420, a determining module 430, and a deleting module 440. Wherein:
the calibration module 410 may be configured to calibrate a tag for a resource file called in a resource file library of a target system in an operation process of the target system, so as to obtain a resource file set of calibrated tags;
the obtaining module 420 may be configured to obtain other resource files in the resource file library except for the calibrated tagged resource file set, so as to obtain a pre-deleted resource file set;
the determining module 430 may be configured to determine available resource files from the set of pre-deleted resource files;
the deleting module 440 may be configured to determine resource files other than the available resource file in the set of pre-deleted resource files as useless resources, and delete the useless resources.
The specific details of each module in the automatic deleting device for useless resources have been described in detail in the corresponding automatic deleting method for useless resources, and therefore are not described herein again.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Moreover, although the steps of the methods of the present disclosure are depicted in the drawings in a particular order, this does not require or imply that the steps must be performed in this particular order, or that all of the depicted steps must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions, etc.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or program product. Thus, various aspects of the invention may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
An electronic device 500 according to this embodiment of the invention is described below with reference to fig. 5. The electronic device 500 shown in fig. 5 is only an example and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 5, the electronic device 500 is embodied in the form of a general purpose computing device. The components of the electronic device 500 may include, but are not limited to: the at least one processing unit 510, the at least one memory unit 520, and a bus 530 that couples various system components including the memory unit 520 and the processing unit 510.
Wherein the storage unit stores program code that is executable by the processing unit 510 to cause the processing unit 510 to perform steps according to various exemplary embodiments of the present invention as described in the above section "exemplary methods" of the present specification. For example, the processing unit 510 may execute step S110 as shown in fig. 1: in the running process of a target system, calibrating labels for the called resource files in a resource file library of the target system to obtain a calibrated label resource file set; s120: acquiring other resource files in the resource file library except the calibrated label resource file set to obtain a pre-deleted resource file set; step S130: determining available resource files from the set of pre-deleted resource files; step S140: and determining other resource files except the available resource files in the pre-deleted resource file set as useless resources, and deleting the useless resources.
The memory unit 520 may include a readable medium in the form of a volatile memory unit, such as a random access memory unit (RAM)5201 and/or a cache memory unit 5202, and may further include a read only memory unit (ROM) 5203.
Storage unit 520 may also include a program/utility 5204 having a set (at least one) of program modules 5205, such program modules 5205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 530 may be one or more of any of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 500 may also communicate with one or more external devices 700 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a client to interact with the electronic device 500, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 500 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 550. Also, the electronic device 500 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via the network adapter 560. As shown, the network adapter 560 communicates with the other modules of the electronic device 500 over the bus 530. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 500, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
In an exemplary embodiment of the present disclosure, there is also provided a computer-readable storage medium having stored thereon a program product capable of implementing the above-described method of the present specification. In some possible embodiments, aspects of the invention may also be implemented in the form of a program product comprising program code means for causing a terminal device to carry out the steps according to various exemplary embodiments of the invention described in the above section "exemplary methods" of the present description, when said program product is run on the terminal device.
Referring to fig. 6, a program product 600 for implementing the above method according to an embodiment of the present invention is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited in this regard and, in the present document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the client computing device, partly on the client device, as a stand-alone software package, partly on the client computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the client computing device over any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., over the internet using an internet service provider).
Furthermore, the above-described figures are merely schematic illustrations of processes involved in methods according to exemplary embodiments of the invention, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

Claims (10)

1. A method for automatically deleting useless resources, comprising the following steps:
in the running process of a target system, calibrating labels for the called resource files in a resource file library of the target system to obtain a calibrated label resource file set;
acquiring other resource files in the resource file library except the calibrated label resource file set to obtain a pre-deleted resource file set;
determining available resource files from the set of pre-deleted resource files;
and determining other resource files except the available resource files in the pre-deleted resource file set as useless resources, and deleting the useless resources.
2. The method according to claim 1, wherein in the running process of the target system, tagging the resource file called in the resource file library of the target system to obtain a tagged resource file set, includes:
controlling the target system to complete a target task;
and calibrating the label for the resource file called by the target system in the process of completing the target task in the resource file library of the target system to obtain the calibrated label resource file set.
3. The method of claim 1, wherein determining available resource files from the set of pre-deleted resource files comprises:
acquiring first operation efficiency when the target system calls the resource files in the calibration label resource file set to complete a target task;
acquiring a pre-deleted resource file in the pre-deleted resource file set, wherein the pre-deleted resource file is used for replacing a target calibration label resource file in the calibration label resource file set, so as to obtain a backup resource file;
after the backup resource file is used for replacing the target calibration label resource file corresponding to the backup resource file, acquiring second operation efficiency of the target system for calling the backup resource file to complete the target task;
and when the first operating efficiency is smaller than the second operating efficiency, judging that the backup resource file is an available resource file.
4. The method according to claim 3, wherein the obtaining of the pre-deleted resource file in the pre-deleted resource file set used for replacing the target tagged resource file in the tagged resource file set to obtain the backup resource file comprises:
acquiring the file name of each pre-deleted resource file;
acquiring the file name of each target calibration label resource file;
and comparing the file name of each pre-deleted resource file with the file name of each target calibration label resource file in sequence to obtain pre-deleted resource files containing the file names of the target calibration label resource files in the pre-deleted resource file set, wherein the pre-deleted resource files are used as the backup resource files.
5. The method according to claim 3, wherein the obtaining of the pre-deleted resource file in the pre-deleted resource file set used for replacing the target tagged resource file in the tagged resource file set to obtain the backup resource file comprises:
acquiring a keyword of each pre-deleted resource file;
obtaining keywords of each target calibration label resource file;
comparing the keywords of the pre-deleted resource files with the keywords of the target calibration label resource files in sequence;
and when the keywords of the pre-deleted resource file are consistent with the keywords of the target calibration label resource file, judging that the pre-deleted resource file is a pre-deleted resource file for replacing the target calibration label resource file.
6. The method according to claim 3, wherein obtaining a second operating efficiency of the target system calling the backup resource file to complete the target task after replacing the target calibration label resource file corresponding to the backup resource file with the backup resource file comprises:
replacing the target calibration label resource file corresponding to the backup resource file with the backup resource file;
replacing the reference file name of the target calibration label resource file in the system code of the target system by the file name of the backup resource file;
and acquiring second operation efficiency of the target system for calling the backup resource file to complete the target task.
7. The method of claim 1, further comprising:
adding a label to a system code of a target system at a position for calling a resource file reference code in the running process of the target system;
and acquiring the reference code without the added label in the system code of the target system, and deleting the reference code as useless reference.
8. An apparatus for automatic deletion of a useless resource, comprising:
the calibration module is used for calibrating the labels for the resource files called from the resource file library of the target system in the running process of the target system to obtain a calibrated label resource file set;
the acquisition module is used for acquiring other resource files in the resource file library except the calibrated label resource file set to obtain a pre-deleted resource file set;
a determining module, configured to determine available resource files from the set of pre-deleted resource files;
and the deleting module is used for determining other resource files except the available resource files in the pre-deleted resource file set as useless resources and deleting the useless resources.
9. A computer-readable storage medium on which an automatic garbage removal program is stored, wherein the automatic garbage removal program implements the method of any one of claims 1 to 7 when executed by a processor.
10. An electronic device, comprising:
a processor; and
a memory for storing an automatic delete program of a garbage resource of the processor; wherein the processor is configured to perform the method of any of claims 1-7 via execution of an automatic delete program of the garbage resource.
CN201910822804.2A 2019-09-02 2019-09-02 Method and device for automatically deleting useless resources, storage medium and electronic equipment Pending CN110716804A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910822804.2A CN110716804A (en) 2019-09-02 2019-09-02 Method and device for automatically deleting useless resources, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910822804.2A CN110716804A (en) 2019-09-02 2019-09-02 Method and device for automatically deleting useless resources, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN110716804A true CN110716804A (en) 2020-01-21

Family

ID=69209612

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910822804.2A Pending CN110716804A (en) 2019-09-02 2019-09-02 Method and device for automatically deleting useless resources, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN110716804A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111459887A (en) * 2020-03-30 2020-07-28 北京百度网讯科技有限公司 Resource screening method and device, electronic equipment and storage medium
CN111580824A (en) * 2020-03-30 2020-08-25 北京达佳互联信息技术有限公司 Program optimization method, device and storage medium
CN111813749A (en) * 2020-08-21 2020-10-23 网易(杭州)网络有限公司 File filtering method and device, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130275593A1 (en) * 2012-04-12 2013-10-17 Ariel Tseitlin Method and system for reclaiming unused resources in a networked application environment
CN106599151A (en) * 2016-12-07 2017-04-26 Tcl集团股份有限公司 Method and system for parallel cleaning of Android engineering useless resources
CN108984207A (en) * 2018-06-14 2018-12-11 珠海金山网络游戏科技有限公司 A kind of method of installation kit invalid resource file detection

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130275593A1 (en) * 2012-04-12 2013-10-17 Ariel Tseitlin Method and system for reclaiming unused resources in a networked application environment
CN106599151A (en) * 2016-12-07 2017-04-26 Tcl集团股份有限公司 Method and system for parallel cleaning of Android engineering useless resources
CN108984207A (en) * 2018-06-14 2018-12-11 珠海金山网络游戏科技有限公司 A kind of method of installation kit invalid resource file detection

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111459887A (en) * 2020-03-30 2020-07-28 北京百度网讯科技有限公司 Resource screening method and device, electronic equipment and storage medium
CN111580824A (en) * 2020-03-30 2020-08-25 北京达佳互联信息技术有限公司 Program optimization method, device and storage medium
CN111459887B (en) * 2020-03-30 2023-08-11 北京百度网讯科技有限公司 Resource screening method and device, electronic equipment and storage medium
CN111580824B (en) * 2020-03-30 2024-05-07 北京达佳互联信息技术有限公司 Program optimization method, device and storage medium
CN111813749A (en) * 2020-08-21 2020-10-23 网易(杭州)网络有限公司 File filtering method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
US10621212B2 (en) Language tag management on international data storage
CN110955428A (en) Page display method and device, electronic equipment and medium
CN110716804A (en) Method and device for automatically deleting useless resources, storage medium and electronic equipment
CN112769802B (en) Access verification method and device based on server, electronic equipment and storage medium
CN110119386B (en) Data processing method, data processing apparatus, medium, and computing device
CN110990346A (en) File data processing method, device, equipment and storage medium based on block chain
US20210026756A1 (en) Deriving software application dependency trees for white-box testing
CN109684309A (en) A kind of quality of data evaluating method and device, computer equipment and storage medium
CN110659210A (en) Information acquisition method and device, electronic equipment and storage medium
CN112988583A (en) Method and device for testing syntax compatibility of database
CN112416957A (en) Data increment updating method and device based on data model layer and computer equipment
CN114003269A (en) Component processing method and device, electronic equipment and storage medium
CN111104125B (en) Intelligent integrated version management method, device, medium and electronic equipment
CN112632425A (en) Method, device, equipment and storage medium for generating offline resource file
CN115080114B (en) Application program transplanting processing method, device and medium
CN110716763A (en) Web container automatic optimization method and device, storage medium and electronic equipment
CN115687075A (en) Error correction method and device for page test script
CN108628909B (en) Information pushing method and device
CN110795259A (en) Method and device for analyzing application collapse
CN114189750A (en) Playing method of multi-format file and related device
CN108415814B (en) Method for automatically recording field change, application server and computer readable storage medium
CN115421785B (en) Method, device and medium for transplanting application program
CN113485688B (en) Code completion method and device, storage medium and electronic equipment
CN111638903B (en) Method and device for generating difference information of different software versions
CN112947846B (en) Batch processing task execution method and device of object storage system and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20200121

WD01 Invention patent application deemed withdrawn after publication