CN104503881A - Handheld device power consumption detecting method and device and handheld device - Google Patents
Handheld device power consumption detecting method and device and handheld device Download PDFInfo
- Publication number
- CN104503881A CN104503881A CN201410805297.9A CN201410805297A CN104503881A CN 104503881 A CN104503881 A CN 104503881A CN 201410805297 A CN201410805297 A CN 201410805297A CN 104503881 A CN104503881 A CN 104503881A
- Authority
- CN
- China
- Prior art keywords
- interface
- handheld device
- value
- preset function
- applications
- 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
Links
Classifications
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE 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/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Telephone Function (AREA)
Abstract
本发明适用于手持设备技术领域,提供了一种手持设备功耗检测的方法、装置及手持设备,所述方法包括:进入第一页面后,读取并存储预设功能接口的初始接口值,所述第一页面是手持设备开机、解锁后,在所述手持设备的显示屏上显示的第一个页面;启动所述手持设备中安装的所有应用,使所述所有应用均运行一遍后,关闭所述所有应用;返回所述第一页面后,读取并存储所述预设功能接口的当前接口值;将所述当前接口值与所述初始接口值进行比对,根据比对结果确定所述预设功能接口中被异常调用的功能接口。本发明,可以检测到功能接口的异常开启或者异常关闭,找到功耗增加的真正原因。
The present invention is applicable to the technical field of handheld devices, and provides a method and device for detecting the power consumption of handheld devices and the handheld device. The method includes: after entering the first page, reading and storing the initial interface value of the preset function interface, The first page is the first page displayed on the display screen of the handheld device after the handheld device is turned on and unlocked; after starting all the applications installed in the handheld device and running all the applications once, closing all the applications; after returning to the first page, reading and storing the current interface value of the preset function interface; comparing the current interface value with the initial interface value, and determining according to the comparison result A function interface called abnormally in the preset function interface. The present invention can detect the abnormal opening or closing of the functional interface, and find the real reason for the increase of power consumption.
Description
技术领域technical field
本发明属于手持设备技术领域,尤其涉及一种手持设备功耗检测的方法、装置及手持设备。The invention belongs to the technical field of handheld devices, and in particular relates to a method and device for detecting power consumption of a handheld device and the handheld device.
背景技术Background technique
随着智能手持设备的发展,手持设备的显示屏越来越大,手持设备的中央处理器(Central Processing Unit,CPU)的核数越来越多,手持设备的功耗也呈指数上升。With the development of smart handheld devices, the display screen of the handheld device is getting bigger and bigger, the number of cores of the central processing unit (Central Processing Unit, CPU) of the handheld device is increasing, and the power consumption of the handheld device is also rising exponentially.
在智能手持设备时代,功耗已经成为影响用户使用的最重要因素之一。我们常常会为手持设备的高耗电而苦恼。In the era of smart handheld devices, power consumption has become one of the most important factors affecting user use. We often suffer from the high power consumption of handheld devices.
当前,大部分的功耗检测方法是基于测试报告中的数据来发现手持设备功耗变大的原因。Currently, most of the power consumption detection methods are based on the data in the test report to find the reason why the power consumption of the handheld device becomes larger.
然而,在实现本发明过程中,发明人发现现有技术中至少存在如下问题:However, in the course of realizing the present invention, the inventor finds that there are at least the following problems in the prior art:
功能接口的异常开启或者异常关闭导致的功耗增加,是通过现有的功耗测试方法很难发现的。比如,手持设备的屏幕使用了某一省电技术,启动该省电技术对应的功能接口后,该省电技术可以给手持设备带来40%的省电,但是,在使用相机时,该省电技术会给屏幕造成一定的显示效果的差异,所以制定在相机界面不会使用该省电技术,但是由于接口的异常调用,会导致其它界面也不能使用该省电技术,最后导致手持设备的耗电增加。The increase in power consumption caused by the abnormal opening or closing of the functional interface is difficult to find through the existing power consumption testing method. For example, the screen of a handheld device uses a certain power-saving technology. After the function interface corresponding to the power-saving technology is activated, the power-saving technology can bring 40% power saving to the handheld device. However, when using a camera, the power saving The power technology will cause a certain difference in the display effect of the screen, so the power saving technology will not be used in the camera interface, but due to the abnormal call of the interface, other interfaces will not be able to use the power saving technology, and finally lead to handheld devices. Power consumption increases.
发明内容Contents of the invention
有鉴于此,本发明实施例提供一种手持设备功耗检测的方法、装置及手持设备,以解决现有技术提供的手持设备,不能检测到功能接口的异常开启或者异常关闭导致的功耗增加的问题。In view of this, the embodiments of the present invention provide a method, device, and handheld device for detecting power consumption of a handheld device, so as to solve the problem that the handheld device provided by the prior art cannot detect the increase in power consumption caused by the abnormal opening or closing of the functional interface. The problem.
第一方面,提供一种手持设备功耗检测的方法,包括:In the first aspect, a method for detecting power consumption of a handheld device is provided, including:
进入第一页面后,读取并存储预设功能接口的初始接口值,所述第一页面是手持设备开机、解锁后,在所述手持设备的显示屏上显示的第一个页面;After entering the first page, read and store the initial interface value of the preset function interface, the first page is the first page displayed on the display screen of the handheld device after the handheld device is turned on and unlocked;
启动所述手持设备中安装的所有应用,使所述所有应用均运行一遍后,关闭所述所有应用;Start all the applications installed in the handheld device, and after running all the applications, close all the applications;
返回所述第一页面后,读取并存储所述预设功能接口的当前接口值;After returning to the first page, read and store the current interface value of the preset function interface;
将所述当前接口值与所述初始接口值进行比对,根据比对结果确定所述预设功能接口中被异常调用的功能接口。The current interface value is compared with the initial interface value, and the abnormally called functional interface among the preset functional interfaces is determined according to the comparison result.
结合第一方面,在第一方面的第一种可能的实现方式中,所述预设功能接口是全球定位系统GPS接口、省电技术接口、摄像头接口、传感器sensor接口、近场通信NFC接口中的至少一种。With reference to the first aspect, in the first possible implementation of the first aspect, the preset function interface is a global positioning system GPS interface, a power saving technology interface, a camera interface, a sensor sensor interface, and a near field communication NFC interface. at least one of .
结合第一方面或者结合第一方面的第一种可能的实现方式,在第一方面的第二种可能的实现方式中,所述预设功能接口的初始接口值存储在初始接口值列表中,所述预设功能接口的当前接口值存储在当前接口值列表中,所述接口值列表中包括预设功能接口的接口名称和与所述接口名称对应的接口值。In combination with the first aspect or the first possible implementation of the first aspect, in a second possible implementation of the first aspect, the initial interface value of the preset function interface is stored in an initial interface value list, The current interface value of the preset function interface is stored in the current interface value list, and the interface value list includes the interface name of the preset function interface and the interface value corresponding to the interface name.
结合第一方面或者结合第一方面的第一种可能的实现方式或者结合第一方面的第二种可能的实现方式,在第一方面的第三种可能的实现方式中,所述启动所述手持设备中安装的所有应用,使所述所有应用均运行一遍后,关闭所述所有应用,包括:In combination with the first aspect or the first possible implementation of the first aspect or the second possible implementation of the first aspect, in a third possible implementation of the first aspect, the starting the All the applications installed in the handheld device, after running all the applications, close all the applications, including:
启动测试自动化工具;Start the test automation tool;
由所述测试自动化工具启动所述手持设备中安装的所有应用,使所述所有应用均运行一遍后,关闭所述所有应用。All the applications installed in the handheld device are started by the test automation tool, and after all the applications are run once, all the applications are closed.
结合第一方面或者结合第一方面的第一种可能的实现方式或者结合第一方面的第二种可能的实现方式或者结合第一方面的第三种可能的实现方式,在第一方面的第四种可能的实现方式中,在所述将所述当前接口值与所述初始接口值进行比对,根据比对结果确定所述预设功能接口中被异常调用的功能接口之后,还包括:In combination with the first aspect or in combination with the first possible implementation of the first aspect or in combination with the second possible implementation of the first aspect or in combination with the third possible implementation of the first aspect, in the first aspect of the first Among the four possible implementation manners, after comparing the current interface value with the initial interface value, and determining the abnormally called functional interface among the preset functional interfaces according to the comparison result, the method further includes:
读取日志文件;read the log file;
根据所述日志文件,确定调用所述被异常调用的功能接口的应用。According to the log file, the application that calls the abnormally called function interface is determined.
第二方面,提供一种手持设备功耗检测的装置,包括:In the second aspect, a device for detecting power consumption of a handheld device is provided, including:
第一读取单元,用于进入第一页面后,读取并存储预设功能接口的初始接口值,所述第一页面是手持设备开机、解锁后,在所述手持设备的显示屏上显示的第一个页面;The first reading unit is used to read and store the initial interface value of the preset function interface after entering the first page, and the first page is displayed on the display screen of the handheld device after the handheld device is turned on and unlocked the first page of
测试单元,用于启动所述手持设备中安装的所有应用,使所述所有应用均运行一遍后,关闭所述所有应用;a test unit, configured to start all the applications installed in the handheld device, and then close all the applications after running all the applications;
第二读取单元,用于返回所述第一页面后,读取并存储所述预设功能接口的当前接口值;The second reading unit is configured to read and store the current interface value of the preset function interface after returning to the first page;
比对单元,用于将所述当前接口值与所述初始接口值进行比对,根据比对结果确定所述预设功能接口中被异常调用的功能接口。A comparison unit is configured to compare the current interface value with the initial interface value, and determine the abnormally called function interface among the preset function interfaces according to the comparison result.
结合第二方面,在第二方面的第一种可能的实现方式中,所述预设功能接口是全球定位系统GPS接口、省电技术接口、摄像头接口、传感器sensor接口、近场通信NFC接口中的至少一种。With reference to the second aspect, in the first possible implementation of the second aspect, the preset function interface is a global positioning system GPS interface, a power saving technology interface, a camera interface, a sensor sensor interface, and a near field communication NFC interface. at least one of .
结合第二方面或者结合第二方面的第一种可能的实现方式,在第二方面的第二种可能的实现方式中,所述预设功能接口的初始接口值存储在初始接口值列表中,所述预设功能接口的当前接口值存储在当前接口值列表中,所述接口值列表中包括预设功能接口的接口名称和与所述接口名称对应的接口值。In combination with the second aspect or the first possible implementation of the second aspect, in the second possible implementation of the second aspect, the initial interface value of the preset function interface is stored in the initial interface value list, The current interface value of the preset function interface is stored in the current interface value list, and the interface value list includes the interface name of the preset function interface and the interface value corresponding to the interface name.
结合第二方面或者结合第二方面的第一种可能的实现方式或者结合第二方面的第二种可能的实现方式,在第二方面的第三种可能的实现方式中,所述测试单元包括:In combination with the second aspect or the first possible implementation manner of the second aspect or the second possible implementation manner of the second aspect, in a third possible implementation manner of the second aspect, the test unit includes :
启动模块,用于启动测试自动化工具;The startup module is used to start the test automation tool;
测试模块,用于由所述测试自动化工具启动所述手持设备中安装的所有应用,使所述所有应用均运行一遍后,关闭所述所有应用。The test module is configured to start all the applications installed in the handheld device by the test automation tool, and close all the applications after running all the applications once.
结合第二方面或者结合第二方面的第一种可能的实现方式或者结合第二方面的第二种可能的实现方式或者结合第二方面的第三种可能的实现方式,在第二方面的第四种可能的实现方式中,所述装置还包括:In combination with the second aspect or in combination with the first possible implementation of the second aspect or in combination with the second possible implementation of the second aspect or in combination with the third possible implementation of the second aspect, in the first possible implementation of the second aspect In four possible implementation manners, the device further includes:
第三读取单元,用于读取日志文件;The third reading unit is used to read the log file;
应用确定单元,用于根据所述日志文件,确定调用所述被异常调用的功能接口的应用。The application determining unit is configured to determine the application that invokes the abnormally invoked functional interface according to the log file.
第三方面,提供一种手持设备,所述手持设备包括如第二方面所述的手持设备功耗检测的装置。According to a third aspect, a handheld device is provided, and the handheld device includes the device for detecting power consumption of the handheld device according to the second aspect.
在本发明实施例,将读取到的预设功能接口的当前接口值与读取到的预设功能接口的初始接口值进行比对,根据比对结果确定预设功能接口中被异常调用的功能接口。克服了现有技术提供的手持设备,不能检测到功能接口的异常开启或者异常关闭导致的功耗增加的问题,进而达到可以检测到功能接口的异常开启或者异常关闭,找到功耗增加的真正原因的目的。In the embodiment of the present invention, the read current interface value of the preset function interface is compared with the read initial interface value of the preset function interface, and according to the comparison result, it is determined functional interface. It overcomes the problem that the handheld device provided by the prior art cannot detect the increase in power consumption caused by the abnormal opening or closing of the functional interface, and then can detect the abnormal opening or closing of the functional interface, and find the real reason for the increase in power consumption the goal of.
附图说明Description of drawings
图1是本发明手持设备功耗检测的方法实施例的实现流程图;Fig. 1 is the implementation flowchart of the method embodiment of the power consumption detection of the handheld device of the present invention;
图2是本发明手持设备功耗检测的装置实施例的结构框图;Fig. 2 is a structural block diagram of an embodiment of a device for detecting power consumption of a handheld device in the present invention;
图3是本发明手持设备实施例的结构框图。Fig. 3 is a structural block diagram of an embodiment of the handheld device of the present invention.
具体实施方式detailed description
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.
在本发明实施例中,进入第一页面后,读取并存储预设功能接口的初始接口值,所述第一页面是手持设备开机、解锁后,在所述手持设备的显示屏上显示的第一个页面;启动所述手持设备中安装的所有应用,使所述所有应用均运行一遍后,关闭所述所有应用;返回所述第一页面后,读取并存储所述预设功能接口的当前接口值;将所述当前接口值与所述初始接口值进行比对,根据比对结果确定所述预设功能接口中被异常调用的功能接口。In the embodiment of the present invention, after entering the first page, the initial interface value of the preset function interface is read and stored, and the first page is displayed on the display screen of the handheld device after the handheld device is turned on and unlocked The first page; start all the applications installed in the handheld device, and after running all the applications, close all the applications; after returning to the first page, read and store the preset function interface The current interface value; comparing the current interface value with the initial interface value, and determining the abnormally called function interface among the preset function interfaces according to the comparison result.
以下结合具体实施例对本发明的实现进行详细描述:The realization of the present invention is described in detail below in conjunction with specific embodiment:
实施例一Embodiment one
图1示出了本发明实施例一提供的手持设备功耗检测的方法的实现流程,详述如下:Figure 1 shows the implementation process of the method for detecting the power consumption of a handheld device provided by Embodiment 1 of the present invention, which is described in detail as follows:
在步骤S101中,进入第一页面后,读取预设功能接口的初始接口值,所述第一页面是手持设备开机、解锁后,在所述手持设备的显示屏上显示的第一个页面。In step S101, after entering the first page, read the initial interface value of the preset function interface, the first page is the first page displayed on the display screen of the handheld device after the handheld device is turned on and unlocked .
在本发明实施例中,预设功能接口可以包括是全球定位系统GPS接口、省电技术接口、摄像头接口、传感器sensor接口、近场通信NFC接口中的至少一种。In the embodiment of the present invention, the preset function interface may include at least one of a global positioning system GPS interface, a power saving technology interface, a camera interface, a sensor interface, and a near field communication NFC interface.
根据预设功能接口中的指定功能接口的工作状态,可以为预设功能接口中的指定功能接口设置相应的接口值。比如,当预设功能接口中的GPS接口开启时,可以设置GPS接口的接口值为1,当GPS接口关闭时,设置GPS接口的接口值为0。According to the working status of the designated function interfaces in the preset function interfaces, corresponding interface values can be set for the designated function interfaces in the preset function interfaces. For example, when the GPS interface in the preset function interfaces is turned on, the interface value of the GPS interface can be set to 1, and when the GPS interface is turned off, the interface value of the GPS interface can be set to 0.
其中,读取到预设功能接口的初始接口值可以存储在初始接口值列表中,该列表中包括预设功能接口的接口名称和与该接口名称对应的初始接口值。不同的接口名称对应不同的功能接口,接口名称与功能接口的类型唯一对应。Wherein, the initial interface value read from the preset function interface may be stored in an initial interface value list, and the list includes the interface name of the preset function interface and the initial interface value corresponding to the interface name. Different interface names correspond to different functional interfaces, and the interface name corresponds uniquely to the type of the functional interface.
当手持设备进入开机状态,并且用户成功解锁手持设备后,手持设备的显示屏上会显示一个页面,为了描述方便,将该页面称为第一页面。进入第一页面后,手持设备依次读取预设功能接口的指定功能接口初始接口值,如果读取的初始值为1,则表示指定功能接口处于开启状态,如果初始值为0,则表示指定功能接口处于关闭状态。When the handheld device enters the power-on state and the user successfully unlocks the handheld device, a page will be displayed on the display screen of the handheld device. For the convenience of description, this page is referred to as the first page. After entering the first page, the handheld device sequentially reads the initial interface value of the designated function interface of the preset function interface. If the read initial value is 1, it means that the designated function interface is on. If the initial value is 0, it means that the designated function interface is The functional interface is closed.
若预设功能接口包括GPS接口、省电技术接口、摄像头接口、传感器sensor接口和近场通信NFC接口,并且手持设备的显示屏上显示第一页面时,则手持设备获取到的预设功能接口的初始接口值存储在初始接口值列表中,这些功能接口对应的初始接口值均为1。If the preset function interface includes GPS interface, power saving technology interface, camera interface, sensor sensor interface and near field communication NFC interface, and when the first page is displayed on the display screen of the handheld device, the preset function interface obtained by the handheld device The initial interface values of are stored in the initial interface value list, and the initial interface values corresponding to these functional interfaces are all 1.
在步骤S102中,启动所述手持设备中安装的所有应用,使所述所有应用均运行一遍后,关闭所述所有应用。In step S102, start all the applications installed in the handheld device, run all the applications once, and then close all the applications.
在本发明实施例中,获取到预设功能接口的初始接口值后,启动测试自动化工具,由所述测试自动化工具启动所述手持设备中安装的所有应用,使所述所有应用均运行一遍后,关闭所述所有应用。In the embodiment of the present invention, after the initial interface value of the preset function interface is obtained, the test automation tool is started, and all the applications installed in the handheld device are started by the test automation tool, and all the applications are run once. , close all applications as described.
其中,可以启动测试自动化工具,如Monkeyrunner,由Monkeyrunner启动手持设备中安装的所有应用,包括一些市场上常用到的应用,使所有的应用均运行一遍后,关闭所述所有应用。Wherein, a test automation tool can be started, such as Monkeyrunner, which starts all applications installed in the handheld device, including some commonly used applications in the market, and after all applications are run once, all applications are closed.
其中,测试自动化工具在指定应用运行一遍后,关闭该应用,也可以在所用的应用均运行一遍后,再关闭所有应用。Wherein, the test automation tool closes the specified application after running it once, or closes all the applications after running all the applications used once.
通过测试自动化工具,可以实现所有功能接口完全调用。并且,全程不需要检测人员手工参与,省去手工操作,且速度快。Through test automation tools, all functional interfaces can be fully invoked. Moreover, the whole process does not require the manual participation of inspection personnel, eliminating the need for manual operations, and the speed is fast.
在步骤S103中,返回所述第一页面后,读取预设功能接口的当前接口值。In step S103, after returning to the first page, read the current interface value of the preset function interface.
在本发明实施例中,在所有应用均运行一遍并关闭后,控制手持设备的显示屏上显示所述第一页面后,由手持设备再次读取预设功能接口的接口值,为了描述方便,将本次读取到的接口值称为当前接口值。In the embodiment of the present invention, after all the applications are run once and closed, the display screen of the handheld device is controlled to display the first page, and the handheld device reads the interface value of the preset function interface again. For the convenience of description, The interface value read this time is called the current interface value.
在步骤S104中,将所述当前接口值与所述初始接口值进行比对,根据比对结果确定所述预设功能接口中被异常调用的功能接口。In step S104, the current interface value is compared with the initial interface value, and the abnormally called function interface among the preset function interfaces is determined according to the comparison result.
在本发明实施例中,将步骤S103读取到的当前接口值与步骤S101读取到的初始接口值进行比对,根据比对结果确定所述预设功能接口中被异常调用的功能接口。In the embodiment of the present invention, the current interface value read in step S103 is compared with the initial interface value read in step S101, and the abnormally called function interface among the preset function interfaces is determined according to the comparison result.
其中,异常调用包括异常开启和异常关闭。Wherein, the abnormal call includes abnormal opening and abnormal closing.
比如,若步骤S103读取到的当前接口值中GPS接口对应的接口值为1,而步骤S101读取到GPS接口对应的接口值为0,则表示GPS接口被异常关闭;若步骤S103读取到的当前接口值中GPS接口对应的接口值为0,而步骤S101读取到GPS接口对应的接口值为1,则表示GPS接口被异常开启。For example, if the interface value corresponding to the GPS interface in the current interface value read in step S103 is 1, and the interface value corresponding to the GPS interface read in step S101 is 0, it means that the GPS interface is abnormally closed; if step S103 reads Among the obtained current interface values, the interface value corresponding to the GPS interface is 0, and the value of the interface corresponding to the GPS interface read in step S101 is 1, which means that the GPS interface is abnormally opened.
优选地,在本发明实施例中,在步骤S104之后,还包括步骤1和步骤2。Preferably, in the embodiment of the present invention, after step S104, step 1 and step 2 are further included.
在步骤1中,读取日志文件log。In step 1, read the log file log.
在本步骤中,手持设备读取当前时间之前记录的日志文件,该日志文件中记录有当前时间之前运行过的应用的名称以及该应用所调用的功能接口。In this step, the handheld device reads the log file recorded before the current time, and the log file records the name of the application run before the current time and the function interface called by the application.
在步骤2中,根据所述日志文件,确定调用所述被异常调用的功能接口的应用。In step 2, according to the log file, the application that calls the abnormally called function interface is determined.
在本步骤中,可以通过查找日志文件,确定调用被异常调用的功能接口的应用。比如,步骤S104中确定被异常调用的功能接口是GPS接口,则可以从日志文件中查找到调用GPS接口的应用,进而确定该应用是导致GPS接口被异常调用的应用,找到导致手持设备功耗增大的真正原因。In this step, the application that invokes the abnormally invoked functional interface can be determined by searching the log file. For example, if it is determined in step S104 that the abnormally called function interface is the GPS interface, the application that calls the GPS interface can be found from the log file, and then it is determined that the application is the application that caused the GPS interface to be abnormally called, and the power consumption of the handheld device is found. real reason for the increase.
本实施例,将读取到的预设功能接口的当前接口值与读取到的预设功能接口的初始接口值进行比对,根据比对结果确定所述预设功能接口中被异常调用的功能接口。克服了现有技术提供的手持设备,不能检测到功能接口的异常开启或者异常关闭导致的功耗增加的问题,进而达到可以检测到功能接口的异常开启或者异常关闭,找到功耗增加的真正原因的目的。In this embodiment, the read current interface value of the preset function interface is compared with the read initial interface value of the preset function interface, and the abnormally called one of the preset function interfaces is determined according to the comparison result. functional interface. It overcomes the problem that the handheld device provided by the prior art cannot detect the increase in power consumption caused by the abnormal opening or closing of the functional interface, and then can detect the abnormal opening or closing of the functional interface, and find the real reason for the increase in power consumption the goal of.
本领域普通技术人员可以理解实现上述各实施例方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,相应的程序可以存储于一计算机可读取存储介质中,所述的存储介质,如ROM/RAM、磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps in the methods of the above-mentioned embodiments can be completed by instructing related hardware through a program, and the corresponding program can be stored in a computer-readable storage medium. Media, such as ROM/RAM, magnetic disk or optical disk, etc.
实施例二Embodiment two
图2示出了本发明实施例二提供的手持设备功耗检测的装置的具体结构框图,为了便于说明,仅示出了与本发明实施例相关的部分。该手持设备功耗检测的装置2可以是内置于手持设备中的软件单元、硬件单元或者软硬件结合的单元,该手持设备功耗检测的装置2包括:第一读取单元21、测试单元22、第二读取单元23和比对单元24。FIG. 2 shows a specific structural block diagram of an apparatus for detecting power consumption of a handheld device provided by Embodiment 2 of the present invention. For convenience of description, only parts related to the embodiment of the present invention are shown. The device 2 for detecting the power consumption of the handheld device may be a software unit, a hardware unit, or a combination of software and hardware built in the handheld device. The device 2 for detecting the power consumption of the handheld device includes: a first reading unit 21, a testing unit 22 , the second reading unit 23 and the comparing unit 24.
其中,第一读取单元21,用于进入第一页面后,读取并存储预设功能接口的初始接口值,所述第一页面是手持设备开机、解锁后,在所述手持设备的显示屏上显示的第一个页面;Wherein, the first reading unit 21 is used to read and store the initial interface value of the preset function interface after entering the first page, and the first page is displayed on the handheld device after the handheld device is turned on and unlocked The first page displayed on the screen;
测试单元22,用于启动所述手持设备中安装的所有应用,使所述所有应用均运行一遍后,关闭所述所有应用;The testing unit 22 is configured to start all the applications installed in the handheld device, and after running all the applications once, close all the applications;
第二读取单元23,用于返回所述第一页面后,读取并存储所述预设功能接口的当前接口值;The second reading unit 23 is configured to read and store the current interface value of the preset function interface after returning to the first page;
比对单元24,用于将所述当前接口值与所述初始接口值进行比对,根据比对结果确定所述预设功能接口中被异常调用的功能接口。The comparison unit 24 is configured to compare the current interface value with the initial interface value, and determine the abnormally called function interface among the preset function interfaces according to the comparison result.
进一步地,所述预设功能接口是全球定位系统GPS接口、省电技术接口、摄像头接口、传感器sensor接口、近场通信NFC接口中的至少一种。Further, the preset function interface is at least one of a global positioning system GPS interface, a power saving technology interface, a camera interface, a sensor interface, and a near field communication NFC interface.
进一步地,所述预设功能接口的初始接口值存储在初始接口值列表中,所述预设功能接口的当前接口值存储在当前接口值列表中,所述接口值列表中包括预设功能接口的接口名称和与所述接口名称对应的接口值。Further, the initial interface value of the preset function interface is stored in the initial interface value list, the current interface value of the preset function interface is stored in the current interface value list, and the interface value list includes the preset function interface The interface name for and the interface value corresponding to the interface name.
具体的,所述测试单元22包括:Specifically, the test unit 22 includes:
启动模块,用于启动测试自动化工具;The startup module is used to start the test automation tool;
测试模块,用于由所述测试自动化工具启动所述手持设备中安装的所有应用,使所述所有应用均运行一遍后,关闭所述所有应用。The test module is configured to start all the applications installed in the handheld device by the test automation tool, and close all the applications after running all the applications once.
进一步地,所述手持设备功耗检测的装置2,还包括:Further, the device 2 for detecting the power consumption of the handheld device also includes:
第三读取单元,用于读取日志文件;The third reading unit is used to read the log file;
应用确定单元,用于根据所述日志文件,确定调用所述被异常调用的功能接口的应用。The application determining unit is configured to determine the application that invokes the abnormally invoked functional interface according to the log file.
本发明实施例提供的手持设备功耗检测的装置可以应用在前述对应的方法实施例一中,详情参见上述实施例一的描述,在此不再赘述。The apparatus for detecting power consumption of a handheld device provided by the embodiment of the present invention can be applied in the first corresponding method embodiment above. For details, refer to the description of the first embodiment above, and details are not repeated here.
实施例三Embodiment three
图3示出了本发明实施例三提供的手持设备的具体结构框图,为了便于说明,仅示出了与本发明实施例相关的部分。该手持设备3可以为智能手机或平板电脑,包括实施例二中所述的手持设备功耗检测的装置2,该手持设备功耗检测的装置2包括:第一读取单元21、测试单元22、第二读取单元23和比对单元24。FIG. 3 shows a specific structural block diagram of a handheld device provided by Embodiment 3 of the present invention. For convenience of description, only parts related to the embodiment of the present invention are shown. The handheld device 3 can be a smart phone or a tablet computer, and includes the device 2 for detecting the power consumption of the handheld device described in Embodiment 2. The device 2 for detecting the power consumption of the handheld device includes: a first reading unit 21, a testing unit 22 , the second reading unit 23 and the comparing unit 24.
其中,第一读取单元21,用于进入第一页面后,读取并存储预设功能接口的初始接口值,所述第一页面是手持设备开机、解锁后,在所述手持设备的显示屏上显示的第一个页面;Wherein, the first reading unit 21 is used to read and store the initial interface value of the preset function interface after entering the first page, and the first page is displayed on the handheld device after the handheld device is turned on and unlocked The first page displayed on the screen;
测试单元22,用于启动所述手持设备中安装的所有应用,使所述所有应用均运行一遍后,关闭所述所有应用;The testing unit 22 is configured to start all the applications installed in the handheld device, and after running all the applications once, close all the applications;
第二读取单元23,用于返回所述第一页面后,读取并存储所述预设功能接口的当前接口值;The second reading unit 23 is configured to read and store the current interface value of the preset function interface after returning to the first page;
比对单元24,用于将所述当前接口值与所述初始接口值进行比对,根据比对结果确定所述预设功能接口中被异常调用的功能接口。The comparison unit 24 is configured to compare the current interface value with the initial interface value, and determine the abnormally called function interface among the preset function interfaces according to the comparison result.
进一步地,所述预设功能接口是全球定位系统GPS接口、省电技术接口、摄像头接口、传感器sensor接口、近场通信NFC接口中的至少一种。Further, the preset function interface is at least one of a global positioning system GPS interface, a power saving technology interface, a camera interface, a sensor interface, and a near field communication NFC interface.
进一步地,所述预设功能接口的初始接口值存储在初始接口值列表中,所述预设功能接口的当前接口值存储在当前接口值列表中,所述接口值列表中包括预设功能接口的接口名称和与所述接口名称对应的接口值。Further, the initial interface value of the preset function interface is stored in the initial interface value list, the current interface value of the preset function interface is stored in the current interface value list, and the interface value list includes the preset function interface The interface name for and the interface value corresponding to the interface name.
具体的,所述测试单元22包括:Specifically, the test unit 22 includes:
启动模块,用于启动测试自动化工具;The startup module is used to start the test automation tool;
测试模块,用于由所述测试自动化工具启动所述手持设备中安装的所有应用,使所述所有应用均运行一遍后,关闭所述所有应用。The test module is configured to start all the applications installed in the handheld device by the test automation tool, and close all the applications after running all the applications once.
进一步地,所述手持设备功耗检测的装置2,还包括:Further, the device 2 for detecting the power consumption of the handheld device also includes:
第三读取单元,用于读取日志文件;The third reading unit is used to read the log file;
应用确定单元,用于根据所述日志文件,确定调用所述被异常调用的功能接口的应用。The application determining unit is configured to determine the application that invokes the abnormally invoked functional interface according to the log file.
本发明实施例提供的手持设备可以应用在前述对应的方法实施例一中,详情参见上述实施例一的描述,在此不再赘述。The handheld device provided by the embodiment of the present invention can be applied in the foregoing first corresponding method embodiment. For details, refer to the description of the foregoing first embodiment, which will not be repeated here.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Those skilled in the art can appreciate that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present invention.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or May be integrated into another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。If the functions described above are realized in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the essence of the technical solution of the present invention or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disc, etc., which can store program codes. .
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应所述以权利要求的保护范围为准。The above is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Anyone skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present invention. Should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims (11)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410805297.9A CN104503881B (en) | 2014-12-19 | 2014-12-19 | The method of handheld device consumption detection, device and handheld device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410805297.9A CN104503881B (en) | 2014-12-19 | 2014-12-19 | The method of handheld device consumption detection, device and handheld device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104503881A true CN104503881A (en) | 2015-04-08 |
CN104503881B CN104503881B (en) | 2017-05-31 |
Family
ID=52945281
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410805297.9A Expired - Fee Related CN104503881B (en) | 2014-12-19 | 2014-12-19 | The method of handheld device consumption detection, device and handheld device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104503881B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105786671A (en) * | 2016-02-26 | 2016-07-20 | 厦门美图移动科技有限公司 | Method and device for detecting application generating power consumption and computing device |
CN108254703A (en) * | 2017-12-28 | 2018-07-06 | 上海传英信息技术有限公司 | A kind of computer readable storage medium and mobile terminal for the lamp test that glistens |
CN110879659A (en) * | 2018-09-05 | 2020-03-13 | 北京九天微星科技发展有限公司 | Low-power consumption method realized based on equipment management framework in embedded real-time operating system (RT-Thread) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100306609A1 (en) * | 2006-07-21 | 2010-12-02 | Janusz Rajski | Low Power Decompression Of Test Cubes |
CN102346214A (en) * | 2011-08-18 | 2012-02-08 | 华为终端有限公司 | Method and device for monitoring abnormal power consumption of terminal equipment |
CN103106130A (en) * | 2013-01-31 | 2013-05-15 | 广东欧珀移动通信有限公司 | Data monitoring method and data monitoring system for software behavior of mobile terminal |
CN103501372A (en) * | 2013-09-24 | 2014-01-08 | 北京大学 | Method for monitoring currents and event information of smart phone synchronously |
-
2014
- 2014-12-19 CN CN201410805297.9A patent/CN104503881B/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100306609A1 (en) * | 2006-07-21 | 2010-12-02 | Janusz Rajski | Low Power Decompression Of Test Cubes |
CN102346214A (en) * | 2011-08-18 | 2012-02-08 | 华为终端有限公司 | Method and device for monitoring abnormal power consumption of terminal equipment |
CN103106130A (en) * | 2013-01-31 | 2013-05-15 | 广东欧珀移动通信有限公司 | Data monitoring method and data monitoring system for software behavior of mobile terminal |
CN103501372A (en) * | 2013-09-24 | 2014-01-08 | 北京大学 | Method for monitoring currents and event information of smart phone synchronously |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105786671A (en) * | 2016-02-26 | 2016-07-20 | 厦门美图移动科技有限公司 | Method and device for detecting application generating power consumption and computing device |
CN105786671B (en) * | 2016-02-26 | 2019-01-22 | 厦门美图移动科技有限公司 | A method, apparatus and computing device for detecting an application that generates power consumption |
CN108254703A (en) * | 2017-12-28 | 2018-07-06 | 上海传英信息技术有限公司 | A kind of computer readable storage medium and mobile terminal for the lamp test that glistens |
CN110879659A (en) * | 2018-09-05 | 2020-03-13 | 北京九天微星科技发展有限公司 | Low-power consumption method realized based on equipment management framework in embedded real-time operating system (RT-Thread) |
Also Published As
Publication number | Publication date |
---|---|
CN104503881B (en) | 2017-05-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
TWI510913B (en) | Test device and test method thereof | |
CN109409050B (en) | Protection system including machine learning snapshot evaluation | |
TWI505282B (en) | Power shutdown prediction for non-volatile storage devices | |
CN103927194A (en) | Computer device and starting method thereof, and basic input and output system marking method | |
WO2018006587A1 (en) | File storage method, terminal, and storage medium | |
CN107590016A (en) | Recognition method and device for restart after power failure | |
CN106161133B (en) | Method and device for testing webpage loading time | |
US20240264914A1 (en) | Method and device for recovering self-test exception of server component, system and medium | |
CN103970575A (en) | Method and device for quickly starting application program in mobile terminal | |
CN106663164A (en) | System and method for improved security for a processor in a portable computing device (pcd) | |
CN104503881B (en) | The method of handheld device consumption detection, device and handheld device | |
CN115494335A (en) | Wearable device function testing method and device, computer device and storage medium | |
CN105893221B (en) | Method and device for alarming terminal running time | |
CN105323748B (en) | Test error uploading method and device | |
CN105717409B (en) | Electric leakage detection method and system for electronic equipment | |
CN109002216B (en) | Touch screen repairing method and device and electronic equipment | |
CN105354491B (en) | Intelligent terminal standby state detection method and device | |
CN102736957A (en) | Resetting method and device | |
CN106708705B (en) | Terminal background process monitoring method and system | |
CN104572464B (en) | The automatic test state saving approach and device of a kind of Android platform | |
CN104915269B (en) | A kind of mobile terminal time and date information setting method, device and mobile terminal | |
CN104834573B (en) | A kind of method for exiting intelligent terminal maloperation, device and a kind of intelligent terminal | |
CN104618606B (en) | Method and system for starting up mobile terminal | |
CN110750162A (en) | An input method and device | |
CN105514924A (en) | Terminal equipment electric leakage protection method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP03 | Change of name, title or address |
Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18 Patentee after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd. Address before: Changan town in Guangdong province Dongguan 523841 usha Beach Road No. 18 Patentee before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd. |
|
CP03 | Change of name, title or address | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20170531 |
|
CF01 | Termination of patent right due to non-payment of annual fee |