Equipment power consumption abnormity detection method and device and computer storage medium

By analyzing the standby log of electronic devices, combining the kernel and comprehensive logs to locate the proportion and type of wake-up source, the problem of rapid positioning of abnormal power consumption of electronic devices is solved, and the battery life and performance of the device are improved.

CN119065882APending Publication Date: 2024-12-03SHANGHAI INNOVATECH INFORMATION TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411094048.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-09
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

The prior art is difficult to quickly and accurately locate the reasons why electronic equipment is successfully consumed during standby, affecting the battery life and overall performance of the equipment.

Method used

By obtaining the standby log of the electronic device, priority is given to search for the wake-up source in the kernel log, analysis is carried out in combination with the comprehensive log, calculation of the ratio of the wake-up source, and determining whether it exceeds the preset threshold, and then determining the target wake-up source to locate the cause of power consumption abnormality.

Benefits of technology

It realizes rapid and accurate positioning of wake-up sources with abnormal power consumption, improves the battery life and overall performance of electronic devices, and ensures detection efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119065882A_ABST
    Figure CN119065882A_ABST
Patent Text Reader

Abstract

The invention provides an equipment power consumption abnormity detection method and device and a computer storage medium, and relates to the technical field of electronics. The method for detecting the abnormal power consumption of the equipment comprises the following steps: acquiring standby logs of the electronic equipment, wherein the standby logs comprise kernel logs and comprehensive logs; searching a plurality of wake-up sources in a kernel log to obtain a first analysis result of power consumption abnormality of the electronic equipment; according to the first analysis result, judging whether multiple wake-up sources are searched in the comprehensive log or not; if yes, multiple wake-up sources are searched in the comprehensive log to obtain a second analysis result of the power consumption abnormity of the electronic equipment; according to the first analysis result and the second analysis result, determining a target wake-up source causing abnormal power consumption of the electronic equipment; and if not, according to the first analysis result, determining a target wake-up source causing the abnormal power consumption of the electronic equipment. The analysis and detection process has both accuracy and detection efficiency, and research and development personnel can accurately and quickly analyze and position the wake-up source causing power consumption abnormity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of electronic technology, and more specifically, to a method, apparatus and computer storage medium for detecting abnormal power consumption of a device. Background Art

[0002] With the popularization of electronic devices and the continuous improvement of their intelligence level, power consumption has become a key factor in measuring device performance, affecting user experience and environmental protection. At present, electronic devices are facing multiple problems in terms of power consumption and battery life, such as diversified functions and increased energy consumption, complex background application management, high energy consumption caused by advances in screen technology, and power consumption of network connections. In order to improve battery life, electronic device manufacturers and operating system developers should also continuously optimize system design and hardware configuration to provide more efficient and longer-lasting battery life.

[0003] In the process of optimizing power consumption and battery life, how to accurately and quickly locate the cause of abnormal device power consumption is a technical problem that needs to be solved urgently. Summary of the invention

[0004] The present application provides a method, device and computer storage medium for detecting abnormal power consumption of a device, which can accurately and quickly locate the cause of the abnormal power consumption of the device.

[0005] In a first aspect, a method for detecting abnormal power consumption of a device is provided, comprising: obtaining a standby log of the electronic device, the standby log comprising: a kernel log and a comprehensive log; searching for multiple wake-up sources in the kernel log to obtain a first analysis result of the abnormal power consumption of the electronic device; judging whether to search for multiple wake-up sources in the comprehensive log based on the first analysis result; if so, searching for multiple wake-up sources in the comprehensive log to obtain a second analysis result of the abnormal power consumption of the electronic device; determining a target wake-up source causing the abnormal power consumption of the electronic device based on the first analysis result and the second analysis result; if not, determining the target wake-up source causing the abnormal power consumption of the electronic device based on the first analysis result.

[0006] Through the technical solution provided by the embodiment of the present application, the standby log of the electronic device is used to detect and locate the wake-up source that causes abnormal power consumption of the electronic device during the standby process. In the analysis process of the standby log, the kernel log can be used for analysis first, and then further analysis can be performed in combination with the comprehensive log as appropriate. The analysis and detection process can have both accuracy and detection efficiency, which is conducive to R&D personnel to accurately analyze and locate the wake-up source that causes abnormal power consumption, and improve the battery life and overall performance of the electronic device.

[0007] In some possible implementations, the above-mentioned searching for multiple wake-up sources in the kernel log to obtain a first analysis result of abnormal power consumption of the electronic device includes: searching for keywords corresponding to the multiple wake-up sources in the kernel log to obtain the number of times each of the multiple wake-up sources appears in the kernel log; calculating the proportion of each of the multiple wake-up sources to obtain the first analysis result.

[0008] Through the technical solution of this implementation, the first analysis result is characterized by the proportion of each wake-up source among multiple wake-up sources. The first analysis result can be calculated faster and with higher accuracy, and can quickly and clearly characterize the proportion of multiple wake-up sources in the kernel log.

[0009] In some possible implementations, the above-mentioned determining whether to search for multiple wake-up sources in the comprehensive log based on the first analysis result includes: determining whether the difference between the highest proportion in the first analysis result and other proportions is greater than a preset threshold; if so, searching for multiple wake-up sources in the comprehensive log; if not, not searching for multiple wake-up sources in the comprehensive log.

[0010] In some possible implementations, the above-mentioned determining the target wake-up source that causes abnormal power consumption of the electronic device based on the first analysis result includes: determining at least one wake-up source corresponding to at least one target ratio in the first analysis result as at least one target wake-up source, wherein the target ratio includes: the highest ratio in the first analysis result and the second highest ratio whose difference with the highest ratio is less than a preset threshold.

[0011] Through the technical solution of this implementation, at least one wake-up source causing abnormal power consumption of the electronic device can be determined using only the first analysis result, which can effectively ensure detection efficiency and accuracy.

[0012] In some possible implementations, determining the target wake-up source that causes abnormal power consumption of the electronic device based on the first analysis result and the second analysis result includes: merging the first analysis result and the second analysis result to form a target analysis result; determining at least one wake-up source corresponding to at least one target ratio in the target analysis result as at least one target wake-up source, wherein the target ratio includes: the highest ratio in the target analysis result and the second highest ratio whose difference with the highest ratio is less than a preset threshold.

[0013] Through the technical solution of this implementation, the first analysis result and the second analysis result can be used to determine at least one wake-up source that causes abnormal power consumption of the electronic device, which is beneficial to improving the comprehensive coverage of abnormal detection while ensuring detection efficiency and accuracy.

[0014] In some possible implementations, the comprehensive log includes at least one of the following logs: a device log, a network log, and a system log.

[0015] In some possible implementations, the comprehensive log includes: a system log, and the system log includes: power information of the electronic device during standby; before searching for multiple wake-up sources in the kernel log, the detection method also includes: determining an abnormal time period of abnormal power consumption of the electronic device based on the power information in the system log; the above-mentioned search for multiple wake-up sources in the kernel log to obtain a first analysis result of abnormal power consumption of the electronic device includes: searching for multiple wake-up sources in the kernel log corresponding to the abnormal time period to obtain a first analysis result of abnormal power consumption of the electronic device; the above-mentioned search for multiple wake-up sources in the comprehensive log to obtain a second analysis result of abnormal power consumption of the electronic device includes: searching for multiple wake-up sources in the comprehensive log corresponding to the abnormal time period to obtain a second analysis result of abnormal power consumption of the electronic device.

[0016] The technical solution of this implementation method is helpful to further speed up the efficiency of analyzing and locating abnormal power consumption problems.

[0017] In some possible implementations, the target wake-up source includes: a data transmission wake-up source, and the comprehensive log includes: a network log; the detection method further includes: querying the IP address of the data transmission wake-up source in the network log; according to the IP address, dividing the data transmission wake-up source into at least one type and counting the proportion of each type; analyzing the data transmission wake-up source according to the type and proportion of the data transmission wake-up source.

[0018] Through the technical solution of the embodiment of the present application, when the target wake-up source is determined according to the previous analysis results, and the target wake-up source includes a data transmission wake-up source, the data transmission wake-up source can be further divided into multiple types according to the IP address in the network log and the proportion can be statistically analyzed to further screen and analyze the data transmission wake-up source, thereby further improving the accuracy of power anomaly detection and positioning of electronic devices.

[0019] In some possible implementations, the data transmission wakeup source includes: a GMS data transmission wakeup source.

[0020] In some possible implementations, the multiple wakeup sources include at least one of the following wakeup sources: an external interrupt wakeup source, a network connection wakeup source, a communication wakeup source, a power wakeup source, and a communication control interface wakeup source.

[0021] In a second aspect, a device for detecting abnormal power consumption of an electronic device is provided, comprising: an input unit for obtaining a standby log of the electronic device, the standby log comprising: a kernel log and a comprehensive log; a processing unit for searching for multiple wake-up sources in the kernel log to obtain a first analysis result of the abnormal power consumption of the electronic device; based on the first analysis result, determining whether to search for multiple wake-up sources in the comprehensive log; if so, searching for multiple wake-up sources in the comprehensive log to obtain a second analysis result of the abnormal power consumption of the electronic device; based on the first analysis result and the second analysis result, determining a target wake-up source that causes the abnormal power consumption of the electronic device; if not, determining the target wake-up source that causes the abnormal power consumption of the electronic device based on the first analysis result.

[0022] In a third aspect, a device for detecting abnormal power consumption of an equipment is provided, comprising: a processor and a memory, the memory being used to store a computer program, and the processor being used to call and run the computer program stored in the memory to execute: the detection method provided in the first aspect or any possible implementation manner in the first aspect.

[0023] In a fourth aspect, a computer storage medium is provided, storing a computer program, wherein the computer program is used to execute: the detection method provided in the first aspect or any possible implementation manner of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 This is a system architecture diagram of a log analysis provided in an embodiment of the present application.

[0025] Figure 2 It is a schematic flowchart of a method for detecting abnormal power consumption of a device provided in an embodiment of the present application.

[0026] Figure 3 It is a schematic flowchart of another method for detecting abnormal power consumption of a device provided in an embodiment of the present application.

[0027] Figure 4 It is a schematic flowchart of another method for detecting abnormal power consumption of a device provided in an embodiment of the present application.

[0028] Figure 5 It is a schematic structural block diagram of a device for detecting abnormal power consumption of a device provided in an embodiment of the present application.

[0029] Figure 6 It is a schematic structural block diagram of another device power consumption abnormality detection apparatus provided in an embodiment of the present application. DETAILED DESCRIPTION

[0030] The technical solution in this application will be described below in conjunction with the accompanying drawings.

[0031] Unless otherwise stated, all technical and scientific terms used in the embodiments of the present application are the same as the meanings generally understood by those skilled in the art of the technical field of the application. The terms used in the present application are only for the purpose of describing specific embodiments, and are not intended to limit the scope of the present application. The singular forms "a kind of", "above" and "the" used in the embodiments of the present application and the appended claims are also intended to include majority forms, unless the context clearly indicates other meanings. In addition, the terms "first", "second" etc. are only used for description purposes, and cannot be interpreted as indicating or suggesting relative importance.

[0032] The embodiments of the present application can be applied to various electronic devices, and are particularly suitable for 3C electronic products such as communications and consumer electronics, for example, smart phones, tablet computers, smart wearable devices, etc.

[0033] During the operation of an electronic device, a log file (also called a log file) is generated inside it. The log file can be used to record the operation, time, state changes and system behavior of the electronic device within a specific time. As an example, for a smartphone, its log files may include but are not limited to the following types: system log, application log, security log, call log, battery log, etc. Among them, the system log is used to record the operation of the mobile phone operating system (such as Android or iOS), including system startup, shutdown, application crash, system error and other information. The system log can help developers or technical support personnel diagnose and repair system problems. The application log is used to record the running status, user interaction, error information, etc. of the application. This log can help developers debug and optimize the application.

[0034] Log files can help users or technical support personnel identify and solve problems with electronic devices, such as software and hardware problems, program crashes, network connection problems, etc. In addition, log files can also be used to analyze the performance of electronic devices, such as CPU usage, memory usage, etc. Therefore, log files are an important tool for maintaining stable operation of devices, improving user experience, and ensuring security. They are of great value to developers, technical support personnel, and end users.

[0035] With the popularity of electronic devices and the continuous improvement of their intelligence, power consumption has become a key factor in measuring device performance, affecting user experience and environmental protection. In order to reduce the power consumption of electronic devices and increase battery life, electronic device manufacturers and operating system developers should also continuously optimize system design and hardware configuration to provide more efficient and longer battery life. In this process, using logs to locate and detect the cause of abnormal high power consumption of electronic devices is a fast and efficient way.

[0036] Figure 1 A system architecture diagram of a log analysis provided by an embodiment of the present application is shown.

[0037] like Figure 1 As shown, the system 100 for log analysis may include an analyzer 110 and a device to be tested 120. The device to be tested 120 may be a problematic device with abnormal power consumption in a standby state. Optionally, the device to be tested 120 may be a smart phone, a wearable device, a tablet computer, and the like.

[0038] The analysis machine 110 may be a personal terminal computer, or may be other computer devices with data processing functions. The analysis machine 110 may be connected to the device under test 120 by wire or wireless means to obtain the log file generated during the standby process of the device under test 120. The analysis machine 110 may analyze and count the log file to locate the relevant factors causing the abnormal power consumption from the log file.

[0039] In order to improve the accuracy of power consumption test analysis, in some implementations, the device to be tested 120 can maintain a dynamic standby state or a static standby state, wherein in the dynamic standby state, a large number of applications can be run in the background of the device. In the static standby state, applications running in the background of the device can be cleared.

[0040] Based on the above Figure 1 The log analysis system shown in the following embodiments can provide a method for detecting power consumption anomalies with better effects.

[0041] Figure 2 A schematic flowchart of a method 200 for detecting abnormal power consumption of a device provided in an embodiment of the present application is shown.

[0042] like Figure 2 As shown, the method 200 for detecting abnormal power consumption of a device includes the following steps.

[0043] S210: Acquire a standby log of the electronic device, where the standby log includes a kernel log and a comprehensive log.

[0044] S220: Searching for multiple wake-up sources in the kernel log to obtain a first analysis result of abnormal power consumption of the electronic device.

[0045] S230: According to the first analysis result, determine whether to search for multiple wakeup sources in the comprehensive log.

[0046] S241: If yes, search for multiple wake-up sources in the comprehensive log to obtain a second analysis result of abnormal power consumption of the electronic device.

[0047] S250: Determine a target wakeup source causing abnormal power consumption of the electronic device according to the first analysis result and the second analysis result.

[0048] S242: If not, determine the target wakeup source causing the abnormal power consumption of the electronic device according to the first analysis result.

[0049] The method 200 provided in the embodiment of the present application can be applied to the above Figure 1 The analysis machine 110 shown in FIG. 1 , that is, the analysis machine 110 can be used as an execution subject to execute the method 200. In addition, the electronic device in the method 200 can be the above Figure 1 A device under test 120 is shown.

[0050] In step S210, the analysis machine may obtain the standby log of the electronic device, which may be a log file generated by the electronic device in a static standby state or a dynamic standby state. The recording duration of the standby log may be flexibly set according to demand, and the embodiment of the present application does not limit this. In the embodiment of the present application, the standby log may include: a kernel log (kenellog) and a comprehensive log, wherein the comprehensive log is a collection of multiple logs. As an example, the comprehensive log may include at least one of the following: a device log (mobilelog), a network log (netlog), and a system log (bugreport), etc.

[0051] Among them, the kernel log records the operation information of the operating system kernel of the electronic device. The kernel log usually contains information about hardware interaction, system calls, interrupt processing, process scheduling, memory management, etc. During the standby process of the electronic device, the wake-up source that causes abnormal power consumption due to abnormal wake-up usually appears in the kernel log. Therefore, in the embodiment of the present application, the kernel log generated by the electronic device during the standby process can be analyzed preferentially, which can improve the speed and efficiency of power consumption abnormality analysis.

[0052] The device log records the activities and events of the device operating system. The log file may contain system startup information, hardware status, application activities, system errors and performance data, etc. The network log records detailed information of network communications. The network log may contain IP address, port number, amount of data transmitted, network connection status, error information, etc. The system log is used to record system status, errors and diagnostic information, etc. The system log can be used for fault diagnosis and problem reporting. As an example, the system log can be a bugreport. When the electronic device is an Android system device, a bugreport tool may be provided therein, and the bugreport log can be obtained by executing the corresponding command.

[0053] In step S220, it is preferred to search for multiple wake-up sources in the kernel log to obtain a first analysis result, which can be used to characterize the appearance status of the multiple wake-up sources in the kernel log. For example, the first analysis result may include the number of times and time when the multiple wake-up sources appear in the kernel log.

[0054] The wakeup source refers to an event or signal that causes the system to resume normal operation from a low-power state (such as sleep mode or hibernation mode). As an example but not a limitation, the wakeup source can be: user input (key operation or touch screen operation, etc.), hardware events (timer wakeup, interrupt wakeup, sensor wakeup, etc.), software events (network packet arrival, system message, application request, etc.) and power management events (battery charging, power plug-in, etc.).

[0055] During the standby process of electronic devices, if abnormal wake-up sources appear frequently, the standby power consumption of the electronic devices will increase, which is not conducive to the long-term battery life of the electronic devices. The wake-up source is an important part of the power management strategy, which directly affects the energy consumption and responsiveness of the system.

[0056] In step S230, based on the above-mentioned first analysis result, it can be determined whether it is necessary to search for multiple wake-up sources in the comprehensive log. Specifically, if the first analysis result obtained based on the kernel log has a better directionality for the abnormal wake-up source, it is not necessary to make further judgments in combination with the comprehensive log, and step S242 is executed to determine the target wake-up source that causes abnormal power consumption of the electronic device based on the first analysis result. Optionally, in some embodiments, the first analysis result may include the number of times each of the multiple wake-up sources appears in the kernel log, where the wake-up source with the largest number of appearances can be the target wake-up source.

[0057] On the contrary, if the first analysis result obtained according to the kernel log does not have a better directionality for the abnormal wake-up source, that is, if the abnormal wake-up source cannot be obtained according to the first analysis result, it is necessary to further combine the comprehensive log for further judgment. Specifically, in step S241 and step S250, multiple wake-up sources can be searched in the comprehensive log first to obtain the second analysis result, and then the target wake-up source that causes the abnormal power consumption of the electronic device is jointly determined based on the first analysis result and the second analysis result. Optionally, in some embodiments, the first analysis result may include the number of times each of the multiple wake-up sources appears in the kernel log, and the second analysis result may include the number of times each of the multiple wake-up sources appears in the comprehensive log. The wake-up source with the largest sum of appearances in the two logs can be the target wake-up source.

[0058] Through the technical solution provided by the embodiment of the present application, the standby log of the electronic device is used to detect and locate the wake-up source that causes abnormal power consumption of the electronic device during the standby process. In the analysis process of the standby log, the kernel log can be used for analysis first, and then further analysis can be performed in combination with the comprehensive log as appropriate. The analysis and detection process can have both accuracy and detection efficiency, which is conducive to R&D personnel to accurately analyze and locate the wake-up source that causes abnormal power consumption, and improve the battery life and overall performance of the electronic device.

[0059] Figure 3 A schematic flowchart of another method 300 for detecting abnormal power consumption of a device provided in an embodiment of the present application is shown.

[0060] like Figure 3 As shown, the method 300 for detecting abnormal power consumption of a device includes the following steps.

[0061] S310: Acquire a standby log of the electronic device, where the standby log includes a kernel log and a comprehensive log.

[0062] S320: Searching for keywords corresponding to the multiple wakeup sources in the kernel log to obtain the number of times each of the multiple wakeup sources appears in the kernel log.

[0063] S330: Calculate the ratio of each wakeup source among the multiple wakeup sources to obtain a first analysis result.

[0064] S340: Determine whether the difference between the highest ratio in the first analysis result and other ratios is greater than a preset threshold.

[0065] S350: If yes, search the comprehensive log for keywords corresponding to the multiple wakeup sources to obtain the number of times each of the multiple wakeup sources appears in the comprehensive log.

[0066] S360: Calculate the ratio of each wakeup source among the multiple wakeup sources to obtain a second analysis result.

[0067] S370: Merge the first analysis result and the second analysis result to form a target analysis result.

[0068] S380: Determine at least one wakeup source corresponding to at least one target ratio in the target analysis result as at least one target wakeup source.

[0069] S390: If not, determine at least one wakeup source corresponding to at least one target ratio in the first analysis result as at least one target wakeup source.

[0070] With the above Figure 2 Similar to the embodiment shown, the method 300 provided in the embodiment of the present application can also be applied to the above Figure 1The analysis machine 110 shown in the figure. In the embodiment of the present application, some steps are similar to those in the above Figure 2 Some steps in the method 200 are related, and the specific implementation scheme can be found in the above description, and will not be elaborated here.

[0071] In step S320 , keywords corresponding to the multiple wakeup sources may be searched in the kernel log to obtain the number of times each of the multiple wakeup sources appears in the kernel log.

[0072] As an example, the keywords corresponding to several wake-up sources are shown below:

[0073] (1) EINT: EINT is pending;

[0074] (2)CONN: alarm time is up;

[0075] (3) CLDMA: CLDMA_MD wakeup source;

[0076] (4)PMIC: pwrkey_int_handler;

[0077] (5)CCIFO: ccif_resume_noirq.

[0078] Among them, ENIT refers to an external interrupt, and its keyword may be ENIT is pending. CONN is a wakeup source related to the network connection, and its keywords may include: alarm time is up. CLDMA may be a wakeup source related to the communication connection, and its keywords may include: CLDMA_MD wakeup source. PMIC is a wakeup source related to power management, and its keywords may include: pwrkey_int_handler. CCIFO is a wakeup source related to the communication control interface. For example, the CCIFO may be an interface between a modem and other parts of the mobile phone (such as an operating system). The keywords of the CCIFO may include: ccif_resume_noirq.

[0079] It is understandable that the above-mentioned wake-up sources are only examples and not limitations, and more other types of wake-up sources can be searched in the standby log of the electronic device according to actual needs. In addition, in the embodiment of the present application, one wake-up source can correspond to one keyword, or one wake-up source can also correspond to multiple keywords.

[0080] In some implementations, a grep command or a similar command may be used to search for keywords in the standby log, thereby obtaining search results accurately and quickly.

[0081] In step S330, the proportion of each of the multiple wakeup sources may be calculated according to the search results, ie, the number of times each of the multiple wakeup sources appears in the kernel log, to obtain a first analysis result.

[0082] Optionally, the proportion of multiple wake-up sources in the first analysis result can be presented to the user (such as R&D personnel) in the form of a pie chart or other views, and different wake-up sources can correspond to different colors. Optionally, different colors can be assigned to the wake-up source according to its type. For example, when the wake-up source is the wake-up source of the system itself, a first color can be configured for this type of wake-up source, and when the wake-up source is the wake-up source of a third-party application, a second color can be configured for this type of wake-up source.

[0083] Through the technical solution of this implementation, the first analysis result is characterized by the proportion of each wake-up source among multiple wake-up sources. The first analysis result can be calculated faster and with higher accuracy, and can quickly and clearly characterize the proportion of multiple wake-up sources in the kernel log.

[0084] In step S340, it can be further determined whether the difference between the highest proportion in the first analysis result and other proportions is greater than a preset threshold. If so, it means that in the first analysis result, the highest proportion is much greater than other proportions, and the wake-up source corresponding to the highest proportion is the main wake-up source causing abnormal power consumption of the electronic device. The wake-up source can be analyzed and located preferentially to optimize the performance of the electronic device.

[0085] In this case, step S390 is executed to determine at least one wakeup source corresponding to at least one target ratio in the first analysis result as at least one target wakeup source, wherein the target ratio includes: the highest ratio in the first analysis result and the second highest ratio whose difference with the highest ratio is less than a preset threshold.

[0086] Through the technical solution of this implementation, at least one wake-up source causing abnormal power consumption of the electronic device can be determined using only the first analysis result, which can effectively ensure detection efficiency and accuracy.

[0087] On the contrary, in step S340, if the difference between the highest proportion in the first analysis result and the other proportions is less than or equal to the preset threshold, it means that in the first analysis result, the highest proportion is relatively close to the other proportions, that is, the proportions of multiple wake-up sources appearing in the kernel log are relatively close, and the main wake-up source causing the abnormal power consumption of the electronic device cannot be determined based on the first analysis result of the kernel log.

[0088] In this case, steps S350 to S380 are executed, that is, the comprehensive log is introduced, and keywords corresponding to multiple wakeup sources are searched in the comprehensive log to obtain the number and proportion of each of the multiple wakeup sources appearing in the comprehensive log to form a second analysis result.

[0089] Specifically, the above process of searching for keywords corresponding to the wakeup source in the comprehensive log can refer to the above solution for searching the wakeup source in the kernel log. The second analysis result can be similar to the above first analysis result, including the proportion of multiple wakeup sources, and presented to the user in the form of a pie chart or other views.

[0090] In an embodiment of the present application, the comprehensive log may include one or more of a device log (mobilelog), a network log (netlog), and a system log (bugreport). In the case where the comprehensive log includes multiple logs, the second analysis result is the proportion of multiple wakeup sources in all logs.

[0091] Furthermore, the first analysis result is combined with the second analysis result, that is, the proportions corresponding to the same wakeup source in the first analysis result and the second analysis result are added to form a target analysis result, which can characterize the proportion of each wakeup source in all standby logs. At least one wakeup source corresponding to at least one target proportion in the target analysis result can be determined as at least one target wakeup source. The target proportion includes: the highest proportion in the target analysis result and the second highest proportion whose difference with the highest proportion is less than a preset threshold.

[0092] Through the technical solution of this implementation, the first analysis result and the second analysis result can be used to determine at least one wake-up source that causes abnormal power consumption of the electronic device, which is beneficial to improving the comprehensive coverage of abnormal detection while ensuring detection efficiency and accuracy.

[0093] Figure 4 A schematic flowchart of another method 400 for detecting abnormal power consumption of a device provided in an embodiment of the present application is shown.

[0094] like Figure 4 As shown, the method 400 for detecting abnormal power consumption of a device includes the following steps.

[0095] S410: Acquire a standby log of the electronic device, where the standby log includes: a kernel log, a system log, and a network log.

[0096] S420: Determine an abnormal time period of abnormal power consumption of the electronic device according to the power information in the system log.

[0097] S430: Searching for multiple wake-up sources in the kernel log corresponding to the abnormal time period to obtain a first analysis result of abnormal power consumption of the electronic device.

[0098] S440: According to the first analysis result, determine whether to search for multiple wakeup sources in the comprehensive log.

[0099] S451: If yes, search for multiple wake-up sources in the comprehensive log corresponding to the abnormal time period to obtain a second analysis result of the abnormal power consumption of the electronic device.

[0100] S460: Determine a target wakeup source causing abnormal power consumption of the electronic device according to the first analysis result and the second analysis result.

[0101] S452: If not, determine the target wakeup source causing the abnormal power consumption of the electronic device according to the first analysis result.

[0102] S470: If the target wakeup source includes a data transmission wakeup source, query the IP address of the data transmission wakeup source in the network log.

[0103] S480: Classify the data transmission wakeup source into at least one type according to the IP address and count the proportion of each type.

[0104] S490: Analyze the data transmission wakeup source according to the type and proportion of the data transmission wakeup source.

[0105] With the above Figure 2 and Figure 3 Similar to the embodiment shown, the method 400 provided in the embodiment of the present application can also be applied to the above Figure 1 The analysis machine 110 shown in the figure. In the embodiment of the present application, some steps are similar to those in the above Figure 2 or Figure 3 Some steps in the method shown are related. For specific implementation schemes, please refer to the above description and will not be described in detail here.

[0106] In the embodiment of the present application, the comprehensive log may at least include: a system log and a network log.

[0107] In step S420, the abnormal time period of abnormal power consumption of the electronic device can be determined based on the power information in the system log. Specifically, the system log can record all power information in the entire standby period, and by analyzing the power information, the abnormal time period of abnormal power consumption can be determined, for example, a time period with a faster power decline rate; in other words, the rate of change of power consumption in the abnormal time period is greater than the rate of change of power consumption in other time periods.

[0108] In step S430, a portion of the logs corresponding to the abnormal time period may be extracted from all kernel logs, and a search and analysis of multiple wakeup sources may be performed on only the portion of the logs to obtain a first analysis result. Similarly, in step S451, a portion of the logs corresponding to the abnormal time period may be extracted from all comprehensive logs, and a search and analysis of multiple wakeup sources may be performed on only the portion of the logs to obtain a second analysis result.

[0109] The technical solution of this implementation method is helpful to further speed up the efficiency of analyzing and locating abnormal power consumption problems.

[0110] Optionally, when the target wakeup source is determined through the analysis result, and the target wakeup source includes a data transmission wakeup source, the embodiment of the present application may further include steps S470 to S490.

[0111] In step S470, the IP address of the data transmission wake-up source can be queried in the network log. The data transmission wake-up source is a wake-up caused by data transmission between the electronic device and the external network server. As an example, the data transmission wake-up source includes: a GMS data transmission wake-up source (or a network data transmission wake-up source), wherein GMS refers to "Google Mobile Services", which is a set of mobile applications and services provided by Google, which can be pre-installed on smartphones and tablets running the Android operating system. The GMS data transmission wake-up source is a wake-up source that triggers wake-up by performing data transmission via GMS.

[0112] The network data transmission wake-up source may include three types, namely: GMS application, third-party application and local area network. The three types of network data transmission wake-up sources may correspond to different IP addresses. In step S470, there are three IP addresses obtained through network log query. In step S480, the network data transmission wake-up source can be divided into three types according to the three IP addresses and the number and proportion of each type appearing in the network log can be counted. In step S490, a specific analysis can be performed according to the type and proportion of the network data transmission wake-up source. For example, in the case where it is determined that the network data transmission wake-up source corresponding to the highest proportion is the local area network, it can be determined that the wake-up source is a normal wake-up source and does not need to enter subsequent analysis. In the case where it is determined that the network data transmission wake-up source corresponding to the highest proportion is a GMS application or a third-party application, the R&D personnel can confirm whether it is necessary to pull in Google or the third-party application provider to analyze and solve it together according to the actual situation.

[0113] It should be noted that in the above embodiments, only the network data transmission wake-up source is used as an example for explanation. In other examples, the data transmission wake-up source may also include a wake-up source for data transmission by other third-party applications or services. The embodiments of the present application do not make specific limitations on this.

[0114] Through the technical solution of the embodiment of the present application, when the target wake-up source is determined according to the previous analysis results, and the target wake-up source includes a data transmission wake-up source, the data transmission wake-up source can be further divided into multiple types according to the IP address in the network log and the proportion can be statistically analyzed to further screen and analyze the data transmission wake-up source, thereby further improving the accuracy of power anomaly detection and positioning of electronic devices.

[0115] It should be understood that in the above-mentioned various embodiments, the size of the sequence number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0116] It should also be understood that the specific examples herein are only intended to help those skilled in the art better understand the embodiments of the present application, and do not limit the scope of the embodiments of the present application. The various implementations described in this specification can be implemented individually or in combination, and the embodiments of the present application are not limited to this.

[0117] Combination of the above Figures 2 to 4 , the method embodiment provided by the present application is introduced, and the following is combined with Figure 5 and Figure 6 , the device embodiment provided by the present application is introduced. It can be understood that the device embodiment can correspond to the method embodiment above, and the actions performed by each unit or module in the device embodiment can refer to the relevant description of the method embodiment above, and no further details will be given below.

[0118] Figure 5 A schematic structural block diagram of a device 500 for detecting abnormal power consumption of a device provided in an embodiment of the present application is shown.

[0119] like Figure 5 As shown, the detection device 500 includes: an input unit 510 and a processing unit 520. The input unit 510 is used to obtain the standby log of the electronic device, and the standby log includes: a kernel log and a comprehensive log. The processing unit 520 is used to search for multiple wake-up sources in the kernel log to obtain a first analysis result of abnormal power consumption of the electronic device; based on the first analysis result, determine whether to search for multiple wake-up sources in the comprehensive log; if so, search for multiple wake-up sources in the comprehensive log to obtain a second analysis result of abnormal power consumption of the electronic device; based on the first analysis result and the second analysis result, determine the target wake-up source that causes the abnormal power consumption of the electronic device; if not, determine the target wake-up source that causes the abnormal power consumption of the electronic device based on the first analysis result.

[0120] In some possible implementations, the processing unit 520 is used to: search for keywords corresponding to multiple wake-up sources in the kernel log to obtain the number of times each of the multiple wake-up sources appears in the kernel log; calculate the proportion of each of the multiple wake-up sources to obtain a first analysis result.

[0121] In some possible implementations, the processing unit 520 is used to: determine whether the difference between the highest ratio in the first analysis result and other ratios is greater than a preset threshold; if so, search for multiple wake-up sources in the comprehensive log; if not, do not search for multiple wake-up sources in the comprehensive log.

[0122] In some possible implementations, the processing unit 520 is used to: determine at least one wake-up source corresponding to at least one target ratio in the first analysis result as at least one target wake-up source, wherein the target ratio includes: the highest ratio in the first analysis result and the second highest ratio whose difference with the highest ratio is less than a preset threshold.

[0123] In some possible implementations, the processing unit 520 is used to: merge the first analysis result and the second analysis result to form a target analysis result; determine at least one wake-up source corresponding to at least one target ratio in the target analysis result as at least one target wake-up source, wherein the target ratio includes: the highest ratio in the target analysis result and the second highest ratio whose difference with the highest ratio is less than a preset threshold.

[0124] In some possible implementations, the comprehensive log includes at least one of the following logs: a device log, a network log, and a system log.

[0125] In some possible implementations, the comprehensive log includes: a system log, and the system log includes: power information of the electronic device during standby; the processing unit 520 is also used to: determine the abnormal time period of abnormal power consumption of the electronic device based on the power information in the system log; search for multiple wake-up sources in the kernel log corresponding to the abnormal time period to obtain a first analysis result of the abnormal power consumption of the electronic device; search for multiple wake-up sources in the comprehensive log corresponding to the abnormal time period to obtain a second analysis result of the abnormal power consumption of the electronic device.

[0126] In some possible implementations, the target wake-up source includes: a data transmission wake-up source, and the comprehensive log includes: a network log; the processing unit 520 is also used to: query the IP address of the data transmission wake-up source in the network log; according to the IP address, divide the data transmission wake-up source into at least one type and count the proportion of each type; analyze the data transmission wake-up source according to the type and proportion of the data transmission wake-up source.

[0127] In some possible implementations, the data transmission wakeup source includes: a GMS data transmission wakeup source.

[0128] In some possible implementations, the multiple wakeup sources include at least one of the following wakeup sources: an external interrupt wakeup source, a network connection wakeup source, a communication wakeup source, a power wakeup source, and a communication control interface wakeup source.

[0129] Optionally, the device 500 may be Figure 1 The processor in the analysis machine 110 shown in FIG. The input unit 510 is an input interface of the processor, and the processing unit 520 may include a hardware module and a software module of the processor, and the software module may be a tool software.

[0130] Figure 6 A schematic structural block diagram of another device power consumption abnormality detection apparatus 600 provided in an embodiment of the present application is shown.

[0131] like Figure 6 As shown, the detection device 600 includes: a processor 610 and a memory 620, the memory 620 is used to store a computer program, and the processor 610 is used to call and run the computer program stored in the memory 620 to execute: the device power consumption abnormality detection method provided in any of the above embodiments. The computer program may include tool software.

[0132] An embodiment of the present application also provides a computer storage medium on which a computer program is stored, and the computer program is used to execute: a method for detecting abnormal power consumption of a device provided in any of the above embodiments.

[0133] An embodiment of the present application also provides a computer program product including a computer program, wherein the computer program is used to execute the method for detecting abnormal power consumption of a device provided in any of the above embodiments.

[0134] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0135] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0136] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0137] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0138] In addition, each functional unit in each embodiment of the present application 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.

[0139] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0140] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for detecting abnormal power consumption of a device, characterized in that: include: Acquire a standby log of the electronic device, wherein the standby log includes: a kernel log and a comprehensive log; Searching for multiple wake-up sources in the kernel log to obtain a first analysis result of abnormal power consumption of the electronic device; determining, according to the first analysis result, whether to search the comprehensive log for the multiple wakeup sources; If so, searching the comprehensive log for the multiple wake-up sources to obtain a second analysis result of abnormal power consumption of the electronic device; Determining a target wakeup source causing abnormal power consumption of the electronic device according to the first analysis result and the second analysis result; If not, determine the target wakeup source causing the abnormal power consumption of the electronic device according to the first analysis result.

2. The detection method according to claim 1, characterized in that The searching for multiple wake-up sources in the kernel log to obtain a first analysis result of abnormal power consumption of the electronic device includes: Searching the kernel log for keywords corresponding to the multiple wakeup sources to obtain the number of times each of the multiple wakeup sources appears in the kernel log; The ratio of each of the multiple wake-up sources is calculated to obtain the first analysis result.

3. The detection method according to claim 2, characterized in that: The determining, according to the first analysis result, whether to search the comprehensive log for the multiple wakeup sources includes: Determine whether the difference between the highest ratio and other ratios in the first analysis result is greater than a preset threshold; If so, searching the comprehensive log for the multiple wakeup sources; If not, the multiple wakeup sources are not searched in the integrated log.

4. The detection method according to claim 2, characterized in that: The determining, according to the first analysis result, a target wakeup source causing abnormal power consumption of the electronic device includes: At least one wake-up source corresponding to at least one target ratio in the first analysis result is determined as at least one target wake-up source, wherein the target ratio includes: a highest ratio in the first analysis result and a second highest ratio whose difference with the highest ratio is less than a preset threshold.

5. The detection method according to claim 2, characterized in that: The determining, according to the first analysis result and the second analysis result, a target wakeup source causing abnormal power consumption of the electronic device includes: Combining the first analysis result and the second analysis result to form a target analysis result; At least one wake-up source corresponding to at least one target ratio in the target analysis result is determined as at least one target wake-up source, wherein the target ratio includes: a highest ratio in the target analysis result and a second highest ratio whose difference with the highest ratio is less than a preset threshold.

6. The detection method according to any one of claims 1 to 5, characterized in that: The comprehensive log includes at least one of the following logs: a device log, a network log, and a system log.

7. The detection method according to any one of claims 1 to 5, characterized in that: The comprehensive log includes: a system log, and the system log includes: power information of the electronic device during standby; Before searching the kernel log for multiple wakeup sources, the detection method further includes: Determine, based on the power information in the system log, an abnormal time period during which the power consumption of the electronic device is abnormal; Searching for multiple wakeup sources in the kernel log to obtain a first analysis result of abnormal power consumption of the electronic device includes: Searching the multiple wake-up sources in the kernel log corresponding to the abnormal time period to obtain a first analysis result of the abnormal power consumption of the electronic device; Searching the multiple wake-up sources in the comprehensive log to obtain a second analysis result of abnormal power consumption of the electronic device includes: The multiple wake-up sources are searched in the comprehensive log corresponding to the abnormal time period to obtain a second analysis result of the abnormal power consumption of the electronic device.

8. The detection method according to any one of claims 1 to 5, characterized in that: The target wakeup source includes: a data transmission wakeup source, and the comprehensive log includes: a network log; The detection method further comprises: Querying the network log for the IP address of the data transmission wake-up source; According to the IP address, the data transmission wake-up source is divided into at least one type and the proportion of each type is counted; The data transmission wakeup sources are analyzed according to the types and proportions of the data transmission wakeup sources.

9. The detection method according to claim 8, characterized in that: The data transmission wakeup source includes: a GMS data transmission wakeup source.

10. The detection method according to any one of claims 1 to 5, characterized in that: The multiple wakeup sources include at least one of the following wakeup sources: an external interrupt wakeup source, a network connection wakeup source, a communication wakeup source, a power wakeup source, and a communication control interface wakeup source.

11. A device for detecting abnormal power consumption of a device, characterized in that: include: An input unit, used to obtain a standby log of the electronic device, wherein the standby log includes: a kernel log and a comprehensive log; A processing unit, configured to search the kernel log for a plurality of wake-up sources to obtain a first analysis result of abnormal power consumption of the electronic device; determining, according to the first analysis result, whether to search the comprehensive log for the multiple wakeup sources; If so, searching the comprehensive log for the multiple wake-up sources to obtain a second analysis result of abnormal power consumption of the electronic device; Determining a target wakeup source causing abnormal power consumption of the electronic device according to the first analysis result and the second analysis result; If not, determine the target wakeup source causing the abnormal power consumption of the electronic device according to the first analysis result.

12. The detection device according to claim 11, characterized in that: The processing unit is used for: Searching the kernel log for keywords corresponding to the multiple wakeup sources to obtain the number of times each of the multiple wakeup sources appears in the kernel log; The ratio of each of the multiple wake-up sources is calculated to obtain the first analysis result.

13. The detection device according to claim 12, characterized in that: The processing unit is used for: Determine whether the difference between the highest ratio and other ratios in the first analysis result is greater than a preset threshold; If so, searching the comprehensive log for the multiple wakeup sources; If not, the multiple wakeup sources are not searched in the integrated log.

14. The detection device according to claim 12, characterized in that: The processing unit is used for: At least one wake-up source corresponding to at least one target ratio in the first analysis result is determined as at least one target wake-up source, wherein the target ratio includes: a highest ratio in the first analysis result and a second highest ratio whose difference with the highest ratio is less than a preset threshold.

15. The detection device according to claim 12, characterized in that: The processing unit is used for: Combining the first analysis result and the second analysis result to form a target analysis result; At least one wake-up source corresponding to at least one target ratio in the target analysis result is determined as at least one target wake-up source, wherein the target ratio includes: a highest ratio in the target analysis result and a second highest ratio whose difference with the highest ratio is less than a preset threshold.

16. The detection device according to any one of claims 11 to 15, characterized in that: The comprehensive log includes at least one of the following logs: a device log, a network log, and a system log.

17. The detection device according to any one of claims 11 to 15, characterized in that: The comprehensive log includes: a system log, and the system log includes: power information of the electronic device during standby; The processing unit is further used to: determine the abnormal time period of the abnormal power consumption of the electronic device according to the power information in the system log; Searching the multiple wake-up sources in the kernel log corresponding to the abnormal time period to obtain a first analysis result of the abnormal power consumption of the electronic device; The multiple wake-up sources are searched in the comprehensive log corresponding to the abnormal time period to obtain a second analysis result of the abnormal power consumption of the electronic device.

18. The detection device according to any one of claims 11 to 15, characterized in that: The target wakeup source includes: a data transmission wakeup source, and the comprehensive log includes: a network log; The processing unit is further used to: query the IP address of the data transmission wake-up source in the network log; According to the IP address, the data transmission wake-up source is divided into at least one type and the proportion of each type is counted; The data transmission wakeup sources are analyzed according to the types and proportions of the data transmission wakeup sources.

19. The detection device according to claim 18, characterized in that: The data transmission wakeup source includes: a GMS data transmission wakeup source.

20. The detection device according to any one of claims 11 to 15, characterized in that: The multiple wakeup sources include at least one of the following wakeup sources: an external interrupt wakeup source, a network connection wakeup source, a communication wakeup source, a power wakeup source, and a communication control interface wakeup source.

21. A device for detecting abnormal power consumption of a device, characterized in that: include: A processor and a memory, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to execute: the detection method according to any one of claims 1 to 10.

22. A computer storage medium, characterized in that A computer program is stored, and the computer program is used to execute: the detection method according to any one of claims 1 to 10.