WO2017166036A1 - 一种资源统计方法、装置及终端 - Google Patents

一种资源统计方法、装置及终端 Download PDF

Info

Publication number
WO2017166036A1
WO2017166036A1 PCT/CN2016/077621 CN2016077621W WO2017166036A1 WO 2017166036 A1 WO2017166036 A1 WO 2017166036A1 CN 2016077621 W CN2016077621 W CN 2016077621W WO 2017166036 A1 WO2017166036 A1 WO 2017166036A1
Authority
WO
WIPO (PCT)
Prior art keywords
hardware resource
information
process set
running
acquiring
Prior art date
Application number
PCT/CN2016/077621
Other languages
English (en)
French (fr)
Inventor
勾军委
庄志山
张弛
夏中林
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN202110305184.2A priority Critical patent/CN113157539A/zh
Priority to US16/089,373 priority patent/US10826310B2/en
Priority to CN202110305211.6A priority patent/CN113157439B/zh
Priority to CN201680069782.1A priority patent/CN108293197B/zh
Priority to EP22195025.6A priority patent/EP4171105A1/en
Priority to EP16895817.1A priority patent/EP3410764B1/en
Priority to PCT/CN2016/077621 priority patent/WO2017166036A1/zh
Publication of WO2017166036A1 publication Critical patent/WO2017166036A1/zh
Priority to US17/084,640 priority patent/US11431182B2/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5044Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering hardware capabilities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/02Power saving arrangements
    • H04W52/0209Power saving arrangements in terminal devices
    • H04W52/0261Power saving arrangements in terminal devices managing power supply demand, e.g. depending on battery level
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J7/00Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
    • H02J7/0047Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries with monitoring or indicating devices or circuits
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/725Cordless telephones
    • H04M1/73Battery saving arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W24/00Supervisory, monitoring or testing arrangements
    • H04W24/04Arrangements for maintaining operational condition
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J7/00Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
    • H02J7/0047Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries with monitoring or indicating devices or circuits
    • H02J7/0048Detection of remaining charge capacity or state of charge [SOC]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M2250/00Details of telephonic subscriber devices
    • H04M2250/12Details of telephonic subscriber devices including a sensor for measuring a physical value, e.g. temperature or motion
    • 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
    • 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
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Definitions

  • the present invention relates to the field of electronic technologies, and in particular, to a resource statistics method, apparatus, and terminal.
  • the user ID is usually used for statistics.
  • a UID usually includes multiple applications, and finally the statistics of the UIDs occupy the hardware resources. That is, the total occupancy of hardware resources by multiple applications, the statistical granularity is relatively large, and the information provided is not intuitive.
  • the embodiments of the present invention provide a resource statistics method and device.
  • the statistics of the hardware resources occupied by each application of the terminal can be obtained by performing statistics on a process-by-process basis, and the statistical granularity is relatively small.
  • a first aspect of the present invention provides a resource statistics method, including:
  • the process set includes a process
  • the at least one hardware resource that is invoked by the process acquires occupation information of the at least one hardware resource
  • the process set includes multiple processes
  • More At least one hardware resource that is called by each process in the process obtains occupation information of the at least one hardware resource by the application associated with the multiple processes, and the application associated with the multiple processes includes one application or multiple applications.
  • the method further includes:
  • the first process set formed by the process running in the first time period in the time period consisting of the at least two time points is obtained, where the first occupation information acquisition request is used to request to acquire the time Occupancy information of hardware resources in the segment;
  • the associated first application can include one application or multiple applications.
  • the method further includes:
  • the second occupation information acquisition request is received, the second process set that is formed by the process associated with the second application is obtained, where the second occupation information acquisition request is used to request to acquire the time period formed by the second application for the at least two time points.
  • the user can conveniently query the occupation of hardware resources by one or more applications, and the user is convenient to use, and the information provided is intuitive and accurate.
  • the method further includes:
  • the third occupation information acquisition request is received, acquiring a third process set that is a process that invokes the target hardware resource in the third time period of the time period consisting of the at least two time points, where the third occupation information acquisition request is used for the request Obtaining occupation information of the target hardware resource in the third time period;
  • the third application includes one application or multiple applications
  • the occupant information of the hardware resource includes: occupying the hardware resource, in the fourth feasible implementation manner of the first aspect, At least one of time point information, size information occupying the hardware resource, and power consumption information occupying the hardware resource. It is convenient for users to locate the occupation information of various applications for various hardware resources.
  • the occupation information of the at least one hardware resource includes the application occupying the at least one hardware resource. Size information
  • the size of the at least one hardware resource is occupied by the process in the process set, and the size information of the at least one hardware resource occupied by the application associated with the process in the process set is obtained.
  • the size of the hardware resources occupied by the processes in the process set is determined to determine the size information of the hardware resources occupied by the processes associated with the processes in the process set, and the statistics are performed in units of processes, and the hardware is accurately located to each application.
  • the size of the resource is determined to determine the size information of the hardware resources occupied by the processes associated with the processes in the process set, and the statistics are performed in units of processes, and the hardware is accurately located to each application.
  • the occupation information of the at least one hardware resource includes the application occupying the at least one hardware resource Power consumption information
  • the power consumption information of the at least one hardware resource is occupied by the process in the process set, and the application associated with the process in the process set occupies the power consumption information of the at least one hardware resource.
  • the method further includes:
  • the information in the process set in the process set occupies the at least one hardware resource in the foreground run, and the process set is separately counted.
  • the process occupies information of the at least one hardware resource when running in the background;
  • the information of the at least one hardware resource is occupied when the process in the process set runs in the background, and the information about the at least one hardware resource is acquired when the application associated with the process in the process set runs in the background.
  • This method can accurately determine the occupation information of each application running in the foreground and running the hardware resources in the background, so that the user can understand the occupation of resources when each application runs in the front and back. condition.
  • the method further includes:
  • the application associated with the process occupies information of the at least one hardware resource.
  • This method can facilitate the user to determine the occupation of hardware resources by each application in the bright screen state and the black screen state.
  • a second aspect of the present invention provides a resource statistics apparatus, including:
  • a recording module configured to record a process run by the terminal at each of the at least two time points
  • a first obtaining module configured to acquire, for each of the time points, at least one hardware resource invoked by a process running at the time point;
  • a second acquiring module configured to acquire a process set consisting of processes running at the at least two time points, where the process set includes one process or multiple processes;
  • a third obtaining module configured to acquire, according to the at least one hardware resource invoked by the process in the process set, the occupation information of the at least one hardware resource by the application associated with the process in the process set. If the process set includes a process, the at least one hardware resource that is invoked by the process acquires occupation information of the at least one hardware resource, and if the process set includes multiple processes, At least one hardware resource that is invoked by each of the plurality of processes obtains occupation information of the at least one hardware resource by the application associated with the multiple processes, where the application associated with the multiple processes includes one application or multiple applications .
  • the source occupancy information allows the user to accurately locate applications that use more hardware resources, and the information provided is more intuitive.
  • the device further includes:
  • a fourth acquiring module configured to acquire a first process set formed by a process running in a first time period in a time period consisting of at least two time points, if the first occupation information acquisition request is received, the first occupation information acquisition request Used to request to acquire occupation information of hardware resources in the period of time;
  • a fifth obtaining module configured to acquire, according to the hardware resource invoked by the process in the first process set, the occupation information of the at least one hardware resource in the first time period of the first application associated with the process in the first process set,
  • the first application associated with the application in the first process set may include one application or multiple applications.
  • the device further includes:
  • a sixth acquiring module configured to acquire a second process set formed by a process associated with the second application, where the second occupation information acquisition request is used to request to acquire the second application, the at least two Occupancy information of hardware resources in the second time period in the time period consisting of time points;
  • the seventh obtaining module is configured to obtain, according to the hardware resource invoked by the process in the second process set in the second time period, the occupation information of the at least one hardware resource in the second time period by the second application.
  • the user can conveniently query the occupation of hardware resources by one or more applications, and the user is convenient to use, and the information provided is intuitive and accurate.
  • the device further includes:
  • an eighth acquiring module configured to acquire a third process set that is a process of calling a target hardware resource in a third time period of the time period consisting of the at least two time points, if the third occupation information acquisition request is received, the third acquiring module
  • the occupation information acquisition request is used to request to acquire occupation information of the target hardware resource in the third time period
  • a ninth obtaining module configured to acquire, according to the calling information of the target hardware resource by the process in the third process set in the third time period, the third application associated with the process in the third process set is in the third time period
  • an output module configured to output the occupation information of the target hardware resource and the identifier of the target hardware resource.
  • the occupation information of the hardware resource includes: occupying the hardware resource At least one of time point information, size information occupying the hardware resource, and power consumption information occupying the hardware resource. It is convenient for users to locate the occupation information of various applications for various hardware resources.
  • the application related to the at least one hardware resource by the process associated with the process in the process set includes the application occupying the at least one hardware Size information of the resource;
  • the third acquiring module obtains, by the third acquiring module, the occupation information of the at least one hardware resource by the application associated with the process in the process set according to the at least one hardware resource that is invoked by the process in the process set, specifically:
  • the size of the at least one hardware resource is occupied by the process in the process set, and the size information of the at least one hardware resource occupied by the application associated with the process in the process set is obtained.
  • the size of the hardware resources occupied by the processes in the process set is determined to determine the size information of the hardware resources occupied by the processes associated with the processes in the process set, and the statistics are performed in units of processes, and the hardware is accurately located to each application.
  • the size of the resource is determined to determine the size information of the hardware resources occupied by the processes associated with the processes in the process set, and the statistics are performed in units of processes, and the hardware is accurately located to each application.
  • the application related to the at least one hardware resource by the process associated with the process in the process set includes the application occupying the at least one hardware Power consumption information of resources;
  • the third acquiring module obtains, by the third acquiring module, the occupation information of the at least one hardware resource by the application associated with the process in the process set according to the at least one hardware resource that is invoked by the process in the process set, specifically:
  • the power consumption information of the at least one hardware resource is occupied by the process in the process set, and the application associated with the process in the process set occupies the power consumption information of the at least one hardware resource.
  • the device further includes a first determining module
  • the first determining module is configured to determine, according to a process that runs at each time point, a running state type of the process, where the running state type includes a foreground running or a background running;
  • the third acquiring module obtains, by the third acquiring module, the occupation information of the at least one hardware resource by the application associated with the process in the process set according to the at least one hardware resource that is invoked by the process in the process set, specifically:
  • the device further includes:
  • a second determining module configured to determine, according to a process running at each time point, a terminal screen state at the time point, where the terminal screen state includes a bright screen state or a black screen state;
  • the third acquiring module obtains, by the third acquiring module, the occupation information of the at least one hardware resource by the application associated with the process in the process set according to the at least one hardware resource that is invoked by the process in the process set, specifically:
  • the application associated with the process occupies information of the at least one hardware resource.
  • This method can facilitate the user to determine the occupation of hardware resources by each application in the bright screen state and the black screen state.
  • a third aspect of the embodiments of the present invention provides a terminal, including: a processor, a memory, and at least one hardware resource, where the processor, the memory, and the at least one hardware resource are respectively connected to a communication bus, and the memory stores one a program code, and the processor is configured to invoke program code stored in the memory for performing the following steps:
  • the process set includes a process
  • the at least one hardware resource that is invoked by the process acquires occupation information of the at least one hardware resource
  • the process set includes multiple processes
  • More At least one hardware resource that is called by each process in the process obtains occupation information of the at least one hardware resource by the application associated with the multiple processes, and the application associated with the multiple processes includes one application or multiple applications.
  • the device further includes an input device, where the input device is connected to the communication bus, and the processor is further configured to invoke the memory Stored program code to perform the following steps:
  • the first occupation information acquisition request is received by the input device, the first process set formed by the process running in the first time period of the time period consisting of at least two time points is acquired, and the first occupation information acquisition request is used for Requesting to obtain occupation information of hardware resources in the period of time;
  • the associated first application can include one application or multiple applications.
  • the device further includes an input device, where the input device is connected to the communication bus, and the processor is further configured to invoke the memory Stored program code to perform the following steps:
  • the second occupation information acquisition request acquiring a second process set formed by the process associated with the second application, where the second occupation information acquisition request is used to request to acquire the second application for the at least two times The occupation information of hardware resources in the second time period in the time period formed by the points;
  • the user can conveniently query the occupation of hardware resources by one or more applications, and the user is convenient to use, and the information provided is intuitive and accurate.
  • the device further includes An input device and an output device, wherein the input device and the output device are respectively connected to the communication bus; the processor is further configured to invoke program code stored in the memory, to perform the following steps:
  • a third occupation information acquisition request acquiring a third process set that is a process that invokes a target hardware resource in a third time period of the time period consisting of the at least two time points, the third occupation information
  • the obtaining request is used to request to acquire occupation information of the target hardware resource in the third time period
  • the third application includes one application or multiple applications
  • the fourth aspect of the third aspect the third possible implementation manner of the third aspect, At least one of time point information, size information occupying the hardware resource, and power consumption information occupying the hardware resource. It is convenient for users to locate the occupation information of various applications for various hardware resources.
  • the at least one hardware resource includes the application occupying the at least one hardware resource. Size information
  • the size of the at least one hardware resource is occupied by the process in the process set, and the size information of the at least one hardware resource occupied by the application associated with the process in the process set is obtained.
  • the size of the hardware resources occupied by the processes in the process set is determined by calculating the size of the hardware resources occupied by the processes in the process set, and the process is determined by the process. Perform statistics to accurately locate the size information of each application on hardware resources.
  • the occupation information of the at least one hardware resource includes the application occupying the at least one hardware resource.
  • the power consumption information of the at least one hardware resource is occupied by the process in the process set, and the application associated with the process in the process set occupies the power consumption information of the at least one hardware resource.
  • the processor is further configured to invoke the memory.
  • the program code stored in it is used to perform the following steps:
  • a running state type of the process Determining, by the process running at each of the time points, a running state type of the process, where the running state type includes a foreground running or a background running;
  • the processor is configured to acquire the occupation information of the at least one hardware resource by the application associated with the process in the process set according to the at least one hardware resource that is invoked by the process in the process set, including:
  • the information in the process set in the process set occupies the at least one hardware resource in the foreground run, and the process set is separately counted.
  • the process occupies information of the at least one hardware resource when running in the background;
  • the information of the at least one hardware resource is occupied when the process in the process set runs in the background, and the information about the at least one hardware resource is acquired when the application associated with the process in the process set runs in the background.
  • This method can accurately determine the occupation information of each application running in the foreground and running the hardware resources in the background, so that the user can understand the occupation status of resources when each application runs in the front and back.
  • the processor is further configured to invoke the memory according to any one of the third aspect to the third possible implementation manner of the third aspect, in an eighth possible implementation manner of the third aspect,
  • the program code stored in it is used to perform the following steps:
  • the processor acquires, by the processor, the occupation information of the at least one hardware resource by the application associated with the process in the process set according to the at least one hardware resource that is invoked by the process in the process set, including:
  • the application associated with the process occupies information of the at least one hardware resource.
  • This method can facilitate the user to determine the occupation of hardware resources by each application in the bright screen state and the black screen state.
  • a fourth aspect of the present invention provides a computer storage medium storing a program, the program specifically comprising instructions for performing some or all of the steps of any of the first aspects of the embodiments of the present invention.
  • the process running by the terminal at each time point is recorded at at least two time points, and for each time point, at least one hardware resource invoked by the process running at the time point is acquired, and obtained.
  • the application uses the occupancy information of the at least one hardware resource. In this way, by statistic in units of processes, the occupancy information of the at least one hardware resource of each application can be accurately located, and the provided information is relatively intuitive.
  • FIG. 1 is a schematic flowchart of a resource statistics method according to an embodiment of the present disclosure
  • FIG. 2 is a schematic flowchart of another resource statistics method according to an embodiment of the present invention.
  • FIG. 3 is a schematic diagram of a UI interface according to an embodiment of the present disclosure.
  • FIG. 4 is a schematic diagram of another UI interface according to an embodiment of the present disclosure.
  • FIG. 5 is a diagram of information interaction in a terminal according to an embodiment of the present invention.
  • FIG. 6 is an internal information interaction diagram of a battery burn-up diagram according to an embodiment of the present invention.
  • FIG. 7 is a schematic structural diagram of a resource statistics apparatus according to an embodiment of the present disclosure.
  • FIG. 8 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
  • the resource statistics device disclosed by the present invention can be implemented as a single device or integrated into various terminals, such as a mobile phone, a tablet personal computer, a laptop computer, a multimedia player. , digital camera, personal digital assistant (PDA), mobile Internet device (MID) or wearable device (Wearable Device).
  • PDA personal digital assistant
  • MID mobile Internet device
  • WPA wearable device
  • the hardware resources of the embodiments of the present invention include, but are not limited to, a touch panel, a microphone, a central processing unit (CPU), a wireless local area network (WLAN) module, a Bluetooth module, and a global positioning system (Global Positioning). System, GPS) module, liquid crystal display (LCD) and so on.
  • CPU central processing unit
  • WLAN wireless local area network
  • Bluetooth Bluetooth
  • Global Positioning Global Positioning
  • GPS global positioning system
  • LCD liquid crystal display
  • the occupation information of the hardware resource in the embodiment of the present invention includes, but is not limited to, at least one of time point information occupying the hardware resource, size information occupying the hardware resource, and power consumption information occupying the hardware resource. It should be noted that the size information of the occupied hardware resources may be the occupation time of occupying the hardware resources.
  • the existing resource statistics algorithm is improved, and more and more detailed hardware resource occupation information can be obtained.
  • the embodiment of the present invention can obtain various occupation information of each application to the hardware resource, including but not limited to Time point, size, power consumption, etc.).
  • the existing resource statistics algorithm performs statistics in units of UIDs, and generally counts the power consumption of hardware resources.
  • One UID contains multiple applications, one application contains multiple processes, and each process uses one process identifier (Process ID). , PID) to identify, a process running power consumption of each hardware resource, then calculate the UID associated with the process, so the result of statistics is that the final terminal can output a UID to the total power consumption of the hardware
  • PID process identifier
  • statistics are performed in units of PIDs in the process of performing resource statistics, and processes running at various time points and at least one hard call invoked by the process are recorded.
  • the total power consumption information of the terminal that is, the sum of the power consumption information of all processes on the hardware resources
  • the occupation of the hardware resources occupied by the application associated with the process at the time point may also be intercepted for a period of time to obtain which hardware resources are occupied by the application during the time period (that is, at least one process that is acquired during the time period)
  • the hardware resource invoked by the at least one process running in the time period is used as an occupation of each hardware resource by the application associated with the at least one
  • various hardware resource occupation information can be obtained by performing statistics in units of processes, by running processes recorded at various time points, and at least one hardware resource invoked by the respective processes.
  • the contents mentioned in the embodiments are all within the scope of protection of the present invention as long as the information is statistically obtained in units of PIDs.
  • FIG. 1 is a schematic flowchart of a resource statistics method according to an embodiment of the present invention. As shown in the figure, the resource statistics method in this embodiment includes steps S100-S102.
  • the time point is a certain moment, which is a certain moment in time, or a certain point on the time axis, for example, 8:40 is a time point.
  • the present invention counts the processes running by the terminal at each of the at least two time points in units of processes.
  • the process identifier PID that is run by the terminal is obtained at a certain interval, and the time interval is determined according to the running time of each process. For example, the process PID that is run by the terminal is obtained every 1 ms, and is recorded. If the process PID of the terminal acquired at each time point is used, if the recording mode is adopted, there may be multiple process PIDs at the same time. Or the recording mode may be that when the system runs each process, the system service notifies the running process PID, then Record the corresponding relationship between the corresponding time point and the PID of the process. If this recording mode is adopted, the process PIDs running at each time point are different, and the difference between the two time points is the process. The length of the run.
  • the system service activity manager (AMS) in the Android system can schedule all processes and hardware resources, as shown in FIG. 5, when the user operates the screen through gestures.
  • the gesture is converted to an APP operation command and transmitted to the AMS, and the AMS schedules the corresponding process, and simultaneously notifies the power manager to record the process PID running by the terminal, and the power manager automatically stores the time points and locations to the storage unit.
  • the corresponding storage method of the process PID may be to add a PID to the storage unit.
  • controller may further obtain the state of the terminal screen when the process is running, for example, whether the screen is on or off, or the controller may also obtain an running state of running the process, such as running in the foreground or running in the background.
  • the terminal screen status and/or operating status acquired by the controller is also stored to the storage unit accordingly.
  • At least one hardware resource that is invoked by the process running at the time point is further acquired, and one process operation may invoke at least one hardware resource, where the hardware resources include but are not limited to the CPU and the WLAN module. , Bluetooth module, Global Positioning System (GPS) module, Liquid Crystal Display (LCD), camera module and so on.
  • the hardware resources include but are not limited to the CPU and the WLAN module. , Bluetooth module, Global Positioning System (GPS) module, Liquid Crystal Display (LCD), camera module and so on.
  • GPS Global Positioning System
  • LCD Liquid Crystal Display
  • At least one hardware resource called by the process running at each time point is also stored.
  • the A process calls the CPU and the GPS module, and the time point is stored in the storage unit.
  • Correspondence between A process and hardware resources CPU and GPS module).
  • S102 Acquire a process set consisting of processes running at the at least two time points, where the process set includes one process or multiple processes;
  • all recorded process PIDs in at least two time points are managed by a set, and the process set includes one process or multiple processes. It should be noted that when recorded If the process PID of each of the at least two time points is the same, then a process is included in the process set.
  • the occupation information of the at least one hardware resource of the application associated with the process is acquired according to the at least one hardware resource invoked by the process;
  • the process obtains the occupation information of the at least one hardware resource by the application associated with the multiple processes according to the at least one hardware resource that is invoked by each process in the process set.
  • the application associated with the multiple processes includes one application or multiple applications.
  • the application is any application installed on the terminal, including but not limited to browser, email, instant messaging service, word processing, keyboard virtual, widget, encryption, digital rights management. , speech recognition, voice reproduction, location navigation (such as those provided by GPS), music playback, and more. It should be noted that the operation of each application is based on the operation of each process under the application.
  • information about the at least one hardware resource occupied by the application associated with the process in the process set may be statistically obtained. Specifically, the occupation information of each hardware resource associated with all processes associated with an application is determined as the occupation information of the application for the respective hardware resource.
  • the usage information of the application for the at least one hardware resource includes time point information that the application occupies the at least one hardware resource (that is, at which point in time the corresponding hardware resource is occupied), or the application occupies at least one hardware resource.
  • the information includes the size information of the at least one hardware resource occupied by the application (that is, the total length of time that an application occupies the corresponding hardware resource), or the usage information of the application for the at least one hardware resource includes the power consumption of the hardware resource occupied by the application.
  • Information, etc. that is, the power consumption generated by an application occupying the corresponding hardware resources, and the power consumption is related to the power consumption of the terminal).
  • the information about the occupation of each hardware resource by each application may be separately collected, for example, the occupation information of the CPU by the application A, the occupation information of the GPS, and the like.
  • the application related to the at least one hardware resource by the application associated with the process in the process set includes the size information of the at least one hardware resource occupied by the application;
  • the process may be executed according to the stored at least two time points (the number of processes includes one or more And at least one hardware resource called by each process performs statistics, and obtains at least one hardware resource size for each process in each process. If the hardware resource includes one, the size of the hardware resource is occupied, and if the hardware resource includes more The size of each hardware resource in the plurality of hardware resources may be occupied.
  • the size of the hardware resources occupied by each process may be the duration of occupying the hardware resources. For example, for a process, the time that the process occupies a certain hardware resource is added to obtain the size of the hardware resource occupied by the process.
  • the size of the at least one hardware resource occupied by the process in the process set is obtained according to the size of the at least one hardware resource.
  • the application associated with the process in the process set may include one or more, and the size information of each hardware resource occupied by each process in each process is determined as an application associated with the process occupies the hardware resource. the size of.
  • all the processes in the application add the occupied size of a certain hardware resource to obtain the size information of the hardware resource occupied by the application.
  • the A application includes the processes a and b
  • the process A can add the CPU occupation size and the process b to the CPU occupation size to obtain the A application pair.
  • CPU occupancy size information The application A calculates the occupation size of other hardware resources in the same way, and will not be described here.
  • the occupancy information includes power consumption information of the at least one hardware resource occupied by the application
  • step S10 For the steps of the embodiment of the present invention, refer to step S10, and details are not described herein again.
  • the process in the process set may calculate the power consumption information of the at least one hardware resource occupied by the process in the process set.
  • the size of a certain hardware resource is the length of time occupied by the hardware resource.
  • the calculation method of calculating the power consumption information of a certain hardware resource by a certain process may be that the size of the hardware resource occupied by the process is compared with the power of the hardware resource. Multiply, the power consumption information of the hardware resource occupied by the process is obtained.
  • the power consumption information of the at least one hardware resource is occupied by the process in the process set, and the power consumption information of the at least one hardware resource occupied by the application associated with the process in the process set is obtained.
  • the power consumption information of the at least one hardware resource occupied by the process in the process set may be obtained, and the specific calculation manner may be Yes, the power consumption information of a certain process on a certain hardware resource is determined as the power consumption of the hardware resource of the application associated with the process, and further, the power consumption set of all the processes associated with an application to each hardware resource is The power consumption of the application for each hardware resource.
  • each hardware resource of each application can directly reflect the power consumption of the application.
  • the user may initiate various hardware resource occupation information acquisition requests to the terminal, and the following three optional occupancy information acquisition requests are used as an example in the embodiment of the present invention.
  • Chengdu is limited by the scope of protection of the invention:
  • the occupation information acquisition request is a first occupation information acquisition request, and includes the following steps S15-S16;
  • the first occupation information acquisition request is used to acquire the occupation information of the hardware resources in the first time period, where the first time period is composed of at least two time points. Part or all of the time period, obtaining a first process set consisting of processes running in the first time period, the first process set including one process or multiple processes.
  • the occupation information of the at least one hardware resource in the first time period is acquired according to the hardware resource invoked by the process; if the first process The plurality of processes are included in the set, and the first application (the first application includes one application or multiple applications) associated with the multiple processes is obtained according to the hardware resources invoked by each of the multiple processes in the first time.
  • the occupation information of the hardware resource includes at least one of time point information occupying the hardware resource, size information occupying the hardware resource, and power consumption information occupying the hardware resource.
  • the user wants to obtain the occupation of hardware resources in the first time period of 8:00-8:30, it can obtain multiple processes running in the 8:00-8:30 period, each process At least one hardware resource is invoked, and the occupation of the corresponding hardware resource by each process is occupied by the corresponding hardware resource of the application associated with the process.
  • hardware resources include CPU, Bluetooth module, GPS, hardware resource occupancy information includes power consumption of hardware resources (of course, not only power consumption but also other information, here is power consumption as an example); 8:00-8:30
  • the multiple processes running during the time period include Process 1, Process 2, Process 3, and Process 4.
  • the power consumption of Process 1 for the CPU is 2, the power consumption of Process 1 for Bluetooth is 2, and the power consumption of Process 2 for the CPU is 2 Yes 3, Process 3 vs. CPU power consumption is 8, Process 4 vs. CPU power consumption is 2, Process 3 vs. CPU power consumption is 8, Bluetooth power consumption is 1, GPS power consumption is 2; Process 4 vs.
  • the power consumption is 2, the process 1 and the process 2 are associated with the application A, the process 3 is associated with the application B, and the process 4 is associated with the application C.
  • the power consumption of the application A to the CPU is 5
  • the power consumption of the Bluetooth is 2
  • the power consumption of the application B is 8 for the CPU
  • the power consumption for the Bluetooth is 1
  • the power consumption for the GPS is 2
  • the power consumption of the application C is 2 for the CPU.
  • the hardware resource occupation information may further include time point information occupying hardware resources (that is, which application is occupying corresponding hardware resources at each time point), and continues to use the above 8:00-8:30 time period.
  • time point information occupied by the at least one hardware resource is used as an example, and the plurality of processes running in the 8:00-8:30 time period and the at least one hardware resource of the multiple processes are recorded.
  • the occupation of the hardware resources of the application associated with the process running at each time point can be obtained. For example, the last statistics get that the application A occupies the CPU and Bluetooth at 8:00-8:10, and the application B at 8:15. -8:20 occupies CPU, Bluetooth and GPS, and application C occupies the CPU at 8:20-8:30.
  • the hardware resource occupation information may also include the size information of the occupied hardware resources, and the size information is the duration of occupying the hardware resources, and the specific calculation manner is not described herein.
  • the occupation information acquisition request is a second occupation information acquisition request, and includes the following steps S17-S18;
  • the second occupation information acquisition request is used to request acquisition of the occupation information of the second application in the second time period, the second time period is at least two Part or all of the time period consisting of time points, obtaining the second application associated with A second process set consisting of processes, the second process set including one process or multiple processes.
  • the second application acquires the occupation information of the at least one hardware resource in the second time period according to the hardware resource invoked by the process; if the second process set includes The plurality of processes acquire the occupation information of the at least one hardware resource in the second time period by the second application according to the hardware resource that is invoked by each of the multiple processes.
  • the occupation information of the hardware resource includes at least one of time point information occupying the hardware resource, size information occupying the hardware resource, and power consumption information occupying the hardware resource.
  • the second process set composed of the processes associated with the application A is acquired (the second process set)
  • the process includes a process or a plurality of processes.
  • the application A can obtain at least one hardware resource in the range of 8:00-8:30. Occupy information.
  • a process invokes at least one hardware resource, and the occupation of the corresponding hardware resource by the process is used as an occupation of the corresponding hardware resource by the application associated with the process.
  • hardware resources include CPU, Bluetooth module, GPS, hardware resource occupancy information includes power consumption of hardware resources (of course, not only power consumption but also other information, here is power consumption as an example); application A includes process 1 and process 2; 8:00-8:30 During this period, the power consumption of the process 1 to the CPU is 2, the power consumption of the process 1 to the Bluetooth is 2, and the power consumption of the process 2 to the CPU is 3, then the power consumption of the CPU A is applied. Is 5, the power consumption for Bluetooth is 2;
  • the hardware resource occupation information may further include time point information occupying the hardware resources (that is, reflecting which hardware resources are occupied by the application A at which time point), and continuing between the above 8:00-8:30 time periods.
  • the time point information occupied by the at least one hardware resource is taken as an example.
  • the recorded process 1 in the 8:00-8:30 time period occupies the CPU and the Bluetooth at 8:00-8:05.
  • Process 2 occupies the CPU at 8:05-8:10, then it can get the CPU occupied at 8:00-8:10, and the Bluetooth is occupied at 8:00-8:05.
  • the hardware resource occupation information may also include the size information of the occupied hardware resources, and the size information is the duration of occupying the hardware resources, and the specific calculation manner is not described herein.
  • the occupation information acquisition request is a third occupation information acquisition request, including the following steps S19-S21;
  • the third occupation information acquisition request is used to request acquisition of the occupation information of the target hardware resource in the third time period, and the occupation information of the target hardware resource includes but is not limited to
  • the third time period is at least two time points And all or part of the time period of the composition, acquiring a third process set consisting of a process that invokes the target hardware resource in a third time point, where the third process set includes one process or multiple processes.
  • the third process set includes a process, acquiring, according to the hardware resource invoked by the process, the occupation information of the at least one hardware resource in the third time period of the application associated with the process; if the third process is in the set Include a plurality of processes, and obtain, according to hardware resources invoked by each of the multiple processes, a third application (the third application includes one application or multiple applications) associated with the multiple processes in a third time period. Occupancy information for the at least one hardware resource.
  • the occupation information of the hardware resource includes at least one of time point information occupying the hardware resource, size information occupying the hardware resource, and power consumption information occupying the hardware resource.
  • the third process consists of calling the CPU in the 8:00-8:30 time period.
  • the process set (the third process set includes one process or multiple processes), for example, the process that calls the CPU in the 8:00-8:30 time period includes process 1, process 2, process 3, and process 4; process 1 to CPU
  • the power consumption is 2, the power consumption of the process 2 to the CPU is 3, the power consumption of the process 3 to the CPU is 8, and the process 4 is to the CPU.
  • the power consumption is 2, the process 1 and the process 2 are associated with the application A, the process 3 is associated with the application B, and the process 4 is associated with the application C, then the power consumption of the application A to the CPU can be obtained, and the power consumption of the application B to the CPU is 8 , application C to CPU power consumption is 2.
  • the power consumption of the hardware resources generated by the respective applications in the period from 8:00 to 8:30 can be clearly reflected by the embodiment of the present invention.
  • the power consumption information and the CPU resource identifier may be output.
  • each hardware resource may be calculated according to the power consumption calculation manner of the foregoing target resource, thereby obtaining power consumption status of each hardware resource, and outputting the identifier of each hardware resource.
  • the total power consumption of each hardware resource can be used as the total power consumption of the terminal in the third time period.
  • the hardware resource occupation information may further include time point information occupying the hardware resources (ie, reflecting which applications are occupied by the target hardware resources at which time points), and continuing between the above 8:00-8:30 time periods.
  • the occupation information of the target hardware resource is taken as an example, and multiple processes (process 1, process 2, process 3, and process occupied by the CPU of the target hardware resource in the recorded time range of 8:00-8:30 are recorded. 4), the application A associated with process 1 and process 2 can be obtained.
  • the target hardware resource CPU is occupied at 8:00-8:10, and the application B associated with process 3 occupies the target hardware at 8:15-8:20.
  • Resource CPU, application C associated with process 4 occupies the target hardware resource CPU at 8:20-8:30.
  • the hardware resource occupation information may also include the size information of the occupied hardware resources, and the size information is the duration of occupying the hardware resources, and the specific calculation manner is not described herein.
  • a process running by the terminal at each of the at least two time points is recorded, and for each time point, at least one hardware resource invoked by the process running at the time point is acquired, and the at least two times are acquired.
  • a process set consisting of a process that is a group of processes, the process set includes a process or a plurality of processes, and according to the at least one hardware resource invoked by the process in the process set, acquiring an application associated with the process in the process set to the at least The occupation information of a hardware resource.
  • FIG. 2 is a schematic flowchart of another resource statistics method according to an embodiment of the present invention. As shown in the figure, the resource statistics method in this embodiment includes the following steps:
  • steps S200-S202 of the embodiment of the present invention refer to the steps S100-S102 of the embodiment of FIG. 1 , and details are not described herein again.
  • steps S202-S205 may be included;
  • S203 Determine, for each process running at the time point, a running state type of the process, where the running state type includes a foreground running or a background running.
  • the embodiment when each application runs in the background, hardware resources are also occupied, for example, the CPU is occupied. Therefore, in order to enable the user to clarify the occupation of the hardware resources when the respective applications are running in the foreground and in the background, the embodiment further determines the running state type of the process at each time point, and the running state type includes foreground running or background running.
  • the AMS determines, by the controller, the foreground running or the background running of the process running at each time point, and The corresponding process PID, the called hardware resource, the foreground or the background running state type are stored in the storage unit.
  • S204 Collect, according to the hardware resources invoked by the process in the process set, and the running state type of the process in the process set, respectively, information that the process in the process set occupies the at least one hardware resource when running in the foreground And the process in the set of processes occupying information of the at least one hardware resource when running in the background;
  • the hardware resources invoked by each process in the recorded at least two time points and the running state type of each process statistics of each hardware resource occupied by each process in the foreground running may be counted, and the specific information may be selected.
  • the occupation of each hardware resource at all points in time when the process is running in the foreground is occupied as a hard time for the process to run in the foreground.
  • Information about the resource; the occupation of each hardware resource at all points in time when the process runs in the background is used as information about the hardware resources occupied by the process when it runs in the background.
  • the information that the process occupies the hardware resources may be the time point at which the process occupies each hardware resource or the total duration of the hardware resources occupied by the process (that is, the occupation size of each hardware resource), or may also be It is the power consumption information of the hardware resources occupied by the process.
  • S205 Acquire information about the at least one hardware resource when the process in the process set is running in the foreground, and obtain information that the application associated with the process in the process set occupies the at least one hardware resource when running in the foreground;
  • the information of each hardware resource occupied by the application associated with each process in the foreground running may be obtained, that is, a certain process is occupied when running in the foreground.
  • the information of the hardware resources is the occupation information of the hardware resources when the application associated with the process runs in the foreground.
  • the two applications (PKG: com.test.demo1 and PKG: com.test.demo2) are used to illustrate the occupation of hardware resources.
  • PID 2000CPU: 200s (the total length of CPU usage for the process PID2000 running in the foreground is 200s)
  • PID 2001CPU: 300s (the total length of the CPU occupied by the process PID2001 running in the foreground is 300s)
  • PID 2000GPS: 200s (the total length of GPS occupied by the process PID2000 running in the foreground is 200s)
  • PID 2000 Wifi traffic: 10M (the process PID2000 runs in the foreground when the WIFI traffic costs 10M)
  • PID 2000CPU: 300s (when the process PID2000 runs in the background, the total CPU usage time is 300s)
  • PID 2001CPU: 200s (the total duration of CPU usage when the process PID2001 is running in the background is 200s)
  • PID 2000GPS: 300s (the total duration of GPS occupancy for the process PID2000 running in the background is 300s)
  • PID 2000 Wifi traffic: 10M (the process PID2000 runs in the background when the wifi consumes 10M traffic)
  • PID 2001 Wifi traffic: 10M (process PID2001 running in the background when the wifi consumption traffic is 10M)
  • the process 2000 is associated with the application com.test.demo1, and the application com.test.demo1 has a CPU usage of 200s in the foreground, 200s for the GPS, and 10M for the WIFI traffic.
  • the application com.test.demo1 has a CPU size of 300s in the background, 300s for the GPS, and 10M for the WIFI traffic.
  • the size of each hardware resource when the com.test.demo2 runs in the foreground can be counted.
  • each hardware resource when running in the background, and further calculating the power consumption of each hardware resource according to the occupied size of each hardware resource, and the power consumption can directly reflect the power consumption of the terminal, and the present invention
  • the statistically obtained information about the occupation of each hardware resource of each process is not limited.
  • the occupancy information of each hardware resource occupied by each application in the foreground running at each time point based on the statistics may further display the application running in the foreground and the application running in the background at each time point, as shown in FIG. 3 . That is, it displays the foreground application running at each time point in this time period from 8:00-10:00, and the occupancy of the hardware resources by the foreground application, as shown in the figure, at the time point of 8:30, the foreground
  • the running application is Sohu video, and the mobile signal is used, that is, the hardware resource of the data flow module is called, and it is a bright screen state, so it also occupies the LCD hardware resources.
  • the foreground application running in each time point and the background application may be further obtained from the display interface.
  • the foreground application running is Sohu video, and Taobao runs in the background.
  • the information of each hardware resource occupied by the application associated with each process in the background may be further obtained.
  • the occupation information of each application for each hardware resource includes, but is not limited to, the time point of each hardware resource occupied by each application when running in the background or the total duration of occupation of each hardware resource (ie, The size of the occupied hardware resources, or the power consumption information of each hardware resource.
  • step S205 For the specific statistical method, reference may be made to the description of step S205, and details are not described herein again.
  • S207 Determine, for each process running at the time point, a terminal screen state at the time point, where the terminal screen state includes a bright screen state or a black screen state;
  • the user generally cares about the application of the terminal running in the bright screen state and the black screen state, and the occupation of each hardware resource by each application.
  • the embodiment of the present invention can further determine the state of the terminal screen at the time point. It should be noted that, in the Android mobile phone system, when the process is scheduled by the AMS, the current time can be determined by the controller.
  • the status of the terminal screen, the terminal screen status includes a bright screen status or a black screen status.
  • S208 Collect, according to the at least one hardware resource that is invoked by the process in the process set, information that the application associated with the process in the process set in the bright screen state occupies the at least one hardware resource, and An application associated with a process in the process set in the black screen state occupies information of the at least one hardware resource.
  • the applications associated with each process in the bright screen state are respectively occupied at least.
  • Information about a hardware resource determining the occupation information of a certain hardware resource by a process in a bright screen state as an application associated with the process in the bright screen state, the hardware resource The occupancy information
  • the information associated with each process in the black screen state occupies at least one hardware resource information (the occupation information of a certain hardware resource in a black screen state is determined to be associated with the process in a black screen state) Apply the occupancy information of the hardware resource).
  • the information about the hardware resources occupied by each application in this embodiment includes, but is not limited to, the occupation time point of each application for each hardware resource, and the occupation size of each application for each hardware resource (that is, the total occupation time). ), as well as power consumption information for each hardware resource per application.
  • statistics are performed in units of processes. The statistical results are as follows:
  • PID 2000CPU: 100s (the total length of the process PID2000 in the black screen state for the CPU is 100s)
  • PID 2001CPU: 100s (the process PID2001 in the black screen state for the CPU occupation time is 100s total)
  • PID 2000GPS: 200s (the process PID2000 in the black screen state for the GPS occupation time is 100s total)
  • PID 2000 Wifi traffic: 10M (process PID2000 in black screen state to WIFI traffic cost 10M)
  • PID 2000CPU: 400s (the process PID2000 is in the bright screen state and the total CPU usage is 400s)
  • PID 2001CPU: 400s (the process PID2001 is in the bright screen state and the total CPU usage is 400s)
  • PID 2000GPS: 300s (the process PID2000 is in the bright screen state for the GPS occupation time is 300s total)
  • PID 2000 Wifi traffic: 10M (process PID2000 consumes 10M in bright screen state)
  • the process 2000 is associated with the application com.test.demo1, and the application com.test.demo1 has a CPU usage of 100s on a black screen, 200s on a GPS, and 10M on a WIFI traffic.
  • the application com.test.demo1 has a CPU footprint of 400s on the bright screen, 300s on the GPS, and 10M on the WIFI traffic.
  • the com.test.demo2 can be used to occupy various hardware resources when it is on the bright screen. Size and size of each hardware resource when it is black.
  • the power consumption of each hardware resource can be calculated according to the occupied size of each hardware resource, and the power consumption can directly reflect the power consumption of the terminal, that is, the consumption of each hardware resource by each application in the bright screen state.
  • the power consumption of each hardware resource by each application in the black screen state; the present invention does not limit the occupancy information of each hardware resource of each process.
  • step S202 to step S205 can be further combined to perform statistics, that is, the foreground application and the background application running in the bright screen state are respectively counted, and the operation is performed in a black screen state.
  • Front-end applications and background applications can be further combined to perform statistics, that is, the foreground application and the background application running in the bright screen state are respectively counted, and the operation is performed in a black screen state.
  • a process running by the terminal at each of the at least two time points is recorded, and for each time point, at least one hardware resource invoked by the process running at the time point is acquired, and the at least two times are acquired.
  • a process set consisting of a process that is a group of processes, the process set includes a process or a plurality of processes, and according to the at least one hardware resource invoked by the process in the process set, acquiring an application associated with the process in the process set to the at least The occupation information of a hardware resource.
  • FIG. 7 is a schematic structural diagram of a resource statistics apparatus according to an embodiment of the present invention. As shown in the figure, a resource statistics apparatus according to an embodiment of the present invention includes:
  • the recording module 100 is configured to record a process run by the terminal at each of the at least two time points;
  • the first obtaining module 101 is configured to acquire, for each of the time points, at least one hardware resource invoked by the process running at the time point;
  • the second obtaining module 102 is configured to acquire a process set consisting of processes running at the at least two time points, where the process set includes one process or multiple processes;
  • the third obtaining module 103 is configured to acquire, according to the at least one hardware resource that is invoked by the process in the process set, occupation information of the at least one hardware resource by an application associated with the process in the process set.
  • the device may further include a fourth obtaining module 104 and a fifth obtaining module 105;
  • the fourth obtaining module 104 is configured to: acquire the first process set that is formed by the process running in the first time period in the time period consisting of the at least two time points, if the first occupation information acquisition request is received, the first The occupation information acquisition request is used to request acquisition of occupation information of hardware resources in the first time period;
  • the fifth obtaining module 105 is configured to acquire, according to the hardware resource invoked by the process in the first process set, the first application associated with the process in the first process set in the first time period The occupancy information of at least one hardware resource.
  • the apparatus may further include a sixth obtaining module 106 and a seventh obtaining module 107;
  • the sixth obtaining module 106 is configured to: obtain a second process set that is formed by the process associated with the second application, and obtain the second application that is configured by the process that is associated with the second application, where the second occupation information acquisition request is used to request to acquire the second application. Occupancy information of hardware resources in a second time period of the time period composed of the at least two time points;
  • the seventh obtaining module 107 is configured to acquire, according to the hardware resource invoked by the process in the second process set in the second time period, the at least one of the second application in the second time period Occupancy information of hardware resources.
  • the device may further include an eighth obtaining module 108, a ninth obtaining module 109, and an output module 110;
  • the eighth obtaining module 108 is configured to: when receiving the third occupation information acquisition request, acquire a third process set that is a process that invokes a target hardware resource in a third time period of the time period consisting of the at least two time points, where The third occupation information acquisition request is used to request to acquire the third time period The occupation information of the target hardware resource;
  • the ninth obtaining module 109 is configured to acquire, according to the calling information of the target hardware resource by the process in the third process set in the third time period, the third process associated with the process in the third process set. Applying occupation information of the target hardware resource in the third time period;
  • the output module 110 is configured to output the occupation information of the target hardware resource and the identifier of the target hardware resource.
  • the occupation information of the hardware resource includes at least one of time point information occupying the hardware resource, size information occupying the hardware resource, and power consumption information occupying the hardware resource.
  • the application related to the at least one hardware resource by the application associated with the process in the process set includes the size information of the at least one hardware resource occupied by the application;
  • the application related to the at least one hardware resource by the application associated with the process in the process set includes the power consumption information of the at least one hardware resource
  • the device further includes a first determining module 111;
  • the first determining module 111 is configured to determine, for each process running at the time point, a running state type of the process, where the running state type includes a foreground running or a background running;
  • the device may further include a second determining module 112;
  • a second determining module 112 configured to determine, according to a process that runs at each time point, a terminal screen state at the time point, where the terminal screen state includes a bright screen state or a black screen state;
  • the process running by the terminal at each time point is recorded at at least two time points, and for each time point, at least one hardware resource invoked by the process running at the time point is acquired, and obtained.
  • the application uses the occupancy information of the at least one hardware resource. In this way, by statistic in units of processes, the occupancy information of the at least one hardware resource of each application can be accurately located, and the provided information is relatively intuitive.
  • FIG. 8 is a schematic structural diagram of a terminal according to an embodiment of the present invention. As shown in the figure, the terminal shown in FIG. 8 is used to perform the resource statistics method disclosed in the embodiment of the present invention. As shown in FIG. 8, the terminal 800 may include at least one processor 801, such as a CPU (Central Processing Unit), at least one input device 802, at least one output device 803, a memory 804, and a communication bus 805. It will be understood by those skilled in the art that the structure of the terminal 800 shown in FIG. 8 does not constitute a limitation of the present invention, and it may be a bus-shaped structure or a star-shaped structure, and may also include more than that shown in FIG.
  • processor 801 such as a CPU (Central Processing Unit)
  • the input device 802 can be a touch screen, a voice input device, a keyboard, a mouse, a tablet, etc.
  • the output device 803 can be a device such as a display, a speaker, a projector, or the like that enables the user to receive the output of the terminal.
  • the memory 804 is used to store software programs and modules, and the processor 801 executes various functional applications of the user terminal and implements resource statistics by running software programs and modules stored in the memory 804.
  • the memory 804 mainly includes a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function, such as a sound playing program, an image playing program, and the like; and the data storage area can be stored according to the terminal. Use the created data (such as audio data, phone book, etc.).
  • memory 804 may include volatile memory, such as non-swing Nonvolatile Random Access Memory (NVRAM), Phase Change RAM (PRAM), Magnetoresistive Random Access Memory (MRAM), etc.
  • NVRAM non-swing Nonvolatile Random Access Memory
  • PRAM Phase Change RAM
  • MRAM Magnetoresistive Random Access Memory
  • Including non-volatile memory such as at least one disk storage device, Electrically Erasable Programmable Read-Only Memory (EEPROM), flash memory device, such as NOR flash memory or In contrast to NAND flash memory.
  • EEPROM Electrically Erasable Programmable Read-Only Memory
  • flash memory device such as NOR flash memory or In contrast to NAND flash memory.
  • the above application includes any application installed on the user terminal, including but not limited to browser, email, instant messaging service, word processing, keyboard virtual, widget, encryption, digital rights management, voice recognition, voice Copy, locate (such as those provided by GPS), music playback, and more.
  • Communication bus 805 is used to implement connection communication between processor 801, input device 802, output device 803, and memory 804 components.
  • the communication bus 805 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. Wait.
  • ISA Industry Standard Architecture
  • PCI Peripheral Component
  • EISA Extended Industry Standard Architecture
  • the communication bus 805 can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is shown in Figure 8, but it does not mean that there is only one bus or one type of bus.
  • Processor 801 is a control center for electronic device 800 that connects various portions of terminal 800 with various interfaces and lines, by running or executing software programs and/or modules stored in memory 804, and for recalling stored in memory 804. Data to do the following:
  • processor 801 is further configured to invoke program code stored in the memory, where Perform the following steps:
  • the first process set formed by the process running in the first time period in the time period consisting of the at least two time points is acquired, the first occupation information.
  • processor 801 is further configured to invoke program code stored in the memory, to perform the following steps:
  • the second process set is formed by the process associated with the second application, and the second occupation information acquisition request is used to request to acquire the second application
  • processor 801 is further configured to invoke program code stored in the memory, to perform the following steps:
  • the third occupation information acquisition request is received by the input device 802, acquiring a third process set consisting of a process of calling a target hardware resource in a third time period of the time period consisting of the at least two time points, the The three occupation information acquisition request is used to request to acquire occupation information of the target hardware resource in the third time period;
  • the occupancy information of the target hardware resource and the identifier of the target hardware resource are output by the output device 803.
  • the occupation information of the hardware resource includes at least one of time point information occupying the hardware resource, size information occupying the hardware resource, and power consumption information occupying the hardware resource.
  • the information about the occupation of the at least one hardware resource by the application associated with the process in the process set includes the size information of the at least one hardware resource occupied by the application;
  • the processor 801 according to the at least one hardware resource that is invoked by the process in the process set, acquires occupation information of the at least one hardware resource by the application associated with the process in the process set, including:
  • the information about the occupation of the at least one hardware resource by the application associated with the process in the process set includes the power consumption information of the at least one hardware resource occupied by the application;
  • the processor 801 according to the at least one hardware resource that is invoked by the process in the process set, acquires occupation information of the at least one hardware resource by the application associated with the process in the process set, including:
  • processor 801 is further configured to invoke program code stored in the memory, to perform the following steps:
  • a running state type of the process Determining, by the process running at each of the time points, a running state type of the process, where the running state type includes a foreground running or a background running;
  • the processor 801 according to the at least one hardware resource that is invoked by the process in the process set, acquires occupation information of the at least one hardware resource by the application associated with the process in the process set, including:
  • processor 801 is further configured to invoke program code stored in the memory, to perform the following steps:
  • the processor 801 according to the at least one hardware resource that is invoked by the process in the process set, acquires occupation information of the at least one hardware resource by the application associated with the process in the process set, including:
  • a process running by the terminal at each of the at least two time points is recorded, and for each time point, at least one hardware resource invoked by the process running at the time point is acquired, and the at least two times are acquired.
  • a process set consisting of a process that is a group of processes, the process set includes a process or a plurality of processes, and according to the at least one hardware resource invoked by the process in the process set, acquiring an application associated with the process in the process set to the at least The occupation information of a hardware resource.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
  • the modules in the memory access device of the embodiment of the present invention may be combined, divided, and deleted according to actual needs.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Power Engineering (AREA)
  • Debugging And Monitoring (AREA)
  • Telephone Function (AREA)
  • Stored Programmes (AREA)

Abstract

一种资源统计方法、装置及终端,该方法包括:记录至少两个时间点中每个时间点终端所运行的进程;针对每个时间点,获取该时间点运行的进程所调用的至少一个硬件资源;获取该至少两个时间点运行的进程组成的进程集合,根据进程集合中的进程所调用的硬件资源,获取进程集合中的进程所关联的应用对该至少一个硬件资源的占用信息。本发明实施例通过以进程为单位进行统计,可以获得终端的各个应用对硬件资源的占用信息,统计粒度比较细。

Description

一种资源统计方法、装置及终端 技术领域
本发明涉及电子技术领域,尤其涉及一种资源统计方法、装置及终端。
背景技术
随着终端使用的日益广泛,用户对终端的要求也越来越高,为了提升用户体验,丰富终端功能,用户在终端上安装了各种应用,这样用户可以使用各种应用实现各种功能,但是也使得用户对终端的使用时间比较长,各种应用对终端耗电也比较多,最终导致终端耗电比较快,终端的耗电通常是由终端的各种硬件资源占用所产生,在现有技术中,为了统计终端的耗电情况通常以用户标识(User ID,UID)为单位进行统计,一个UID下面通常包括多个应用,最后统计得到的是各个UID的对硬件资源的占用情况,即是多个应用对硬件资源总的占用情况,统计粒度比较大,提供的信息不直观。
发明内容
本发明实施例提供了一种资源统计方法及装置,通过以进程为单位进行统计,可以获得终端的各个应用对硬件资源的占用信息,统计粒度比较细。
本发明第一方面提供一种资源统计方法,包括:
记录至少两个时间点中每个时间点终端所运行的进程;
针对每个所述时间点,获取该时间点运行的进程所调用的至少一个硬件资源;
获取该至少两个时间点运行的进程组成的进程集合,该进程集合包括一个进程或者多个进程;
根据进程集合中的进程所调用的至少一个硬件资源,获取进程集合中的进程所关联的应用对该至少一个硬件资源的占用信息。若该进程集合中包括一个进程,则根据该进程所调用的至少一个硬件资源,获取该进程所关联的应用对该至少一个硬件资源的占用信息;若该进程集合中包括多个进程,则根据该多 个进程中每个进程所调用的至少一个硬件资源,获得该多个进程所关联的应用对该至少一个硬件资源的占用信息,该多个进程所关联的应用包括一个应用或者多个应用。
这种方式通过以进程为单位进行统计,可以获得终端的各个应用对硬件资源的占用信息,用户可以精确定位对硬件资源占用比较多的应用,提供的信息比较直观。
基于第一方面,在第一方面的第一种可行的实施方式中,所述方法还包括:
若接收到第一占用信息获取请求,获取至少两个时间点组成的时间段中第一时间段内运行的进程组成的第一进程集合,该第一占用信息获取请求用于请求获取该一时间段内硬件资源的占用信息;
根据第一进程集合中的进程所调用的硬件资源,获取第一进程集合中的进程所关联的第一应用在第一时间段内对至少一个硬件资源的占用信息,第一进程集合中的应用所关联的第一应用可以包括一个应用或者多个应用。
通过这种方式用户可以方便地获取到任意一个时间段内应用对硬件资源的占用信息,提供的信息直观。
基于第一方面,在第一方面的第二种可行的实施方式中,所述方法还包括:
若接收到第二占用信息获取请求,获取第二应用所关联的进程组成的第二进程集合,该第二占用信息获取请求用于请求获取第二应用对该至少两个时间点组成的时间段中第二时间段内硬件资源的占用信息;
根据第二时间段内该第二进程集合中的进程所调用的硬件资源,获取第二应用在第二时间段内对该至少一个硬件资源的占用信息。
通过这种方式可以方便用户查询某一个或者多个应用对硬件资源的占用情况,用户使用方便,提供的信息直观准确。
基于第一方面,在第一方面的第三种可行的实施方式中,所述方法还包括:
若接收到第三占用信息获取请求,获取该至少两个时间点组成的时间段中第三时间段内调用目标硬件资源的进程组成的第三进程集合,该第三占用信息获取请求用于请求获取该第三时间段内对目标硬件资源的占用信息;
根据第三时间段内该第三进程集合中的进程对目标硬件资源的调用信息, 获取第三进程集合中的进程所关联的第三应用在第三时间段内对目标硬件资源的占用信息;该第三应用包括一个应用或者多个应用;
输出所述对所述目标硬件资源的占用信息以及所述目标硬件资源的标识。
通过这种方式可以方便用户查询对某一个或者多个目标硬件资源占用情况,提供的信息直观准确。
基于第一方面~第一方面第三种可行的实施方式中的任意一种实施方式,在第一方面的第四种可行的实施方式中,该硬件资源的占用信息包括:占用该硬件资源的时间点信息、占用该硬件资源的大小信息以及占用该硬件资源的功耗信息中的至少一种。可以方便用户定位各种应用对各个硬件资源的占用信息。
基于第一方面,在第一方面的第五种可行的实施方式中,若所述进程集合中的进程所关联的应用对该至少一个硬件资源的占用信息包括该应用占用该至少一个硬件资源的大小信息;
所述根据进程集合中的进程所调用的至少一个硬件资源,获取进程集合中的进程所关联的应用对该至少一个硬件资源的占用信息,包括:
根据该进程集合中的进程所调用的至少一个硬件资源,获取该进程集合中的进程占用该至少一个硬件资源的大小;
根据该进程集合中的进程占用该至少一个硬件资源的大小,获取该进程集合中的进程所关联的应用占用该至少一个硬件资源的大小信息。
这种方式中进一步通过计算进程集合中的进程占用硬件资源的大小从而确定进程集合中的进程所关联的应用占用硬件资源的大小信息,以进程为单位进行统计,准确定位到每个应用对硬件资源的占用大小信息。
基于第一方面,在第一方面的第六种可行的实施方式中,若所述进程集合中的进程所关联的应用对该至少一个硬件资源的占用信息包括该应用占用所述至少一个硬件资源的功耗信息;
所述根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息,包括:
根据进程集合中的进程所调用的至少一个硬件资源,获取该进程集合中的进程占用该至少一个硬件资源的大小;
根据进程集合中的进程占用该至少一个硬件资源的大小以及硬件资源的功率,获取进程集合中的进程占用该至少一个硬件资源的功耗信息;
根据进程集合中的进程占用该至少一个硬件资源的功耗信息,获取进程集合中的进程所关联的应用占用该至少一个硬件资源的功耗信息。
这种方式通过计算进程集合中进程对各个硬件资源的功耗信息,获取该进程集合中的进程所关联的应用对该至少一个硬件资源的功耗,从而方便用户精确定位出每个应用对终端的耗电情况。
基于第一方面~第一方面第六种可行的实施方式中的任意一种可行的实施方式,在第一方面的第七种可行的实施方式中,所述方法还包括:
针对每个所述时间点运行的进程,确定进程的运行状态类型,运行状态类型包括前台运行或者后台运行;
所述根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息,包括:
根据进程集合中的进程所调用的硬件资源以及该进程集合中的进程的运行状态类型,分别统计该进程集合中的进程中在前台运行时占用该至少一个硬件资源的信息,以及该进程集合中的进程在后台运行时占用该至少一个硬件资源的信息;
根据进程集合中的进程在前台运行时占用该至少一个硬件资源的信息,获取进程集合中的进程所关联的应用在前台运行时占用该至少一个硬件资源的信息;
根据进程集合中的进程在后台运行时占用该至少一个硬件资源的信息,获取进程集合中的进程所关联应用在在后台运行时占用该至少一个硬件资源的信息。
这种方式可以精确地确定各个应用在前台运行以及在后台运行对硬件资源的占用信息,从而方便用户了解各个应用在前后台运行时对资源的占用状 况。
基于第一方面~第一方面第六种可行的实施方式中的任意一种可行的实施方式,在第一方面的第八种可行的实施方式中,所述方法还包括:
针对每个时间点运行的进程,确定该时间点的终端屏幕状态,所述终端屏幕状态包括亮屏状态或者黑屏状态;
所述根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息,包括:
根据进程集合中的进程所调用的至少一个硬件资源,分别统计在亮屏状态该进程集合中的进程所关联的应用占用该至少一个硬件资源的信息,以及在所述黑屏状态该进程集合中的进程所关联的应用占用该至少一个硬件资源的信息。
这种方式可以方便用户确定在亮屏状态以及黑屏状态下各个应用对硬件资源的占用情况。
本发明第二方面提供一种资源统计装置,包括:
记录模块,用于记录至少两个时间点中每个时间点终端所运行的进程;
第一获取模块,用于针对每个所述时间点,获取该时间点运行的进程所调用的至少一个硬件资源;
第二获取模块,用于获取该至少两个时间点运行的进程组成的进程集合,该进程集合包括一个进程或者多个进程;
第三获取模块,用于根据进程集合中的进程所调用的至少一个硬件资源,获取进程集合中的进程所关联的应用对该至少一个硬件资源的占用信息。若该进程集合中包括一个进程,则根据该进程所调用的至少一个硬件资源,获取该进程所关联的应用对该至少一个硬件资源的占用信息;若该进程集合中包括多个进程,则根据该多个进程中每个进程所调用的至少一个硬件资源,获得该多个进程所关联的应用对该至少一个硬件资源的占用信息,该多个进程所关联的应用包括一个应用或者多个应用。
这种方式通过以进程为单位进行统计,可以获得终端的各个应用对硬件资 源的占用信息,用户可以精确定位对硬件资源占用比较多的应用,提供的信息比较直观。
基于第二方面,在第二方面的第一种可行的实施方式中,所述装置还包括:
第四获取模块,用于若接收到第一占用信息获取请求,获取至少两个时间点组成的时间段中第一时间段内运行的进程组成的第一进程集合,该第一占用信息获取请求用于请求获取该一时间段内硬件资源的占用信息;
第五获取模块,用于根据第一进程集合中的进程所调用的硬件资源,获取第一进程集合中的进程所关联的第一应用在第一时间段内对至少一个硬件资源的占用信息,第一进程集合中的应用所关联的第一应用可以包括一个应用或者多个应用。
通过这种方式用户可以方便地获取到任意一个时间段内应用对硬件资源的占用信息,提供的信息直观。
基于第二方面,在第二方面的第二种可行的实施方式中,所述装置还包括:
第六获取模块,用于若接收到第二占用信息获取请求,获取第二应用所关联的进程组成的第二进程集合,该第二占用信息获取请求用于请求获取第二应用对该至少两个时间点组成的时间段中第二时间段内硬件资源的占用信息;
第七获取模块,用于根据第二时间段内该第二进程集合中的进程所调用的硬件资源,获取第二应用在第二时间段内对该至少一个硬件资源的占用信息。
通过这种方式可以方便用户查询某一个或者多个应用对硬件资源的占用情况,用户使用方便,提供的信息直观准确。
基于第二方面,在第二方面的第三种可行的实施方式中,所述装置还包括:
第八获取模块,用于若接收到第三占用信息获取请求,获取该至少两个时间点组成的时间段中第三时间段内调用目标硬件资源的进程组成的第三进程集合,该第三占用信息获取请求用于请求获取该第三时间段内对目标硬件资源的占用信息;
第九获取模块,用于根据第三时间段内该第三进程集合中的进程对目标硬件资源的调用信息,获取第三进程集合中的进程所关联的第三应用在第三时间段内对目标硬件资源的占用信息;该第三应用包括一个应用或者多个应用;
输出模块,用于输出所述对所述目标硬件资源的占用信息以及所述目标硬件资源的标识。
通过这种方式可以方便用户查询对某一个或者多个目标硬件资源占用情况,提供的信息直观准确。
基于第二方面~第二方面第三种可行的实施方式中的任意一种实施方式,在第二方面的第四种可行的实施方式中,该硬件资源的占用信息包括:占用该硬件资源的时间点信息、占用该硬件资源的大小信息以及占用该硬件资源的功耗信息中的至少一种。可以方便用户定位各种应用对各个硬件资源的占用信息。
基于第二方面,在第二方面的第五种可行的实施方式中,若所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息包括该应用占用所述至少一个硬件资源的大小信息;
所述第三获取模块根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息具体包括:
根据该进程集合中的进程所调用的至少一个硬件资源,获取该进程集合中的进程占用该至少一个硬件资源的大小;
根据该进程集合中的进程占用该至少一个硬件资源的大小,获取该进程集合中的进程所关联的应用占用该至少一个硬件资源的大小信息。
这种方式中进一步通过计算进程集合中的进程占用硬件资源的大小从而确定进程集合中的进程所关联的应用占用硬件资源的大小信息,以进程为单位进行统计,准确定位到每个应用对硬件资源的占用大小信息。
基于第二方面,在第二方面的第六种可行的实施方式中,若所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息包括该应用占用所述至少一个硬件资源的功耗信息;
所述第三获取模块根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息具体包括:
根据进程集合中的进程所调用的至少一个硬件资源,获取该进程集合中的进程占用该至少一个硬件资源的大小;
根据进程集合中的进程占用该至少一个硬件资源的大小以及硬件资源的功率,获取进程集合中的进程占用该至少一个硬件资源的功耗信息;
根据进程集合中的进程占用该至少一个硬件资源的功耗信息,获取进程集合中的进程所关联的应用占用该至少一个硬件资源的功耗信息。
这种方式通过计算进程集合中进程对各个硬件资源的功耗信息,获取该进程集合中的进程所关联的应用对该至少一个硬件资源的功耗,从而方便用户精确定位出每个应用对终端的耗电情况。
基于第二方面~第二方面第六种可行的实施方式中的任意一种可行的实施方式中,在第二方面的第七种可行的实施方式中,所述装置还包括第一确定模块;
所述第一确定模块,用于针对每个所述时间点运行的进程,确定进程的运行状态类型,运行状态类型包括前台运行或者后台运行;
所述第三获取模块根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息具体包括:
根据所述进程集合中的进程所调用的硬件资源以及所述进程集合中的进程的运行状态类型,分别统计所述进程集合中的进程在前台运行时占用所述至少一个硬件资源的信息,以及所述进程集合中的进程在后台运行时占用所述至少一个硬件资源的信息;
根据所述进程集合中的进程在前台运行时占用所述至少一个硬件资源的信息,获取所述进程集合中的进程所关联的应用在前台运行时占用所述至少一个硬件资源的信息;
根据所述进程集合中的进程在后台运行时占用所述至少一个硬件资源的信息,获取所述进程集合中的进程所关联的应用在后台运行时占用所述至少一个硬件资源的信息。
这种方式可以精确地确定各个应用在前台运行以及在后台运行对硬件资 源的占用信息,从而方便用户了解各个应用在前后台运行时对资源的占用状况。
基于第二方面~第二方面第六种可行的实施方式中的任意一种可行的实施方式,在第二方面的第八种可行的实施方式中,所述装置还包括:
第二确定模块,用于针对每个时间点运行的进程,确定该时间点的终端屏幕状态,终端屏幕状态包括亮屏状态或者黑屏状态;
所述第三获取模块根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息具体包括:
根据进程集合中的进程所调用的至少一个硬件资源,分别统计在亮屏状态该进程集合中的进程所关联的应用占用该至少一个硬件资源的信息,以及在所述黑屏状态该进程集合中的进程所关联的应用占用该至少一个硬件资源的信息。
这种方式可以方便用户确定在亮屏状态以及黑屏状态下各个应用对硬件资源的占用情况。
本发明实施例第三方面提供一种终端,包括:处理器、存储器以及至少一个硬件资源,其中,所述处理器、存储器以及所述至少一个硬件资源分别连接通信总线,所述存储器中存储一组程序代码,且所述处理器用于调用所述存储器中存储的程序代码,用于执行以下步骤:
记录至少两个时间点中每个时间点终端所运行的进程;
针对每个所述时间点,获取该时间点运行的进程所调用的至少一个硬件资源;
获取该至少两个时间点运行的进程组成的进程集合,该进程集合包括一个进程或者多个进程;
根据进程集合中的进程所调用的至少一个硬件资源,获取进程集合中的进程所关联的应用对该至少一个硬件资源的占用信息。若该进程集合中包括一个进程,则根据该进程所调用的至少一个硬件资源,获取该进程所关联的应用对该至少一个硬件资源的占用信息;若该进程集合中包括多个进程,则根据该多 个进程中每个进程所调用的至少一个硬件资源,获得该多个进程所关联的应用对该至少一个硬件资源的占用信息,该多个进程所关联的应用包括一个应用或者多个应用。
这种方式通过以进程为单位进行统计,可以获得终端的各个应用对硬件资源的占用信息,用户可以精确定位对硬件资源占用比较多的应用,提供的信息比较直观。
基于第三方面,在第三方面的第一种可行的实施方式中,所述装置还包括输入装置,所述输入装置与所述通信总线连接;所述处理器还用于调用所述存储器中存储的程序代码,用于执行以下步骤:
若通过所述输入装置接收到第一占用信息获取请求,获取至少两个时间点组成的时间段中第一时间段内运行的进程组成的第一进程集合,该第一占用信息获取请求用于请求获取该一时间段内硬件资源的占用信息;
根据第一进程集合中的进程所调用的硬件资源,获取第一进程集合中的进程所关联的第一应用在第一时间段内对至少一个硬件资源的占用信息,第一进程集合中的应用所关联的第一应用可以包括一个应用或者多个应用。
通过这种方式用户可以方便地获取到任意一个时间段内应用对硬件资源的占用信息,提供的信息直观。
基于第三方面,在第三方面的第二种可行的实施方式中,所述装置还包括输入装置,所述输入装置与所述通信总线连接;所述处理器还用于调用所述存储器中存储的程序代码,用于执行以下步骤:
若通过所述输入装置接收到第二占用信息获取请求,获取第二应用所关联的进程组成的第二进程集合,该第二占用信息获取请求用于请求获取第二应用对该至少两个时间点组成的时间段中第二时间段内硬件资源的占用信息;
根据第二时间段内该第二进程集合中的进程所调用的硬件资源,获取第二应用在第二时间段内对该至少一个硬件资源的占用信息。
通过这种方式可以方便用户查询某一个或者多个应用对硬件资源的占用情况,用户使用方便,提供的信息直观准确。
基于第三方面,在第三方面的第三种可行的实施方式中,所述装置还包括 输入装置和输出装置,所述输入装置和所述输出装置分别与所述通信总线连接;所述处理器还用于调用所述存储器中存储的程序代码,用于执行以下步骤:
若通过所述输入装置接收到第三占用信息获取请求,获取该至少两个时间点组成的时间段中第三时间段内调用目标硬件资源的进程组成的第三进程集合,该第三占用信息获取请求用于请求获取该第三时间段内对目标硬件资源的占用信息;
根据第三时间段内该第三进程集合中的进程对目标硬件资源的调用信息,获取第三进程集合中的进程所关联的第三应用在第三时间段内对目标硬件资源的占用信息;该第三应用包括一个应用或者多个应用;
输出所述对所述目标硬件资源的占用信息以及所述目标硬件资源的标识。
通过这种方式可以方便用户查询对某一个或者多个目标硬件资源占用情况,提供的信息直观准确。
基于第三方面~第三方面第三种可行的实施方式中的任意一种实施方式,在第三方面的第四种可行的实施方式中,该硬件资源的占用信息包括:占用该硬件资源的时间点信息、占用该硬件资源的大小信息以及占用该硬件资源的功耗信息中的至少一种。可以方便用户定位各种应用对各个硬件资源的占用信息。
基于第三方面,在第三方面的第五种可行的实施方式中,若所述进程集合中的进程所关联的应用对该至少一个硬件资源的占用信息包括该应用占用该至少一个硬件资源的大小信息;
所述根据进程集合中的进程所调用的至少一个硬件资源,获取进程集合中的进程所关联的应用对该至少一个硬件资源的占用信息,包括:
根据该进程集合中的进程所调用的至少一个硬件资源,获取该进程集合中的进程占用该至少一个硬件资源的大小;
根据该进程集合中的进程占用该至少一个硬件资源的大小,获取该进程集合中的进程所关联的应用占用该至少一个硬件资源的大小信息。
这种方式中进一步通过计算进程集合中的进程占用硬件资源的大小从而确定进程集合中的进程所关联的应用占用硬件资源的大小信息,以进程为单位 进行统计,准确定位到每个应用对硬件资源的占用大小信息。
基于第三方面,在第三方面的第六种可行的实施方式中,若所述进程集合中的进程所关联的应用对该至少一个硬件资源的占用信息包括该应用占用所述至少一个硬件资源的功耗信息;
所述根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息,包括:
根据进程集合中的进程所调用的至少一个硬件资源,获取该进程集合中的进程占用该至少一个硬件资源的大小;
根据进程集合中的进程占用该至少一个硬件资源的大小以及硬件资源的功率,获取进程集合中的进程占用该至少一个硬件资源的功耗信息;
根据进程集合中的进程占用该至少一个硬件资源的功耗信息,获取进程集合中的进程所关联的应用占用该至少一个硬件资源的功耗信息。
这种方式通过计算进程集合中进程对各个硬件资源的功耗信息,获取该进程集合中的进程所关联的应用对该至少一个硬件资源的功耗,从而方便用户精确定位出每个应用对终端的耗电情况。
基于第三方面~第三方面第六种可行的实施方式中的任意一种可行的实施方式,在第三方面的第七种可行的实施方式中,所述处理器还用于调用所述存储器中存储的程序代码,用于执行以下步骤:
针对每个所述时间点运行的进程,确定所述进程的运行状态类型,所述运行状态类型包括前台运行或者后台运行;
所示处理器根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息,包括:
根据进程集合中的进程所调用的硬件资源以及该进程集合中的进程的运行状态类型,分别统计该进程集合中的进程中在前台运行时占用该至少一个硬件资源的信息,以及该进程集合中的进程在后台运行时占用该至少一个硬件资源的信息;
根据进程集合中的进程在前台运行时占用该至少一个硬件资源的信息,获取进程集合中的进程所关联的应用在前台运行时占用该至少一个硬件资源的信息;
根据进程集合中的进程在后台运行时占用该至少一个硬件资源的信息,获取进程集合中的进程所关联应用在在后台运行时占用该至少一个硬件资源的信息。
这种方式可以精确地确定各个应用在前台运行以及在后台运行对硬件资源的占用信息,从而方便用户了解各个应用在前后台运行时对资源的占用状况。
基于第三方面~第三方面第六种可行的实施方式中的任意一种可行的实施方式,在第三方面的第八种可行的实施方式中,所述处理器还用于调用所述存储器中存储的程序代码,用于执行以下步骤:
针对每个所述时间点运行的进程,确定该时间点的终端屏幕状态,所述终端屏幕状态包括亮屏状态或者黑屏状态;
所述处理器根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息,包括:
根据进程集合中的进程所调用的至少一个硬件资源,分别统计在亮屏状态该进程集合中的进程所关联的应用占用该至少一个硬件资源的信息,以及在所述黑屏状态该进程集合中的进程所关联的应用占用该至少一个硬件资源的信息。
这种方式可以方便用户确定在亮屏状态以及黑屏状态下各个应用对硬件资源的占用情况。
本发明第四方面提供一种计算机存储介质,所述计算机存储介质存储有程序,所述程序具体包括用于执行本发明实施例第一方面任一方法的部分或全部步骤的指令。
本发明实施例中,记录至少两个时间点中每个时间点终端所运行的进程,针对每个时间点,获取该时间点运行的进程所调用的至少一个硬件资源,获取 该至少两个时间点运行的进程组成的进程集合,该进程集合中包括一个进程或者多个进程,根据进程集合中的进程所调用的该至少一个硬件资源,获取该进程集合中的进程所关联的应用对该至少一个硬件资源的占用信息,这种方式通过以进程为单位进行统计,可以精确定位到每个应用对该至少一个硬件资源的占用信息,提供的信息比较直观。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本发明实施例提供的一种资源统计方法的流程示意图;
图2为本发明实施例提供的另一种资源统计方法的流程示意图;
图3为本发明实施例提供的一种UI界面的示意图;
图4为本发明实施例提供的另一种UI界面的示意图;
图5为本发明实施例提供的一种终端内的信息交互图;
图6为本发明实施例提供的一种电池燃尽图的内部信息交互图;
图7为本发明实施例提供的一种资源统计装置的结构示意图;
图8为本发明实施例提供的一种终端的结构示意图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行描述。
本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”和“第三”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”以及它的任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或模块的过程、方法、***、产品或设备没有限定于已列出的步骤或模块,而是可 选地还包括没有列出的步骤或模块,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或模块。
本发明所揭示的资源统计装置可以实作成单独一台装置,或整合于各种不同的终端中,诸如移动电话、平板电脑(Tablet Personal Computer)、膝上型电脑(Laptop Computer)、多媒体播放器、数字摄影机、个人数字助理(personal digital assistant,简称PDA)、移动上网装置(Mobile Internet Device,MID)或可穿戴式设备(Wearable Device)等。
本发明实施例的硬件资源包括但不限于触控面板、麦克风、中央处理器(Central Processing Unit,CPU)、无线局域网络(Wireless Local Area Networks,WLAN)模块、蓝牙模块、全球定位***(Global Positioning System,GPS)模块、液晶显示器(Liquid Crystal Display,LCD)等等。
本发明实施例中硬件资源的占用信息包括但不限于占用所述硬件资源的时间点信息、占用所述硬件资源的大小信息以及占用所述硬件资源的功耗信息中的至少一种。需要说明的是,占用硬件资源的大小信息可以是占用该硬件资源的占用时长。
本发明实施例通过对现有资源统计算法进行了改进,可以获得更多且更细的硬件资源占用信息(比如本发明实施例可以获得各个应用对硬件资源的各种占用信息,包括但不限于时间点、大小以及功耗等等)。
现有资源统计算法以UID为单位进行统计,且通常统计的是对硬件资源的功耗,一个UID下包含多个应用,一个应用下包含多个进程,每个进程用一个进程标识(Process ID,PID)进行标识,某个进程运行对各个硬件资源产生的功耗,则计算在该进程所关联的UID上,这样进行统计获得的结果是,最后终端可以输出一个UID对硬件总的功耗,而无法获得各个应用对硬件资源的功耗,也无法获得各个时间点是哪些应用对硬件资源占用产生功耗,而用户最关心的是定位到耗电元凶的应用,现有的资源统计算法无法实现该目的。
本发明实施例中为了解决上述问题,在进行资源统计的过程中以PID为单位进行统计,且记录各个时间点所运行的进程以及该进程所调用的至少一个硬 件资源,通过统计各个时间点所运行的进程以及各个进程所调用的硬件资源,可以统计得到各个进程所关联的至少一个应用中每个应用对各个硬件资源的各种占用信息,比如可以获得对该终端总的功耗信息(即是所有进程对硬件资源功耗信息的总和),也可以获得各个时间点是哪个应用在占用哪些硬件资源(即是将该时间点运行的进程对硬件资源的占用作为该进程所关联的应用在该时间点对硬件资源的占用),也可以截取一时间段,获得该时间段是哪些应用占用哪些硬件资源(即是获取该时间段所运行的至少一个进程,并将该时间段所运行的至少一个进程所调用的硬件资源作为该至少一个进程所关联的应用在该时间段内对各个硬件资源的占用),还可以获得各个应用对某一个硬件资源的详细占用信息(即是获取占用该硬件资源的各个进程PID,根据该各个进程所关联的应用,可以获得该各个进程所关联的应用对某一个硬件资源的详细占用信息)等等。
本发明实施例通过以进程为单位进行统计,通过记录的各个时间点所运行的进程,以及该各个进程所调用的至少一个硬件资源,可以获得各种硬件资源占用信息,包括但不限于本发明实施例所提及的内容,只要是以PID为单位统计获得的信息均属于本发明的保护范围之内。
请参照图1,为本发明实施例提供的一种资源统计方法的流程示意图,如图所示,本实施例的资源统计方法包括步骤S100-S102;
S100,记录至少两个时间点中每个时间点终端所运行的进程;
本发明实施例中,时间点即某个时刻,它是时间上的某个瞬间,或是时间轴上的某个点,例如8:40即是一个时间点。本发明以进程为单位统计至少两个时间点中每个时间点终端所运行的进程。
具体可选的,每隔一定时间间隔获取一次终端所运行的进程标识PID,该时间间隔需根据各个进程的运行时间所确定,例如可以是每隔1ms获取一次终端所运行的进程PID,并记录每个时间点所获取的终端所运行的进程PID,如果采用这种记录方式,则可能存在多个时间点的进程PID相同。或者记录方式也可以是当***运行每一个进程时,***服务通知所运行的进程PID,则自 动记录相应时间点与该进程PID之间的对应关系,如果采用这种记录方式,则每个时间点所运行的进程PID均不同,两个时间点之间的差值即是该进程此次运行的时长。
可选的,以安卓***为例,在安卓***的***服务活动管理器(activity manager service,AMS)可以对所有进程以及硬件资源进行调度,如图5所示,当用户通过手势操作屏幕的应用APP时,该手势转换为APP操作指令传输至AMS,AMS对相应的进程进行调度,并同时通知电源管理器记录终端所运行的进程PID,则电源管理器自动向存储单元存储各个时间点与所运行进程PID的对应关系,具体的存储方法可以是向存储单元添加PID。
需要说明的是,控制器可以进一步获取运行该进程时终端屏幕状态,例如是亮屏或者灭屏,或者控制器还可以获取运行该进程的运行状态,例如是前台运行还是后台运行。控制器所获取的终端屏幕状态和/或运行状态也会相应存储至存储单元。
S101,针对每个所述时间点,获取该时间点运行的进程所调用的至少一个硬件资源;
本发明实施例中,针对每个时间点,还需要进一步获取该时间点运行的进程所调用的至少一个硬件资源,一个进程运行可以调用至少一个硬件资源,硬件资源包括但不限于CPU、WLAN模块、蓝牙模块、全球定位***(Global Positioning System,GPS)模块、液晶显示器(Liquid Crystal Display,LCD)、相机模块等等。
进一步的,将各个时间点运行的进程所调用的至少一个硬件资源也会进行存储,例如在某个时间点,A进程调用了CPU和GPS模块,则会在存储单元中相应存储该时间点、A进程以及硬件资源(CPU和GPS模块)的对应关系。
S102,获取所述至少两个时间点运行的进程组成的进程集合,所述进程集合中包括一个进程或者多个进程;
本发明实施例中,将至少两个时间点中所有记录的进程PID通过集合进行管理,该进程集合中包括一个进程或者多个进程。需要说明的是,当所记录的 至少两个时间点中每个时间点的进程PID相同,则该进程集合中包括一个进程。
S103,根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息。
本发明实施例中,若进程集合中包括一个进程,则根据该进程所调用的至少一个硬件资源,获取该进程所关联的应用对所述至少一个硬件资源的占用信息;若进程集合中包括多个进程,则根据进程集合中每个进程所调用的至少一个硬件资源,获取该多个进程所关联的应用对所述至少一个硬件资源的占用信息。需要说明的是,该多个进程所关联的应用包括一个应用或者多个应用。
本发明实施例中,所述应用为安装在终端上的任何应用,包括但不限于浏览器、电子邮件、即时消息服务、文字处理、键盘虚拟、窗口小部件(Widget)、加密、数字版权管理、语音识别、语音复制、定位导航(例如由全球定位***提供的功能)、音乐播放等等。需要说明的是,各个应用的运行都是基于该应用下各个进程的运行。
根据该进程集合中的进程所调用的硬件资源,可以统计获得该进程集合中的进程所关联的应用占用该至少一个硬件资源的信息。具体可选的,将关联于某个应用的所有进程对各个硬件资源的占用信息确定为该应用对该各个硬件资源的占用信息。
可选的,应用对至少一个硬件资源的占用信息包括该应用占用该至少一个硬件资源的时间点信息(即是在哪一些时间点占用相应的硬件资源),或者应用对至少一个硬件资源的占用信息包括该应用占用该至少一个硬件资源的大小信息(即是某个应用占用相应的硬件资源总的时长大小),或者应用对至少一个硬件资源的占用信息包括该应用占用该硬件资源的功耗信息等等(即是某个应用占用相应的硬件资源所产生的功耗,功耗与终端的耗电情况关联)。
需要说明的是,在统计每个应用占用硬件资源的信息时,可以选择分别统计每个应用对各个硬件资源的占用信息,例如,A应用对CPU的占用信息,对GPS的占用信息等等。
可选的,若所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息包括该应用占用所述至少一个硬件资源的大小信息;
所述根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息,可以包括以下步骤S10-S11;
S10,根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程占用所述至少一个硬件资源的大小;
本发明实施例中,若需要统计进程集合中的进程所关联的应用对各个硬件资源的占用大小信息,则可以根据存储的该至少两个时间点中运行的进程(进程个数包括一个或者多个)以及各个进程所调用的至少一个硬件资源进行统计,获得各个进程中每个进程占用该至少一个硬件资源大小,若硬件资源包括一个,则是占用该硬件资源的大小,若硬件资源包括多个,则可以是占用该多个硬件资源中每个硬件资源的大小。
需要说明的是,每个进程占用硬件资源的大小可以是占用该硬件资源的时长。例如,对于某一个进程而言,将该进程占用某个硬件资源的所有时间相加即可得到该进程占用该硬件资源的大小。
S11,根据所述进程集合中的进程占用所述至少一个硬件资源的大小,获取所述进程集合中的进程所关联的应用占用所述至少一个硬件资源的大小信息。
本发明实施例中,该进程集合中的进程所关联的应用可以包括一个或者多个,将各个进程中每个进程占用某个硬件资源的大小信息确定为与该进程关联的应用占用该硬件资源的大小。
比如对于某一个应用而言,将该应用下所有进程对某个硬件资源的占用大小相加即可得到该应用对该硬件资源的占用大小信息。例如,A应用下包括进程a和b,则当计算A应用对CPU占用大小信息时,则可以将进程a对CPU的占用大小和进程b对CPU的占用大小相加,即可得到A应用对CPU的占用大小信息。A应用对其它硬件资源的占用大小计算方式相同,在此不再赘述。
可选的,若所述进程集合中的进程所关联的应用对所述至少一个硬件资源 的占用信息包括该应用占用所述至少一个硬件资源的功耗信息;
所述根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息,包括以下步骤S12-S14;
S12,根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程占用所述至少一个硬件资源的大小;
本发明实施例步骤请参照步骤S10,在此不再赘述。
S13,根据所述进程集合中的进程占用所述至少一个硬件资源的大小以及所述硬件资源的功率,获取所述进程集合中的进程占用所述至少一个硬件资源的功耗信息;
本发明实施例中,根据进程集合中的进程占用该至少一个硬件资源的大小以及各个硬件资源的功率,可以计算出该进程集合中的进程占用该至少一个硬件资源的功耗信息。占用某个硬件资源的大小即是占用该硬件资源的时长,计算某个进程占用某个硬件资源的功耗信息的计算方式可以是将该进程占用该硬件资源的大小与该硬件资源的功率相乘,即得到该进程占用该硬件资源的功耗信息。
S14,根据所述进程集合中的进程占用所述至少一个硬件资源的功耗信息,获取所述进程集合中的进程所关联的应用占用所述至少一个硬件资源的功耗信息。
本发明实施例中,根据进程集合中的进程占用该至少一个硬件资源的功耗信息可以获取该进程集合中的进程所关联的应用占用该至少一个硬件资源的功耗信息,具体的计算方式可以是,将某个进程对某个硬件资源的功耗信息确定为该进程所关联的应用对该硬件资源的功耗,进一步,某个应用关联的所有进程对各个硬件资源的功耗集合即是该应用对各个硬件资源的功耗。
需要说明的是,各个应用对各个硬件资源的功耗可以直观地反映该应用的耗电情况。
进一步可选的,用户可以向终端发起各种硬件资源占用信息获取请求,本发明实施例以下面三种可选的占用信息获取请求作为举例说明,当然这并不构 成都本发明保护范围的限定:
在第一种可选的实施方式中,所述占用信息获取请求为第一占用信息获取请求,包括以下步骤S15-S16;
S15,若接收到第一占用信息获取请求,获取所述至少两个时间点组成的时间段中第一时间段内运行的进程组成的第一进程集合,所述第一占用信息获取请求用于请求获取所述第一时间段内硬件资源的占用信息;
S16,根据所述第一进程集合中的进程所调用的硬件资源,获取所述第一进程集合中的进程所关联的第一应用在所述第一时间段内对所述至少一个硬件资源的占用信息。
具体可选的,若接收到第一占用信息获取请求(该第一占用信息获取请求用于请求获取第一时间段内硬件资源的占用信息,该第一时间段为至少两个时间点组成的时间段中的部分或者全部),获取第一时间段内运行的进程组成的第一进程集合,该第一进程集合中包括一个进程或者多个进程。
若该第一进程集合中包括一个进程,则根据该进程所调用的硬件资源,获取该进程所关联的应用在第一时间段内对所述至少一个硬件资源的占用信息;若该第一进程集合中包括多个进程,则根据该多个进程中每个进程所调用的硬件资源,获取该多个进程所关联的第一应用(第一应用包括一个应用或者多个应用)在第一时间段内对该至少一个硬件资源的占用信息。所述硬件资源的占用信息包括:占用所述硬件资源的时间点信息、占用所述硬件资源的大小信息以及占用所述硬件资源的功耗信息中的至少一种。
例如,若用户想要获取8:00-8:30这个第一时间段内对硬件资源的占用情况,则可以获取8:00-8:30时段内所运行的多个进程,每个进程均调用了至少一个硬件资源,将每个进程对相应硬件资源的占用作为该进程所关联的应用对相应硬件资源的占用。
比如硬件资源包括CPU、蓝牙模块、GPS,硬件资源占用信息包括对硬件资源的功耗(当然不仅限于功耗还可以是其它信息,这里以功耗作为举例);8:00-8:30这个时段内运行的多个进程包括进程1、进程2、进程3以及进程4,进程1对CPU的功耗是2,进程1对蓝牙的功耗是2,进程2对CPU的功耗 是3,进程3对CPU的功耗是8、进程4对CPU的功耗是2,进程3对CPU功耗是8,对蓝牙功耗是1,对GPS功耗是2;进程4对CPU功耗是2,进程1和进程2与应用A关联,进程3与应用B关联,进程4与应用C关联。最终获得应用A对CPU的功耗5,对蓝牙的功耗是2;应用B对CPU功耗是8,对蓝牙功耗是1,对GPS功耗是2;应用C对CPU功耗是2。由上述可见,通过本发明实施例可以清楚反映出在8:00-8:30这个时段内是哪些应用在对各个硬件资源占用,从而产生功耗。
进一步的,硬件资源占用信息还可以包括占用硬件资源的时间点信息(即是反映出在每个时间点是哪个应用在占用相应的硬件资源),继续以上述8:00-8:30时间段之间对该至少一个硬件资源占用的时间点信息为例进行说明,通过所记录的该8:00-8:30时间段内运行的多个进程以及该多个进程对该至少一个硬件资源的调用情况,可以获得在每个时间点所运行的进程关联的应用对硬件资源的占用情况,例如最后统计得到应用A在8:00-8:10占用了CPU以及蓝牙,应用B在8:15-8:20占用了CPU、蓝牙以及GPS,应用C在8:20-8:30占用了CPU。
可以理解的是,硬件资源占用信息还可以包括占用硬件资源的大小信息,该大小信息为占用该硬件资源的时长,具体的计算方式在此不再赘述。
在第二种可选的实施方式中,所述占用信息获取请求为第二占用信息获取请求,包括以下步骤S17-S18;
S17,若接收到第二占用信息获取请求,获取第二应用所关联的进程组成的第二进程集合,所述第二占用信息获取请求用于请求获取所述第二应用对所述至少两个时间点组成的时间段中第二时间段内硬件资源的占用信息;
S18,根据所述第二时间段内所述第二进程集合中的进程所调用的硬件资源,获取所述第二应用在所述第二时间段内对所述至少一个硬件资源的占用信息。
具体可选的,若接收到第二占用信息获取请求(该第二占用信息获取请求用于请求获取第二应用在第二时间段内对硬件资源的占用信息,该第二时间段为至少两个时间点组成的时间段中的部分或者全部),获取第二应用所关联的 进程组成的第二进程集合,该第二进程集合中包括一个进程或者多个进程。
若该第二进程集合中包括一个进程,则根据该进程所调用的硬件资源,获取第二应用在第二时间段内对所述至少一个硬件资源的占用信息;若该第二进程集合中包括多个进程,则根据该多个进程中每个进程所调用的硬件资源,获取第二应用在第二时间段内对所述至少一个硬件资源的占用信息。所述硬件资源的占用信息包括:占用所述硬件资源的时间点信息、占用所述硬件资源的大小信息以及占用所述硬件资源的功耗信息中的至少一种。
例如,若用户想要获取应用A在第二时间段8:00-8:30内对硬件资源的占用情况,则获取与应用A所关联的进程组成的第二进程集合(该第二进程集合中包括一个进程或者多个进程),根据第二进程集合中的进程在第二时间段内对硬件资源的调用情况,可以得到应用A在8:00-8:30内对至少一个硬件资源的占用信息。一个进程调用了至少一个硬件资源,将该进程对相应硬件资源的占用作为该进程所关联的应用对相应硬件资源的占用。
比如硬件资源包括CPU、蓝牙模块、GPS,硬件资源占用信息包括对硬件资源的功耗(当然不仅限于功耗还可以是其它信息,这里以功耗作为举例);应用A下包括进程1和进程2;8:00-8:30这个时段内进程1对CPU的功耗是2,进程1对蓝牙的功耗是2,进程2对CPU的功耗是3,则应用A对CPU的功耗是5,对蓝牙的功耗是2;
进一步的,硬件资源占用信息还可以包括占用硬件资源的时间点信息(即是反映出应用A是在哪些时间点占用了哪些硬件资源),继续以上述8:00-8:30时间段之间对该至少一个硬件资源占用的时间点信息为例进行说明,通过所记录的该8:00-8:30时间段内应用A下的进程1在8:00-8:05占用了CPU和蓝牙,进程2在8:05-8:10占用了CPU,则可以得到在8:00-8:10应用A占用了CPU,在8:00-8:05占用了蓝牙。
可以理解的是,硬件资源占用信息还可以包括占用硬件资源的大小信息,该大小信息为占用该硬件资源的时长,具体的计算方式在此不再赘述。
在第三种可选的实施方式中,所述占用信息获取请求为第三占用信息获取请求,包括以下步骤S19-S21;
S19,若接收到第三占用信息获取请求,获取所述至少两个时间点组成的时间段中第三时间段内调用目标硬件资源的进程组成的第三进程集合,所述第三占用信息获取请求用于请求获取所述第三时间段内对所述目标硬件资源的占用信息;
S20,根据所述第三时间段内所述第三进程集合中的进程对所述目标硬件资源的调用信息,获取所述第三进程集合中的进程所关联的第三应用在所述第三时间段内对所述目标硬件资源的占用信息;
S21,输出所述对所述目标硬件资源的占用信息以及所述目标硬件资源的标识。
具体可选的,若接收到第三占用信息获取请求(该第三占用信息获取请求用于请求获取第三时间段内对目标硬件资源的占用信息,对目标硬件资源的占用信息包括但不限于在第三时间段内是哪些应用对该目标硬件资源进行占用,或者在该第三时间段内对该目标硬件资源占用产生的总功耗等等,该第三时间段为至少两个时间点组成的时间段中全部或者部分),获取第三时间点内调用该目标硬件资源的进程组成的第三进程集合,该第三进程集合包括一个进程或者多个进程。
若该第三进程集合中包括一个进程,则根据该进程所调用的硬件资源,获取该进程所关联的应用在第三时间段内对至少一个硬件资源的占用信息;若该第三进程集合中包括多个进程,则根据该多个进程中每个进程所调用的硬件资源,获取该多个进程所关联的第三应用(第三应用包括一个应用或者多个应用)在第三时间段内对所述至少一个硬件资源的占用信息。所述硬件资源的占用信息包括:占用所述硬件资源的时间点信息、占用所述硬件资源的大小信息以及占用所述硬件资源的功耗信息中的至少一种。
例如,若用户想要获取在第三时间段8:00-8:30对目标硬件资源CPU的占用情况,则获取在8:00-8:30时间段内调用该CPU的进程组成的第三进程集合(第三进程集合包括一个进程或多个进程),比如在8:00-8:30时间段内调用该CPU的进程包括进程1、进程2、进程3以及进程4;进程1对CPU的功耗是2,进程2对CPU的功耗是3,进程3对CPU的功耗是8、进程4对CPU的 功耗是2,进程1和进程2与应用A关联,进程3与应用B关联,进程4与应用C关联,则可以得出应用A对CPU的功耗5,应用B对CPU功耗是8,应用C对CPU功耗是2。通过本发明实施例可以清楚反映出在8:00-8:30这个时段内各个应用对CPU这个硬件资源的产生的功耗。
需要说明的是,为了使得用户能够明确各个应用对CPU的功耗,可以输出该功耗信息,以及CPU资源标识。
进一步的,可以将每个硬件资源均按照上述目标资源的功耗计算方式进行计算,从而获得各个硬件资源的功耗情况,并输出各个硬件资源的标识。
需要说明的是,将各个硬件资源的功耗总和可以作为终端在第三时间段内总的功耗情况。
进一步的,硬件资源占用信息还可以包括占用硬件资源的时间点信息(即是反映出目标硬件资源是由哪些应用在哪些时间点占用),继续以上述8:00-8:30时间段之间对该目标硬件资源的占用信息为例进行说明,通过所记录的该8:00-8:30时间段内对该目标硬件资源CPU占用的多个进程(进程1、进程2、进程3以及进程4),可以获得与进程1和进程2相关联的应用A在8:00-8:10占用了目标硬件资源CPU,与进程3关联的应用B在8:15-8:20占用了目标硬件资源CPU,与进程4相关联的应用C在8:20-8:30占用了目标硬件资源CPU。
可以理解的是,硬件资源占用信息还可以包括占用硬件资源的大小信息,该大小信息为占用该硬件资源的时长,具体的计算方式在此不再赘述。
本发明实施例中,记录至少两个时间点中每个时间点终端所运行的进程,针对每个时间点,获取该时间点运行的进程所调用的至少一个硬件资源,获取该至少两个时间点运行的进程组成的进程集合,该进程集合中包括一个进程或者多个进程,根据进程集合中的进程所调用的该至少一个硬件资源,获取该进程集合中的进程所关联的应用对该至少一个硬件资源的占用信息,这种方式通过以进程为单位进行统计,可以精确定位到每个应用对该至少一个硬件资源的占用信息,提供的信息比较直观。
请参照图2,为本发明实施例提供的另一种资源统计方法的流程示意图,如图所示,本实施例的的资源统计方法包括以下步骤:
S200,记录至少两个时间点中每个时间点终端所运行的进程;
S201,针对每个所述时间点,获取该时间点运行的进程所调用的至少一个硬件资源;
S202,获取所述至少两个时间点运行的进程组成的进程集合,所述进程集合中包括一个进程或者多个进程;
本发明实施例步骤S200-S202请参照图1的实施例步骤S100-S102,在此不再赘述。
可选的,在一种可选的实施方式中,可以包括以下步骤S202-S205;
S203,针对每个所述时间点运行的进程,确定所述进程的运行状态类型,所述运行状态类型包括前台运行或者后台运行;
本发明实施例中,通常各个应用在后台运行时,也会对硬件资源进行占用,例如会对CPU进行占用。因此为了能够让用户明确各个应用在前台运行和后台运行时对硬件资源的占用情况,本实施例进一步对每个时间点的进程的运行状态类型进行判定,运行状态类型包括前台运行或者后台运行。
具体可选的,如图5所示,AMS在对各个进程进行调度以及对硬件资源进行分配的过程中,通过控制器对每个时间点所运行的进程的前台运行或者后台运行进行判定,并将相应的进程PID、所调用的硬件资源、前台或者后台运行状态类型存储入存储单元。
S204,根据所述进程集合中的进程所调用的硬件资源以及所述进程集合中的进程的运行状态类型,分别统计所述进程集合中的进程在前台运行时占用所述至少一个硬件资源的信息,以及所述进程集合中的进程在后台运行时占用所述至少一个硬件资源的信息;
本发明实施例中,根据所记录的至少两个时间点中各个进程所调用的硬件资源以及各个进程的运行状态类型,可以统计每个进程在前台运行时占用各个硬件资源的信息,具体可选的,对于某一个进程而言,将该进程在前台运行的所有时间点对各个硬件资源的占用情况作为该进程在前台运行时占用各个硬 件资源的信息;将该进程在后台运行的所有时间点对各个硬件资源的占用情况作为该进程在后台运行时占用各个硬件资源的信息。需要说明的是,该进程占用各个硬件资源的信息可以是该进程占用各个硬件资源的时间点或者该进程占用各个硬件资源的总的时长(即是对各个硬件资源的占用大小),或者也可以是该进程占用各个硬件资源的功耗信息。
S205,根据所述进程集合中的进程在前台运行时占用所述至少一个硬件资源的信息,获取所述进程集合中的进程所关联的应用在前台运行时占用所述至少一个硬件资源的信息;
本发明实施例中,根据各个进程在前台运行时占用硬件资源的信息,可以获得各个进程所关联的应用在前台运行时占用各个硬件资源的信息,即是将某个进程在前台运行时占用某个硬件资源的信息作为该进程所关联的应用在前台运行时对该硬件资源的占用信息。
具体可选的,这里以两个应用(PKG:com.test.demo1和PKG:com.test.demo2)对硬件资源的占用大小为例进行说明,应用com.test.demo1下包括一个进程PID=2000;应用com.test.demo2下包括一个进程PID=2001;以进程为单位进行统计,统计结果如下:
前台:
PID=2000CPU:200s(进程PID2000运行在前台时对CPU占用时长总的为200s)
PID=2001CPU:300s(进程PID2001运行在前台时对CPU占用时长总的为300s))
PID=2000GPS:200s(进程PID2000运行在前台时对GPS占用时长总的为200s)
PID=2000Wifi流量:10M(进程PID2000运行在前台时对WIFI流量耗费为10M)
后台:
PID=2000CPU:300s(进程PID2000运行在后台时对CPU占用时长总的为 300s)
PID=2001CPU:200s(进程PID2001运行在后台时对CPU占用时长总的为200s)
PID=2000GPS:300s(进程PID2000运行在后台时对GPS占用时长总的为300s)
PID=2000Wifi流量:10M(进程PID2000运行在后台时对wifi耗费流量为10M)
PID=2001Wifi流量:10M(进程PID2001运行在后台时对wifi耗费流量为10M)
从上述可知,进程2000与应用com.test.demo1关联,则应用com.test.demo1在前台时对CPU占用大小为200s,对GPS占用为200s,对WIFI流量耗费为10M。应用com.test.demo1在后台对CPU占用大小为300s,对GPS占用大小为300s,对WIFI流量耗费为10M,同理可以统计出com.test.demo2在前台运行时对各个硬件资源的占用大小以及在后台运行时对各个硬件资源的占用大小,进一步还可以根据对各个硬件资源的占用大小计算出对各个硬件资源的功耗,功耗可以直观反映对终端的耗电情况,本发明对所统计得到的各个进程的对各个硬件资源的占用信息不作限定,
进一步可选的,基于统计得到的各个时间点各个应用在前台运行时占用各个硬件资源的占用信息,可以进一步显示在各个时间点前台所运行的应用以及后台所运行的应用,如图3所示,即是显示8:00-10:00这个时间段内各个时间点所运行的前台应用,以及该前台应用对各个硬件资源的占用情况,如图所示,在8:30这个时间点,前台运行的应用是搜狐视频,同时采用的是移动信号,即是调用了数据流量模块硬件资源,且是亮屏状态,因此也占用了LCD硬件资源。
请参照图4,还可以进一步从显示界面获得各个时间点所运行的前台应用以及后台应用,例如在8:40这个时间点,运行的前台应用为搜狐视频,同时淘宝在后台运行。
需要说明的是,本发明对各个应用对各个硬件资源占用信息的显示方式不作限定。
S206,根据所述进程集合中的进程在后台运行时占用所述至少一个硬件资源的信息,获取所述进程集合中的进程所关联的应用在后台运行时占用所述至少一个硬件资源的信息。
本发明实施例中,根据每个进程在后台运行时占用硬件资源的信息,可以进一步获得各个进程所关联的应用在后台运行时占用各个硬件资源的信息。需要说明的是,每个应用对各个硬件资源的占用信息包括但不限于每个应用在后台运行时对各个硬件资源的占用时间点或者也可以是对各个硬件资源的占用总的时长(即是对各个硬件资源的占用大小),或者也可以是对各个硬件资源的功耗信息。
对于具体的统计方法可以参照步骤S205的阐述,在此不再赘述。
在另一种可选的实施方式中,可以包括以下步骤S207-S208;
S207,针对每个所述时间点运行的进程,确定该时间点的终端屏幕状态,所述终端屏幕状态包括亮屏状态或者黑屏状态;
本发明实施例中,通常用户对终端在亮屏状态以及黑屏状态所运行的应用以及各个应用对各个硬件资源的占用情况比较关心。本发明实施例针对每个时间点所运行的进程,可以进一步确定该时间点终端屏幕状态,需要说明的是,在安卓手机***中,由AMS对进程进行调度时,可以由控制器确定当前时间点终端屏幕的状态,终端屏幕状态包括亮屏状态或者黑屏状态。
S208,根据所述进程集合中的进程所调用的所述至少一个硬件资源,分别统计在所述亮屏状态所述进程集合中的进程所关联的应用占用所述至少一个硬件资源的信息,以及在所述黑屏状态所述进程集合中的进程所关联的应用占用所述至少一个硬件资源的信息。
本发明实施例中,根据所记录的至少两个时间点中各个进程所调用的硬件资源以及所记录的各个时间点的终端屏幕状态,分别统计在亮屏状态下各个进程所关联的应用占用至少一个硬件资源的信息(将亮屏状态下某个进程对某个硬件资源的占用信息确定为在亮屏状态下该进程所关联的应用对该硬件资源 的占用信息),以及在黑屏状态下各个进程所关联的应用占用至少一个硬件资源的信息(将黑屏状态下某个进程对某个硬件资源的占用信息确定为在黑屏状态下该进程所关联的应用对该硬件资源的占用信息)。
需要说明的是,本实施例的每个应用占用硬件资源的信息包括但不限于每个应用对各个硬件资源的占用时间点、每个应用对各个硬件资源的占用大小(即是总的占用时长),以及每个应用对各个硬件资源的功耗信息。
这里继续以两个应用(PKG:com.test.demo1和PKG:com.test.demo2)对硬件资源的占用大小为例进行说明,应用com.test.demo1下包括一个进程PID=2000;应用com.test.demo2下包括一个进程PID=2001;以进程为单位进行统计,统计结果如下:
黑屏:
PID=2000CPU:100s(进程PID2000在黑屏状态对CPU占用时长总的为100s)
PID=2001CPU:100s(进程PID2001在黑屏状态对CPU占用时长总的为100s)
PID=2000GPS:200s(进程PID2000在黑屏状态对GPS占用时长总的为100s)
PID=2000Wifi流量:10M(进程PID2000在黑屏状态对WIFI流量耗费为10M)
PID=2001Wifi流量:10M(进程PID2001在黑屏状态对WIFI流量耗费为10M)
亮屏:
PID=2000CPU:400s(进程PID2000在亮屏状态对CPU占用时长总的为400s)
PID=2001CPU:400s(进程PID2001在亮屏状态对CPU占用时长总的为400s)
PID=2000GPS:300s(进程PID2000在亮屏状态对GPS占用时长总的为300s)
PID=2000Wifi流量:10M(进程PID2000在亮屏状态耗费流量为10M)
从上述可知,进程2000与应用com.test.demo1关联,则应用com.test.demo1在黑屏时对CPU占用大小为100s,对GPS占用为200s,对WIFI流量耗费为10M。应用com.test.demo1在亮屏对CPU占用大小为400s,对GPS占用大小为300s,对WIFI流量耗费为10M,同理可以统计出com.test.demo2在亮屏时对各个硬件资源的占用大小以及在黑屏时对各个硬件资源的占用大小。
进一步的,还可以根据对各个硬件资源的占用大小计算出对各个硬件资源的功耗,功耗可以直观反映对终端的耗电情况,即是在亮屏状态时各个应用对各个硬件资源的耗电以及在黑屏状态时各个应用对各个硬件资源的耗电;本发明对所统计得到的各个进程的对各个硬件资源的占用信息不作限定。
需要说明的是,可以进一步结合步骤S202-步骤S205所阐述的前台应用和后台应用进行统计,即是分别统计在亮屏状态下所运行的前台应用以及后台应用,以及在黑屏状态下所运行的前台应用和后台应用。
本发明实施例中,记录至少两个时间点中每个时间点终端所运行的进程,针对每个时间点,获取该时间点运行的进程所调用的至少一个硬件资源,获取该至少两个时间点运行的进程组成的进程集合,该进程集合中包括一个进程或者多个进程,根据进程集合中的进程所调用的该至少一个硬件资源,获取该进程集合中的进程所关联的应用对该至少一个硬件资源的占用信息,这种方式通过以进程为单位进行统计,可以精确定位到每个应用对该至少一个硬件资源的占用信息,提供的信息比较直观。
请参照图7,为本发明实施例提供的一种资源统计装置的结构示意图,如图所示,本发明实施例的资源统计装置包括:
记录模块100,用于记录至少两个时间点中每个时间点终端所运行的进程;
第一获取模块101,用于针对每个所述时间点,获取该时间点运行的进程所调用的至少一个硬件资源;
第二获取模块102,用于获取所述至少两个时间点运行的进程组成的进程集合,所述进程集合中包括一个进程或者多个进程;
第三获取模块103,用于根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息。
可选的,该装置还可以包括第四获取模块104和第五获取模块105;
第四获取模块104,用于若接收到第一占用信息获取请求,获取所述至少两个时间点组成的时间段中第一时间段内运行的进程组成的第一进程集合,所述第一占用信息获取请求用于请求获取所述第一时间段内硬件资源的占用信息;
第五获取模块105,用于根据所述第一进程集合中的进程所调用的硬件资源,获取所述第一进程集合中的进程所关联的第一应用在所述第一时间段内对所述至少一个硬件资源的占用信息。
可选的,该装置还可以包括第六获取模块106和第七获取模块107;
第六获取模块106,用于若接收到第二占用信息获取请求,获取第二应用所关联的进程组成的第二进程集合,所述第二占用信息获取请求用于请求获取所述第二应用对所述至少两个时间点组成的时间段中第二时间段内硬件资源的占用信息;
第七获取模块107,用于根据所述第二时间段内所述第二进程集合中的进程所调用的硬件资源,获取所述第二应用在所述第二时间段内对所述至少一个硬件资源的占用信息。
可选的,该装置还可以包括第八获取模块108、第九获取模块109以及输出模块110;;
第八获取模块108,用于若接收到第三占用信息获取请求,获取所述至少两个时间点组成的时间段中第三时间段内调用目标硬件资源的进程组成的第三进程集合,所述第三占用信息获取请求用于请求获取所述第三时间段内对所 述目标硬件资源的占用信息;
第九获取模块109,用于根据所述第三时间段内所述第三进程集合中的进程对所述目标硬件资源的调用信息,获取所述第三进程集合中的进程所关联的第三应用在所述第三时间段内对所述目标硬件资源的占用信息;
输出模块110,用于输出所述对所述目标硬件资源的占用信息以及所述目标硬件资源的标识。
上述硬件资源的占用信息包括:占用所述硬件资源的时间点信息、占用所述硬件资源的大小信息以及占用所述硬件资源的功耗信息中的至少一种。
可选的,若所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息包括该应用占用所述至少一个硬件资源的大小信息;
所述第三获取模块103根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息具体包括:
根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程占用所述至少一个硬件资源的大小;
根据所述进程集合中的进程占用所述至少一个硬件资源的大小,获取所述进程集合中的进程所关联的应用占用所述至少一个硬件资源的大小信息。
可选的,若所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息包括该应用占用所述至少一个硬件资源的功耗信息;
所述第三获取模块103根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息具体包括:
根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程占用所述至少一个硬件资源的大小;
根据所述进程集合中的进程占用所述至少一个硬件资源的大小以及所述硬件资源的功率,获取所述进程集合中的进程占用所述至少一个硬件资源的功耗信息;
根据所述进程集合中的进程占用所述至少一个硬件资源的功耗信息,获取所述进程集合中的进程所关联的应用占用所述至少一个硬件资源的功耗信息。
可选的,该装置还包括第一确定模块111;
第一确定模块111,用于针对每个所述时间点运行的进程,确定所述进程的运行状态类型,所述运行状态类型包括前台运行或者后台运行;
所述第三获取模块103根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息具体包括:
根据所述进程集合中的进程所调用的硬件资源以及所述进程集合中的进程的运行状态类型,分别统计所述进程集合中的进程在前台运行时占用所述至少一个硬件资源的信息,以及所述进程集合中的进程在后台运行时占用所述至少一个硬件资源的信息;
根据所述进程集合中的进程在前台运行时占用所述至少一个硬件资源的信息,获取所述进程集合中的进程所关联的应用在前台运行时占用所述至少一个硬件资源的信息;
根据所述进程集合中的进程在后台运行时占用所述至少一个硬件资源的信息,获取所述进程集合中的进程所关联的应用在后台运行时占用所述至少一个硬件资源的信息。
可选的,该装置还可以包括第二确定模块112;
第二确定模块112,用于针对每个所述时间点运行的进程,确定该时间点的终端屏幕状态,所述终端屏幕状态包括亮屏状态或者黑屏状态;
所述第三获取模块103根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息具体包括:
根据所述进程集合中的进程所调用的所述至少一个硬件资源,分别统计在所述亮屏状态所述进程集合中的进程所关联的应用占用所述至少一个硬件资源的信息,以及在所述黑屏状态所述进程集合中的进程所关联的应用占用所述至少一个硬件资源的信息。
本发明实施例中,记录至少两个时间点中每个时间点终端所运行的进程,针对每个时间点,获取该时间点运行的进程所调用的至少一个硬件资源,获取 该至少两个时间点运行的进程组成的进程集合,该进程集合中包括一个进程或者多个进程,根据进程集合中的进程所调用的该至少一个硬件资源,获取该进程集合中的进程所关联的应用对该至少一个硬件资源的占用信息,这种方式通过以进程为单位进行统计,可以精确定位到每个应用对该至少一个硬件资源的占用信息,提供的信息比较直观。
可以理解的是,上述资源统计装置中各个模块的具体实现方式可以进一步参考方法实施例中的相关描述。
请参照图8,为本发明实施例提供的终端的结构示意图,如图所示,其中,图8所示的终端用于执行本发明实施例所公开的资源统计方法。如图8所示,该终端800可以包括:至少一个处理器801,例如CPU(Central Processing Unit,中央处理器),至少一个输入装置802,至少一个输出装置803,存储器804以及通信总线805。本领域技术人员可以理解,图8中示出的终端800的结构并不构成对本发明的限定,它既可以是总线形结构,也可以是星型结构,还可以包括比图8所示的更多或更少的部件,例如通信组件,用于实现与其他终端通信以及进行网络访问等功能,例如定位组件,用于获取地图信息以及为用户提供导航等服务;或者组合某些部件,或者不同的部件布置。其中,输入装置802可以是触摸屏,语音输入装置,键盘,鼠标,手写板等等能实现输入的装置,输出装置803可以是显示器,扬声器,投影仪等能使得用户接收终端输出结果的装置。
其中,存储器804用于存储软件程序以及模块,处理器801通过运行存储在存储器804的软件程序以及模块,从而执行用户终端的各种功能应用以及实现资源统计。存储器804主要包括程序存储区和数据存储区,其中,程序存储区可存储操作***、至少一个功能所需的应用程序,比如声音播放程序、图像播放程序等等;数据存储区可存储根据终端的使用所创建的数据(比如音频数据、电话本等)等。
在本发明具体实施方式中,存储器804可以包括易失性存储器,例如非挥 发性动态随机存取内存(Nonvolatile Random Access Memory,简称NVRAM)、相变化随机存取内存(Phase Change RAM,简称PRAM)、磁阻式随机存取内存(Magetoresistive RAM,简称MRAM)等,还可以包括非易失性存储器,例如至少一个磁盘存储器件、电子可擦除可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,简称EEPROM)、闪存器件,例如反或闪存(NOR flash memory)或是反及闪存(NAND flash memory)。上述应用程序包括安装在用户终端上的任何应用,包括但不限于浏览器、电子邮件、即时消息服务、文字处理、键盘虚拟、窗口小部件(Widget)、加密、数字版权管理、语音识别、语音复制、定位(例如由全球定位***提供的功能)、音乐播放等等。
通信总线805用于实现处理器801、输入装置802、输出装置803以及存储器804组件之间的连接通信。通信总线805可以是工业标准体系结构(Industry Standard Architecture,简称为ISA)总线、外部设备互连(Peripheral Component,简称为PCI)总线或扩展工业标准体系结构(Extended Industry Standard Architecture,简称为EISA)总线等。通信总线805可以分为地址总线、数据总线、控制总线等。为便于表示,图8中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
处理器801为电子设备800的控制中心,利用各种接口和线路连接整个终端800的各个部分,通过运行或执行存储在存储器804内的软件程序和/或模块,以及调用存储在存储器804内的数据,用于执行以下操作:
记录至少两个时间点中每个时间点终端所运行的进程;
针对每个所述时间点,获取该时间点运行的进程所调用的至少一个硬件资源;
获取所述至少两个时间点运行的进程组成的进程集合,所述进程集合中包括一个进程或者多个进程;
根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息。
可选的,所述处理器801还用于调用所述存储器中存储的程序代码,用于 执行以下步骤:
若通过所述输入装置802接收到第一占用信息获取请求,获取所述至少两个时间点组成的时间段中第一时间段内运行的进程组成的第一进程集合,所述第一占用信息获取请求用于请求获取所述第一时间段内硬件资源的占用信息;
根据所述第一进程集合中的进程所调用的硬件资源,获取所述第一进程集合中的进程所关联的第一应用在所述第一时间段内对所述至少一个硬件资源的占用信息。
可选的,所述处理器801还用于调用所述存储器中存储的程序代码,用于执行以下步骤:
若通过所述输入装置802接收到第二占用信息获取请求,获取第二应用所关联的进程组成的第二进程集合,所述第二占用信息获取请求用于请求获取所述第二应用对所述至少两个时间点组成的时间段中第二时间段内硬件资源的占用信息;
根据所述第二时间段内所述第二进程集合中的进程所调用的硬件资源,获取所述第二应用在所述第二时间段内对所述至少一个硬件资源的占用信息。
可选的,所述处理器801还用于调用所述存储器中存储的程序代码,用于执行以下步骤:
若通过所述输入装置802接收到第三占用信息获取请求,获取所述至少两个时间点组成的时间段中第三时间段内调用目标硬件资源的进程组成的第三进程集合,所述第三占用信息获取请求用于请求获取所述第三时间段内对所述目标硬件资源的占用信息;
根据所述第三时间段内所述第三进程集合中的进程对所述目标硬件资源的调用信息,获取所述第三进程集合中的进程所关联的第三应用在所述第三时间段内对所述目标硬件资源的占用信息;
通过所述输出装置803输出所述对所述目标硬件资源的占用信息以及所述目标硬件资源的标识。
上述硬件资源的占用信息包括:占用所述硬件资源的时间点信息、占用所述硬件资源的大小信息以及占用所述硬件资源的功耗信息中的至少一种。
其中,若所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息包括该应用占用所述至少一个硬件资源的大小信息;
所述处理器801根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息,包括:
根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程占用所述至少一个硬件资源的大小;
根据所述进程集合中的进程占用所述至少一个硬件资源的大小,获取所述进程集合中的进程所关联的应用占用所述至少一个硬件资源的大小信息。
其中,若所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息包括该应用占用所述至少一个硬件资源的功耗信息;
所述处理器801根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息,包括:
根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程占用所述至少一个硬件资源的大小;
根据所述进程集合中的进程占用所述至少一个硬件资源的大小以及所述硬件资源的功率,获取所述进程集合中的进程占用所述至少一个硬件资源的功耗信息;
根据所述进程集合中的进程占用所述至少一个硬件资源的功耗信息,获取所述进程集合中的进程所关联的应用占用所述至少一个硬件资源的功耗信息。
可选的,所述处理器801还用于调用所述存储器中存储的程序代码,用于执行以下步骤:
针对每个所述时间点运行的进程,确定所述进程的运行状态类型,所述运行状态类型包括前台运行或者后台运行;
所示处理器801根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息,包括:
根据所述进程集合中的进程所调用的硬件资源以及所述进程集合中的进程的运行状态类型,分别统计所述进程集合中的进程在前台运行时占用所述至少一个硬件资源的信息,以及所述进程集合中的进程在后台运行时占用所述至少一个硬件资源的信息;
根据所述进程集合中的进程在前台运行时占用所述至少一个硬件资源的信息,获取所述进程集合中的进程所关联的应用在前台运行时占用所述至少一个硬件资源的信息;
根据所述进程集合中的进程在后台运行时占用所述至少一个硬件资源的信息,获取所述进程集合中的进程所关联的应用在后台运行时占用所述至少一个硬件资源的信息。
可选的,所述处理器801还用于调用所述存储器中存储的程序代码,用于执行以下步骤:
针对每个所述时间点运行的进程,确定该时间点的终端屏幕状态,所述终端屏幕状态包括亮屏状态或者黑屏状态;
所述处理器801根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息,包括:
根据所述进程集合中的进程所调用的所述至少一个硬件资源,分别统计在所述亮屏状态所述进程集合中的进程所关联的应用占用所述至少一个硬件资源的信息,以及在所述黑屏状态所述进程集合中的进程所关联的应用占用所述至少一个硬件资源的信息。
本发明实施例中,记录至少两个时间点中每个时间点终端所运行的进程,针对每个时间点,获取该时间点运行的进程所调用的至少一个硬件资源,获取该至少两个时间点运行的进程组成的进程集合,该进程集合中包括一个进程或者多个进程,根据进程集合中的进程所调用的该至少一个硬件资源,获取该进程集合中的进程所关联的应用对该至少一个硬件资源的占用信息,这种方式通过以进程为单位进行统计,可以精确定位到每个应用对该至少一个硬件资源的占用信息,提供的信息比较直观。
可以理解的是,上述终端中各个组件的具体实现方式可以进一步参考方法实施例中的相关描述。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(Random Access Memory,RAM)等。
本发明实施例方法中的步骤可以根据实际需要进行顺序调整、合并和删减。
本发明实施例内存访问装置中的模块可以根据实际需要进行合并、划分和删减。
以上所揭露的仅为本发明较佳实施例而已,当然不能以此来限定本发明之权利范围,因此依本发明权利要求所作的等同变化,仍属本发明所涵盖的范围。

Claims (27)

  1. 一种资源统计方法,其特征在于,包括:
    记录至少两个时间点中每个时间点终端所运行的进程;
    针对每个所述时间点,获取该时间点运行的进程所调用的至少一个硬件资源;
    获取所述至少两个时间点运行的进程组成的进程集合,所述进程集合中包括一个进程或者多个进程;
    根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息。
  2. 如权利要求1所述的方法,其特征在于,所述方法还包括:
    若接收到第一占用信息获取请求,获取所述至少两个时间点组成的时间段中第一时间段内运行的进程组成的第一进程集合,所述第一占用信息获取请求用于请求获取所述第一时间段内硬件资源的占用信息;
    根据所述第一进程集合中的进程所调用的硬件资源,获取所述第一进程集合中的进程所关联的第一应用在所述第一时间段内对所述至少一个硬件资源的占用信息。
  3. 如权利要求1所述的方法,其特征在于,所述方法还包括:
    若接收到第二占用信息获取请求,获取第二应用所关联的进程组成的第二进程集合,所述第二占用信息获取请求用于请求获取所述第二应用对所述至少两个时间点组成的时间段中第二时间段内硬件资源的占用信息;
    根据所述第二时间段内所述第二进程集合中的进程所调用的硬件资源,获取所述第二应用在所述第二时间段内对所述至少一个硬件资源的占用信息。
  4. 如权利要求1所述的方法,其特征在于,所述方法还包括:
    若接收到第三占用信息获取请求,获取所述至少两个时间点组成的时间段中第三时间段内调用目标硬件资源的进程组成的第三进程集合,所述第三占用 信息获取请求用于请求获取所述第三时间段内对所述目标硬件资源的占用信息;
    根据所述第三时间段内所述第三进程集合中的进程对所述目标硬件资源的调用信息,获取所述第三进程集合中的进程所关联的第三应用在所述第三时间段内对所述目标硬件资源的占用信息;
    输出所述对所述目标硬件资源的占用信息以及所述目标硬件资源的标识。
  5. 如权利要求1-4任意一项所述的方法,其特征在于,所述硬件资源的占用信息包括:占用所述硬件资源的时间点信息、占用所述硬件资源的大小信息以及占用所述硬件资源的功耗信息中的至少一种。
  6. 如权利要求1所述的方法,其特征在于,若所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息包括该应用占用所述至少一个硬件资源的大小信息;
    所述根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息,包括:
    根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程占用所述至少一个硬件资源的大小;
    根据所述进程集合中的进程占用所述至少一个硬件资源的大小,获取所述进程集合中的进程所关联的应用占用所述至少一个硬件资源的大小信息。
  7. 如权利要求1所述的方法,其特征在于,若所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息包括该应用占用所述至少一个硬件资源的功耗信息;
    所述根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息,包括:
    根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进 程集合中的进程占用所述至少一个硬件资源的大小;
    根据所述进程集合中的进程占用所述至少一个硬件资源的大小以及所述硬件资源的功率,获取所述进程集合中的进程占用所述至少一个硬件资源的功耗信息;
    根据所述进程集合中的进程占用所述至少一个硬件资源的功耗信息,获取所述进程集合中的进程所关联的应用占用所述至少一个硬件资源的功耗信息。
  8. 如权利要求1-7任意一项所述的方法,其特征在于,所述方法还包括:
    针对每个所述时间点运行的进程,确定所述进程的运行状态类型,所述运行状态类型包括前台运行或者后台运行;
    所述根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息,包括:
    根据所述进程集合中的进程所调用的硬件资源以及所述进程集合中的进程的运行状态类型,分别统计所述进程集合中的进程在前台运行时占用所述至少一个硬件资源的信息,以及所述进程集合中的进程在后台运行时占用所述至少一个硬件资源的信息;
    根据所述进程集合中的进程在前台运行时占用所述至少一个硬件资源的信息,获取所述进程集合中的进程所关联的应用在前台运行时占用所述至少一个硬件资源的信息;
    根据所述进程集合中的进程在后台运行时占用所述至少一个硬件资源的信息,获取所述进程集合中的进程所关联的应用在后台运行时占用所述至少一个硬件资源的信息。
  9. 如权利要求1-7任意一项所述的方法,其特征在于,所述方法还包括:
    针对每个所述时间点运行的进程,确定该时间点的终端屏幕状态,所述终端屏幕状态包括亮屏状态或者黑屏状态;
    所述根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息,包 括:
    根据所述进程集合中的进程所调用的所述至少一个硬件资源,分别统计在所述亮屏状态所述进程集合中的进程所关联的应用占用所述至少一个硬件资源的信息,以及在所述黑屏状态所述进程集合中的进程所关联的应用占用所述至少一个硬件资源的信息。
  10. 一种资源统计装置,其特征在于,包括:
    记录模块,用于记录至少两个时间点中每个时间点终端所运行的进程;
    第一获取模块,用于针对每个所述时间点,获取该时间点运行的进程所调用的至少一个硬件资源;
    第二获取模块,用于获取所述至少两个时间点运行的进程组成的进程集合,所述进程集合中包括一个进程或者多个进程;
    第三获取模块,用于根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息。
  11. 如权利要求10所述的装置,其特征在于,所述装置还包括:
    第四获取模块,用于若接收到第一占用信息获取请求,获取所述至少两个时间点组成的时间段中第一时间段内运行的进程组成的第一进程集合,所述第一占用信息获取请求用于请求获取所述第一时间段内硬件资源的占用信息;
    第五获取模块,用于根据所述第一进程集合中的进程所调用的硬件资源,获取所述第一进程集合中的进程所关联的第一应用在所述第一时间段内对所述至少一个硬件资源的占用信息。
  12. 如权利要求10所述的装置,其特征在于,所述装置还包括:
    第六获取模块,用于若接收到第二占用信息获取请求,获取第二应用所关联的进程组成的第二进程集合,所述第二占用信息获取请求用于请求获取所述第二应用对所述至少两个时间点组成的时间段中第二时间段内硬件资源的占用信息;
    第七获取模块,用于根据所述第二时间段内所述第二进程集合中的进程所调用的硬件资源,获取所述第二应用在所述第二时间段内对所述至少一个硬件资源的占用信息。
  13. 如权利要求10所述的装置,其特征在于,所述装置还包括:
    第八获取模块,用于若接收到第三占用信息获取请求,获取所述至少两个时间点组成的时间段中第三时间段内调用目标硬件资源的进程组成的第三进程集合,所述第三占用信息获取请求用于请求获取所述第三时间段内对所述目标硬件资源的占用信息;
    第九获取模块,用于根据所述第三时间段内所述第三进程集合中的进程对所述目标硬件资源的调用信息,获取所述第三进程集合中的进程所关联的第三应用在所述第三时间段内对所述目标硬件资源的占用信息;
    输出模块,用于输出所述对所述目标硬件资源的占用信息以及所述目标硬件资源的标识。
  14. 如权利要求10-13任意一项所述的装置,其特征在于,所述硬件资源的占用信息包括:占用所述硬件资源的时间点信息、占用所述硬件资源的大小信息以及占用所述硬件资源的功耗信息中的至少一种。
  15. 如权利要求10所述的装置,其特征在于,若所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息包括该应用占用所述至少一个硬件资源的大小信息;
    所述第三获取模块根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息具体包括:
    根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程占用所述至少一个硬件资源的大小;
    根据所述进程集合中的进程占用所述至少一个硬件资源的大小,获取所述进程集合中的进程所关联的应用占用所述至少一个硬件资源的大小信息。
  16. 如权利要求10所述的装置,其特征在于,若所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息包括该应用占用所述至少一个硬件资源的功耗信息;
    所述第三获取模块根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息具体包括:
    根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程占用所述至少一个硬件资源的大小;
    根据所述进程集合中的进程占用所述至少一个硬件资源的大小以及所述硬件资源的功率,获取所述进程集合中的进程占用所述至少一个硬件资源的功耗信息;
    根据所述进程集合中的进程占用所述至少一个硬件资源的功耗信息,获取所述进程集合中的进程所关联的应用占用所述至少一个硬件资源的功耗信息。
  17. 如权利要求10-16任意一项所述的装置,其特征在于,所述装置还包括第一确定模块;
    所述第一确定模块,用于针对每个所述时间点运行的进程,确定所述进程的运行状态类型,所述运行状态类型包括前台运行或者后台运行;
    所述第三获取模块根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息具体包括:
    根据所述进程集合中的进程所调用的硬件资源以及所述进程集合中的进程的运行状态类型,分别统计所述进程集合中的进程在前台运行时占用所述至少一个硬件资源的信息,以及所述进程集合中的进程在后台运行时占用所述至少一个硬件资源的信息;
    根据所述进程集合中的进程在前台运行时占用所述至少一个硬件资源的信息,获取所述进程集合中的进程所关联的应用在前台运行时占用所述至少一个硬件资源的信息;
    根据所述进程集合中的进程在后台运行时占用所述至少一个硬件资源的信息,获取所述进程集合中的进程所关联的应用在后台运行时占用所述至少一个硬件资源的信息。
  18. 如权利要求10-16任意一项所述的装置,其特征在于,所述装置还包括:
    第二确定模块,用于针对每个所述时间点运行的进程,确定该时间点的终端屏幕状态,所述终端屏幕状态包括亮屏状态或者黑屏状态;
    所述第三获取模块根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息具体包括:
    根据所述进程集合中的进程所调用的所述至少一个硬件资源,分别统计在所述亮屏状态所述进程集合中的进程所关联的应用占用所述至少一个硬件资源的信息,以及在所述黑屏状态所述进程集合中的进程所关联的应用占用所述至少一个硬件资源的信息。
  19. 一种终端,其特征在于,包括:处理器、存储器以及至少一个硬件资源,其中,所述处理器、存储器以及所述至少一个硬件资源分别连接通信总线,所述存储器中存储一组程序代码,且所述处理器用于调用所述存储器中存储的程序代码,用于执行以下步骤:
    记录至少两个时间点中每个时间点终端所运行的进程;
    针对每个所述时间点,获取该时间点运行的进程所调用的至少一个硬件资源;
    获取所述至少两个时间点运行的进程组成的进程集合,所述进程集合中包括一个进程或者多个进程;
    根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息。
  20. 如权利要求19所述的终端,其特征在于,所述装置还包括输入装置, 所述输入装置与所述通信总线连接;所述处理器还用于调用所述存储器中存储的程序代码,用于执行以下步骤:
    若通过所述输入装置接收到第一占用信息获取请求,获取所述至少两个时间点组成的时间段中第一时间段内运行的进程组成的第一进程集合,所述第一占用信息获取请求用于请求获取所述第一时间段内硬件资源的占用信息;
    根据所述第一进程集合中的进程所调用的硬件资源,获取所述第一进程集合中的进程所关联的第一应用在所述第一时间段内对所述至少一个硬件资源的占用信息。
  21. 如权利要求19所述的终端,其特征在于,所述装置还包括输入装置,所述输入装置与所述通信总线连接;所述处理器还用于调用所述存储器中存储的程序代码,用于执行以下步骤:
    若通过所述输入装置接收到第二占用信息获取请求,获取第二应用所关联的进程组成的第二进程集合,所述第二占用信息获取请求用于请求获取所述第二应用对所述至少两个时间点组成的时间段中第二时间段内硬件资源的占用信息;
    根据所述第二时间段内所述第二进程集合中的进程所调用的硬件资源,获取所述第二应用在所述第二时间段内对所述至少一个硬件资源的占用信息。
  22. 如权利要求19所述的终端,其特征在于,所述装置还包括输入装置和输出装置,所述输入装置和所述输出装置分别与所述通信总线连接;所述处理器还用于调用所述存储器中存储的程序代码,用于执行以下步骤:
    若通过所述输入装置接收到第三占用信息获取请求,获取所述至少两个时间点组成的时间段中第三时间段内调用目标硬件资源的进程组成的第三进程集合,所述第三占用信息获取请求用于请求获取所述第三时间段内对所述目标硬件资源的占用信息;
    根据所述第三时间段内所述第三进程集合中的进程对所述目标硬件资源的调用信息,获取所述第三进程集合中的进程所关联的第三应用在所述第三时 间段内对所述目标硬件资源的占用信息;
    通过所述输出装置输出所述对所述目标硬件资源的占用信息以及所述目标硬件资源的标识。
  23. 如权利要求19-22任意一项所述的终端,其特征在于,所述硬件资源的占用信息包括:占用所述硬件资源的时间点信息、占用所述硬件资源的大小信息以及占用所述硬件资源的功耗信息中的至少一种。
  24. 如权利要求19所述的终端,其特征在于,若所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息包括该应用占用所述至少一个硬件资源的大小信息;
    所述处理器根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息,包括:
    根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程占用所述至少一个硬件资源的大小;
    根据所述进程集合中的进程占用所述至少一个硬件资源的大小,获取所述进程集合中的进程所关联的应用占用所述至少一个硬件资源的大小信息。
  25. 如权利要求19所述的终端,其特征在于,若所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息包括该应用占用所述至少一个硬件资源的功耗信息;
    所述处理器根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息,包括:
    根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程占用所述至少一个硬件资源的大小;
    根据所述进程集合中的进程占用所述至少一个硬件资源的大小以及所述硬件资源的功率,获取所述进程集合中的进程占用所述至少一个硬件资源的功 耗信息;
    根据所述进程集合中的进程占用所述至少一个硬件资源的功耗信息,获取所述进程集合中的进程所关联的应用占用所述至少一个硬件资源的功耗信息。
  26. 如权利要求19-25任意一项所述的终端,其特征在于,所述处理器还用于调用所述存储器中存储的程序代码,用于执行以下步骤:
    针对每个所述时间点运行的进程,确定所述进程的运行状态类型,所述运行状态类型包括前台运行或者后台运行;
    所示处理器根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信息,包括:
    根据所述进程集合中的进程所调用的硬件资源以及所述进程集合中的进程的运行状态类型,分别统计所述进程集合中的进程在前台运行时占用所述至少一个硬件资源的信息,以及所述进程集合中的进程在后台运行时占用所述至少一个硬件资源的信息;
    根据所述进程集合中的进程在前台运行时占用所述至少一个硬件资源的信息,获取所述进程集合中的进程所关联的应用在前台运行时占用所述至少一个硬件资源的信息;
    根据所述进程集合中的进程在后台运行时占用所述至少一个硬件资源的信息,获取所述进程集合中的进程所关联的应用在后台运行时占用所述至少一个硬件资源的信息。
  27. 如权利要求19-25任意一项所述的终端,其特征在于,所述处理器还用于调用所述存储器中存储的程序代码,用于执行以下步骤:
    针对每个所述时间点运行的进程,确定该时间点的终端屏幕状态,所述终端屏幕状态包括亮屏状态或者黑屏状态;
    所述处理器根据所述进程集合中的进程所调用的所述至少一个硬件资源,获取所述进程集合中的进程所关联的应用对所述至少一个硬件资源的占用信 息,包括:
    根据所述进程集合中的进程所调用的所述至少一个硬件资源,分别统计在所述亮屏状态所述进程集合中的进程所关联的应用占用所述至少一个硬件资源的信息,以及在所述黑屏状态所述进程集合中的进程所关联的应用占用所述至少一个硬件资源的信息。
PCT/CN2016/077621 2016-03-29 2016-03-29 一种资源统计方法、装置及终端 WO2017166036A1 (zh)

Priority Applications (8)

Application Number Priority Date Filing Date Title
CN202110305184.2A CN113157539A (zh) 2016-03-29 2016-03-29 一种资源统计方法、装置及终端
US16/089,373 US10826310B2 (en) 2016-03-29 2016-03-29 Resource statistics collection method and apparatus and terminal
CN202110305211.6A CN113157439B (zh) 2016-03-29 2016-03-29 一种资源统计方法、装置及终端
CN201680069782.1A CN108293197B (zh) 2016-03-29 2016-03-29 一种资源统计方法、装置及终端
EP22195025.6A EP4171105A1 (en) 2016-03-29 2016-03-29 Resource statistics collection method and terminal
EP16895817.1A EP3410764B1 (en) 2016-03-29 2016-03-29 Method and device for resource statistics, and terminal
PCT/CN2016/077621 WO2017166036A1 (zh) 2016-03-29 2016-03-29 一种资源统计方法、装置及终端
US17/084,640 US11431182B2 (en) 2016-03-29 2020-10-30 Resource statistics collection method and apparatus and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2016/077621 WO2017166036A1 (zh) 2016-03-29 2016-03-29 一种资源统计方法、装置及终端

Related Child Applications (2)

Application Number Title Priority Date Filing Date
US16/089,373 A-371-Of-International US10826310B2 (en) 2016-03-29 2016-03-29 Resource statistics collection method and apparatus and terminal
US17/084,640 Continuation US11431182B2 (en) 2016-03-29 2020-10-30 Resource statistics collection method and apparatus and terminal

Publications (1)

Publication Number Publication Date
WO2017166036A1 true WO2017166036A1 (zh) 2017-10-05

Family

ID=59962472

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/077621 WO2017166036A1 (zh) 2016-03-29 2016-03-29 一种资源统计方法、装置及终端

Country Status (4)

Country Link
US (2) US10826310B2 (zh)
EP (2) EP3410764B1 (zh)
CN (3) CN113157539A (zh)
WO (1) WO2017166036A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112732434A (zh) * 2019-10-28 2021-04-30 华为终端有限公司 一种应用管理方法及装置
US11636020B2 (en) 2018-03-09 2023-04-25 Samsung Electronics Co., Ltd Electronic device and on-device method for enhancing user experience in electronic device
CN118227743A (zh) * 2024-05-24 2024-06-21 四川凯普顿信息技术股份有限公司 一种算法模型智能调用方法及***

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11290772B2 (en) * 2020-02-10 2022-03-29 Kyndryl, Inc. Multi-source content displaying interface

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102323900A (zh) * 2011-08-31 2012-01-18 国家计算机网络与信息安全管理中心 一种众核环境下基于动态感知的***容错机制
CN102880540A (zh) * 2012-08-27 2013-01-16 南京智达康无线通信科技股份有限公司 一种保障接入控制器在高负载下正常工作的方法
US8627029B2 (en) * 2007-03-08 2014-01-07 Sandisk Il Ltd. Methods for managing files according to application

Family Cites Families (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090040029A1 (en) * 2006-08-10 2009-02-12 V2Green, Inc. Transceiver and charging component for a power aggregation system
US8312136B2 (en) * 2007-07-10 2012-11-13 Nec Corporation Computer system management based on request count change parameter indicating change in number of requests processed by computer system
WO2010007913A1 (ja) 2008-07-15 2010-01-21 ミツミ電機株式会社 携帯機器、電池パック、半導体装置、表示制御方法、表示制御プログラム
US9152218B2 (en) * 2010-12-22 2015-10-06 Intel Corporation Framework for runtime power monitoring and management
WO2012100219A1 (en) * 2011-01-20 2012-07-26 Zoll Medical Corporation Systems and methods for collection, organization and display of ems information
WO2012127596A1 (ja) * 2011-03-19 2012-09-27 富士通株式会社 端末装置、プロセス管理方法、およびプロセス管理プログラム
US9804893B2 (en) * 2011-04-08 2017-10-31 Qualcomm Incorporated Method and apparatus for optimized execution using resource utilization maps
CN102306118A (zh) 2011-08-31 2012-01-04 中兴通讯股份有限公司 Android终端应用程序功耗监控的方法和装置
CN102508761B (zh) 2011-11-17 2015-11-25 宇龙计算机通信科技(深圳)有限公司 终端电量的管理方法和终端
US8490058B2 (en) * 2011-12-13 2013-07-16 Microsoft Corporation Time-based navigation within resource utilization data
KR101212496B1 (ko) 2012-05-07 2012-12-14 주식회사 팀스톤 모니터링 자원의 사용량 표현 방법, 컴퓨팅 장치 및 그 방법을 실행시키기 위한 프로그램을 기록한 기록 매체
US9465398B2 (en) * 2012-06-20 2016-10-11 Causam Energy, Inc. System and methods for actively managing electric power over an electric power grid
US9128899B1 (en) * 2012-07-31 2015-09-08 Google Inc. Predictive failover planning
CN103226486B (zh) * 2013-04-23 2016-08-10 北京奇虎科技有限公司 对浏览器运行进行优化的方法和装置
US9871741B2 (en) * 2014-03-10 2018-01-16 Microsoft Technology Licensing, Llc Resource management based on device-specific or user-specific resource usage profiles
EP3683591B1 (en) 2014-05-30 2021-10-20 Apple Inc. Battery usage tracking user interface
WO2016082109A1 (zh) * 2014-11-25 2016-06-02 华为技术有限公司 用户设备的电源管理方法和电源管理装置
CN104503840B (zh) * 2014-12-15 2016-09-28 北京奇虎科技有限公司 对终端资源进行优化的方法及装置
CN104660816B (zh) 2015-02-13 2018-09-25 青岛海信移动通信技术股份有限公司 一种显示提示信息的方法及移动终端
CN105117321B (zh) * 2015-06-30 2018-07-31 浪潮(北京)电子信息产业有限公司 一种进程管理方法及进程管理终端
US20170046357A1 (en) * 2015-08-10 2017-02-16 Lunatech, Llc Collecting And Providing Data For Electronic Vaporizers
US11662796B2 (en) * 2018-06-01 2023-05-30 Apple Inc. User interfaces for indicating battery information on an electronic device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8627029B2 (en) * 2007-03-08 2014-01-07 Sandisk Il Ltd. Methods for managing files according to application
CN102323900A (zh) * 2011-08-31 2012-01-18 国家计算机网络与信息安全管理中心 一种众核环境下基于动态感知的***容错机制
CN102880540A (zh) * 2012-08-27 2013-01-16 南京智达康无线通信科技股份有限公司 一种保障接入控制器在高负载下正常工作的方法

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3410764A4 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11636020B2 (en) 2018-03-09 2023-04-25 Samsung Electronics Co., Ltd Electronic device and on-device method for enhancing user experience in electronic device
CN112732434A (zh) * 2019-10-28 2021-04-30 华为终端有限公司 一种应用管理方法及装置
CN118227743A (zh) * 2024-05-24 2024-06-21 四川凯普顿信息技术股份有限公司 一种算法模型智能调用方法及***

Also Published As

Publication number Publication date
US20190058341A1 (en) 2019-02-21
US10826310B2 (en) 2020-11-03
CN108293197B (zh) 2021-03-23
US20210119460A1 (en) 2021-04-22
CN113157439B (zh) 2024-03-01
CN108293197A (zh) 2018-07-17
EP3410764A4 (en) 2018-12-05
CN113157439A (zh) 2021-07-23
EP3410764B1 (en) 2022-11-09
EP4171105A1 (en) 2023-04-26
EP3410764A1 (en) 2018-12-05
CN113157539A (zh) 2021-07-23
US11431182B2 (en) 2022-08-30

Similar Documents

Publication Publication Date Title
US11431182B2 (en) Resource statistics collection method and apparatus and terminal
US9432314B2 (en) Quick navigation of message conversation history
EP2945058B1 (en) Processing method and device for application program
US9104768B2 (en) Person-based information aggregation
JP5813863B2 (ja) プライベートアプリケーション及びパブリックアプリケーション
WO2021082739A1 (zh) 多任务界面管理方法及电子设备
US20140137020A1 (en) Graphical user interface for navigating applications
WO2015103993A1 (en) Chat window presentation control method and system
TW201814510A (zh) 介面移動方法、裝置、智慧型終端機、伺服器和操作系統
CN111309418A (zh) 一种控件显示方法及电子设备
EP2920693B1 (en) System and method for negotiating control of a shared audio or visual resource
CN111221643A (zh) 任务处理方法和任务处理装置
CN112055072A (zh) 云端音频输入方法、装置、云***、电子设备与存储介质
CN106233237A (zh) 一种处理与应用关联的新消息的方法和装置
WO2019007409A1 (zh) 一种显示方法、装置、智能终端及计算机可读存储介质
CN107402777B (zh) 一种资源更新方法及电子设备
CN111708431A (zh) 人机交互方法、装置、头戴显示设备及存储介质
CN110286836B (zh) 用于移动应用接口元素的设备、方法和图形用户界面
WO2020057241A1 (zh) 应用程序显示的方法、装置及终端设备
CN109451506B (zh) Lte扩容的评估方法、装置、终端及计算机存储介质
WO2020206690A1 (zh) 应用清理方法、装置、存储介质及电子设备
CN110858115A (zh) 应用的显示方法、装置、***、终端及存储介质
CN115878915A (zh) 页面访问方法、装置、存储介质以及计算机设备

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 2016895817

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 2016895817

Country of ref document: EP

Effective date: 20180829

NENP Non-entry into the national phase

Ref country code: DE

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16895817

Country of ref document: EP

Kind code of ref document: A1