WO2017198025A1 - Method, apparatus for processing power consumption of an application programme, calculation device and machine readable storage medium - Google Patents

Method, apparatus for processing power consumption of an application programme, calculation device and machine readable storage medium Download PDF

Info

Publication number
WO2017198025A1
WO2017198025A1 PCT/CN2017/080889 CN2017080889W WO2017198025A1 WO 2017198025 A1 WO2017198025 A1 WO 2017198025A1 CN 2017080889 W CN2017080889 W CN 2017080889W WO 2017198025 A1 WO2017198025 A1 WO 2017198025A1
Authority
WO
WIPO (PCT)
Prior art keywords
power consumption
application
working state
preset time
value
Prior art date
Application number
PCT/CN2017/080889
Other languages
French (fr)
Chinese (zh)
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 广州市动景计算机科技有限公司
Publication of WO2017198025A1 publication Critical patent/WO2017198025A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/32Monitoring with visual or acoustical indication of the functioning of the machine
    • G06F11/324Display of status information
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/32Monitoring with visual or acoustical indication of the functioning of the machine
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3058Monitoring arrangements for monitoring environmental properties or parameters of the computing system or of the computing system component, e.g. monitoring of power, currents, temperature, humidity, position, vibrations
    • G06F11/3062Monitoring arrangements for monitoring environmental properties or parameters of the computing system or of the computing system component, e.g. monitoring of power, currents, temperature, humidity, position, vibrations where the monitored property is the power consumption
    • 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

Definitions

  • the present invention relates to the field of data processing, and in particular to a method, an apparatus, a computing device, and a non-transitory machine readable storage medium for processing power consumption of an application.
  • An embodiment of the present invention provides a processing method, an apparatus, a computing device, and a non-transitory machine-readable storage medium for a power consumption situation of an application program, so as to at least solve the problem that the power consumption abnormal point cannot be quickly located in the related art.
  • the technical problem caused by the problem of the corresponding power consumption problem cannot be solved.
  • a processing method for a power consumption condition of an application program includes: starting from when an application is switched from a foreground working state to a background working state, or from an application working state by a foreground After the switch to the preset working time after the background working state, determining the actual power consumption value of each process in the application in the preset time period; according to the actual power consumption value of each process in the preset time period And determining whether the actual value of the power consumption exceeds the power consumption warning value in the application; if it is determined that the actual value of the power consumption exceeds the power consumption warning value in the application, the generation is performed under the process. All letters Number of related information.
  • a processing apparatus for a power consumption condition of an application comprising: a determining unit, configured to start when an application is switched from a foreground working state to a background working state, or Determining an actual power consumption value of each process in the application in a preset time period from a preset time after the application is switched from the foreground working state to the background working state; the determining unit is configured to be used according to each process described above The foregoing actual power consumption value in the preset time period determines whether there is a process in which the actual power consumption value exceeds the power consumption warning value in the application program; and the generating unit is configured to determine that the actual power consumption value in the application program exceeds In the case of a process that consumes an early warning value, information about all functions running under that process is generated.
  • a computing device comprising: a processor; and a memory having stored thereon executable code for causing the processor to execute the above when the executable code is executed by the processor The processing method described for the power consumption of the application.
  • a non-transitory machine readable storage medium having stored thereon executable code that, when executed by a processor of a computing device, causes the processor to execute The method of processing the power consumption of the application as described.
  • the method of implanting an SDK having a power consumption abnormal positioning function into an application requiring power consumption abnormality detection is started by switching from an application working state to a background working state, or from an application.
  • the program starts from the foreground working state to the preset time after the background working state, and determines the actual power consumption value of each process in the application within the preset time period; according to the actual power consumption of each process in the preset time period
  • the value is used to determine whether there is a process in the application that exceeds the power consumption warning value; if it is determined that there is a process in which the actual power consumption value exceeds the power consumption warning value, all the processes running under the process are generated.
  • the related information of the function achieves the purpose of quickly locating the power consumption abnormal point, thereby realizing the technical effect of timely and accurately solving the corresponding power consumption abnormality problem, thereby solving the problem that the power consumption abnormal point cannot be quickly performed in the related art.
  • the technical problem caused by the positioning cannot solve the corresponding power consumption abnormality problem.
  • FIG. 1 is a block diagram showing the hardware structure of a computer terminal for processing a power consumption condition of an application program according to an embodiment of the present invention
  • FIG. 2 is a flow chart of an optional method for processing a power consumption condition of an application according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram of an optional power consumption detecting system according to an embodiment of the present invention.
  • FIG. 4 is a flow chart of an optional processing method for power consumption of an application according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of an optional processing device for power consumption of an application, in accordance with an embodiment of the present invention.
  • SDK Software Development Kit
  • Thread stack It provides a complete list of all the Java threads that have been created. Depending on the thread stack, you can get information about the name of each thread, its running state, and the name of the function being run.
  • a method embodiment for a method of processing a power consumption condition of an application is provided, and it is noted that the steps illustrated in the flowchart of the accompanying drawings may be in a set of computer executable instructions, such as The execution is performed in a computer system, and although the logical order is shown in the flowcharts, in some cases the steps shown or described may be performed in a different order than the ones described herein.
  • FIG. 1 is a hardware structural block diagram of a computer terminal for processing a power consumption condition of an application program according to an embodiment of the present invention.
  • computer terminal 10 may include one or more (only one shown) processor 102 (processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA)
  • processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA)
  • a memory 104 for storing data
  • a transmission device 106 for communication functions.
  • computer terminal 10 may also include more or fewer components than those shown in FIG. 1, or have a different configuration than that shown in FIG.
  • the memory 104 can be used to store software programs and modules of the application software, such as program instructions/modules corresponding to the processing method for the power consumption of the application in the embodiment of the present invention, and the processor 102 runs the software stored in the memory 104. Programs and modules to perform various functional applications and data processing, that is, to implement the vulnerability detection method of the above application.
  • Memory 104 may include high speed random access memory, and may also include non-volatile memory such as one or more magnetic storage devices, flash memory, or other non-volatile solid state memory.
  • memory 104 may further include memory remotely located relative to processor 102, which may be coupled to computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
  • Transmission device 106 is for receiving or transmitting data via a network.
  • the network specific examples described above may include a wireless network provided by a communication provider of the computer terminal 10.
  • the transmission device 106 includes a Network Interface Controller (NIC) that can be connected to other network devices through a base station to communicate with the Internet.
  • the transmission device 106 can be a Radio Frequency (RF) module for communicating with the Internet wirelessly.
  • NIC Network Interface Controller
  • RF Radio Frequency
  • FIG. 1 is only schematic and the computer is final.
  • the terminal can also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, an applause computer, and a mobile Internet device (MID), a PAD, and the like.
  • FIG. 1 does not limit the structure of the above electronic device.
  • computer terminal 10 may also include more or fewer components (such as a network interface, display device, etc.) than shown in FIG. 1, or have a different configuration than that shown in FIG.
  • FIG. 2 is a flow chart of an alternative processing method for power consumption of an application, in accordance with an embodiment of the present invention. As shown in FIG. 2, the method includes the following steps:
  • Step S202 Starting from when the application is switched from the foreground working state to the background working state, or starting from a preset time after the application is switched from the foreground working state to the background working state, determining that each process in the application is in a preset time period Actual power consumption value;
  • Step S204 judging whether there is a process in the application that the actual value of the power consumption exceeds the power consumption warning value according to the actual power consumption value of each process in the preset time period;
  • Step S206 in the case that it is determined that there is a process in which the actual value of the power consumption exceeds the power consumption warning value, the related information of all functions running under the process is generated.
  • the above steps of the present invention can be implemented by an SDK having a power consumption abnormal positioning function. If you need to detect the power consumption of a specific application running in the background and determine if there is a background power consumption abnormality, you can embed the above SDK into the application. In this way, the SDK can use the above technical solution to detect the background power consumption abnormality of the application. Among them, the SDK itself has the characteristics of small size and extremely low power consumption, and does not introduce any complicated functions. In the process of detecting the power consumption situation, the SDK reads the relevant files of the system recording power, which will not cause The system is new to consumption, so the SDK is a lightweight power consumption detection system.
  • the SDK detects a related system file that records the power consumption information of the SDK application, and passes the CPU and the wake lock ( Wakelock), the use time of components such as sensors, component parameters provided by the supplier (such as the current magnitude of the component), calculate the actual power consumption value of the above components, and compare with the preset power consumption warning value, and then according to The comparison results determine if the SDK application has experienced background power consumption anomalies. Among them, when the background power consumption abnormality occurs, the SDK will automatically capture the relevant log recording the power consumption information.
  • the SDK finds in the detection that the power consumption indicator of a process in the application exceeds the corresponding power consumption warning threshold, then under the process, use Android's Debug.startMethodTracing() and The Debug.stopMethodTracing() function takes two seconds to generate a log file.
  • this log file various information such as the thread stack and timing of all threads in this process in two seconds is recorded. Since these log files contain information such as the thread stack and timing of the thread that caused the power consumption, the program developer can intuitively understand the number of background power consumption abnormalities existing in the current SDK application and the seriousness through the above related logs.
  • Debug.startMethodTracing() and Debug.stopMethodTracing() methods are used when grabbing the power consumption log. These methods will record all the program running details in the log file, and will not miss any suspicious points, which can help development. The person accurately locates the point where the background power consumption is abnormal.
  • the SDK developer when the SDK developer implants the SDK into the corresponding application, it can also set parameters such as the power consumption warning value (ie, the power consumption warning threshold) and the safe running time of the application. Since the application normally processes a part of the transaction in the background, setting the safe running time in advance means that during this time, the power consumption of the application during the safe running time is recorded as normal power consumption, avoiding the occurrence of power consumption. The test result does not match the facts.
  • the power consumption warning value ie, the power consumption warning threshold
  • an SDK having a power consumption abnormal positioning function is implanted into an application that needs to perform power consumption abnormality detection, by starting from an application working state to a background working state, or from an application.
  • the related information achieves the purpose of quickly locating power consumption abnormal points, thereby realizing the technical effect of timely and accurately solving the corresponding power consumption abnormality problem, thereby solving the problem that the power consumption abnormal point cannot be quickly located in the related art.
  • the technical problem caused by the problem of the corresponding power consumption problem cannot be solved.
  • the invention has the characteristics of rapid positioning, and experiments have shown that it can reduce the process of locating and solving the power consumption problem from the original need to consume several days to now consume several hours, and tens of times reduce the error correction cost and manpower. Invest.
  • the embodiment of the present invention quantifies the power consumption of each process in the application by using the specific power consumption value, which can facilitate the developer to grasp the power consumption trend of the application program, thereby setting an accurate power consumption warning value and the like.
  • the above method may further include:
  • the following situations may occur: just after the application is cut to the background, the corresponding user behavior is performed (for example, the user triggers the download operation), that is, the application is re-worked from the background. Switch to the foreground working state; or perform the corresponding user behavior (such as the user triggered the download operation) after cutting the application to the background and passing the preset security running time (such as 10 minutes).
  • the SDK performs the above S2 and S4 to detect whether a user-triggered power interference operation occurs; and/or detects whether the application has been switched from the background working state to the foreground working state.
  • the SDK will abandon the power consumption detecting process and again in the application.
  • the process starts when the foreground working state is switched to the background working state, or the application starts to switch from the foreground working state to the preset working time after the background working state, and the next power consumption detecting process is started.
  • the impact of the power consumption interference triggered by the user and the power consumption change caused by the running state switching of the application itself on the entire detection result can be excluded.
  • determining the actual power consumption value of each process in the application in the preset time period may include:
  • S6 determining, according to a preset time after the application is switched from the foreground working state to the background working state, determining an initial power consumption value of each process in the application;
  • the SDK will be from the system.
  • the application power consumption abnormality in the background is mainly caused by CPU, wakelock, and sensor, it is determined from the preset time after the application is switched from the foreground working state to the background working state, and each process in the application is determined by the above method.
  • the actual power consumption value in the preset time period can accurately locate the background power consumption abnormality of the application.
  • the above method may further include:
  • the following may occur: just after the application is cut to the background, the corresponding user behavior is performed (eg, The user triggers the download operation), that is, re-switches the application from the background working state to the foreground working state; or after the application is cut to the background and has passed the preset security running time (for example, after 10 minutes), the corresponding execution is performed.
  • User behavior (such as a user triggering a download operation).
  • the SDK performs the above S12 and S14 to detect whether a user-triggered power interference operation occurs; and/or to detect whether the application has been switched from the background working state to the foreground working state.
  • the SDK will give up the power consumption when it detects that the user triggered power disturbance operation has occurred and/or the application has been switched from the background working state to the foreground working state. Detecting the process and discarding the relevant power consumption data detected this time, and starting when the application is switched from the foreground working state to the background working state again, or the application starts again from the foreground working state to the background working state. , the next power consumption detection process is turned on.
  • the impact of the power consumption interference triggered by the user and the power consumption change caused by the running state switching of the application itself on the entire detection result can be excluded.
  • the method may further include:
  • S16 Upload the generated information about all the functions running under the process to the server, so that the server classifies the background power consumption abnormality of the application according to the related information of all functions running under the process.
  • the SDK may generate multiple power consumption logs in the process of detecting whether the application has a background power consumption abnormality.
  • the power consumption logs there may be multiple power consumption logs describing a power consumption problem.
  • developers directly use the above logs not only need to view all the data, but also difficult to sum up a total of several types of power consumption problems.
  • the SDK can upload all of them to the specified server, which can use the time according to the method, the time the function takes up the CPU (that is, the time the thread occupies the CPU), etc. Information, classify these power consumption logs, classify the logs by the severity of power consumption and the location of power consumption codes, so that developers can solve the corresponding power consumption problems.
  • the server parses the log files sent by the SDK through anti-aliasing, dmtracedump and other tools, and sorts the points of the power consumption problems indicated by the log files according to the CPU usage time. For example, the server can be specifically parsed into the application. Three functions, and classify the severity of the power consumption problem according to the CPU occupation time. In this way, according to the three functions and the severity of power consumption, the server's log files are sorted, summarized, and displayed, and a download log interface is provided to facilitate developers to solve power consumption problems.
  • the present invention can also be implemented by the SDK power consumption detecting system, and the system module diagram corresponding to the power consumption detecting system is shown in FIG. 3 .
  • the power consumption detecting system includes: a server, a detected program (ie, an application described above), an Android system, and an SDK.
  • the SDK is used to define and calculate the power consumption value, and compare with the power consumption warning value, capture the trace file of each process of the application across the process, upload the trace file to the server;
  • the Android system uses the file to record the application CPU consumption information and
  • the information of the mobile phone component provides a method for capturing the trace file;
  • the detected program is used to provide the timing of the application switching to the background, the safe running time and the information affecting the power consumption behavior, and is implanted into the SDK;
  • the server is used to classify the power consumption problem and Display the classified power consumption problem. When classifying, you can classify the function according to the top three, or classify according to the thread usage time.
  • Step S404 implanting an SDK in the application
  • Step S406 the application switches to the background running state
  • Step S408 the background runs after a certain safe running time (for example, 10 minutes);
  • Step S410 it is determined whether there is power consumption interference behavior (such as download), and if so, step S412A is performed, and if so, step S412B is performed;
  • Step S412A discarding the current detection and waiting for the next detection
  • Step S412B obtaining power consumption data from the system file, and calculating and recording the initial power consumption value
  • Step S414 waiting for 20 minutes, wherein if there is interference power consumption behavior, such as downloading, etc., step S412A is performed, otherwise, step S416 is performed;
  • Step S416 obtaining power consumption data from the system file, and calculating and recording the ending power consumption value
  • Step S418, calculating a difference between the initial power consumption value and the ending power consumption value, and calculating the actual power consumption value of the 20 minutes;
  • Step S420 it is determined whether the power consumption warning value is exceeded, if not, then step S412A is performed, and if so, step S422 is performed;
  • step S422 the system method is invoked to generate a trace file, which is used to obtain information about the power consumption abnormality
  • Step S424 uploading the log to the server
  • Step S428, dividing all the logs occupied by the thread and the longest execution time of the function into one class, indicating the same power consumption problem
  • Step S430 showing the developer and the detailed power consumption function to the developer of the application
  • Step S432 the developer locates and solves the corresponding power consumption problem by using the power consumption function
  • the processing method for the power consumption situation of the application according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course It can be done through hardware, but in many cases the former is a better implementation.
  • the technical solution of the present invention which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk,
  • the optical disc includes a number of instructions for causing a terminal device (which may be a cell phone, a computer, a server, or a network device, etc.) to perform the methods described in various embodiments of the present invention.
  • the apparatus includes: a determining unit 502, configured to Start when the working state is switched to the background working state, or start from the preset time after the application is switched from the foreground working state to the background working state, and determine the actual power consumption value of each process in the application within the preset time period;
  • the unit 504 is configured to determine, according to the actual power consumption value of each process in the preset time period, whether there is a process in the application that exceeds the power consumption warning value; and the generating unit 506 is configured to determine the application.
  • the generating unit 506 is configured to determine the application. In the case where there is a process in which the actual value of the power consumption exceeds the power consumption warning value, information about all functions running under the process is generated.
  • the above steps of the present invention can be implemented by an SDK having a power consumption abnormal positioning function. If you need to detect the power consumption of a specific application running in the background and determine if there is a background power consumption abnormality, you can embed the above SDK into the application. This In this way, the SDK can use the above technical solution to detect the background power consumption abnormality of the application. Among them, the SDK itself has the characteristics of small size and extremely low power consumption, and does not introduce any complicated functions. In the process of detecting the power consumption situation, the SDK reads the relevant files of the system recording power, which will not cause The system is new to consumption, so the SDK is a lightweight power consumption detection system.
  • the SDK detects a related system file that records the power consumption information of the SDK application, and passes the CPU and the wake lock ( Wakelock), the use time of components such as sensors, component parameters provided by the supplier (such as the current magnitude of the component), calculate the actual power consumption value of the above components, and compare with the preset power consumption warning value, and then according to The comparison results determine if the SDK application has experienced background power consumption anomalies. Among them, when the background power consumption abnormality occurs, the SDK will automatically capture the relevant log recording the power consumption information.
  • the SDK finds in the detection that the power consumption indicator of a process in the application exceeds the corresponding power consumption warning threshold, then under the process, Android's Debug.startMethodTracing() and Debug.stopMethodTracing() are used.
  • the function generates a log file for two seconds.
  • various information such as the thread stack and timing of all threads in this process in two seconds is recorded. Since these log files contain information such as the thread stack and timing of the thread that caused the power consumption, the program developer can intuitively understand the number of background power consumption abnormalities existing in the current SDK application and the seriousness through the above related logs.
  • Debug.startMethodTracing() and Debug.stopMethodTracing() methods are used when grabbing the power consumption log. These methods will record all the program running details in the log file, and will not miss any suspicious points, which can help development. The person accurately locates the point where the background power consumption is abnormal.
  • the SDK developer when the SDK developer implants the SDK into the corresponding application, it can also set parameters such as the power consumption warning value (ie, the power consumption warning threshold) and the safe running time of the application. Since the application normally processes a part of the transaction in the background, setting the safe running time in advance means that during this time, the power consumption of the application during the safe running time is recorded as normal power consumption, avoiding the occurrence of power consumption. The test result does not match the facts.
  • the power consumption warning value ie, the power consumption warning threshold
  • an SDK having a power consumption abnormal positioning function is implanted into an application that needs to perform power consumption abnormality detection, by starting from an application working state to a background working state, or from an application.
  • Switch from foreground work status to background work The preset time after the state starts, and the actual power consumption value of each process in the application in the preset time period is determined; according to the actual power consumption value of each process in the preset time period, it is determined whether there is any consumption in the application.
  • the actual value of the electric power exceeds the process of the power consumption warning value; when it is judged that there is a process in which the actual value of the power consumption exceeds the power consumption warning value, the related information of all the functions running under the process is generated, and the fast pair is achieved.
  • the purpose of positioning the power consumption abnormal point is to achieve the technical effect of timely and accurately solving the corresponding power consumption abnormality problem, thereby solving the problem that the corresponding power consumption cannot be solved due to the inability to quickly locate the power consumption abnormal point in the related art.
  • Technical problem with anomalous problems the invention has the characteristics of rapid positioning, and experiments have shown that it can reduce the process of locating and solving the power consumption problem from the original need to consume several days to now consume several hours, and tens of times reduce the error correction cost and manpower. Invest.
  • the embodiment of the present invention quantifies the power consumption of each process in the application by using the specific power consumption value, which can facilitate the developer to grasp the power consumption trend of the application program, thereby setting an accurate power consumption warning value and the like.
  • the foregoing apparatus may further include: a first detecting unit, configured to detect whether a user-triggered power interference operation occurs before determining an actual power consumption value of each process in the application within a preset time period; and/or a second detecting unit, configured to detect whether the application has been switched from the background working state to the foreground working state, wherein the determining unit is further configured to detect that the user-triggered power-interference operation does not occur and/or the application is not in the background working state In the case of switching to the foreground working state, a step of determining the actual power consumption value of each process in the application for a preset period of time is performed.
  • the determining unit may include: a first determining module, configured to determine a starting power consumption value of each process in the application program at a preset time after the application is switched from the foreground working state to the background working state; Determining a module, after a preset period of time, determining an end power consumption value of each process in the application; a calculation module for calculating and starting power consumption value and end power consumption value of each process in the application The difference between the two is taken as the actual power consumption value of the corresponding process within the preset time period.
  • the determining unit may further include: a first detecting module, configured to detect whether a user-triggered power interference operation occurs within a preset time period; and/or a second detecting module, configured to be within a preset time period Detecting whether the application has been switched from the background working state to the foreground working state, wherein the second determining module is further configured to detect that the user does not trigger the power interference operation and/or the application is not in the background within the preset time period
  • the end power consumption of each process in the application is determined. The step of the value.
  • the foregoing apparatus may further include: an uploading unit, configured to: when it is determined that the actual value of the power consumption in the application exceeds the process of the power consumption warning value, and generate information about all functions running under the process After that, the generated information about all the functions running under the process is uploaded to the server, so that the server classifies the background power consumption abnormality of the application according to the related information of all the functions running under the process.
  • an uploading unit configured to: when it is determined that the actual value of the power consumption in the application exceeds the process of the power consumption warning value, and generate information about all functions running under the process After that, the generated information about all the functions running under the process is uploaded to the server, so that the server classifies the background power consumption abnormality of the application according to the related information of all the functions running under the process.
  • the implementation of the device part is similar to the implementation of the method part, and the functions and the achieved technical effects of the functional unit or module of the device part are similar to the functions and technical effects achieved by the steps of the method part. , will not repeat them here.
  • Embodiments of the present invention may provide a computing device, which may be a computer terminal, which may be any one of computer terminal groups.
  • the foregoing computing device may also be a terminal device such as a mobile terminal.
  • the computing device can be the computer terminal shown in FIG.
  • the computing device may be located in at least one network device of the plurality of network devices of the computer network.
  • the computing device may execute the program code of the following steps in the power consumption detecting method of the application program: when the application program is switched from the foreground working state to the background working state, or the application is switched from the foreground working state to the working state. Determining, by a preset time after the background working state, determining an actual power consumption value of each process in the application in a preset time period; according to the actual consumption of each process in the preset time period An electric value, determining whether there is a process in the application that exceeds a power consumption warning value; and determining that a process in which the actual power consumption value exceeds a power consumption warning value is generated in the application Information about all functions running under the process.
  • computing device A may include one or more processors, memory, and other components.
  • the memory can be used to store software programs and modules, such as the processing method for the power consumption of the application program and the program instructions/modules corresponding to the device in the embodiment of the present invention, the processor running the software program stored in the memory and The module, thereby performing various functional applications and data processing, that is, implementing the above-described processing method for the power consumption of the application.
  • the memory may include a high speed random access memory, and may also include a non-volatile memory such as one or more magnetic Storage device, flash memory, or other non-volatile solid state memory.
  • the memory can further include memory remotely located relative to the processor, which can be connected to terminal A via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
  • the processor can call the memory stored information and the application by the transmission device to perform the following steps: detecting whether the user-triggered power interference occurs before determining the actual power consumption value of each process in the application within a preset time period. And/or detecting whether the application has been switched from the background working state to the foreground working state, wherein, when it is detected that the user-triggered power disturbance operation does not occur and/or the application is not switched from the background working state to the foreground working state, Next, the step of determining the actual power consumption value of each process in the application for a preset period of time is performed.
  • the foregoing processor may further execute the following program code: determining, according to a preset time after the application is switched from the foreground working state to the background working state, determining a starting power consumption value of each process in the application; After the time period is set, determine the end power consumption value of each process in the application; calculate and calculate the difference between the initial power consumption value and the end power consumption value of each process in the application as the corresponding process in the preset time period. The actual power consumption value inside.
  • the foregoing processor may further execute the following program code: detecting, during a preset time period, whether a user-triggered power interference operation occurs; and/or detecting whether the application has been used by the background within a preset time period
  • the working state is switched to the foreground working state, wherein, in the preset time period, when the power-interference operation triggered by the user is not detected and/or the application is not switched from the background working state to the foreground working state, the preset is executed.
  • the steps to determine the end power consumption value of each process in the application After the time period, the steps to determine the end power consumption value of each process in the application.
  • the foregoing processor may further execute the following program code: when it is determined that the actual value of the power consumption in the application exceeds the process of the power consumption warning value, and all the functions running under the process are generated. After the related information, the generated information about all the functions running under the process is uploaded to the server, so that the server classifies the background power consumption abnormality of the application according to the related information of all the functions running under the process.
  • the method of implanting an SDK having a power consumption abnormal positioning function into an application requiring power consumption abnormality detection is started by switching from an application working state to a background working state, or from an application.
  • the program starts from the foreground working state to the preset time after the background working state, and determines the actual power consumption value of each process in the application within the preset time period; according to the actual power consumption of each process in the preset time period Value, judged in the application is Whether there is a process in which the actual value of the power consumption exceeds the power consumption warning value; if it is determined that there is a process in which the actual value of the power consumption exceeds the power consumption warning value, the related information of all the functions running under the process is generated.
  • the purpose of quickly locating power consumption abnormal points is achieved, thereby realizing the technical effect of timely and accurately solving the corresponding power consumption abnormality problem, and solving the unresolved corresponding problem in the related art that the power consumption abnormal point cannot be quickly located.
  • the technical problem of the power consumption problem is achieved, thereby realizing the technical effect of timely and accurately solving the corresponding power consumption abnormality problem, and solving the unresolved corresponding problem in the related art that the power consumption abnormal point cannot be quickly located.
  • Embodiments of the present invention also provide a non-transitory machine readable storage medium.
  • the foregoing storage medium may be used to save the program code executed by the processing method for the power consumption condition of the application provided in Embodiment 1 above.
  • the foregoing storage medium may be located in any one of the computer terminal groups in the computer network, or in any one of the mobile terminal groups.
  • the storage medium is configured to store program code for performing the following steps: starting from when the application is switched from the foreground working state to the background working state, or switching from the foreground working state to the application
  • the preset time after the background working state starts, determining the actual power consumption value of each process in the application in the preset time period; determining whether the application is in the application according to the actual power consumption value of each process in the preset time period
  • information about all functions running under the process is generated.
  • the disclosed technical content can be implemented in other ways.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • multiple units or components may be combined or may be Integrate into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, unit or module, and may be electrical or otherwise.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
  • the technical solution of the present invention which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium.
  • a number of instructions are included to cause a computer device (which may be a personal computer, server or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk, and the like. .
  • the method according to the invention can also be implemented as a computer program comprising computer program code instructions for performing the various steps defined above in the above method of the invention.
  • the method according to the invention may also be embodied as a computer program product comprising a computer readable medium on which is stored a computer for performing the above-described functions defined in the above method of the invention program.
  • Those skilled in the art will also appreciate the various exemplary logic blocks, modules, circuits, and circuits described in connection with the disclosure herein.
  • the algorithm steps can be implemented as electronic hardware, computer software, or a combination of both.
  • each block of the flowchart or block diagram can represent a module, a program segment, or a portion of code that includes one or more of the Executable instructions.
  • the functions noted in the blocks may also occur in a different order than the ones in the drawings. For example, two consecutive blocks may be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending upon the functionality involved.
  • each block of the block diagrams and/or flowcharts, and combinations of blocks in the block diagrams and/or flowcharts can be implemented in a dedicated hardware-based system that performs the specified function or operation. Or it can be implemented by a combination of dedicated hardware and computer instructions.

Abstract

Disclosed are a method and apparatus for processing power consumption of an application programme, a calculation device and a non-transitory machine readable storage medium. The method comprises: starting when an application programme switches from a foreground operation state to a background operation state, or from a pre-set time when the application programme switches from the foreground operation state to the background state, to determine an actual power consumption value of each process within a pre-set time period in the application programme (S202); according to the actual power consumption of each process within the pre-set time period, determining whether there is a process, of which the actual value of the power consumption goes beyond a power consumption alarming value, in the application programme (S204); and where it is determined that there is a process, of which the actual value of the power consumption goes beyond the power consumption alarming value, in the application programme, generating relevant information about all functions operated under the process (S206). The present method solves the technical problem in the relevant art of a corresponding abnormal power consumption problem which can not be solved due to the fact that an abnormal point of power consumption cannot be quickly positioned.

Description

用于应用程序的耗电情况的处理方法、装置、计算设备以及机器可读存储介质Processing method, apparatus, computing device, and machine readable storage medium for power consumption of an application 技术领域Technical field
本发明涉及数据处理领域,具体而言,涉及一种用于应用程序的耗电情况的处理方法、装置、计算设备以及非暂时性机器可读存储介质。The present invention relates to the field of data processing, and in particular to a method, an apparatus, a computing device, and a non-transitory machine readable storage medium for processing power consumption of an application.
背景技术Background technique
随着安卓技术的发展,安卓应用的功能越来越多,但与之相关的,耗电量也会越来越大。如何定义和发现耗电异常,提升用户的使用体验,在业界并没有一个统一的标准以及查错方法。With the development of Android technology, Android applications have more and more functions, but related to them, the power consumption will be larger and larger. How to define and discover power consumption anomalies and improve the user experience, there is no unified standard and troubleshooting method in the industry.
以移动安卓应用为例,其一直饱受耗电问题的困扰。例如,当用户反馈耗电异常时,程序开发人员不能快速对耗电异常点进行定位,进而无法解决对应的耗电异常问题。Take the mobile Android application as an example, it has been plagued by power consumption problems. For example, when the user feedbacks the power consumption abnormality, the program developer cannot quickly locate the power consumption abnormal point, and thus cannot solve the corresponding power consumption abnormality problem.
针对上述问题,目前尚未提出有效的解决方案。In response to the above problems, no effective solution has been proposed yet.
发明内容Summary of the invention
本发明实施例提供了一种用于应用程序的耗电情况的处理方法、装置、计算设备以及非暂时性机器可读存储介质,以至少解决相关技术中由于不能快速对耗电异常点进行定位造成的无法解决对应的耗电异常问题的技术问题。An embodiment of the present invention provides a processing method, an apparatus, a computing device, and a non-transitory machine-readable storage medium for a power consumption situation of an application program, so as to at least solve the problem that the power consumption abnormal point cannot be quickly located in the related art. The technical problem caused by the problem of the corresponding power consumption problem cannot be solved.
根据本发明实施例的一个方面,提供了一种用于应用程序的耗电情况的处理方法,包括:从应用程序由前台工作状态切换至后台工作状态时开始,或者从应用程序由前台工作状态切换至后台工作状态后的预设时刻开始,确定上述应用程序中每个进程在预设时间段内的实际耗电值;根据上述每个进程在上述预设时间段内的上述实际耗电值,判断上述应用程序中是否有耗电实际值超出耗电预警值的进程;在判断出上述应用程序中有耗电实际值超出耗电预警值的进程的情况下,生成在该进程下运行的所有函 数的相关信息。According to an aspect of an embodiment of the present invention, a processing method for a power consumption condition of an application program includes: starting from when an application is switched from a foreground working state to a background working state, or from an application working state by a foreground After the switch to the preset working time after the background working state, determining the actual power consumption value of each process in the application in the preset time period; according to the actual power consumption value of each process in the preset time period And determining whether the actual value of the power consumption exceeds the power consumption warning value in the application; if it is determined that the actual value of the power consumption exceeds the power consumption warning value in the application, the generation is performed under the process. All letters Number of related information.
根据本发明实施例的另一方面,还提供了一种用于应用程序的耗电情况的处理装置,包括:确定单元,用于从应用程序由前台工作状态切换至后台工作状态时开始,或者从应用程序由前台工作状态切换至后台工作状态后的预设时刻开始,确定上述应用程序中每个进程在预设时间段内的实际耗电值;判断单元,用于根据上述每个进程在上述预设时间段内的上述实际耗电值,判断上述应用程序中是否有耗电实际值超出耗电预警值的进程;生成单元,用于在判断出上述应用程序中有耗电实际值超出耗电预警值的进程的情况下,生成在该进程下运行的所有函数的相关信息。According to another aspect of the embodiments of the present invention, there is also provided a processing apparatus for a power consumption condition of an application, comprising: a determining unit, configured to start when an application is switched from a foreground working state to a background working state, or Determining an actual power consumption value of each process in the application in a preset time period from a preset time after the application is switched from the foreground working state to the background working state; the determining unit is configured to be used according to each process described above The foregoing actual power consumption value in the preset time period determines whether there is a process in which the actual power consumption value exceeds the power consumption warning value in the application program; and the generating unit is configured to determine that the actual power consumption value in the application program exceeds In the case of a process that consumes an early warning value, information about all functions running under that process is generated.
根据本发明实施例的另一方面,还提供了一种计算设备,包括:处理器;以及存储器,其上存储有可执行代码,当可执行代码被处理器执行时,使处理器执行上文述及的用于应用程序的耗电情况的处理方法。According to another aspect of an embodiment of the present invention, there is also provided a computing device comprising: a processor; and a memory having stored thereon executable code for causing the processor to execute the above when the executable code is executed by the processor The processing method described for the power consumption of the application.
根据本发明实施例的另一方面,还提供了一种非暂时性机器可读存储介质,其上存储有可执行代码,当可执行代码被计算设备的处理器执行时,使处理器执行上文述及的用于应用程序的耗电情况的处理方法。According to another aspect of an embodiment of the present invention, there is also provided a non-transitory machine readable storage medium having stored thereon executable code that, when executed by a processor of a computing device, causes the processor to execute The method of processing the power consumption of the application as described.
在本发明实施例中,采用将具有耗电异常定位功能的SDK植入需要进行耗电异常检测的应用程序的方式,通过从应用程序由前台工作状态切换至后台工作状态时开始,或者从应用程序由前台工作状态切换至后台工作状态后的预设时刻开始,确定应用程序中每个进程在预设时间段内的实际耗电值;根据每个进程在预设时间段内的实际耗电值,判断应用程序中是否有耗电实际值超出耗电预警值的进程;在判断出应用程序中有耗电实际值超出耗电预警值的进程的情况下,生成在该进程下运行的所有函数的相关信息,达到了快速对耗电异常点进行定位的目的,从而实现了及时准确地解决对应的耗电异常问题的技术效果,进而解决了相关技术中由于不能快速对耗电异常点进行定位造成的无法解决对应的耗电异常问题的技术问题。In the embodiment of the present invention, the method of implanting an SDK having a power consumption abnormal positioning function into an application requiring power consumption abnormality detection is started by switching from an application working state to a background working state, or from an application. The program starts from the foreground working state to the preset time after the background working state, and determines the actual power consumption value of each process in the application within the preset time period; according to the actual power consumption of each process in the preset time period The value is used to determine whether there is a process in the application that exceeds the power consumption warning value; if it is determined that there is a process in which the actual power consumption value exceeds the power consumption warning value, all the processes running under the process are generated. The related information of the function achieves the purpose of quickly locating the power consumption abnormal point, thereby realizing the technical effect of timely and accurately solving the corresponding power consumption abnormality problem, thereby solving the problem that the power consumption abnormal point cannot be quickly performed in the related art. The technical problem caused by the positioning cannot solve the corresponding power consumption abnormality problem.
附图说明DRAWINGS
通过结合附图对本公开示例性实施方式进行更详细的描述,本公开的上述以及其它目的、特征和优势将变得更加明显,其中,在本公开示例性实施方式中,相同的参考标号通常代表相同部件。 The above and other objects, features, and advantages of the present invention will become more apparent from the aspects of the embodiments of the invention. The same parts.
图1是本发明实施例的一种用于应用程序的耗电情况的处理方法的计算机终端的硬件结构框图;1 is a block diagram showing the hardware structure of a computer terminal for processing a power consumption condition of an application program according to an embodiment of the present invention;
图2是根据本发明实施例的一种可选的用于应用程序的耗电情况的处理方法的流程图;2 is a flow chart of an optional method for processing a power consumption condition of an application according to an embodiment of the present invention;
图3是根据本发明实施例的一种可选的耗电检测系统的示意图;3 is a schematic diagram of an optional power consumption detecting system according to an embodiment of the present invention;
图4是根据本发明实施例的一种可选的用于应用程序的耗电情况的处理方法的流程图;4 is a flow chart of an optional processing method for power consumption of an application according to an embodiment of the present invention;
图5是根据本发明实施例的一种可选的用于应用程序的耗电情况的处理装置的示意图。5 is a schematic diagram of an optional processing device for power consumption of an application, in accordance with an embodiment of the present invention.
具体实施方式detailed description
下面将参照附图更详细地描述本公开的优选实施方式。虽然附图中显示了本公开的优选实施方式,然而应该理解,可以以各种形式实现本公开而不应被这里阐述的实施方式所限制。相反,提供这些实施方式是为了使本公开更加透彻和完整,并且能够将本公开的范围完整地传达给本领域的技术人员。Preferred embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While the preferred embodiment of the present invention has been shown in the drawings, it is understood that Rather, these embodiments are provided so that this disclosure will be thorough and complete.
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本发明的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。It is to be understood that the terms "first", "second" and the like in the specification and claims of the present invention are used to distinguish similar objects, and are not necessarily used to describe a particular order or order. It is to be understood that the data so used may be interchanged where appropriate, so that the embodiments of the invention described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "comprises" and "comprises" and "the" and "the" are intended to cover a non-exclusive inclusion, for example, a process, method, system, product, or device that comprises a series of steps or units is not necessarily limited to Those steps or units may include other steps or units not explicitly listed or inherent to such processes, methods, products or devices.
以下对本申请设计的专业术语简单介绍如下:The following is a brief introduction to the technical terms designed in this application:
软件开发工具包(Software Development Kit,简称为SDK):一般都是一些软件工程师为特定软件包、软件框架、硬件平台、操作系统等创建应用软件时使用的开发工具的集合。Software Development Kit (SDK): Generally, it is a collection of development tools used by software engineers to create application software for specific software packages, software frameworks, hardware platforms, operating systems, etc.
线程堆栈:它能提供所有被创建出来的Java线程的完整清单.根据线程堆栈可以得到各线程的名称、运行状态以及正在运行的函数名等信息。 Thread stack: It provides a complete list of all the Java threads that have been created. Depending on the thread stack, you can get information about the name of each thread, its running state, and the name of the function being run.
实施例1Example 1
根据本发明实施例,提供了一种用于应用程序的耗电情况的处理方法的方法实施例,需要说明的是,在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行,并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。In accordance with an embodiment of the present invention, a method embodiment for a method of processing a power consumption condition of an application is provided, and it is noted that the steps illustrated in the flowchart of the accompanying drawings may be in a set of computer executable instructions, such as The execution is performed in a computer system, and although the logical order is shown in the flowcharts, in some cases the steps shown or described may be performed in a different order than the ones described herein.
本申请实施例一所提供的方法实施例可以在移动终端、计算机终端或者类似的运算装置中执行。以运行在计算机终端上为例,图1是本发明实施例的一种用于应用程序的耗电情况的处理方法的计算机终端的硬件结构框图。如图1所示,计算机终端10可以包括一个或多个(图中仅示出一个)处理器102(处理器102可以包括但不限于微处理器MCU或可编程逻辑器件FPGA等的处理装置)、用于存储数据的存储器104、以及用于通信功能的传输装置106。本领域普通技术人员可以理解,图1所示的结构仅为示意,其并不对上述电子装置的结构造成限定。例如,计算机终端10还可包括比图1中所示更多或者更少的组件,或者具有与图1所示不同的配置。The method embodiment provided in Embodiment 1 of the present application can be executed in a mobile terminal, a computer terminal or the like. Taking a computer terminal as an example, FIG. 1 is a hardware structural block diagram of a computer terminal for processing a power consumption condition of an application program according to an embodiment of the present invention. As shown in FIG. 1, computer terminal 10 may include one or more (only one shown) processor 102 (processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) A memory 104 for storing data, and a transmission device 106 for communication functions. It will be understood by those skilled in the art that the structure shown in FIG. 1 is merely illustrative and does not limit the structure of the above electronic device. For example, computer terminal 10 may also include more or fewer components than those shown in FIG. 1, or have a different configuration than that shown in FIG.
存储器104可用于存储应用软件的软件程序以及模块,如本发明实施例中的用于应用程序的耗电情况的处理方法对应的程序指令/模块,处理器102通过运行存储在存储器104内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现上述的应用程序的漏洞检测方法。存储器104可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器104可进一步包括相对于处理器102远程设置的存储器,这些远程存储器可以通过网络连接至计算机终端10。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 104 can be used to store software programs and modules of the application software, such as program instructions/modules corresponding to the processing method for the power consumption of the application in the embodiment of the present invention, and the processor 102 runs the software stored in the memory 104. Programs and modules to perform various functional applications and data processing, that is, to implement the vulnerability detection method of the above application. Memory 104 may include high speed random access memory, and may also include non-volatile memory such as one or more magnetic storage devices, flash memory, or other non-volatile solid state memory. In some examples, memory 104 may further include memory remotely located relative to processor 102, which may be coupled to computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
传输装置106用于经由一个网络接收或者发送数据。上述的网络具体实例可包括计算机终端10的通信供应商提供的无线网络。在一个实例中,传输装置106包括一个网络适配器(Network Interface Controller,NIC),其可通过基站与其他网络设备相连从而可与互联网进行通讯。在一个实例中,传输装置106可以为射频(Radio Frequency,RF)模块,其用于通过无线方式与互联网进行通讯。Transmission device 106 is for receiving or transmitting data via a network. The network specific examples described above may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC) that can be connected to other network devices through a base station to communicate with the Internet. In one example, the transmission device 106 can be a Radio Frequency (RF) module for communicating with the Internet wirelessly.
本领域普通技术人员可以理解,图1所示的结构仅为示意,计算机终 端也可以是智能手机(如Android手机、iOS手机等)、平板电脑、掌声电脑以及移动互联网设备(Mobile Internet Devices,MID)、PAD等终端设备。图1其并不对上述电子装置的结构造成限定。例如,计算机终端10还可包括比图1中所示更多或者更少的组件(如网络接口、显示装置等),或者具有与图1所示不同的配置。Those skilled in the art can understand that the structure shown in FIG. 1 is only schematic and the computer is final. The terminal can also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, an applause computer, and a mobile Internet device (MID), a PAD, and the like. FIG. 1 does not limit the structure of the above electronic device. For example, computer terminal 10 may also include more or fewer components (such as a network interface, display device, etc.) than shown in FIG. 1, or have a different configuration than that shown in FIG.
在上述运行环境下,本申请提供了如图2所示的用于应用程序的耗电情况的处理方法。图2是根据本发明实施例的一种可选的用于应用程序的耗电情况的处理方法的流程图。如图2所示,该方法包括如下步骤:In the above operating environment, the present application provides a processing method for power consumption of an application as shown in FIG. 2. 2 is a flow chart of an alternative processing method for power consumption of an application, in accordance with an embodiment of the present invention. As shown in FIG. 2, the method includes the following steps:
步骤S202,从应用程序由前台工作状态切换至后台工作状态时开始,或者从应用程序由前台工作状态切换至后台工作状态后的预设时刻开始,确定应用程序中每个进程在预设时间段内的实际耗电值;Step S202: Starting from when the application is switched from the foreground working state to the background working state, or starting from a preset time after the application is switched from the foreground working state to the background working state, determining that each process in the application is in a preset time period Actual power consumption value;
步骤S204,根据每个进程在预设时间段内的实际耗电值,判断应用程序中是否有耗电实际值超出耗电预警值的进程;Step S204, judging whether there is a process in the application that the actual value of the power consumption exceeds the power consumption warning value according to the actual power consumption value of each process in the preset time period;
步骤S206,在判断出应用程序中有耗电实际值超出耗电预警值的进程的情况下,生成在该进程下运行的所有函数的相关信息。Step S206, in the case that it is determined that there is a process in which the actual value of the power consumption exceeds the power consumption warning value, the related information of all functions running under the process is generated.
需要说明的是,本发明的上述步骤可以通过具有耗电异常定位功能的SDK来实现。如果需要检测某个指定应用程序在后台运行时的耗电情况,确定其是否存在后台耗电异常,则可以将上述SDK植入该应用程序中。这样,SDK就可以使用上述技术方案,检测该应用程序的后台耗电异常情况。其中,SDK本身具有体积小、耗电量极小的特点,不会引入任何复杂的功能,而且在检测耗电情况的过程中,SDK读取的都是系统记录电量的相关文件,不会引起系统新的消耗,因此SDK是一个轻量级的耗电检测系统。It should be noted that the above steps of the present invention can be implemented by an SDK having a power consumption abnormal positioning function. If you need to detect the power consumption of a specific application running in the background and determine if there is a background power consumption abnormality, you can embed the above SDK into the application. In this way, the SDK can use the above technical solution to detect the background power consumption abnormality of the application. Among them, the SDK itself has the characteristics of small size and extremely low power consumption, and does not introduce any complicated functions. In the process of detecting the power consumption situation, the SDK reads the relevant files of the system recording power, which will not cause The system is new to consumption, so the SDK is a lightweight power consumption detection system.
具体地,从用户开始使用植入了SDK的应用程序(以下称为SDK应用程序)时开始,该SDK会检测记录了SDK应用程序的耗电信息的相关系统文件,并通过CPU、唤醒锁(wakelock)、传感器等部件的使用时间、供应商提供的元件参数(如元件的电流大小等值),计算出上述部件的耗电实际值,并与预先设定的耗电预警值对比,进而根据对比结果确定SDK应用程序是否已出现后台耗电异常。其中,当出现后台耗电异常时,SDK会自动抓取记录有耗电信息的相关日志。例如,如果SDK在检测中发现应用程序中某个进程的耗电指标超过了对应的耗电预警阀值,则会在该进程下,使用安卓系统的Debug.startMethodTracing()和 Debug.stopMethodTracing()函数两秒钟,生成一个日志文件。在这个日志文件中,记录了这个进程在两秒内的所有线程对应的线程堆栈和时序等多种信息。由于这些日志文件中包含了引发耗电的线程对应的线程堆栈和时序等信息,因此程序开发人员通过上述相关日志可以直观地了解当前SDK应用程序中存在的后台耗电异常问题的数量及其严重程度,并且可以找出出现耗电异常问题的线程堆栈,进而能够快速解决当前SDK应用程序中存在的后台耗电异常问题。并且,抓取耗电日志时使用了Debug.startMethodTracing()和Debug.stopMethodTracing()方法,这些方法会在日志文件中记录所有的程序运行细节,不会漏过任何一个可疑点,这样可以帮助开发人员准确定位出现后台耗电异常的点。Specifically, when the user starts using an application (hereinafter referred to as an SDK application) in which the SDK is implanted, the SDK detects a related system file that records the power consumption information of the SDK application, and passes the CPU and the wake lock ( Wakelock), the use time of components such as sensors, component parameters provided by the supplier (such as the current magnitude of the component), calculate the actual power consumption value of the above components, and compare with the preset power consumption warning value, and then according to The comparison results determine if the SDK application has experienced background power consumption anomalies. Among them, when the background power consumption abnormality occurs, the SDK will automatically capture the relevant log recording the power consumption information. For example, if the SDK finds in the detection that the power consumption indicator of a process in the application exceeds the corresponding power consumption warning threshold, then under the process, use Android's Debug.startMethodTracing() and The Debug.stopMethodTracing() function takes two seconds to generate a log file. In this log file, various information such as the thread stack and timing of all threads in this process in two seconds is recorded. Since these log files contain information such as the thread stack and timing of the thread that caused the power consumption, the program developer can intuitively understand the number of background power consumption abnormalities existing in the current SDK application and the seriousness through the above related logs. The extent, and the thread stack that has the problem of power consumption abnormality can be found, so that the background power consumption abnormality existing in the current SDK application can be quickly solved. Also, the Debug.startMethodTracing() and Debug.stopMethodTracing() methods are used when grabbing the power consumption log. These methods will record all the program running details in the log file, and will not miss any suspicious points, which can help development. The person accurately locates the point where the background power consumption is abnormal.
另外,程序开发人员在将SDK植入对应的应用程序时,同时可以设置该应用程序的耗电预警值(即耗电预警阈值)、安全运行时间等参数。由于应用程序在后台一般也会正常处理一部分事务,因此预先设置安全运行时间,可以是指在这段时间内,将应用程序在安全运行时间内的耗电量记为正常耗电量,避免出现检测结果与事实不符的情况。In addition, when the SDK developer implants the SDK into the corresponding application, it can also set parameters such as the power consumption warning value (ie, the power consumption warning threshold) and the safe running time of the application. Since the application normally processes a part of the transaction in the background, setting the safe running time in advance means that during this time, the power consumption of the application during the safe running time is recorded as normal power consumption, avoiding the occurrence of power consumption. The test result does not match the facts.
通过本发明实施例,采用将具有耗电异常定位功能的SDK植入需要进行耗电异常检测的应用程序的方式,通过从应用程序由前台工作状态切换至后台工作状态时开始,或者从应用程序由前台工作状态切换至后台工作状态后的预设时刻开始,确定应用程序中每个进程在预设时间段内的实际耗电值;根据每个进程在预设时间段内的实际耗电值,判断应用程序中是否有耗电实际值超出耗电预警值的进程;在判断出应用程序中有耗电实际值超出耗电预警值的进程的情况下,生成在该进程下运行的所有函数的相关信息,达到了快速对耗电异常点进行定位的目的,从而实现了及时准确地解决对应的耗电异常问题的技术效果,进而解决了相关技术中由于不能快速对耗电异常点进行定位造成的无法解决对应的耗电异常问题的技术问题。另外,本发明具有定位迅速的特点,实验表明其可以将定位和解决耗电问题这个流程从原来需要消耗几天时间降低到了现在需要消耗几个小时,数十倍的减少了纠错成本和人力投入。同时,本发明实施例通过使用具体耗电值来量化应用程序中各进程的耗电情况,可以便于开发人员掌握应用程序的耗电趋势,从而设定准确的耗电预警值等。According to the embodiment of the present invention, an SDK having a power consumption abnormal positioning function is implanted into an application that needs to perform power consumption abnormality detection, by starting from an application working state to a background working state, or from an application. Starting from a preset time after the foreground working state is switched to the background working state, determining the actual power consumption value of each process in the application in the preset time period; according to the actual power consumption value of each process in the preset time period , judging whether there is a process in the application that the actual value of the power consumption exceeds the power consumption warning value; when it is determined that the actual value of the power consumption in the application exceeds the process of the power consumption warning value, all functions running under the process are generated. The related information achieves the purpose of quickly locating power consumption abnormal points, thereby realizing the technical effect of timely and accurately solving the corresponding power consumption abnormality problem, thereby solving the problem that the power consumption abnormal point cannot be quickly located in the related art. The technical problem caused by the problem of the corresponding power consumption problem cannot be solved. In addition, the invention has the characteristics of rapid positioning, and experiments have shown that it can reduce the process of locating and solving the power consumption problem from the original need to consume several days to now consume several hours, and tens of times reduce the error correction cost and manpower. Invest. At the same time, the embodiment of the present invention quantifies the power consumption of each process in the application by using the specific power consumption value, which can facilitate the developer to grasp the power consumption trend of the application program, thereby setting an accurate power consumption warning value and the like.
进一步地,在确定应用程序中每个进程在预设时间段内的实际耗电值 之前,上述方法还可以包括:Further, determining the actual power consumption value of each process in the preset time period in the application Previously, the above method may further include:
S2,检测是否出现用户触发的电量干扰操作;和/或S2, detecting whether a user-triggered power interference operation occurs; and/or
S4,检测应用程序是否已由后台工作状态切换至前台工作状态。S4, detecting whether the application has been switched from the background working state to the foreground working state.
其中,在检测到未出现用户触发的电量干扰操作和/或应用程序未由后台工作状态切换至前台工作状态的情况下,执行确定应用程序中每个进程在预设时间段内的实际耗电值的步骤。Wherein, in the case that it is detected that the user-triggered power interference operation does not occur and/or the application is not switched from the background working state to the foreground working state, performing actual power consumption determination for each process in the application within a preset time period is performed. The step of the value.
例如,用户使用应用程序的过程中,可以会出现以下情况:刚将应用切到后台,就执行了对应的用户行为的操作(如用户触发了下载操作),即重新将应用程序由后台工作状态切换至前台工作状态;或者在将应用切到后台并经过了预先设定的安全运行时间(如10分钟后),执行了对应的用户行为的操作(如用户触发了下载操作)。对应地,SDK就会执行上述S2和S4,检测是否出现用户触发的电量干扰操作;和/或检测应用程序是否已由后台工作状态切换至前台工作状态。For example, in the process of using the application, the following situations may occur: just after the application is cut to the background, the corresponding user behavior is performed (for example, the user triggers the download operation), that is, the application is re-worked from the background. Switch to the foreground working state; or perform the corresponding user behavior (such as the user triggered the download operation) after cutting the application to the background and passing the preset security running time (such as 10 minutes). Correspondingly, the SDK performs the above S2 and S4 to detect whether a user-triggered power interference operation occurs; and/or detects whether the application has been switched from the background working state to the foreground working state.
需要说明的是,在检测到已出现用户触发的电量干扰操作和/或应用程序已由后台工作状态切换至前台工作状态的情况下,SDK会放弃本次耗电检测流程,并在应用程序再次由前台工作状态切换至后台工作状态时开始,或者应用程序再次由前台工作状态切换至后台工作状态后的预设时刻开始,开启下次耗电检测流程。It should be noted that, in the case that it is detected that the user-triggered power disturbance operation has occurred and/or the application has been switched from the background working state to the foreground working state, the SDK will abandon the power consumption detecting process and again in the application. The process starts when the foreground working state is switched to the background working state, or the application starts to switch from the foreground working state to the preset working time after the background working state, and the next power consumption detecting process is started.
通过本发明实施例,可以排除用户触发的电量干扰操作以及应用程序本身发生运行状态切换导致的耗电变化对整个检测结果的影响。Through the embodiment of the present invention, the impact of the power consumption interference triggered by the user and the power consumption change caused by the running state switching of the application itself on the entire detection result can be excluded.
进一步地,从应用程序由前台工作状态切换至后台工作状态后的预设时刻开始,确定应用程序中每个进程在预设时间段内的实际耗电值可以包括:Further, starting from a preset time after the application is switched from the foreground working state to the background working state, determining the actual power consumption value of each process in the application in the preset time period may include:
S6,在应用程序由前台工作状态切换至后台工作状态后的预设时刻,确定应用程序中每个进程的起始耗电值;S6: determining, according to a preset time after the application is switched from the foreground working state to the background working state, determining an initial power consumption value of each process in the application;
S8,经过预设时间段后,确定应用程序中每个进程的结束耗电值;S8, after a preset period of time, determining an end power consumption value of each process in the application;
S10,计算并将应用程序中每个进程的起始耗电值与结束耗电值间的差值作为对应进程在预设时间段内的实际耗电值。S10. Calculate and compare the difference between the initial power consumption value and the end power consumption value of each process in the application as the actual power consumption value of the corresponding process in the preset time period.
具体地,从应用程序由前台工作状态切换至后台工作状态后的预设时刻开始,在确定应用程序中每个进程在预设时间段内的实际耗电值的过程中,SDK会从系统的"/proc/"+pid+"/stat"中读取CPU的运行时间等数据, 从系统的/data/system/batterystats.bin文件中读取唤醒锁(wakelock)和传感器的使用时间等数据,从device///frameworks/base/core/res/res/xml/power_profile.xml文件中读取终端设备(如手机)的硬件对应电流参数,然后通过公式“耗电量=CPU的运行时间×CPU元件运行态电流值+wakelock的使用时间×CPU元件唤醒态电流值+传感器的使用时间×传感器电流值”计算,得到一个耗电初始值(起始耗电值)。进一步地,从开始计时起,经过20分钟后,再从通过公式执行一次计算操作,算出结束一个耗电值。两次计算结果经过相减运算,可以得出这20分钟内该应用程序的每一个进程的耗电指标。Specifically, starting from a preset time after the application is switched from the foreground working state to the background working state, in determining the actual power consumption value of each process in the preset time period in the application, the SDK will be from the system. "/proc/"+pid+"/stat" reads data such as the running time of the CPU, Read data such as wakelock and sensor usage time from the system's /data/system/batterystats.bin file, from device///frameworks/base/core/res/res/xml/power_profile.xml Read the hardware corresponding current parameters of the terminal device (such as mobile phone), and then pass the formula "power consumption = CPU running time × CPU component operating state current value + wakelock usage time × CPU component wake-up state current value + sensor usage time × Sensor current value is calculated to obtain an initial power consumption value (initial power consumption value). Further, from the start of the counting, after 20 minutes have elapsed, a calculation operation is performed by the formula to calculate the end of one power consumption value. The result of the two calculations is subtracted, and the power consumption index of each process of the application in the 20 minutes can be obtained.
由于应用程序在后台耗电异常主要是CPU、wakelock和传感器等导致的,因此从应用程序由前台工作状态切换至后台工作状态后的预设时刻开始,通过上述方法确定应用程序中每个进程在预设时间段内的实际耗电值,可以准确地定位出应用程序的后台耗电异常问题。Since the application power consumption abnormality in the background is mainly caused by CPU, wakelock, and sensor, it is determined from the preset time after the application is switched from the foreground working state to the background working state, and each process in the application is determined by the above method. The actual power consumption value in the preset time period can accurately locate the background power consumption abnormality of the application.
进一步地,上述方法还可以包括:Further, the above method may further include:
S12,在预设时间段内,检测是否出现用户触发的电量干扰操作;和/或S12. In the preset time period, detecting whether a user-triggered power interference operation occurs; and/or
S14,在预设时间段内,检测应用程序是否已由后台工作状态切换至前台工作状态。S14: Detect whether the application has been switched from the background working state to the foreground working state within a preset time period.
其中,在预设时间段内,检测到未出现用户触发的电量干扰操作和/或应用程序未由后台工作状态切换至前台工作状态的情况下,执行经过预设时间段后,确定应用程序中每个进程的结束耗电值的步骤。Wherein, in the preset time period, when it is detected that the user-triggered power interference operation does not occur and/or the application program is not switched from the background working state to the foreground working state, after executing the preset time period, determining the application The step of ending the power consumption value of each process.
也即,在确定应用程序中每个进程在预设时间段内的实际耗电值的过程中,可能会出现以下情况:刚将应用切到后台,就执行了对应的用户行为的操作(如用户触发了下载操作),即重新将应用程序由后台工作状态切换至前台工作状态;或者在将应用切到后台并经过了预先设定的安全运行时间(如10分钟后),执行了对应的用户行为的操作(如用户触发了下载操作)。对应地,SDK就会执行上述S12和S14,检测是否出现用户触发的电量干扰操作;和/或检测应用程序是否已由后台工作状态切换至前台工作状态。That is, in determining the actual power consumption value of each process in the application within the preset time period, the following may occur: just after the application is cut to the background, the corresponding user behavior is performed (eg, The user triggers the download operation), that is, re-switches the application from the background working state to the foreground working state; or after the application is cut to the background and has passed the preset security running time (for example, after 10 minutes), the corresponding execution is performed. User behavior (such as a user triggering a download operation). Correspondingly, the SDK performs the above S12 and S14 to detect whether a user-triggered power interference operation occurs; and/or to detect whether the application has been switched from the background working state to the foreground working state.
需要说明的是,在检测到已出现用户触发的电量干扰操作和/或应用程序已由后台工作状态切换至前台工作状态的情况下,SDK会放弃本次耗电 检测流程并丢弃本次检测到的相关耗电数据,并在应用程序再次由前台工作状态切换至后台工作状态时开始,或者应用程序再次由前台工作状态切换至后台工作状态后的预设时刻开始,开启下次耗电检测流程。It should be noted that the SDK will give up the power consumption when it detects that the user triggered power disturbance operation has occurred and/or the application has been switched from the background working state to the foreground working state. Detecting the process and discarding the relevant power consumption data detected this time, and starting when the application is switched from the foreground working state to the background working state again, or the application starts again from the foreground working state to the background working state. , the next power consumption detection process is turned on.
通过本发明实施例,可以排除用户触发的电量干扰操作以及应用程序本身发生运行状态切换导致的耗电变化对整个检测结果的影响。Through the embodiment of the present invention, the impact of the power consumption interference triggered by the user and the power consumption change caused by the running state switching of the application itself on the entire detection result can be excluded.
进一步地,在判断出应用程序中有耗电实际值超出耗电预警值的进程的情况下,且在生成在该进程下运行的所有函数的相关信息之后,上述方法还可以包括:Further, after determining that there is a process in the application that exceeds the power consumption warning value, and after generating related information of all functions running under the process, the method may further include:
S16,将生成的在该进程下运行的所有函数的相关信息上传至服务器,以便服务器根据在该进程下运行的所有函数的相关信息,对应用程序的后台耗电异常情况进行分类处理。S16: Upload the generated information about all the functions running under the process to the server, so that the server classifies the background power consumption abnormality of the application according to the related information of all functions running under the process.
具体地,由于SDK在检测应用程序是否存在后台耗电异常的过程中,可以能会生成多个耗电日志,在这些耗电日志中,可能存在多个耗电日志描述一个耗电问题的现象,在这种情况,开发人员直接使用上述日志,不仅需要查看所有的数据资料,而且难以归纳出一共出现了几类耗电问题。针对该问题,尤其在面对大量的耗电日志的情况下,SDK可以将其全部上传至指定的服务器,该服务器可以依照方法使用时间、函数占用CPU的时间(即线程占用CPU的时间)等信息,对这些耗电日志进行分类处理,将日志以耗电严重程度和耗电代码的位置进行分类,以便于开发人员解决对应的耗电问题。Specifically, the SDK may generate multiple power consumption logs in the process of detecting whether the application has a background power consumption abnormality. In the power consumption logs, there may be multiple power consumption logs describing a power consumption problem. In this case, developers directly use the above logs, not only need to view all the data, but also difficult to sum up a total of several types of power consumption problems. In response to this problem, especially in the case of a large number of power consumption logs, the SDK can upload all of them to the specified server, which can use the time according to the method, the time the function takes up the CPU (that is, the time the thread occupies the CPU), etc. Information, classify these power consumption logs, classify the logs by the severity of power consumption and the location of power consumption codes, so that developers can solve the corresponding power consumption problems.
具体地,服务器会通过反混淆、dmtracedump等其他工具,解析SDK发来的日志文件,并将日志文件所提示的耗电问题的点,按照CPU使用时间排序,例如,可以具体解析为应用中的三个函数,并根据CPU占用时间分类耗电问题的严重程度。这样,根据三个函数以及耗电严重程度,将服务器的日志文件分类、归拢,并且进行展示,并且提供下载日志接口,方便开发人员解决耗电问题。Specifically, the server parses the log files sent by the SDK through anti-aliasing, dmtracedump and other tools, and sorts the points of the power consumption problems indicated by the log files according to the CPU usage time. For example, the server can be specifically parsed into the application. Three functions, and classify the severity of the power consumption problem according to the CPU occupation time. In this way, according to the three functions and the severity of power consumption, the server's log files are sorted, summarized, and displayed, and a download log interface is provided to facilitate developers to solve power consumption problems.
需要说明的是,本发明提供的上述实施方案已实验性地投入UC浏览器的使用中,在使用的2个月时间内,发现了20多个严重的耗电问题,其中大部分都已经快速地解决了。对于用户而言,有效地降低了用户对耗电的反馈,提升了用户体验;对于开发人员而言,有效地缩短了耗电问题的发现、排查、反馈的周期,提高了开发效率。 It should be noted that the foregoing embodiments provided by the present invention have been experimentally put into use in the UC browser, and more than 20 serious power consumption problems have been discovered within two months of use, most of which have been rapidly The ground is solved. For the user, the user's feedback on power consumption is effectively reduced, and the user experience is improved; for the developer, the cycle of discovery, troubleshooting, and feedback of the power consumption problem is effectively shortened, and the development efficiency is improved.
需要说明的是,本发明还可以通过SDK耗电检测系统来实现,该耗电检测系统对应的系统模块图如图3所示。其中,耗电检测系统包括:服务器、被检测程序(即前文所述的应用程序)、安卓系统和SDK。SDK用于定义和计算耗电值,并与耗电预警值比较,跨进程抓取应用的每个进程的trace文件,将trace文件上传至服务器;安卓系统用于使用文件记录应用CPU消耗信息和手机元件的信息,提供抓取trace文件的方法;被检测程序用于提供应用切换至后台的时机、安全运行时间和影响耗电行为的信息,被植入SDK;服务器用于分类耗电问题并展示分类好的耗电问题,分类时,可以按照函数使用时间占前三的进行分类,或者按照线程使用时间进行分类。It should be noted that the present invention can also be implemented by the SDK power consumption detecting system, and the system module diagram corresponding to the power consumption detecting system is shown in FIG. 3 . The power consumption detecting system includes: a server, a detected program (ie, an application described above), an Android system, and an SDK. The SDK is used to define and calculate the power consumption value, and compare with the power consumption warning value, capture the trace file of each process of the application across the process, upload the trace file to the server; the Android system uses the file to record the application CPU consumption information and The information of the mobile phone component provides a method for capturing the trace file; the detected program is used to provide the timing of the application switching to the background, the safe running time and the information affecting the power consumption behavior, and is implanted into the SDK; the server is used to classify the power consumption problem and Display the classified power consumption problem. When classifying, you can classify the function according to the top three, or classify according to the thread usage time.
以下结合图4以一个具体实施例详细阐述本发明:The present invention will be described in detail below with reference to FIG. 4 in a specific embodiment:
步骤S402,开始;Step S402, starting;
步骤S404,在应用程序中植入SDK;Step S404, implanting an SDK in the application;
步骤S406,应用程序切换至后台运行状态;Step S406, the application switches to the background running state;
步骤S408,后台运行经过一定的安全运行时间(如10分钟);Step S408, the background runs after a certain safe running time (for example, 10 minutes);
步骤S410,判断是否有耗电干扰行为(如下载),若是,则执行步骤S412A,若是,则执行步骤S412B;Step S410, it is determined whether there is power consumption interference behavior (such as download), and if so, step S412A is performed, and if so, step S412B is performed;
步骤S412A,放弃本次检测,等待下次检测;Step S412A, discarding the current detection and waiting for the next detection;
步骤S412B,从系统文件中获取耗电数据,计算并记录起始耗电值;Step S412B, obtaining power consumption data from the system file, and calculating and recording the initial power consumption value;
步骤S414,等待20分钟,其中,若期间有干扰耗电行为,如下载等,则执行步骤S412A,否则,则执行步骤S416;Step S414, waiting for 20 minutes, wherein if there is interference power consumption behavior, such as downloading, etc., step S412A is performed, otherwise, step S416 is performed;
步骤S416,从系统文件中获取耗电数据,计算并记录结束耗电值;Step S416, obtaining power consumption data from the system file, and calculating and recording the ending power consumption value;
步骤S418,计算起始耗电值与结束耗电值的差,算出这20分钟的耗电实际值;Step S418, calculating a difference between the initial power consumption value and the ending power consumption value, and calculating the actual power consumption value of the 20 minutes;
步骤S420,判断是否超出耗电预警值,若否,则执行步骤S412A,若是,则执行步骤S422;Step S420, it is determined whether the power consumption warning value is exceeded, if not, then step S412A is performed, and if so, step S422 is performed;
步骤S422,调用系统方法,生成trace文件,用于获取耗电异常的信息;In step S422, the system method is invoked to generate a trace file, which is used to obtain information about the power consumption abnormality;
步骤S424,将日志上传给服务器;Step S424, uploading the log to the server;
步骤S426,服务器抓取每个日志中线程占用的时间和函数执行时间最长的三个; Step S426, the server captures the time occupied by the thread in each log and the longest execution time of the function;
步骤S428,将线程占用的时间和函数执行时间最长的所有日志分为一类,表示同一个耗电问题;Step S428, dividing all the logs occupied by the thread and the longest execution time of the function into one class, indicating the same power consumption problem;
步骤S430,向应用程序的开发者展示这些问题以及详细的耗电函数;Step S430, showing the developer and the detailed power consumption function to the developer of the application;
步骤S432,开发人员通过这些耗电函数定位并解决对应的耗电问题;Step S432, the developer locates and solves the corresponding power consumption problem by using the power consumption function;
步骤S434,结束。Step S434, ending.
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明并不受所描述的动作顺序的限制,因为依据本发明,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本发明所必须的。It should be noted that, for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations, but those skilled in the art should understand that the present invention is not limited by the described action sequence. Because certain steps may be performed in other sequences or concurrently in accordance with the present invention. In addition, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的用于应用程序的耗电情况的处理方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the processing method for the power consumption situation of the application according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course It can be done through hardware, but in many cases the former is a better implementation. Based on such understanding, the technical solution of the present invention, which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk, The optical disc includes a number of instructions for causing a terminal device (which may be a cell phone, a computer, a server, or a network device, etc.) to perform the methods described in various embodiments of the present invention.
实施例2Example 2
根据本发明实施例,还提供了一种用于实施上述用于应用程序的耗电情况的处理方法的装置,如图5所示,该装置包括:确定单元502,用于从应用程序由前台工作状态切换至后台工作状态时开始,或者从应用程序由前台工作状态切换至后台工作状态后的预设时刻开始,确定应用程序中每个进程在预设时间段内的实际耗电值;判断单元504,用于根据每个进程在预设时间段内的实际耗电值,判断应用程序中是否有耗电实际值超出耗电预警值的进程;生成单元506,用于在判断出应用程序中有耗电实际值超出耗电预警值的进程的情况下,生成在该进程下运行的所有函数的相关信息。According to an embodiment of the present invention, there is further provided an apparatus for implementing the above-described processing method for a power consumption condition of an application program. As shown in FIG. 5, the apparatus includes: a determining unit 502, configured to Start when the working state is switched to the background working state, or start from the preset time after the application is switched from the foreground working state to the background working state, and determine the actual power consumption value of each process in the application within the preset time period; The unit 504 is configured to determine, according to the actual power consumption value of each process in the preset time period, whether there is a process in the application that exceeds the power consumption warning value; and the generating unit 506 is configured to determine the application. In the case where there is a process in which the actual value of the power consumption exceeds the power consumption warning value, information about all functions running under the process is generated.
需要说明的是,本发明的上述步骤可以通过具有耗电异常定位功能的SDK来实现。如果需要检测某个指定应用程序在后台运行时的耗电情况,确定其是否存在后台耗电异常,则可以将上述SDK植入该应用程序中。这 样,SDK就可以使用上述技术方案,检测该应用程序的后台耗电异常情况。其中,SDK本身具有体积小、耗电量极小的特点,不会引入任何复杂的功能,而且在检测耗电情况的过程中,SDK读取的都是系统记录电量的相关文件,不会引起系统新的消耗,因此SDK是一个轻量级的耗电检测系统。It should be noted that the above steps of the present invention can be implemented by an SDK having a power consumption abnormal positioning function. If you need to detect the power consumption of a specific application running in the background and determine if there is a background power consumption abnormality, you can embed the above SDK into the application. This In this way, the SDK can use the above technical solution to detect the background power consumption abnormality of the application. Among them, the SDK itself has the characteristics of small size and extremely low power consumption, and does not introduce any complicated functions. In the process of detecting the power consumption situation, the SDK reads the relevant files of the system recording power, which will not cause The system is new to consumption, so the SDK is a lightweight power consumption detection system.
具体地,从用户开始使用植入了SDK的应用程序(以下称为SDK应用程序)时开始,该SDK会检测记录了SDK应用程序的耗电信息的相关系统文件,并通过CPU、唤醒锁(wakelock)、传感器等部件的使用时间、供应商提供的元件参数(如元件的电流大小等值),计算出上述部件的耗电实际值,并与预先设定的耗电预警值对比,进而根据对比结果确定SDK应用程序是否已出现后台耗电异常。其中,当出现后台耗电异常时,SDK会自动抓取记录有耗电信息的相关日志。例如,如果SDK在检测中发现应用程序中某个进程的耗电指标超过了对应的耗电预警阀值,则会在该进程下,使用安卓系统的Debug.startMethodTracing()和Debug.stopMethodTracing()函数两秒钟,生成一个日志文件。在这个日志文件中,记录了这个进程在两秒内的所有线程对应的线程堆栈和时序等多种信息。由于这些日志文件中包含了引发耗电的线程对应的线程堆栈和时序等信息,因此程序开发人员通过上述相关日志可以直观地了解当前SDK应用程序中存在的后台耗电异常问题的数量及其严重程度,并且可以找出出现耗电异常问题的线程堆栈,进而能够快速解决当前SDK应用程序中存在的后台耗电异常问题。并且,抓取耗电日志时使用了Debug.startMethodTracing()和Debug.stopMethodTracing()方法,这些方法会在日志文件中记录所有的程序运行细节,不会漏过任何一个可疑点,这样可以帮助开发人员准确定位出现后台耗电异常的点。Specifically, when the user starts using an application (hereinafter referred to as an SDK application) in which the SDK is implanted, the SDK detects a related system file that records the power consumption information of the SDK application, and passes the CPU and the wake lock ( Wakelock), the use time of components such as sensors, component parameters provided by the supplier (such as the current magnitude of the component), calculate the actual power consumption value of the above components, and compare with the preset power consumption warning value, and then according to The comparison results determine if the SDK application has experienced background power consumption anomalies. Among them, when the background power consumption abnormality occurs, the SDK will automatically capture the relevant log recording the power consumption information. For example, if the SDK finds in the detection that the power consumption indicator of a process in the application exceeds the corresponding power consumption warning threshold, then under the process, Android's Debug.startMethodTracing() and Debug.stopMethodTracing() are used. The function generates a log file for two seconds. In this log file, various information such as the thread stack and timing of all threads in this process in two seconds is recorded. Since these log files contain information such as the thread stack and timing of the thread that caused the power consumption, the program developer can intuitively understand the number of background power consumption abnormalities existing in the current SDK application and the seriousness through the above related logs. The extent, and the thread stack that has the problem of power consumption abnormality can be found, so that the background power consumption abnormality existing in the current SDK application can be quickly solved. Also, the Debug.startMethodTracing() and Debug.stopMethodTracing() methods are used when grabbing the power consumption log. These methods will record all the program running details in the log file, and will not miss any suspicious points, which can help development. The person accurately locates the point where the background power consumption is abnormal.
另外,程序开发人员在将SDK植入对应的应用程序时,同时可以设置该应用程序的耗电预警值(即耗电预警阈值)、安全运行时间等参数。由于应用程序在后台一般也会正常处理一部分事务,因此预先设置安全运行时间,可以是指在这段时间内,将应用程序在安全运行时间内的耗电量记为正常耗电量,避免出现检测结果与事实不符的情况。In addition, when the SDK developer implants the SDK into the corresponding application, it can also set parameters such as the power consumption warning value (ie, the power consumption warning threshold) and the safe running time of the application. Since the application normally processes a part of the transaction in the background, setting the safe running time in advance means that during this time, the power consumption of the application during the safe running time is recorded as normal power consumption, avoiding the occurrence of power consumption. The test result does not match the facts.
通过本发明实施例,采用将具有耗电异常定位功能的SDK植入需要进行耗电异常检测的应用程序的方式,通过从应用程序由前台工作状态切换至后台工作状态时开始,或者从应用程序由前台工作状态切换至后台工作 状态后的预设时刻开始,确定应用程序中每个进程在预设时间段内的实际耗电值;根据每个进程在预设时间段内的实际耗电值,判断应用程序中是否有耗电实际值超出耗电预警值的进程;在判断出应用程序中有耗电实际值超出耗电预警值的进程的情况下,生成在该进程下运行的所有函数的相关信息,达到了快速对耗电异常点进行定位的目的,从而实现了及时准确地解决对应的耗电异常问题的技术效果,进而解决了相关技术中由于不能快速对耗电异常点进行定位造成的无法解决对应的耗电异常问题的技术问题。另外,本发明具有定位迅速的特点,实验表明其可以将定位和解决耗电问题这个流程从原来需要消耗几天时间降低到了现在需要消耗几个小时,数十倍的减少了纠错成本和人力投入。同时,本发明实施例通过使用具体耗电值来量化应用程序中各进程的耗电情况,可以便于开发人员掌握应用程序的耗电趋势,从而设定准确的耗电预警值等。According to the embodiment of the present invention, an SDK having a power consumption abnormal positioning function is implanted into an application that needs to perform power consumption abnormality detection, by starting from an application working state to a background working state, or from an application. Switch from foreground work status to background work The preset time after the state starts, and the actual power consumption value of each process in the application in the preset time period is determined; according to the actual power consumption value of each process in the preset time period, it is determined whether there is any consumption in the application. The actual value of the electric power exceeds the process of the power consumption warning value; when it is judged that there is a process in which the actual value of the power consumption exceeds the power consumption warning value, the related information of all the functions running under the process is generated, and the fast pair is achieved. The purpose of positioning the power consumption abnormal point is to achieve the technical effect of timely and accurately solving the corresponding power consumption abnormality problem, thereby solving the problem that the corresponding power consumption cannot be solved due to the inability to quickly locate the power consumption abnormal point in the related art. Technical problem with anomalous problems. In addition, the invention has the characteristics of rapid positioning, and experiments have shown that it can reduce the process of locating and solving the power consumption problem from the original need to consume several days to now consume several hours, and tens of times reduce the error correction cost and manpower. Invest. At the same time, the embodiment of the present invention quantifies the power consumption of each process in the application by using the specific power consumption value, which can facilitate the developer to grasp the power consumption trend of the application program, thereby setting an accurate power consumption warning value and the like.
进一步地,上述装置还可以包括:第一检测单元,用于在确定应用程序中每个进程在预设时间段内的实际耗电值之前,检测是否出现用户触发的电量干扰操作;和/或第二检测单元,用于检测应用程序是否已由后台工作状态切换至前台工作状态,其中,确定单元还用于在检测到未出现用户触发的电量干扰操作和/或应用程序未由后台工作状态切换至前台工作状态的情况下,执行确定应用程序中每个进程在预设时间段内的实际耗电值的步骤。Further, the foregoing apparatus may further include: a first detecting unit, configured to detect whether a user-triggered power interference operation occurs before determining an actual power consumption value of each process in the application within a preset time period; and/or a second detecting unit, configured to detect whether the application has been switched from the background working state to the foreground working state, wherein the determining unit is further configured to detect that the user-triggered power-interference operation does not occur and/or the application is not in the background working state In the case of switching to the foreground working state, a step of determining the actual power consumption value of each process in the application for a preset period of time is performed.
进一步地,上述确定单元可以包括:第一确定模块,用于在应用程序由前台工作状态切换至后台工作状态后的预设时刻,确定应用程序中每个进程的起始耗电值;第二确定模块,用于经过预设时间段后,确定应用程序中每个进程的结束耗电值;计算模块,用于计算并将应用程序中每个进程的起始耗电值与结束耗电值间的差值作为对应进程在预设时间段内的实际耗电值。Further, the determining unit may include: a first determining module, configured to determine a starting power consumption value of each process in the application program at a preset time after the application is switched from the foreground working state to the background working state; Determining a module, after a preset period of time, determining an end power consumption value of each process in the application; a calculation module for calculating and starting power consumption value and end power consumption value of each process in the application The difference between the two is taken as the actual power consumption value of the corresponding process within the preset time period.
进一步地,上述确定单元还可以包括:第一检测模块,用于在预设时间段内,检测是否出现用户触发的电量干扰操作;和/或第二检测模块,用于在预设时间段内,检测应用程序是否已由后台工作状态切换至前台工作状态,其中,第二确定模块还用于在预设时间段内,检测到未出现用户触发的电量干扰操作和/或应用程序未由后台工作状态切换至前台工作状态的情况下,执行经过预设时间段后,确定应用程序中每个进程的结束耗电 值的步骤。Further, the determining unit may further include: a first detecting module, configured to detect whether a user-triggered power interference operation occurs within a preset time period; and/or a second detecting module, configured to be within a preset time period Detecting whether the application has been switched from the background working state to the foreground working state, wherein the second determining module is further configured to detect that the user does not trigger the power interference operation and/or the application is not in the background within the preset time period When the working state is switched to the foreground working state, after the preset time period is executed, the end power consumption of each process in the application is determined. The step of the value.
进一步地,上述装置还可以包括:上传单元,用于在判断出应用程序中有耗电实际值超出耗电预警值的进程的情况下,且在生成在该进程下运行的所有函数的相关信息之后,将生成的在该进程下运行的所有函数的相关信息上传至服务器,以便服务器根据在该进程下运行的所有函数的相关信息,对应用程序的后台耗电异常情况进行分类处理。Further, the foregoing apparatus may further include: an uploading unit, configured to: when it is determined that the actual value of the power consumption in the application exceeds the process of the power consumption warning value, and generate information about all functions running under the process After that, the generated information about all the functions running under the process is uploaded to the server, so that the server classifies the background power consumption abnormality of the application according to the related information of all the functions running under the process.
需要说明的是,装置部分的实施方式与方法部分的实施方式对应类似,并且装置部分的功能单元或模块实现的功能和达到的技术效果与方法部分的步骤对应实现的功能和达到的技术效果类似,在此不再赘述。It should be noted that the implementation of the device part is similar to the implementation of the method part, and the functions and the achieved technical effects of the functional unit or module of the device part are similar to the functions and technical effects achieved by the steps of the method part. , will not repeat them here.
实施例3Example 3
本发明的实施例可以提供一种计算设备,该计算设备可以是计算机终端,该计算机终端可以是计算机终端群中的任意一个计算机终端设备。可选地,在本实施例中,上述计算设备也可以是移动终端等终端设备。例如,计算设备可以是图1所示的计算机终端。Embodiments of the present invention may provide a computing device, which may be a computer terminal, which may be any one of computer terminal groups. Optionally, in this embodiment, the foregoing computing device may also be a terminal device such as a mobile terminal. For example, the computing device can be the computer terminal shown in FIG.
可选地,在本实施例中,上述计算设备可以位于计算机网络的多个网络设备中的至少一个网络设备。Optionally, in this embodiment, the computing device may be located in at least one network device of the plurality of network devices of the computer network.
在本实施例中,上述计算设备可以执行应用程序的耗电检测方法中以下步骤的程序代码:从应用程序由前台工作状态切换至后台工作状态时开始,或者从应用程序由前台工作状态切换至后台工作状态后的预设时刻开始,确定所述应用程序中每个进程在预设时间段内的实际耗电值;根据所述每个进程在所述预设时间段内的所述实际耗电值,判断所述应用程序中是否有耗电实际值超出耗电预警值的进程;在判断出所述应用程序中有耗电实际值超出耗电预警值的进程的情况下,生成在该进程下运行的所有函数的相关信息。In this embodiment, the computing device may execute the program code of the following steps in the power consumption detecting method of the application program: when the application program is switched from the foreground working state to the background working state, or the application is switched from the foreground working state to the working state. Determining, by a preset time after the background working state, determining an actual power consumption value of each process in the application in a preset time period; according to the actual consumption of each process in the preset time period An electric value, determining whether there is a process in the application that exceeds a power consumption warning value; and determining that a process in which the actual power consumption value exceeds a power consumption warning value is generated in the application Information about all functions running under the process.
可选地,上述计算设备(可以标记为计算设备A)可以包括:一个或多个处理器、存储器、以及其他部件。Alternatively, the computing device described above (which may be labeled as computing device A) may include one or more processors, memory, and other components.
其中,存储器可用于存储软件程序以及模块,如本发明实施例中的用于应用程序的耗电情况的处理方法和装置对应的程序指令/模块,处理器通过运行存储在存储器内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现上述的用于应用程序的耗电情况的处理方法。存储器可包括高速随机存储器,还可以包括非易失性存储器,如一个或者多个磁性 存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器可进一步包括相对于处理器远程设置的存储器,这些远程存储器可以通过网络连接至终端A。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory can be used to store software programs and modules, such as the processing method for the power consumption of the application program and the program instructions/modules corresponding to the device in the embodiment of the present invention, the processor running the software program stored in the memory and The module, thereby performing various functional applications and data processing, that is, implementing the above-described processing method for the power consumption of the application. The memory may include a high speed random access memory, and may also include a non-volatile memory such as one or more magnetic Storage device, flash memory, or other non-volatile solid state memory. In some examples, the memory can further include memory remotely located relative to the processor, which can be connected to terminal A via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
处理器可以通过传输装置调用存储器存储的信息及应用程序,以执行下述步骤:在确定应用程序中每个进程在预设时间段内的实际耗电值之前,检测是否出现用户触发的电量干扰操作;和/或检测应用程序是否已由后台工作状态切换至前台工作状态,其中,在检测到未出现用户触发的电量干扰操作和/或应用程序未由后台工作状态切换至前台工作状态的情况下,执行确定应用程序中每个进程在预设时间段内的实际耗电值的步骤。The processor can call the memory stored information and the application by the transmission device to perform the following steps: detecting whether the user-triggered power interference occurs before determining the actual power consumption value of each process in the application within a preset time period. And/or detecting whether the application has been switched from the background working state to the foreground working state, wherein, when it is detected that the user-triggered power disturbance operation does not occur and/or the application is not switched from the background working state to the foreground working state, Next, the step of determining the actual power consumption value of each process in the application for a preset period of time is performed.
可选的,上述处理器还可以执行如下步骤的程序代码:在应用程序由前台工作状态切换至后台工作状态后的预设时刻,确定应用程序中每个进程的起始耗电值;经过预设时间段后,确定应用程序中每个进程的结束耗电值;计算并将应用程序中每个进程的起始耗电值与结束耗电值间的差值作为对应进程在预设时间段内的实际耗电值。Optionally, the foregoing processor may further execute the following program code: determining, according to a preset time after the application is switched from the foreground working state to the background working state, determining a starting power consumption value of each process in the application; After the time period is set, determine the end power consumption value of each process in the application; calculate and calculate the difference between the initial power consumption value and the end power consumption value of each process in the application as the corresponding process in the preset time period. The actual power consumption value inside.
可选的,上述处理器还可以执行如下步骤的程序代码:在预设时间段内,检测是否出现用户触发的电量干扰操作;和/或在预设时间段内,检测应用程序是否已由后台工作状态切换至前台工作状态,其中,在预设时间段内,检测到未出现用户触发的电量干扰操作和/或应用程序未由后台工作状态切换至前台工作状态的情况下,执行经过预设时间段后,确定应用程序中每个进程的结束耗电值的步骤。Optionally, the foregoing processor may further execute the following program code: detecting, during a preset time period, whether a user-triggered power interference operation occurs; and/or detecting whether the application has been used by the background within a preset time period The working state is switched to the foreground working state, wherein, in the preset time period, when the power-interference operation triggered by the user is not detected and/or the application is not switched from the background working state to the foreground working state, the preset is executed. After the time period, the steps to determine the end power consumption value of each process in the application.
可选的,上述处理器还可以执行如下步骤的程序代码:在判断出应用程序中有耗电实际值超出耗电预警值的进程的情况下,且在生成在该进程下运行的所有函数的相关信息之后,将生成的在该进程下运行的所有函数的相关信息上传至服务器,以便服务器根据在该进程下运行的所有函数的相关信息,对应用程序的后台耗电异常情况进行分类处理。Optionally, the foregoing processor may further execute the following program code: when it is determined that the actual value of the power consumption in the application exceeds the process of the power consumption warning value, and all the functions running under the process are generated. After the related information, the generated information about all the functions running under the process is uploaded to the server, so that the server classifies the background power consumption abnormality of the application according to the related information of all the functions running under the process.
在本发明实施例中,采用将具有耗电异常定位功能的SDK植入需要进行耗电异常检测的应用程序的方式,通过从应用程序由前台工作状态切换至后台工作状态时开始,或者从应用程序由前台工作状态切换至后台工作状态后的预设时刻开始,确定应用程序中每个进程在预设时间段内的实际耗电值;根据每个进程在预设时间段内的实际耗电值,判断应用程序中是 否有耗电实际值超出耗电预警值的进程;在判断出应用程序中有耗电实际值超出耗电预警值的进程的情况下,生成在该进程下运行的所有函数的相关信息,达到了快速对耗电异常点进行定位的目的,从而实现了及时准确地解决对应的耗电异常问题的技术效果,进而解决了相关技术中由于不能快速对耗电异常点进行定位造成的无法解决对应的耗电异常问题的技术问题。In the embodiment of the present invention, the method of implanting an SDK having a power consumption abnormal positioning function into an application requiring power consumption abnormality detection is started by switching from an application working state to a background working state, or from an application. The program starts from the foreground working state to the preset time after the background working state, and determines the actual power consumption value of each process in the application within the preset time period; according to the actual power consumption of each process in the preset time period Value, judged in the application is Whether there is a process in which the actual value of the power consumption exceeds the power consumption warning value; if it is determined that there is a process in which the actual value of the power consumption exceeds the power consumption warning value, the related information of all the functions running under the process is generated. The purpose of quickly locating power consumption abnormal points is achieved, thereby realizing the technical effect of timely and accurately solving the corresponding power consumption abnormality problem, and solving the unresolved corresponding problem in the related art that the power consumption abnormal point cannot be quickly located. The technical problem of the power consumption problem.
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令终端设备相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质可以包括:闪存盘、只读存储器(Read-Only Memory,ROM)、随机存取器(Random Access Memory,RAM)、磁盘或光盘等。A person of ordinary skill in the art may understand that all or part of the steps of the foregoing embodiments may be completed by a program to instruct terminal device related hardware, and the program may be stored in a computer readable storage medium, and the storage medium may be Including: flash disk, read-only memory (ROM), random access memory (RAM), disk or optical disk.
实施例4Example 4
本发明的实施例还提供了一种非暂时性机器可读存储介质。可选地,在本实施例中,上述存储介质可以用于保存上述实施例1所提供的用于应用程序的耗电情况的处理方法所执行的程序代码。Embodiments of the present invention also provide a non-transitory machine readable storage medium. Optionally, in this embodiment, the foregoing storage medium may be used to save the program code executed by the processing method for the power consumption condition of the application provided in Embodiment 1 above.
可选地,在本实施例中,上述存储介质可以位于计算机网络中计算机终端群中的任意一个计算机终端中,或者位于移动终端群中的任意一个移动终端中。Optionally, in this embodiment, the foregoing storage medium may be located in any one of the computer terminal groups in the computer network, or in any one of the mobile terminal groups.
可选地,在本实施例中,存储介质被设置为存储用于执行以下步骤的程序代码:从应用程序由前台工作状态切换至后台工作状态时开始,或者从应用程序由前台工作状态切换至后台工作状态后的预设时刻开始,确定应用程序中每个进程在预设时间段内的实际耗电值;根据每个进程在预设时间段内的实际耗电值,判断应用程序中是否有耗电实际值超出耗电预警值的进程;在判断出应用程序中有耗电实际值超出耗电预警值的进程的情况下,生成在该进程下运行的所有函数的相关信息。Optionally, in the embodiment, the storage medium is configured to store program code for performing the following steps: starting from when the application is switched from the foreground working state to the background working state, or switching from the foreground working state to the application The preset time after the background working state starts, determining the actual power consumption value of each process in the application in the preset time period; determining whether the application is in the application according to the actual power consumption value of each process in the preset time period There is a process in which the actual value of the power consumption exceeds the power consumption warning value; when it is determined that there is a process in which the actual power consumption value exceeds the power consumption warning value, information about all functions running under the process is generated.
需要说明的是,上述存储介质还可以被设置为存储用于执行实施例1中其他实施方式中的步骤的程序代码,在此不再赘述。It should be noted that the above storage medium may also be configured to store program codes for performing the steps in other embodiments in Embodiment 1, and details are not described herein again.
上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the embodiments of the present invention are merely for the description, and do not represent the advantages and disadvantages of the embodiments.
在本发明的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above-mentioned embodiments of the present invention, the descriptions of the various embodiments are different, and the parts that are not detailed in a certain embodiment can be referred to the related descriptions of other embodiments.
在本申请所提供的几个实施例中,应该理解到,所揭露的技术内容, 可通过其它的方式实现。其中,以上所描述的装置实施例仅仅是示意性的,例如所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元或模块的间接耦合或通信连接,可以是电性或其它的形式。In the several embodiments provided by the present application, it should be understood that the disclosed technical content, It can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of the unit is only a logical function division. In actual implementation, there may be another division manner. For example, multiple units or components may be combined or may be Integrate into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, unit or module, and may be electrical or otherwise.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention, which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium. A number of instructions are included to cause a computer device (which may be a personal computer, server or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: a U disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk, and the like. .
上文中已经参考附图详细描述了根据本发明的用于应用程序的耗电情况的处理方法、装置、计算设备以及非暂时性机器可读存储介质。The processing method, apparatus, computing device, and non-transitory machine-readable storage medium for power consumption of an application according to the present invention have been described in detail above with reference to the accompanying drawings.
此外,根据本发明的方法还可以实现为一种计算机程序,该计算机程序包括用于执行本发明的上述方法中限定的上述各步骤的计算机程序代码指令。或者,根据本发明的方法还可以实现为一种计算机程序产品,该计算机程序产品包括计算机可读介质,在该计算机可读介质上存储有用于执行本发明的上述方法中限定的上述功能的计算机程序。本领域技术人员还将明白的是,结合这里的公开所描述的各种示例性逻辑块、模块、电路和 算法步骤可以被实现为电子硬件、计算机软件或两者的组合。Furthermore, the method according to the invention can also be implemented as a computer program comprising computer program code instructions for performing the various steps defined above in the above method of the invention. Alternatively, the method according to the invention may also be embodied as a computer program product comprising a computer readable medium on which is stored a computer for performing the above-described functions defined in the above method of the invention program. Those skilled in the art will also appreciate the various exemplary logic blocks, modules, circuits, and circuits described in connection with the disclosure herein. The algorithm steps can be implemented as electronic hardware, computer software, or a combination of both.
附图中的流程图和框图显示了根据本发明的多个实施例的系统和方法的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或代码的一部分,所述模块、程序段或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标记的功能也可以以不同于附图中所标记的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality and operation of possible implementations of systems and methods in accordance with various embodiments of the present invention. In this regard, each block of the flowchart or block diagram can represent a module, a program segment, or a portion of code that includes one or more of the Executable instructions. It should also be noted that in some alternative implementations, the functions noted in the blocks may also occur in a different order than the ones in the drawings. For example, two consecutive blocks may be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending upon the functionality involved. It is also noted that each block of the block diagrams and/or flowcharts, and combinations of blocks in the block diagrams and/or flowcharts, can be implemented in a dedicated hardware-based system that performs the specified function or operation. Or it can be implemented by a combination of dedicated hardware and computer instructions.
以上已经描述了本发明的各实施例,上述说明是示例性的,并非穷尽性的,并且也不限于所披露的各实施例。在不偏离所说明的各实施例的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。本文中所用术语的选择,旨在最好地解释各实施例的原理、实际应用或对市场中的技术的改进,或者使本技术领域的其它普通技术人员能理解本文披露的各实施例。 The embodiments of the present invention have been described above, and the foregoing description is illustrative, not limiting, and not limited to the disclosed embodiments. Numerous modifications and changes will be apparent to those skilled in the art without departing from the scope of the invention. The choice of terms used herein is intended to best explain the principles, practical applications, or improvements of the techniques in the various embodiments of the embodiments, or to enable those of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (12)

  1. 一种用于应用程序的耗电情况的处理方法,其特征在于,包括:A method for processing a power consumption situation of an application, comprising:
    从应用程序由前台工作状态切换至后台工作状态时开始,或者从应用程序由前台工作状态切换至后台工作状态后的预设时刻开始,确定所述应用程序中每个进程在预设时间段内的实际耗电值;Starting from when the application is switched from the foreground working state to the background working state, or starting from a preset time after the application is switched from the foreground working state to the background working state, determining that each process in the application is within a preset time period Actual power consumption value;
    根据所述每个进程在所述预设时间段内的所述实际耗电值,判断所述应用程序中是否有耗电实际值超出耗电预警值的进程;Determining, according to the actual power consumption value of each process in the preset time period, whether there is a process in which the actual power consumption value exceeds the power consumption warning value;
    在判断出所述应用程序中有耗电实际值超出耗电预警值的进程的情况下,生成在该进程下运行的所有函数的相关信息。In the case where it is determined that there is a process in which the actual value of the power consumption exceeds the power consumption warning value, information about all functions running under the process is generated.
  2. 根据权利要求1所述的方法,其特征在于,在确定所述应用程序中每个进程在预设时间段内的实际耗电值之前,所述方法还包括:The method according to claim 1, wherein the method further comprises: before determining an actual power consumption value of each process in the application within a preset time period, the method further comprising:
    检测是否出现用户触发的电量干扰操作;和/或Detecting whether a user triggered power disturbance operation occurs; and/or
    检测所述应用程序是否已由后台工作状态切换至前台工作状态,Detecting whether the application has been switched from the background working state to the foreground working state,
    其中,在检测到未出现用户触发的电量干扰操作和/或所述应用程序未由后台工作状态切换至前台工作状态的情况下,执行确定所述应用程序中每个进程在预设时间段内的实际耗电值的步骤。Wherein, in the case that it is detected that the user-triggered power interference operation does not occur and/or the application is not switched from the background working state to the foreground working state, performing determining that each process in the application is within a preset time period The actual power consumption step.
  3. 根据权利要求1所述的方法,其特征在于,从应用程序由前台工作状态切换至后台工作状态后的预设时刻开始,确定所述应用程序中每个进程在预设时间段内的实际耗电值包括:The method according to claim 1, wherein the actual consumption of each process in the application within a preset time period is determined from a preset time after the application is switched from the foreground working state to the background working state. The electrical values include:
    在所述应用程序由前台工作状态切换至后台工作状态后的所述预设时刻,确定所述应用程序中每个进程的起始耗电值;Determining, at the preset time after the application is switched from the foreground working state to the background working state, determining a starting power consumption value of each process in the application;
    经过所述预设时间段后,确定所述应用程序中每个进程的结束耗电值;After the preset period of time, determining an end power consumption value of each process in the application;
    计算并将所述应用程序中每个进程的起始耗电值与结束耗电值间的差值作为对应进程在所述预设时间段内的实际耗电值。Calculating and comparing the difference between the initial power consumption value and the ending power consumption value of each process in the application as the actual power consumption value of the corresponding process in the preset time period.
  4. 根据权利要求3所述的方法,其特征在于,所述方法还包括:The method of claim 3, wherein the method further comprises:
    在所述预设时间段内,检测是否出现用户触发的电量干扰操作;和/或Detecting whether a user-triggered power interference operation occurs during the preset time period; and/or
    在所述预设时间段内,检测所述应用程序是否已由后台工作状态切换 至前台工作状态,Detecting whether the application has been switched by the background working state during the preset time period To the front desk,
    其中,在所述预设时间段内,检测到未出现用户触发的电量干扰操作和/或所述应用程序未由后台工作状态切换至前台工作状态的情况下,执行经过所述预设时间段后,确定所述应用程序中每个进程的结束耗电值的步骤。After the preset time period is detected, if the power-interference operation triggered by the user does not occur and/or the application is not switched from the background working state to the foreground working state, the preset time period is executed. Thereafter, the step of determining the end power consumption value of each process in the application.
  5. 根据权利要求1所述的方法,其特征在于,在判断出所述应用程序中有耗电实际值超出耗电预警值的进程的情况下,且在生成在该进程下运行的所有函数的相关信息之后,所述方法还包括:The method according to claim 1, wherein in the case where it is determined that there is a process in which the actual value of the power consumption exceeds the power consumption warning value, and correlation is generated in generating all functions running under the process After the information, the method further includes:
    将生成的在该进程下运行的所有函数的相关信息上传至服务器,以便所述服务器根据在该进程下运行的所有函数的相关信息,对所述应用程序的后台耗电异常情况进行分类处理。The generated related information of all the functions running under the process is uploaded to the server, so that the server classifies the background power consumption abnormality of the application according to the related information of all the functions running under the process.
  6. 一种用于应用程序的耗电情况的处理装置,其特征在于,包括:A processing device for power consumption of an application, comprising:
    确定单元,用于从应用程序由前台工作状态切换至后台工作状态时开始,或者从应用程序由前台工作状态切换至后台工作状态后的预设时刻开始,确定所述应用程序中每个进程在预设时间段内的实际耗电值;Determining a unit, starting from when the application is switched from the foreground working state to the background working state, or starting from a preset time after the application is switched from the foreground working state to the background working state, determining that each process in the application is The actual power consumption value within the preset time period;
    判断单元,用于根据所述每个进程在所述预设时间段内的所述实际耗电值,判断所述应用程序中是否有耗电实际值超出耗电预警值的进程;a determining unit, configured to determine, according to the actual power consumption value of each process in the preset time period, whether there is a process in which the actual power consumption value exceeds the power consumption warning value;
    生成单元,用于在判断出所述应用程序中有耗电实际值超出耗电预警值的进程的情况下,生成在该进程下运行的所有函数的相关信息。And a generating unit, configured to generate related information of all functions running under the process, if it is determined that the actual value of the power consumption exceeds the power consumption warning value in the application.
  7. 根据权利要求6所述的装置,其特征在于,所述装置还包括:The device according to claim 6, wherein the device further comprises:
    第一检测单元,用于在确定所述应用程序中每个进程在预设时间段内的实际耗电值之前,检测是否出现用户触发的电量干扰操作;和/或a first detecting unit, configured to detect whether a user triggered power interference operation occurs before determining an actual power consumption value of each process in the application in a preset time period; and/or
    第二检测单元,用于检测所述应用程序是否已由后台工作状态切换至前台工作状态,a second detecting unit, configured to detect whether the application has been switched from a background working state to a foreground working state,
    其中,所述确定单元还用于在检测到未出现用户触发的电量干扰操作和/或所述应用程序未由后台工作状态切换至前台工作状态的情况下,执行确定所述应用程序中每个进程在预设时间段内的实际耗电值的步骤。 The determining unit is further configured to perform determining to determine each of the applications in the case that it is detected that the user-triggered power interference operation does not occur and/or the application is not switched from the background working state to the foreground working state. The step of the actual power consumption value of the process over a preset time period.
  8. 根据权利要求6所述的装置,其特征在于,所述确定单元包括:The apparatus according to claim 6, wherein the determining unit comprises:
    第一确定模块,用于在所述应用程序由前台工作状态切换至后台工作状态后的所述预设时刻,确定所述应用程序中每个进程的起始耗电值;a first determining module, configured to determine, according to the preset time after the application is switched from the foreground working state to the background working state, the initial power consumption value of each process in the application;
    第二确定模块,用于经过所述预设时间段后,确定所述应用程序中每个进程的结束耗电值;a second determining module, configured to determine, after the preset time period, an end power consumption value of each process in the application;
    计算模块,用于计算并将所述应用程序中每个进程的起始耗电值与结束耗电值间的差值作为对应进程在所述预设时间段内的实际耗电值。And a calculation module, configured to calculate, as a difference between the initial power consumption value and the end power consumption value of each process in the application, an actual power consumption value of the corresponding process in the preset time period.
  9. 根据权利要求8所述的装置,其特征在于,所述确定单元还包括:The device according to claim 8, wherein the determining unit further comprises:
    第一检测模块,用于在所述预设时间段内,检测是否出现用户触发的电量干扰操作;和/或a first detecting module, configured to detect, during the preset time period, whether a user-triggered power interference operation occurs; and/or
    第二检测模块,用于在所述预设时间段内,检测所述应用程序是否已由后台工作状态切换至前台工作状态,a second detecting module, configured to detect, in the preset time period, whether the application program has been switched from a background working state to a foreground working state,
    其中,所述第二确定模块还用于在所述预设时间段内,检测到未出现用户触发的电量干扰操作和/或所述应用程序未由后台工作状态切换至前台工作状态的情况下,执行经过所述预设时间段后,确定所述应用程序中每个进程的结束耗电值的步骤。The second determining module is further configured to detect, in the preset time period, that the power-interference operation triggered by the user does not occur and/or the application is not switched from the background working state to the foreground working state. And performing the step of determining an end power consumption value of each process in the application after the preset time period.
  10. 根据权利要求6所述的装置,其特征在于,所述装置还包括:The device according to claim 6, wherein the device further comprises:
    上传单元,用于在判断出所述应用程序中有耗电实际值超出耗电预警值的进程的情况下,且在生成在该进程下运行的所有函数的相关信息之后,将生成的在该进程下运行的所有函数的相关信息上传至服务器,以便所述服务器根据在该进程下运行的所有函数的相关信息,对所述应用程序的后台耗电异常情况进行分类处理。An uploading unit, configured to determine, in a process that the actual value of the power consumption in the application exceeds a power consumption warning value, and after generating related information of all functions running under the process, Relevant information of all functions running under the process is uploaded to the server, so that the server classifies the background power consumption abnormality of the application according to related information of all functions running under the process.
  11. 一种计算设备,包括:A computing device comprising:
    处理器;以及Processor;
    存储器,其上存储有可执行代码,当所述可执行代码被所述处理器执行时,使所述处理器执行如权利要求1-5中任何一项所述的处理方法。A memory having executable code stored thereon that, when executed by the processor, causes the processor to perform the processing method of any of claims 1-5.
  12. 一种非暂时性机器可读存储介质,其上存储有可执行代码,当所 述可执行代码被计算设备的处理器执行时,使所述处理器执行如权利要求1至5中任一项所述的处理方法。 A non-transitory machine readable storage medium having executable code stored thereon When the executable code is executed by a processor of the computing device, the processor is caused to perform the processing method according to any one of claims 1 to 5.
PCT/CN2017/080889 2016-05-16 2017-04-18 Method, apparatus for processing power consumption of an application programme, calculation device and machine readable storage medium WO2017198025A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610326398.7 2016-05-16
CN201610326398.7A CN107391348A (en) 2016-05-16 2016-05-16 Processing method and processing device for the power consumption condition of application program

Publications (1)

Publication Number Publication Date
WO2017198025A1 true WO2017198025A1 (en) 2017-11-23

Family

ID=60324777

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/080889 WO2017198025A1 (en) 2016-05-16 2017-04-18 Method, apparatus for processing power consumption of an application programme, calculation device and machine readable storage medium

Country Status (2)

Country Link
CN (1) CN107391348A (en)
WO (1) WO2017198025A1 (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110945896A (en) * 2018-05-17 2020-03-31 华为技术有限公司 Power consumption abnormity prompting method, server and terminal
CN111651261A (en) * 2020-07-07 2020-09-11 Oppo(重庆)智能科技有限公司 Process management method and device, terminal equipment and computer readable storage medium
CN111930222A (en) * 2020-07-31 2020-11-13 联想(北京)有限公司 Control method and device and electronic equipment
CN112988554A (en) * 2019-12-12 2021-06-18 阿里巴巴集团控股有限公司 SDK detection method, device, SDK, application program, device and storage medium
CN114115509A (en) * 2022-01-25 2022-03-01 荣耀终端有限公司 Application management method and terminal
TWI806664B (en) * 2022-06-16 2023-06-21 華碩電腦股份有限公司 Method and system for detecting application program version with abnormal power consumption

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110134219B (en) * 2019-05-13 2024-03-19 深圳传音通讯有限公司 Application program background power consumption processing method and device
CN110737320B (en) * 2019-09-25 2023-08-18 腾讯音乐娱乐科技(深圳)有限公司 Power consumption detection method and device, electronic equipment and storage medium
CN111209160B (en) * 2019-12-31 2024-03-22 深圳云天励飞技术有限公司 Power consumption abnormality analysis method and device, terminal equipment and readable storage medium
CN113886192A (en) * 2021-10-25 2022-01-04 Oppo广东移动通信有限公司 Log data acquisition method and device, terminal equipment and readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102109945A (en) * 2009-12-25 2011-06-29 联想(北京)有限公司 Portable electronic equipment provided with touch screen and control method thereof
CN104239195A (en) * 2014-09-17 2014-12-24 可牛网络技术(北京)有限公司 Method for processing power consumption of electronic equipment, and electronic equipment
CN104267799A (en) * 2014-09-17 2015-01-07 可牛网络技术(北京)有限公司 Network server and method and system for processing power consumption of electronic equipment
CN104298335A (en) * 2013-07-19 2015-01-21 贝壳网际(北京)安全技术有限公司 Application program process cleaning method and device of mobile terminal and mobile terminal

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104298584A (en) * 2013-07-19 2015-01-21 贝壳网际(北京)安全技术有限公司 Method and device for acquiring application program with abnormal power consumption and mobile terminal
US9229522B1 (en) * 2013-08-27 2016-01-05 Symantec Corporation Mobile battery performance by identifying apps that disproportionally run background tasks that prevent mobile devices from sleeping
CN105208642B (en) * 2015-10-10 2018-08-21 魅族科技(中国)有限公司 A kind of method and terminal of application management

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102109945A (en) * 2009-12-25 2011-06-29 联想(北京)有限公司 Portable electronic equipment provided with touch screen and control method thereof
CN104298335A (en) * 2013-07-19 2015-01-21 贝壳网际(北京)安全技术有限公司 Application program process cleaning method and device of mobile terminal and mobile terminal
CN104239195A (en) * 2014-09-17 2014-12-24 可牛网络技术(北京)有限公司 Method for processing power consumption of electronic equipment, and electronic equipment
CN104267799A (en) * 2014-09-17 2015-01-07 可牛网络技术(北京)有限公司 Network server and method and system for processing power consumption of electronic equipment

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110945896A (en) * 2018-05-17 2020-03-31 华为技术有限公司 Power consumption abnormity prompting method, server and terminal
CN110945896B (en) * 2018-05-17 2021-10-01 华为技术有限公司 Power consumption abnormity prompting method, server and terminal
US11422605B2 (en) 2018-05-17 2022-08-23 Huawei Technologies Co., Ltd. Power consumption exception prompt method, server, and terminal
CN112988554A (en) * 2019-12-12 2021-06-18 阿里巴巴集团控股有限公司 SDK detection method, device, SDK, application program, device and storage medium
CN111651261A (en) * 2020-07-07 2020-09-11 Oppo(重庆)智能科技有限公司 Process management method and device, terminal equipment and computer readable storage medium
CN111930222A (en) * 2020-07-31 2020-11-13 联想(北京)有限公司 Control method and device and electronic equipment
CN114115509A (en) * 2022-01-25 2022-03-01 荣耀终端有限公司 Application management method and terminal
CN114115509B (en) * 2022-01-25 2022-07-26 荣耀终端有限公司 Application management method and terminal
TWI806664B (en) * 2022-06-16 2023-06-21 華碩電腦股份有限公司 Method and system for detecting application program version with abnormal power consumption

Also Published As

Publication number Publication date
CN107391348A (en) 2017-11-24

Similar Documents

Publication Publication Date Title
WO2017198025A1 (en) Method, apparatus for processing power consumption of an application programme, calculation device and machine readable storage medium
CN102682229B (en) Malicious code behavior detection method based on virtualization technology
KR101043299B1 (en) Method, system and computer readable recording medium for detecting exploit code
JP2018519586A5 (en)
WO2017114152A1 (en) Service dial testing method, apparatus and system
CN104572422A (en) Memory monitoring achievement method based on startup and shutdown of Linux system
CN105590063B (en) A kind of method, apparatus and electronic equipment for excavating loophole
CN102306119A (en) System for capturing global exception and method
US8521765B2 (en) Method and system for post processing trace data
WO2020211253A1 (en) Elastic scaling method and apparatus for number of hosts in distributed system, and computer device
CN104899125A (en) Operation information acquisition method and operation information acquisition device for single-board system
CN104991866B (en) The adjustment method and device of JS programs
CN106711933B (en) A kind of equipment abnormal electrical power supply processing method, device and video camera
CN106201753B (en) Method and system for processing PCIE errors in linux
CN111090593A (en) Method, device, electronic equipment and storage medium for determining crash attribution
CN105138447A (en) Hard disc and memory monitoring method in Reboot test process
CN113407391A (en) Fault processing method, computer system, substrate management controller and system
CN110598797B (en) Fault detection method and device, storage medium and electronic device
CN114200877A (en) Monitoring method and device for electric equipment
CN105786679B (en) A kind of automatic test monitoring system and method and mobile terminal
CN108491483B (en) Method and device for remotely monitoring running state of program
CN106528353A (en) Crash detection method and system based on touch screen and display screen
CN103986595A (en) Fault analyzing and upgrading method and server
CN115525461A (en) Anomaly detection method for energy storage device and server
KR102418892B1 (en) Method of saving energy based on confidence interval and apparatus using the same

Legal Events

Date Code Title Description
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: 17798589

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 17798589

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 22.05.2019)

122 Ep: pct application non-entry in european phase

Ref document number: 17798589

Country of ref document: EP

Kind code of ref document: A1