CN114610548A - Power consumption testing method and device, electronic equipment, storage medium and system - Google Patents

Power consumption testing method and device, electronic equipment, storage medium and system Download PDF

Info

Publication number
CN114610548A
CN114610548A CN202210172538.5A CN202210172538A CN114610548A CN 114610548 A CN114610548 A CN 114610548A CN 202210172538 A CN202210172538 A CN 202210172538A CN 114610548 A CN114610548 A CN 114610548A
Authority
CN
China
Prior art keywords
sampling
data
circuit
power consumption
tested
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210172538.5A
Other languages
Chinese (zh)
Inventor
潘志坚
樊卿华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Allwinner Technology Co Ltd
Original Assignee
Allwinner Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Allwinner Technology Co Ltd filed Critical Allwinner Technology Co Ltd
Priority to CN202210172538.5A priority Critical patent/CN114610548A/en
Publication of CN114610548A publication Critical patent/CN114610548A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2205Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2268Logging of test results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2273Test methods

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Testing Electric Properties And Detecting Electric Faults (AREA)

Abstract

The embodiment of the invention provides a power consumption testing method and device, electronic equipment, a storage medium and a system, and relates to the technical field of power consumption testing. The method comprises a power distribution circuit, a sampling control circuit and a system load to be tested, wherein a sensor is initialized, parameters of the sensor are configured, a periodic sampling program is set, the system load to be tested is sampled according to the sampling program, first data are acquired, the first data are stored in a memory, and the first data are sent to a terminal device, so that the terminal device draws a chart according to the first data. The method can realize low-cost and accurate automatic power consumption test.

Description

Power consumption testing method and device, electronic equipment, storage medium and system
Technical Field
The present invention relates to the field of power consumption testing technologies, and in particular, to a power consumption testing method and apparatus, an electronic device, a storage medium, and a system.
Background
At present, along with the development of electronic technology, people use electronic equipment more and more, however, in the production process, the power consumption of the electronic equipment needs to be tested, the traditional power consumption testing method needs to manually build a hardware testing environment, is complex in operation and harsh in use conditions, the power consumption of the electronic equipment needs to test the voltage of the electronic equipment, a universal meter needs to be used for measuring the divided voltage on a circuit, and complex operation needs to be manually carried out.
Disclosure of Invention
The present invention is directed to solving, at least to some extent, one of the technical problems in the related art. Therefore, the invention provides a power consumption testing method and device, electronic equipment, a storage medium and a system, which can save labor cost, are simple to operate and high in efficiency, and realize low-cost accurate power consumption automatic testing.
In order to achieve the above object, a first aspect of the embodiments of the present invention provides a power consumption testing method applied to a testing apparatus, where the testing apparatus includes a power distribution circuit, a sampling control circuit and a system load to be tested, the power distribution circuit is configured to supply power to different modules, the power distribution circuit is connected to the sampling circuit and the sampling control circuit, the sampling circuit is composed of a sensor and a sampling resistor and is configured to collect data, the sampling circuit is connected to the system load to be tested, the sampling control circuit is configured and controlled for the sensor, and the sampling control circuit is connected to the system load to be tested, and the method includes:
initializing the sensor;
configuring parameters of the sensor;
setting a periodic sampling program;
sampling the load of the system to be tested according to the sampling program to obtain first data;
storing the first data to a memory;
and sending the first data to terminal equipment so that the terminal equipment draws a chart according to the first data.
In some embodiments of the invention, the configuring the parameter of the sensor comprises:
setting a sampling control switch according to the sampling circuit;
setting a sampling channel according to the sampling circuit;
setting a sampling rate according to the sampling circuit;
and setting sampling time according to the sampling circuit.
In some embodiments of the invention, the setting a periodic sampling procedure includes:
creating a working thread;
and periodically sampling the voltage of the sampling circuit according to the working thread to obtain the first data.
In some embodiments of the present invention, the sending the first data to a terminal device to enable the terminal device to draw a chart according to the first data includes:
sending the first data and the sampling resistance value to terminal equipment;
so that the terminal equipment obtains second data according to the first data and the resistance value of the sampling resistor;
so that the terminal device draws a chart according to the second data;
and finally, the terminal equipment analyzes and verifies the first data according to the chart.
In order to achieve the above object, a second aspect of the embodiments of the present invention provides a power consumption testing method applied to a terminal device, where the terminal device is connected to a testing apparatus, and the method includes:
receiving first data and a sampling resistor resistance value sent by the testing device;
obtaining second data according to the first data and the resistance value of the sampling resistor;
drawing a chart according to the second data;
the first data is analyzed and validated against the graph.
In some embodiments of the present invention, the first data includes sampling resistor instantaneous voltage division and circuit to be tested instantaneous voltage, the second data includes circuit to be tested instantaneous current, circuit to be tested instantaneous power and circuit to be tested average power, and the second data is obtained according to the first data and the sampling resistor resistance value, and the method includes:
the instantaneous current of the circuit to be tested is equal to the instantaneous divided voltage of the sampling resistor divided by the resistance value of the sampling resistor;
the instantaneous power of the circuit to be tested is equal to the instantaneous voltage of the circuit to be tested multiplied by the instantaneous current of the circuit to be tested;
the average power of the circuit to be tested is equal to the accumulated average value of the instantaneous power of the circuit to be tested.
In some embodiments of the invention, said charting according to said second data comprises:
drawing a chart by taking the sampling time as an abscissa and the instantaneous current as an ordinate;
taking the sampling time as an abscissa and the instantaneous power as an ordinate to draw a chart;
and drawing a graph by taking the sampling time as an abscissa and the average power as an ordinate.
In order to achieve the above object, a third aspect of an embodiment of the present invention provides a power consumption testing apparatus, including:
the sensor initialization module is used for initializing the sensor;
the sensor parameter configuration module is used for configuring parameters of the sensor;
the sampling program module is used for setting a periodic sampling program;
the first data acquisition module is used for sampling the equipment to be tested according to the sampling program to acquire first data;
the first data storage module is used for storing the first data to a memory;
and the chart drawing module is used for sending the first data to the terminal equipment so that the terminal equipment draws a chart according to the first data.
To achieve the above object, a fourth aspect of an embodiment of the present invention proposes an electronic device, including:
at least one memory;
at least one processor;
at least one program;
the programs are stored in a memory and a processor executes the at least one program to implement the power consumption testing method of the present invention as described in the above first aspect.
To achieve the above object, a fifth aspect of the present invention provides a storage medium, which is a computer-readable storage medium storing computer-executable instructions for causing a computer to execute the power consumption testing method according to the first aspect.
To achieve the above object, a sixth aspect of the present invention provides a power consumption test system, including: the test device and the terminal equipment execute the power consumption test method according to the first and second aspects.
The power consumption testing method is applied to a testing device and comprises a power supply distribution circuit, a sampling control circuit and a system load to be tested, wherein the power supply distribution circuit is used for supplying power to different modules, the sampling circuit consists of a sensor and a sampling resistor and is used for acquiring data, and the sampling control circuit is used for configuring and controlling the sensor; the method comprises the steps of firstly initializing a sensor, configuring parameters of the sensor, setting a periodic sampling program, sampling a load of a system to be tested according to the sampling program, acquiring first data, storing the first data in a memory, and sending the first data to terminal equipment, so that the terminal equipment draws a chart according to the first data. The prior art needs complex and tedious operations for power consumption test of electronic equipment. The method and the device can save labor cost, are simple to operate and high in efficiency, and realize low-cost accurate power consumption automatic testing.
Drawings
The accompanying drawings are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the example serve to explain the principles of the invention and not to limit the invention.
FIG. 1 is a hardware framework diagram of a power consumption testing method provided by one embodiment of the invention;
FIG. 2 is a flowchart of a power consumption testing method provided by an embodiment of the invention;
FIG. 3 is a flowchart of a power consumption testing method provided by one embodiment of step S120 in FIG. 2;
FIG. 4 is a flowchart of a power consumption testing method provided by another embodiment of step S130 in FIG. 2;
FIG. 5 is a flowchart of a power consumption testing method provided by another embodiment of step S160 in FIG. 2;
FIG. 6 is a flowchart of a power consumption testing method according to another embodiment of the invention;
FIG. 7 is a flowchart of a power consumption testing method provided by one embodiment of step S520 in FIG. 6;
FIG. 8 is a flowchart of a power consumption testing method provided by one embodiment of step S530 in FIG. 6;
fig. 9 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In the description of the present invention, it should be understood that the orientation or positional relationship referred to in the description of the orientation, such as upper, lower, front, rear, left, right, etc., is based on the orientation or positional relationship shown in the drawings only for the convenience of description of the present invention and simplification of the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus, should not be construed as limiting the present invention.
In the description of the present invention, the meaning of a plurality of means is one or more, the meaning of a plurality of means is two or more, and larger, smaller, larger, etc. are understood as excluding the number, and larger, smaller, inner, etc. are understood as including the number. If the description to the first and second is only for the purpose of distinguishing technical features, it is not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated or implicitly indicating the precedence of the technical features indicated, nor is it necessary to describe a particular order or sequence.
In the description of the present invention, unless otherwise explicitly limited, terms such as arrangement, installation, connection and the like should be understood in a broad sense, and those skilled in the art can reasonably determine the specific meanings of the above terms in the present invention in combination with the specific contents of the technical solutions.
The embodiment of the invention provides a power consumption testing method and device, electronic equipment, a storage medium and a system, and particularly provides a power consumption testing method, wherein the power consumption testing method in the embodiment of the invention is described firstly, and is applied to a testing device which comprises a power supply distribution circuit, a sampling control circuit and a system load to be tested, wherein the power supply distribution circuit is used for supplying power to different modules, the sampling circuit consists of a sensor and a sampling resistor and is used for collecting data, and the sampling control circuit is used for configuring and controlling the sensor; the method comprises the steps of firstly initializing a sensor, configuring parameters of the sensor, setting a periodic sampling program, sampling a load of a system to be tested according to the sampling program, acquiring first data, storing the first data in a memory, and sending the first data to terminal equipment, so that the terminal equipment draws a chart according to the first data. The prior art needs complex and tedious operations for power consumption test of electronic equipment. The method and the device can save labor cost, are simple to operate and high in efficiency, and realize low-cost accurate power consumption automatic testing.
The embodiments of the present invention will be further explained with reference to the drawings.
As shown in fig. 1, fig. 1 is a hardware framework diagram of a power consumption testing method according to an embodiment of the present invention. In the example of fig. 1, the hardware framework includes a system load 101 under test, a sampling circuit 102, a power distribution circuit 103, and a sampling control circuit 104.
The power distribution circuit 103 distributes different voltages to the sampling circuit 102 and the sampling control circuit 104, the power distribution circuit 103 is connected with the sampling circuit 102 and the sampling control circuit 104, the system load 101 to be tested is responsible for sending a control instruction to the sampling control circuit 104, so that the sampling control circuit 104 can control the sampling behavior of the sampling circuit 102, the sampling control circuit 104 is connected with the system load 101 to be tested, the sampling circuit 102 consists of a sensor and a sampling resistor and is used for collecting data, and the sampling circuit 102 is connected with the system load 101 to be tested.
In some embodiments, the system load 101 under test may be a system-on-chip load, and may further include, but is not limited to, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA), or other programmable logic device.
In some embodiments, the power distribution circuit may supply different voltages to different modules, the power distribution circuit outputs multiple power supplies, and the sampling circuit is responsible for sampling power consumption supplied by the power distribution circuit to the different modules. Specifically, in the SOC chip, there are different module units, such as an ADC module, a DAC module, a UART module, and the like, the power distribution circuit supplies different voltages to the ADC module, the DAC module, and the UART module, and meanwhile, the plurality of sampling circuits respectively correspond to power consumption conditions of the ADC module, the DAC module, and the UART module. The power consumption testing method provided by the embodiment of the steps can be used for simultaneously testing the power consumption data of different modules.
Fig. 2 is an optional flowchart of a power consumption testing method provided in an embodiment of the present invention, and is applied to a testing apparatus, where the method in fig. 2 may include, but is not limited to, steps S110 to S160.
Step S110, initializing a sensor;
step S120, configuring parameters of the sensor;
step S130, setting a periodic sampling program;
step S140, sampling the load of the system to be tested according to the sampling program to obtain first data;
step S150, storing the first data in a memory;
step S160, sending the first data to the terminal device, so that the terminal device draws a chart according to the first data.
Based on the hardware framework structure of fig. 1, in step S110 of some embodiments, the sensor is initialized, the testing apparatus is started, and the power consumption testing method initializes the sensor first. In step S120 of some embodiments, the parameters of the sensor are configured, and the parameters of the sensor are configured using a script tool, so that the testing device is in a scene to be tested. In step S130 of some embodiments, a periodic sampling procedure is set, specifically, a working thread is created to periodically sample the sampling circuit, and the period of sampling may be set according to the requirement of the test, which may include, but is not limited to, fifty samples per second and once sample per second. In some embodiments, the sampling circuit is periodically sampled using a timer plus a software interrupt. In step S140 of some embodiments, the system load to be tested is sampled according to the sampling procedure, the first data is obtained, and the system load to be tested is periodically sampled according to the sampling procedure set in step S130. In step S150 of some embodiments, the first data is stored in the memory, and the first data sampled by the sampling circuit for the system load to be tested is stored in the memory space in real time. In step S160 of some embodiments, the first data is sent to the terminal device, so that the terminal device draws a chart according to the first data, and performs analysis and verification on the data.
The power consumption testing method provided by the embodiment of the steps can solve the problem of complex power consumption testing, the data is sampled in a programmed mode, the data is firstly set corresponding to the sensor parameters, a periodic sampling program is set for executing periodic data sampling, the acquired data is stored, a chart is drawn according to the first data, and data analysis is facilitated. The problems of complex test power consumption and low efficiency in the prior art are solved, the embodiment of the invention can save labor cost, has simple operation and high efficiency, and realizes low-cost accurate power consumption automatic test.
Referring to fig. 3, an optional flowchart of the power consumption testing method according to the embodiment of the present invention, step S120 may include, but is not limited to, step S210 to step S240;
step S210, setting a sampling control switch according to a sampling circuit;
step S220, setting a sampling channel according to the sampling circuit;
step S230, setting a sampling rate according to the sampling circuit;
in step S240, a sampling time is set according to the sampling circuit.
Specifically, in step S210 in some embodiments, a sampling control switch is set according to the sampling circuit, and the sampling control switch is turned on to enter a scene to be tested; in step S220 of some embodiments, a sampling channel is set according to the sampling circuit, the number of sampling channels is set according to the requirement of the sampling scene, and the sampling channels are turned on and turned off, which may specifically include, but is not limited to, setting 5 sampling channels, turning off the 4 th sampling channel, and turning on the other sampling channels. This allows the testing device to capture multiple paths of power consumption data simultaneously, and in some embodiments, in step S230, the sampling rate is set according to the sampling circuit and the sampling rate is set according to the scene requirement of sampling. In step S240 of some embodiments, the sampling time is set according to the sampling circuit and the sampling time is set according to the scene requirements of the sampling, which may include, but is not limited to including, sampling for one hour.
Through the power consumption testing method provided by the embodiment of the steps, a user can set parameters of the sensor according to requirements, such as a sampling control switch, a sampling channel, a sampling rate and sampling time.
Referring to fig. 4, an alternative flowchart of the power consumption testing method according to the embodiment of the present invention, step S130 may include, but is not limited to, steps S310 to S320;
step S310, creating a working thread;
step S320, periodically sampling the voltage of the sampling circuit according to the working thread to obtain first data.
Specifically, in step S310 of some embodiments, a worker thread is created; in step S320 of some embodiments, the first data is obtained by periodically sampling the sampling circuit voltage according to the work thread. The acquired first data comprises sampling resistance instantaneous voltage division and a circuit to be tested instantaneous voltage. The automatic and periodic sampling is carried out in a program working thread mode, and the power consumption can be conveniently and quickly sampled. In some embodiments, a timer may be set in the test device while periodically sampling the sampling circuit using a software interrupt. In some embodiments, the first data obtained further includes a cpu load and bandwidth data of the dynamic random access memory.
According to the power consumption testing method provided by the embodiment of the steps, the periodic data sampling is carried out on the load of the system to be tested by a programmed method and a method of using a working thread, a timer and software interruption.
Referring to fig. 5, an alternative flowchart of the power consumption testing method according to the embodiment of the present invention, step S160 may include, but is not limited to, steps S410 to S440;
step S410, first data and the resistance value of the sampling resistor are sent to local terminal equipment;
step S420, the local terminal equipment obtains second data according to the first data and the resistance value of the sampling resistor;
step S430, so that the local terminal device draws a chart according to the second data;
and step S440, finally, the local terminal equipment analyzes and verifies the first data according to the chart.
Specifically, in step S410 of some embodiments, the first data and the sampling resistance value are sent to the local terminal device, and the testing apparatus sends the sampled first data and the sampling resistance value in the sampling circuit to the local terminal device, and in some embodiments, the first data may be sent to the local terminal device through a UART transmission channel; in some embodiments, the first data is saved as a file, and then the file is pulled to the local terminal device for analysis through an Android Debug Bridge tool; in step S420 of some embodiments, the local terminal device obtains second data according to the first data and the resistance value of the sampling resistor; after the testing device sends the first data and the sampling resistance value to the local terminal device, the testing device may calculate second data according to the first data and the sampling resistance value, in step S430 of some embodiments, so that the local terminal device draws a chart according to the second data; in step S440 of some embodiments, the local terminal device is finally caused to analyze and verify the first data according to the graph.
In some embodiments, in the test apparatus, the sampling circuit samples the first data, obtains, in the test apparatus, the second data according to the first data and the resistance value of the sampling resistor, and outputs the second data to the local terminal device through the UART serial port.
According to the power consumption testing method provided by the embodiment of the steps, the testing device sends the first data and the sampling resistance value to the local terminal equipment, so that the local terminal equipment obtains the second data according to the first data and the sampling resistance value, then the chart is drawn, finally the first data is analyzed and verified on the local terminal equipment according to the chart, the chart can be obtained through the sampled data, and the sampled data can be analyzed and verified intuitively, conveniently and quickly from the chart.
Referring to fig. 6, an alternative flowchart of the power consumption testing method provided in the embodiment of the present invention is applied to a local terminal device, where the local terminal device is connected to a testing apparatus, and the method in fig. 6 may include, but is not limited to, steps S510 to S540;
step S510, receiving first data and a sampling resistor resistance value sent by a testing device;
step S520, obtaining second data according to the first data and the resistance value of the sampling resistor;
step S530, drawing a chart according to the second data;
step S540, the first data is analyzed and verified according to the graph.
Specifically, in step S510 of some embodiments, the local terminal device receives the first data and the sampling resistance value sent from the testing apparatus; in step S520 of some embodiments, second data is obtained according to the first data and the resistance value of the sampling resistor; in step S530 of some embodiments, a chart is drawn according to the second data; in step S540 of some embodiments, the first data is analyzed and validated according to a graph.
Referring to fig. 7, an alternative flowchart of the power consumption testing method according to the embodiment of the present invention is shown, where the first data includes the sampling resistor instantaneous voltage and the to-be-tested circuit instantaneous voltage, and the second data includes the to-be-tested circuit instantaneous current, the to-be-tested circuit instantaneous power and the to-be-tested circuit average power, and step S520 may include, but is not limited to, steps S610 to S630;
step S610, the instantaneous current of the circuit to be tested is equal to the instantaneous divided voltage of the sampling resistor divided by the resistance value of the sampling resistor;
step S620, the instantaneous power of the circuit to be tested is equal to the instantaneous voltage multiplied by the instantaneous current of the circuit to be tested;
in step S630, the average power of the circuit to be tested is equal to the accumulated average value of the instantaneous power of the circuit to be tested.
In step S610 of some embodiments, the instantaneous current of the circuit to be tested is equal to the instantaneous divided voltage of the sampling resistor divided by the resistance of the sampling resistor, the instantaneous divided voltage of the sampling resistor and the instantaneous voltage of the circuit to be tested are both acquired by the sensor, the sampling circuit samples according to a unit time of a sampling period, and the value of the sampled instantaneous current is equal to the instantaneous divided voltage of the current sampling resistor divided by the resistance of the sampling resistor. In step S620 of some embodiments, the instantaneous power of the circuit under test is equal to the instantaneous voltage of the circuit under test multiplied by the instantaneous current of the circuit under test. The value of the sampled instantaneous power is equal to the instantaneous voltage of the current circuit to be tested multiplied by the instantaneous current of the circuit to be tested; in step S630 of some embodiments, the average power of the circuit is equal to the accumulated average value of the instantaneous power of the circuit to be measured, and since the sampling is divided into a plurality of sampling times for data sampling, the sampled instantaneous power of the circuit to be measured needs to be averaged, which is obtained by the following formula:
Figure BDA0003517921200000071
referring to fig. 8, an alternative flowchart of the power consumption testing method according to the embodiment of the present invention, step S530 may include, but is not limited to, steps S710 to S730;
step S710, drawing a chart by taking the sampling time as an abscissa and the instantaneous current as an ordinate;
step S720, drawing a chart by taking the sampling time as an abscissa and the instantaneous power as an ordinate;
in step S730, a graph is plotted with the sampling time as the abscissa and the average power as the ordinate.
In step S710 of some embodiments, a graph is plotted with the sampling time as the abscissa and the instantaneous current as the ordinate; in step S720 of some embodiments, a graph is plotted with the sampling time as the abscissa and the instantaneous power as the ordinate; in step S730 of some embodiments, a graph is plotted with the sampling time as the abscissa and the average power as the ordinate. And calculating the first data acquired by the sampling circuit by using a matched script tool to obtain second data, and drawing a corresponding chart by taking t as an abscissa and taking the instantaneous current, the instantaneous power and the average power as an ordinate in a script tool programming mode.
The power consumption testing method provided by the embodiment of the steps can capture power consumption data in real time and perform calculation conversion, and draw the captured first data into the chart through the matched script tool, so that the running state of the testing device can be analyzed.
An embodiment of the present invention further provides a power consumption testing apparatus, which can implement the power consumption testing method, and the apparatus includes:
initializing a sensor module and initializing a sensor;
the sensor parameter configuration module is used for configuring parameters of the sensor;
the sampling program setting module is used for setting a periodic sampling program;
the first data acquisition module is used for sampling the load of the system to be tested according to the sampling program to acquire first data;
the first data storage module stores the first data to the memory;
and sending the first data to the terminal equipment so that the terminal equipment draws a chart according to the first data.
The specific implementation of the power consumption testing apparatus of this embodiment is substantially the same as the specific implementation of the power consumption testing method described above, and is not described herein again.
An embodiment of the present disclosure further provides an electronic device, including:
at least one memory;
at least one processor;
at least one program;
programs are stored in the memory and the processor executes at least one of the programs to implement the power consumption testing method of the present invention as described above. The electronic device can be any intelligent terminal including a mobile phone, a tablet computer, a Personal Digital Assistant (PDA for short), a vehicle-mounted computer and the like.
Referring to fig. 9, fig. 9 illustrates a hardware structure of an electronic device according to another embodiment, where the electronic device includes:
the processor 901 may be implemented by a general-purpose CPU (central processing unit), a microprocessor, an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits, and is configured to execute a relevant program to implement the technical solution provided in the embodiment of the present invention;
the memory 902 may be implemented in a form of a ROM (read only memory), a static storage device, a dynamic storage device, or a RAM (random access memory). The memory 902 may store an operating system and other application programs, and when the technical solution provided by the embodiments of the present disclosure is implemented by software or firmware, the relevant program codes are stored in the memory 902 and called by the processor 901 to execute the power consumption testing method of the embodiments of the present disclosure;
an input/output interface 903 for implementing information input and output;
a communication interface 904, configured to implement communication interaction between the device and another device, where communication may be implemented in a wired manner (e.g., USB, network cable, etc.), or in a wireless manner (e.g., mobile network, WIFI, bluetooth, etc.);
a bus 905 that transfers information between various components of the device (e.g., the processor 901, the memory 902, the input/output interface 903, and the communication interface 904);
wherein the processor 901, the memory 902, the input/output interface 903 and the communication interface 904 enable a communication connection within the device with each other through a bus 905.
The embodiment of the present disclosure also provides a storage medium, which is a computer-readable storage medium, and the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used for causing a computer to execute the power consumption testing method.
The memory, which is a non-transitory computer readable storage medium, may be used to store non-transitory software programs as well as non-transitory computer executable programs. Further, the memory may include high speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory optionally includes memory located remotely from the processor, and these remote memories may be connected to the processor through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The embodiment of the invention also provides a power consumption testing system which comprises the power consumption testing method.
The specific implementation of the power consumption testing system of this embodiment is substantially the same as the specific implementation of the power consumption testing method, and is not described herein again.
The embodiment described in the embodiment of the present invention is for more clearly illustrating the technical solution of the embodiment of the present invention, and does not constitute a limitation to the technical solution provided in the embodiment of the present invention, and it can be known by those skilled in the art that the technical solution provided in the embodiment of the present invention is also applicable to similar technical problems with the evolution of technology and the occurrence of new application scenarios.
It will be appreciated by those skilled in the art that the solutions shown in fig. 2 to 8 do not constitute a limitation of the embodiments of the present invention, and may include more or less steps than those shown, or combine some steps, or different steps.
The above described embodiments of the apparatus are merely illustrative, wherein the units illustrated as separate components may or may not be physically separate, may be located in one place, or may be distributed over a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
It will be understood by those of ordinary skill in the art that all or some of the steps of the methods, systems, and functional modules/units in the devices disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof.
The terms "first," "second," "third," "fourth," and the like in the description of the application and the above-described figures, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be understood that in the present application, "at least one" means one or more, "a plurality" means two or more. "and/or" for describing an association relationship of associated objects, indicating that there may be three relationships, e.g., "a and/or B" may indicate: only A, only B and both A and B are present, wherein A and B may be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" or similar expressions refer to any combination of these items, including any combination of single item(s) or plural items. For example, at least one (one) of a, b, or c, may represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b, c may be single or plural.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes multiple instructions for causing a computer device (which may be a personal computer, a server, or a network device) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing programs, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The preferred embodiments of the present invention have been described above with reference to the accompanying drawings, and are not intended to limit the scope of the embodiments of the invention. Any modifications, equivalents and improvements that may occur to those skilled in the art without departing from the scope and spirit of the embodiments of the present invention are intended to be within the scope of the claims of the embodiments of the present invention.

Claims (11)

1. The utility model provides a power consumption test method, its characterized in that is applied to testing arrangement, testing arrangement includes power distribution circuit, sampling control circuit and the system load that awaits measuring, power distribution circuit is used for supplying power for different modules, power distribution circuit with sampling control circuit connects, sampling circuit comprises sensor and sampling resistance for data acquisition, sampling circuit with the system load that awaits measuring is connected, sampling control circuit is used for configuring and controlling the sensor, sampling control circuit with the system load that awaits measuring is connected, the method includes:
initializing the sensor;
configuring parameters of the sensor;
setting a periodic sampling program;
sampling the load of the system to be tested according to the sampling program to obtain first data;
storing the first data to a memory;
and sending the first data to terminal equipment so that the terminal equipment draws a chart according to the first data.
2. The power consumption testing method of claim 1, wherein the configuring the parameters of the sensor comprises:
setting a sampling control switch according to the sampling circuit;
setting a sampling channel according to the sampling circuit;
setting a sampling rate according to the sampling circuit;
and setting sampling time according to the sampling circuit.
3. The power consumption testing method according to claim 2, wherein the setting of the periodic sampling procedure includes:
creating a working thread;
and periodically sampling the voltage of the sampling circuit according to the working thread to obtain the first data.
4. The power consumption testing method according to claim 3, wherein the sending the first data to a terminal device to enable the terminal device to draw a chart according to the first data comprises:
sending the first data and the resistance value of the sampling resistor to terminal equipment;
so that the terminal equipment obtains second data according to the first data and the resistance value of the sampling resistor;
so that the terminal device draws a chart according to the second data;
and finally, the terminal equipment analyzes and verifies the first data according to the chart.
5. A power consumption testing method is applied to terminal equipment, and the terminal equipment is connected with a testing device, and the method comprises the following steps:
receiving first data and a sampling resistor resistance value sent by the testing device;
obtaining second data according to the first data and the resistance value of the sampling resistor;
drawing a chart according to the second data;
analyzing and verifying the first data according to the graph.
6. The power consumption testing method according to claim 5, wherein the first data comprises sampling resistor instantaneous voltage and circuit to be tested instantaneous voltage, and the second data comprises circuit to be tested instantaneous current, circuit to be tested instantaneous power and circuit to be tested average power, and the second data is obtained according to the first data and the sampling resistor resistance value, and the method comprises:
the instantaneous current of the circuit to be tested is equal to the instantaneous divided voltage of the sampling resistor divided by the resistance value of the sampling resistor;
the instantaneous power of the circuit to be tested is equal to the instantaneous voltage of the circuit to be tested multiplied by the instantaneous current of the circuit to be tested;
the average power of the circuit to be tested is equal to the accumulated average value of the instantaneous power of the circuit to be tested.
7. The power consumption testing method of claim 6, wherein the charting according to the second data comprises:
drawing a chart by taking the sampling time as an abscissa and the instantaneous current as an ordinate;
taking the sampling time as an abscissa and taking the instantaneous power as an ordinate to draw a chart;
and drawing a graph by taking the sampling time as an abscissa and the average power as an ordinate.
8. A power consumption test apparatus, comprising:
the sensor initialization module is used for initializing the sensor;
the sensor parameter configuration module is used for configuring parameters of the sensor;
the sampling program module is used for setting a periodic sampling program;
the first data acquisition module is used for sampling the equipment to be tested according to the sampling program to acquire first data;
the first data storage module is used for storing the first data to a memory;
and the chart drawing module is used for sending the first data to the terminal equipment so that the terminal equipment draws a chart according to the first data.
9. An electronic device, comprising:
at least one memory;
at least one processor;
at least one program;
the program is stored in the memory, and the processor executes the at least one program to:
the power consumption testing method of any one of claims 1 to 4.
10. A storage medium that is a computer-readable storage medium having stored thereon computer-executable instructions for causing a computer to perform:
the power consumption testing method of any one of claims 1 to 4.
11. A power consumption test system, the power consumption test system comprising: test apparatus and terminal device, performing a power consumption test method according to any one of claims 1 to 7.
CN202210172538.5A 2022-02-24 2022-02-24 Power consumption testing method and device, electronic equipment, storage medium and system Pending CN114610548A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210172538.5A CN114610548A (en) 2022-02-24 2022-02-24 Power consumption testing method and device, electronic equipment, storage medium and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210172538.5A CN114610548A (en) 2022-02-24 2022-02-24 Power consumption testing method and device, electronic equipment, storage medium and system

Publications (1)

Publication Number Publication Date
CN114610548A true CN114610548A (en) 2022-06-10

Family

ID=81858846

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210172538.5A Pending CN114610548A (en) 2022-02-24 2022-02-24 Power consumption testing method and device, electronic equipment, storage medium and system

Country Status (1)

Country Link
CN (1) CN114610548A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116361095A (en) * 2023-06-01 2023-06-30 珠海妙存科技有限公司 Power consumption verification method, system, equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116361095A (en) * 2023-06-01 2023-06-30 珠海妙存科技有限公司 Power consumption verification method, system, equipment and storage medium
CN116361095B (en) * 2023-06-01 2023-08-29 珠海妙存科技有限公司 Power consumption verification method, system, equipment and storage medium

Similar Documents

Publication Publication Date Title
US20120198101A1 (en) Mobile device peripheral detection with independent state machines
CN103927255A (en) Software testing method based on cloud testing system, cloud testing system and client side of cloud testing system
CN106897219B (en) Method and device for testing stability of mobile terminal system
CN114610548A (en) Power consumption testing method and device, electronic equipment, storage medium and system
CN107064682A (en) Assembly detection apparatus
CN103425577A (en) Test method and device
CN111639002A (en) Method and system for testing sleep power consumption, computer equipment and storage medium
CN114167132B (en) Power consumption detection method and device of wireless terminal, electronic equipment and storage medium
CN211453815U (en) Electronic product batch aging test system
US20230152389A1 (en) Method for Detecting Storage Battery of Vehicle and Battery Detection Device
CN104954528A (en) Detection method and apparatus of electricity consumption information of terminal equipment
CN112054564B (en) Circuit detection method and device, equipment and storage medium
CN111751614B (en) ModBus-based non-invasive electricity consumption data testing system and method thereof
CN112985867A (en) Steering engine test method, device, equipment and storage medium
Dzhagaryan et al. An environment for automated measurement of energy consumed by mobile and embedded computing devices
CN111949538A (en) Data analysis method, equipment and system
CN110825649A (en) Application testing method, device, equipment and storage medium
CN111258828A (en) I2C bus test method, test device and computer readable storage medium
CN210181590U (en) MCU parameter testing system
CN114244423A (en) Processing method of measurement and control data and multi-satellite measurement and control system
CN110942618A (en) System, method and device for monitoring electronic equipment signals
CN102185739A (en) Device for testing Ethernet network cable connection diagram
CN105187818A (en) Intelligent video continuity analyzing device and method based on vehicle-mounted wireless terminal
CN202372553U (en) Multimeter
CN111596645B (en) Data processing method, device and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination