Power consumption detection method and device, electronic equipment and storage medium
1. A method for detecting power consumption, comprising:
monitoring the low power consumption mode state of a test end;
when the test end is monitored to enter the low power consumption mode and/or exit the low power consumption mode, power consumption behavior data of a target power consumption module are obtained;
and determining a power consumption related quantity based on the power consumption behavior data, wherein the power consumption related quantity is used for representing whether the power consumption of the target power consumption module is abnormal or not.
2. The power consumption detection method according to claim 1, wherein the target power consumption module includes a subsystem of the test terminal, and the power consumption behavior data includes a low power consumption mode time and a sleep time of the subsystem;
when the test end is monitored to enter the low power consumption mode and/or exit the low power consumption mode, acquiring power consumption behavior data of a target power consumption module, wherein the power consumption behavior data comprises the following steps:
when the test end is monitored to enter the low power consumption mode, recording a first moment when the test end enters the low power consumption mode;
when the test end is monitored to exit the low power consumption mode, recording a second moment when the test end exits the low power consumption mode, and acquiring sleep time data of the subsystem by reading related nodes of the subsystem;
determining the low power consumption mode time based on a difference between the second time and the first time, and determining a sleep time of the subsystem based on the sleep time data.
3. The power consumption detection method of claim 2, wherein the subsystem comprises: at least one of an application processor subsystem, a modem processor subsystem, an audio digital signal processing subsystem, a computational digital signal processing subsystem, and a sensor low power island subsystem.
4. The power consumption detection method according to claim 2, wherein determining the power consumption related quantity based on the power consumption behavior data comprises:
taking a ratio of the sleep time of the subsystem to the low power consumption mode time as a sleep percentage of the subsystem, the sleep percentage of the subsystem being the power consumption related quantity.
5. The power consumption detection method according to claim 1, wherein the target power consumption module comprises a framework layer device of the test end, and the power consumption behavior data comprises a use state of the framework layer device and a switch state of a corresponding general purpose input/output pin;
when the test end is monitored to enter the low power consumption mode and/or exit the low power consumption mode, acquiring power consumption behavior data of a target power consumption module, wherein the power consumption behavior data comprises the following steps:
when the test end is monitored to enter a low power consumption mode or exit the low power consumption mode, reading feedback data used for representing the use state, and obtaining the switch state data of the general input and output pin by reading a relevant node or chip of the general input and output pin;
determining the use state based on the feedback data and determining the switch state based on the switch state data.
6. The power consumption detection method of claim 5, wherein the frame layer device comprises at least one of a screen, a front light emitting diode, a rear light emitting diode, a flash, and a headset.
7. The power consumption detection method according to claim 5, wherein determining the power consumption related quantity based on the power consumption behavior data comprises:
and matching the use state with the switch state to obtain the matching degree between the frame layer equipment and the corresponding general input/output pins, wherein the matching degree is the related quantity of the power consumption.
8. The power consumption detection method according to claim 1, wherein after determining the power consumption-related quantity based on the power consumption behavior data, the method further comprises:
counting the power consumption related quantity of the target power consumption module aiming at the same system version; alternatively, the first and second electrodes may be,
and respectively counting the power consumption related quantity of the target power consumption module aiming at different system versions.
9. The power consumption detection method according to claim 8,
after counting the power consumption related quantity of the target power consumption module for the same system version, the method further comprises:
displaying a variation curve of the power consumption related quantity of the target power consumption module with respect to time; alternatively, the first and second electrodes may be,
after respectively counting the power consumption related quantities of the target power consumption module for different system versions, the method further includes:
and displaying a change curve of the power consumption related quantity of the target power consumption module relative to the system version.
10. The power consumption detection method according to claim 1, wherein determining the power consumption related quantity based on the power consumption behavior data comprises:
sending the power consumption behavior data to a cloud;
determining, via the cloud, the power consumption-related quantity based on the power consumption behavior data.
11. A power consumption detection apparatus, comprising:
the state monitoring unit is used for monitoring the low power consumption mode state of the test end;
the power consumption data acquisition unit is used for acquiring power consumption behavior data of a target power consumption module when the test end is monitored to enter a low power consumption mode and/or exit the low power consumption mode;
and the power consumption related quantity determining unit is used for determining the power consumption related quantity based on the power consumption behavior data, and the power consumption related quantity is used for representing whether the power consumption of the target power consumption module is abnormal or not.
12. An electronic device, characterized in that the electronic device comprises:
a processor;
a memory for storing the processor-executable instructions;
the processor is configured to read the executable instructions from the memory and execute the instructions to implement the power consumption detection method of any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that the storage medium stores a computer program for executing the power consumption detection method of any of the above claims 1-10.
Background
With the widespread use of intelligent electronic devices, people generally expect that the intelligent electronic devices can be used for a long time after being charged once. Extending the endurance time and reducing the power consumption of the device are the current development directions of intelligent electronic devices and strong demands of users.
After the intelligent electronic device is not plugged with a power supply, the screen is closed and is in a static state for a period of time, the device enters a low power consumption mode. In the low power consumption mode, the system may attempt to conserve power by limiting the access of applications to network and CPU intensive services. Normally, the main power consuming device goes to a sleep state after the device goes into the low power consumption mode. However, some abnormal problems of the device may cause some application programs to still use the main power consumption device in the low power consumption mode, so that the main power consumption device cannot enter the sleep state, and the power consumption of the device is abnormal. Therefore, in the low power consumption mode, how to accurately detect the power consumption device with abnormal power consumption to repair the abnormal power consumption becomes a problem to be solved by related testing personnel.
Disclosure of Invention
To solve the technical problem or at least partially solve the technical problem, the present disclosure provides a power consumption detection method, apparatus, electronic device, and storage medium.
The embodiment of the disclosure provides a power consumption detection method, which includes:
monitoring the low power consumption mode state of a test end;
when the test end is monitored to enter the low power consumption mode and/or exit the low power consumption mode, power consumption behavior data of a target power consumption module are obtained;
and determining a power consumption related quantity based on the power consumption behavior data, wherein the power consumption related quantity is used for representing whether the power consumption of the target power consumption module is abnormal or not.
The embodiment of the present disclosure further provides a power consumption detection apparatus, including:
the state monitoring unit is used for monitoring the low power consumption mode state of the test end;
the power consumption data acquisition unit is used for acquiring power consumption behavior data of a target power consumption module when the test end is monitored to enter a low power consumption mode and/or exit the low power consumption mode;
and the power consumption related quantity determining unit is used for determining the power consumption related quantity based on the power consumption behavior data, and the power consumption related quantity is used for representing whether the power consumption of the target power consumption module is abnormal or not.
An embodiment of the present disclosure further provides an electronic device, which includes: a processor; a memory for storing the processor-executable instructions; the processor is used for reading the executable instruction from the memory and executing the instruction to realize the power consumption detection method provided by the embodiment of the disclosure.
The embodiment of the disclosure also provides a computer-readable storage medium, which stores a computer program for executing the power consumption detection method provided by the embodiment of the disclosure.
Compared with the prior art, the technical scheme provided by the embodiment of the disclosure has the following advantages:
according to the technical scheme provided by the embodiment of the disclosure, when the test end is monitored to enter the low power consumption mode and/or exit the low power consumption mode, the power consumption behavior data of the target power consumption module is obtained, and the power consumption related quantity of the target power consumption module is determined based on the power consumption behavior data. Therefore, the power consumption module with abnormal power consumption can be analyzed based on the related power consumption quantity, and a reliable basis is provided for repairing the abnormal power consumption.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale.
Fig. 1 is an application scenario diagram of a power consumption detection method in an embodiment of the present disclosure;
fig. 2 is a schematic flow chart of a power consumption detection method in an embodiment of the present disclosure;
fig. 3 is a block diagram of a power consumption detection apparatus in an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of an electronic device in an embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
Under normal conditions, when the tester is in a low power consumption mode, all applications stop using the device resources, i.e., the power consuming modules. However, some white list applications set by manufacturers can still use part of the power consumption modules, so that the part of the power consumption modules cannot sleep, and the power consumption problem is caused.
In order to solve the above problem, an embodiment of the present disclosure provides a power consumption detection method, which can effectively analyze a power consumption module with abnormal power consumption based on the power consumption related quantity obtained by the method. The method is described below with reference to specific examples.
In some embodiments, the power consumption detection method provided by the embodiments of the present disclosure may be applied to an application environment as shown in fig. 1. The power consumption detection method is applied to a power consumption detection system, and the power consumption detection system comprises a test end 1, a cloud end 2 and a data processing end 3. The testing terminal 1 and the cloud terminal 2 communicate through a network, and the data processing terminal 3 and the cloud terminal 2 communicate through the network. The testing terminal 1 includes but is not limited to various personal computers, notebook computers, smart phones, tablet computers and portable wearable devices, the cloud terminal 2 may be a server or a server cluster formed by a plurality of servers, and the data processing terminal 3 may be a computer or other devices with data processing functions. In this embodiment, the test end 1 monitors the low power consumption mode state of the test end, acquires the power consumption behavior data of the target power consumption module when monitoring that the test end enters the low power consumption mode and/or exits the low power consumption mode, and sends the power consumption behavior data to the cloud end 2; the cloud 2 stores power consumption behavior data; the data processing terminal 3 acquires power consumption behavior data from the cloud terminal 2, and determines power consumption related quantity based on the power consumption behavior data.
In some embodiments, the cloud 2 may also determine the power consumption related quantity based on the power consumption behavior data, and the data processing terminal 3 directly obtains the power consumption related quantity from the cloud 2.
In some embodiments, the power consumption detection system may include the test terminal 1 and the data processing terminal 3, instead of the cloud terminal 2. At this time, the test terminal 1 directly transmits the power consumption behavior data to the data processing terminal 3, and the data processing terminal 3 determines the power consumption related quantity based on the power consumption behavior data.
In some embodiments, the power consumption detection system may include only the test terminal 1, and not include the cloud terminal 2 and the data processing terminal 3. At this time, the test terminal 1 acquires power consumption behavior data of the target power consumption module, and determines the power consumption related quantity directly based on the power consumption behavior data.
Fig. 2 is a schematic flow chart of a power consumption detection method provided by an embodiment of the present disclosure, where the method is suitable for detecting abnormal power consumption of an intelligent electronic device in a research and development stage to find a problem of the abnormal power consumption in advance. The method may be performed by a power consumption detection apparatus, wherein the apparatus may be implemented in software and/or hardware, and may generally be integrated in an electronic device. As shown in fig. 2, the method includes:
step 101, monitoring the low power consumption mode state of the test terminal.
Wherein the low power consumption mode state comprises entering the low power consumption mode or exiting the low power consumption mode or being in the low power consumption mode. After the test machine is not plugged with a power supply, the screen is closed and is in a static state for a period of time, the test machine enters a low power consumption mode, and the state of the low power consumption mode is updated to enter the low power consumption mode. When the user wakes up the tester by moving the tester, turning on the screen or connecting to a charger, the system immediately exits the low power consumption mode, and the state of the low power consumption mode is updated to exit the low power consumption mode.
In some embodiments, the low power consumption mode state may be characterized by a low power consumption mode identification. For example, the low power consumption mode state corresponds to a low power consumption mode identifier, for example, 0 or 1, 0 may indicate entering the low power consumption mode, 1 may indicate exiting the low power consumption mode, and the tester may determine the low power consumption mode state by querying the low power consumption mode identifier in real time.
And 102, acquiring power consumption behavior data of the target power consumption module when the test end is monitored to enter the low power consumption mode and/or exit the low power consumption mode.
In the embodiment of the present disclosure, whether to enter the low power consumption mode or exit the low power consumption mode may be determined by monitoring whether the low power consumption mode identifier changes, for example, when it is monitored that the low power consumption mode identifier changes from 1 to 0, it is determined that the test machine enters the low power consumption mode; when the low power consumption mode identification is changed from 0 to 1, the testing machine is judged to exit the low power consumption mode.
In the embodiment of the present disclosure, the target power consuming module may be a subsystem of the testing end, or may be a frame layer device of the testing end. The power consumption behavior data refers to data related to power consumption.
In some embodiments, the target power consumption module includes a subsystem of the test end, and the power consumption behavior data includes a low power consumption mode time, i.e., a time when the tester is in a low power consumption mode, and a sleep time of the subsystem.
Correspondingly, when the test end is monitored to enter the low power consumption mode and/or exit the low power consumption mode, the power consumption behavior data of the target power consumption module is obtained, and the method comprises the following steps:
step 1021, when it is monitored that the test end enters the low power consumption mode, recording a first moment when the test end enters the low power consumption mode.
Based on the above scheme, the time when the low power consumption mode state is updated can be used as the time when the low power consumption mode is entered or exited. For example, when the low power consumption mode state is updated to enter the low power consumption mode, the time of the state update is regarded as the first time when the low power consumption mode is entered, and the first time is recorded.
And step 1022, when it is monitored that the test end exits the low power consumption mode, recording a second time when the test end exits the low power consumption mode, and acquiring sleep time data of the subsystem by reading related nodes of the subsystem.
Similarly, when the state of the low power consumption mode is updated to exit the low power consumption mode, the second time may be recorded by taking the time of the state update as the second time when the low power consumption mode exits.
In some embodiments, the subsystem comprises: at least one of an application processor subsystem, a modem processor subsystem, an audio digital signal processing subsystem, a computational digital signal processing subsystem, and a sensor low power island subsystem. In the embodiment of the present disclosure, the sleep time data of the subsystem is recorded in the relevant node of the subsystem, and for example, the reading node: system/power/system sleep/states, can acquire sleep time data of at least one subsystem of the application processor subsystem, modem processor subsystem, audio digital signal processing subsystem, computing digital signal processing subsystem and sensor low power island subsystem. The sleep time data corresponds to the sleep time data between the first time and the second time.
In addition, the subsystem may further include wifi (wireless network), and the wifi sleep time data may be acquired through the dumpwifi sleep state in consideration of the fact that wifi does not have a node for recording the sleep time data.
Step 1023 determines a low power consumption mode time based on the difference between the second time and the first time, and determines a sleep time of the subsystem based on the sleep time data.
In this embodiment, subtracting the second time from the second time is the low power consumption mode time; after the sleep time data are acquired, the sleep time of the subsystem can be obtained by converting the sleep time data into seconds. It can be understood that the larger the ratio of the sleep time to the low power consumption mode time is, the better the sleep effect of the subsystem is, and the more normal the power consumption of the subsystem is.
In some embodiments, the target power consuming module comprises a framework layer device at the test end, and the power consuming behavior data comprises a use state of the framework layer device and a switch state of a corresponding general purpose input output pin.
Correspondingly, when the test end is monitored to enter the low power consumption mode and/or exit the low power consumption mode, the power consumption behavior data of the target power consumption module is obtained, and the method comprises the following steps:
step 1021', when it is monitored that the test end enters the low power consumption mode or exits the low power consumption mode, reading feedback data for representing the use state, and obtaining the switch state data of the general input/output pin by reading a relevant node or chip of the general input/output pin.
In some embodiments, the frame layer devices are hardware power consuming devices, and the frame layer devices have a one-to-one correspondence with the general purpose input/output pins. Optionally, the frame layer device includes at least one of a screen, a front led, a rear led, a flash, and a headset.
Normally, the feedback data and the switch state data are matched at any time, namely, the same use state of the frame layer equipment is represented. However, when the usage state of the framework layer device is abnormal (corresponding to abnormal power consumption), the feedback data and the switch state data cannot be matched, that is, different usage states of the framework layer device are represented.
For example, when the frame layer device is a screen, the screen may send out a broadcast when being turned on and off, and the system records the current screen status (on or off) based on the broadcast, that is, feedback data, which may be represented by 0 or 1. Correspondingly, the relevant node or chip of the gpio pin records the switching status data of the gpio pin, which can also be represented by 0 or 1. When the frame layer equipment is a front light-emitting diode or a rear light-emitting diode, a notehlingon is called when the front light-emitting diode or the rear light-emitting diode is lightened, the current light-emitting state of the front light-emitting diode or the rear light-emitting diode can be recorded, namely feedback data can be recorded, and the feedback data can be represented by 1; when the front led or the rear led is turned off, noteFlash off is called, and the current lighting state of the front led or the rear led, i.e. feedback data, may be recorded, where the feedback data may be represented by 0.
Step 1022', determine a use state based on the feedback data, and determine a switch state based on the switch state data.
Illustratively, the feedback data includes 0 or 1, and when the feedback data is 0, the use state of the frame layer device is use, such as screen lighting, front led or rear led lighting, flash lamp turning on or headphone insertion; when the feedback data is 1, the using state of the frame layer device is unused, such as screen off, front led or rear led off, flash off or earphone unplugging. The switch state data comprises 0 or 1, and when the switch state data is 0, the switch state is closed; when the switch state data is 1, the switch state is open.
And 103, determining the related quantity of the power consumption based on the power consumption behavior data.
In an embodiment of the present invention, the test machine may upload the power consumption behavior data to the cloud in real time, that is, the test machine uploads the power consumption behavior data to the cloud after acquiring the power consumption behavior data; or, the test machine may upload the power consumption behavior data to the cloud at regular time, for example, after the test machine acquires the power consumption behavior data each time, the power consumption behavior data is cached, and when a preset time (for example, one day) is reached, all the power consumption behavior data acquired within the preset time are uploaded to the cloud at one time. Correspondingly, the data processing end can acquire the power consumption behavior data uploaded by the testing machine from the cloud end in real time, or the data processing end can acquire the power consumption behavior data uploaded by the testing machine from the cloud end at regular time. In another embodiment of this embodiment, the test machine sends the power consumption behavior data to the cloud; determining, via the cloud, a power consumption-related quantity based on the power consumption behavior data. And then, the data processing end can acquire the power consumption related quantity from the cloud end.
In the embodiment of the present disclosure, the power consumption related quantity is used to characterize whether the power consumption of the target power consumption module is abnormal.
In some embodiments, the target power consumption module includes a subsystem of the test terminal, and the power consumption behavior data includes a low power consumption mode time and a sleep time of the subsystem.
Correspondingly, the determining of the power consumption related quantity based on the power consumption behavior data comprises:
and taking the ratio of the sleep time of the subsystem to the low power consumption mode time as the sleep percentage of the subsystem, wherein the sleep percentage of the subsystem is the power consumption related quantity.
In some embodiments, the power consumption related quantity is a sleep percentage of the subsystem, i.e., a ratio of a sleep time of the subsystem to a low power consumption mode time. Generally, when the sleep percentage of the subsystem is greater than or equal to a sleep percentage threshold (e.g., 95%), it may be determined that the power consumption of the subsystem is normal; when the sleep percentage of the subsystem is less than a sleep percentage threshold (e.g., 95%), a power consumption anomaly of the subsystem may be determined.
In some embodiments, the target power consuming module comprises a framework layer device at the test end, and the power consuming behavior data comprises a use state of the framework layer device and a switch state of a corresponding general purpose input output pin.
Correspondingly, the determining of the power consumption related quantity based on the power consumption behavior data comprises:
and matching the use state with the switch state to obtain the matching degree between the frame layer equipment and the corresponding universal input/output pin, wherein the matching degree is the related quantity of power consumption.
In some embodiments, the degree of match includes a match or a mismatch. The power consumption related quantity is the matching degree between the frame layer device and the corresponding general input/output pin, namely whether the use state of the frame layer device is matched with the switch state of the corresponding general input/output pin. Illustratively, the use state of the framework layer device and the switch state of the corresponding general input/output pin have a preset corresponding relationship. If the using state of the frame layer equipment and the switching state of the corresponding general input/output pin meet the preset corresponding relation, the using state of the frame layer equipment is matched with the switching state of the corresponding general input/output pin, namely the frame layer equipment is matched with the corresponding general input/output pin, and the power consumption of the frame layer equipment can be judged to be normal; otherwise, the service state of the frame layer device is not matched with the switch state of the corresponding general input/output pin, that is, the frame layer device is not matched with the corresponding general input/output pin, and the power consumption abnormality of the frame layer device can be judged.
According to the power consumption detection scheme provided by the embodiment of the disclosure, when the low power consumption mode state is triggered, the power consumption behavior data of the target power consumption module is obtained, and whether the power consumption of the target power consumption module is abnormal or not is determined based on the power consumption behavior data, so that the power consumption module with abnormal power consumption can be analyzed based on the power consumption related quantity, and a reliable basis is provided for repairing the power consumption abnormality.
In some embodiments, the power consumption related quantity can be analyzed for the same or different system versions, so that more comprehensive analysis on power consumption modules with abnormal power consumption can be realized.
In some embodiments, after determining the power consumption related amount based on the power consumption behavior data, the power consumption detection method may further include: counting the power consumption related quantity of a target power consumption module aiming at the same system version; and showing a change curve of the power consumption related quantity of the target power consumption module with respect to time.
Exemplarily, system version information sent by a test end is received, and a system version is determined based on the system version information (the test end can adjust the system version); respectively counting the power consumption related quantity of each target power consumption module aiming at the same system version; and showing a change curve of the power consumption related quantity of each target power consumption module with respect to time. In one embodiment, the change curve of the power consumption related quantity of each target power consumption module with respect to time may be displayed in different interfaces or different coordinate systems according to the type of the target power consumption module. For example, the target power consumption module may be divided into subsystems and framework layer devices according to types, a variation curve of the power consumption related quantity of all the subsystems with respect to time is displayed in a first interface or a first coordinate system, a variation curve of the power consumption related quantity of all the framework layer devices with respect to time is displayed in a second interface or a second coordinate system, the first interface and the second interface are different interfaces, and the first coordinate system and the second coordinate system are different coordinate systems. Therefore, by counting the power consumption related quantity of the target power consumption module, the judgment error of abnormal power consumption caused by the error of single data can be avoided, the accuracy of judging the abnormal power consumption is improved, and meanwhile, the power consumption modules with abnormal power consumption under the same system version can be compared more visually.
In some embodiments, after determining the power consumption related amount based on the power consumption behavior data, the power consumption detection method may further include: respectively counting the power consumption related quantity of the target power consumption module aiming at different system versions; and showing a change curve of the power consumption related quantity of the target power consumption module relative to the system version.
Exemplarily, system version information sent by a test end is received, and a system version is determined based on the system version information (the test end can adjust the system version); respectively counting the power consumption related quantity of each target power consumption module aiming at different system versions; and showing a change curve of the power consumption related quantity of each target power consumption module relative to the system version. The manner of displaying the change curve of the power consumption related quantity with respect to the system version in this embodiment may be the same as the manner of displaying the change curve of the power consumption related quantity with respect to time in the above embodiment, and details are not repeated here. Therefore, the influence of the upgrading or the decline of the system version on the power consumption of the power consumption module can be visually seen.
Fig. 3 is a schematic structural diagram of a power consumption detection apparatus provided in an embodiment of the present disclosure, where the power consumption detection apparatus may be implemented by software and/or hardware, and may be generally integrated in an electronic device. As shown in fig. 3, the apparatus includes:
a state monitoring unit 201, configured to monitor a low power consumption mode state of a test end;
the power consumption data acquisition unit 202 is configured to acquire power consumption behavior data of the target power consumption module when it is monitored that the test end enters the low power consumption mode and/or exits the low power consumption mode;
a power consumption related quantity determining unit 203, configured to determine a power consumption related quantity based on the power consumption behavior data, where the power consumption related quantity is used to characterize whether the power consumption of the target power consumption module is abnormal.
In some embodiments, the target power consumption module comprises a subsystem of the test terminal, and the power consumption behavior data comprises a low power consumption mode time and a sleep time of the subsystem;
the power consumption data obtaining unit 202 is specifically configured to:
recording a first moment when the test end enters the low power consumption mode;
when the test end is monitored to exit the low power consumption mode, recording a second moment when the test end exits the low power consumption mode, and acquiring sleep time data of the subsystem through reading related nodes of the subsystem;
determining a low power consumption mode time based on a difference between the second time and the first time, and determining a sleep time of the subsystem based on the sleep time data.
In some embodiments, the subsystem comprises: at least one of an application processor subsystem, a modem processor subsystem, an audio digital signal processing subsystem, a computational digital signal processing subsystem, and a sensor low power island subsystem.
In some embodiments, the power consumption related quantity determining unit 203 is specifically configured to:
and taking the ratio of the sleep time of the subsystem to the low power consumption mode time as the sleep percentage of the subsystem, wherein the sleep percentage of the subsystem is the power consumption related quantity.
In some embodiments, the target power consumption module includes a framework layer device of the test end, and the power consumption behavior data includes a use state of the framework layer device and a switch state of a corresponding general input/output pin;
the power consumption data obtaining unit 202 is specifically configured to:
when the test end is monitored to enter the low power consumption mode or exit the low power consumption mode, reading feedback data for representing the use state, and acquiring the switch state data of the general input and output pin by reading a relevant node or chip of the general input and output pin;
the use state is determined based on the feedback data and the switch state is determined based on the switch state data.
In some embodiments, the frame layer device includes at least one of a screen, a front light emitting diode, a rear light emitting diode, a flash, and a headset.
In some embodiments, the power consumption related quantity determining unit 203 is specifically configured to:
and matching the use state with the switch state to obtain the matching degree between the frame layer equipment and the corresponding universal input/output pin, wherein the matching degree is the related quantity of power consumption.
In some embodiments, the power consumption detection apparatus further comprises: the power consumption related quantity counting unit is used for counting the power consumption related quantity of the target power consumption module aiming at the same system version after determining the power consumption related quantity based on the power consumption behavior data; alternatively, the first and second electrodes may be,
and respectively counting the power consumption related quantity of the target power consumption module aiming at different system versions.
In some embodiments, the power consumption detection apparatus further comprises: the display unit is used for displaying a change curve of the power consumption related quantity of the target power consumption module with respect to time after the power consumption related quantity of the target power consumption module is counted aiming at the same system version; alternatively, the first and second electrodes may be,
after the power consumption related quantities of the target power consumption module are respectively counted aiming at different system versions, a change curve of the power consumption related quantities of the target power consumption module relative to the system versions is displayed.
In some embodiments, the power consumption related quantity determining unit is specifically configured to:
sending the power consumption behavior data to a cloud;
determining, via the cloud, a power consumption-related quantity based on the power consumption behavior data.
The power consumption detection device provided by the embodiment of the disclosure can execute the power consumption detection method provided by the corresponding embodiment of the disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
Embodiments of the present disclosure also provide a computer program product, which includes a computer program/instruction, and when the computer program/instruction is executed by a processor, the steps of the power consumption detection method provided in any embodiment of the present disclosure are implemented.
Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
Referring now specifically to fig. 4, a schematic diagram of an electronic device 300 suitable for use in implementing embodiments of the present disclosure is shown. The electronic device 300 in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle-mounted terminal (e.g., a car navigation terminal), etc., and a stationary terminal such as a digital TV, a desktop computer, etc. The electronic device shown in fig. 4 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 4, the electronic device 300 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 301 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)302 or a program loaded from a storage means 308 into a Random Access Memory (RAM) 303. In the RAM303, various programs and data necessary for the operation of the electronic apparatus 300 are also stored. The processing device 301, the ROM 302, and the RAM303 are connected to each other via a bus 304. An input/output (I/O) interface 305 is also connected to bus 304.
Generally, the following devices may be connected to the I/O interface 305: input devices 306 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 307 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage devices 308 including, for example, magnetic tape, hard disk, etc.; and a communication device 309. The communication means 309 may allow the electronic device 300 to communicate wirelessly or by wire with other devices to exchange data. While fig. 4 illustrates an electronic device 300 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication means 309, or installed from the storage means 308, or installed from the ROM 302. The computer program performs the above-described functions defined in the power consumption detection method of the embodiment of the present disclosure when executed by the processing apparatus 301.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: monitoring the low power consumption mode state of a test end; when monitoring that the test end enters a low power consumption mode and/or exits the low power consumption mode, acquiring power consumption behavior data of a target power consumption module; and determining a power consumption related quantity based on the power consumption behavior data, wherein the power consumption related quantity is used for representing whether the power consumption of the target power consumption module is abnormal or not.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of an element does not in some cases constitute a limitation on the element itself.
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
According to one or more embodiments of the present disclosure, there is provided a power consumption detection method including:
monitoring the low power consumption mode state of a test end;
when the test end is monitored to enter the low power consumption mode and/or exit the low power consumption mode, power consumption behavior data of a target power consumption module are obtained;
and determining a power consumption related quantity based on the power consumption behavior data, wherein the power consumption related quantity is used for representing whether the power consumption of the target power consumption module is abnormal or not.
According to one or more embodiments of the present disclosure, in the power consumption detection method provided by the present disclosure, the target power consumption module includes a subsystem of the test terminal, and the power consumption behavior data includes a low power consumption mode time and a sleep time of the subsystem;
when the test end is monitored to enter the low power consumption mode and/or exit the low power consumption mode, acquiring power consumption behavior data of a target power consumption module, wherein the power consumption behavior data comprises the following steps:
when the test end is monitored to enter the low power consumption mode, recording a first moment when the test end enters the low power consumption mode;
when the test end is monitored to exit the low power consumption mode, recording a second moment when the test end exits the low power consumption mode, and acquiring sleep time data of the subsystem by reading related nodes of the subsystem;
determining the low power consumption mode time based on a difference between the second time and the first time, and determining a sleep time of the subsystem based on the sleep time data.
According to one or more embodiments of the present disclosure, in a power consumption detection method provided by the present disclosure, the subsystem includes: at least one of an application processor subsystem, a modem processor subsystem, an audio digital signal processing subsystem, a computational digital signal processing subsystem, and a sensor low power island subsystem.
According to one or more embodiments of the present disclosure, in a power consumption detection method provided by the present disclosure, determining a power consumption related quantity based on the power consumption behavior data includes:
taking a ratio of the sleep time of the subsystem to the low power consumption mode time as a sleep percentage of the subsystem, the sleep percentage of the subsystem being the power consumption related quantity.
According to one or more embodiments of the present disclosure, in the power consumption detection method provided by the present disclosure, the target power consumption module includes a frame layer device of the test end, and the power consumption behavior data includes a use state of the frame layer device and a switch state of a corresponding general input/output pin;
when the test end is monitored to enter the low power consumption mode and/or exit the low power consumption mode, acquiring power consumption behavior data of a target power consumption module, wherein the power consumption behavior data comprises the following steps:
when the test end is monitored to enter a low power consumption mode or exit the low power consumption mode, reading feedback data used for representing the use state, and obtaining the switch state data of the general input and output pin by reading a relevant node or chip of the general input and output pin;
determining the use state based on the feedback data and determining the switch state based on the switch state data.
According to one or more embodiments of the present disclosure, the power consumption detection method provided by the present disclosure, the frame layer device includes at least one of a screen, a front light emitting diode, a rear light emitting diode, a flash, and a headphone.
According to one or more embodiments of the present disclosure, in a power consumption detection method provided by the present disclosure, determining a power consumption related quantity based on the power consumption behavior data includes:
and matching the use state with the switch state to obtain the matching degree between the frame layer equipment and the corresponding general input/output pins, wherein the matching degree is the related quantity of the power consumption.
According to one or more embodiments of the present disclosure, in a power consumption detection method provided by the present disclosure, after determining a power consumption related quantity based on the power consumption behavior data, the method further includes:
counting the power consumption related quantity of the target power consumption module aiming at the same system version; alternatively, the first and second electrodes may be,
and respectively counting the power consumption related quantity of the target power consumption module aiming at different system versions.
According to one or more embodiments of the present disclosure, in a power consumption detection method provided by the present disclosure,
after counting the power consumption related quantity of the target power consumption module for the same system version, the method further comprises:
displaying a variation curve of the power consumption related quantity of the target power consumption module with respect to time; alternatively, the first and second electrodes may be,
after respectively counting the power consumption related quantities of the target power consumption module for different system versions, the method further includes:
and displaying a change curve of the power consumption related quantity of the target power consumption module relative to the system version.
According to one or more embodiments of the present disclosure, in a power consumption detection method provided by the present disclosure,
determining a power consumption related quantity based on the power consumption behavior data, including:
sending the power consumption behavior data to a cloud;
determining, via the cloud, the power consumption-related quantity based on the power consumption behavior data.
According to one or more embodiments of the present disclosure, there is provided a power consumption detection apparatus including:
the state monitoring unit is used for monitoring the low power consumption mode state of the test end;
the power consumption data acquisition unit is used for acquiring power consumption behavior data of a target power consumption module when the test end is monitored to enter a low power consumption mode and/or exit the low power consumption mode;
and the power consumption related quantity determining unit is used for determining the power consumption related quantity based on the power consumption behavior data, and the power consumption related quantity is used for representing whether the power consumption of the target power consumption module is abnormal or not.
According to one or more embodiments of the present disclosure, in the power consumption detection apparatus provided by the present disclosure, the target power consumption module includes a subsystem of the test terminal, and the power consumption behavior data includes a low power consumption mode time and a sleep time of the subsystem;
the power consumption data acquisition unit is specifically configured to:
when the test end is monitored to enter the low power consumption mode, recording a first moment when the test end enters the low power consumption mode;
when the test end is monitored to exit the low power consumption mode, recording a second moment when the test end exits the low power consumption mode, and acquiring sleep time data of the subsystem by reading related nodes of the subsystem;
determining the low power consumption mode time based on a difference between the second time and the first time, and determining a sleep time of the subsystem based on the sleep time data.
According to one or more embodiments of the present disclosure, in a power consumption detection apparatus provided by the present disclosure, the subsystem includes: at least one of an application processor subsystem, a modem processor subsystem, an audio digital signal processing subsystem, a computational digital signal processing subsystem, and a sensor low power island subsystem.
According to one or more embodiments of the present disclosure, in a power consumption detection apparatus provided by the present disclosure, the power consumption related quantity determining unit is specifically configured to:
taking a ratio of the sleep time of the subsystem to the low power consumption mode time as a sleep percentage of the subsystem, the sleep percentage of the subsystem being the power consumption related quantity.
According to one or more embodiments of the present disclosure, in the power consumption detection apparatus provided by the present disclosure, the target power consumption module includes a frame layer device of the test end, and the power consumption behavior data includes a use state of the frame layer device and a switch state of a corresponding general-purpose input/output pin;
the power consumption data acquisition unit is specifically configured to:
when the test end is monitored to enter a low power consumption mode or exit the low power consumption mode, reading feedback data used for representing the use state, and obtaining the switch state data of the general input and output pin by reading a relevant node or chip of the general input and output pin;
determining the use state based on the feedback data and determining the switch state based on the switch state data.
According to one or more embodiments of the present disclosure, the present disclosure provides a power consumption detection apparatus in which the frame layer device includes at least one of a screen, a front light emitting diode, a rear light emitting diode, a flash, and a headphone.
According to one or more embodiments of the present disclosure, in a power consumption detection apparatus provided by the present disclosure, the power consumption related quantity determining unit is specifically configured to:
and matching the use state with the switch state to obtain the matching degree between the frame layer equipment and the corresponding general input/output pins, wherein the matching degree is the related quantity of the power consumption.
According to one or more embodiments of the present disclosure, in a power consumption detection apparatus provided by the present disclosure, the power consumption detection apparatus further includes: the power consumption related quantity counting unit is used for counting the power consumption related quantity of the target power consumption module aiming at the same system version after determining the power consumption related quantity based on the power consumption behavior data; alternatively, the first and second electrodes may be,
and respectively counting the power consumption related quantity of the target power consumption module aiming at different system versions.
According to one or more embodiments of the present disclosure, in a power consumption detection apparatus provided by the present disclosure, the power consumption detection apparatus further includes: the display unit is used for displaying a change curve of the power consumption related quantity of the target power consumption module with respect to time after the power consumption related quantity of the target power consumption module is counted aiming at the same system version; alternatively, the first and second electrodes may be,
after the power consumption related quantities of the target power consumption module are respectively counted aiming at different system versions, a change curve of the power consumption related quantities of the target power consumption module relative to the system versions is displayed.
According to one or more embodiments of the present disclosure, in a power consumption detection apparatus provided by the present disclosure, the power consumption related quantity determining unit is specifically configured to:
sending the power consumption behavior data to a cloud;
determining, via the cloud, the power consumption-related quantity based on the power consumption behavior data.
In accordance with one or more embodiments of the present disclosure, there is provided an electronic device including:
a processor;
a memory for storing the processor-executable instructions;
the processor is used for reading the executable instructions from the memory and executing the instructions to realize the power consumption detection method provided by the disclosure.
According to one or more embodiments of the present disclosure, there is provided a computer-readable storage medium storing a computer program for executing any one of the power consumption detection methods provided by the present disclosure.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.
- 上一篇:石墨接头机器人自动装卡簧、装栓机
- 下一篇:微服务网关的动态日志记录管理方法及系统