CN106599151A - Method and system for parallel cleaning of Android engineering useless resources - Google Patents

Method and system for parallel cleaning of Android engineering useless resources Download PDF

Info

Publication number
CN106599151A
CN106599151A CN201611115847.XA CN201611115847A CN106599151A CN 106599151 A CN106599151 A CN 106599151A CN 201611115847 A CN201611115847 A CN 201611115847A CN 106599151 A CN106599151 A CN 106599151A
Authority
CN
China
Prior art keywords
file
resource
resource file
code
waste resources
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
CN201611115847.XA
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.)
TCL Corp
Original Assignee
TCL Corp
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 TCL Corp filed Critical TCL Corp
Priority to CN201611115847.XA priority Critical patent/CN106599151A/en
Publication of CN106599151A publication Critical patent/CN106599151A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/162Delete operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • 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/5061Partitioning or combining of resources

Landscapes

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

Abstract

The invention discloses a method and system for parallel cleaning of Android engineering useless resources. The method for parallel cleaning of Android engineering useless resources comprises the following steps: detecting whether the resource file has a reference relationship in the code file or other resource files; if the resource file has a reference relationship in the code file or other resource files, the resource file is judged to be a useful resource file, that is to say, the resource file is a reference resource file; on the contrary, if the resource file does not have a reference relationship in the code file or other resource files, the resource file is judged to be a garbage file, and then the garbage file is deleted. By means of the invention, the garbage resource files of the application in the Android system can be deleted quickly and effectively, and the volume of the APK is reduced, therefore, the memory occupation of the APK in the Android system is reduced, and meanwhile, the starting speed of the application and the development efficiency of the application is improved.

Description

A kind of method and system of the useless resource of Android engineerings cleaning parallel
Technical field
The present invention relates to resource cleaning field, more particularly to the method that a kind of useless resource of Android engineerings is cleared up parallel And system.
Background technology
With the popular and popularization of Android development platforms, increasing programmer puts into opening for application program Send out in spring tide, how to develop that One function is complete, and the APK for occupying little space is the target that program development is being chased always.
In android system process of application development, resource file typically can be placed into different res by programmer Under catalogue, the resource file category is divided includes animation resource, color resource, picture resource, layout resource and character string Resource etc., these resource files are located at different file directorys, and these resource majorities are all the useless rubbish that program is not used Rubbish resource.These useless waste resources do not only take up the volume of APK, and are difficult investigation out, which results in each iteration of APK Volume will be increased when exploitation, if it is desired to the very big manpower of flower again is deleted, to the very big puzzlement that program development brings.
Therefore, prior art has yet to be improved and developed.
The content of the invention
In view of above-mentioned the deficiencies in the prior art, it is an object of the invention to provide a kind of useless resource of Android engineerings is simultaneously The method and system of row cleaning, it is intended to solve existing Android platform useless resource row during development and application program Except difficulty, cause the increase of APK volumes, toggle speed slow, the low problem of application development efficiency.
Technical scheme is as follows:
A kind of method of the useless resource of Android engineerings cleaning parallel, wherein, including step:
Resource file the name translation by the resource file in A, scanning android system application program under res catalogues For string format, and build resource file list;
Code file in B, scanning android system application program under src catalogues, and build code reference set;
C, multiple threads are created according to configuration file, the code file that the code is quoted in set is averagely allocated to described many Individual thread;
D, the plurality of thread of startup, read the character string in each code file of distribution by each thread, while traversal Resource file title in the resource file list;
E, the detection resource file title are deposited when the resource file title is detected with the presence or absence of in the code file When being in the code file, then the resource file is judged as resource file is quoted;When detecting the resource file name When title is not present in the code file, then resource file described in preliminary judgement is waste resources file;
F, the waste resources file to the reference resource file and preliminary judgement carry out the detection that interdepends, according to testing result Final waste resources file is filtered out from the waste resources file of preliminary judgement, and final waste resources file is deleted Remove.
It is preferred that the method that the described useless resource of Android engineerings is cleared up parallel, wherein, step A is specifically wrapped Include:
Resource file in A1, scanning android system application program under res catalogues, and build resource file list;
A2, according to default transformational rule, be the unique character of resource that code is quoted by the name translation in the resource file String format.
It is preferred that the method that the described useless resource of Android engineerings is cleared up parallel, wherein, step C is specifically wrapped Include:
C1, multiple threads are created according to configuration file, and the plurality of thread is arranged in thread pool;
C2, the quantity for counting code file in the code reference set, calculate the code file of each thread needs scanning Number, the code file is evenly distributed in the plurality of thread.
It is preferred that the method that the described useless resource of Android engineerings is cleared up parallel, wherein, step E also includes:
E1, the plurality of thread of startup, when the resource file is judged as resource file is quoted by a wherein thread, then will The reference resource file is rejected from the resource file list, and updates resource file list;
The remaining thread of E2, notice updates resource file list, and to the resource file in the resource file list after the renewal Detected.
It is preferred that the method that the described useless resource of Android engineerings is cleared up parallel, wherein, step F is specifically wrapped Include:
F1, the character string read in the reference resource file, travel through the title of the waste resources file of preliminary judgement, and detection is just The title of the waste resources file that step judges is with the presence or absence of in the reference resource file;
F2, when detect the title of waste resources file of preliminary judgement be not present in it is described reference resource file in when, then sentence The waste resources file for determining preliminary judgement is final waste resources file and deletes the final waste resources file;
F3, when detecting the title of waste resources file of preliminary judgement and being present in the reference resource file, then will just The waste resources file that step judges is judged to quote resource file, and retains.
A kind of system of the useless resource of Android engineerings cleaning parallel, wherein, including:
First builds module, for scanning resource file in android system application program under res catalogues and by the resource The name translation of file is string format, and builds resource file list;
Second builds module, for scanning the code file in android system application program under src catalogues, and builds code Quote set;
Configuration module, for creating multiple threads according to configuration file, the code file code quoted in set is average Distribute to the plurality of thread;
Starting module, for starting the plurality of thread, and reads the word in each code file of distribution by each thread Symbol string, while the resource file title in the traversal resource file list;
First detection module, for detecting the resource file title with the presence or absence of in the code file, when detecting When stating resource file title and being present in the code file, then the resource file is judged as resource file is quoted;Work as detection When being not present in the code file to the resource file title, then resource file described in preliminary judgement is waste resources text Part;
Second detection module, for carrying out the inspection that interdepends to the waste resources file for quoting resource file and preliminary judgement Survey, final waste resources file is filtered out from the waste resources file of preliminary judgement according to testing result, and will be final Waste resources file is deleted.
It is preferred that the system that the described useless resource of Android engineerings is cleared up parallel, wherein, described first builds module Including:
First construction unit, for scanning the resource file in android system application program under res catalogues, and builds resource Listed files;
Converting unit, for according to default transformational rule, by the money that the name translation in the resource file is code reference Source unique string form.
It is preferred that the system that the described useless resource of Android engineerings is cleared up parallel, wherein, the configuration module includes:
Creating unit, for creating multiple threads according to configuration file, and the plurality of thread is arranged in thread pool;
Allocation unit, quotes the quantity of code file in set for counting the code, and calculating each thread needs scanning The number of code file, the code file is evenly distributed in the plurality of thread.
It is preferred that the system that the described useless resource of Android engineerings is cleared up parallel, wherein, the first detection module Also include:
Culling unit, for starting the plurality of thread, when by a wherein thread judge the resource file as quote resource During file, then the reference resource file is rejected from the resource file list, and update resource file list;
Notification unit, for notifying that remaining thread updates resource file list, and in the resource file list after the renewal Resource file detected.
It is preferred that the system that the described useless resource of Android engineerings is cleared up parallel, wherein, second detection module Including:
Detector unit, for reading the character string quoted in resource file, travels through the waste resources file of preliminary judgement Title, detects the title of waste resources file of preliminary judgement with the presence or absence of in the reference resource file;
Unit is deleted, for the reference resource file being not present in when the title of the waste resources file for detecting preliminary judgement When middle, then the waste resources file of preliminary judgement is judged as final waste resources file and delete the final waste resources File;
Stick unit, for being present in the reference resource file when the title of the waste resources file for detecting preliminary judgement When, then the waste resources file of preliminary judgement is judged to quote resource file, and is retained.
Beneficial effect:The present invention provides a kind of Android engineerings method and system that useless resource is cleared up parallel, by this The waste resources file in android system application program can be fast and effeciently deleted in invention, reduce the volume of APK, so as to EMS memory occupations of the APK in android system is reduced, while improve the toggle speed and application program of application program Development efficiency.
Description of the drawings
Fig. 1 is the flow chart of the method preferred embodiment that a kind of useless resource of Android engineerings of the invention is cleared up parallel.
Fig. 2 is the structured flowchart of the system preferred embodiment that a kind of useless resource of Android engineerings of the invention is cleared up parallel.
Specific embodiment
The present invention provides a kind of Android engineerings method and system that useless resource is cleared up parallel, to make the mesh of the present invention , technical scheme and effect it is clearer, clear and definite, the present invention is described in more detail below.It should be appreciated that described herein Specific embodiment only to explain the present invention, be not intended to limit the present invention.
Fig. 1 is referred to, Fig. 1 is the method preferred embodiment that a kind of useless resource of Android engineerings of the invention is cleared up parallel Flow chart, as illustrated, which includes step:
The title of the resource file is simultaneously turned by resource file in S100, scanning android system application program under res catalogues String format is changed to, and builds resource file list;
Code file in S200, scanning android system application program under src catalogues, and build code reference set;
S300, multiple threads are created according to configuration file, the code is quoted into the code file in set and is averagely allocated to institute State multiple threads;
S400, the plurality of thread of startup, read the character string in each code file of distribution by each thread, while time The resource file title gone through in the resource file list;
S500, the resource file title is detected with the presence or absence of in the code file, when detecting the resource file name When title is present in the code file, then the resource file is judged as resource file is quoted;It is literary when the resource is detected When part title is not present in the code file, then resource file described in preliminary judgement is waste resources file;
S600, the waste resources file to the reference resource file and preliminary judgement carry out the detection that interdepends, according to detection As a result filter out final waste resources file from the waste resources file of preliminary judgement, and by final waste resources file Delete.
In the present invention, detect whether resource file is useless, whether its core is the detection resource file in generation There is adduction relationship in code file or other resource files, if resource file is present in code file or other resource files Adduction relationship, then judge that the resource file is useful resource file, that is, quote resource file.The present invention in order to accelerate detection The speed of useless resource in application program, using the method for multi-threaded parallel, i.e., multiple threads share a resource pool, by inspection Survey resource file in garbage files and be deleted, as far as possible reduce cycle detection number of times, so as to improve detection speed.It is logical The waste resources file that the present invention fast and effeciently can be deleted in android system application program is crossed, the volume of APK is reduced, So as to reduce EMS memory occupations of the APK in android system, while improve the toggle speed of application program and applying journey The development efficiency of sequence.
Specifically, step S100 is specifically included:
Resource file in S110, scanning android system application program under res catalogues, and build resource file list;
Specifically, by calling getFiles function recursive traversal res catalogues, all of resource file under res catalogues is obtained, Build resource file list ArrayList<File>, its code is as follows:
static void getFiles(String filePath,ArrayList<File> filelists){
File root = new File(filePath);
if (root != null) {
File[] files = root.listFiles();
if (files != null && files.length >0) {
for (File file:files) {
if (file.isDirectory()) {
getFiles(file.getAbsolutePath(),filelists);
}else {
filelists.add(file);
}
}
}
}
}
Realize building the resource file list of all of resource file under res catalogues by above-mentioned code.
S120, according to default transformational rule, by the name translation in the resource file be the resource quoted of code only One string format, which is realized especially by following code:
Specifically, the default transformational rule is as follows:
Filename res/anim/*.xml is converted to R.anim.* unique strings;
Filename res/color/*.xml is converted to R.color.* unique strings;
Filename res/drawable/*.xml is converted to R.drawable.* unique strings;
Filename res/layout/*.xml is converted to R.layout.* unique strings;
The * is specifically to sew filename without male offspring, for example, filename res/ layout/ activity_all_player.xml Become R.layout.activity_all_player after changing according to transformational rule.
In step S200, the code file in scanning android system application program under src catalogues, and build Code quotes set;
Specifically, again by getFiles function recursive traversal src catalogues are called, all code texts under src catalogues are obtained Part, builds code and quotes set ArrayList<File>, its code with build resource file list code it is identical, here is not Describe in detail again.
Further, step S300 of the present invention is specifically included:
S310, multiple threads are created according to configuration file, and the plurality of thread is arranged in thread pool;
S320, the quantity for counting code file in the code reference set, calculating each thread needs the code file of scanning Number, the code file is evenly distributed in the plurality of thread.
Specifically, according to configuration file, user configured maximum thread is obtained, is arranged in thread pool, according to most Big Thread Count and code quote the file number that set calculates each thread needs scanning, for example:File under src code directories 100 altogether, maximum thread 5, then it is 20 that each thread needs the file number of scanning, for example:1 scan code of thread The the 0th to the 19th file of set is quoted, 2 scan code of thread is quoted the 20th to the 39th file of set, counted by that analogy Calculate the 80-99 that 5 scan code of thread quotes set(The index of program is from 0 beginning).
Further, in step S400 and step S500, start the plurality of thread, read by each thread each Character string from the code file of distribution, while the resource file title in the traversal resource file list;Further, examine The resource file title is surveyed with the presence or absence of in the code file, when detect the resource file title be present in it is described When in code file, then the resource file is judged as resource file is quoted;Do not exist when the resource file title is detected When in the code file, then resource file described in preliminary judgement is waste resources file.
Specifically, the code file set of each thread scans oneself, for example, thread 1 obtains the 1st file, and reads Take the 1st file and by read Content Transformation be character string, implement code as follows:
String data =“@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
GlLog.d(TAG, "onCreate()----");
Log.i("costtime", "MainActivity onCreate:"+ System.currentTimeMill is());
setContentView(R.layout.activity_main);
mParentLayout = (TCLFloatFoucsLinearlayout) findViewById(R.id.main);
ShadeWaitDialog.getInstance().showWaitDialog(this);
mSettingsLayout = (LinearLayout) findViewById(R.id.settings);
mBlockViewPager = (ViewPager) findViewById(R.id.myViewpager);
mBlockViewPager.setFocusable(false);
mBlockViewPager.setPageMargin((int) getResources().getDimension(R.dimen.viewpager_margin));
mBlockViewPager.setOffscreenPageLimit(1);
mChannelsBeans = new ArrayList<ChannelsBean>();
ChannelsBean history = new ChannelsBean();
history.setType("1");
history.setChi_name(getString(R.string.watch_history));
mChannelsBeans.add(history);
mGlobalFocus = new GlobalFocus(this, R.id.main, new FocusChanger());
mGlobalFocus.setDurtion(500);“
Further, all of resource unique string in the thread traverses resource file list, for example(R.layout.activ ity_all_player), search whether resource file is cited in the code character string data.When the resource file quilt During reference, then the resource file is judged as resource file is quoted, be not cleaned object;When the resource file not by During reference, then resource file described in preliminary judgement is waste resources file.
Further, step S500 also includes:
S510, the plurality of thread of startup, when the resource file is judged as resource file is quoted by a wherein thread, then The reference resource file is rejected from the resource file list, and updates resource file list;
The remaining thread of S520, notice updates resource file list, and to the resource text in the resource file list after the renewal Part is detected.
Specifically, because each thread may detect the resource file being cited, if the inspection of sub-line journey After measuring reference resource file, the reference resource file will be rejected from resource file list, so as to change resource text Part list, and notify that other threads update newest resource file list so that resource file list quickly can restrain.
Further, step S600 is specifically included:
S610, the character string read in the reference resource file, travel through the title of the waste resources file of preliminary judgement, detection The title of the waste resources file of preliminary judgement is with the presence or absence of in the reference resource file;
S620, when detect the title of waste resources file of preliminary judgement be not present in it is described reference resource file in when, then The waste resources file of preliminary judgement is judged as final waste resources file and delete the final waste resources file;
S630, when detect the title of waste resources file of preliminary judgement be present in it is described reference resource file in when, then will The waste resources file of preliminary judgement is judged to quote resource file, and retains.
Specifically, under res file directorys, there is relation of interdependence between some resource files, it is therefore desirable to right The detection that interdepends is carried out between resource file, for example:In topology file under layout files, there is reference color literary Color resource under part folder;In needing to detect final the Resources list, if also exist by the reference of other resource files;Example Such as:The resource under the catalogues such as Drawable, Color is quoted in the presence of Layout resource file maximum probabilities;So needing traversal money Source list ArrayList<File>, file is opened, reading file character string is resData, whether checks character string resData Comprising the resource unique resource character string in the Resources list(Such as:R.color.red)If be cited, judge this resource as Resource is quoted, is not cleaned object;Secondary resource is weeded out from the Resources list;If be not cited, it is judged to Final waste resources, then call delete orders, deletes final garbage files one by one.
Based on said method, the present invention also provides the system that a kind of useless resource of Android engineerings is cleared up parallel, such as Fig. 2 It is shown, wherein, including:
First builds module 100, for the resource file that scans in android system application program under res catalogues and will be described The name translation of resource file is string format, and builds resource file list;
Second builds module 200, for scanning the code file in android system application program under src catalogues, and builds generation Code quotes set;
The code, for creating multiple threads according to configuration file, is quoted the code file in set and is put down by configuration module 300 The plurality of thread is distributed to;
Starting module 400, for starting the plurality of thread, and is read in each code file of distribution by each thread Character string, while the resource file title in the traversal resource file list;
First detection module 500, for detecting the resource file title with the presence or absence of in the code file, when detecting When the resource file title is present in the code file, then the resource file is judged as resource file is quoted;Work as inspection When measuring the resource file title and being not present in the code file, then resource file described in preliminary judgement is waste resources File;
Second detection module 600, for the waste resources file for quoting resource file and preliminary judgement is carried out mutually according to Rely detection, final waste resources file is filtered out from the waste resources file of preliminary judgement according to testing result, and will most Whole waste resources file is deleted.
It is preferred that in described android system the parallel cleaning of the useless resource of application program system, wherein, described the One structure module 100 includes:
First construction unit, for scanning the resource file in android system application program under res catalogues, and builds resource Listed files;
Converting unit, for according to default transformational rule, by the money that the name translation in the resource file is code reference Source unique string form.
It is preferred that in described android system the useless resource parallel processing of application program system, wherein, it is described to match somebody with somebody Putting module 300 includes:
Creating unit, for creating multiple threads according to configuration file, and the plurality of thread is arranged in thread pool;
Allocation unit, quotes the quantity of code file in set for counting the code, and calculating each thread needs scanning The number of code file, the code file is evenly distributed in the plurality of thread.
It is preferred that in described android system the parallel cleaning of the useless resource of application program system, wherein, described the One detection module 500 also includes:
Culling unit, for starting the plurality of thread, when by a wherein thread judge the resource file as quote resource During file, then the reference resource file is rejected from the resource file list, and update resource file list;
Notification unit, for notifying that remaining thread updates resource file list, and in the resource file list after the renewal Resource file detected.
It is preferred that in described android system the parallel cleaning of the useless resource of application program system, wherein, described the Two detection modules 600 include:
Detector unit, for reading the character string quoted in resource file, travels through the waste resources file of preliminary judgement Title, detects the title of waste resources file of preliminary judgement with the presence or absence of in the reference resource file;
Unit is deleted, for the reference resource file being not present in when the title of the waste resources file for detecting preliminary judgement When middle, then the waste resources file of preliminary judgement is judged as final waste resources file and delete the final waste resources File;
Stick unit, for being present in the reference resource file when the title of the waste resources file for detecting preliminary judgement When, then the waste resources file of preliminary judgement is judged to quote resource file, and is retained.
It is described in detail in method above with regard to the ins and outs of above-mentioned modular unit, therefore is repeated no more.
In sum, the present invention provides a kind of Android engineerings method and system that useless resource is cleared up parallel, by this The waste resources file in android system application program can be fast and effeciently deleted in invention, reduce the volume of APK, so as to EMS memory occupations of the APK in android system is reduced, while improve the toggle speed and application program of application program Development efficiency.
It should be appreciated that the application of the present invention is not limited to above-mentioned citing, and for those of ordinary skills, can To be improved according to the above description or be converted, all these modifications and variations should all belong to the guarantor of claims of the present invention Shield scope.

Claims (10)

1. the method that a kind of useless resource of Android engineerings is cleared up parallel, it is characterised in that including step:
Resource file the name translation by the resource file in A, scanning android system application program under res catalogues For string format, and build resource file list;
Code file in B, scanning android system application program under src catalogues, and build code reference set;
C, multiple threads are created according to configuration file, the code file that the code is quoted in set is averagely allocated to described many Individual thread;
D, the plurality of thread of startup, read the character string in each code file of distribution by each thread, while traversal Resource file title in the resource file list;
E, the detection resource file title are deposited when the resource file title is detected with the presence or absence of in the code file When being in the code file, then the resource file is judged as resource file is quoted;When detecting the resource file name When title is not present in the code file, then resource file described in preliminary judgement is waste resources file;
F, the waste resources file to the reference resource file and preliminary judgement carry out the detection that interdepends, according to testing result Final waste resources file is filtered out from the waste resources file of preliminary judgement, and final waste resources file is deleted Remove.
2. the method that the useless resource of Android engineerings according to claim 1 is cleared up parallel, it is characterised in that the step Rapid A is specifically included:
Resource file in A1, scanning android system application program under res catalogues, and build resource file list;
A2, according to default transformational rule, be the unique character of resource that code is quoted by the name translation in the resource file String format.
3. the method that the useless resource of Android engineerings according to claim 1 is cleared up parallel, it is characterised in that the step Rapid C is specifically included:
C1, multiple threads are created according to configuration file, and the plurality of thread is arranged in thread pool;
C2, the quantity for counting code file in the code reference set, calculate the code file of each thread needs scanning Number, the code file is evenly distributed in the plurality of thread.
4. the method that the useless resource of Android engineerings according to claim 1 is cleared up parallel, it is characterised in that the step Rapid E also includes:
E1, the plurality of thread of startup, when the resource file is judged as resource file is quoted by a wherein thread, then will The reference resource file is rejected from the resource file list, and updates resource file list;
The remaining thread of E2, notice updates resource file list, and to the resource file in the resource file list after the renewal Detected.
5. the method that the useless resource of Android engineerings according to claim 1 is cleared up parallel, it is characterised in that the step Rapid F is specifically included:
F1, the character string read in the reference resource file, travel through the title of the waste resources file of preliminary judgement, and detection is just The title of the waste resources file that step judges is with the presence or absence of in the reference resource file;
F2, when detect the title of waste resources file of preliminary judgement be not present in it is described reference resource file in when, then sentence The waste resources file for determining preliminary judgement is final waste resources file and deletes the final waste resources file;
F3, when detecting the title of waste resources file of preliminary judgement and being present in the reference resource file, then will just The waste resources file that step judges is judged to quote resource file, and retains.
6. the system that a kind of useless resource of Android engineerings is cleared up parallel, it is characterised in that include:
First builds module, for scanning resource file in android system application program under res catalogues and by the resource The name translation of file is string format, and builds resource file list;
Second builds module, for scanning the code file in android system application program under src catalogues, and builds code Quote set;
Configuration module, for creating multiple threads according to configuration file, the code file code quoted in set is average Distribute to the plurality of thread;
Starting module, for starting the plurality of thread, and reads the word in each code file of distribution by each thread Symbol string, while the resource file title in the traversal resource file list;
First detection module, for detecting the resource file title with the presence or absence of in the code file, when detecting When stating resource file title and being present in the code file, then the resource file is judged as resource file is quoted;Work as detection When being not present in the code file to the resource file title, then resource file described in preliminary judgement is waste resources text Part;
Second detection module, for carrying out the inspection that interdepends to the waste resources file for quoting resource file and preliminary judgement Survey, final waste resources file is filtered out from the waste resources file of preliminary judgement according to testing result, and will be final Waste resources file is deleted.
7. the system of the parallel cleaning of the useless resource of Android engineerings according to claim 6, it is characterised in that described the One structure module includes:
First construction unit, for scanning the resource file in android system application program under res catalogues, and builds resource Listed files;
Converting unit, for according to default transformational rule, by the money that the name translation in the resource file is code reference Source unique string form.
8. the system that the useless resource of Android engineerings according to claim 6 is cleared up parallel, it is characterised in that described to match somebody with somebody Putting module includes:
Creating unit, for creating multiple threads according to configuration file, and the plurality of thread is arranged in thread pool;
Allocation unit, quotes the quantity of code file in set for counting the code, and calculating each thread needs scanning The number of code file, the code file is evenly distributed in the plurality of thread.
9. the system of the parallel cleaning of the useless resource of Android engineerings according to claim 6, it is characterised in that described the One detection module also includes:
Culling unit, for starting the plurality of thread, when by a wherein thread judge the resource file as quote resource During file, then the reference resource file is rejected from the resource file list, and update resource file list;
Notification unit, for notifying that remaining thread updates resource file list, and in the resource file list after the renewal Resource file detected.
10. the system of the parallel cleaning of the useless resource of Android engineerings according to claim 6, it is characterised in that described the Two detection modules include:
Detector unit, for reading the character string quoted in resource file, travels through the waste resources file of preliminary judgement Title, detects the title of waste resources file of preliminary judgement with the presence or absence of in the reference resource file;
Unit is deleted, for the reference resource file being not present in when the title of the waste resources file for detecting preliminary judgement When middle, then the waste resources file of preliminary judgement is judged as final waste resources file and delete the final waste resources File;
Stick unit, for being present in the reference resource file when the title of the waste resources file for detecting preliminary judgement When, then the waste resources file of preliminary judgement is judged to quote resource file, and is retained.
CN201611115847.XA 2016-12-07 2016-12-07 Method and system for parallel cleaning of Android engineering useless resources Pending CN106599151A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611115847.XA CN106599151A (en) 2016-12-07 2016-12-07 Method and system for parallel cleaning of Android engineering useless resources

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611115847.XA CN106599151A (en) 2016-12-07 2016-12-07 Method and system for parallel cleaning of Android engineering useless resources

Publications (1)

Publication Number Publication Date
CN106599151A true CN106599151A (en) 2017-04-26

Family

ID=58597292

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611115847.XA Pending CN106599151A (en) 2016-12-07 2016-12-07 Method and system for parallel cleaning of Android engineering useless resources

Country Status (1)

Country Link
CN (1) CN106599151A (en)

Cited By (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108089893A (en) * 2017-12-14 2018-05-29 网易(杭州)网络有限公司 Definite method, apparatus, terminal device and the storage medium of redundant resource
CN108897569A (en) * 2018-05-30 2018-11-27 福建天晴在线互动科技有限公司 The method for cleaning and computer readable storage medium of iOS engineering discarded record
CN108984207A (en) * 2018-06-14 2018-12-11 珠海金山网络游戏科技有限公司 A kind of method of installation kit invalid resource file detection
CN109344277A (en) * 2018-08-31 2019-02-15 网易传媒科技(北京)有限公司 Image processing method, device, medium and calculating equipment
CN109426509A (en) * 2017-09-04 2019-03-05 华为技术有限公司 Method for processing resource and equipment
CN109471729A (en) * 2018-11-15 2019-03-15 平安科技(深圳)有限公司 Based on recursive resource method for cleaning and device
CN109522020A (en) * 2018-09-29 2019-03-26 中国平安人寿保险股份有限公司 Android system installation kit method for reducing body weight, device, terminal and storage medium
CN109558145A (en) * 2017-09-26 2019-04-02 北京金山安全软件有限公司 Installation package volume optimization method and device for android application
CN109614511A (en) * 2018-11-26 2019-04-12 平安科技(深圳)有限公司 A kind of delet method and device, electronic equipment of discarded picture
CN109828777A (en) * 2018-12-06 2019-05-31 珠海西山居互动娱乐科技有限公司 A kind of hand trip installation kit optimization method and system
CN109918076A (en) * 2017-12-13 2019-06-21 北京嘀嘀无限科技发展有限公司 Code file processing method, system, computer equipment and readable storage medium storing program for executing
CN110059214A (en) * 2019-04-01 2019-07-26 北京奇艺世纪科技有限公司 A kind of image resource processing method and processing device
CN110069458A (en) * 2019-04-25 2019-07-30 努比亚技术有限公司 Method, equipment and the storage medium of invalid resource in a kind of deletion Android system
CN110716804A (en) * 2019-09-02 2020-01-21 平安普惠企业管理有限公司 Method and device for automatically deleting useless resources, storage medium and electronic equipment
CN111176717A (en) * 2019-12-20 2020-05-19 广州华多网络科技有限公司 Method and device for generating installation package and electronic equipment
CN111459887A (en) * 2020-03-30 2020-07-28 北京百度网讯科技有限公司 Resource screening method and device, electronic equipment and storage medium
CN111581331A (en) * 2020-04-27 2020-08-25 北京字节跳动网络技术有限公司 Method and device for processing file, electronic equipment and computer readable medium
CN111625242A (en) * 2020-04-16 2020-09-04 广州华多网络科技有限公司 Item code deleting method and device, electronic equipment and storage medium
CN111737504A (en) * 2020-06-23 2020-10-02 网易(杭州)网络有限公司 Image resource detection method, device, equipment and storage medium
CN112131340A (en) * 2019-06-25 2020-12-25 杭州萤石软件有限公司 Character string detection method, device and storage medium
CN112889026A (en) * 2018-10-16 2021-06-01 电子湾有限公司 User interface resource file optimization

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102722415A (en) * 2012-05-22 2012-10-10 广州晶锐信息技术有限公司 Garbage collecting method based on Java system on chip (SoC) with stack system structure
US8578105B2 (en) * 2007-06-29 2013-11-05 Microsoft Corporation Using type stability to facilitate contention management
CN103699420A (en) * 2013-12-31 2014-04-02 海信集团有限公司 System recovery method and system recovery device
CN104461661A (en) * 2014-12-30 2015-03-25 中科创达软件股份有限公司 Image resource loading method and system
CN104484484A (en) * 2015-01-08 2015-04-01 北京奇虎科技有限公司 Method and device for removing cache file
CN105511934A (en) * 2015-12-08 2016-04-20 贵阳朗玛信息技术股份有限公司 Resource processing method and device in application program development
CN105718272A (en) * 2016-02-22 2016-06-29 青岛海信移动通信技术股份有限公司 Method for restoring factory settings of terminal and terminal
CN106156032A (en) * 2015-03-25 2016-11-23 北京奇虎科技有限公司 The recognition methods of cleaning file and device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8578105B2 (en) * 2007-06-29 2013-11-05 Microsoft Corporation Using type stability to facilitate contention management
CN102722415A (en) * 2012-05-22 2012-10-10 广州晶锐信息技术有限公司 Garbage collecting method based on Java system on chip (SoC) with stack system structure
CN103699420A (en) * 2013-12-31 2014-04-02 海信集团有限公司 System recovery method and system recovery device
CN104461661A (en) * 2014-12-30 2015-03-25 中科创达软件股份有限公司 Image resource loading method and system
CN104484484A (en) * 2015-01-08 2015-04-01 北京奇虎科技有限公司 Method and device for removing cache file
CN106156032A (en) * 2015-03-25 2016-11-23 北京奇虎科技有限公司 The recognition methods of cleaning file and device
CN105511934A (en) * 2015-12-08 2016-04-20 贵阳朗玛信息技术股份有限公司 Resource processing method and device in application program development
CN105718272A (en) * 2016-02-22 2016-06-29 青岛海信移动通信技术股份有限公司 Method for restoring factory settings of terminal and terminal

Cited By (32)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109426509A (en) * 2017-09-04 2019-03-05 华为技术有限公司 Method for processing resource and equipment
CN109558145A (en) * 2017-09-26 2019-04-02 北京金山安全软件有限公司 Installation package volume optimization method and device for android application
CN109558145B (en) * 2017-09-26 2022-04-22 北京金山安全软件有限公司 Installation package volume optimization method and device for android application
CN109918076B (en) * 2017-12-13 2022-09-09 北京嘀嘀无限科技发展有限公司 Code file processing method, system, computer device and readable storage medium
CN109918076A (en) * 2017-12-13 2019-06-21 北京嘀嘀无限科技发展有限公司 Code file processing method, system, computer equipment and readable storage medium storing program for executing
CN108089893B (en) * 2017-12-14 2021-03-16 网易(杭州)网络有限公司 Method and device for determining redundant resources, terminal equipment and storage medium
CN108089893A (en) * 2017-12-14 2018-05-29 网易(杭州)网络有限公司 Definite method, apparatus, terminal device and the storage medium of redundant resource
CN108897569A (en) * 2018-05-30 2018-11-27 福建天晴在线互动科技有限公司 The method for cleaning and computer readable storage medium of iOS engineering discarded record
CN108984207A (en) * 2018-06-14 2018-12-11 珠海金山网络游戏科技有限公司 A kind of method of installation kit invalid resource file detection
CN109344277A (en) * 2018-08-31 2019-02-15 网易传媒科技(北京)有限公司 Image processing method, device, medium and calculating equipment
CN109344277B (en) * 2018-08-31 2020-10-20 网易传媒科技(北京)有限公司 Picture processing method, device, medium and computing equipment
CN109522020A (en) * 2018-09-29 2019-03-26 中国平安人寿保险股份有限公司 Android system installation kit method for reducing body weight, device, terminal and storage medium
CN112889026A (en) * 2018-10-16 2021-06-01 电子湾有限公司 User interface resource file optimization
CN109471729B (en) * 2018-11-15 2024-05-14 平安科技(深圳)有限公司 Resource cleaning method and device based on recursion
CN109471729A (en) * 2018-11-15 2019-03-15 平安科技(深圳)有限公司 Based on recursive resource method for cleaning and device
CN109614511A (en) * 2018-11-26 2019-04-12 平安科技(深圳)有限公司 A kind of delet method and device, electronic equipment of discarded picture
CN109828777A (en) * 2018-12-06 2019-05-31 珠海西山居互动娱乐科技有限公司 A kind of hand trip installation kit optimization method and system
CN110059214A (en) * 2019-04-01 2019-07-26 北京奇艺世纪科技有限公司 A kind of image resource processing method and processing device
CN110069458A (en) * 2019-04-25 2019-07-30 努比亚技术有限公司 Method, equipment and the storage medium of invalid resource in a kind of deletion Android system
CN112131340A (en) * 2019-06-25 2020-12-25 杭州萤石软件有限公司 Character string detection method, device and storage medium
CN112131340B (en) * 2019-06-25 2024-02-20 杭州萤石软件有限公司 Character string detection method, device and storage medium
CN110716804A (en) * 2019-09-02 2020-01-21 平安普惠企业管理有限公司 Method and device for automatically deleting useless resources, storage medium and electronic equipment
CN111176717A (en) * 2019-12-20 2020-05-19 广州华多网络科技有限公司 Method and device for generating installation package and electronic equipment
CN111176717B (en) * 2019-12-20 2023-05-16 广州华多网络科技有限公司 Method and device for generating installation package and electronic equipment
CN111459887A (en) * 2020-03-30 2020-07-28 北京百度网讯科技有限公司 Resource screening method and device, electronic equipment and storage medium
CN111459887B (en) * 2020-03-30 2023-08-11 北京百度网讯科技有限公司 Resource screening method and device, electronic equipment and storage medium
CN111625242B (en) * 2020-04-16 2023-08-29 广州方硅信息技术有限公司 Project code deleting method and device, electronic equipment and storage medium
CN111625242A (en) * 2020-04-16 2020-09-04 广州华多网络科技有限公司 Item code deleting method and device, electronic equipment and storage medium
CN111581331A (en) * 2020-04-27 2020-08-25 北京字节跳动网络技术有限公司 Method and device for processing file, electronic equipment and computer readable medium
CN111581331B (en) * 2020-04-27 2023-08-25 抖音视界有限公司 Method, device, electronic equipment and computer readable medium for processing text
CN111737504A (en) * 2020-06-23 2020-10-02 网易(杭州)网络有限公司 Image resource detection method, device, equipment and storage medium
CN111737504B (en) * 2020-06-23 2023-09-15 网易(杭州)网络有限公司 Image resource detection method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN106599151A (en) Method and system for parallel cleaning of Android engineering useless resources
US20220058221A1 (en) Methods to Support Version Control and Conflict Resolution in a Database using a Hierarchical Log
Sepulchre et al. Tectonic uplift and Eastern Africa aridification
Brindescu et al. How do centralized and distributed version control systems impact software changes?
CN105975392A (en) Duplicated code detection method and device based on abstract syntax tree
Fokaefs et al. Decomposing object-oriented class modules using an agglomerative clustering technique
CN106687921A (en) Specifying components in graph-based programs
Hanley et al. No calm in the storm: investigating QAnon website relationships
CN110309131A (en) The method for evaluating quality and device of massive structured data
CN106484892A (en) Data manipulation method and device
CN108959359A (en) A kind of uniform resource locator semanteme De-weight method, device, equipment and medium
CN111061679A (en) Method and system for rapid configuration of technological innovation policy based on rete and drools rules
CN108182217A (en) A kind of APP development systems and dissemination method based on mobile Internet
Duarte et al. The river network toolkit–RivTool
Silva et al. Jextract: An eclipse plug-in for recommending automated extract method refactorings
Melanda et al. Diversity trapped in cages: Revision of Blumenavia Möller (Clathraceae, Basidiomycota) reveals three hidden species
Gärtner et al. Coordinate systems for supergenomes
Petrosyan et al. FAIR degree assessment in agriculture datasets using the F-UJI tool
Martinez Two datasets of questions and answers for studying the development of cross-platform mobile applications using Xamarin framework
Green et al. Define “authoring tool”: a survey of interactive narrative authoring tools
CN110765742A (en) Automatic manuscript writing system based on text analysis technology
Kusunoki et al. How much do code repositories include peripheral modifications?
Nilsson Enumerations count
JP4972997B2 (en) Program analysis method for asset diagnosis
Suyehira et al. Depp: a system for detecting pages to protect in wikipedia

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20170426

RJ01 Rejection of invention patent application after publication