CN105404583A - Quick detection and unit resource use ratio improvement method of APK (Android Application Package) - Google Patents

Quick detection and unit resource use ratio improvement method of APK (Android Application Package) Download PDF

Info

Publication number
CN105404583A
CN105404583A CN201510730835.7A CN201510730835A CN105404583A CN 105404583 A CN105404583 A CN 105404583A CN 201510730835 A CN201510730835 A CN 201510730835A CN 105404583 A CN105404583 A CN 105404583A
Authority
CN
China
Prior art keywords
apk
file
virtual machine
value
resource
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.)
Granted
Application number
CN201510730835.7A
Other languages
Chinese (zh)
Other versions
CN105404583B (en
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.)
Zhongke Information Security Common Technology National Engineering Research Center Co ltd
Institute of Information Engineering of CAS
Original Assignee
Zhongke Information Security Common Technology National Engineering Research Center Co ltd
Institute of Information Engineering of CAS
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 Zhongke Information Security Common Technology National Engineering Research Center Co ltd, Institute of Information Engineering of CAS filed Critical Zhongke Information Security Common Technology National Engineering Research Center Co ltd
Priority to CN201510730835.7A priority Critical patent/CN105404583B/en
Publication of CN105404583A publication Critical patent/CN105404583A/en
Application granted granted Critical
Publication of CN105404583B publication Critical patent/CN105404583B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a quick detection and unit resource use ratio improvement method of an APK (Android Application Package). The method comprises the following steps: a computer which operates a virtual machine determines a minimum value [PHi]1 of resources, which are occupied by the APK to be detected, of each virtual machine, determines a specific value [Phi]2 of the sum of priority attributes of the APK which is not detected and the sum of priority attributes of the detected APK in a current time period, and utilizes a Lagrange weighting method to carry out weighting processing on the [PHi]1 and the [PHi]2 to form a [PHi] value; and then, a genetic algorithm is utilized for determining an optimal distribution scheme of the APK to be detected, i.e., fitness P is added in the genetic algorithm to realize, the fitness P is a sum of the [PHi] of all virtual machines, and therefore, the optimum of the whole detection system is paid attention. The quick detection and resource use ratio improvement method has the advantages that the quick detection and resource use ratio improvement method is based on the relationship of the attributes of the APK and the resources of the virtual machine. When the method is used for distributing and detecting the APK, speed is high, and the resource use ratio is effective.

Description

The quick detection of a kind of APK and the method for raising unit resource utilization factor
Technical field
The invention belongs to field of information security technology, particularly relate to a kind of quick detection of Android mobile applications (Androidapplicationpackage, APK) and improve the method for detection system unit resource utilization factor.
Background technology
Along with the high speed development of mobile Internet, the types of applications based on android system is developed in a large number.Meanwhile, occurred numerous spam application, malicious application etc., the safety problem that mobile terminal is faced also increases thereupon, cause developer and user benefit impaired.Therefore need to carry out safety detection to the application program of Android.
Existing detection method roughly comprises: Static Detection, detection of dynamic and Viral diagnosis.Static Detection detects before APK performs; Detection of dynamic detects when APK runs; Viral diagnosis carries out Virus Sample identification virus killing for APK.Different detection rates needed for detection method and the ability consuming detection system resource are not quite similar.
APK at present based on cloud computing detects, its step mainly: first, upload APK file to be measured; Secondly, according to the precedence uploading APK, be assigned to successively in the virtual machine of specifying and detect.When the APK to be measured of a large amount of different size, type, different detection demand, owing to not considering the detection resource of reasonable distribution system, the problems such as the low and resource utilization of certain detection efficiency is low will inevitably be there is.
Therefore a kind of method of quick detection of Android mobile applications and raising detection system unit resource utilization factor is needed to solve prior art Problems existing.
Summary of the invention
The object of the invention is for the deficiencies in the prior art, propose a kind of quick detection of Android mobile applications and improve the method for unit resource utilization factor, the method effectively improves the detection speed of APK and detects resource utilization.
What technical scheme of the present invention was paid close attention to is not which APK to be detected is assigned to optimum in certain virtual machine, but how to be assigned in different virtual machines by all APK to be detected, makes detection system detect APK fast in an optimal manner.
The technical thought of technical scheme of the present invention is: the computing machine running virtual machine determines that APK to be detected takies the minimum value Φ of every platform resources of virtual machine 1and determine the ratio Φ of the not detected APK priority attribute sum of current slot and detected APK priority attribute sum 2, and utilize Lagrangian weighted method to Φ 1and Φ 2be weighted process and form Φ value; Then utilize genetic algorithm to determine APK optimal distributing scheme to be detected, namely by genetic algorithm by adding fitness P to realize, described fitness P is the Φ sum of all virtual machines, realizes thus paying close attention to the optimum of whole detection system; In addition, in the genetic algorithm that the present invention uses, realize realizing optimum allocation to whole detection system by operations such as intersection, selections, thus reach raising detection resource utilization to realize detecting fast the object of APK.
Realize the specific as follows of technique effect of the present invention:
The quick detection of a kind of APK and the method for raising unit resource utilization factor:
Comprise the computing machine that is run virtual machine;
Computing machine batch from detection queue of described operation virtual machine obtains APK to be detected;
The computing machine of described operation virtual machine obtains APK attribute to be detected and resources of virtual machine attribute;
The COMPUTER DETECTION of described operation virtual machine also determines APK property value to be detected and resources of virtual machine property value;
The weight of the resources of virtual machine that the attribute of APK is corresponding determined by the computing machine of described operation virtual machine, and described weight is for identifying the influence degree of attribute to resources of virtual machine of APK;
The computing machine of described operation virtual machine is set up and is calculated APK property value to be detected and resources of virtual machine property value function;
The computing machine of described operation virtual machine utilizes genetic algorithm to determine optimum APK allocative decision;
APK to be detected is distributed to virtual machine according to optimum APK allocative decision by the computing machine of described operation virtual machine.
Further, described APK attribute comprises: in the size of APK file, the size of DEX file, APK file, in code complexity, APK file median surface complexity, APK file, resource file complexity and APK detect priority, wherein,
The size of described APK file refers to that APK file itself takies the size of storage space, and unit is Mb;
The size of described DEX file refers to that the expansion in APK file is called the size of .dex file, unit Mb;
In described APK file, code complexity refers to the directories deep of code and the relation of number of files in dex file, it is (1 that code complexity arranges scope, 100), APK file directories deep is (1,10], more than 10 in the number of files (1 of 10, APK, 1000], more than 1000 in 1000;
Described APK file median surface complexity to refer in the interface number of APK in operational process and interface use the relation of control, interface complexity refers to that the scope that arranges is (1,100), APK interface adds up to (1,100], more than 100 in 100, the control sum (1 of single interface, 10], more than 10 in 10;
In described APK file, resource file complexity to refer in APK the level of catalogue and the relation below between catalogue and number of files under res catalogue, it is (1 that the complexity of described resource file arranges scope, 100), directories deep is (1,5], every grade of maximum catalogue number (1,10], the maximum number of files of each catalogue (1,100];
Described APK detects priority and refers to the start time of detection the latest that APK will meet, and the conditions such as the maximum number of resource requirement, include but not limited to above-mentioned condition, can according to actual conditions dynamic conditioning;
Described resources of virtual machine attribute comprises CPU index, memory index and thread index, wherein,
Described CPU index refers to that CPU is current can by the resource that uses and the original ratio using resource of CPU;
Described memory index refers to internal memory current idle resource and the original ratio using resource of internal memory,
Described thread index refers to the idle number of current hyperthread thread and original line number of passes.
Further, described APK property value to comprise in the size attribute value of APK file, the size attribute value of DEX file, APK file resource file complexity attributes value and APK in code complexity attributes value, APK file median surface complexity attributes value, APK file and detects priority attribute value, wherein
The size attribute value of APK file, is specially APK actual size and is multiplied by 100 with the ratio that can detect APK file maximal value;
The size attribute value of DEX file in APK file, the actual size being specially DEX in APK is multiplied by 100 with the ratio of the maximal value that can detect DEX file;
Divided by maximum directories deep 10, code complexity attributes value in APK file, adds that DEX file file sum obtains divided by file maximum number 1000 after being multiplied by 70 after the directories deep being specially code in DEX file is multiplied by the maximal value 30 that can detect DEX file;
APK file median surface complexity attributes value, most amassing divided by the interface maximum number of setting and the maximum number of control in interface that the total interface number being specially APK file is multiplied by single interface control, and then take advantage of 100 to obtain APK file median surface complexity attributes value;
Resource file complexity attributes value in APK file, be specially long-pending the amassing divided by maximum number of files in the directories deep maximal value under Res file set and catalogue number maximal value and catalogue of the maximum number of the physical directory degree of depth and physical directory maximum number and physical directory file under Res file in APK file, and then be multiplied by 100 and obtain resource file complexity attributes value in PK file;
APK detects priority attribute value, and the time to be checked 10 the latest that is specially deducts to set the latest to be determined divided by being multiplied by 100 after 10 detection time;
Described resources of virtual machine property value comprises CPU exponential quantity, memory index value and thread exponential quantity, wherein,
Described CPU exponential quantity is specially core cpu number and CPU frequency and current C PU not by the product of utilization rate;
Described memory index value is specially CPU memory size and current memory not by the product of utilization rate;
Described thread exponential quantity is specially Thread Count and current thread not by the product of utilization rate.
The weight determination mode of the resources of virtual machine that described APK attribute is corresponding is:
Each APK has some attribute, and each virtual machine has limited resource, and the attribute of APK determines its allocation result in virtual machine;
If the attribute affecting APK distribution is as follows:
The surplus resources kind of each virtual machine is as follows:
Because certain resource of virtual machine is associated with some attribute of APK, thus determine the allocation scheme of APK, the expression formula of described association is:
Wherein,
s=1,2,3,4,5,6
t=1,2,3,4,5,6
represent relation between resource s and attribute t, need meet simultaneously with two conditions; R srepresent that certain APK is assigned to virtual machine S class resource shared after virtual machine.
The computing machine of described operation virtual machine is set up and the mode calculating APK property value to be detected and resources of virtual machine property value function is:
By N number of APK be assigned to M virtual machine on, be divided into M bunch by N number of APK, each candidate bunch is designated as ; It meets following constraint condition:
The APK resource requirement sum putting into each virtual machine is not more than the actual resource had of this virtual machine, is:
It needs meet:
Optimization aim one: the resource taking every platform virtual machine most possibly
Wherein: m represents virtual machine number, and s represents resource category
Optimization aim two: for priority attribute, the APK priority allocation that property value is higher
Wherein: i represents that not selected APK, j show selected APK
Above two optimization aim are carried out Lagrangian weighting, integrated objective function as follows can be obtained:
The computing machine of described operation virtual machine utilizes genetic algorithm to determine, and the concrete steps of optimum APK allocative decision are:
Step one: individual UVR exposure generates
Use binary coding, introduce a special coded identification "×" in addition and represent and forbids gene, the virtual machine forbidding corresponding to gene does not mate with this APK performance or virtual machine is in busy condition, and can not receive an assignment distribution; When initialization, forbid that gene is assigned with coding "×", and all can not change in genetic manipulation below, namely do not consider to distribute corresponding APK to this virtual machine; Therefore, the gene on chromosome has " 0 ", " 1 ", "×" three kinds coding, if the gene of the capable τ row of μ is , then its meaning is as follows:
Step 2: the generation of initial population
Because genetic algorithm operates colony, determine the data of initial population;
Rapid three: carry out fitness calculating
Evaluate the quality of whole allocative decision in genetic algorithm with the fitness size of all virtual machine sums, thus determine the size of hereditary chance;
Described fitness is used (i represents the number of virtual machine) measures, probability more selected is larger;
Step 4: specifically select
Roulette method choice is used to form follow-on individuality, the selected probability selected of arbitrary individuality equals the ratio of its adaptive value and all chromosome adaptive value sums, in this selection course, elite's retention strategy is used, with guarantee the optimum individual that obtains not destroy by further genetic manipulation, thus more likely converge to globally optimal solution; After the operations such as intersection, variation, if the adaptive value of optimum individual is less than the adaptive value of optimum individual in previous generation in a new generation, then the optimum individual of previous generation is replicated, and replaces the poorest individuality in a new generation;
Step 5: cross selection
Always meet constraint condition in order to ensure filial generation dyeing, make the feasible solution of child chromosome always problem, the row or column in two parent chromosome matrixes is with certain crossover probability P cexchanged, after having intersected, need at father's chromosome P 1, P 2with new chromosome C 1, C 2between select, what adaptive value was higher enters the next generation, is specially:
Step 6: variation
Mutation operator changes by a certain less probability the genic value on the some of individuality or certain some gene, and it is also produce new individual a kind of method of operating.The method that in this model, we adopt position to make a variation, namely capable from N, produce two random number p and q at random in M row, then when below meeting when two conditions, by the gene of capable for p q row become 1 or become 0 from 1 from 0, and following two conditions need be met: condition 1 is gene be not forbid gene, condition 2 is , above-mentioned two conditions are simultaneously satisfied just can make a variation.
The invention has the advantages that: the present invention is based on APK attribute and the raising APK detection rates of resources of virtual machine relation and the method for resource utilization, when using the method to detect APK, we only need APK attribute to be detected and resources of virtual machine model attributes, calculate the relation function of APK attribute and resources of virtual machine attribute, pass through genetic algorithm again, calculate the scheduling scheme of APK, according to scheduling scheme, APK is distributed to virtual machine and detect.Due to the issue of current APK and renewal speed faster, so use the method to distribute with when detecting APK, speed is faster, and resource utilization is more effective.
Accompanying drawing explanation
The initial population body surface schematic diagram data that in Fig. 1 technical scheme of the present invention, genetic algorithm operates colony;
In Fig. 2 technical scheme of the present invention genetic algorithm two parent chromosome matrixes in a line (or row) with certain crossover probability P cexchanged schematic diagram;
Embodiment
For making the object, technical solutions and advantages of the present invention clearly understand, hereafter technical solution of the present invention is described in further detail.It should be noted that, when not conflicting, the feature in the embodiment of the application and embodiment can combine arbitrarily mutually.
The APK attribute that the present invention mentions is described in detail as follows:
(1) for the size of APK file, X is used 1represent
The size of APK file refers to the size that file itself takies storage space, and unit is Mb.
Common, the composition of APK file comprises: META-INF, the certificate signature of its essential record file; Res, it is mainly used in the catalogue depositing resource file; AndroidManifest.xml, it is mainly used in program global configuration file; Classes.dex, it is mainly used in depositing Dalvik bytecode; Resources.arsc, it is mainly used in the Binary Resources file after depositing compiling.
Current detectable APK file size is between (0,300) Mb, and the size of most of APK is between (5,50) Mb.Test result shows, file is larger, and required detection resource is larger.
X 1value equal APK actual size and be multiplied by 100 again divided by the maximal value 300 that can detect APK file, retain two-decimal, formula is as follows:
Example: the actual size of APK is 34.5Mb, is specifically calculated as follows:
(2) for the size of dex file in APK file, X is used 2represent
The size expansion referred in APK file of Dex file is called the size of .dex file, unit Mb.
Dex file size between (0,30Mb), and the size of most of dex file is between (1,10Mb), and .dex file is larger, and description code amount is larger, and service logic is more complicated.
X 2value equal Dex actual size in APK and be multiplied by 100 again divided by the maximal value 30 that can detect Dex file, retain two-decimal, formula is as follows:
Example: the actual size of Dex is 4.5Mb, is specifically calculated as follows:
(3) code complexity in APK file, uses X 3represent
Code complexity refers to the directories deep of code and the relation of number of files in dex file.
Code complexity arranges scope for (1,100), directories deep be (1,10], more than 10 in 10, the number of files of class (1,1000], more than 1000 in 1000.
X 3the depth value of the bag such as value be multiplied by 30 except 10 sums adding class again and be multiplied by 70 except 1000, retain two-decimal, formula is as follows:
Example: the degree of depth of bag is 7, class add up to 452, substitute into formula specific as follows:
(4) APK file median surface complexity, uses X 4represent
Interface complexity to refer in the interface number of APK in operational process and interface use the relation of control.
Interface complexity refers to that the scope that arranges is for (1,100), interface adds up to (1,100], more than 100 in 100, the control sum of single interface (1,10], more than 10 in 10.
The interface number of the bag such as value be multiplied by most interface maximum numbers 100 divided by setting of single interface control, maximum number 10 long-pending of control in interface, then take advantage of 100, retain two-decimal, formula is as follows:
Example: the interface number of bag is 36, and what in interface, control was maximum is 8, substitutes into formula specific as follows:
(5) resource file complexity in APK file, uses X 5represent
Resource file complexity to refer in APK the level of catalogue and the relation below between catalogue and number of files under res catalogue.
The complexity of resource file arranges scope for (1,100), directories deep be (1,5], every grade of maximum catalogue number (1,10], the maximum number of files of each catalogue (1,100].(according to circumstances Continual Improvement)
Value equal the long-pending of maximum number of files 100 in the directories deep maximal value 5 of the long-pending Res divided by setting of the maximum number of the Res physical directory degree of depth, physical directory maximum number, physical directory file in APK, catalogue number maximal value 10, catalogue, be multiplied by 100 reservation two-decimals again, formula is as follows:
Example: the physical directory degree of depth of Res is 3, and maximum catalogue number is 8, and maximum number of files is 30, is specifically calculated as follows:
(6) APK detects priority, uses X 6represent
Priority refers to the start time of detection the latest that APK will meet, and the conditions such as the maximum number of resource requirement include but not limited to above-mentioned condition.
The scope (1,100) of current setting, the time detected the latest by hour in units of, then be multiplied by 100 reservation two-decimals, formula is as follows:
Example: the latest detection time be 8 hours 30 points, be specifically calculated as follows:
The source attribute values of the virtual machine that the present invention mentions is specific as follows:
(1) CPU index, with representing
CPU index refers to that CPU is current can by the resource that uses and the original ratio using resource of CPU, computing formula core cpu number × CPU frequency × (the current utilization rate of 1-CPU).
(2) memory index, with representing
Memory index refers to internal memory current idle resource and the original ratio using resource of internal memory, computing formula CPU memory size × (the current utilization rate of 1-internal memory).
(3) thread index, with representing
Thread index refers to the idle number of current hyperthread thread and original line number of passes, computing formula Thread Count × (the current utilization rate of 1-thread).
Attribute according to the APK of above-mentioned analysis obtains the unit of account detecting resource needed for, then according to detecting the corresponding attribute of resource itself, by algorithm below to a value.
Each APK has some attribute, and each virtual machine has limited resource, and the attribute of APK determines its allocation result in virtual machine;
If the attribute affecting APK distribution is as follows:
The surplus resources kind of each virtual machine is as follows:
Because certain resource of virtual machine may be associated with some attribute of APK, thus determine the allocation scheme of APK, this pass coupling mathematical form is expressed as follows by we:
Wherein, the implication of each parameter is:
s=1,2,……,S
t=1,2,……,T
represent relation between resource s and attribute t, need meet simultaneously with two conditions; R srepresent that certain APK is assigned to virtual machine S class resource shared after virtual machine.
Fig. 1 is that APK attribute intuitively shows figure with associating of resources of virtual machine, and concrete example is analyzed as follows:
Certain APK will carry out Static Detection, and each attribute description of APK is as follows:
File size is 25.7Mb;
Wherein dex file size is 1.3Mb;
In dex file, maximum directories deep is 7 grades, and total files is 358;
To have interface number be 26 in institute, is integrated with 9 controls at most in interface;
In source file catalogue, maximum directories deep is 4 grades, and catalogue numbers maximum under single catalogue is 7, and number of files maximum under single catalogue is 84;
According to above-mentioned attribute description, attribute is substituted into formula below can be obtained:
APK attribute and result of calculation:
APK attribute and resources of virtual machine incidence relation:
Following result will be obtained by each result substitution formula above:
existingby N number of APK be assigned to M virtual machine on, be divided into M bunch by N number of APK, each candidate bunch is designated as ; It meets following constraint condition:
The APK resource requirement sum putting into each virtual machine is not more than the actual resource had of this virtual machine, is:
It needs meet:
Optimization aim one: the resource taking every platform virtual machine most possibly
Wherein: m represents virtual machine number, and s represents resource category
Optimization aim two: for priority attribute, the APK priority allocation that property value is higher
Wherein: i represents that not selected APK, j show selected APK
Above two optimization aim are carried out Lagrangian weighting, integrated objective function as follows can be obtained:
Based on above-mentioned analysis, utilize genetic algorithm to find optimal distributing scheme, specifically comprise the steps:
Step one: individual UVR exposure generates
Use binary coding, introduce a special coded identification "×" in addition and represent and forbids gene, the virtual machine forbidding corresponding to gene does not mate with this APK performance or virtual machine is in busy condition, and can not receive an assignment distribution.When initialization, forbid that gene is assigned with coding "×", and all can not change in genetic manipulation below, mean and do not consider to distribute corresponding APK to this virtual machine.Therefore, the gene on chromosome has " 0 ", " 1 ", "×" three kinds coding, if the gene of row row is that then its meaning is as follows:
Step 2: the generation of initial population
As described in Figure 2, genetic algorithm operates colony, the data of initial population that it is given;
Step 3: carry out fitness calculating
Evaluate the quality of whole allocative decision in genetic algorithm with the fitness size of all virtual machine sums, thus determine the size of hereditary chance; In this model, fitness is used (i represents the number of virtual machine) measures, probability more selected is larger;
Step 4: specifically select
Use roulette method choice to form follow-on individuality, the selected probability selected of arbitrary individuality equals the ratio of its adaptive value and all chromosome adaptive value sums; In this selection course, elite's retention strategy is used, with guarantee the optimum individual that obtains not destroy by further genetic manipulation, thus more likely converge to globally optimal solution; After the operations such as intersection, variation, if the adaptive value of optimum individual is less than the adaptive value of optimum individual in previous generation in a new generation, then the optimum individual of previous generation is replicated, and replaces the poorest individuality in a new generation; Such as, if parent chromosome population is:
And intersect, make a variation after obtain new population be:
Wherein, a i with a j , b m with b n the optimum in parent population and new population and the poorest individuality respectively, if adaptive value , sub-population recruitment so of future generation is as follows:
Step 5: cross selection
Always meet constraint condition in order to ensure filial generation dyeing, make the feasible solution of child chromosome always problem, Fig. 2 is that a line (or row) in two parent chromosome matrixes is with certain crossover probability P cexchanged concrete schematic diagram;
After having intersected, need at father's chromosome P 1, P 2with new chromosome C 1, C 2between select, what adaptive value was higher enters the next generation:
Step 6: variation
Mutation operator changes by a certain less probability the genic value on the some of individuality or certain some gene, and it is also produce new individual a kind of method of operating.The method that in this model, we adopt position to make a variation, namely capable from N, produce two random number p and q at random in M row, then when below meeting when two conditions, by the gene of capable for p q row become 1 or become 0 from 1 from 0, and following two conditions need be met: condition 1 is gene be not forbid gene, condition 2 is , above-mentioned two conditions are simultaneously satisfied just can make a variation.
Above to invention has been detailed introduction, applying embodiment herein and setting forth the principle of the application and embodiment, the explanation of above embodiment is just for helping method and the core concept thereof of understanding the application; Meanwhile, for one of ordinary skill in the art, according to the thought of the application, all will change in specific embodiments and applications, in sum, this description should not be construed as the restriction to the application.

Claims (6)

1. the quick detection of an APK and the method for raising unit resource utilization factor:
Comprise the computing machine that is run virtual machine;
Computing machine batch from detection queue of described operation virtual machine obtains APK to be detected;
The computing machine of described operation virtual machine obtains APK attribute to be detected and resources of virtual machine attribute;
The COMPUTER DETECTION of described operation virtual machine also determines APK property value to be detected and resources of virtual machine property value;
The weight of the resources of virtual machine that the attribute of APK is corresponding determined by the computing machine of described operation virtual machine, and described weight is for identifying the influence degree of attribute to resources of virtual machine of APK;
The computing machine of described operation virtual machine is set up and is calculated APK property value to be detected and resources of virtual machine property value function;
The computing machine of described operation virtual machine utilizes genetic algorithm to determine optimum APK allocative decision;
APK to be detected is distributed to virtual machine according to optimum APK allocative decision by the computing machine of described operation virtual machine.
2. the quick detection of a kind of APK as claimed in claim 1 and the method for raising unit resource utilization factor, it is characterized in that: described APK attribute comprises: in the size of APK file, the size of DEX file, APK file, in code complexity, APK file median surface complexity, APK file, resource file complexity and APK detect priority, wherein
The size of described APK file refers to that APK file itself takies the size of storage space, and unit is Mb;
The size of described DEX file refers to that the expansion in APK file is called the size of .dex file, unit Mb;
In described APK file, code complexity refers to the directories deep of code and the relation of number of files in dex file, it is (1 that code complexity arranges scope, 100), APK file directories deep is (1,10], more than 10 in the number of files (1 of 10, APK, 1000], more than 1000 in 1000;
Described APK file median surface complexity to refer in the interface number of APK in operational process and interface use the relation of control, interface complexity refers to that the scope that arranges is (1,100), APK interface adds up to (1,100], more than 100 in 100, the control sum (1 of single interface, 10], more than 10 in 10;
In described APK file, resource file complexity to refer in APK the level of catalogue and the relation below between catalogue and number of files under res catalogue, it is (1 that the complexity of described resource file arranges scope, 100), directories deep is (1,5], every grade of maximum catalogue number (1,10], the maximum number of files of each catalogue (1,100];
Described APK detects priority and refers to the start time of detection the latest that APK will meet, and the conditions such as the maximum number of resource requirement, include but not limited to above-mentioned condition, can according to actual conditions dynamic conditioning;
Described resources of virtual machine attribute comprises CPU index, memory index and thread index, wherein,
Described CPU index refers to that CPU is current can by the resource that uses and the original ratio using resource of CPU;
Described memory index refers to internal memory current idle resource and the original ratio using resource of internal memory,
Described thread index refers to the idle number of current hyperthread thread and original line number of passes.
3. the quick detection of a kind of APK as claimed in claim 1 and the method for raising unit resource utilization factor, it is characterized in that: described APK property value to comprise in the size attribute value of APK file, the size attribute value of DEX file, APK file resource file complexity attributes value and APK in code complexity attributes value, APK file median surface complexity attributes value, APK file and detects priority attribute value, wherein
The size attribute value of APK file, is specially APK actual size and is multiplied by 100 with the ratio that can detect APK file maximal value;
The size attribute value of DEX file in APK file, the actual size being specially DEX in APK is multiplied by 100 with the ratio of the maximal value that can detect DEX file;
Divided by maximum directories deep 10, code complexity attributes value in APK file, adds that DEX file file sum obtains divided by file maximum number 1000 after being multiplied by 70 after the directories deep being specially code in DEX file is multiplied by the maximal value 30 that can detect DEX file;
APK file median surface complexity attributes value, most amassing divided by the interface maximum number of setting and the maximum number of control in interface that the total interface number being specially APK file is multiplied by single interface control, and then take advantage of 100 to obtain APK file median surface complexity attributes value;
Resource file complexity attributes value in APK file, be specially long-pending the amassing divided by maximum number of files in the directories deep maximal value under Res file set and catalogue number maximal value and catalogue of the maximum number of the physical directory degree of depth and physical directory maximum number and physical directory file under Res file in APK file, and then be multiplied by 100 and obtain resource file complexity attributes value in PK file;
APK detects priority attribute value, and the time to be checked 10 the latest that is specially deducts to set the latest to be determined divided by being multiplied by 100 after 10 detection time;
Described resources of virtual machine property value comprises CPU exponential quantity, memory index value and thread exponential quantity, wherein,
Described CPU exponential quantity is specially core cpu number and CPU frequency and current C PU not by the product of utilization rate;
Described memory index value is specially CPU memory size and current memory not by the product of utilization rate;
Described thread exponential quantity is specially Thread Count and current thread not by the product of utilization rate.
4. the quick detection of a kind of APK as claimed in claim 1 and the method for raising unit resource utilization factor, is characterized in that: the weight determination mode of the resources of virtual machine that described APK attribute is corresponding is:
Each APK has some attribute, and each virtual machine has limited resource, and the attribute of APK determines its allocation result in virtual machine;
If the attribute affecting APK distribution is as follows:
The surplus resources kind of each virtual machine is as follows:
Because certain resource of virtual machine is associated with some attribute of APK, thus determine the allocation scheme of APK, the expression formula of described association is:
Wherein,
s=1,2,3,4,5,6
t=1,2,3,4,5,6
represent relation between resource s and attribute t, need meet simultaneously with two conditions; R srepresent that certain APK is assigned to virtual machine S class resource shared after virtual machine.
5. a kind of APK as claimed in claim 1 quick detection and improve the method for unit resource utilization factor, it is characterized in that: the computing machine of described operation virtual machine is set up and the mode calculating APK property value to be detected and resources of virtual machine property value function is:
By N number of APK be assigned to M virtual machine on, be divided into M bunch by N number of APK, each candidate bunch is designated as ; It meets following constraint condition:
The APK resource requirement sum putting into each virtual machine is not more than the actual resource had of this virtual machine, is:
It needs meet:
Optimization aim one: the resource taking every platform virtual machine most possibly
Wherein: m represents virtual machine number, and s represents resource category
Optimization aim two: for priority attribute, the APK priority allocation that property value is higher
Wherein: i represents that not selected APK, j show selected APK
Above two optimization aim are carried out Lagrangian weighting, integrated objective function as follows can be obtained:
6. a kind of APK as claimed in claim 1 quick detection and improve the method for unit resource utilization factor, it is characterized in that: the computing machine of described operation virtual machine utilize genetic algorithm to determine the concrete steps of optimum APK allocative decision are:
Step one: individual UVR exposure generates
Use binary coding, introduce a special coded identification "×" in addition and represent and forbids gene, the virtual machine forbidding corresponding to gene does not mate with this APK performance or virtual machine is in busy condition, and can not receive an assignment distribution;
When initialization, forbid that gene is assigned with coding "×", and all can not change in genetic manipulation below, namely do not consider to distribute corresponding APK to this virtual machine; Therefore, the gene on chromosome has " 0 ", " 1 ", "×" three kinds coding, if the gene of row row is that then its meaning is as follows:
Step 2: the generation of initial population
Because genetic algorithm operates colony, determine the data of initial population;
Rapid three: carry out fitness calculating
Evaluate the quality of whole allocative decision in genetic algorithm with the fitness size of all virtual machine sums, thus determine the size of hereditary chance;
Described fitness is used (i represents the number of virtual machine) measures, probability more selected is larger;
Step 4: specifically select
Roulette method choice is used to form follow-on individuality, the selected probability selected of arbitrary individuality equals the ratio of its adaptive value and all chromosome adaptive value sums, in this selection course, elite's retention strategy is used, with guarantee the optimum individual that obtains not destroy by further genetic manipulation, thus more likely converge to globally optimal solution; After the operations such as intersection, variation, if the adaptive value of optimum individual is less than the adaptive value of optimum individual in previous generation in a new generation, then the optimum individual of previous generation is replicated, and replaces the poorest individuality in a new generation;
Step 5: cross selection
Always meet constraint condition in order to ensure filial generation dyeing, make the feasible solution of child chromosome always problem, the row or column in two parent chromosome matrixes is with certain crossover probability P cexchanged, after having intersected, need at father's chromosome P 1, P 2with new chromosome C 1, C 2between select, what adaptive value was higher enters the next generation, is specially:
Step 6: variation
Capable from N, produce two random number p and q at random in M row, then when below meeting when two conditions, by the gene of capable for p q row become 1 or become 0 from 1 from 0, and following two conditions need be met: condition 1 is gene be not forbid gene, condition 2 is , above-mentioned two conditions are simultaneously satisfied just can make a variation.
CN201510730835.7A 2015-12-04 2015-12-04 The quick detection of APK a kind of and the method for improving unit resource utilization rate Active CN105404583B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510730835.7A CN105404583B (en) 2015-12-04 2015-12-04 The quick detection of APK a kind of and the method for improving unit resource utilization rate

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510730835.7A CN105404583B (en) 2015-12-04 2015-12-04 The quick detection of APK a kind of and the method for improving unit resource utilization rate

Publications (2)

Publication Number Publication Date
CN105404583A true CN105404583A (en) 2016-03-16
CN105404583B CN105404583B (en) 2017-10-20

Family

ID=55470081

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510730835.7A Active CN105404583B (en) 2015-12-04 2015-12-04 The quick detection of APK a kind of and the method for improving unit resource utilization rate

Country Status (1)

Country Link
CN (1) CN105404583B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106293981A (en) * 2016-07-29 2017-01-04 浪潮电子信息产业股份有限公司 A kind of detection method of server CPU Hyper-Threading

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110239291A1 (en) * 2010-03-26 2011-09-29 Barracuda Networks, Inc. Detecting and Thwarting Browser-Based Network Intrusion Attacks For Intellectual Property Misappropriation System and Method
US20120030731A1 (en) * 2010-07-28 2012-02-02 Rishi Bhargava System and Method for Local Protection Against Malicious Software
CN102945347A (en) * 2012-09-29 2013-02-27 中兴通讯股份有限公司 Method, system and device for detecting Android malicious software
CN104268473A (en) * 2014-09-23 2015-01-07 龙芯中科技术有限公司 Method and device for detecting application programs
CN104933366A (en) * 2015-07-17 2015-09-23 成都布林特信息技术有限公司 Mobile terminal application program processing method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110239291A1 (en) * 2010-03-26 2011-09-29 Barracuda Networks, Inc. Detecting and Thwarting Browser-Based Network Intrusion Attacks For Intellectual Property Misappropriation System and Method
US20120030731A1 (en) * 2010-07-28 2012-02-02 Rishi Bhargava System and Method for Local Protection Against Malicious Software
CN102945347A (en) * 2012-09-29 2013-02-27 中兴通讯股份有限公司 Method, system and device for detecting Android malicious software
CN104268473A (en) * 2014-09-23 2015-01-07 龙芯中科技术有限公司 Method and device for detecting application programs
CN104933366A (en) * 2015-07-17 2015-09-23 成都布林特信息技术有限公司 Mobile terminal application program processing method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
吴发伟、方勇、刘亮: "一种恶意软件分析中检测虚拟环境的方法", 《信息与电子工程》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106293981A (en) * 2016-07-29 2017-01-04 浪潮电子信息产业股份有限公司 A kind of detection method of server CPU Hyper-Threading

Also Published As

Publication number Publication date
CN105404583B (en) 2017-10-20

Similar Documents

Publication Publication Date Title
US10747780B2 (en) Blockchain-based data processing method and device
Wilczyński et al. Modelling and simulation of security-aware task scheduling in cloud computing based on Blockchain technology
US20190034836A1 (en) Automatic generation of training data for anomaly detection using other user's data samples
US10623481B2 (en) Balancing resources in distributed computing environments
US10666716B1 (en) Optimization of application parameters
CN102254120B (en) Method, system and relevant device for detecting malicious codes
US20130074055A1 (en) Memoization Configuration File Consumed at Compile Time
Rehman et al. Multi‐objective approach of energy efficient workflow scheduling in cloud environments
US20130085882A1 (en) Offline Optimization of Computer Software
US10476985B1 (en) System and method for resource management and resource allocation in a self-optimizing network of heterogeneous processing nodes
Guerrero et al. Multi-objective optimization for virtual machine allocation and replica placement in virtualized hadoop
US20210089422A1 (en) System and method for serverless computing based on blockchain
US20140196054A1 (en) Ensuring performance of a computing system
Antonescu et al. Dynamic SLA management with forecasting using multi-objective optimization
CN106471473A (en) Mechanism for the too high distribution of server in the minds of in control data
Tan et al. A NSGA-II-based approach for multi-objective micro-service allocation in container-based clouds
CN106708875B (en) Feature screening method and system
Zhuang et al. Impact of instance seeking strategies on resource allocation in cloud data centers
CN105404583A (en) Quick detection and unit resource use ratio improvement method of APK (Android Application Package)
Kumari et al. A hybrid approach of genetic algorithm and multi objective PSO task scheduling in cloud computing
CN104657216A (en) Resource allocation method and device for resource pool
CN116303082B (en) Seed scheduling and evaluating method for fuzzy test of kernel of operating system
CN107589980A (en) A kind of dispatching method of cloud computing resources
CN111694835B (en) Number section access method, system, equipment and storage medium of logistics electronic bill
CN109376006A (en) Resource integrated method based on user demand time-varying characteristics under a kind of cloud computing environment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant