CN116879623A - Power consumption acquisition circuit, method and chip - Google Patents

Power consumption acquisition circuit, method and chip Download PDF

Info

Publication number
CN116879623A
CN116879623A CN202311133022.0A CN202311133022A CN116879623A CN 116879623 A CN116879623 A CN 116879623A CN 202311133022 A CN202311133022 A CN 202311133022A CN 116879623 A CN116879623 A CN 116879623A
Authority
CN
China
Prior art keywords
power consumption
accumulated
value
accumulated value
difference value
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.)
Granted
Application number
CN202311133022.0A
Other languages
Chinese (zh)
Other versions
CN116879623B (en
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.)
Moore Threads Technology Co Ltd
Original Assignee
Moore Threads 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 Moore Threads Technology Co Ltd filed Critical Moore Threads Technology Co Ltd
Priority to CN202311133022.0A priority Critical patent/CN116879623B/en
Publication of CN116879623A publication Critical patent/CN116879623A/en
Application granted granted Critical
Publication of CN116879623B publication Critical patent/CN116879623B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R21/00Arrangements for measuring electric power or power factor
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R1/00Details of instruments or arrangements of the types included in groups G01R5/00 - G01R13/00 and G01R31/00
    • G01R1/30Structural combination of electric measuring instruments with basic electronic circuits, e.g. with amplifier
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03KPULSE TECHNIQUE
    • H03K4/00Generating pulses having essentially a finite slope or stepped portions
    • H03K4/06Generating pulses having essentially a finite slope or stepped portions having triangular shape

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Power Engineering (AREA)
  • Measurement Of Current Or Voltage (AREA)

Abstract

The disclosure relates to the technical field of signal processing, and relates to a power consumption acquisition circuit, a power consumption acquisition method and a power consumption acquisition chip. The input end of the triangular wave generating circuit is used for receiving a reference square wave signal and generating a triangular wave signal based on the reference square wave signal. The comparator is used for comparing the analog signal to be detected of the power consumption equipment with the triangular wave signal output by the triangular wave generating circuit to obtain a PWM signal, and the PWM signal is transmitted to the controller. The controller is used for acquiring a first timing accumulated value when the reference square wave signal turns over and a second timing accumulated value when the PWM signal turns over from the timer register, and determining the power consumption of the power consumption equipment according to the first timing accumulated value and the second timing accumulated value. Therefore, an external power consumption sensing device is not needed, and the power consumption acquisition efficiency is improved on the basis of reducing the cost.

Description

Power consumption acquisition circuit, method and chip
Technical Field
The disclosure relates to the technical field of signal processing, and in particular relates to a power consumption acquisition circuit, a power consumption acquisition method and a power consumption acquisition chip.
Background
For power consumption control of electronic products such as GPU (Graphics Processing Unit, graphics processor), the traditional method generally collects power consumption of the electronic products by accessing external independent power consumption sensing devices, and performs power consumption control based on the actually collected power consumption.
However, the external independent power consumption sensor has high cost, and the real-time transmission is limited by I2C (Inter-Integrated Circuit, two-wire serial bus) communication and the like.
Disclosure of Invention
The purpose of the disclosure is to provide a power consumption acquisition circuit, a method and a chip, which do not need external power consumption sensing devices, and improve the power consumption acquisition efficiency on the basis of reducing the cost.
In order to achieve the above object, a first aspect of the embodiments of the present disclosure provides a power consumption acquisition circuit including a triangle wave generation circuit, a controller, a timer register, and a signal comparison circuit including a comparator;
the first input end of the comparator is used for being electrically connected with power consumption equipment to receive an analog signal to be detected of the power consumption equipment, the second input end of the comparator is connected with the output end of the triangular wave generation circuit, and the output end of the comparator is connected with the controller; the controller is connected with the timer register;
The input end of the triangular wave generating circuit is used for receiving a reference square wave signal and inputting the triangular wave signal generated based on the reference square wave signal into the second input end of the comparator;
the comparator is used for transmitting PWM signals obtained by comparing the magnitudes of the analog signals to be detected and the triangular wave signals to the controller;
the controller is used for acquiring a first timing accumulated value when the reference square wave signal is turned over and a second timing accumulated value when the PWM signal is turned over from the timer register, and determining the power consumption of the power consumption equipment according to an accumulated difference value between the first timing accumulated value and the second timing accumulated value and a standard difference value corresponding to preset standard power consumption.
Optionally, the controller is connected to an input end of the triangular wave generating circuit, and the reference square wave signal is output to the triangular wave generating circuit by the controller.
Optionally, the power consumption acquisition circuit further comprises a voltage conversion circuit;
the input end of the voltage conversion circuit is used for being electrically connected with the power consumption equipment so as to receive an analog signal to be detected of the power consumption equipment, and the output end of the voltage conversion circuit is connected with the first input end of the comparator;
The voltage conversion circuit is used for converting the analog signal to be detected, so that the voltage value represented by the converted analog signal to be detected is within the voltage amplitude range represented by the triangular wave signal.
Optionally, the triangle wave generating circuit comprises a resistor and a capacitor;
the first end of the resistor is used for receiving the reference square wave signal, and the second end of the resistor is respectively connected with the first end of the capacitor and the second input end of the comparator;
the second end of the capacitor is grounded.
A second aspect of an embodiment of the present disclosure provides a power consumption collection method, where the power consumption collection method is applied to the controller in the power consumption collection circuit described in the first aspect, and the power consumption collection method includes:
controlling the timer register to start timing;
determining a first timing accumulated value recorded by the timer register when the reference square wave signal has signal turnover, wherein the signal turnover comprises a rising edge or a falling edge of the signal;
determining a second timing accumulated value recorded by the timer register when the PWM signal turns over;
and determining the power consumption of the power consumption equipment according to the accumulated difference value between the first timing accumulated value and the second timing accumulated value corresponding to the same triangular wave waveform and a standard difference value corresponding to preset standard power consumption.
Optionally, the first timing accumulated value includes a first rising accumulated value characterizing a rising edge of the reference square wave signal and a first falling accumulated value characterizing a falling edge of the reference square wave signal;
the second timing accumulation value includes a second rising accumulation value characterizing a rising edge of the PWM signal and a second falling accumulation value characterizing a falling edge of the PWM signal;
the standard deviation value comprises a first standard deviation value and a second standard deviation value;
the first standard deviation value is used for determining the power consumption of the power consumption equipment when the turnover of the reference square wave signal corresponding to the first timing accumulated value is opposite to the turnover of the PWM signal corresponding to the second timing accumulated value; the second standard deviation value is used for determining the power consumption of the power consumption equipment under the condition that the turnover of the reference square wave signal corresponding to the first timing accumulated value is the same as the turnover of the PWM signal corresponding to the second timing accumulated value.
Optionally, the determining the power consumption of the power consumption device according to the accumulated difference value between the first timing accumulated value and the second timing accumulated value corresponding to the same triangular waveform and the standard difference value corresponding to the preset standard power consumption includes:
Determining power consumption of the power consumption device according to an accumulated difference value between the second rising accumulated value and the first falling accumulated value corresponding to the same triangular waveform and the first standard difference value when the accumulated difference value between the second falling accumulated value and the first rising accumulated value corresponding to the same triangular waveform is smaller than the first standard difference value or the accumulated difference value between the second rising accumulated value and the first falling accumulated value corresponding to the same triangular waveform is larger than the first standard difference value;
and determining the power consumption of the power consumption equipment according to the accumulated difference value between the second descending accumulated value and the first ascending accumulated value corresponding to the same triangular wave waveform and the first standard difference value under the condition that the accumulated difference value between the second ascending accumulated value and the first descending accumulated value corresponding to the same triangular wave waveform is smaller than the first standard difference value or the accumulated difference value between the second descending accumulated value and the first ascending accumulated value corresponding to the same triangular wave waveform is larger than the first standard difference value.
Optionally, the determining the power consumption of the power consumption device according to the accumulated difference value between the first timing accumulated value and the second timing accumulated value corresponding to the same triangular waveform and the standard difference value corresponding to the preset standard power consumption includes:
Determining power consumption of the power consumption device according to an accumulated difference value between the first rising accumulated value and the second rising accumulated value corresponding to the same triangular waveform and the second standard difference value when the accumulated difference value between the first rising accumulated value and the second rising accumulated value corresponding to the same triangular waveform is smaller than the second standard difference value or the accumulated difference value between the first falling accumulated value and the second falling accumulated value corresponding to the same triangular waveform is larger than the second standard difference value;
and determining the power consumption of the power consumption equipment according to the accumulated difference value between the first descending accumulated value and the second descending accumulated value corresponding to the same triangular wave waveform and the second standard difference value under the condition that the accumulated difference value between the first descending accumulated value and the second descending accumulated value corresponding to the same triangular wave waveform is smaller than the second standard difference value or the accumulated difference value between the first ascending accumulated value and the second ascending accumulated value corresponding to the same triangular wave waveform is larger than the second standard difference value.
Optionally, the method further comprises:
when the accumulated difference value between the second descending accumulated value and the first ascending accumulated value corresponding to the same triangular wave waveform is smaller than the first standard difference value, delaying a first preset duration to obtain the second ascending accumulated value and the first descending accumulated value; or alternatively, the process may be performed,
And delaying a second preset duration to acquire the second descending accumulated value and the first ascending accumulated value under the condition that the accumulated difference value between the second ascending accumulated value and the first descending accumulated value corresponding to the same triangular wave waveform is smaller than the first standard difference value.
Optionally, the method further comprises:
delaying a third preset duration to acquire the first rising accumulated value and the second rising accumulated value under the condition that the accumulated difference value between the first falling accumulated value and the second falling accumulated value corresponding to the same triangular wave waveform is larger than the second standard difference value; or alternatively, the process may be performed,
and delaying a fourth preset time length to acquire the first descending accumulated value and the second descending accumulated value under the condition that the accumulated difference value between the first ascending accumulated value and the second ascending accumulated value corresponding to the same triangular wave waveform is larger than the second standard difference value.
Optionally, the reference square wave signal is a low frequency square wave signal generated by the controller according to a preset interrupt program.
Optionally, the voltage value of the analog signal to be measured is within the voltage amplitude range of the triangle wave signal.
A third aspect of an embodiment of the present disclosure provides a chip integrated with the power consumption collection circuit of any one of the first aspects.
Through the technical scheme, the triangular wave signal generated according to the reference square wave signal and the analog signal to be tested of the power consumption equipment are respectively input into the comparator for comparison, so that the corresponding PWM signal is output. On the basis, the timer register is controlled by the controller to start timing, so that the timer is interrupted when the reference square wave signal and the PWM signal are turned over, a first timing accumulated value when the reference square wave signal is turned over and a second timing accumulated value when the PWM signal is turned over are obtained from the timer register, and therefore the power consumption of the power consumption equipment can be determined according to the accumulated difference value between the first timing accumulated value and the second timing accumulated value and the standard difference value corresponding to the preset standard power consumption. Therefore, an external power consumption sensing device is not needed, and the power consumption acquisition efficiency is improved on the basis of reducing the cost.
Additional features and advantages of the present disclosure will be set forth in the detailed description which follows.
Drawings
The accompanying drawings are included to provide a further understanding of the disclosure, and are incorporated in and constitute a part of this specification, illustrate the disclosure and together with the description serve to explain, but do not limit the disclosure. In the drawings:
Fig. 1 is a schematic diagram of a power consumption acquisition circuit, according to an example embodiment.
Fig. 2 is a schematic diagram showing a comparison of a triangular wave signal and an analog signal to be measured to obtain a PWM signal according to an exemplary embodiment.
Fig. 3 is a schematic diagram showing a comparison of a triangular wave signal with a standard voltage signal to obtain a standard PWM signal according to an exemplary embodiment.
FIG. 4 is a schematic diagram of a power consumption acquisition region, according to an example embodiment.
Fig. 5 is a flow chart illustrating a power consumption harvesting method according to an example embodiment.
Detailed Description
Specific embodiments of the present disclosure are described in detail below with reference to the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating and illustrating the disclosure, are not intended to limit the disclosure.
The related art adopts an external independent power consumption sensing device to collect the power consumption of the electronic product, the cost of the mode is higher, and the independent power consumption sensing device brings high cost particularly in large-scale application. In addition, the external independent power consumption sensing device generally converts the acquired analog signals into digital signals in the process of transmitting the signals, and then the digital signals are transmitted to a controller for controlling the power consumption through the I2C circuit module, and in the process, the transmission efficiency of the external independent power consumption sensing device is limited by a communication protocol.
In view of this, the embodiments of the present disclosure provide a power consumption acquisition circuit, a method and a chip, which respectively input a triangular wave signal generated according to a reference square wave signal and an analog signal to be measured of a power consumption device into a comparator in a signal comparison circuit to be compared, so as to output a corresponding PWM (pulse width modulation ) signal. On the basis, the timer register is controlled by the controller to start timing, so that the timer is interrupted when the reference square wave signal and the PWM signal are turned over, a first timing accumulated value when the reference square wave signal is turned over and a second timing accumulated value when the PWM signal is turned over are obtained from the timer register, and therefore the power consumption of the power consumption equipment can be determined according to the accumulated difference value between the first timing accumulated value and the second timing accumulated value and the standard difference value corresponding to the preset standard power consumption. Therefore, an external power consumption sensing device is not needed, and the power consumption acquisition efficiency is improved on the basis of reducing the cost.
Fig. 1 is a schematic diagram of a power consumption acquisition circuit 100, shown according to an example embodiment. As shown in fig. 1, the power consumption acquisition circuit 100 may include a controller 101, a triangular wave generation circuit 102, a timer register 1011, and a signal comparison circuit 104, the signal comparison circuit 104 including a comparator 1041;
A first input end of the comparator 1041 is electrically connected with the power consumption device to receive an analog signal to be tested of the power consumption device, a second input end of the comparator 1041 is connected with an output end of the triangular wave generating circuit 102, and an output end of the comparator 1041 is connected with the controller 101; the controller 101 is connected to the timer register 1011;
an input terminal of the triangular wave generating circuit 102 is configured to receive the reference square wave signal, and input the triangular wave signal generated based on the reference square wave signal to a second input terminal of the comparator 1041;
the comparator 1041 is configured to transmit a PWM signal obtained by comparing the magnitudes of the analog signal to be detected and the triangular wave signal to the controller 101;
the controller 101 is configured to obtain, from the timer register 1011, a first timing accumulated value when the reference square wave signal is turned over, and a second timing accumulated value when the PWM signal is turned over, and determine power consumption of the power consumption device according to an accumulated difference between the first timing accumulated value and the second timing accumulated value and a standard difference value corresponding to a preset standard power consumption.
The power consuming device may be an electronic product, or a power consuming device in an electronic product, such as a GPU. The analog signal to be measured of the power consuming device may be a voltage signal, such as a voltage drop from a power supply terminal to a power consuming device terminal in a circuit.
The reference square wave signal may be a 50% duty cycle standard square wave, which may be generated by the controller 101 or by an external controller.
The controller 101 may control the timer register 1011 to start timing after power-up and interrupt when it is determined that the reference square wave signal or the PWM signal is turned over, to acquire a first timing accumulated value when the reference square wave signal is turned over and a second timing accumulated value when the PWM signal is turned over from the timer register 1011. For example, an interrupt controller of GPIO (General-purpose input/output) may be turned on, an interrupt triggered using a rising edge or an interrupt triggered using a falling edge, and the timing accumulated value recorded by the timer register 1011 is collected by the interrupt processing function.
It should be noted that the preset standard power consumption may refer to a target power consumption for performing power consumption control on the power consumption device, that is, an optimal power consumption during operation of the power consumption device. Different power consumption devices may correspond to different preset standard power consumption, which is not specifically limited by the present disclosure. The preset standard power consumption can correspond to a standard voltage signal, and the voltage value represented by the standard voltage signal can be the voltage drop when the power consumption of the power consumption equipment is the preset standard power consumption. And comparing a standard voltage signal corresponding to the preset standard power consumption with a triangular wave signal generated by the reference square wave signal to obtain a corresponding standard PWM signal. The difference between the first timing accumulated value when the reference square wave signal is turned over and the standard timing accumulated value when the standard PWM signal is turned over may be a standard difference.
Thus, when power consumption of the power consumption device is collected, the triangular wave signal generated by the triangular wave generating circuit 102 according to the reference square wave signal and the analog signal to be measured of the power consumption device can be respectively input to the comparator 1041 in the signal comparing circuit 104 for comparison, and a corresponding PWM signal can be output. On the basis, the timer register 1011 is controlled by the controller 101 to start timing so as to interrupt when the reference square wave signal and the PWM signal are turned over, so that a first timing accumulated value when the reference square wave signal is turned over and a second timing accumulated value when the PWM signal is turned over are obtained from the timer register 1011, and thus the power consumption of the power consumption device can be determined according to the accumulated difference between the first timing accumulated value and the second timing accumulated value and the standard difference corresponding to the preset standard power consumption. Therefore, an external power consumption sensing device is not needed, and the power consumption acquisition efficiency is improved on the basis of reducing the cost.
In the embodiment of the disclosure, the actual power consumption of the power consumption device may be determined according to a proportional relationship between the preset standard power consumption and the standard deviation value and a proportional relationship between the actual power consumption of the power consumption device and the accumulated difference value. For example, according to the formula: p (P) S /D S =p/D, where P S To preset standard power consumption, D S P is the standard deviation, P is the actual power consumption of the power consuming device, and D is the accumulated difference. Thus, the scaled formula can be used: p= (P) S ·D)/D S P is obtained. After the actual power consumption of the power consumption equipment is obtained, the power consumption of the power consumption equipment can be controlled by adopting a traditional mean value filtering mode and a PID mode based on preset standard power consumption.
Optionally, the power consumption acquisition circuit 100 may further include a voltage conversion circuit;
the input end of the voltage conversion circuit is used for being electrically connected with the power consumption equipment to receive an analog signal to be tested of the power consumption equipment, and the output end of the voltage conversion circuit is connected with the first input end of the comparator 1041;
the voltage conversion circuit can be used for converting the analog signal to be detected, so that the voltage value represented by the converted analog signal to be detected is in the voltage amplitude range represented by the triangular wave signal. On the basis, the comparator 1041 is used for comparing the triangular wave signal with the converted analog signal to be detected to obtain a corresponding PWM signal, and the power consumption of the power consumption device is determined based on the second timing accumulated value when the signal inversion occurs in the PWM signal and the first timing accumulated value when the signal inversion occurs in the reference square wave signal.
In an embodiment, for power consumption acquisition of the GPU, since the voltage drop of the GPU is generally small, the analog signal to be tested of the GPU may be amplified by the voltage conversion circuit 103. In this case, the voltage conversion circuit may include a capacitor, an operational amplifier, and several resistors. The capacitor can be used for filtering, the setting of the capacitor is not necessary in specific implementation, and whether the capacitor is set or not can be selected according to actual requirements. The operational amplifier and the resistors are used for amplifying the analog signals to be tested. The arrangement of the individual circuit elements can be referred to in the related art. It should be understood that the placement and connection of the resistors in the operational amplifier may be changed according to actual requirements.
In another embodiment, for a power consumption device with a larger voltage drop, the analog signal to be measured of the power consumption device can be reduced by the voltage conversion circuit. In this case, the voltage conversion circuit may include a voltage dividing resistor, whereby voltage division can be performed by the voltage dividing resistor, realizing reduction of the analog signal to be measured of the power consumption device.
It should be understood that, when the variable range of the voltage value represented by the analog signal to be measured of the power consumption device is within the voltage amplitude range represented by the triangular wave signal, the analog signal to be measured of the power consumption device does not need to be converted by the voltage conversion circuit, but the analog signal to be measured of the power consumption device may be directly input to the first input terminal of the comparator 1041.
It should be noted that, such a power consumption acquisition circuit provided in the embodiments of the present disclosure may be implemented based on a dual operational amplifier, for example, the dual operational amplifier may be applied to a voltage conversion circuit. The cost of the double operational amplifiers is far lower than that of an external independent power consumption sensing device, so that the cost of power consumption acquisition can be greatly reduced.
It is understood that, according to the voltage conversion circuit, the analog signal to be detected of the input voltage conversion circuit may be directly proportional or inversely proportional to the converted analog signal to be detected output by the voltage conversion circuit, and may be specific according to the actual situation, which is not specifically limited in this disclosure.
Fig. 2 is a schematic diagram showing a comparison of a triangular wave signal and an analog signal to be measured to obtain a PWM signal according to an exemplary embodiment. As shown in fig. 2, the triangular wave signal may be generated from a reference square wave signal, for example, by filtering the reference square wave signal to obtain a corresponding triangular wave signal. The PWM signal can be obtained by comparing the magnitude of the triangular wave signal and the converted analog signal to be measured by the controller 101. The embodiment shown in fig. 2 outputs a high level when the converted analog signal to be measured is greater than the triangular wave signal, and outputs a low level when the converted analog signal to be measured is less than the triangular wave signal, thereby obtaining a corresponding PWM signal. It is to be understood that, the high level may be output when the converted analog signal to be measured is smaller than the triangular wave signal, and the low level may be output when the converted analog signal to be measured is larger than the triangular wave signal, which is not particularly limited by the present disclosure.
It should be noted that signal inversion may include a rising or falling edge of a signal. Thus, the first timed accumulation value when the signal flip of the reference square wave signal occurs may include a first rising accumulation value C that characterizes the rising edge of the reference square wave signal 1 A first falling accumulated value C representing the falling edge of the reference square wave signal 2 . Similarly, the second timed accumulation value when the PWM signal is signal flipped may include a second rising accumulation value C that characterizes the rising edge of the PWM signal 3 And a second falling accumulated value C representing the falling edge of the PWM signal 4 . Thus, the accumulated difference between the first and second timing accumulated values can be determined from the two.
Fig. 3 is a schematic diagram showing a comparison of a triangular wave signal with a standard voltage signal to obtain a standard PWM signal according to an exemplary embodiment. As shown in fig. 3, the controller 101 compares a standard voltage signal corresponding to a preset standard power consumption with a triangular wave signal generated by a reference square wave signal, so as to obtain a corresponding standard PWM signal. The voltage value represented by the standard voltage signal can be the median value of the voltage amplitude range represented by the triangular wave signal. The standard timing accumulated value when the signal flip occurs in the standard PWM signal may include a standard rising accumulated value C representing the rising edge of the standard PWM signal S3 A standard falling accumulated value C representing the falling edge of the standard PWM signal S4 . Thus, it can be according to the standardThe timing accumulation value and the first timing accumulation value determine a standard deviation value therebetween.
It will be appreciated that the controller 101 may determine different standard deviation values based on the first timing accumulation value and the standard timing accumulation value for different signal inverses. The accumulated difference between the determined first and second timed accumulated values is also different based on the different standard deviation values.
Using the example of fig. 3, in the first embodiment, the controller 101 obtains the first standard deviation D from the difference between the first timing accumulated value corresponding to the same triangular waveform and the standard timing accumulated value under the reverse signal flip S1 . I.e. D S1 =C S3 -C 2 = C S4 - C 1 . In the second embodiment, the controller 101 obtains the second standard deviation D according to the difference between the first timing accumulated value and the standard timing accumulated value corresponding to the same triangular waveform under the same signal inversion S2 . I.e. D S2 =C 1 -C S3 =C 2 -C S4
Taking the example of fig. 2, similarly to the above embodiment, the controller 101 may obtain the accumulated differences D according to the differences between the first and second timing accumulated values corresponding to the same triangular waveform under the reverse signal flip 1-down D (D) 1-up . Wherein D is 1-down =C 3 -C 2 ,D 1-up =C 4 -C 1
As shown in combination with FIGS. 2 and 3, due to C 2 To C S3 Longitudinal axis between C S3 To C 1 The power consumption value ranges mapped by the vertical axis are consistent, and the time difference C of the first time interval S3 -C 2 A time difference C smaller than the second time interval 1 -C S3 The second time interval may thus map a finer granularity of power consumption values. It will be appreciated that in the case where the converted analog signal under test is located in the lower half of the triangular waveform, D 1-down Variable interval > D of (2) 1-up Variable interval of (D), i.e. D 1-down Can be mapped toFiner granularity of the power consumption value, thereby making it possible to employ a second rising accumulated value C corresponding to the same triangular waveform 3 And a first falling-accumulated value C 2 Accumulated difference D between 1-down First standard deviation D S1 The power consumption of the power consuming device is determined. Wherein the second falling accumulated value C corresponding to the same triangular wave waveform 4 And a first rising accumulated value C 1 The accumulated difference value is smaller than the first standard difference value D S1 Alternatively, the second rising accumulated value C corresponding to the same triangular waveform 3 And a first falling-accumulated value C 2 The accumulated difference value is larger than the first standard difference value D S1 In the case of (2), it is determined that the converted analog signal to be measured is located in the lower half of the triangular waveform.
In the embodiment of the disclosure, in the case that the converted analog signal to be measured is located in the lower half of the triangular waveform, compared with the case of using C 4 And C 1 The accumulated difference value is mapped to obtain the actual power consumption of the power consumption equipment, and C is adopted 3 And C 2 The accumulated difference value is used for mapping the obtained actual power consumption of the power consumption equipment, namely the accuracy is higher. Therefore, the power consumption acquisition method provided by the embodiment of the disclosure can further improve the accuracy of power consumption acquisition on the basis of reducing the cost and improving the acquisition efficiency.
Similarly, due to C 1 To C S4 Longitudinal axis between C S4 To C 2 The power consumption value ranges mapped by the vertical axis are consistent, and the time difference C of the third time interval S4 -C 1 A time difference C smaller than the fourth time interval 2 -C S4 The fourth time interval may thus map a finer granularity of power consumption values. D when the converted analog signal to be tested is positioned at the upper half part of the triangular wave shape 1-up Variable interval > D of (2) 1-down Variable interval of (D), i.e. D 1-up The power consumption value of finer granularity can be mapped, whereby the second falling accumulated value C corresponding to the same triangular waveform can be adopted 4 And a first rising accumulated value C 1 Accumulated difference D between 1-up First standard deviation D S1 Determining power consumption deviceAnd power consumption of the device. Wherein the second rising accumulated value C corresponding to the same triangular wave waveform 3 And a first falling-accumulated value C 2 The accumulated difference value is smaller than the first standard difference value D S1 Alternatively, the second falling-sum value C corresponding to the same triangular waveform 4 And a first rising accumulated value C 1 The accumulated difference value is larger than the first standard difference value D S1 In the case of (2), it is determined that the converted analog signal to be measured is located in the upper half of the triangular waveform.
In the embodiment of the disclosure, in the case that the converted analog signal to be measured is located in the upper half of the triangular waveform, compared with the case of using C 3 And C 2 The accumulated difference value is mapped to obtain the actual power consumption of the power consumption equipment, and C is adopted 4 And C 1 The accumulated difference value is used for mapping the obtained actual power consumption of the power consumption equipment, namely the accuracy is higher. Therefore, the power consumption acquisition method provided by the embodiment of the disclosure can further improve the accuracy of power consumption acquisition on the basis of reducing the cost and improving the acquisition efficiency.
As with the above embodiment, the controller 101 can obtain the accumulated difference D from the first and second timing accumulated values corresponding to the same triangular waveform under the same signal inversion 2-down D (D) 2-up Wherein D is 2-down =C 1 -C 3 ,D 2-up =C 2 -C 4
In this embodiment, the accumulated difference D may be used in the case where the converted analog signal to be measured is located in the lower half of the triangular waveform 2-down Mapping to obtain the actual power consumption of the power consumption device, and adopting the accumulated difference D under the condition that the converted analog signal to be tested is positioned at the upper half part of the triangular wave shape 2-up The mapping yields the actual power consumption of the power consuming device. The specific implementation principle is similar to that of the foregoing embodiments, and will not be repeated here.
For example, the first rising accumulated value C corresponding to the same triangular waveform 1 And a second rising accumulated value C 3 The accumulated difference value is smaller than the second standard difference value D S2 Alternatively, the first falling-accumulation value C corresponding to the same triangular waveform 2 And a second falling-accumulated value C 4 In the case that the accumulated difference is greater than the second standard difference, it is determined that the converted analog signal to be measured is located at the lower half of the triangular waveform, so that the controller 101 can perform the processing according to the first rising accumulated value C corresponding to the same triangular waveform 1 And a second rising accumulated value C 3 Accumulated difference and second standard difference D S2 The power consumption of the power consuming device is determined.
Illustratively, at a first falling-accumulation value C corresponding to the same triangular waveform 2 And a second falling-accumulated value C 4 The accumulated difference value is smaller than the second standard difference value D S2 Alternatively, the first rising accumulated value C corresponding to the same triangular waveform 1 And a second rising accumulated value C 3 In the case that the accumulated difference is larger than the second standard difference, it is determined that the converted analog signal to be measured is located at the upper half of the triangular waveform, so that the controller 101 can perform the first falling accumulated value C according to the same triangular waveform 2 And a second falling-accumulated value C 4 Accumulated difference and second standard difference D S2 The power consumption of the power consuming device is determined.
FIG. 4 is a schematic diagram of a power consumption acquisition region, according to an example embodiment. As shown in fig. 4, in the case that the converted analog signal to be measured is located in the lower half of the triangular waveform, the accumulated difference corresponding to the region S1-down and the region S2-down may map the power consumption value of finer granularity, that is, the accumulated difference corresponding to the region S1-down: c (C) 3 -C 2 Or the accumulated difference corresponding to the region S2-down: c (C) 1 -C 3 . In the case that the converted analog signal to be measured is located in the upper half of the triangular waveform, the accumulated difference corresponding to the area S1-up and the area S2-up may map the power consumption value with finer granularity, that is, the accumulated difference corresponding to the area S1-up: c (C) 4 -C 1 Alternatively, the accumulated difference value corresponding to the region S2-up: c (C) 2 -C 4 . Therefore, the accuracy of power consumption acquisition can be further improved on the basis of reducing the cost and improving the acquisition efficiency.
It should be noted that the reference square wave signal may be a low frequency square wave signal, so as to be suitable for the frequencies that can be processed by the dual operational amplifier. Wherein the low frequency square wave signal may be generated by associated hardware. Since the PWM frequency division coefficient of a part of the related hardware is insufficient, for example, only 12 bits, the hardware in this case can generate a PWM wave of 100M/4096=24 KHz based on an input frequency of 100MHz at most, however, the dual operational amplifier cannot process too high a frequency, that is, a PWM wave of 24KHz is not suitable for being applied to the dual operational amplifier. Therefore, under the condition that the hardware cannot generate the low-frequency square wave signal, the corresponding square wave signal can be generated through a preset interrupt program in the controller. The preset interrupt program may be written according to actual situations, which is not specifically limited in the present disclosure. For example, the interrupt may be controlled by a timer register 1011 to generate a PWM waveform. Meanwhile, a second timing accumulated value at the time of PWM signal inversion can be recorded by the timer register 1011.
Since the process of obtaining the timing accumulated value in the timer register 1011 by interruption in the process of software interruption may affect the output of the reference square wave signal, the preset time period may be delayed to wait for the waveform to stabilize in the process of converting from the power consumption value corresponding to the analog signal to be measured which is collected in the upper half of the triangular waveform to the power consumption value corresponding to the analog signal to be measured which is collected in the lower half of the triangular waveform, or from the power consumption value corresponding to the analog signal to be measured which is collected in the lower half of the triangular waveform to the power consumption value corresponding to the analog signal to be measured which is collected in the upper half of the triangular waveform.
Illustratively, at a second decreasing accumulated value C corresponding to the same triangular waveform 4 And a first rising accumulated value C 1 The accumulated difference value is smaller than the first standard difference value D S1 In the case of (1), the second rising accumulated value C is obtained by delaying the first preset time period 3 A first falling accumulated value C 2 The method comprises the steps of carrying out a first treatment on the surface of the Alternatively, the second rising accumulated value C corresponding to the same triangular waveform 3 And a first falling-accumulated value C 2 The accumulated difference value is smaller than the first standard difference value D S1 In the case of (2), a second falling accumulated value C is obtained by delaying a second preset time period 4 The first rising accumulated value C 1
Illustratively, at a first falling-accumulation value C corresponding to the same triangular waveform 2 And a second falling-accumulated value C 4 Under the condition that the accumulated difference value is larger than the second standard difference value, delaying a third preset duration to obtain a first rising accumulated value C 1 A second rising accumulated value C 3 The method comprises the steps of carrying out a first treatment on the surface of the Alternatively, the first rising accumulated value C corresponding to the same triangular waveform 1 And a second rising accumulated value C 3 Under the condition that the accumulated difference value is larger than the second standard difference value, delaying a fourth preset duration to obtain a first descending accumulated value C 2 A second falling accumulated value C 4
The first preset duration, the second preset duration, the third preset duration and the fourth preset duration may be set according to actual situations, which is not specifically limited in the disclosure. For example, the first preset duration, the second preset duration, the third preset duration, and the fourth preset duration may all be two periods, and the period may be a period of the reference square wave signal.
In the embodiment of the disclosure, the influence of running the preset interrupt program on the output of the reference square wave signal can be reduced through delay processing, so that the accuracy of power consumption acquisition is improved.
Alternatively, the controller 101 may be connected to an input terminal of the triangular wave generating circuit 102, whereby a reference square wave signal may be generated by the controller 101 and output to the triangular wave generating circuit 102.
Furthermore, in one possible implementation, the input of the triangular wave generating circuit 102 may also be connected to an external controller, so that a reference square wave signal is generated by the external controller.
Alternatively, the triangular wave generation circuit 102 may include a resistor and a capacitor;
the first end of the resistor is used for receiving the reference square wave signal, and the second end of the resistor is respectively connected with the first end of the capacitor and the second input end of the comparator;
the second end of the capacitor is grounded.
In the embodiment of the disclosure, the RC filter circuit may be formed by a resistor and a capacitor, so as to filter the received reference square wave signal to obtain a corresponding triangular wave signal. In this process, the slope and amplitude of the triangular wave waveform can be adjusted by adjusting the resistance value of the resistor and/or the capacitance value of the capacitor. The voltage amplitude range of the triangular wave may be determined according to practical situations, for example, according to the voltage value characterized by the standard voltage signal, which is not specifically limited in the disclosure.
It should be appreciated that the triangle wave generation circuit 102 has low cost, and the combination of the triangle wave generation circuit 102 and the triangle wave output circuit can effectively control the cost of the power consumption acquisition circuit. In one possible implementation, other circuit arrangements may also be used to output the triangular wave, which is not specifically limited in this disclosure.
By the above technical solution, the triangular wave signal generated by the triangular wave generating circuit 102 according to the reference square wave signal and the analog signal to be tested of the power consumption device can be respectively input into the comparator 1041 in the signal comparing circuit 104 for comparison, so as to output the corresponding PWM signal. On the basis, the timer register 1011 is controlled by the controller 101 to start timing so as to interrupt when the reference square wave signal and the PWM signal are turned over, so that a first timing accumulated value when the reference square wave signal is turned over and a second timing accumulated value when the PWM signal is turned over are obtained from the timer register 1011, and thus the power consumption of the power consumption device can be determined according to the accumulated difference between the first timing accumulated value and the second timing accumulated value and the standard difference corresponding to the preset standard power consumption. Therefore, an external power consumption sensing device is not needed, and the power consumption acquisition efficiency is improved on the basis of reducing the cost.
Based on the same conception, the disclosure also provides a power consumption acquisition method. Referring to fig. 5, fig. 5 is a flowchart illustrating a power consumption harvesting method according to an example embodiment. The power consumption collection method may be applied to the controller 101 in the power consumption collection circuit 100, and the power consumption collection method may include the steps of:
S501, a control timer register starts timing.
S502, determining a first timing accumulated value recorded by a timer register when the signal of the reference square wave signal turns over. The signal flip may include a rising or falling edge of the reference square wave signal.
S503, determining a second timing accumulated value recorded by the timer register when the PWM signal turns.
S504, determining the power consumption of the power consumption equipment according to the accumulated difference value between the first timing accumulated value and the second timing accumulated value corresponding to the same triangular wave waveform and the standard difference value corresponding to the preset standard power consumption.
According to the technical scheme, the timer register can be controlled to start timing, the first timing accumulated value when the reference square wave signal is turned over and the second timing accumulated value when the PWM signal is turned over are determined, and therefore the power consumption of the power consumption equipment can be determined according to the accumulated difference between the first timing accumulated value and the second timing accumulated value and the standard difference value corresponding to the preset standard power consumption. Therefore, an external power consumption sensing device is not needed, and the power consumption acquisition efficiency is improved on the basis of reducing the cost.
In an embodiment, the first timing accumulation value may include a first rising accumulation value indicative of a rising edge of the reference square wave signal and a first falling accumulation value indicative of a falling edge of the reference square wave signal, and the second timing accumulation value may include a second rising accumulation value indicative of a rising edge of the PWM signal and a second falling accumulation value indicative of a falling edge of the PWM signal. The standard deviation value may include a first standard deviation value and a second standard deviation value.
The first standard deviation value is used for determining the power consumption of the power consumption equipment under the condition that the turnover of the reference square wave signal corresponding to the first timing accumulated value is opposite to the turnover of the PWM signal corresponding to the second timing accumulated value; the second standard deviation value is used for determining the power consumption of the power consumption equipment under the condition that the turnover of the reference square wave signal corresponding to the first timing accumulated value is the same as the turnover of the PWM signal corresponding to the second timing accumulated value.
In an embodiment, the step S504 may include:
determining power consumption of the power consumption device according to the accumulated difference value between the second rising accumulated value and the first falling accumulated value corresponding to the same triangular waveform and the first standard difference value under the condition that the accumulated difference value between the second rising accumulated value and the first rising accumulated value corresponding to the same triangular waveform is smaller than the first standard difference value or the accumulated difference value between the second rising accumulated value and the first falling accumulated value corresponding to the same triangular waveform is larger than the first standard difference value;
and determining the power consumption of the power consumption equipment according to the accumulated difference value between the second falling accumulated value and the first rising accumulated value corresponding to the same triangular wave waveform and the first standard difference value under the condition that the accumulated difference value between the second falling accumulated value and the first falling accumulated value corresponding to the same triangular wave waveform is smaller than the first standard difference value or the accumulated difference value between the second falling accumulated value and the first rising accumulated value corresponding to the same triangular wave waveform is larger than the first standard difference value.
In an embodiment, the step S504 may include:
determining power consumption of the power consumption device according to the accumulated difference value between the first rising accumulated value and the second rising accumulated value corresponding to the same triangular waveform and the second standard difference value under the condition that the accumulated difference value between the first rising accumulated value and the second rising accumulated value corresponding to the same triangular waveform is smaller than the second standard difference value or the accumulated difference value between the first falling accumulated value and the second falling accumulated value corresponding to the same triangular waveform is larger than the second standard difference value;
and determining the power consumption of the power consumption equipment according to the accumulated difference value between the first falling accumulated value and the second falling accumulated value corresponding to the same triangular wave waveform and the second standard difference value under the condition that the accumulated difference value between the first falling accumulated value and the second falling accumulated value corresponding to the same triangular wave waveform is smaller than the second standard difference value or the accumulated difference value between the first rising accumulated value and the second rising accumulated value corresponding to the same triangular wave waveform is larger than the second standard difference value.
In an embodiment, the power consumption collection method provided by the embodiment of the disclosure may further include:
when the accumulated difference value between the second descending accumulated value and the first ascending accumulated value corresponding to the same triangular wave waveform is smaller than the first standard difference value, delaying a first preset duration to obtain the second ascending accumulated value and the first descending accumulated value; or alternatively, the process may be performed,
And when the accumulated difference value between the second rising accumulated value and the first falling accumulated value corresponding to the same triangular wave waveform is smaller than the first standard difference value, delaying for a second preset time length to acquire the second falling accumulated value and the first rising accumulated value.
In an embodiment, the power consumption collection method provided by the embodiment of the disclosure may further include:
when the accumulated difference value between the first descending accumulated value and the second descending accumulated value corresponding to the same triangular wave waveform is larger than the second standard difference value, delaying a third preset duration to obtain a first ascending accumulated value and a second ascending accumulated value; or alternatively, the process may be performed,
and when the accumulated difference value between the first rising accumulated value and the second rising accumulated value corresponding to the same triangular wave waveform is larger than the second standard difference value, delaying a fourth preset duration to acquire the first falling accumulated value and the second falling accumulated value.
In one embodiment, the reference square wave signal is a low frequency square wave signal generated by the controller according to a predetermined interrupt routine.
In an embodiment, the analog signal to be measured may be the analog signal to be measured converted by the voltage converting circuit 103. Therefore, the voltage value of the representation of the analog signal to be detected can be in the voltage amplitude range of the representation of the triangular wave signal.
With respect to the power consumption collection method in the above-described embodiment, in which the respective steps have been described in detail in the embodiment regarding the power consumption collection circuit, detailed explanation will not be made here.
Based on the same concept, the present disclosure also provides an electronic device, which may include: a processor, a memory. The electronic device may also include one or more of a multimedia component, an input/output (I/O) interface, and a communication component.
The processor is used for controlling the whole operation of the electronic device so as to complete all or part of the steps in the power consumption acquisition method. The memory is used to store various types of data to support operation at the electronic device, which may include, for example, instructions for any application or method operating on the electronic device, as well as application-related data, such as contact data, messages, pictures, audio, video, and so forth. The Memory may be implemented by any type of volatile or non-volatile Memory device or combination thereof, such as static random access Memory (Static Random Access Memory, SRAM for short), electrically erasable programmable Read-Only Memory (Electrically Erasable Programmable Read-Only Memory, EEPROM for short), erasable programmable Read-Only Memory (Erasable Programmable Read-Only Memory, EPROM for short), programmable Read-Only Memory (Programmable Read-Only Memory, PROM for short), read-Only Memory (ROM for short), magnetic Memory, flash Memory, magnetic disk or optical disk. The multimedia components may include a screen and audio components. Wherein the screen may be, for example, a touch screen, the audio component being for outputting and/or inputting audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may be further stored in a memory or transmitted through a communication component. The audio assembly further comprises at least one speaker for outputting audio signals. The input/output interface provides an interface between the processor and other interface modules, which may be a keyboard, mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component is used for wired or wireless communication between the electronic device and other devices. Wireless communication, such as Wi-Fi, bluetooth, near field communication (Near Field Communication, NFC for short), 2G, 3G, 4G, NB-IOT, eMTC, or other 5G, etc., or one or a combination of more of them, is not limited herein. The corresponding communication assembly may thus comprise: wi-Fi module, bluetooth module, NFC module, etc.
In an exemplary embodiment, the electronic device may be implemented by one or more application specific integrated circuits (Application Specific Integrated Circuit, abbreviated ASIC), digital signal processor (Digital Signal Processor, abbreviated DSP), digital signal processing device (Digital Signal Processing Device, abbreviated DSPD), programmable logic device (Programmable Logic Device, abbreviated PLD), field programmable gate array (Field Programmable Gate Array, abbreviated FPGA), controller, microcontroller, microprocessor, or other electronic component for performing the power consumption acquisition method described above.
In another exemplary embodiment, a computer readable storage medium is also provided, comprising program instructions which, when executed by a processor, implement the steps of the power consumption harvesting method described above. For example, the computer readable storage medium may be the memory described above including program instructions executable by a processor of an electronic device to perform the power consumption harvesting method described above.
In another exemplary embodiment, a computer program product is also provided, comprising a computer program executable by a programmable apparatus, the computer program having code portions for performing the above described power consumption harvesting method when executed by the programmable apparatus.
Based on the same conception, the disclosure also provides a chip integrated with the power consumption acquisition circuit described in any one of the above.
The preferred embodiments of the present disclosure have been described in detail above with reference to the accompanying drawings, but the present disclosure is not limited to the specific details of the above embodiments, and various simple modifications may be made to the technical solutions of the present disclosure within the scope of the technical concept of the present disclosure, and all the simple modifications belong to the protection scope of the present disclosure.
In addition, the specific features described in the foregoing embodiments may be combined in any suitable manner, and in order to avoid unnecessary repetition, the present disclosure does not further describe various possible combinations.
Moreover, any combination between the various embodiments of the present disclosure is possible as long as it does not depart from the spirit of the present disclosure, which should also be construed as the disclosure of the present disclosure.

Claims (13)

1. The power consumption acquisition circuit is characterized by comprising a triangular wave generation circuit, a controller, a timer register and a signal comparison circuit, wherein the signal comparison circuit comprises a comparator;
The first input end of the comparator is used for being electrically connected with power consumption equipment to receive an analog signal to be detected of the power consumption equipment, the second input end of the comparator is connected with the output end of the triangular wave generation circuit, and the output end of the comparator is connected with the controller; the controller is connected with the timer register;
the input end of the triangular wave generating circuit is used for receiving a reference square wave signal and inputting the triangular wave signal generated based on the reference square wave signal into the second input end of the comparator;
the comparator is used for transmitting PWM signals obtained by comparing the magnitudes of the analog signals to be detected and the triangular wave signals to the controller;
the controller is used for acquiring a first timing accumulated value when the reference square wave signal is turned over and a second timing accumulated value when the PWM signal is turned over from the timer register, and determining the power consumption of the power consumption equipment according to an accumulated difference value between the first timing accumulated value and the second timing accumulated value and a standard difference value corresponding to preset standard power consumption.
2. The power consumption acquisition circuit according to claim 1, wherein the controller is connected to an input terminal of the triangular wave generation circuit, and the reference square wave signal is output to the triangular wave generation circuit by the controller.
3. The power consumption harvesting circuit of claim 1, further comprising a voltage conversion circuit;
the input end of the voltage conversion circuit is used for being electrically connected with the power consumption equipment so as to receive an analog signal to be detected of the power consumption equipment, and the output end of the voltage conversion circuit is connected with the first input end of the comparator;
the voltage conversion circuit is used for converting the analog signal to be detected, so that the voltage value represented by the converted analog signal to be detected is within the voltage amplitude range represented by the triangular wave signal.
4. The power consumption acquisition circuit according to claim 1, wherein the triangular wave generation circuit includes a resistor and a capacitor;
the first end of the resistor is used for receiving the reference square wave signal, and the second end of the resistor is respectively connected with the first end of the capacitor and the second input end of the comparator;
the second end of the capacitor is grounded.
5. A power consumption collection method, wherein the power consumption collection method is applied to the controller in the power consumption collection circuit of claim 1, and the power consumption collection method comprises:
controlling the timer register to start timing;
Determining a first timing accumulated value recorded by the timer register when the reference square wave signal has signal turnover, wherein the signal turnover comprises a rising edge or a falling edge of the signal;
determining a second timing accumulated value recorded by the timer register when the PWM signal turns over;
and determining the power consumption of the power consumption equipment according to the accumulated difference value between the first timing accumulated value and the second timing accumulated value corresponding to the same triangular wave waveform and a standard difference value corresponding to preset standard power consumption.
6. The power consumption collection method according to claim 5, wherein,
the first timing accumulation value comprises a first rising accumulation value representing a rising edge of the reference square wave signal and a first falling accumulation value representing a falling edge of the reference square wave signal;
the second timing accumulation value includes a second rising accumulation value characterizing a rising edge of the PWM signal and a second falling accumulation value characterizing a falling edge of the PWM signal;
the standard deviation value comprises a first standard deviation value and a second standard deviation value;
the first standard deviation value is used for determining the power consumption of the power consumption equipment when the turnover of the reference square wave signal corresponding to the first timing accumulated value is opposite to the turnover of the PWM signal corresponding to the second timing accumulated value; the second standard deviation value is used for determining the power consumption of the power consumption equipment under the condition that the turnover of the reference square wave signal corresponding to the first timing accumulated value is the same as the turnover of the PWM signal corresponding to the second timing accumulated value.
7. The power consumption collection method according to claim 6, wherein the determining the power consumption of the power consumption device according to the accumulated difference between the first and second timing accumulated values corresponding to the same triangular waveform and a standard difference corresponding to a preset standard power consumption includes:
determining power consumption of the power consumption device according to an accumulated difference value between the second rising accumulated value and the first falling accumulated value corresponding to the same triangular waveform and the first standard difference value when the accumulated difference value between the second falling accumulated value and the first rising accumulated value corresponding to the same triangular waveform is smaller than the first standard difference value or the accumulated difference value between the second rising accumulated value and the first falling accumulated value corresponding to the same triangular waveform is larger than the first standard difference value;
and determining the power consumption of the power consumption equipment according to the accumulated difference value between the second descending accumulated value and the first ascending accumulated value corresponding to the same triangular wave waveform and the first standard difference value under the condition that the accumulated difference value between the second ascending accumulated value and the first descending accumulated value corresponding to the same triangular wave waveform is smaller than the first standard difference value or the accumulated difference value between the second descending accumulated value and the first ascending accumulated value corresponding to the same triangular wave waveform is larger than the first standard difference value.
8. The power consumption collection method according to claim 6, wherein the determining the power consumption of the power consumption device according to the accumulated difference between the first and second timing accumulated values corresponding to the same triangular waveform and a standard difference corresponding to a preset standard power consumption includes:
determining power consumption of the power consumption device according to an accumulated difference value between the first rising accumulated value and the second rising accumulated value corresponding to the same triangular waveform and the second standard difference value when the accumulated difference value between the first rising accumulated value and the second rising accumulated value corresponding to the same triangular waveform is smaller than the second standard difference value or the accumulated difference value between the first falling accumulated value and the second falling accumulated value corresponding to the same triangular waveform is larger than the second standard difference value;
and determining the power consumption of the power consumption equipment according to the accumulated difference value between the first descending accumulated value and the second descending accumulated value corresponding to the same triangular wave waveform and the second standard difference value under the condition that the accumulated difference value between the first descending accumulated value and the second descending accumulated value corresponding to the same triangular wave waveform is smaller than the second standard difference value or the accumulated difference value between the first ascending accumulated value and the second ascending accumulated value corresponding to the same triangular wave waveform is larger than the second standard difference value.
9. The power consumption collection method according to claim 6 or 7, characterized in that the method further comprises:
when the accumulated difference value between the second descending accumulated value and the first ascending accumulated value corresponding to the same triangular wave waveform is smaller than the first standard difference value, delaying a first preset duration to obtain the second ascending accumulated value and the first descending accumulated value; or alternatively, the process may be performed,
and delaying a second preset duration to acquire the second descending accumulated value and the first ascending accumulated value under the condition that the accumulated difference value between the second ascending accumulated value and the first descending accumulated value corresponding to the same triangular wave waveform is smaller than the first standard difference value.
10. The power consumption harvesting method according to claim 6 or 8, wherein the method further comprises:
delaying a third preset duration to acquire the first rising accumulated value and the second rising accumulated value under the condition that the accumulated difference value between the first falling accumulated value and the second falling accumulated value corresponding to the same triangular wave waveform is larger than the second standard difference value; or alternatively, the process may be performed,
and delaying a fourth preset time length to acquire the first descending accumulated value and the second descending accumulated value under the condition that the accumulated difference value between the first ascending accumulated value and the second ascending accumulated value corresponding to the same triangular wave waveform is larger than the second standard difference value.
11. The power consumption collection method according to any one of claims 5 to 8, wherein the reference square wave signal is a low frequency square wave signal generated by the controller according to a preset interrupt program.
12. The power consumption collection method according to any one of claims 5-8, wherein the voltage value of the analog signal representation to be measured is within the voltage amplitude range of the triangle wave signal representation.
13. A chip characterized in that it is integrated with the power consumption acquisition circuit of any one of claims 1-4.
CN202311133022.0A 2023-09-04 2023-09-04 Power consumption acquisition circuit, method and chip Active CN116879623B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311133022.0A CN116879623B (en) 2023-09-04 2023-09-04 Power consumption acquisition circuit, method and chip

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311133022.0A CN116879623B (en) 2023-09-04 2023-09-04 Power consumption acquisition circuit, method and chip

Publications (2)

Publication Number Publication Date
CN116879623A true CN116879623A (en) 2023-10-13
CN116879623B CN116879623B (en) 2023-12-08

Family

ID=88257150

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311133022.0A Active CN116879623B (en) 2023-09-04 2023-09-04 Power consumption acquisition circuit, method and chip

Country Status (1)

Country Link
CN (1) CN116879623B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB1474236A (en) * 1973-05-17 1977-05-18 Gen Electric Apparatus for metering active electrical energy
CN2042598U (en) * 1988-03-30 1989-08-09 宋寿椿 Electronic digital watt-hour meter
CN1112680A (en) * 1994-05-26 1995-11-29 黎民 Operational digital set type electronic electric meter
CN101957393A (en) * 2009-07-16 2011-01-26 厦门华侨电子股份有限公司 Method and device for displaying overall power consumption on display terminal in real time
CN108594140A (en) * 2018-03-14 2018-09-28 昆山龙腾光电有限公司 Electronic circuit measurement of power loss device
CN112710980A (en) * 2020-12-17 2021-04-27 国网北京市电力公司 Power source for electric energy meter verification
CN116366063A (en) * 2023-03-14 2023-06-30 摩尔线程智能科技(北京)有限责任公司 Signal acquisition circuit, chip and signal acquisition method

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB1474236A (en) * 1973-05-17 1977-05-18 Gen Electric Apparatus for metering active electrical energy
CN2042598U (en) * 1988-03-30 1989-08-09 宋寿椿 Electronic digital watt-hour meter
CN1112680A (en) * 1994-05-26 1995-11-29 黎民 Operational digital set type electronic electric meter
CN101957393A (en) * 2009-07-16 2011-01-26 厦门华侨电子股份有限公司 Method and device for displaying overall power consumption on display terminal in real time
CN108594140A (en) * 2018-03-14 2018-09-28 昆山龙腾光电有限公司 Electronic circuit measurement of power loss device
CN112710980A (en) * 2020-12-17 2021-04-27 国网北京市电力公司 Power source for electric energy meter verification
CN116366063A (en) * 2023-03-14 2023-06-30 摩尔线程智能科技(北京)有限责任公司 Signal acquisition circuit, chip and signal acquisition method

Also Published As

Publication number Publication date
CN116879623B (en) 2023-12-08

Similar Documents

Publication Publication Date Title
TWI463769B (en) Charge pump device
CN106662960B (en) Capacitive touch panel device and driving method
JP2017510885A (en) Touch screen controller and method for charger noise reduction using noise shaping
TWI522772B (en) Automatic transmission interface device and method for correcting transmission frequency
CN116879623B (en) Power consumption acquisition circuit, method and chip
CN210005106U (en) Apparatus for generating acoustic emission spectra using amplitude demodulation
US10408870B2 (en) Capacitor sensor apparatus and sensing method thereof
CN112445358A (en) Adjusting method, terminal and computer storage medium
KR20100094549A (en) Differential pressure transmitter
JP2009153007A (en) Auto gain control amplifier and audio recording device with the same
KR20170101979A (en) Fingerprint detection circuit and electronic device
CN116366063A (en) Signal acquisition circuit, chip and signal acquisition method
WO2017016273A1 (en) Accelerator
KR102593293B1 (en) Method and sensor system for processing continuous sensor signals
EP3057344B1 (en) Sound field measurement device, sound field measurement method, and sound field measurement program
CN113115992B (en) Current output control method, device and equipment of electronic cigarette and storage medium
KR101996084B1 (en) Method and apparatus for lowing noise on touch screen panel
US9635478B1 (en) Coulomb counter and battery management for hearing aid
CN114400889A (en) Output voltage control circuit and method for charge pump
CN103945306A (en) Detecting device and method for magnetic-force intensity parameter of loudspeaker
CN108595142B (en) Volume adjusting method and device
CN105786443A (en) Frequency response correction method, processing chip and terminal equipment
US20150124983A1 (en) Circuit and method for driving a loudspeaker
CN216209456U (en) Frequency measuring device
US9876506B2 (en) Measuring device, measuring system, measuring method, and computer readable recording 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
GR01 Patent grant
GR01 Patent grant