CN102968173B - A kind of mobile device power saving method based on bandwidth self-adaption code migration - Google Patents

A kind of mobile device power saving method based on bandwidth self-adaption code migration Download PDF

Info

Publication number
CN102968173B
CN102968173B CN201210421845.9A CN201210421845A CN102968173B CN 102968173 B CN102968173 B CN 102968173B CN 201210421845 A CN201210421845 A CN 201210421845A CN 102968173 B CN102968173 B CN 102968173B
Authority
CN
China
Prior art keywords
program
bandwidth
mobile device
node
segmentation
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.)
Expired - Fee Related
Application number
CN201210421845.9A
Other languages
Chinese (zh)
Other versions
CN102968173A (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

Abstract

The present invention proposes a kind of mobile device power saving method based on bandwidth self-adaption code migration, by carrying out Static and dynamic analysis to mobile applications, construct a kind of weighting object relationship figure, thus program segmentation problem is converted into object relationship figure segmentation problem; The bandwidth changed in mobile environment is regarded as a variable, propose the object module based on working time and energetic optimum; For program segmentation Optimized model, the branch-and-bound program split plot design (BBAP) of bandwidth self-adaption and the greedy program split plot design (MCGAP) based on minimal cut are proposed; Finally realize the code migration of mobile applications between mobile device and server and distributed execution based on obtained splitting scheme.The inventive method effectively can shorten the working time of mobile applications, reduces the power consumption of mobile device, and has good adaptability to bandwidth change.

Description

A kind of mobile device power saving method based on bandwidth self-adaption code migration
Technical field
The invention belongs to mobile computing field, be specifically related to a kind of mobile device power saving method based on bandwidth self-adaption code migration.
Background technology
Mobile device, because of its light and handy advantage such as portable, easy to use, becomes the computing platform that customer volume is maximum gradually.Along with the demand of mobile subscriber 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 migration technology based on program segmentation is applied to mobile computing field gradually, becomes a kind of effective ways alleviating mobile device resource-constrained problem.According to program splitting scheme, a part of code migration of application program is run to server end, the working time of application program can be shortened, reduce the energy ezpenditure of mobile device.
The complicacy of object-oriented application program and diversity bring challenge for realizing program segmentation.Chinese scholars has carried out in this field studying comparatively widely and proposing corresponding scheme.The MAUI system that the people such as Eduardo propose is the code migration system based on Microsoft general purpose language Runtime Library CLR, needs programmer to add " Remotable " mark to the object that can perform at far-end server in program source code in advance; The Cuckoo system that the people such as Roelof propose is by expansion Android compiling system, for programmer provides one programming model easily, auxiliary routine person can complete part work (realization of such as remote method invocation (RMI)), but still need programmer manually to realize; The people such as Shumao are then by the program segmentation on Middleware implementation mobile device and migration.These schemes depend on programmer or middleware instrument, limit its application.
So the researchers such as Sinha further provide auto-programming splitting scheme, this method, without the need to by additional means, does not rely on programmer, can realize program auto Segmentation pellucidly, be applicable to mobile platform.In recent years, the auto Segmentation scheme of object-oriented program mostly by carrying out pure static analysis or pure performance analysis constructor object relationship figure to program, and realizes program segmentation based on object relationship figure (Object Relation Graph, ORG).The Doorastha system that the people such as Spiegel and Dahm propose all adopts pure static program analysis method construct object relationship figure, accurately can not reflect the run mode information of program, thus cannot obtain optimum program segmentation result.The people such as people and Bialek such as Messer then adopt pure dynamic routine analytical approach to construct object relationship figure, compare pure static analysis, pure dynamic routine analysis can obtain information when more accurate program is run, but the object relationship figure bulky complex obtained, cause program to split expense excessive, be 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, propose the program splitting scheme that is applicable to different target model and the distributed system framework based on Java, but program dividing method is not specifically studied, do not consider the change of bandwidth in mobile environment.
The key of program segmentation is the optimum segmentation scheme of how option program, realizes that energy consumption of mobile equipment is minimum and data transfer overhead is minimum as far as possible.Because data transfer overhead is directly related with the network bandwidth, the optimum segmentation scheme that different bandwidth can be corresponding different.Program segmentation in the past usually hypothesis bandwidth immobilizes, and as namely the people such as Diaconescu are split with decision-making process according to static bandwidth computational grid transport overhead, does not consider the change of network environmental factors (as bandwidth).Because in mobile network environment, bandwidth change is frequent, traditional static routine cutting techniques usually can conservatively according to lower bandwidth decision-making splitting scheme.But this splitting scheme cannot make full use of bandwidth resources in the higher situation of bandwidth, causes network resources waste.The people such as Byung-Gon, by analyzing isomery and the dynamic variation characteristic of mobile device and network environment, propose dynamic routine segmentation, but program segmentation task certainly will bring larger overhead burden for mobile device frequently.
Summary of the invention
For mobile device energy resource finiteness problem, in order to effectively save the energy ezpenditure of mobile device, and overcoming mobile environment and the dynamic routine segmentation overhead problem greatly that static routine segmentation is not suitable for bandwidth change, the present invention proposes a kind of mobile device power saving method based on bandwidth self-adaption code migration.
A kind of mobile device power saving method based on bandwidth self-adaption code migration of the present invention, detailed process is as follows:
Step 1, structure weighting object relationship figure, specifically: first, application programs carries out static program analysis, according to the method call relation of application program, obtain the object in application program and the call relation between object, object relationship figure (the Initial Object Relation Graph that Structural application program is initial, IORG), node and the limit call relation respectively between corresponding application object and object of object relationship figure; Then, obtained the amount of communication data of the call relation (every bar limit) between working time of each node object in object relationship figure and object by dynamic routine analysis, obtain weighting object relationship figure.
Step 2, based on above weighting object relationship figure, using bandwidth as a variable, sets up the program segmentation Optimized model based on working time and power consumption.Make x ithe run location of identification nodes i, x i=1 and x i=0 represents that node i is run at mobile device and server end respectively, then program splitting scheme can be expressed as X={x 1, x 2..., x n, n is node number, makes b represent current bandwidth.The target of program segmentation Optimized model is to try to achieve optimum segmentation scheme meet x pfor model solution space, the Optimized model of program splitting scheme X when W (X, b) represents that 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 the weight of working time and power consumption respectively, and meet w t+ w e=1; Program runtime and the power consumption of program splitting scheme X is adopted when T (X, b) and E (X, b) represents that current bandwidth is b respectively; 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 the P (b>=b that satisfies condition l)>=P cmaximum bandwidth value, P cfor set probability threshold value; for bandwidth b llower optimum segmentation scheme corresponding model value; A > 0 is empirical constant, in order to set W (X, b l) higher limit be
Step 3, carry out the segmentation of bandwidth self-adaption program, when node number n is no more than 200, the branch-and-bound program dividing method based on depth-first search strategy is adopted to find optimum segmentation scheme, when node number n is greater than 200, the greedy method (MCGAP) based on minimal cut is adopted to find optimum segmentation scheme.
Described branch-and-bound program dividing method is based on branch-and-bound depth-first search, and the constraint condition of deep search comprises: the Optimized model value that 1) program splitting scheme is corresponding under current bandwidth b is less than the minimum value of the Optimized model of current preservation; 2) program splitting scheme is at bandwidth threshold b lunder simulated target value not higher than set model higher limit
The described greedy method based on minimal cut, utilizes Stoer-Wagner minimal cut algorithm to try to achieve bandwidth for b and b ltime the corresponding node set C operating in mobile device bwith the node set operating in server end make node to be split v' interior joint is split, the largest contiguous value sort algorithm in Stoer-Wagner minimal cut algorithm is adopted to sort to node, then based on Greedy strategy, choose optimum segmentation scheme according to the constraint condition of the deep search identical with branch-and-bound program dividing method simultaneously.
Step 4, according to the optimum segmentation scheme that step 3 is tried to achieve, the code migration of the program that realizes between mobile device and server and distributed execution, effectively reduce the execution time of application program and the power consumption of mobile device, extends the battery of mobile device.
Advantage of the present invention is with good effect: the weighting object relationship figure of the method construct program that (1) adopts static and dynamic Status process analysis to combine, constructed object relationship figure complexity is low, and program structure can be reflected exactly, be conducive to program segmentation, be applicable to the mobile platform of resource-constrained; (2) using bandwidth in mobile environment as a variable, set up the program segmentation Optimized model based on working time and power consumption, be applicable to the mobile environment of bandwidth change; (3) based on weighting object relationship figure and program segmentation Optimized model, propose the program dividing method of two kinds of bandwidth self-adaptions: branch-and-bound program split plot design and the greedy method based on minimal cut, the former can obtain the optimum solution of program segmentation on a small scale, and the latter can try to achieve the approximate optimal solution of extensive program segmentation fast; Two kinds of methods can adapt to bandwidth change, effectively shorten program runtime, reduce the energy ezpenditure of mobile device.
Accompanying drawing explanation
Fig. 1 is bandwidth self-adaption program of the present invention segmentation 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 schematic diagram of the present invention;
Fig. 6 is MCGAP method false code schematic diagram of the present invention;
Fig. 7 is that the size of employing three kinds of method construct weighting object relationship figure compares schematic diagram;
Fig. 8 is the contrast schematic diagram of prediction working time of embodiment of the present invention Program actual run time and three kinds of methods;
Fig. 9 is emulation experiment parameter schematic diagram of the present invention;
Figure 10 is emulation experiment weighting object relationship figure information of the present invention;
Figure 11 is that BBAP method of the present invention solves comparison diagram sliced time to object module three kinds of special circumstances;
Figure 12 contrasts schematic diagram the working time that the segmentation result of BBAP method of the present invention is corresponding under different bandwidth;
Figure 13 is the power consumption contrast schematic diagram that the segmentation result of BBAP method of the present invention is corresponding under different bandwidth;
Figure 14 is the weighted model value contrast schematic diagram that the segmentation result of BBAP method of the present invention is corresponding under different bandwidth;
Figure 15 is that MCGAP method of the present invention solves comparison diagram sliced time to object module three kinds of special circumstances;
Figure 16 is BBAP and MGCAP optimization model working time solving result comparison diagram of the present invention;
Figure 17 contrasts schematic diagram the working time that the segmentation result of MCGAP method of the present invention is corresponding under different bandwidth;
Figure 18 is the power consumption contrast schematic diagram that the segmentation result of MCGAP method of the present invention is corresponding under different bandwidth;
Figure 19 is the weighted model value contrast schematic diagram that the segmentation result of MCGAP method of the present invention is corresponding under different bandwidth;
Figure 20 is the average behavior comparison diagram of BBAP and MGCAP of the present invention.
Embodiment
Below in conjunction with accompanying drawing and example, the present invention is described in further detail.
A kind of mobile device power saving method based on bandwidth self-adaption code migration that the present invention proposes, first, adopts the methods analyst mobile applications that static and dynamic state combines, and constructs the weighting object relationship figure of its correspondence; Secondly, using the bandwidth that changes in mobile environment as a variable, the program segmentation Optimized model based on working time and power consumption is set up; Then, the program dividing method of bandwidth self-adaption is realized based on object relationship figure and program parted pattern; Finally, the code migration of program between mobile device and server and distributed execution is realized according to segmentation result, thus reduce the execution time of application program and the power consumption of mobile device, extend the serviceable life of mobile device battery, and the working time of application program and power consumption are less with bandwidth change fluctuation, have certain adaptability to bandwidth change.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 present invention sets forth the construction process of weighting object relationship figure for a java applet, example procedure as shown in Figure 2, routine package is containing four classes: FacePreview, ImageCapture, FaceDetection and FaceDetectionLib, create an ImageCapture object and two FaceDetection objects in the main method of wherein FacePreview class, and two FaceDetection objects all have invoked the ProcessBlock method of FaceDetectionLib class when performing self DetectFace method.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 obtain the call relation between all objects of program and object by traversal call graph, thus construct the initial object graph of a relation (IORG) of program, the call relation between the object of its node and the corresponding application program of limit difference and 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 calls the method for S_FaceDetectionLib, and wherein S_ and D_ prefix represents static object and dynamic object respectively.Because the internodal mutual mode mainly called in method embodies, its communication data main manifestations is parameter and the rreturn value of method call, in the dynamic routine analysis phase, utilize Java bytecode rewriting technique, the CPU working time of each node object in program IORG and the amount of communication data on every bar limit (call relation between object) can be obtained, i.e. the weights on each node and limit in weighting object relationship figure.Fig. 4 is expressed as weighting object relationship figure corresponding to example procedure, and CPU working time of such as, object representated by node S_FacePreview is 50ms, and the amount of communication data between node S_FacePreview and node D_ImageCapture is 9066bytes.
Step 2, creation facilities program (CFP) segmentation Optimized model.
Consider the change of bandwidth in mobile environment, bandwidth as a variable, is proposed the program segmentation Optimized model based on working time and power consumption, makes x by the present invention ithe run location of identification nodes i, x i=1 and x i=0 represents that node i is run at mobile device and server end respectively, then program splitting scheme can be expressed as X={x 1, x 2..., x n, b represents current bandwidth, represent optimization routines splitting scheme.The target of program segmentation Optimized model is to try to achieve optimum segmentation scheme meet x prepresent model solution space, the Optimized model of splitting scheme X when W (X, b) represents that 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 the weight of working time and power consumption respectively, and meet w t+ w e=1; Program runtime and the power consumption of program splitting scheme X is adopted when T (X, b) and E (X, b) represents that current bandwidth is b respectively; 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 meeting probability P (b>=b l)>=P cmaximum bandwidth value, P cfor probability threshold value, mainly specifically set according to the bandwidth situation of change in wireless mobile environment, in enforcement experiment of the present invention, set P cbe 0.85. for bandwidth b llower optimum segmentation scheme corresponding Optimized model value; A is empirical constant, in order to set W (X, b l) higher limit be wherein the preferred value of a is relevant with embody rule program and mobile environment thereof, the preferable range of the present invention's setting is 0 < a < 1, according to the experiment test to embody rule program in the present invention, the preferred value of this parameter is a=0.4.
The program runtime T (X, b) of program splitting scheme X is adopted 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 the working time of node i at mobile device and server end respectively, node i is at t working time of mobile device nlican obtain in dynamic analysis phase, i.e. the weight of node i, if server computing velocity is k times of mobile device, then:
t nsi=t nli/k
W ijrepresent the amount of communication data of node i and the node j performed at diverse location (mobile device or server), then node i when bandwidth is b, data transmission period t between j ijfor:
t ij=W ij/b
Program power consumption E (X, b) of program splitting scheme X is adopted 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 irepresent the power consumption that node i performs on the mobile apparatus, E ijrepresent node i, the power consumption of data communication between j; Make P cpurepresent the cpu power of mobile device.Generally, received power and the transmitted power difference of mobile device WiFi interface are less, are all expressed as data traffic power P w, then have:
E i=t nli×P cpu
E ij=t ij×P w
Due to X &OverBar; &Element; X P , Then W ( X &OverBar; , b l ) &le; W ( X b l opt , b l ) &times; ( 1 + a ) . If b>=b l, then W ( X &OverBar; , b ) &le; W ( X &OverBar; , b l ) &le; W ( X b l opt , b l ) &times; ( 1 + a ) ; Again due to P (b>=b l)>=P c, therefore optimum segmentation scheme in object module meet:
P ( W ( X &OverBar; , b ) &le; W ( X b l opt , b l ) &times; ( 1 + a ) ) &GreaterEqual; P c
This illustrates that required optimum segmentation scheme can with probability P under bandwidth situation of change cthe value of corresponding Optimized model is made to meet solution room X pthreshold restriction condition.
In this model, the weight of working time and power consumption can be set according to mobile device dump energy with to the demand of program response time flexibly by user.Especially, w is worked as t=1 and w ewhen=0, i.e. correspondence optimization model working time; Work as w t=0 and w ewhen=1, be power consumption optimization model.
Step 3, carries out the segmentation of bandwidth self-adaption program.
Split on the basis of Optimized model at above-mentioned weighting object relationship figure and program, first, based on depth-first search strategy, branch-and-bound program dividing method (BBAP) is proposed, the constraint condition of deep search not only meets the minimum Optimized model value that splitting scheme Optimized model value corresponding under current bandwidth is less than current preservation, also needs to ensure that this is segmented in bandwidth threshold b simultaneously lunder model value not higher than the higher limit of set Optimized model, thus avoid selected splitting scheme expense when bandwidth is lower excessive, realize the adaptability to bandwidth change.But because method time complexity is O (2 in the worst cases n) (n is node number), the method is not suitable for the more larger application program of object (nodes), under experiment porch of the present invention when the Object node number that mobile applications is corresponding is greater than 200, the time that solves of the method calculation procedure segmentation can obviously increase.For this reason, the present invention is directed to large-scale application program, consider to propose the didactic greedy method based on minimal cut (MCGAP) from Greedy strategy.MCGAP method adopts the largest contiguous value sort method used in minimal cut Stoer-Wagner method to sort to Object node, with the constraint condition in BBAP method for restriction, separates calling program splitting scheme fast based on Greedy strategy.
The present invention considers from search strategy and Greedy strategy, propose to be applicable to the branch-and-bound program split plot design (BBAP) of small-scale and the segmentation of large-scale application program and the greedy method (MCGAP) based on minimal cut respectively, its false code is respectively as Fig. 5, shown in Fig. 6, wherein input and mainly comprise current bandwidth b, bandwidth threshold b l, and weighting object relationship figure WORG=(V, E, W that program is corresponding v, W e), V, E, W vand W erepresent node set, limit set, node weights set and limit weight set respectively; Export as the optimum segmentation scheme of program and value corresponding to Optimized model.
As shown in Figure 5, first the 1st and 2 row false codes of BBAP method adopt Stoer-Wagner static method to solve bandwidth is b ltime the value minV_SW of Optimized model corresponding to optimum segmentation scheme, and set b lthe higher limit minV of Optimized model value under bandwidth.Majorization of solutions model optimal value minValue required by 3rd row initialization is a maximum integer that can represent.N lthe node set that expression must perform on local mobile device, as nodes such as the interface object with user interactions, the vertex ticks having to operate at local mobile device is " x by 4-8 capable BBAP method i=1 ", N is not belonged in V lnode all belong to node to be split, vertex ticks to be split is " x i=-1 ".9th row BBSearch function, based on basic branch and bound method, adopts depth-first search to try to achieve the optimum solution of model, all current solution space is divided into two sub spaces (x in each iteration i=0 represents that this node performs at server; x i=1 represents that this node performs on local mobile device), and adopt Pruning strategy to carry out method optimization; The value that constraint condition in BBSearch not only meets splitting scheme Optimized model corresponding under current bandwidth is less than the model minimum value (minValue) of current preservation, also needs to ensure that this is segmented in bandwidth threshold b simultaneously lunder the value of Optimized model not higher than set model threshold (minV), thus avoid splitting scheme expense when bandwidth is lower excessive, ensure the adaptability to bandwidth change.The optimum segmentation scheme Xmin of the 10th row return information of last BBAP method and optimal value minValue corresponding to Optimized model.Under worst case, BBAP method time complexity is O (2 n), when application object nodes is more, computation complexity is higher, and therefore the method is not suitable for the segmentation of larger application program.
Because bandwidth is higher, data transfer overhead is lower, therefore, the node running on mobile device in the higher situation of bandwidth still will run on mobile device when bandwidth reduces, and the node running on server in the lower situation of bandwidth still will run on server when bandwidth raises.Note X b=(C b, S b) represent program optimum segmentation scheme corresponding under bandwidth b, C band S brepresent that 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 respectively b=(C b, S b), have: ( 1 ) B > b &DoubleRightArrow; C B &SubsetEqual; C b , ( 2 ) B > b &DoubleRightArrow; S b &SubsetEqual; S B . In MCGAP method, consider at b and b lbetween change bandwidth, if for model optimum solution, then have
As shown in Figure 6, first required majorization of solutions model optimal value minValue is initialized as a maximum integer that can represent by MCGAP method in the 1st line code.2-4 is capable tries to achieve static bandwidth b and b respectively according to Stoer-Wagner method lunder optimization routines splitting scheme (C b, S b) and and according to corresponding Optimized model optimal value setting bandwidth b lthe higher limit W of lower Optimized model value bl.The C that the Adjust function that in MCGAP method, 5-6 is capable is tried to achieve according to Stoer-Wagner method bwith the weighting object relationship figure of adjustment programme, and determine node V' to be split, namely when bandwidth is at b land only need the segmentation of decision-making V' interior joint 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 minimal cut Stoer-Wagner method to sort to node; The capable splitting scheme (C, S) determining current selection based on Greedy strategy of 9-11, C and S represents the node set operating in local mobile device and server in current segmentation respectively, and calculates 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 is capable of two constraint condition: the Ws identical with BBAP bl(C, S) <W bland W b(C, S) <minValue, wherein W blrepresent bandwidth b lthe higher limit of lower program segmentation Optimized model, upgrades current optimum segmentation scheme (C min, S min); 16-17 is capable, and Contract function is by v m-1and v mtwo nodes merge, and from node set V' deletion of node v m, wherein A 3=Contract (A 1, A 2) concrete expression deletion two node A 1and A 2, generate a new node A 3, and for other arbitrary nodes v in 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 last optimum segmentation scheme solved according to program dividing method, the code migration of the program that realizes between mobile device and server and distributed execution, effectively can reduce the execution time of application program and the power consumption of mobile device, extend the battery of mobile device.
Illustrate that the mobile device power saving method based on the segmentation of bandwidth self-adaption program that the present invention proposes compares the improvement effect of additive method below in conjunction with accompanying drawing.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, runs the ThinkPad X201i notebook of Ubuntu 10.10 operating system.Utilize Java bytecode analysis and optimization framework Soot instrument and byte code rewritten technology, for Dacapo Benchmarks program, weighting object relationship figure building method (CSDPAC) of the present invention and pure Static Analysis Method (PSPAC), pure dynamic analysing method (PDPAC) are contrasted.Fig. 7 and Fig. 8 is that execution 8 example procedures (Programs) contrast, respectively: avrora, h2, luindex, lusearch, pmd, sunflow, tomcat and xalan.
Fig. 7 represent three kinds of methods obtain object relationship figure size compare.As can be seen from Figure 7, compared with PDPAC, the weighting object relationship figure scale that CSDPAC and PSPAC constructs is less.This is because CSDPAC and PSPAC all utilizes the static information deletion system storehouse object of program, carries out cutting to initial program object relationship figure, and information when PDPAC have recorded all operations such as comprising system library object and relation thereof, object relationship figure is larger.
The contrast predicting working time under Fig. 8 representation program actual run time and three kinds of methods.Test the working time of carrying out predictor according to program total byte yardage (Bytecode Instruction Count is called for short BIC).Prediction working time (PredictedExecution Time is called for short PET) is more close with actual run time (Actual Execution Time is called for short AET), shows that constructed object relationship figure is more accurate.As can be seen from Figure 8, the prediction of CSDPAC and PDPAC is all comparatively close to program production time working time, show performance analysis can obtain comparatively accurately program run time information.And PSPAC only adopts static program analysis, accurately cannot obtain information when program is run, therefore predict that working time is less than normal, show that PSPAC obtains object relationship figure not accurate enough.Combined the advantage of PDPAC and PSPAC as can be seen from Fig. 7 and Fig. 8, CSDPAC, program information more accurately can be obtained, object relationship figure can be avoided again larger, alleviate the computation burden of mobile applications segmentation.
For evaluating the performance of BBAP and MCGAP method of the present invention, implementing platform saves as 3.0GB in adopting, and cpu frequency is 2.53GHz, runs the ThinkPad X201i notebook of Windows 7 operating system.As shown in Figure 9, Figure 10 is the object relationship figure interior joint number and limit number that Application Instance is corresponding to concrete enforcement optimum configurations.Emulation experiment is for three kinds of special circumstances of program parted pattern: (1) w t=1, w e=0 (working time is optimum); (2) w t=0, w e=1 (energetic optimum); (3) w t=0.5, w e=0.5, be implemented as follows step respectively:
(1) optimum segmentation Cut (W, S_W, 100) under bandwidth 100kb/s and Cut (W is solved respectively by Stoer-Wagner method and BBAP/MCGAP method, BBAP, 100) (or Cut (W, MCGAP, 100)); Wherein S_W is the abbreviation of Stoer-Wagner method, and W represents Optimized model;
(2) above two segmentations Cut (W, S_W, 100) and Cut (W is calculated respectively, BBAP, 100) (or Cut (W, MCGAP, 100)) corresponding under different bandwidth b model value W{Cut (W, S_W, 100), b}, W{Cut (W, BBAP, 100), b} (or W{Cut (W, MCGAP, 100), b});
(3) model optimal value Wmin (b) corresponding under calculating different bandwidth b successively by Stoer-Wagner method;
(4) calculation procedure all performs corresponding model value WLocal on the mobile apparatus.
Distinguishingly, in order to 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 situation, model value equivalence is converted into program runtime and power consumption by experimental result, in figure, symbol represents and uses ' T ' (Time) and ' E ' (Energy) to replace corresponding ' W ' (Weight) respectively, i.e. W{Cut (W, S_W, 100), b}, W{Cut (W, BBAP, 100), b} (or W{Cut (W, MCGAP, 100), b}), Wmin (b) and WLocal be at (1) w t=1, w ein=0 situation, correspondence is expressed as T{Cut (T, S_W, 100) respectively, 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, correspondence is expressed as E{Cut (E, S_W, 100) respectively, b}, E{Cut (E, BBAP, 100), b} (or E{Cut (E, MCGAP, 100), b}), Emin (b) and ELocal.
Figure 11 represent BBAP method to object module three kinds in particular cases solve the time.Model_T, Model_E and Model_W corresponding (1) w respectively in 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, for the figure that node number is less, BBAP can obtain optimum solution within a short period of time; For the figure that node number is more, it is longer that it solves the time.This illustrates that BBAP is applicable to the less figure of scale, and for the more figure of nodes, and as lusearch program, the computing cost of BBAP obviously increases.
Figure 12, Figure 13 and Figure 14 are expressed as the BBAP program runtime (w corresponding under bandwidth situation of change with additive method 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.Sets forth in Figure 12 ~ 14 and contrast in the operation of four programs, four programs are respectively: (A) RandomGraph1 program, (B) RandomGraph2 program, (C) lusearch program, (D) avrora program.In fig. 12, T{Cut (T, BBAP, 100), b} and T{Cut (T, S_W, 100), the optimum segmentation scheme Cut (T that when b} represents that bandwidth is 100kb/s respectively, BBAP and Stoer-Wagner method obtain, BBAP, 100) and the program runtime corresponding under different bandwidth b of Cut (T, S_W, 100).Tmin (b) represents the minimal path sort run time that the optimum segmentation scheme of repeatedly trying to achieve by Stoer-Wagner method under each bandwidth b is corresponding.TLocal represents and does not adopt program to split, and namely program is all in the time that mobile device this locality performs.Can find out, T{Cut (T, BBAP, 100), b} and Tmin (b) is all less than TLocal as a rule, and T{Cut (T, S_W, 100), b} is also less than TLocal in the larger situation of bandwidth, this illustrates and utilizes program to split code migration, effectively can reduce the working time of application program.When bandwidth significantly declines, the running time T that static routine optimum segmentation Cut (T, S_W, 100) is corresponding { fluctuate greatly with bandwidth change by Cut (T, S_W, 100), b} sharp increase.And T{Cut (T, BBAP, 100), b} are compared with close to the shortest running time T min (b) of program under different bandwidth, and fluctuation is comparatively mild.The program power consumption that Figure 13 and Figure 14 is corresponding and optimization model value have similar conclusion.Static Stoer-Wagner method is compared in this explanation, and BBAP can adapt to bandwidth change preferably, reduces application program working time and power consumption; And compared with all needing to recalculate the dynamic approach of segmentation under each different bandwidth, BBAP only needs segmentation once, reduce segmentation expense.
Figure 15 be MCGAP method to object module three kinds in particular cases solve the time.Model_T, Model_E and Model_W be corresponding (1) w respectively t=1 and w e=0 (working time is optimum); (2) w t=0 and w e=1 (energetic optimum); (3) w t=0.5 and w e=0.5.Compare with Figure 11, can find out, when node of graph number is less, time that solves of MCGAP method and BBAP method are more or less the same; And node number more time MCGAP method the time that solves obviously reduce.
Figure 16 is the program comparison diagram the shortest working time that MCGAP method and BBAP method solve under different bandwidth.Wherein b represents bandwidth, and B, M and P represent the degree of accuracy of BBAP, MCGAP method and MCGAP approximate solution respectively.If for the model optimum solution that BBAP solves, X is the approximate optimal solution adopting MCGAP method to try to achieve, then for the degree of accuracy of MCGAP method approximate solution.As can be seen from Figure 16, degree of accuracy is higher, can be used for the approximate optimal solution of trying to achieve larger object relationship figure quickly compared with close to optimum solution corresponding to BBAP the minimal path sort run time that MCGAP solves.
Figure 17, Figure 18 and Figure 19 are respectively the MCGAP program runtime (w corresponding under bandwidth situation of change with additive method 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.Sets forth in Figure 17 ~ 19 and contrast in the operation of four programs, four programs respectively: (a) avrora program, (b) lusearch program, (c) luindex program, (d) h2 program.Can be found out by Figure 17, Figure 18 and Figure 19, compared with all running at mobile device with program, utilize program segmentation and code migration can reduce the power consumption of mobile device, shorten the working time of application program; And compared with splitting Stoer-Wagner method with static routine, simulated target value corresponding to MCGAP is compared with close to the minimum value under different bandwidth, comparatively mild with bandwidth fluctuation.Visible, along with the change of bandwidth in environment, MCGAP can avoid simulated target value sharply to increase because bandwidth reduces, and effectively shortens program runtime, reduces the power consumption of mobile device.Although the better performances of dynamic approach in figure, BBAP and MCGAP all avoids the larger expense of dynamic approach repeatedly computed segmentation under different bandwidth.If consider the computing cost of dynamic approach repeated segmentation, its performance will obviously decline.
Figure 20 is the average behavior comparison diagram of BBAP and MCGAP method.TR1 with ER1 represents respectively compared with employing Stoer-Wagner method, the number percent that during employing BBAP/MCGAP method, program average operating time and power consumption reduce; Compared with TR2 with ER2 represents respectively and all runs at mobile device with program, the number percent that when adopting BBAP or MCGAP method, program average operating time and power consumption reduce.Can find out, compared with all running at mobile device with program, adopt program average operating time corresponding to BBAP method and power consumption to reduce 44.17% and 34.47% respectively, adopt the program average operating time of MCGAP method and power consumption to reduce 37.44% and 46.09% respectively; And compared with splitting Stoer-Wagner method with static routine, the average operating time that BBAP is corresponding and power consumption reduce 26.38% and 25.88% respectively, the program average operating time that MCGAP is corresponding and power consumption reduce 26.99% and 30.58% respectively.
By specifically implementing experimental verification above, can draw, when bandwidth constantly changes, of the present invention based on the segmentation of bandwidth self-adaption program and the mobile device power saving method of code migration, effectively can reduce the execution time of application program and the power consumption of mobile device, thus extend the battery of mobile device.

Claims (3)

1. based on a mobile device power saving method for bandwidth self-adaption code migration, when mobile environment bandwidth constantly changes, it is characterized in that, this mobile device power saving method is by step realization below:
Step 1: structure weighting object relationship figure, specifically: first, static program analysis is carried out, according to the method call relation of program, the object relationship figure that constructor is initial, the object in corresponding program and the call relation between object are distinguished in each node in object relationship figure and limit; Then, obtain the working time of each node object in object relationship figure and the amount of communication data on every bar limit by dynamic routine analysis, obtain weighting object relationship figure;
Step 2: based on weighting object relationship figure, using bandwidth as a variable, sets up the program segmentation Optimized model based on working time and power consumption, specifically: make x ithe run location of identification nodes i, x i=1 and x i=0 represents that node i is run at mobile device and server end respectively, and program splitting scheme is expressed as X={x 1, x 2..., x n, n is the node number in weighting object relationship figure, then the target of program segmentation Optimized model is to try to achieve optimum segmentation scheme meet x pfor model solution space, b represents current bandwidth, and the Optimized model of program splitting scheme X when W (X, b) represents that 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 the weight of working time and power consumption respectively, and meet w t+ w e=1;
The program runtime of program splitting scheme X is adopted when T (X, b) represents that current 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 the working time of node i at mobile device and server end respectively; t nlifor the weight of corresponding node i in weighting object relationship figure, if server computing velocity is k times of mobile device, then: t nsi=t nli/ k; Make W ijrepresent the amount of communication data of mobile device and server end, then node i when bandwidth is b, data transmission period t between j ijfor: t ij=W ij/ b;
The program power consumption of program splitting scheme X is adopted when E (X, b) represents that current 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 irepresent the power consumption that node i is run on the mobile apparatus, E i=t nli× P cpu; E ijrepresent node i, the power consumption of data transmission between j, E ij=t ij× P w; P cpurepresent the cpu power of mobile device, P wrepresent the data traffic power of mobile device WiFi interface;
Described model solution space X pbe defined as: wherein, bandwidth threshold b lfor meeting probability P (b>=b l)>=P cmaximum bandwidth value, P cfor set probability threshold value; for bandwidth b llower optimization routines splitting scheme corresponding Optimized model value; Empirical constant a > 0;
Step 3: carry out the segmentation of bandwidth self-adaption program, when node number n is no more than 200, adopts branch-and-bound program dividing method to find optimum segmentation scheme, when node number n is greater than 200, adopts the greedy method based on minimal cut to find optimum segmentation scheme;
Described branch-and-bound program dividing method is based on branch-and-bound depth-first search, and the constraint condition of deep search comprises: the Optimized model value that 1) program splitting scheme is corresponding under current bandwidth b is less than the minimum value of the Optimized model of current preservation; 2) program splitting scheme is at bandwidth threshold b lunder simulated target value not higher than set model higher limit
The described greedy method based on minimal cut, utilizes Stoer-Wagner minimal cut algorithm to try to achieve static bandwidth for b and b ltime the corresponding node set C operating in mobile device bwith the node set operating in server end make node to be split v represents the node set in weighting object relationship figure, V' interior joint is split, the largest contiguous value sort algorithm in Stoer-Wagner minimal cut algorithm is adopted to sort to node, then based on Greedy strategy, choose optimum segmentation scheme according to the constraint condition of the deep search identical with branch-and-bound program dividing method simultaneously;
Step 4: according to the optimum segmentation scheme obtained, the code migration of the program that realizes between mobile device and server and distributed execution.
2. a kind of mobile device power saving method based on bandwidth self-adaption code migration 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 bandwidth self-adaption code migration according to claim 1, it is characterized in that, described empirical constant a is set as 0.4.
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
CN2012103678703 2012-09-28
CN201210367870.3 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 CN102968173A (en) 2013-03-13
CN102968173B true 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)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106909449B (en) * 2017-01-11 2021-03-23 西可通信技术设备(河源)有限公司 Computing migration method and device for mobile terminal program
CN109981546B (en) * 2017-12-28 2021-08-20 北京京东尚科信息技术有限公司 Method and device for acquiring remote call relation between application modules

Citations (2)

* 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
CN101473301A (en) * 2006-06-13 2009-07-01 微软公司 Iterative static and dynamic software analysis

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09179738A (en) * 1995-12-26 1997-07-11 Hitachi Ltd Object-oriented language processing method and processor
US8429633B2 (en) * 2008-11-21 2013-04-23 International Business Machines Corporation Managing memory to support large-scale interprocedural static analysis for security problems
WO2012031165A2 (en) * 2010-09-02 2012-03-08 Zaretsky, Howard System and method of cost oriented software profiling

Patent Citations (2)

* 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
CN101473301A (en) * 2006-06-13 2009-07-01 微软公司 Iterative static and dynamic software analysis

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
《静动态结合的Java程序不变性分析方法》;于利前等;《计算机学报》;20100430;第33卷(第4期);正文第736-746页 *

Also Published As

Publication number Publication date
CN102968173A (en) 2013-03-13

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
US20140208287A1 (en) Energy Consumption Simulation and Evaluation System for Embedded Device
US20230035451A1 (en) Resource usage prediction for deep learning model
Nguyen et al. A smartphone perspective on computation offloading—A survey
Billet et al. From task graphs to concrete actions: a new task mapping algorithm for the future internet of things
US20130254754A1 (en) Methods and systems for optimizing the performance of software applications at runtime
WO2020248511A1 (en) Method for realizing control over terminal utilization on the basis of run-time model
US20160004518A1 (en) Profile guided optimization in the presence of stale profile data
Chéour et al. Evaluation of simulator tools and power‐aware scheduling model for wireless sensor networks
Barrameda et al. A novel statistical cost model and an algorithm for efficient application offloading to clouds
CN102968173B (en) A kind of mobile device power saving method based on bandwidth self-adaption code migration
Calinescu et al. Using runtime quantitative verification to provide assurance evidence for self-adaptive software: advances, applications and research challenges
Kiran et al. Execution time prediction of imperative paradigm tasks for grid scheduling optimization
CN102902804B (en) High-efficiency BPEL (business process execution language) service dynamic updating method
Cai et al. AutoMan: Resource-efficient provisioning with tail latency guarantees for microservices
CN110058849A (en) Generation method, device, computer equipment and the storage medium of flow chart
Di Marco et al. Model-driven approach to Agilla Agent generation
Yang Manageable granularity in mobile application code offloading for energy savings
Morin et al. Unifying runtime adaptation and design evolution
CN115329143A (en) Directed acyclic graph evaluation method, device, equipment and storage medium
CN104008058B (en) A kind of framework evaluation method based on prototype emulation
CN112445607B (en) Method and device for executing method function by application program
Kakkar et al. Risk analysis in mobile application development
Denoyelle et al. A topology-aware performance monitoring tool for shared resource management in multicore 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