CN102968173A - Bandwidth self-adaption code migration-based energy saving method for mobile equipment - Google Patents

Bandwidth self-adaption code migration-based energy saving method for mobile equipment Download PDF

Info

Publication number
CN102968173A
CN102968173A CN2012104218459A CN201210421845A CN102968173A CN 102968173 A CN102968173 A CN 102968173A CN 2012104218459 A CN2012104218459 A CN 2012104218459A CN 201210421845 A CN201210421845 A CN 201210421845A CN 102968173 A CN102968173 A CN 102968173A
Authority
CN
China
Prior art keywords
program
bandwidth
mobile device
node
power consumption
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
CN2012104218459A
Other languages
Chinese (zh)
Other versions
CN102968173B (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.)
Beihang University
Original Assignee
Beihang University
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 Beihang University filed Critical Beihang University
Priority to CN201210421845.9A priority Critical patent/CN102968173B/en
Publication of CN102968173A publication Critical patent/CN102968173A/en
Application granted granted Critical
Publication of CN102968173B publication Critical patent/CN102968173B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a bandwidth self-adaption code migration-based energy saving method for mobile equipment. The energy saving method comprises the following steps of: constructing a weighting object relation graph through performing static and dynamic analysis on a mobile application, therefore, transforming an application partitioning problem into an object relation graph partitioning problem; proposing a running time and energetic optimum-based target model by taking varied bandwidth in a mobile environment to serve as a variable; proposing a bandwidth self-adaption branch and bound application partitioning method (BBAP) and a minimum cut-based greedy application partitioning method (MCGAP) by aiming at an application partitioning optimization model; and finally, realizing code migration and distributed execution on the mobile application between the mobile equipment and a server based on the obtained partitioning scheme. According to the method disclosed by the invention, the running time of the mobile application can be effectively shortened, and the power consumption of the mobile equipment is reduced. Moreover, the method disclosed by the invention is good in adaptability to bandwidth variations.

Description

A kind of mobile device power saving method based on the migration of bandwidth self-adaption code
Technical field
The invention belongs to the mobile computing field, be specifically related to a kind of mobile device power saving method based on the migration of bandwidth self-adaption code.
Background technology
Mobile device becomes the computing platform of customer volume maximum gradually because of its light and handy advantage such as portable, easy to use.Along with mobile subscriber's demand constantly increases, the performance of mobile device constantly promotes, and battery capacity has become the bottleneck problem that mobile device further develops.In recent years, the code migrating technology of cutting apart based on program is applied to the mobile computing field gradually, becomes a kind of effective ways of alleviating mobile device resource-constrained problem.According to the program splitting scheme a part of code of application program is moved to the server end operation, can shorten the working time of application program, reduce the energy consumption of mobile device.
The complicacy of object-oriented application program and diversity are that the realization program is cut apart and brought challenge.Chinese scholars has carried out studying comparatively widely and having proposed corresponding scheme in this field.The MAUI system that the people such as Eduardo propose is based on the code migratory system of the general purpose language Runtime Library CLR of Microsoft, needs the programmer in advance to adding at the object that far-end server is carried out " Remotable " sign in the program source code; The Cuckoo system that the people such as Roelof propose is by expansion Android compiling system, for the programmer provides a kind of easily programming model, can auxiliary routine person finish part work (for example realization of remote method invocation (RMI)), but still need the programmer manually to realize; The people such as Shumao are cut apart and are moved by the program on the Middleware implementation mobile device.These schemes depend on programmer or middleware instrument, have limited its application.
So the researchers such as Sinha have further proposed the auto-programming splitting scheme, this method need not rely on the programmer by additional means, can realize pellucidly the program auto Segmentation, is applicable to mobile platform.In recent years, the auto Segmentation scheme of object-oriented program is mostly by carrying out pure static analysis or pure performance analysis constructor object relationship figure to program, and cuts apart based on object relationship figure (Object Relation Graph, ORG) realization program.The Doorastha system that the people such as Spiegel and Dahm propose all adopts pure static program analysis method construct object relationship figure, can not accurately reflect the run mode information of program, thereby can't obtain optimum program segmentation result.The people such as the people such as Messer and Bialek then adopt pure dynamic routine analytical approach structure object relationship figure, compare pure static analysis, information when pure dynamic routine analysis can be obtained more accurate program operation, but the object relationship figure bulky complex that obtains, it is excessive to cause program to cut apart expense, is not suitable for the mobile platform of resource-constrained.The people such as Wang Lei are by the two-layer object relationship figure of structure, proposed to be applicable to the program splitting scheme of different target model and based on the distributed system framework of Java, but the program dividing method is not specifically studied, do not considered the variation of bandwidth in the mobile environment.
The key that program is cut apart is the optimum segmentation scheme of How to choose program, realizes that as far as possible energy consumption of mobile equipment is minimum and data transfer overhead is minimum.Because data transfer overhead is directly related with the network bandwidth, different bandwidth can corresponding different optimum segmentation schemes.Program is in the past cut apart common hypothesis bandwidth and is immobilized, and namely cuts apart with decision-making process according to static bandwidth computational grid transport overhead such as people such as Diaconescu, does not consider the variation of network environment factor (such as bandwidth).Because bandwidth changes frequently in the mobile network environment, traditional static routine cutting techniques usually can be conservatively according to lower bandwidth decision-making splitting scheme.Yet this splitting scheme can't take full advantage of bandwidth resources in the higher situation of bandwidth, cause network resources waste.The people such as Byung-Gon have proposed dynamic routine and have cut apart by analyzing isomery and the dynamic variation characteristic of mobile device and network environment, but program is cut apart task and certainly will be brought larger overhead burden for mobile device frequently.
Summary of the invention
For mobile device energy resource finiteness problem, in order effectively to save the energy consumption of mobile device, and overcome static routine and cut apart and be not suitable for mobile environment and the dynamic routine that bandwidth changes and cut apart overhead problem greatly, the present invention proposes a kind of mobile device power saving method based on the migration of bandwidth self-adaption code.
A kind of mobile device power saving method based on the migration of bandwidth self-adaption code of the present invention, detailed process is as follows:
Step 1, structure weighting object relationship figure, specifically: at first, application programs is carried out static program analysis, according to the method call of application program relation, obtain object in the application program and the call relation between object, object relationship figure (the Initial Object Relation Graph that the Structural application program is initial, IORG), the call relation between the node of object relationship figure and the limit corresponding application object of difference and object; Then, obtain the working time of each node object among the object relationship figure and the amount of communication data of the call relation between object (every limit) by the dynamic routine analysis, obtain weighting object relationship figure.
Step 2 based on above weighting object relationship figure, as a variable, is set up bandwidth to cut apart Optimized model based on the program of working time and power consumption.Make x iThe run location of identification nodes i, x i=1 and x i=0 represents respectively node i in mobile device and server end operation, and then the program splitting scheme can be expressed as X={x 1, x 2..., x n, n is the node number, makes b represent current bandwidth.The target that program is cut apart Optimized model is to try to achieve the optimum segmentation scheme
Figure BDA00002326518700021
Satisfy
Figure BDA00002326518700022
X PBe the model solution space, the Optimized model of program splitting scheme X when W (X, b) expression current bandwidth is b is defined as follows:
W(X,b)=w t×T(X,b)/T Local+w e×E(X,b)/E Local
Wherein, T LocalAnd E LocalWorking time when representation program all runs at mobile device respectively and power consumption; w tAnd w eRepresent respectively the weight of working time and power consumption, and satisfy w t+ w e=1; T (X, b) and E (X, b) represent respectively to adopt when current bandwidth is b program runtime and the power consumption of program splitting scheme X; The model solution space X PBe expressed as:
X p = { X | W ( X , b l ) ≤ W ( X b l opt , b l ) × ( 1 + a ) }
Wherein, bandwidth threshold b lBe the P (b 〉=b that satisfies condition l) 〉=P cMaximum bandwidth value, P cBe the probability threshold value that sets; Be bandwidth b lLower optimum segmentation scheme
Figure BDA00002326518700025
Corresponding model value; A>0 is empirical constant, in order to set W (X, b l) higher limit be
Figure BDA00002326518700026
Step 3, carrying out the bandwidth self-adaption program cuts apart, n is no more than at 200 o'clock in the node number, employing is sought the optimum segmentation scheme based on the branch-and-bound program dividing method of depth-first search strategy,, adopted and seek the optimum segmentation scheme based on the greedy method (MCGAP) of minimal cut greater than 200 o'clock at node number n.
Described branch-and-bound program dividing method is based on branch-and-bound depth-first search method, and the constraint condition of deep search comprises:
1) the Optimized model value of program splitting scheme correspondence under current bandwidth b is less than the minimum value of the Optimized model of current preservation; 2) the program splitting scheme is at bandwidth threshold b lUnder the simulated target value be not higher than and set the model higher limit
Described greedy method based on minimal cut utilizes Stoer-Wagner minimal cut algorithm to try to achieve bandwidth and is b and b lThe time the corresponding node set C that operates in mobile device bWith the node set that operates in server end Make node to be split
Figure BDA00002326518700033
Node among the V' is cut apart, adopt the largest contiguous value sort algorithm in the Stoer-Wagner minimal cut algorithm that node is sorted, then based on Greedy strategy, simultaneously according to branch-and-bound program dividing method in the constraint condition of identical deep search choose the optimum segmentation scheme.
Step 4, according to the optimum segmentation scheme that step 3 is tried to achieve, code migration and the distributed execution of realization program between mobile device and server effectively reduces the execution time of application program and the power consumption of mobile device, prolongs the battery of mobile device.
Advantage of the present invention is with good effect: (1) adopts the weighting object relationship figure of the static method construct program that combines with the dynamic routine analysis, constructed object relationship figure complexity is low, and can reflect exactly program structure, be conducive to program and cut apart, be applicable to the mobile platform of resource-constrained; (2) with bandwidth in the mobile environment as a variable, set up and to cut apart Optimized model based on the program of working time and power consumption, be applicable to the mobile environment that bandwidth changes; (3) cut apart Optimized model based on weighting object relationship figure and program, the program dividing method of two kinds of bandwidth self-adaptions has been proposed: branch-and-bound program split plot design and based on the greedy method of minimal cut, the former can obtain the optimum solution that the small-scale program is cut apart, and the latter can try to achieve the approximate optimal solution that extensive program is cut apart fast; Two kinds of methods can adapt to bandwidth and change, and effectively shorten program runtime, reduce the energy consumption of mobile device.
Description of drawings
Fig. 1 is that bandwidth self-adaption program of the present invention is cut apart process flow diagram;
Fig. 2 is example procedure figure of the present invention;
Fig. 3 is example procedure initial object graph of a relation of the present invention;
Fig. 4 is example procedure weighting object relationship figure of the present invention;
Fig. 5 is BBAP method false code synoptic diagram of the present invention;
Fig. 6 is MCGAP method false code synoptic diagram of the present invention;
Fig. 7 compares synoptic diagram for the size that adopts three kinds of method construct weighting object relationship figure;
Fig. 8 is the contrast synoptic diagram of prediction working time of embodiment of the invention Program actual run time and three kinds of methods;
Fig. 9 is emulation experiment parameter synoptic diagram of the present invention;
Figure 10 is emulation experiment weighting object relationship figure information of the present invention;
What Figure 11 was BBAP method of the present invention to three kinds of special circumstances of object module finds the solution comparison diagram sliced time;
Figure 12 contrasts synoptic diagram the working time of segmentation result correspondence under different bandwidth of BBAP method of the present invention;
Figure 13 is that segmentation result corresponding power consumption under different bandwidth of BBAP method of the present invention contrasts synoptic diagram;
Figure 14 is that segmentation result corresponding weighted model value under different bandwidth of BBAP method of the present invention contrasts synoptic diagram;
What Figure 15 was MCGAP method of the present invention to three kinds of special circumstances of object module finds the solution comparison diagram sliced time;
Figure 16 is BBAP of the present invention and MGCAP optimization model working time solving result comparison diagram;
Figure 17 contrasts synoptic diagram the working time of segmentation result correspondence under different bandwidth of MCGAP method of the present invention;
Figure 18 is that segmentation result corresponding power consumption under different bandwidth of MCGAP method of the present invention contrasts synoptic diagram;
Figure 19 is that segmentation result corresponding weighted model value under different bandwidth of MCGAP method of the present invention contrasts synoptic diagram;
Figure 20 is the average behavior comparison diagram of BBAP of the present invention and MGCAP.
Embodiment
The present invention is described in further detail below in conjunction with accompanying drawing and example.
A kind of mobile device power saving method based on the migration of bandwidth self-adaption code that the present invention proposes, at first, the methods analyst mobile applications that adopts static and dynamic state to combine, and construct its corresponding weighting object relationship figure; Secondly, the bandwidth that changes in the mobile environment as a variable, is set up and cut apart Optimized model based on the program of working time and power consumption; Then, realize the program dividing method of bandwidth self-adaption based on object relationship figure and program parted pattern; At last, realize code migration and the distributed execution of program between mobile device and server according to segmentation result, thereby reduce the execution time of application program and the power consumption of mobile device, prolong the serviceable life of mobile device battery, and the working time of application program and power consumption to change fluctuation with bandwidth less, bandwidth is changed have certain adaptability.As shown in Figure 1, mobile device power saving method of the present invention, detailed process is as follows:
Step 1, structure weighting object relationship figure.
The embodiment of the invention is set forth the construction process of weighting object relationship figure as example take a java applet, example procedure as shown in Figure 2, program comprises four class: FacePreview, ImageCapture, FaceDetection and FaceDetectionLib, wherein created an ImageCapture object and two FaceDetection objects in the main method of FacePreview class, and two FaceDetection objects have all called the ProcessBlock method of FaceDetectionLib class when carrying out self DetectFace method.At first, carry out static program analysis, utilize the byte code files of direction analysis (Points-to) technical Analysis java applet, obtain its method call graph of a relation, and by the traversal call graph obtain all objects of program and the call relation between object, thereby construct the initial object graph of a relation (IORG) of program, its node and the object of the corresponding application program of limit difference and the call relation between object.Fig. 3 is expressed as initial object graph of a relation corresponding to example procedure, S_FacePreview creates object D_ImageCapture, D_FaceDetection1 and D_FaceDetection2, object D_FaceDetection1 and D_FaceDetection2 call the method for S_FaceDetectionLib, and wherein S and D prefix represent respectively static object and dynamic object.Because internodal mutual main mode with method call embodies, parameter and rreturn value that its communication data main manifestations is method call, in the dynamic routine analysis phase, utilize Java byte code rewritten technology, can obtain the CPU working time of each node object among the program IORG and the amount of communication data on every limit (call relation between object), i.e. the weights on each node and limit among the weighting object relationship figure.Fig. 4 is expressed as weighting object relationship figure corresponding to example procedure, and for example be 50ms CPU working time of the object of node S-FacePreview representative, and the amount of communication data between node S_FacePreview and the node D_ImageCaptur is 9066bytes.
Step 2, creation facilities program (CFP) is cut apart Optimized model.
Consider the variation of bandwidth in the mobile environment, the present invention as a variable, proposes bandwidth to cut apart Optimized model based on the program of working time and power consumption, makes x iThe run location of identification nodes i, x i=1 and x i=0 represents respectively node i in mobile device and server end operation, and then the program splitting scheme can be expressed as X={x 1, x 2..., x n, b represents current bandwidth,
Figure BDA00002326518700051
Expression optimization routines splitting scheme.The target that program is cut apart Optimized model is to try to achieve the optimum segmentation scheme
Figure BDA00002326518700052
Satisfy X PThe representation model solution room, the Optimized model of splitting scheme X when W (X, b) expression current bandwidth is b is defined as follows:
W(X,b)=w t×T(X,b)/T Local+w e×E(X,b)/E Local
Wherein, T LocalAnd E LocalWorking time when representation program all runs at mobile device respectively and power consumption; w tAnd w eRepresent respectively the weight of working time and power consumption, and satisfy w t+ w e=1; T (X, b) and E (X, b) represent respectively to adopt when current bandwidth is b program runtime and the power consumption of program splitting scheme X; The model solution space X PBe expressed as:
X p = { X | W ( X , b l ) ≤ W ( X b l opt , b l ) × ( 1 + a ) }
Wherein, bandwidth threshold b lFor satisfying probability P (b 〉=b l) 〉=P cMaximum bandwidth value, P cBe probability threshold value, mainly specifically set according to the bandwidth situation of change in the wireless mobile environment, set P in the enforcement experiment of the present invention cBe 0.85.
Figure BDA00002326518700055
Be bandwidth b lLower optimum segmentation scheme
Figure BDA00002326518700056
Corresponding Optimized model value; A is empirical constant, in order to set W (X, b l) higher limit be
Figure BDA00002326518700057
Wherein the preferred value of a is relevant with concrete application program and mobile environment thereof, and the preferable range that the present invention sets is 0<a<1, and according to the experiment test to concrete application program, the preferred value of this parameter is a=0.4 among the present invention.
Adopt the program runtime T (X, b) of program splitting scheme X to be expressed as follows when bandwidth is b:
T ( X , b ) = &Sigma; 1 &le; i &le; n ( x i &times; t nli + ( 1 - x i ) &times; t nsi ) + &Sigma; 1 &le; i < j &le; n | x i - x j | &times; t ij
Wherein, t NliWith t NsiRepresent respectively node i in the working time of mobile device and server end, node i is at the t working time of mobile device NliCan obtain in dynamic analysis phase, i.e. the weight of node i is established the server computing velocity and is the k of mobile device doubly, then:
t nsi=t nli/k
W IjBe illustrated in the node i of diverse location (mobile device or server) execution and the amount of communication data of node j, node i when then bandwidth is b, data transmission period t between j IjFor:
t ij=W ij/b
Adopt the program power consumption E (X, b) of program splitting scheme X to be expressed as when bandwidth is b:
E ( X , b ) = &Sigma; 1 &le; i &le; n x i &times; E i + &Sigma; 1 &le; i < j &le; n | x i - x j | &times; E ij
Wherein, E iThe power consumption that the expression node i is carried out at mobile device, E IjThe expression node i, the power consumption of data communication between the j; Make P CpuThe cpu power of expression mobile device.Generally speaking, received power and the transmitted power difference of mobile device WiFi interface are less, all are expressed as the data communication power P w, then have:
E i=t nli×P cpu
E ij=t ij×P w
Because
Figure BDA00002326518700061
Then
Figure BDA00002326518700062
If b 〉=b l, then
Figure BDA00002326518700063
Again because P (b 〉=b l) 〉=P c, therefore optimum segmentation scheme in object module
Figure BDA00002326518700064
Satisfy:
P ( W ( X _ , b ) &le; W ( X b l opt , b l ) &times; ( 1 + a ) ) &GreaterEqual; P c
This illustrates that required optimum segmentation scheme can be with probability P under the bandwidth situation of change cMake the value of corresponding Optimized model satisfy solution room X pThe threshold restriction condition.
The weight of working time and power consumption can be set according to the mobile device dump energy with to the demand of program response time flexibly by the user in this model.Especially, work as w t=1 and w e=0 o'clock, namely corresponding working time optimization model; Work as w t=0 and w e, be the power consumption optimization model at=1 o'clock.
Step 3 is carried out the bandwidth self-adaption program and is cut apart.
Cut apart on the basis of Optimized model at above-mentioned weighting object relationship figure and program, at first, based on the depth-first search strategy, branch-and-bound program dividing method (BBAP) is proposed, the constraint condition of deep search not only satisfies the Optimized model value of splitting scheme correspondence under current bandwidth less than the minimum Optimized model value of current preservation, need guarantee also that simultaneously this is segmented in bandwidth threshold b lUnder model value be not higher than the higher limit of the Optimized model that sets, thereby avoid selected splitting scheme expense when bandwidth is low excessive, realize the adaptability that bandwidth is changed.But because the method time complexity is O (2 under worst case n) (n is the node number), the method is not suitable for the more larger application program of object (nodes), under the experiment porch of the present invention when Object node number corresponding to mobile applications greater than 200 the time, the time of finding the solution that the method calculation procedure is cut apart can obviously increase.For this reason, the present invention is directed to the large-scale application program, consider to propose didactic greedy method based on minimal cut (MCGAP) from Greedy strategy.The MCGAP method adopts the largest contiguous value sort method of using in the minimal cut Stoer-Wagner method that Object node is sorted, and the constraint condition in the BBAP method is separated the calling program splitting scheme as restriction fast based on Greedy strategy.
The present invention considers from search strategy and Greedy strategy, propose to be applicable to respectively on a small scale and branch-and-bound program split plot design (BBAP) that the large-scale application program is cut apart and based on the greedy method (MCGAP) of minimal cut, its false code is respectively such as Fig. 5, shown in Figure 6, wherein input mainly comprises current bandwidth b, bandwidth threshold b l, and corresponding weighting object relationship figure WORG=(V, E, the W of program v, W e), V, E, W vAnd W eRepresent respectively node set, limit set, node weights set and the set of limit weight; Be output as optimum segmentation scheme and the value corresponding to Optimized model of program.
As shown in Figure 5, at first to adopt the Stoer-Wagner static method to find the solution bandwidth be b to the 1st of the BBAP method the and 2 row false codes lThe time the value minV_SW of Optimized model corresponding to optimum segmentation scheme, and set b lThe higher limit minV of Optimized model value under the bandwidth.It is a maximum integer that can represent that the 3rd row initialization requires majorization of solutions model optimal value minValue.N LThe node set that expression must be carried out at local mobile device, as with the nodes such as interface object of user interactions, the vertex ticks that the capable BBAP method of 4-8 will have to operate at local mobile device is " x i=1 ", do not belong to N among the V LNode all belong to node to be split, vertex ticks to be split is " x i=-1 ".The 9th row BBSearch function adopts the depth-first search method to try to achieve the optimum solution of model based on basic branch and bound method, all current solution space is divided into two sub spaces (x in each iteration i=0 this node of expression is carried out at server; x i=1 this node of expression is carried out at local mobile device), and adopt Pruning strategy to carry out method optimization; Constraint condition among the BBSearch not only satisfies the value of splitting scheme corresponding Optimized model under current bandwidth less than the model minimum value (minValue) of current preservation, need guarantee also that simultaneously this is segmented in bandwidth threshold b lUnder the value of Optimized model be not higher than the model threshold (minV) that sets, thereby avoid splitting scheme expense when bandwidth is low excessive, guarantee the adaptability that bandwidth is changed.Optimum segmentation scheme Xmin and the optimal value minValue corresponding to Optimized model of the 10th row return information of last BBAP method.BBAP method time complexity is O (2 under the worst case n), when the application object nodes was more, computation complexity was higher, so the method is not suitable for cutting apart of larger application program.
Because bandwidth is higher, data transfer overhead is lower, therefore, the node that runs on mobile device in the higher situation of bandwidth will still run on mobile device when Bandwidth Reduction, and the node that runs on server in the low situation of bandwidth will still run on server when bandwidth raises.Note X b=(C b, S b) corresponding program optimum segmentation scheme under the expression bandwidth b, C bAnd S bRepresent that respectively bandwidth operates in the node set of mobile device and server end when being b, for program optimum segmentation scheme X corresponding under certain bandwidth B B=(C B, S B), have: (1) (2)
Figure BDA00002326518700072
In the MCGAP method, consider at b and b lBetween the bandwidth that changes, establish
Figure BDA00002326518700073
For the model optimum solution, then have
Figure BDA00002326518700074
Figure BDA00002326518700075
As shown in Figure 6, the MCGAP method at first is initialized as a maximum integer that can represent with requirement majorization of solutions model optimal value minValue in the 1st line code.2-4 is capable to try to achieve respectively static bandwidth b and b according to the Stoer-Wagner method lUnder optimization routines splitting scheme (C b, S b) and
Figure BDA00002326518700076
And according to
Figure BDA00002326518700077
Corresponding Optimized model optimal value is set bandwidth b lThe higher limit W of lower Optimized model value BlThe C that the Adjust function that 5-6 is capable in the MCGAP method is tried to achieve according to the Stoer-Wagner method bWith
Figure BDA00002326518700078
The weighting object relationship figure of adjustment programme, and determine node V' to be split,
Figure BDA00002326518700079
Namely work as bandwidth at b lAnd the cutting apart of node among the V' that only need make a strategic decision when changing between b, to reduce calculated amount.7-18 is capable namely based on the optimum segmentation scheme of minimal cut solver, and wherein eighth row MA_Order function adopts the largest contiguous value sort method in the minimal cut Stoer-Wagner method that node is sorted; 9-11 is capable to determine the splitting scheme (C, S) of current selection based on Greedy strategy, and C and S represent respectively to operate in current cutting apart the node set of local mobile device and server, and calculate this scheme at bandwidth b and b lThe Optimized model value W of lower correspondence b(C, S) and W Bl(C, S); 12-15 capable according to BBAP in identical two constraint condition: W Bl(C, S)<W BlAnd W b(C, S)<minValue, wherein W BlExpression bandwidth b lLower program is cut apart the higher limit of Optimized model, upgrades current optimum segmentation scheme (C Min, S Min); 16-17 is capable, and the Contract function is with v M-1And v mTwo nodes merge, and from node set V' deletion of node v m, A wherein 3=Contract(A 1, A 2) two node A of concrete expression deletion 1And A 2, generate a new node A 3, and for other arbitrary nodes v among the figure, set up new limit e=(A 3, v), upgrade its weight: w (A 3, v)=w (A 1, v)+w (A 2, v).Final optimal splitting scheme (the C of the 19th row return information of last MCGAP method Min, S Min) and optimal value minValue corresponding to Optimized model.
Step 4, distributed executive routine.
The optimum segmentation scheme that solves according to the program dividing method at last, code migration and the distributed execution of realization program between mobile device and server, can effectively reduce the execution time of application program and the power consumption of mobile device, prolong the battery of mobile device.
The mobile device power saving method of cutting apart based on the bandwidth self-adaption program that proposes below in conjunction with description of drawings the present invention is compared the improvement effect of additive method.At first in order to analyze weighting object relationship figure building method performance of the present invention, implementing platform saves as 3.0GB in adopting, and cpu frequency is 2.53GHz, the ThinkPad X201i notebook of operation Ubuntu 10.10 operating systems.Utilize Java bytecode analysis and optimization framework Soot instrument and byte code rewritten technology, for Dacapo Benchmarks program, weighting object relationship figure building method of the present invention (CSDPAC) and pure Static Analysis Method (PSPAC), pure dynamic analysing method (PDPAC) are compared.Fig. 7 and Fig. 8 carry out 8 example procedures (Programs) to compare, and are respectively: avrora, h2, luindex, lusearch, pmd, sunflow, tomcat and xalan.
Fig. 7 represents that size that three kinds of methods obtain object relationship figure relatively.As can be seen from Figure 7, compare with PDPAC, the weighting object relationship figure scale that CSDPAC and PSPAC construct is less.This is because CSDPAC and PSPAC all utilize the static information deletion system storehouse object of program, and figure carries out cutting to the initial program object relationship, and PDPAC has recorded information when comprising all operations such as system library object and relation thereof, and object relationship figure is larger.
The contrast of prediction working time under Fig. 8 representation program actual run time and the three kinds of methods.The working time that experimental basis program total byte yardage (Bytecode Instruction Count is called for short BIC) is come predictor.Prediction working time (Predicted Execution Time, be called for short PET) is more approaching with actual run time (Actual Execution Time is called for short AET), show the object relationship figure that constructs more accurate.As can be seen from Figure 8, the prediction of CSDPAC and PDPAC is all compared close to the program actual run time working time, shows information when performance analysis can obtain comparatively accurately program operation.And PSPAC only adopts static program analysis, and therefore information in the time of can't accurately obtaining the program operation predict that working time is less than normal, and it is not accurate enough to show that PSPAC obtains object relationship figure.Can find out that by Fig. 7 and Fig. 8 CSDPAC combines the advantage of PDPAC and PSPAC, can obtain more accurately program information, can avoid again object relationship figure larger, alleviate the computation burden that mobile applications is cut apart.
For estimating the performance of BBAP of the present invention and MCGAP method, implementing platform saves as 3.0GB in adopting, and cpu frequency is 2.53GHz, the ThinkPad X201i notebook of operation Windows 7 operating systems.The setting of implementation parameter as shown in Figure 9, Figure 10 is node number and limit number among object relationship figure corresponding to Application Instance.Emulation experiment is for three kinds of special circumstances of program parted pattern: (1) w t=1, w e=0(is optimum working time); (2) w t=0, w e=1(energetic optimum); (3) w t=0.5, w e=0.5, be implemented as follows respectively step:
(1) finds the solution respectively optimum segmentation Cut (W, S_W, 100) and Cut (W, BBAP, 100) (or Cut (W, MCGAP, 100)) under the bandwidth 100kb/s with Stoer-Wagner method and BBAP/MCGAP method; Wherein S_W is the abbreviation of Stoer-Wagner method, and W represents Optimized model;
(2) calculate respectively above two and cut apart Cut (W, S_W, 100) and Cut (W, BBAP, 100) (or Cut (W, MCGAP, 100)) the model value W{Cut (W, S_W, 100) of correspondence under different bandwidth b, b}, W{Cut (W, BBAP, 100), b}(or W{Cut (W, MCGAP, 100), b});
(3) calculate successively model optimal value Wmin (b) corresponding under the different bandwidth b with the Stoer-Wagner method;
(4) calculation procedure is all carried out corresponding model value WLocal at mobile device.
Distinguishingly, for more directly perceived, for (1) w t=1, w e=0 (working time is optimum) and (2) w t=0, w e=1(energetic optimum) two kinds of situations, experimental result is converted into program runtime and power consumption with the model value equivalence, and symbolic representation uses respectively ' T ' (Time) (Energy) to replace corresponding ' W ' (Weight) with ' E ' among the figure, be W{Cut (W, S_W, 100), b}, W{Cut (W, BBAP, 100), b}(or W{Cut (W, MCGAP, 100), b}), Wmin (b) and WLocal are at (1) w t=1, w eIn=0 situation respectively correspondence be expressed as T{Cut (T, S W, 100), b}, T{Cut (T, BBAP, 100), b}(or T{Cut (T, MCGAP, 100), b}), Tmin (b) and TLocal, at (2) w t=0, w eIn=1 situation respectively correspondence be expressed as E{Cut (E, S_W, 100), b}, E{Cut (E, BBAP, 100), b}(or E{Cut (E, MCGAP, 100), b}), Emin (b) and ELocal.
Figure 11 represents that the BBAP method is to three kinds of object modules finding the solution the time in particular cases.Respectively corresponding (1) w of Model_T, Model_E and Model_W among the figure t=1 and w e=0; (2) w t=0 and w e=1; (3) w t=0.5 and w e=0.5 three kind of situation.Can find out that for the less figure of node number, BBAP can obtain optimum solution within a short period of time; For the more figure of node number, it is longer that it finds the solution the time.This explanation BBAP is applicable to the less figure of scale, and for the more figure of nodes, as for the lusearch program, the computing cost of BBAP obviously increases.
Figure 12, Figure 13 and Figure 14 are expressed as respectively BBAP and additive method corresponding program runtime (w under the bandwidth situation of change t=1, w e=0), power consumption (w t=0, w e=1) and optimization model value (w t=0.5, w e=0.5) performance comparison figure.Provided respectively the operation contrast four programs in Figure 12~14, four programs are respectively: (A) RandomGraph1 program, (B) RandomGraph2 program, (C) lusearch program, (D) avrora program.In Figure 12, T{Cut (T, BBAP, 100), b} and T{Cut (T, the optimum segmentation scheme Cut (T that obtains with BBAP and Stoer-Wagner method when S_W, 100), b} represents respectively that bandwidth is 100kb/s, BBAP, 100) and Cut (T, S W, 100) corresponding program runtime under different bandwidth b.Tmin (b) is illustrated in the minimal path sort run time corresponding to optimum segmentation scheme of repeatedly trying to achieve with the Stoer-Wagner method under each bandwidth b.TLocal represents that not employing program cuts apart, and namely program is all in the local time of carrying out of mobile device.Can find out, T{Cut (T, BBAP, 100), b} and Tmin (b) are as a rule all less than TLocal, and T{Cut (T, S_W, 100), b} in the larger situation of bandwidth also less than TLocal, this explanation utilizes program to cut apart code migration, the working time that can effectively reduce application program.When bandwidth significantly descended, { Cut (T, S_W, 100), b} sharp increase changed fluctuation greatly with bandwidth to the running time T that static routine optimum segmentation Cut (T, S_W, 100) is corresponding.And T{Cut (T, BBAP, 100), b} is close to the shortest running time T min of program (b) under the different bandwidth, and fluctuation is comparatively mild.Program power consumption and optimization model value that Figure 13 and Figure 14 are corresponding have similar conclusion.Static Stoer-Wagner method is compared in this explanation, and BBAP can adapt to bandwidth preferably to be changed, and reduces application program working time and power consumption; And with each different bandwidth under all need recomputate the dynamic approach of cutting apart and compare, BBAP only need be cut apart once, has reduced to cut apart expense.
Figure 15 is the MCGAP method to three kinds of object modules finding the solution the time in particular cases.Respectively corresponding (1) w of Model_T, Model_E and Model_W t=1 and w e=0(is optimum working time); (2) w t=0 and w e=1(energetic optimum); (3) w t=05 and w e=0.5.Compare with Figure 11, can find out that the time of finding the solution of MCGAP method and BBAP method were more or less the same when the node of graph number was less; And the time of finding the solution of node number MCGAP method when more obviously reduces.
Figure 16 is program the shortest working time of the comparison diagram that MCGAP method and BBAP method are found the solution under different bandwidth.Wherein b represents bandwidth, and B, M and P represent respectively the degree of accuracy of BBAP, MCGAP method and MCGAP approximate solution.If
Figure BDA00002326518700101
Be the model optimum solution that BBAP solves, the approximate optimal solution of X for adopting the MCGAP method to try to achieve, then W (X, b)/
Figure BDA00002326518700102
Degree of accuracy for MCGAP method approximate solution.As can be seen from Figure 16, degree of accuracy is higher, can be used for trying to achieve quickly the approximate optimal solution of larger object relationship figure close to optimum solution corresponding to BBAP the minimal path sort run time that MCGAP finds the solution.
Figure 17, Figure 18 and Figure 19 are respectively MCGAP and additive method corresponding program runtime (w under the bandwidth situation of change t=1, w e=0), power consumption (w t=0, w e=1) and optimization model value (w t=0.5, w e=0.5) performance comparison figure.Provided respectively the operation contrast four programs in Figure 17~19, four programs are respectively: (a) avrora program, (b) lusearch program, (c) luindex program, (d) h2 program.By Figure 17, Figure 18 and Figure 19 can find out, all run at mobile device with program and compare, and utilize program to cut apart with code and move the power consumption that can reduce mobile device, shorten the working time of application program; Compare and cut apart the Stoer-Wagner method with static routine, simulated target value corresponding to MCGAP is close to the minimum value under the different bandwidth, and be comparatively mild with the bandwidth fluctuation.As seen, along with the variation of bandwidth in the environment, MCGAP can avoid the simulated target value because Bandwidth Reduction sharply increases, and effectively shortens program runtime, reduces the power consumption of mobile device.Although the better performances of dynamic approach among the figure, BBAP and MCGAP have all avoided dynamic approach larger expense of computed segmentation repeatedly under different bandwidth.If consider the computing cost of dynamic approach repeated segmentation, its performance will obviously descend.
Figure 20 is the average behavior comparison diagram of BBAP and MCGAP method.TR1 represents respectively to compare the number percent that program average operating time and power consumption reduce when adopting the BBAP/MCGAP method with adopting the Stoer-Wagner method with ER1; TR2 represents respectively that with ER2 all running at mobile device with program compares, the number percent that program average operating time and power consumption reduce when adopting BBAP or MCGAP method.Can find out, all running at mobile device with program compares, adopt corresponding program average operating time and the power consumption of BBAP method to reduce respectively 44.17% and 34.47%, adopt program average operating time and the power consumption of MCGAP method to reduce respectively 37.44% and 46.09%; Compare and cut apart the Stoer-Wagner method with static routine, the average operating time that BBAP is corresponding and power consumption reduced respectively 26.38% and corresponding program average operating time and the power consumption of 25.88%, MCGAP reduced respectively 26.99% and 30.58%.
By above implementation experimental verification, can draw, in the situation that bandwidth constantly changes, the mobile device power saving method of moving with code of cutting apart based on the bandwidth self-adaption program of the present invention, can effectively reduce the execution time of application program and the power consumption of mobile device, thereby prolong the battery of mobile device.

Claims (5)

1. mobile device power saving method based on bandwidth self-adaption code migration in the situation that the mobile environment bandwidth constantly changes, is characterized in that this mobile device power saving method realizes by following step:
Step 1: structure weighting object relationship figure, specifically: at first, carry out static program analysis, according to the method call relation of program, the object relationship figure that constructor is initial, the object in each node among the object relationship figure and the corresponding program of limit difference and the call relation between object; Then, obtain the working time of each node object among the object relationship figure and the amount of communication data on every limit by the dynamic routine analysis, obtain weighting object relationship figure;
Step 2: based on weighting object relationship figure, bandwidth as a variable, is set up and cut apart Optimized model based on the program of working time and power consumption, specifically: make x iThe run location of identification nodes i, x i=1 and x i=0 represents respectively node i in mobile device and server end operation, and the program splitting scheme is expressed as X={x 1, x 2..., x n, n is the node number among the weighting object relationship figure, then the program target of cutting apart Optimized model is to try to achieve the optimum segmentation scheme
Figure FDA00002326518600011
Satisfy X PBe the model solution space, b represents current bandwidth, and the Optimized model of program splitting scheme X when W (X, b) expression current bandwidth is b is defined as follows:
W(X,b)=w t×T(X,b)/T Local+w e×E(X,b)/E Local
Wherein, T LocalAnd E LocalRepresentation program all runs at working time and the power consumption of mobile device respectively; w tAnd w eRepresent respectively the weight of working time and power consumption, and satisfy w t+ w e=1; T (X, b) and E (X, b) represent respectively to adopt when current bandwidth is b program runtime and the power consumption of program splitting scheme X;
Described model solution space X PBe defined as: Wherein, bandwidth threshold b lFor satisfying probability P (b 〉=b l) 〉=P cMaximum bandwidth value, P cBe the probability threshold value that sets; Be bandwidth b lLower optimization routines splitting scheme
Figure FDA00002326518600015
Corresponding Optimized model value; Empirical constant a>0;
Step 3: carry out the bandwidth self-adaption program and cut apart, n is no more than at 200 o'clock in the node number, adopts branch-and-bound program dividing method to seek the optimum segmentation scheme,, adopts and seeks the optimum segmentation scheme based on the greedy method of minimal cut greater than 200 o'clock at node number n;
Described branch-and-bound program dividing method is based on branch-and-bound depth-first search method, and the constraint condition of deep search comprises:
1) the Optimized model value of program splitting scheme correspondence under current bandwidth b is less than the minimum value of the Optimized model of current preservation; 2) the program splitting scheme is at bandwidth threshold b lUnder the simulated target value be not higher than and set the model higher limit
Figure FDA00002326518600016
Described greedy method based on minimal cut utilizes Stoer-Wagner minimal cut algorithm to try to achieve bandwidth and is b and b lThe time the corresponding node set C that operates in mobile device bWith the node set that operates in server end
Figure FDA00002326518600017
Make node to be split
Figure FDA00002326518600018
Node among the V' is cut apart, adopt the largest contiguous value sort algorithm in the Stoer-Wagner minimal cut algorithm that node is sorted, then based on Greedy strategy, simultaneously according to branch-and-bound program dividing method in the constraint condition of identical deep search choose the optimum segmentation scheme;
Step 4: according to the optimum segmentation scheme that obtains, code migration and the distributed execution of realization program between mobile device and server.
2. a kind of mobile device power saving method based on the migration of bandwidth self-adaption code according to claim 1 is characterized in that described probability threshold value P cBe set as 0.85.
3. a kind of mobile device power saving method based on the migration of bandwidth self-adaption code according to claim 1 is characterized in that described empirical constant a is set as 0.4.
4. a kind of mobile device power saving method based on the migration of bandwidth self-adaption code according to claim 1 is characterized in that, adopts the program runtime T (X, b) of program splitting scheme X to be when the bandwidth described in the step 2 is b:
T ( X , b ) = &Sigma; 1 &le; i &le; n ( x i &times; t nli + ( 1 - x i ) &times; t nsi ) + &Sigma; 1 &le; i < j &le; n | x i - x j | &times; t ij
Wherein, t NliWith t NsiRepresent that respectively node i is in the working time of mobile device and server end; t NliBe the weight of corresponding node i among the weighting object relationship figure, establish the server computing velocity and be the k of mobile device doubly, then: t Nsi=t Nli/ k; Make W IjThe amount of communication data of expression mobile device and server end, node i when then bandwidth is b, data transmission period t between j IjFor: t Ij=W Ij/ b.
5. a kind of mobile device power saving method based on the migration of bandwidth self-adaption code according to claim 1 is characterized in that, adopts the program power consumption E (X, b) of program splitting scheme X to be when the bandwidth described in the step 2 is b:
E ( X , b ) = &Sigma; 1 &le; i &le; n x i &times; E i + &Sigma; 1 &le; i < j &le; n | x i - x j | &times; E ij
Wherein, E iThe power consumption that the expression node i is moved at mobile device, E i=t Nli* P CpuE IjThe expression node i, the power consumption of data transmission between the j, E Ij=t Ij* P wP CpuThe cpu power of expression mobile device, P wThe data communication power of expression mobile device WiFi interface.
CN201210421845.9A 2012-09-28 2012-10-30 A kind of mobile device power saving method based on bandwidth self-adaption code migration Expired - Fee Related CN102968173B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210421845.9A CN102968173B (en) 2012-09-28 2012-10-30 A kind of mobile device power saving method based on bandwidth self-adaption code migration

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN201210367870 2012-09-28
CN201210367870.3 2012-09-28
CN2012103678703 2012-09-28
CN201210421845.9A CN102968173B (en) 2012-09-28 2012-10-30 A kind of mobile device power saving method based on bandwidth self-adaption code migration

Publications (2)

Publication Number Publication Date
CN102968173A true CN102968173A (en) 2013-03-13
CN102968173B CN102968173B (en) 2015-08-26

Family

ID=47798354

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210421845.9A Expired - Fee Related CN102968173B (en) 2012-09-28 2012-10-30 A kind of mobile device power saving method based on bandwidth self-adaption code migration

Country Status (1)

Country Link
CN (1) CN102968173B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106909449A (en) * 2017-01-11 2017-06-30 西可通信技术设备(河源)有限公司 A kind of computation migration method and apparatus of program of mobile terminal
CN109981546A (en) * 2017-12-28 2019-07-05 北京京东尚科信息技术有限公司 The method and apparatus for obtaining the far call relationship between application module

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5579518A (en) * 1993-03-19 1996-11-26 Fuji Xerox Co., Ltd. Message compiler for object-oriented language that statically produces object code by provisionally identifying a set of candidate types
JPH09179738A (en) * 1995-12-26 1997-07-11 Hitachi Ltd Object-oriented language processing method and processor
CN101473301A (en) * 2006-06-13 2009-07-01 微软公司 Iterative static and dynamic software analysis
US20100131721A1 (en) * 2008-11-21 2010-05-27 Richard Title Managing memory to support large-scale interprocedural static analysis for security problems
US20120060142A1 (en) * 2010-09-02 2012-03-08 Code Value Ltd. System and method of cost oriented software profiling

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5579518A (en) * 1993-03-19 1996-11-26 Fuji Xerox Co., Ltd. Message compiler for object-oriented language that statically produces object code by provisionally identifying a set of candidate types
JPH09179738A (en) * 1995-12-26 1997-07-11 Hitachi Ltd Object-oriented language processing method and processor
CN101473301A (en) * 2006-06-13 2009-07-01 微软公司 Iterative static and dynamic software analysis
US20100131721A1 (en) * 2008-11-21 2010-05-27 Richard Title Managing memory to support large-scale interprocedural static analysis for security problems
US20120060142A1 (en) * 2010-09-02 2012-03-08 Code Value Ltd. System and method of cost oriented software profiling

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
于利前等: "《静动态结合的Java程序不变性分析方法》", 《计算机学报》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106909449A (en) * 2017-01-11 2017-06-30 西可通信技术设备(河源)有限公司 A kind of computation migration method and apparatus of program of mobile terminal
CN106909449B (en) * 2017-01-11 2021-03-23 西可通信技术设备(河源)有限公司 Computing migration method and device for mobile terminal program
CN109981546A (en) * 2017-12-28 2019-07-05 北京京东尚科信息技术有限公司 The method and apparatus for obtaining the far call relationship between application module
CN109981546B (en) * 2017-12-28 2021-08-20 北京京东尚科信息技术有限公司 Method and device for acquiring remote call relation between application modules

Also Published As

Publication number Publication date
CN102968173B (en) 2015-08-26

Similar Documents

Publication Publication Date Title
Wu et al. An efficient application partitioning algorithm in mobile environments
Niu et al. Bandwidth-adaptive partitioning for distributed execution optimization of mobile applications
Niu et al. Selecting proper wireless network interfaces for user experience enhancement with guaranteed probability
CN107016175A (en) It is applicable the Automation Design method, device and the optimization method of neural network processor
CN112433819A (en) Heterogeneous cluster scheduling simulation method and device, computer equipment and storage medium
CN104202373A (en) Method and system for migrating mobile cloud computing
Billet et al. From task graphs to concrete actions: a new task mapping algorithm for the future internet of things
WO2020248511A1 (en) Method for realizing control over terminal utilization on the basis of run-time model
Chéour et al. Evaluation of simulator tools and power‐aware scheduling model for wireless sensor networks
Balis et al. Holistic approach to management of IT infrastructure for environmental monitoring and decision support systems with urgent computing capabilities
Jha et al. Multiobjective deployment of data analysis operations in heterogeneous IoT infrastructure
CN104252383A (en) Reconfigurable-calculation hardware and software task partitioning method based on chaotic particle swarm optimization algorithm
CN113722218A (en) Software defect prediction model construction method based on compiler intermediate representation
CN110852930B (en) FPGA graph processing acceleration method and system based on OpenCL
CN102968173B (en) A kind of mobile device power saving method based on bandwidth self-adaption code migration
CN102681855A (en) Model-to-code converting method facing wireless sensor network
CN113014649B (en) Cloud Internet of things load balancing method, device and equipment based on deep learning
CN102779025A (en) Parallel PLSA (Probabilistic Latent Semantic Analysis) method based on Hadoop
CN102902804A (en) High-efficiency BPEL (business process execution language) service dynamic updating method
Niu et al. Bandwidth-adaptive application partitioning for execution time and energy optimization
CN105653523A (en) Energy consumption supervise network of things basis platform system building method
Di Marco et al. Model-driven approach to Agilla Agent generation
Zhang et al. Reliable and efficient task allocation method in wireless sensor networks
Matthé Applying reconfiguration cost and control pattern modeling to self-adaptive systems
Mouline et al. Enabling temporal-aware contexts for adaptative distributed systems

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20150826

Termination date: 20151030

EXPY Termination of patent right or utility model