Battery power consumption test method, device, equipment and storage medium
By analyzing the device operation log to generate a timing feature table and drawing a battery power consumption curve chart, the inefficiency problem caused by repeated manual operations in the existing battery power consumption test methods is solved, and an automated test process is realized, which improves the testing efficiency and accuracy.
Patent Information
- Application Number
- CN202411356250.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-09-27
AI Technical Summary
The existing battery power consumption testing methods have a large number of repeated manual operations, which are time-consuming and inefficient, resulting in the failure to effectively improve the testing efficiency and waste a lot of human resource costs.
By obtaining the running log of the target device, analyzing the log in response to the test instructions input by the user, obtaining a timing feature table, and generating a battery power consumption curve chart based on the timing feature table, and finally obtaining the battery power consumption test results based on the timing feature table and curve chart.
An automated battery power consumption testing process is realized, which reduces manual operations, improves test efficiency, can understand the power consumption characteristics of the equipment more intuitively, and reduces human resource costs.
Smart Images

Figure CN118884267B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a battery power consumption testing method, device, equipment and storage medium. Background Art
[0002] When testing battery performance, it is necessary to manually switch from AC to DC power supply, so after the previous test is completed, someone needs to be on duty in the test environment. In addition, after the test is completed, it is necessary to manually input test analysis commands and report output commands, take screenshots of the test results in the form of web pages, and then manually collect the required data on the web pages and generate reports.
[0003] At present, testers are still required to manually extract relevant data of the device battery, organize it into an Excel table, and then generate a battery curve in the table for analysis. There are a lot of repeated manual operations, which are time-consuming and inefficient. Therefore, the test efficiency cannot be effectively improved and a lot of human resource costs are wasted.
[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0005] The main purpose of the present application is to provide a battery power consumption test method, device, equipment and storage medium, aiming to solve the technical problems that the current battery power consumption test has a large number of repeated manual operations, is time-consuming and inefficient.
[0006] To achieve the above purpose, the present application proposes a battery power consumption test method, the battery power consumption test method comprising:
[0007] Get the running log of the target device;
[0008] In response to the test instruction input by the user, the operation log is parsed to obtain a time series feature table;
[0009] Generate a battery power consumption curve graph based on the timing characteristic table;
[0010] The battery power consumption test result is obtained according to the timing characteristic table and the battery power consumption curve diagram.
[0011] In one embodiment, in response to the test instruction input by the user, the operation log is parsed to obtain a timing feature table, including:
[0012] In response to the test instruction input by the user, the operation log is read to obtain the power consumption information of the target device, wherein the power consumption information includes a timestamp, power consumption, and power consumption duration;
[0013] A time series feature table is obtained according to the timestamp, power consumption and power consumption rate.
[0014] In one embodiment, obtaining the time series characteristic table according to the time, power consumption, and power consumption rate includes:
[0015] Convert the timestamp into standard time, and obtain an initial timing table according to the standard time;
[0016] Fill the initial time sequence with the power consumption corresponding to each standard time to obtain a reference time sequence table;
[0017] The marking information is obtained according to the power consumption rate, and the timing characteristic table is obtained based on the marking information and the reference timing table.
[0018] In one embodiment, obtaining the labeling information according to the power consumption rate, and obtaining the timing characteristic table based on the labeling information and the reference timing table includes:
[0019] Acquiring a device state, and when the device state is in a dormant state and continues to consume power, generating abnormal power consumption fault information based on the device state;
[0020] When the power consumption rate is greater than or equal to a preset power consumption rate threshold, generating power consumption rate fault information based on the power consumption rate;
[0021] Obtaining labeling information according to the abnormal power consumption fault information and the power consumption rate fault information;
[0022] A timing feature table is obtained based on the annotation information and the reference timing table.
[0023] In one embodiment, generating a battery power consumption curve graph based on the timing characteristic table includes:
[0024] Extracting the power consumption sequence and the power consumption rate sequence of the timing feature table;
[0025] Taking time as the horizontal axis, constructing a power consumption curve based on the power consumption sequence, and constructing a power consumption rate curve based on the power consumption rate sequence;
[0026] A battery power consumption curve is obtained according to the power consumption curve and the power consumption rate curve.
[0027] In one embodiment, obtaining the battery power consumption test result according to the timing characteristic table and the battery power consumption curve graph includes:
[0028] Obtaining the annotation information in the time series feature table and the annotation time corresponding to the annotation information;
[0029] Determine a problem time point of the battery power consumption curve graph based on the marked time;
[0030] Performing fault marking on the battery power consumption curve graph based on the problem time point and the marking information to obtain a marked power consumption curve graph;
[0031] Based on the annotated power consumption curve, energy consumption analysis is performed based on the device status, power consumption and power consumption rate to obtain the battery power consumption test result.
[0032] In one embodiment, in response to the test instruction input by the user, after parsing the operation log to obtain the timing feature table, the following steps are included:
[0033] Responding to a progress status signal input by a user, obtaining a real-time test step;
[0034] The test progress is obtained according to the real-time test steps, and the test progress is fed back to the user.
[0035] In addition, to achieve the above purpose, the present application also proposes a battery power consumption test device, the battery power consumption test device comprising:
[0036] The log acquisition module is used to obtain the operation log of the target device;
[0037] A power consumption curve drawing module, used for parsing the operation log in response to a test instruction input by a user to obtain a timing characteristic table;
[0038] The power consumption curve drawing module is further used to generate a battery power consumption curve chart based on the timing characteristic table;
[0039] The power consumption test module is used to obtain the battery power consumption test result according to the timing characteristic table and the battery power consumption curve diagram.
[0040] In addition, to achieve the above objectives, the present application also proposes a battery power consumption testing device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the battery power consumption testing method described above.
[0041] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the battery power consumption testing method described above are implemented.
[0042] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the battery power consumption testing method described above are implemented.
[0043] One or more technical solutions proposed in this application have at least the following technical effects:
[0044] By collecting data records during normal operation of the device to generate log data, analyzing the log data according to user test instructions to obtain a timing characteristic table, identifying the key parameters of the device at different time points, and obtaining a curve chart based on the timing characteristic table to show how the battery power consumption changes over time, the battery energy consumption status can be intuitively understood. By comprehensively analyzing battery performance through tables and key parameters, the power consumption characteristics of the device can be better and more intuitively understood. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0046] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0047] Figure 1 A flowchart of the first embodiment of the battery power consumption test method of the present application is provided;
[0048] Figure 2 The battery voltage change curve and battery current change curve provided in Example 1 of the battery power consumption test method of this application;
[0049] Figure 3 The current SOC, voltage SOC, battery power and device change curve diagram provided in the first embodiment of the battery power consumption test method of the present application;
[0050] Figure 4 A complete flow chart of device battery power consumption testing provided in Example 1 of the battery power consumption testing method of this application;
[0051] Figure 5 A flowchart of the second embodiment of the battery power consumption test method of the present application is provided;
[0052] Figure 6 This is a schematic diagram of the module structure of the battery power consumption test device according to an embodiment of the present application;
[0053] Figure 7 This is a schematic diagram of the device structure of the hardware operating environment involved in the battery power consumption testing method in the embodiment of the present application. DETAILED DESCRIPTION
[0054] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0055] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0056] The main solution of the embodiment of the present application is: obtain the operation log of the target device; in response to the test instruction input by the user, parse the operation log to obtain a timing characteristic table; generate a battery power consumption curve chart based on the timing characteristic table; obtain the battery power consumption test result according to the timing characteristic table and the battery power consumption curve chart.
[0057] In this embodiment, for the convenience of description, the following description is made by taking the identification of the battery power consumption test device as the execution subject.
[0058] Since the existing technology requires manual switching from AC to DC power supply when testing battery performance, someone needs to be on duty at all times after the previous test is completed. In addition, after the test is completed, it is necessary to manually input test analysis commands and report output commands, take screenshots of the test results in the form of web pages, and then manually collect the required data in the web pages and generate reports.
[0059] At present, testers are still required to manually extract relevant data of the device battery, organize it into an Excel table, and then generate a battery curve in the table for analysis. There are a lot of repeated manual operations, which are time-consuming and inefficient. Therefore, the test efficiency cannot be effectively improved and a lot of human resource costs are wasted.
[0060] The present application provides a solution, which generates log data by collecting data records of the device during normal operation, analyzes the log data according to user test instructions to obtain a timing characteristic table, identifies key parameters of the device at different time points, and obtains a curve chart based on the timing characteristic table to show how the battery power consumption changes over time, so as to intuitively understand the energy consumption status of the battery, and comprehensively analyze the battery performance through the table and key parameters, so as to better and intuitively understand the power consumption characteristics of the device.
[0061] It can be seen from the above embodiments that the present application discloses a battery power consumption testing method, device, equipment and storage medium, which relates to the field of data processing technology, and discloses a battery power consumption testing method, including: obtaining an operation log of a target device; in response to a test instruction input by a user, parsing the operation log to obtain a timing characteristic table; generating a battery power consumption curve chart based on the timing characteristic table; obtaining a battery power consumption test result according to the timing characteristic table and the battery power consumption curve chart; the method generates log data by collecting data records of the device during normal operation, analyzes the timing characteristic table obtained by the log data according to the user test instruction, identifies the key parameters of the device at different time points, and obtains a curve chart according to the timing characteristic table to show the change of battery power consumption over time, intuitively understands the energy consumption status of the battery, and comprehensively analyzes the battery performance through the table and key parameters, so as to better and intuitively understand the power consumption characteristics of the device.
[0062] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a battery power consumption test device, etc. The following takes the battery power consumption test device as an example to illustrate this embodiment and the following embodiments.
[0063] Based on this, the present application embodiment provides a battery power consumption test method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the battery power consumption testing method of the present application.
[0064] In this embodiment, the battery power consumption test method includes steps S10 to S40:
[0065] Step S10, obtaining the operation log of the target device.
[0066] It is understandable that there is a close correlation between the device's operation log and the device's battery power consumption data, which is reflected in many aspects, mainly involving the status of the device's hardware components, the software operation status, and the impact of these factors on battery power consumption.
[0067] It should be understood that the device's operation log usually contains information about the status of various hardware components, which directly affects the battery power consumption; the device operation log also records information at the software level, and the application and operation status of the software also have an important impact on battery power consumption; the device operation log records the occurrence of various system events, which sometimes trigger additional power consumption.
[0068] It should be noted that the correlation data between the hardware component status, software operation status and battery power consumption can be obtained based on the operation log of the target device.
[0069] Step S20, in response to the test instruction input by the user, the operation log is parsed to obtain a time series feature table.
[0070] It is understandable that the test instruction may be a simple instruction input by the user to start analyzing the battery power consumption of the device, or may be an instruction specifically for analyzing a certain type of power consumption data in the operation log.
[0071] It should be understood that the specific parsing method is obtained according to the type of test instruction, for example, the test instruction type is application power consumption test instruction / CPU power consumption test instruction / sleep power consumption test instruction, etc.; based on the type of test instruction, the device energy consumption data and timestamp related to the type in the operation log can be extracted to obtain a timing feature table.
[0072] It should be emphasized that the user can upload the operation logs of multiple target devices at the same time, so as to perform synchronous battery power consumption analysis on each target device according to each operation log.
[0073] It should be understood that the timing feature list may be a list consisting of power consumption features of target devices including timestamps.
[0074] In a feasible implementation manner, step S20 may include steps A201-A202:
[0075] Step A201, in response to a progress status signal input by a user, obtain a real-time test step.
[0076] It is understandable that the progress status signal may be a signal indicating that the user wants to view the progress of the current device battery energy consumption analysis based on an input from the interactive interface.
[0077] It should be understood that the real-time testing step may be any step of performing battery power consumption analysis on the target device, that is, a step of performing power consumption analysis on the target device when the user inputs a progress status signal.
[0078] Step A202, obtaining the test progress according to the real-time test steps, and feeding back the test progress to the user.
[0079] It should be noted that the battery power consumption analysis of the target device can be divided into multiple steps in advance, for example, divided into 3 steps, step 1-step 3, and the test progress is obtained according to the order of the current step; in the specific implementation, if step 2 is currently in progress, the test progress is 66.6%; the execution time of each step can also be tested in advance, and a time threshold is set for each step. For example, the execution time set for step 1 is 5 minutes, corresponding to 3 steps, and the completion rate of step 1 is 25% (it can be the average rate of each step, or it can be the pre-set completion rate of each step). If the time to enter the first step is 2 minutes, the corresponding test progress is 10%.
[0080] In this embodiment, based on the progress status information input by the user, the execution step of the current device power consumption is determined, and the progress of the entire power consumption analysis is fed back to the user based on the completion status of the step, so that the user can know the progress of the power consumption analysis in time and improve the user experience.
[0081] The above are only feasible implementations of step S20 provided in this embodiment, and this embodiment does not specifically limit the specific implementation of step S20.
[0082] Step S30: generating a battery power consumption curve graph based on the timing characteristic table.
[0083] It is understandable that the battery power consumption curve graph may be a power consumption variation curve of the target device based on time variation.
[0084] It should be noted that the battery power consumption curve may include the power consumption curve of the target device, the power consumption rate curve, the battery voltage change curve, the charging current change curve, the current SOC change curve, the voltage SOC change curve, the battery power change curve and the device temperature change curve; it may also be obtained by selecting some of the curves separately and merging them.
[0085] In a feasible implementation, step S30 may include steps A31 to A33:
[0086] Step A31, extracting the power consumption sequence and the power consumption rate sequence of the time series feature table.
[0087] It is understandable that the features in the timing feature table are arranged in chronological order, and then a series of features (which can also be data) about the battery voltage, charging current, current SOC, voltage SOC, battery power and device temperature are further obtained from the timing feature table arranged in chronological order.
[0088] It should be understood that the power consumption and power consumption rate at each time point can be obtained based on the battery voltage, charging current, current SOC, voltage SOC, and battery power at each time point, thereby obtaining a power consumption sequence and a power consumption rate sequence.
[0089] Step A32, taking time as the horizontal axis, constructing a power consumption curve based on the power consumption sequence, and constructing a power consumption rate curve based on the power consumption rate sequence.
[0090] It is understandable that by observing the changes in power consumption, power consumption rate, battery voltage, charging current, current SOC, voltage SOC, and battery level at different times, it is possible to evaluate whether the power consumption of the device battery is normal in combination with the status of the device at different times.
[0091] Step A33, obtaining a battery power consumption curve according to the power consumption curve and the power consumption rate curve.
[0092] It is understandable that the battery power consumption curve may include a power consumption curve and a power consumption rate curve, and may also include change curves of parameters such as battery voltage, charging current, current SOC, voltage SOC, and battery power.
[0093] In the specific implementation, the battery power consumption curve can refer to Figure 2 and Figure 3 , Figure 2 is the battery voltage change curve and battery current change curve, Figure 3 It is the change curve of current SOC, voltage SOC, battery power and equipment.
[0094] In this implementation, the power consumption and power consumption rate of the target device are analyzed through parameters such as battery voltage, charging current, current SOC, voltage SOC, battery level, and device temperature in the timing characteristic table, and a battery power consumption curve is drawn based on the time progress, which can more clearly show the development and changes of battery power consumption and problem points.
[0095] The above are only feasible implementations of step S30 provided in this embodiment, and this embodiment does not specifically limit the specific implementation of step S30.
[0096] Step S40, obtaining a battery power consumption test result according to the timing characteristic table and the battery power consumption curve diagram.
[0097] It is understandable that the battery power consumption test results can be displayed in the form of an Excel table.
[0098] It should be understood that the battery power consumption test result may include power consumption abnormality information obtained based on the battery power consumption curve diagram and the timing characteristic table.
[0099] In a feasible implementation, step S40 may include steps A41 to A44:
[0100] Step A41, obtaining the marking information in the time series feature table and the marking time corresponding to the marking information.
[0101] It is understandable that the timing characteristic table includes parameters such as battery voltage, charging current, current SOC, voltage SOC, battery power, and device temperature at each time point.
[0102] It should be noted that the marked information is parameter information with obvious problems in battery voltage, charging current, current SOC, voltage SOC, battery power and device temperature, and the marked time is the timestamp corresponding to the marked information in the timing feature table.
[0103] It should be understood that corresponding parameter thresholds may be set for the battery voltage, charging current, current SOC, voltage SOC, battery power, and device temperature, and if the threshold is exceeded, the parameter is used as annotation information.
[0104] It should be noted that outliers can also be defined based on standard deviation or IQR (interquartile range). For example, any data point that exceeds the mean plus or minus 3 times the standard deviation can be used as annotation information. Alternatively, the sliding window average of the data points can be calculated, and then each data point can be compared with the mean of the window. If the deviation is large, it is considered an anomaly, and the information corresponding to the anomaly point can be used as annotation information.
[0105] Step A42: determining the problem time point of the battery power consumption curve graph based on the marked time.
[0106] It is understandable that the timing feature table is associated with the battery power consumption curve, and the annotation information in the timing feature table can be used to directly locate the time point of the problem.
[0107] Step A43: perform fault marking on the battery power consumption curve graph based on the problem time point and the marking information to obtain a marked power consumption curve graph.
[0108] It is understandable that marking the battery power consumption curve graph for faults based on the problem time point and the marking information can be understood as marking the fault cause and possible faults based on time and fault information.
[0109] Step A44, performing energy consumption analysis based on the annotated power consumption curve from the device status, power consumption and power consumption rate to obtain a battery power consumption test result.
[0110] It should be noted that the energy consumption analysis based on the device status, power consumption and power consumption rate after the power consumption curve after the annotation can be to analyze the annotated points in the graph, or to analyze the background of the abnormal point in combination with the usage scenario and time information of the device. For example, if the power consumption surges when the device is not performing any operation, this may be an abnormal signal.
[0111] In a specific implementation, when the target device is in a sleep state, there is still a long period of high current.
[0112] It should be understood that it is possible to confirm whether an abnormality does exist based on the behavior during the abnormal time period, and if an abnormality exists, it can be analyzed in combination with the usage of the device during that time period to mark the fault.
[0113] It is understandable that the battery power consumption test result may include annotation information, a power consumption curve graph, and a timing characteristic table, and the annotation information, the power consumption curve graph, and the timing characteristic table are fed back to the user as a table.
[0114] In a specific implementation, the user requests the progress interface, and when receiving a message indicating that the generation is complete, requests the server to generate a picture and display it on the front end, and requests to download an Excel spreadsheet generated by the server.
[0115] In this implementation, the power consumption curve is used to mark the battery voltage, charging current, current SOC, voltage SOC, battery level and device temperature for obvious abnormal data analysis, and the abnormal points in the power consumption curve are further determined in combination with information such as the device status, so that the power consumption curve is marked to obtain the battery power consumption test results, which are fed back to the user so that the user can intuitively and clearly obtain the battery power consumption abnormality problem of the target device.
[0116] The above are only feasible implementations of step S40 provided in this embodiment, and this embodiment does not specifically limit the specific implementation of step S40.
[0117] In the specific implementation, the complete process of device battery power consumption test can be referred to Figure 4 , Figure 4 This is a flow chart. In the figure, the server receives the generation request, reads all uploaded files, obtains the information in the LOG, converts the required information, and performs preliminary data analysis to obtain annotation information. The annotation information is common and obvious problems, such as long-term high current after a period of dormancy. Create an Excel table, convert the kernel timestamp in the LOG to a standard timestamp, and fill the data and annotation information into the table in chronological order. Draw a picture based on the extracted and converted data, generate a battery curve picture, and insert the picture data into the table.
[0118] This embodiment provides a battery power consumption testing method, which generates log data by collecting data records of the device during normal operation, analyzes the log data according to user test instructions to obtain a timing characteristic table, identifies key parameters of the device at different time points, and obtains a curve chart based on the timing characteristic table to show how the battery power consumption changes over time, so as to intuitively understand the energy consumption status of the battery, and comprehensively analyze the battery performance through the table and key parameters, so as to better and intuitively understand the power consumption characteristics of the device.
[0119] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 5 , step S20, the battery power consumption test method further includes steps S21-S22:
[0120] Step S21, in response to the test instruction input by the user, read the operation log to obtain the power consumption information of the target device, wherein the power consumption information includes a timestamp, power consumption, and power consumption duration.
[0121] It is understandable that to read the operation log, you first need to ensure that you can obtain the operation log of the device. For different devices and operating systems, the way to obtain the log may be different. For example, on an Android device, you can pull the log through the adb (Android Debug Bridge) command; on an iOS device, you may need to use Xcode or other tools to access the device log.
[0122] It should be understood that the power and energy consumption information may also include information such as battery voltage, charging current, current SOC, voltage SOC, battery power, and device temperature.
[0123] It should be noted that the logs obtained from the device are usually large text files that contain all the information during the operation of the device. Therefore, it is necessary to filter out log entries related to battery power consumption. This may include but is not limited to the following information: Battery voltage: reflects the current voltage level of the battery. Battery current: indicates the charging or discharging current of the battery. Battery temperature: helps to understand the working environment of the battery. Battery capacity: that is, the percentage of remaining power. Application usage: understand which applications are running and their power consumption. Hardware component status: such as screen brightness, CPU utilization, etc.
[0124] In the specific implementation, when the system receives the test instruction input by the user, it will respond immediately. Specifically, the system will read the operation log file stored in the device. By parsing these logs, the system can extract the power consumption information of the target device in different time periods. This energy consumption information records in detail the power consumption of the device at each time point and the duration of power consumption. Specifically, this information includes the timestamp of each record, that is, the specific time point when the energy consumption data is recorded, as well as the corresponding power consumption value and power consumption duration, thereby providing users with a detailed analysis of the device's energy consumption.
[0125] Step S22, obtaining a time series feature table according to the timestamp, power consumption, and power consumption rate.
[0126] It is understandable that by parsing and filtering the log data, specific values are extracted, namely the battery voltage, charging current, current SOC, voltage SOC, and battery power at each time point, so as to further obtain the power consumption and power consumption rate.
[0127] It should be noted that for each log entry related to battery power consumption, the timestamp is extracted and stored in a structured data format to form a time series feature table.
[0128] In a feasible implementation, step S22 may include steps A221 to A223:
[0129] Step A221, convert the timestamp into standard time, and obtain an initial timing table according to the standard time.
[0130] It is understandable that the timestamp may be a mark used for timing inside a machine, and the timestamp needs to be converted into standard time for timing arrangement.
[0131] It should be noted that the battery voltage, charging current, current SOC, voltage SOC, and battery power at each time point are tabulated based on the standard time to obtain an initial timing table.
[0132] Step A222, filling the initial timing with the power consumption corresponding to each standard time to obtain a reference timing table.
[0133] It is understandable that the power consumption and power consumption rate at each time point are obtained based on the battery voltage, charging current, current SOC, voltage SOC, and battery power at each time point, and the power consumption and power consumption rate at each time point in the initial timing table are supplemented based on the power consumption and power consumption rate to obtain a reference timing table.
[0134] Step A223, obtaining labeling information according to the power consumption rate, and obtaining a timing feature table based on the labeling information and the reference timing table.
[0135] It should be noted that a power consumption rate threshold can be set. When the power consumption rate exceeds the power consumption rate threshold, the relevant data corresponding to the standard time is used as annotation information, and the cause of the problem of the data is further determined based on the annotation information, and the cause of the problem is marked to obtain a timing feature table.
[0136] It should be noted that the labeling information is obtained according to the power consumption rate, and the timing feature table is obtained based on the labeling information and the reference timing table, including: obtaining the device status, and generating abnormal power consumption fault information based on the device status when the device status is a sleep state and continues to consume power; generating power consumption rate fault information based on the power consumption rate when the power consumption rate is greater than or equal to a preset power consumption rate threshold; obtaining labeling information based on the abnormal power consumption fault information and the power consumption rate fault information; and obtaining the timing feature table based on the labeling information and the reference timing table.
[0137] Among them, in the specific implementation, a power consumption rate threshold is set to determine whether the device has abnormal power consumption. If the device continues to consume power in the sleep state, we can generate an abnormal power consumption fault information. In addition, if the power consumption rate of the device is greater than or equal to the preset power consumption rate threshold, we can also generate a power consumption rate fault information. By combining these abnormal power consumption fault information and power consumption rate fault information, more detailed annotation information can be obtained. Finally, based on these annotation information and the reference timing table, a more accurate timing feature table is generated to better understand and analyze the power consumption behavior of the device.
[0138] In this implementation, standardized timestamps are used to ensure that all recorded times are in a consistent format (such as UTC), which eliminates time deviations caused by different devices or recording methods. The power consumption data at each time point is filled into the initial time series table to form a complete data table of power consumption changes over time, providing detailed time series data for subsequent analysis. By analyzing the power consumption rate data, power consumption patterns or abnormal conditions in different time periods can be identified, and annotation information can be generated based on this to obtain a time series feature table containing more details.
[0139] The above are only feasible implementations of step S22 provided in this embodiment, and this embodiment does not specifically limit the specific implementation of step S22.
[0140] This embodiment provides a battery power consumption test method, which converts device operation data into a table form that is easy to process and analyze, obtains detailed data on battery performance through a timing characteristic table, provides a basis for formulating improvement measures, and makes the device battery power consumption test more automated and systematic. Through a user-friendly interface and detailed data analysis, it provides strong support for battery management.
[0141] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the battery power consumption testing method of the present application. More simple transformations based on this technical concept are all within the protection scope of the present application.
[0142] This application also provides a battery power consumption test device, please refer to Figure 6 , the battery power consumption testing device comprises:
[0143] The log acquisition module 10 is used to acquire the operation log of the target device;
[0144] The power consumption curve drawing module 20 is used to parse the operation log in response to the test instruction input by the user to obtain a timing characteristic table;
[0145] The power consumption curve drawing module 20 is further used to generate a battery power consumption curve chart based on the timing characteristic table;
[0146] The power consumption test module 30 is used to obtain a battery power consumption test result according to the timing characteristic table and the battery power consumption curve diagram.
[0147] The battery power consumption test device provided by the present application adopts the battery power consumption test method in the above embodiment, which can solve the technical problems that the current battery power consumption test has a large number of repeated manual operations, is time-consuming and inefficient. Compared with the prior art, the beneficial effects of the battery power consumption test device provided by the present application are the same as the beneficial effects of the battery power consumption test method provided by the above embodiment, and the other technical features in the battery power consumption test device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0148] The present application provides a battery power consumption testing device, which includes: at least one processor; and a memory that is communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the battery power consumption testing method in the above-mentioned embodiment 1.
[0149] Reference below Figure 7 , which shows a schematic diagram of the structure of a battery power consumption test device suitable for implementing an embodiment of the present application. The battery power consumption test device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The battery power consumption test device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0150] like Figure 7As shown, the battery power consumption test device may include a processing device 1001 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the battery power consumption test device are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the battery power consumption test device to communicate with other devices wirelessly or wired to exchange data. Although the figure shows a battery power consumption test device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or provided instead.
[0151] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0152] The battery power consumption test device provided by the present application adopts the battery power consumption test method in the above embodiment, which can solve the technical problems that the current battery power consumption test has a large number of repeated manual operations, is time-consuming and inefficient. Compared with the prior art, the beneficial effects of the battery power consumption test device provided by the present application are the same as the beneficial effects of the battery power consumption test method provided by the above embodiment, and the other technical features in the battery power consumption test device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0153] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0154] 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.
[0155] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the battery power consumption testing method in the above-mentioned embodiment.
[0156] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.
[0157] The computer-readable storage medium may be included in the battery power consumption test device; or may exist independently without being assembled into the battery power consumption test device.
[0158] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the battery power consumption test device, the battery power consumption test device: obtains the operation log of the target device; parses the operation log in response to the test instruction input by the user to obtain a timing characteristic table; generates a battery power consumption curve chart based on the timing characteristic table; and obtains the battery power consumption test result according to the timing characteristic table and the battery power consumption curve chart.
[0159] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a 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 may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0160] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0161] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0162] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned battery power consumption test method, and can solve the technical problems that the current battery power consumption test has a large number of repeated manual operations, which is time-consuming and inefficient. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the battery power consumption test method provided by the above-mentioned embodiment, and will not be repeated here.
[0163] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned battery power consumption testing method when executed by a processor.
[0164] The computer program product provided by the present application can solve the technical problems that the current battery power consumption test has a large number of repeated manual operations, is time-consuming and inefficient. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the battery power consumption test method provided by the above embodiment, and will not be repeated here.
[0165] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A battery power consumption test method, characterized in that: The battery power consumption testing method comprises: Get the running log of the target device; In response to a test instruction input by a user, the operation log is parsed to obtain a device state, and when the device state is a dormant state and continues to consume power, abnormal power consumption fault information is generated based on the device state; when the power consumption rate is greater than or equal to a preset power consumption rate threshold, power consumption rate fault information is generated based on the power consumption rate; annotation information is obtained according to the abnormal power consumption fault information and the power consumption rate fault information; a timing feature table is obtained based on the annotation information and a reference timing table; Generate a battery power consumption curve graph based on the timing characteristic table; Obtain the annotation information in the timing feature table and the annotation time corresponding to the annotation information; determine the problem time point of the battery power consumption curve graph based on the annotation time; perform fault annotation on the battery power consumption curve graph based on the problem time point and the annotation information to obtain a marked power consumption curve graph; perform energy consumption analysis based on the device status, power consumption and power consumption rate based on the marked power consumption curve graph to obtain a battery power consumption test result.
2. The battery power consumption testing method according to claim 1, characterized in that: In response to the test instruction input by the user, the operation log is parsed to obtain a time series feature table, including: In response to the test instruction input by the user, the operation log is read to obtain the power consumption information of the target device, wherein the power consumption information includes a timestamp, power consumption, and power consumption duration; A time series feature table is obtained according to the timestamp, power consumption and power consumption rate.
3. The battery power consumption testing method according to claim 2, characterized in that: The obtaining of the time series feature table according to the timestamp, power consumption, and power consumption rate includes: Convert the timestamp into standard time, and obtain an initial timing table according to the standard time; Fill the initial time sequence with the power consumption corresponding to each standard time to obtain a reference time sequence table; The marking information is obtained according to the power consumption rate, and the timing characteristic table is obtained based on the marking information and the reference timing table.
4. The battery power consumption testing method according to claim 1, characterized in that: The generating a battery power consumption curve graph based on the timing characteristic table includes: Extracting the power consumption sequence and the power consumption rate sequence of the timing feature table; Taking time as the horizontal axis, constructing a power consumption curve based on the power consumption sequence, and constructing a power consumption rate curve based on the power consumption rate sequence; A battery power consumption curve is obtained according to the power consumption curve and the power consumption rate curve.
5. The battery power consumption testing method according to claim 1, characterized in that: After parsing the operation log in response to the test instruction input by the user to obtain the time series feature table, the method further comprises: Responding to a progress status signal input by a user, obtaining a real-time test step; The test progress is obtained according to the real-time test steps, and the test progress is fed back to the user.
6. A battery power consumption test device, characterized in that: The battery power consumption test device adopts the battery power consumption test method according to any one of claims 1 to 5, and the battery power consumption test device comprises: The log acquisition module is used to obtain the operation log of the target device; A power consumption curve drawing module, for parsing the operation log in response to a test instruction input by a user, obtaining a device state, generating abnormal power consumption fault information based on the device state when the device state is in a dormant state and continues to consume power; generating power consumption rate fault information based on the power consumption rate when the power consumption rate is greater than or equal to a preset power consumption rate threshold; obtaining annotation information based on the abnormal power consumption fault information and the power consumption rate fault information; and obtaining a timing feature table based on the annotation information and the reference timing table; The power consumption curve drawing module is further used to generate a battery power consumption curve chart based on the timing characteristic table; The power consumption test module is used to obtain the annotation information in the timing feature table and the annotation time corresponding to the annotation information; determine the problem time point of the battery power consumption curve based on the annotation time; perform fault annotation on the battery power consumption curve based on the problem time point and the annotation information to obtain the annotated power consumption curve; perform energy consumption analysis based on the device status, power consumption and power consumption rate based on the annotated power consumption curve to obtain the battery power consumption test result.
7. A battery power consumption test device, characterized in that: The device comprises: a memory, a processor, and a battery power consumption test program stored in the memory and executable on the processor, wherein the battery power consumption test program is configured to implement the battery power consumption test method according to any one of claims 1 to 5.
8. A storage medium, characterized in that: The storage medium stores a battery power consumption test program, and when the battery power consumption test program is executed by the processor, the battery power consumption test method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Method and device for detecting power consumption abnormity of application programs and electronic device
CN105373482A
Power consumption testing method and device, electronic equipment and storage medium
CN109697168A