CN107357703A - A kind of terminal applies power consumption detection method and server - Google Patents

A kind of terminal applies power consumption detection method and server Download PDF

Info

Publication number
CN107357703A
CN107357703A CN201710458194.3A CN201710458194A CN107357703A CN 107357703 A CN107357703 A CN 107357703A CN 201710458194 A CN201710458194 A CN 201710458194A CN 107357703 A CN107357703 A CN 107357703A
Authority
CN
China
Prior art keywords
power consumption
code storehouse
time point
journal file
detected
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
CN201710458194.3A
Other languages
Chinese (zh)
Other versions
CN107357703B (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.)
Beijing Qianxin Technology Co Ltd
Original Assignee
Beijing Qianxin Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Qianxin Technology Co Ltd filed Critical Beijing Qianxin Technology Co Ltd
Priority to CN201710458194.3A priority Critical patent/CN107357703B/en
Publication of CN107357703A publication Critical patent/CN107357703A/en
Application granted granted Critical
Publication of CN107357703B publication Critical patent/CN107357703B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3058Monitoring arrangements for monitoring environmental properties or parameters of the computing system or of the computing system component, e.g. monitoring of power, currents, temperature, humidity, position, vibrations
    • G06F11/3062Monitoring arrangements for monitoring environmental properties or parameters of the computing system or of the computing system component, e.g. monitoring of power, currents, temperature, humidity, position, vibrations where the monitored property is the power consumption
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/32Monitoring with visual or acoustical indication of the functioning of the machine
    • G06F11/323Visualisation of programs or trace data
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/14Arrangements for monitoring or testing data switching networks using software, i.e. software packages
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The embodiment of the present invention provides a kind of terminal applies power consumption detection method and server.Methods described includes:Code storehouse journal file generated during application program to be detected, in preset time period and power consumption sample log file are run in receiving terminal;According to the code storehouse journal file and the power consumption sample log file, power consumption analysis is carried out to the application program to be detected, obtains power consumption corresponding to each code storehouse in the code storehouse journal file.The server is used to perform methods described.The embodiment of the present invention passes through according to code storehouse journal file and power consumption sample log file, power consumption analysis is carried out to application program to be detected, power consumption corresponding to each code storehouse in code storehouse journal file is obtained, it is hereby achieved that the power consumption reason to application program to be detected.

Description

A kind of terminal applies power consumption detection method and server
Technical field
The present embodiments relate to mobile communication technology field, more particularly to a kind of terminal applies power consumption detection method and clothes Business device.
Background technology
With the development of mobile Internet, intelligent mobile terminal is more and more common, increasing so as to also emerge Using having attracted mass users.However, some applications do not account for power consumption this problem due to designing upper existing defects, from And cause the power consumption when user is running the application excessive.
Due to becoming increasingly conspicuous for this big problem of mobile terminal power consumption, focus has also been gathered movement by developer The detection of terminal applies power consumption comes up.Therefore, have at present to the detection method of mobile terminal application power consumption it is a variety of, such as:Pass through The order that system provides is counted using power consumption;Utilize third party's instrument statistics application power consumption;Hardware device counts mobile phone Power consumption.The order provided for system counts this detection method using power consumption, the system that mobile terminal carries The electricity service condition of all applications of installation on this system can be monitored in real time, therefore, when user needs to check that battery is used During electric situation, each percentage that total power consumption is accounted for using power consumption can be counted, how much can also be ranked up according to power consumption, It is big using power consumption which allows users to be apparent from.For the detection method of third party's instrument statistics application power consumption, It is exactly that one third party software of implantation, the third party software can be to monitoring in system using power consumption in systems. For the detection method of the power consumption of hardware device statistics mobile phone, be by by detection means and hardware collecting device to being connected, Hardware collecting device is connected with mobile terminal, the current data of control hardware collecting device collection mobile terminal, so as to obtain The power consumption of mobile terminal.
Both for the power consumption of application in above-mentioned mobile terminal power consumption detection method of the prior art, for specifically should Tested for equivalent to flight data recorder, i.e., can only obtain how much some applies power consumption within a period of time, can not divided Separate out the concrete reason for applying power consumption.The concrete reason of power consumption can not find, and developer just can not carry out effective to application Optimization.
It is therefore proposed that a kind of detection method is capable of detecting when that using the concrete reason of power consumption be skill nowadays urgently to be resolved hurrily Art problem.
The content of the invention
The problem of existing for prior art, the embodiment of the present invention provide a kind of terminal applies power consumption detection method and service Device.
In a first aspect, the embodiment of the present invention provides a kind of terminal applies power consumption detection method, including:
Run in receiving terminal code storehouse journal file generated during application program to be detected, in preset time period and Power consumption sample log file;
According to the code storehouse journal file and the power consumption sample log file, the application program to be detected is entered Row power consumption is analyzed, and obtains power consumption corresponding to each code storehouse in the code storehouse journal file.
Second aspect, the embodiment of the present invention provide a kind of terminal applies power consumption detection service device, including:
Receiving module, code generated during application program to be detected, in preset time period is run in receiving terminal Storehouse journal file and power consumption sample log file;
Analysis module, for according to the code storehouse journal file and the power consumption sample log file, being treated to described Detect application program and carry out power consumption analysis, obtain power consumption corresponding to each code storehouse in the code storehouse journal file.
The third aspect, the embodiment of the present invention provide a kind of electronic equipment, including:Processor, memory and bus, wherein,
The processor and the memory complete mutual communication by the bus;
The memory storage has and by the programmed instruction of the computing device, the processor described program can be called to refer to Order is able to carry out the method and step of first aspect.
Fourth aspect, the embodiment of the present invention provide a kind of non-transient computer readable storage medium storing program for executing, including:
The non-transient computer readable storage medium storing program for executing stores computer instruction, and the computer instruction makes the computer Perform the method and step of first aspect.
A kind of terminal applies power consumption detection method provided in an embodiment of the present invention and server, by according to code storehouse day Will file and power consumption sample log file, power consumption analysis is carried out to application program to be detected, obtained in code storehouse journal file Power consumption corresponding to each code storehouse, it is hereby achieved that the power consumption reason to application program to be detected.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing There is the required accompanying drawing used in technology description to be briefly described, it should be apparent that, drawings in the following description are this hairs Some bright embodiments, for those of ordinary skill in the art, on the premise of not paying creative work, can be with root Other accompanying drawings are obtained according to these accompanying drawings.
Fig. 1 is a kind of terminal applies power consumption detection method schematic flow sheet provided in an embodiment of the present invention;
Fig. 2 is a kind of terminal applies power consumption detection service device structural representation provided in an embodiment of the present invention;
Fig. 3 is a kind of terminal applies power consumption detection service device structural representation that another embodiment of the present invention provides;
Fig. 4 is a kind of electronic equipment entity structure schematic diagram provided in an embodiment of the present invention.
Embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention In accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is Part of the embodiment of the present invention, rather than whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art The every other embodiment obtained under the premise of creative work is not made, belongs to the scope of protection of the invention.
Fig. 1 is a kind of terminal applies power consumption detection method schematic flow sheet provided in an embodiment of the present invention, as shown in figure 1, Methods described, including:
Step 101:Code storehouse day generated during application program to be detected, in preset time period is run in receiving terminal Will file and power consumption sample log file;
Specifically, terminal is realized using Hook frameworks and the business logic codes in application program to be detected is linked up with. When application program to be detected operationally, Hook hooks can get some time point operation what method, will obtain The information arrived is stored in the form of daily record, forms code storehouse journal file.Meanwhile when application program to be detected operationally, The power consumption of the application program to be detected is sampled in terminal-pair preset time period, generates power consumption sample log file.Terminal Code storehouse journal file in preset time period and power consumption sample log file are sent to server, server receiving terminal The code storehouse journal file and power consumption sample log file of transmission.It should be noted that preset time period can be 1 hour, It can also be adjusted according to actual conditions, the embodiment of the present invention is not especially limited to this.
Step 102:According to the code storehouse journal file and the power consumption sample log file, to it is described it is to be detected should Power consumption analysis is carried out with program, obtains power consumption corresponding to each code storehouse in the code storehouse journal file.
Specifically, server is according to code storehouse journal file and power consumption sample log file, to application program to be detected Power consumption analysis is carried out, code heap corresponding to all methods performed in preset time period is included in code storehouse journal file Stack, therefore, code storehouse journal file include multiple code storehouses, after having carried out power consumption analysis, can obtain each The power consumption of individual code storehouse, so as to find the power consumption of some specific method in application program to be detected, so as to divide The reason for separating out the application program power consumption to be detected.
The embodiment of the present invention is by the way that according to code storehouse journal file and power consumption sample log file, journey is applied to be detected Sequence carries out power consumption analysis, power consumption corresponding to each code storehouse in code storehouse journal file is obtained, it is hereby achieved that arriving The power consumption reason of application program to be detected.
On the basis of above-described embodiment, methods described also includes:
The power consumption corresponding to each code storehouse is shown.
Specifically, after the completion of server is to the power consumption analysis of application program to be detected, code storehouse journal file is obtained In each code storehouse corresponding to power consumption, and analysis result is shown so that user or developer can be with The concrete reason of application program power consumption to be detected is known from terminal, that is, which specific code heap in application program to be detected known Stack power consumption is big, so as to targetedly be optimized processing etc. to it.
The embodiment of the present invention is by the way that according to code storehouse journal file and power consumption sample log file, journey is applied to be detected Sequence carries out power consumption analysis, power consumption corresponding to each code storehouse in code storehouse journal file is obtained, it is hereby achieved that arriving The power consumption reason of application program to be detected, improve the operating efficiency that developer traces power consumption.
On the basis of the various embodiments described above, the code storehouse journal file includes:Time point and the time point pair The method name answered;The power consumption sample log file includes:Power consumption corresponding to the time point and the time point;Accordingly ,
It is described according to the code storehouse journal file and the power consumption sample log file, to be detected apply journey to described Sequence carries out power consumption analysis, including:
Calculate average power consumption of the application program to be detected in the preset time period;
If judging to know that power consumption corresponding to the time point is more than the average power consumption, according to the time point, Methods described title corresponding to the time point is obtained from the code storehouse journal file.
Specifically, application program to be detected is linked up with using Hook frameworks, application to be detected is monitored by hook The action of program in the process of implementation, i.e., a certain method is carrying out in sometime point, so as to generate code storehouse daily record text Part.The code storehouse journal file that terminal is got includes method name corresponding to time point and time point, should illustrate It is that can also include the information such as thread corresponding to time point in code storehouse journal file, the embodiment of the present invention is not made specifically to this Limit.Terminal needs power consumption during application program to be detected is performed, therefore can collect application program to be detected and exist Power consumption in preset time period, generates power consumption sample log file, and the wherein power consumption sample log file includes time point With time point corresponding to power consumption.It should be noted that time point and code storehouse daily record text in power consumption sample log file Time point in part is completely the same, its purpose is to can passage time point code storehouse and power consumption are connected, from And learn the power consumption of code storehouse.In addition, power consumption should be understood to corresponding to time point:Such as preset time period is 1 Hour, every 1 minute is a time point, is that 0-1 minutes, this to be detected applied journey in the power consumption at first minute this time point The power consumption that sequence is consumed, the power consumption at second minute this time point be 1-2 minutes the application program to be detected consumed Power consumption, the like.It is understood that it was that interval determines that time point is the citing of the embodiment of the present invention with 1 minute, it has Body determines that the method at time point can be adjusted according to actual conditions, and the embodiment of the present invention is not especially limited to this.
By power consumption sample log file, it can be calculated in preset time period, application program to be detected is consumed Total power consumption, so as to which the average power consumption of the application program to be detected is calculated.By in preset time period each Power consumption corresponding to time point obtains the time point more than average power consumption, then from code compared with average power consumption Method name corresponding to the time point is searched in storehouse journal file, because code storehouse is the method set in time series, Therefore, also just can determine it is that the power consumption of which code storehouse has exceeded average power consumption after method name is found, so as to The original of the method and code storehouse, i.e. the application program power consumption to be detected that compare power consumption in the application program to be detected can be found Cause.It should be noted that can also be by power consumption corresponding to each time point and the corresponding time in code storehouse journal file The method name of point is corresponding, so as to draw power consumption of each method name in the preset time period.And from code storehouse Execution number of a certain method name in preset time period can also be got in journal file.
The embodiment of the present invention is by the way that according to code storehouse journal file and power consumption sample log file, journey is applied to be detected Sequence carries out power consumption analysis, power consumption corresponding to each code storehouse in code storehouse journal file is obtained, it is hereby achieved that arriving The power consumption reason of application program to be detected.
It is described to be shown power consumption corresponding to each code storehouse on the basis of above-described embodiment, including:
By power consumption graphical treatment corresponding to each code storehouse, and shown.
Specifically, after power consumption corresponding to each code storehouse is determined, processing is patterned, such as can To be fabricated to block diagram, cake chart etc., and figure is shown, so that user or developer acquire and more intuitively consumed Electrical analysis result.
The embodiment of the present invention is shown by handling the power consumption image conversion of each code storehouse, there is provided more Add intuitively power consumption analysis result, fast positioning power consumption reason.
On the basis of above-described embodiment, methods described, in addition to:
Calculate what each code storehouse in the preset time period performed according to the code storehouse journal file Number.
Specifically, server can also be calculated in preset time period by the code storehouse journal file received Number and frequency interior, that method corresponding to a certain code storehouse performs.It should be noted that the meaning of frequency is in certain generation The number that method corresponding to code storehouse performs, account for the ratio of the total degree that all methods perform in preset time period.
Execution number of the embodiment of the present invention by calculation code storehouse in preset time period, reflect from another dimension Go out the power consumption condition of each method in the application program to be detected.
Fig. 2 is a kind of terminal applies power consumption detection service device structural representation provided in an embodiment of the present invention, such as Fig. 2 institutes Show, the server, including, receiving module 201 and analysis module 202, wherein:
Receiving module 201 is used for generation generated when running application program to be detected in receiving terminal, in preset time period Code storehouse journal file and power consumption sample log file;Analysis module 202 is used for according to the code storehouse journal file and institute Power consumption sample log file is stated, power consumption analysis is carried out to the application program to be detected, obtains the code storehouse journal file In power consumption corresponding to each code storehouse.
Specifically, it is being generated when running application program to be detected in the receiving terminal of receiving module 201, in preset time period Code storehouse journal file, terminal are realized using Hook frameworks and the business logic codes in application program to be detected are hung Hook.When application program to be detected operationally, Hook hooks can get some time point operation what method, will obtain The information got is stored in the form of daily record, forms code storehouse journal file.Meanwhile when application program to be detected is being run When, the power consumption of the interior application program to be detected of terminal-pair preset time period is sampled, and generates power consumption sample log file.Eventually Code storehouse journal file and power consumption sample log file are sent to receiving module 201, the receiving terminal of receiving module 201 hair by end The code storehouse journal file and power consumption sample log file sent.Analysis module 202 is according to code storehouse journal file and power consumption Sample log file, power consumption analysis is carried out to application program to be detected, includes preset time period in code storehouse journal file Code storehouse corresponding to all methods of interior execution, therefore, code storehouse journal file include multiple code storehouses, by entering After power consumption of having gone analysis, the power consumption of each code storehouse can be obtained, so as to find in application program to be detected The power consumption of some specific method, the reason for so as to analyze the application program power consumption to be detected.
The embodiment of server provided by the invention specifically can be used for the handling process for performing above-mentioned each method embodiment, Its function will not be repeated here, and be referred to the detailed description of above method embodiment.
The embodiment of the present invention is by the way that according to code storehouse journal file and power consumption sample log file, journey is applied to be detected Sequence carries out power consumption analysis, power consumption corresponding to each code storehouse in code storehouse journal file is obtained, it is hereby achieved that arriving The power consumption reason of application program to be detected.
On the basis of above-described embodiment, Fig. 3 is a kind of terminal applies power consumption detection that another embodiment of the present invention provides Server architecture schematic diagram, as shown in figure 3, the server includes, receiving module 201, analysis module 202 and display module 203, wherein:
Display module 203 is used to be shown the power consumption corresponding to each code storehouse.
Specifically, receiving module 201 and analysis module 202 are consistent with above-described embodiment, and the present invention implements to come to this no longer Repeat.After the completion of analysis module 202 is to the power consumption analysis of application program to be detected, obtain every in code storehouse journal file Power consumption corresponding to one code storehouse, display module 203 shown analysis result so that user or developer can To know the concrete reason of application program power consumption to be detected from terminal, that is, which specific code in application program to be detected known Storehouse power consumption is big, so as to targetedly be optimized processing etc. to it.
The embodiment of the present invention is by the way that according to code storehouse journal file and power consumption sample log file, journey is applied to be detected Sequence carries out power consumption analysis, power consumption corresponding to each code storehouse in code storehouse journal file is obtained, it is hereby achieved that arriving The power consumption reason of application program to be detected.
On the basis of the various embodiments described above, the code storehouse journal file includes:Time point and the time point pair The method name answered;The power consumption sample log file includes:Power consumption corresponding to the time point and the time point;Accordingly ,
The analysis module 202 is specifically used for:
Calculate average power consumption of the application program to be detected in the preset time period;
If judging to know that power consumption corresponding to the time point is more than the average power consumption, according to the time point, Methods described title corresponding to the time point is obtained from the code storehouse journal file.
Specifically, application program to be detected is linked up with using Hook frameworks, application to be detected is monitored by hook The action of program in the process of implementation, i.e., a certain method is carrying out in sometime point, so as to generate code storehouse daily record text Part.The code storehouse journal file that terminal is got includes method name corresponding to time point and time point, should illustrate It is that can also include the information such as thread corresponding to time point in code storehouse journal file, the embodiment of the present invention is not made specifically to this Limit.Terminal needs power consumption during application program to be detected is performed, therefore can collect application program to be detected and exist Power consumption in preset time period, generates power consumption sample log file, and the wherein power consumption sample log file includes time point With time point corresponding to power consumption should be noted that time point and code storehouse journal file in power consumption sample log file In time point it is completely the same, its purpose is to can passage time point code storehouse and power consumption are connected, so as to Learn the power consumption of code storehouse.In addition, power consumption should be understood to corresponding to time point:Such as preset time period is 1 small When, every 1 minute is a time point, is the 0-1 minutes application program to be detected in the power consumption at first minute this time point The power consumption consumed, the power consumption at second minute this time point are the 1-2 minutes consumptions that are consumed of the application program to be detected Electricity, the like.It is understood that it was that interval determines that time point is the citing of the embodiment of the present invention with 1 minute, its is specific Determining the method at time point can be adjusted according to actual conditions, and the embodiment of the present invention is not especially limited to this.
Analysis module 202 can be calculated in preset time period, application to be detected by power consumption sample log file The total power consumption that program is consumed, so as to which the average power consumption of the application program to be detected is calculated.Analysis module 202 By power consumption corresponding to each time point in preset time period compared with average power consumption, acquisition is more than average power consumption Time point, then method name corresponding to the time point is searched from code storehouse journal file, when being due to code storehouse Between method set in sequence, therefore, also just can determine it is that the power consumption of which code storehouse surpasses after method name is found Average power consumption is crossed, so as to find the method and code storehouse that compare power consumption in the application program to be detected, i.e., this is treated The reason for detecting application program power consumption.It should be noted that can also be by power consumption corresponding to each time point and code storehouse The method name at the corresponding time point in journal file is corresponding, so as to draw each method name in the preset time period Power consumption.And execution of a certain method name in preset time period time can also be got from code storehouse journal file Number.
The embodiment of server provided by the invention specifically can be used for the handling process for performing above-mentioned each method embodiment, Its function will not be repeated here, and be referred to the detailed description of above method embodiment.
The embodiment of the present invention is by the way that according to code storehouse journal file and power consumption sample log file, journey is applied to be detected Sequence carries out power consumption analysis, power consumption corresponding to each code storehouse in code storehouse journal file is obtained, it is hereby achieved that arriving The power consumption reason of application program to be detected.
Fig. 4 is a kind of electronic equipment entity structure schematic diagram provided in an embodiment of the present invention, as shown in figure 4, the electronics Equipment, including:Processor (processor) 401, memory (memory) 402 and bus 403;Wherein,
The processor 401 and memory 402 complete mutual communication by the bus 403;
The processor 401 is used to call the programmed instruction in the memory 402, to perform above-mentioned each method embodiment The method provided, such as including:Code generated during application program to be detected, in preset time period is run in receiving terminal Storehouse journal file and power consumption sample log file;According to the code storehouse journal file and power consumption sample log text Part, power consumption analysis is carried out to the application program to be detected, obtains each code storehouse pair in the code storehouse journal file The power consumption answered.
The present embodiment discloses a kind of computer program product, and the computer program product includes being stored in non-transient calculating Computer program on machine readable storage medium storing program for executing, the computer program include programmed instruction, when described program instruction is calculated When machine performs, computer is able to carry out the method that above-mentioned each method embodiment is provided, such as including:Operation is treated in receiving terminal Detect code storehouse journal file and power consumption sample log file generated during application program, in preset time period;According to institute Code storehouse journal file and the power consumption sample log file are stated, power consumption analysis is carried out to the application program to be detected, obtained Obtain power consumption corresponding to each code storehouse in the code storehouse journal file.
The present embodiment provides a kind of non-transient computer readable storage medium storing program for executing, the non-transient computer readable storage medium storing program for executing Computer instruction is stored, the computer instruction makes the computer perform the method that above-mentioned each method embodiment is provided, example Such as include:Run in receiving terminal code storehouse journal file generated during application program to be detected, in preset time period and Power consumption sample log file;According to the code storehouse journal file and the power consumption sample log file, to described to be detected Application program carries out power consumption analysis, obtains power consumption corresponding to each code storehouse in the code storehouse journal file.
One of ordinary skill in the art will appreciate that:Realizing all or part of step of above method embodiment can pass through Programmed instruction related hardware is completed, and foregoing program can be stored in a computer read/write memory medium, the program Upon execution, the step of execution includes above method embodiment;And foregoing storage medium includes:ROM, RAM, magnetic disc or light Disk etc. is various can be with the medium of store program codes.
The embodiments such as server described above are only schematical, wherein the list illustrated as separating component Member can be or may not be physically separate, can be as the part that unit is shown or may not be physics Unit, you can with positioned at a place, or can also be distributed on multiple NEs.It can select according to the actual needs Some or all of module therein realizes the purpose of this embodiment scheme.Those of ordinary skill in the art are not paying creation In the case of the work of property, you can to understand and implement.
Through the above description of the embodiments, those skilled in the art can be understood that each embodiment can Realized by the mode of software plus required general hardware platform, naturally it is also possible to pass through hardware.Based on such understanding, on The part that technical scheme substantially in other words contributes to prior art is stated to embody in the form of software product, should Computer software product can store in a computer-readable storage medium, such as ROM/RAM, magnetic disc, CD, including some fingers Make to cause a computer equipment (can be personal computer, server, or network equipment etc.) to perform each implementation Method described in some parts of example or embodiment.
Finally it should be noted that:The above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although The present invention is described in detail with reference to the foregoing embodiments, it will be understood by those within the art that:It still may be used To be modified to the technical scheme described in foregoing embodiments, or equivalent substitution is carried out to which part technical characteristic; And these modification or replace, do not make appropriate technical solution essence depart from various embodiments of the present invention technical scheme spirit and Scope.

Claims (10)

  1. A kind of 1. terminal applies power consumption detection method, it is characterised in that including:
    Code storehouse journal file generated during application program to be detected, in preset time period and power consumption are run in receiving terminal Sample log file;
    According to the code storehouse journal file and the power consumption sample log file, the application program to be detected is consumed Electroanalysis, obtain power consumption corresponding to each code storehouse in the code storehouse journal file.
  2. 2. according to the method for claim 1, it is characterised in that methods described also includes:
    The power consumption corresponding to each code storehouse is shown.
  3. 3. method according to claim 1 or 2, it is characterised in that the code storehouse journal file includes:Time point and Method name corresponding to the time point;The power consumption sample log file includes:The time point and the time point are corresponding Power consumption;Accordingly,
    It is described according to the code storehouse journal file and the power consumption sample log file, the application program to be detected is entered Row power consumption is analyzed, including:
    Calculate average power consumption of the application program to be detected in the preset time period;
    If judgement knows that power consumption corresponding to the time point is more than the average power consumption, according to the time point, from institute State and methods described title corresponding to the time point is obtained in code storehouse journal file.
  4. 4. according to the method for claim 2, it is characterised in that described to enter power consumption corresponding to each code storehouse Row display, including:
    By power consumption graphical treatment corresponding to each code storehouse, and shown.
  5. 5. according to the method for claim 3, it is characterised in that methods described, in addition to:
    The number that each code storehouse performs in the preset time period is calculated according to the code storehouse journal file.
  6. A kind of 6. terminal applies power consumption detection service device, it is characterised in that including:
    Receiving module, code storehouse generated during application program to be detected, in preset time period is run in receiving terminal Journal file and power consumption sample log file;
    Analysis module, for according to the code storehouse journal file and the power consumption sample log file, to described to be detected Application program carries out power consumption analysis, obtains power consumption corresponding to each code storehouse in the code storehouse journal file.
  7. 7. server according to claim 6, it is characterised in that the server, in addition to:
    Display module, for the power consumption corresponding to each code storehouse to be shown.
  8. 8. the server according to claim 6 or 7, it is characterised in that the code storehouse journal file includes:Time point With the time point corresponding to method name;The power consumption sample log file includes:The time point and the time point pair The power consumption answered;Accordingly,
    The analysis module, is specifically used for:
    Calculate average power consumption of the application program to be detected in the preset time period;
    If judgement knows that power consumption corresponding to the time point is more than the average power consumption, according to the time point, from institute State and methods described title corresponding to the time point is obtained in code storehouse journal file.
  9. 9. a kind of electronic equipment, it is characterised in that including:Processor, memory and bus, wherein, the processor and described Memory completes mutual communication by the bus;
    The memory storage has can be by the programmed instruction of the computing device, and the processor calls described program instruction energy Enough perform the method as described in claim any one of 1-5.
  10. 10. a kind of non-transient computer readable storage medium storing program for executing, it is characterised in that the non-transient computer readable storage medium storing program for executing is deposited Computer instruction is stored up, the computer instruction makes the computer perform the method as described in claim any one of 1-5.
CN201710458194.3A 2017-06-16 2017-06-16 Terminal application power consumption detection method and server Active CN107357703B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710458194.3A CN107357703B (en) 2017-06-16 2017-06-16 Terminal application power consumption detection method and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710458194.3A CN107357703B (en) 2017-06-16 2017-06-16 Terminal application power consumption detection method and server

Publications (2)

Publication Number Publication Date
CN107357703A true CN107357703A (en) 2017-11-17
CN107357703B CN107357703B (en) 2020-09-29

Family

ID=60272929

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710458194.3A Active CN107357703B (en) 2017-06-16 2017-06-16 Terminal application power consumption detection method and server

Country Status (1)

Country Link
CN (1) CN107357703B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113778516A (en) * 2021-09-15 2021-12-10 山东派盟网络科技有限公司 Method, device and equipment for optimizing performance
CN116822340A (en) * 2023-06-12 2023-09-29 中科软件测评(广州)有限公司 Terminal electric quantity optimization method based on software energy consumption

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104516806A (en) * 2014-12-26 2015-04-15 北京奇虎科技有限公司 Power consumption information detection result display method and system for mobile terminal
CN105183135A (en) * 2015-09-02 2015-12-23 北京奇虎科技有限公司 Method for saving power consumption of smart phone and smart phone
CN106445769A (en) * 2015-08-11 2017-02-22 腾讯科技(深圳)有限公司 Computer operation monitoring method, device and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104516806A (en) * 2014-12-26 2015-04-15 北京奇虎科技有限公司 Power consumption information detection result display method and system for mobile terminal
CN106445769A (en) * 2015-08-11 2017-02-22 腾讯科技(深圳)有限公司 Computer operation monitoring method, device and system
CN105183135A (en) * 2015-09-02 2015-12-23 北京奇虎科技有限公司 Method for saving power consumption of smart phone and smart phone

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113778516A (en) * 2021-09-15 2021-12-10 山东派盟网络科技有限公司 Method, device and equipment for optimizing performance
CN116822340A (en) * 2023-06-12 2023-09-29 中科软件测评(广州)有限公司 Terminal electric quantity optimization method based on software energy consumption

Also Published As

Publication number Publication date
CN107357703B (en) 2020-09-29

Similar Documents

Publication Publication Date Title
CN110210227B (en) Risk detection method, device, equipment and storage medium
CN110428127B (en) Automatic analysis method, user equipment, storage medium and device
CN109885452A (en) Method for monitoring performance, device and terminal device
CN104932963B (en) The method and device of management terminal
CN105607986A (en) Acquisition method and device of user behavior log data
CN107370806A (en) HTTP conditional codes monitoring method, device, storage medium and electronic equipment
CN111368980A (en) State detection method, device, equipment and storage medium
CN103903312B (en) The execution method and apparatus of automatic detecting
CN109359019A (en) Application program capacity monitoring method, device, electronic equipment and storage medium
CN112446511A (en) Fault handling method, device, medium and equipment
CN107045475A (en) Method of testing and device
CN107357703A (en) A kind of terminal applies power consumption detection method and server
CN112948223A (en) Method and device for monitoring operation condition
CN109858548B (en) Method and device for judging abnormal power consumption, storage medium and communication terminal
CN111800292A (en) Early warning method and device based on historical flow, computer equipment and storage medium
CN109409948B (en) Transaction abnormity detection method, device, equipment and computer readable storage medium
CN103809955B (en) The method and apparatus of end process
CN115794545A (en) Automatic processing method of operation and maintenance data and related equipment thereof
CN115757075A (en) Task abnormity detection method and device, computer equipment and storage medium
CN113360182B (en) Method and apparatus for system performance diagnostics
CN108964283A (en) A kind of distribution box early warning system
CN114238130A (en) Performance test method, device, equipment and storage medium
CN114282940A (en) Method and apparatus for intention recognition, storage medium, and electronic device
CN111509810A (en) Lithium battery charging state detection method and device and storage medium
CN115372752A (en) Fault detection method, device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 100088 Building 3 332, 102, 28 Xinjiekouwai Street, Xicheng District, Beijing

Applicant after: Qianxin Technology Group Co.,Ltd.

Address before: 100015 Jiuxianqiao Chaoyang District Beijing Road No. 10, building 15, floor 17, layer 1701-26, 3

Applicant before: Beijing Qi'anxin Technology Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant