Power consumption detection method, electronic equipment and storage medium
By obtaining the proportional relationship of input current between multiple load modules in electronic equipment and using common sampling resistors for spectrum analysis, the problems of low power consumption detection efficiency and unstable current in the prior art are solved, and high efficiency and low cost are achieved Power consumption detection.
Patent Information
- Application Number
- CN202411549471.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-01-10
AI Technical Summary
In existing electronic equipment, multiple sampling resistors are required to detect power consumption of load modules, resulting in low efficiency, high cost, large power consumption and large plate area, and may cause current fluctuations and instability.
By obtaining the proportional relationship of input current between multiple load modules, using a common sampling resistor and an ADC sampling channel for spectrum analysis, the input current and power consumption of each load module are accurately determined, reducing the possibility of current fluctuations and instability.
It improves the efficiency of electronic equipment, reduces cost, power consumption and plate area, and reduces current fluctuations and instability of load modules.
Smart Images

Figure CN119291296A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of smart terminals, and in particular to a power consumption detection method, an electronic device and a storage medium. Background Art
[0002] With the rapid development of electronic equipment technology, users have higher and higher performance requirements for electronic devices such as mobile phones, and more and more load modules are included in electronic devices. Among them, a load module may correspond to at least one voltage change circuit (for example, Buck step-down circuit, also known as Buck power supply network) and a load unit (for example, central processing unit, graphics processor, baseband processor, speaker, display, etc.). When users frequently or for a long time use the load module of an electronic device, a large amount of electricity will be consumed, affecting the performance of the electronic device. Therefore, it is particularly important to detect the power consumption of the load module in the electronic device.
[0003] Usually, when power consumption detection is performed on each load module, a sampling resistor needs to be set at the input end of each load module, and the voltage signal at both ends of the sampling resistor is transmitted based on an independent analog-to-digital converter (ADC) sampling channel to realize power consumption detection of the load module. In this way, not only the cost, power consumption, efficiency and layout area of the electronic equipment are affected, but also the added sampling resistor may cause current fluctuation and instability in the voltage change circuit in the load module. Summary of the invention
[0004] The embodiment of the present application provides a power consumption detection method, an electronic device, and a storage medium. By obtaining the input current proportional relationship between multiple load modules that share a first sampling resistor in the electronic device, and processing the input current signal of the detected first sampling resistor according to the input current proportional relationship, the input current corresponding to each load module can be obtained more accurately. In addition, based on the input current corresponding to each load module, the power consumption of each load module can be more accurately determined. Since multiple load modules share a first sampling resistor, it not only improves the efficiency of the electronic device, reduces the cost, power consumption, and layout area of the electronic device, but also reduces the possibility of current fluctuation and instability in each load module.
[0005] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:
[0006] In a first aspect, the present application provides a power consumption detection method, which is applied to an electronic device, and the method includes:
[0007] Obtaining an input current proportional relationship between a plurality of load modules that share a first sampling resistor in the electronic device;
[0008] Detecting an input current signal of a first sampling resistor;
[0009] Performing spectrum analysis on the input current signal to determine the DC component and other frequency components; wherein the other frequency components are the remaining frequency components in the spectrum of the input current signal except the DC component;
[0010] Based on the proportional relationship of the input current, the DC component and other frequency components are processed respectively to obtain the input current corresponding to each load module;
[0011] Based on the input current corresponding to each load module, the power consumption of each load module is determined.
[0012] In the power consumption detection method provided in the embodiment of the present application, since the current magnitude relationship of multiple load modules can be accurately reflected based on the input current proportional relationship between multiple load modules, the input current signal of the first sampling resistor is the total input current signal of multiple load modules. Therefore, after the input current signal of the first sampling resistor is subjected to spectrum analysis to obtain the DC component and other frequency components, the DC component and other frequency components can be processed more accurately based on the input current proportional relationship between the multiple load modules to obtain the input current corresponding to each load module. Furthermore, based on the input current corresponding to each load module, the power consumption of each load module can be more accurately determined. In this way, not only the efficiency of the electronic device is improved, the cost, power consumption and layout area of the electronic device are reduced, but also the possibility of current fluctuation and instability in each load module can be reduced.
[0013] In a possible design manner of the first aspect, obtaining an input current proportional relationship between multiple load modules that share a first sampling resistor in an electronic device includes: obtaining a corresponding relationship between a switching frequency and an input current of each load module; determining an input current corresponding to the switching frequency of each load module based on the corresponding relationship between the switching frequency and the input current; and determining an input current proportional relationship between multiple load modules based on the input current corresponding to the switching frequency of each load module.
[0014] Based on the above technical scheme, since the corresponding relationship between the switching frequency and the input current of each load module can accurately reflect the relationship between the switching frequency and the input current of each load module, the input current corresponding to the switching frequency of each load module can be accurately determined based on the corresponding relationship between the switching frequency and the input current of each load module, and further based on the input current corresponding to the switching frequency of each load module, the input current proportional relationship between multiple load modules can be accurately determined.
[0015] In a possible design method of the first aspect, the input current value includes a first current component corresponding to the DC component and a second current component corresponding to other frequency components; the DC component and other frequency components are processed respectively based on the input current proportional relationship to obtain the input current corresponding to each load module, including: processing the DC component based on the input current proportional relationship to obtain the first current component corresponding to each load module; processing other frequency components based on the input current proportional relationship to obtain the second current component corresponding to each load module; determining the input current corresponding to each load module based on the first current component corresponding to each load module and the second current component corresponding to each load module.
[0016] Based on the above technical solution, when the input current proportional relationship is consistent with the actual situation, the DC component is processed based on the input current proportional relationship, and the input current corresponding to each load module is also consistent with the actual situation. Other frequency components are processed based on the input current proportional relationship, and the second current component corresponding to each load module is also consistent with the actual situation. Furthermore, based on the first current component corresponding to each load module and the second current component corresponding to each load module, the input current corresponding to each load module can be determined more accurately.
[0017] In a possible design method of the first aspect, the DC component is processed based on the proportional relationship of the input current to obtain the first current component corresponding to each load module, including: performing frequency domain to time domain processing on the DC component to obtain a first current value; and splitting the first current value based on the proportional relationship of the input current to obtain the first current component corresponding to each load module.
[0018] Based on the above technical solution, since the DC component corresponding to the input current signal of each load module is superimposed on the DC component in the frequency domain, the DC component is converted from the frequency domain to the time domain. After obtaining the first current value, the first current value is split based on the proportional relationship of the input currents of multiple load modules, so that the first current component corresponding to each load module can be obtained more accurately.
[0019] In a possible design manner of the first aspect, the multiple load modules include a first load module and a second load module, and the input current proportional relationship includes a ratio of a first input current of the first load module to a second input current of the second load module of k:1; wherein k is a positive number; based on the input current proportional relationship, the first current value is split to obtain the first current component corresponding to each load module, including: dividing the first current value by (k+1) to obtain the first current component corresponding to the second load module; and determining the first current component corresponding to the second load module with k times as much as the first current component corresponding to the first load module.
[0020] Based on the above technical solution, the first current component of each load module that strictly corresponds to the input current proportional relationship can be accurately obtained.
[0021] In a possible design method of the first aspect, other frequency components are processed based on the proportional relationship of the input current to obtain second current components corresponding to each load module, including: determining at least one target frequency component from the other frequency components; performing frequency domain to time domain processing on each target frequency component in at least one target frequency component to obtain a second current value corresponding to each target frequency component; and splitting each second current value in multiple second current values based on the proportional relationship of the input current to obtain a second current component corresponding to each load module.
[0022] Based on the above technical solution, since the other frequency components include other frequency components corresponding to the input current signals of multiple load modules, at least one target frequency component in the other frequency components is converted from the frequency domain to the time domain. After obtaining the second current value corresponding to each target frequency component, the multiple second current values are split in turn based on the proportional relationship of the input currents of the multiple load modules, so that the second DC component corresponding to each load module can be determined more accurately.
[0023] In a possible design manner of the first aspect, determining at least one target frequency component from other frequency components includes: determining the amplitude of each frequency component in the other frequency components; and determining at least one frequency component with the largest amplitude as at least one target frequency component.
[0024] Based on the above technical solution, by determining at least one frequency component with the largest amplitude among other frequency components as at least one target frequency component, the obtained at least one target frequency component can cover the frequency components that have a greater impact on the current value, which is conducive to reducing the amount of calculation.
[0025] In a possible design method of the first aspect, based on the first current component corresponding to each load module and the second current component corresponding to each load module, the input current corresponding to each load module is determined, including: the sum of the first current component corresponding to each load module and the second current component corresponding to each load module is determined as the input current corresponding to each load module.
[0026] Based on the above technical solution, since the first DC component corresponding to each load module corresponds to the DC component in the input current signal of each load module, and the second current component corresponding to each load module corresponds to other frequency components in the input current signal of each load module, based on the sum of the first current component corresponding to each load module and the second current component corresponding to each load module, the input current corresponding to each load module can be obtained more accurately.
[0027] In a second aspect, the present application provides an electronic device, comprising: a display screen, a memory and one or more processors; the display screen, the memory and the processor are coupled; wherein the memory stores computer program code, the computer program code comprises computer instructions, and when the computer instructions are executed by the processor, the electronic device executes the power consumption detection method provided in the first aspect and any possible design method thereof.
[0028] In a third aspect, the present application provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the power consumption detection method provided in the first aspect and any possible design thereof.
[0029] In a fourth aspect, the present application provides a computer program product, which includes executable instructions. When the computer program product runs on an electronic device, the electronic device executes the power consumption detection method provided in the first aspect and any possible design thereof.
[0030] In a fifth aspect, a device (for example, the device may be a chip system) is provided, the device including a processor for supporting an electronic device to implement the functions involved in the second aspect above. In one possible design, the device also includes a memory for storing program instructions and data necessary for the electronic device. When the device is a chip system, it may be composed of a chip, or may include a chip and other discrete devices.
[0031] It can be understood that the beneficial effects that can be achieved by the technical solutions provided in the second to fifth aspects provided above can refer to the beneficial effects in the first aspect and any possible design method thereof, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 It is a schematic diagram of the structure of a power consumption detection circuit for multiple load modules in an electronic device provided by an embodiment of the present application;
[0033] Figure 2 It is a schematic diagram of the structure of a power consumption detection circuit for multiple load modules in another electronic device provided in an embodiment of the present application;
[0034] Figure 3 It is a schematic diagram of a hardware framework of an electronic device provided in an embodiment of the present application;
[0035] Figure 4 It is a flowchart of a power consumption detection method provided in an embodiment of the present application;
[0036] Figure 5Ais a schematic diagram of a corresponding relationship between a switching frequency and a load current provided in an embodiment of the present application;
[0037] Figure 5B 1 is a schematic diagram of an input current signal waveform of a Buck circuit provided in an embodiment of the present application;
[0038] Figure 6 It is a flowchart of another power consumption detection method provided in an embodiment of the present application;
[0039] Figure 7 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application;
[0040] Figure 8 It is a structural schematic diagram of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0041] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments and are not intended to be limiting of the present application. As used in the specification and appended claims of the present application, the singular expressions "a", "an", "said", "above", "the" and "this" are intended to also include plural expressions, unless the context clearly indicates otherwise. It should also be understood that " / " means or, for example, A / B can mean A or B; "and / or" in the text is merely a description of an association relationship of associated objects, indicating that three relationships can exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0042] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments.
[0043] The terms "first" and "second" in the following embodiments of the present application are used for descriptive purposes only and should not be understood as suggesting or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more.
[0044] At present, the power consumption of the multiple load modules is mainly detected by setting a sampling resistor at the input end of each load module in the electronic device, transmitting a voltage signal across the sampling resistor based on an independent ADC sampling channel, and determining the power consumption of the load module based on the voltage signal across the sampling resistor.
[0045] like Figure 1 1 is a schematic diagram of a power consumption detection circuit structure of multiple load modules in an electronic device provided by an embodiment of the present application. Figure 1 As shown, the electronic device 10 includes a lithium battery 100, a plurality of load modules 101, a sampling resistor 102 corresponding to each load module 101, an ADC sampling channel 103 corresponding to each sampling resistor 102, a microcontroller (MCU) 104 and an application processor (AP) 105. The load module 101 includes a Buck circuit and a load unit coupled to the Buck circuit. The sampling resistor 102 is coupled in series between the lithium battery 100 and the load module 101. The ADC sampling channel 103 is connected across the two ends of the sampling resistor 102 to transmit the voltage signal of the sampling resistor 102. The MCU 104 is coupled to each ADC sampling channel 103 to receive and respond to a sampling rate configuration signal, collect the voltage signal of the sampling resistor 102 based on a preset sampling rate, and calculate the power consumption of each load module 101 based on the voltage signal. The AP 105 is coupled to the MCU 104 , and is configured to generate a sampling rate configuration signal and send the sampling rate configuration signal to the MCU 104 .
[0046] In the embodiment of the present application, since a sampling resistor 102 is provided for each load module 101, and a corresponding ADC sampling channel 103 is provided for each sampling resistor 102, the efficiency of the electronic device is low, and the cost, power consumption and layout area are high. Moreover, the added sampling resistor may also cause current fluctuation and instability of the load module 101.
[0047] In view of the above problems, an embodiment of the present application provides a power consumption detection method, which can be applied to electronic devices. In this technical solution, a common sampling resistor can be set for multiple load modules, and then the voltage signal of the sampling resistor is transmitted through an ADC sampling channel, and the input current signal of the sampling resistor is determined according to the voltage signal. Then, the input current signal is processed according to the preset proportional relationship of the input current between the multiple load modules to obtain the input current corresponding to each load module. Thus, the power consumption of the load module can be determined based on the input current corresponding to the load module and the input voltage of the load module. In this way, the power consumption detection of multiple load modules can be realized through a sampling resistor and an ADC sampling channel, which improves the efficiency of the electronic device and reduces the cost, power consumption and layout area of the electronic device. At the same time, the possibility of current fluctuation and instability in the load module is reduced.
[0048] The technical solution provided by the embodiments of the present application is described in detail below with reference to the accompanying drawings.
[0049] Figure 2 This is a schematic diagram of a power consumption detection circuit structure of multiple load modules in another electronic device provided by an embodiment of the present application. Figure 2As shown, the electronic device 20 includes a lithium battery 200, a first load module 201, a second load module 202, a sampling resistor 203 shared by the first load module 201 and the second load module 202, an ADC sampling channel 204 corresponding to the sampling resistor 203, an MCU 205, and an AP 206. Among them, the first load module 201 includes a Buck circuit 2011 and a central processing unit (CPU) 2012 coupled to the Buck circuit 2011. The second load module 202 includes a Buck circuit 2012 and a static random access memory (SRAM) 2022 coupled to the Buck circuit 2012. The ADC sampling channel 204 is connected across the two ends of the sampling resistor 203 and is used to transmit the voltage signal of the sampling resistor 203. MCU205 is coupled to the ADC sampling channel 204, and is used to calculate the input current signal of the sampling resistor 203 based on the voltage signal of the sampling resistor 203 and the resistance value of the sampling resistor 203; receives and responds to the sampling rate configuration signal and the processing interval configuration signal, and processes the input current signal based on the preset proportional relationship between the input currents of the first load module 201 and the second load module 202 to obtain the first input current of the first load module 201 and the second input current of the second load module 202. The power consumption of the first load module 201 is calculated based on the first input current of the first load module 201, and the power consumption of the second load module 202 is calculated based on the second input current of the second load module 202. AP 206 is coupled to the MCU 205, and is used to generate the sampling rate configuration signal and the processing interval configuration signal, and send the sampling rate configuration signal and the processing interval configuration signal to the MCU 205.
[0050] In the embodiments of the present application, the electronic device may be a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), or the like, which uses a multi-battery series system to supply power. The embodiments of the present application do not impose any restrictions on the specific type of the electronic device.
[0051] Take the example of a mobile phone being an electronic device. Figure 3 A schematic structural diagram of an electronic device provided in the present application is shown.
[0052] Reference Figure 3As shown, the electronic device may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a display screen 193, a subscriber identification module (SIM) card interface 194, and a camera 195, etc. Among them, the sensor module 180 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.
[0053] The processor 110 may include one or more processing units, for example, the processor 110 may include an AP, a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0054] The controller can be the nerve center and command center of the electronic device. The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.
[0055] A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or circulated. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. Repeated access is avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved. In the embodiment of the present application, the processor may be a SOC.
[0056] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an I2C interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0057] The charging management module 140 is used to receive charging input from a power supply device (such as a charger, a laptop, etc.). The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input through a wireless charging coil of the electronic device.
[0058] In the embodiment of the present disclosure, the charging management module 140 may correspond to Figure 3 In some examples, the charging module 3022 may include a Buck circuit for constant voltage charging of the battery 142 and a current chip for high current charging and pre-charging of the battery 142.
[0059] While charging the battery 142, the charging management module 140 can also power the electronic device through the power management module 141. The battery 142 can be composed of multiple batteries connected in series. The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110.
[0060] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 193, the camera 195, and the wireless communication module 160. The power management module 141 can also be used to detect parameters such as the voltage, current, number of battery cycles, and battery health status (leakage, impedance) of the battery 142. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device, for example, the power management module 141 and the charging management module 140 can be different functional modules in the same chip.
[0061] In the embodiment of the present application, the power management module 141 and / or the charging management module 140 may include a fast charging chip. The power management module 141 and / or the charging management module 140 may use the fast charging chip to realize high-power charging of the battery. In the fast charging chip, there will be corresponding multiple registers for different types of data to store corresponding ADC data.
[0062] The external memory interface 120 can be used to connect to an external non-volatile memory to expand the storage capacity of the electronic device. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos are stored in the external non-volatile memory.
[0063] The internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM). The random access memory can be directly read and written by the processor 110, and can be used to store executable programs (such as machine instructions) of the operating system or other running programs, and can also be used to store user and application data. The non-volatile memory can also store executable programs and store user and application data, etc., and can be loaded into the random access memory in advance for direct reading and writing by the processor 110.
[0064] A touch sensor is also called a "touch control device". The touch sensor can be arranged on the display screen 193. The touch sensor and the display screen 193 form a touch screen, also called a "touch control screen". The touch sensor is used to detect a touch operation acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. A visual output related to the touch operation can be provided through the display screen 193. In other embodiments, the touch sensor can also be arranged on the surface of the electronic device, which is different from the position of the display screen 193.
[0065] The pressure sensor is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor can be set on the display screen 193. There are many types of pressure sensors, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. When a touch operation is applied to the display screen 193, the electronic device detects the touch operation strength according to the pressure sensor. The electronic device can also calculate the touch position based on the detection signal of the pressure sensor. In some embodiments, touch operations acting on the same touch position but with different touch operation strengths can correspond to different operation instructions. For example: when a touch operation with a touch operation strength less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation strength greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.
[0066] A temperature sensor is a device used to measure the temperature of an environment or object. It can convert temperature into electrical signals or digital signals so that the temperature can be read and processed by computers or other electronic devices.
[0067] Gyroscope (GYRO-sensor), also known as ground sensor or gyro sensor, has a traditional structure with a gyroscope inside. A three-axis gyroscope can simultaneously measure the position, movement trajectory, and acceleration in six directions. A single-axis gyroscope can only measure quantities in two directions, that is, a system requires three gyroscopes, and a three-axis gyroscope can replace three single-axis gyroscopes. The working principle of a three-axis gyroscope is to measure the angle between the vertical axis of the gyroscope rotor and the device in a three-dimensional coordinate system, and calculate the angular velocity, and use the angle and angular velocity to determine the motion state of the object in three-dimensional space. A three-axis gyroscope can simultaneously measure six directions, including up, down, left, right, front, and back (the composite direction can also be decomposed into three-axis coordinates), and finally determine the movement trajectory and acceleration of the device. In other words, the three-axis gyroscope determines the current motion state of the device by measuring its own rotation state, such as forward, backward, upward, downward, left, or right; whether it is accelerating (angular velocity) or decelerating (angular velocity), etc. In the embodiment of the present application, the gyro sensor in the electronic device is a three-axis gyro sensor. The electronic device can determine the position or area on the electronic device corresponding to the heating feedback operation performed by the user based on the detection data of the gyro sensor.
[0068] The electronic device implements the display function through a GPU, a display screen 193, and an application processor. The GPU is a microprocessor for image editing, connecting the display screen 193 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0069] The electronic device can realize the shooting function through ISP, camera 195, video codec, GPU, display screen 193 and application processor.
[0070] ISP is used to process data fed back by camera 195. For example, when taking a photo, the shutter is opened, and light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise and brightness of the image. ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, ISP can be set in camera 195. Camera 195 is used to capture still images or videos. In some embodiments, the electronic device may include 1 or N cameras, where N is a positive integer greater than 1. Camera 195 can be a front camera or a rear camera.
[0071] Digital signal processors are used to process digital signals. In addition to processing digital image signals, they can also process other digital signals. For example, when an electronic device selects a frequency point, a digital signal processor is used to perform Fourier transform on the frequency point energy.
[0072] The display screen 193 is used to display images, videos, etc. The display screen 193 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), miniLED, microLed, micro-oLed, quantum dot light-emitting diodes (QLED), etc. In some embodiments, the electronic device may include 1 or N display screens 193, where N is a positive integer greater than 1.
[0073] In an embodiment of the present application, the display screen 193 can be used to display the interface of the electronic device (for example, a camera preview interface, a video preview interface, a finished film preview interface, etc.), and display images taken from any one or more cameras 195 in the interface.
[0074] The wireless communication function of the electronic device can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem and baseband processor.
[0075] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas.
[0076] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to electronic devices. The mobile communication module 150 can receive electromagnetic waves through the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0077] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 193. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0078] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to electronic devices. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0079] The SIM card interface 194 is used to connect a SIM card. The SIM card can be connected to or disconnected from the electronic device by inserting it into or removing it from the SIM card interface 194. The electronic device can support one or more SIM card interfaces. The SIM card interface 194 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 194 at the same time. The SIM card interface 194 can also be compatible with external memory cards. The electronic device interacts with the network through the SIM card to implement functions such as calls and data communications. One SIM card corresponds to one user number.
[0080] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation of the electronic device. In other embodiments of the present application, the electronic device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0081] Of course, it is understandable that the above Figure 3 The figure is only an exemplary description when the electronic device is in the form of a mobile phone. If the electronic device is in the form of a tablet computer, a handheld computer, a personal computer (PC), a PDA, a wearable device (such as a smart watch, a smart bracelet), etc., the structure of the electronic device may include Figure 3 The structure shown in the figure is less than Figure 3 More structures are shown in the figure, which are not limited here.
[0082] It is understandable that, in general, the realization of electronic device functions requires not only hardware support, but also software cooperation. The software system of the electronic device can adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application does not limit the architecture adopted by the software system of the electronic device. The embodiment of the present application is exemplified by taking the software system of the electronic device as a layered architecture as an example. Exemplarily, the layered architecture can be, from top to bottom, an application layer, a framework layer (or an application framework layer), a HAL layer (hardware abstraction layer, hardware abstraction layer) and a driver layer (or a kernel layer).
[0083] The methods in the following embodiments can all be implemented in an electronic device having the above hardware structure and any software system layered architecture.
[0084] Based on the above hardware architecture and software structure, the following combination Figure 4 , the power consumption detection method provided in the embodiment of the present application is described in detail, and the method can be used for Figure 2 In the electronic device shown. Figure 4 As shown, the power consumption detection method provided in the embodiment of the present application may include the following steps S401 to S413:
[0085] Step S401: acquiring a first corresponding relationship between a switching frequency and an input current of a first load module and a second corresponding relationship between a switching frequency and an input current of a second load module in an electronic device.
[0086] Exemplarily, the first load module and the second load module can be any two load modules in the electronic device whose input currents are significantly different (in some examples, the input currents are in a multiple relationship of more than 2 times, for example, a multiple relationship of 10 times). The first load module can be related to the second load module, or it can be unrelated to the second load module. The embodiment of the present application does not limit the correlation between the first load module and the second load module. The embodiment of the present application takes the correlation between the first load module and the second load module as an example for illustrative explanation. For example, the first load module can correspond to Figure 2 The first load module 201 and the second load module may correspond to Figure 2 The second load module 202 in.
[0087] Exemplarily, the first correspondence between the switching frequency and the input current of the first load module can represent the input current of the first load module when the first load module operates at different switching frequencies. In some examples, the first correspondence between the switching frequency and the input current of the first load module can be determined according to the correspondence between the switching frequency and the load current of the first load module and the correspondence between the input current of the first load module and the load current of the first load module.
[0088] Exemplarily, the second correspondence between the switching frequency and the input current of the second load module can represent the input current of the second load module when the second load module operates at the same switching frequency. In some examples, the second correspondence between the switching frequency and the input current of the second load module can be determined according to the correspondence between the switching frequency and the load current of the second load module and the correspondence between the input current of the second load module and the load current of the second load module.
[0089] It can be understood that if the input voltage and output voltage of the Buck circuit in the first load module and the second load module are the same, the corresponding relationship between the switching frequency and the load current of the first load module and the corresponding relationship between the switching frequency and the load current of the second load module can be the same. For example, if the input voltage of the Buck circuit in the first load module and the second load module is 12V, and the output voltage of the Buck circuit in the first load module and the second load module is 1.2V, then the corresponding relationship between the switching frequency and the load current of the first load module and the corresponding relationship between the switching frequency and the load current of the second load module can be referred to. Figure 5A Curve 501 in .
[0090] For example, reference Figure 2As shown, step S401 may include: MCU 205 determines the corresponding relationship between the switching frequency and the load current of the first load module and the corresponding relationship between the switching frequency and the load current of the second load module, converts the corresponding relationship between the switching frequency and the load current of the first load module based on the corresponding relationship between the input current of the first load module and the load current of the first load module, and obtains the first corresponding relationship between the switching frequency and the input current of the first load module; converts the corresponding relationship between the switching frequency and the load current of the second load module based on the corresponding relationship between the input current of the second load module and the load current of the second load module, and obtains the second corresponding relationship between the switching frequency and the input current of the second load module.
[0091] In some examples, since the corresponding relationship between the input current of the first load module and the load current of the first load module and the corresponding relationship between the input current of the second load module and the load current of the second load module are both fixed ratios, the first corresponding relationship between the switching frequency of the first load module and the input current and the second corresponding relationship between the switching frequency of the second load module and the input current can be Figure 5A The curve 501 in is similar.
[0092] Step S402: determining a first rated input current of the first load module based on the first corresponding relationship and the switching frequency of the first load module.
[0093] For example, reference Figure 2 As shown, step S402 may include: the MCU 205 searches for the current corresponding to the switching frequency of the first load module from the first corresponding relationship, and determines the searched current as the first rated input current of the first load module.
[0094] In some examples, if the first correspondence is Figure 5A According to the curve 501 in FIG. 5 , the switching frequency of the first load module is 2 MHz (megahertz), and the first rated input current of the first load module is 2 A (ampere).
[0095] Step S403: determining a second rated input current of the second load module based on the second corresponding relationship and the switching frequency of the second load module.
[0096] For example, reference Figure 2 As shown, step S403 may include: the MCU 205 searches for the current corresponding to the switching frequency of the second load module from the second corresponding relationship, and determines the searched current as the second rated input current of the second load module.
[0097] In some examples, if the second correspondence is Figure 5A According to the curve 501 in FIG. 5 , the switching frequency of the second load module is 1 MHz, and the second rated input current of the second load module is 1A.
[0098] Step S404: determining an input current proportional relationship between the first load module and the second load module based on the first rated input current of the first load module and the second rated input current of the second load module.
[0099] For example, reference Figure 2 As shown, step S404 may include: MCU 205 calculates the ratio of the first rated input current to the second rated input current, and uses the ratio as the input current proportional relationship of the first load module and the second load module. For example, if the first rated input current is 2A and the second rated input current is 1A, the input current proportional relationship of the first load module and the second load module is determined to be 2:1. For another example, if the first rated input current is 2A and the second rated input current is 0.5A, the input current proportional relationship of the first load module and the second load module is determined to be 4:1.
[0100] In some examples, since the first load module and the second load module both include a Buck module and a load unit coupled in series, the first input current signal of the first load module and the second input current signal of the second load module are both periodic signals with a preset duty cycle, and are not current signals with a constant current value. Therefore, the first current corresponding to the first input current signal may be the current average value of the first input current signal; and the second input current corresponding to the second input current signal may be the current average value of the second input current signal.
[0101] refer to Figure 5B As shown, the waveforms of the first input current signal and the second input current signal may be similar to waveform 502 , and the embodiment of the present application does not limit the period and duty cycle of the waveforms of the first input current signal and the second input current signal.
[0102] It is understandable that, for a fixed integrated circuit in an electronic device, if the operating frequency of the first load module and the second load module is a fixed operating frequency, the input current ratio relationship of the first load module and the second load module is also a fixed ratio. For example, if the operating frequency of the Buck circuit in the first load module is 2MHz, and the operating frequency of the Buck circuit in the second load module is 1MHz, the input current ratio relationship of the first load module and the second load module can be fixed to 2:1.
[0103] Exemplarily, the input current proportional relationship between the first load module and the second load module can be pre-written into the MCU 205 of the electronic device, so that when the first load module and the second load module in the electronic device are powered on, the input current proportional relationship between the first load module and the second load module can be read.
[0104] Step S405 : detecting an input current signal of a sampling resistor shared by a first load module and a second load module in the electronic device according to a preset sampling frequency.
[0105] Exemplarily, the predicted sampling frequency may be any sampling frequency set according to the requirements. The embodiment of the present application does not limit the size of the preset sampling frequency, and the preset sampling frequency is any frequency between 0kHz (kilohertz) and 2MHz (megahertz). Figure 2 As shown, the signal sampling frequency of MCU 205 can be set by AP 206, and the signal sampling frequency of MCU 205 can be set to a preset sampling frequency. For example, AP 206 can send a sampling rate configuration signal to MCU 205, and MCU 205 receives and samples according to the preset sampling rate in response to the sampling rate configuration signal.
[0106] Exemplarily, the input current signal of the sampling resistor is the same as the total current signal obtained by superimposing the first input current signal of the first load module and the second input current signal of the second load module. In some examples, the input current signal of the sampling resistor can be determined by the voltage signal of the sampling resistor and the resistance value of the sampling resistor. For example, the quotient of the voltage signal of the sampling resistor and the resistance value of the sampling resistor can be determined as the input current signal of the sampling resistor. Figure 2 As shown, the input current signal of the sampling resistor 203 is the quotient of the voltage signal of the sampling resistor 203 and the resistance value of the sampling resistor 203 .
[0107] For example, reference Figure 2 As shown, step 402 may include: the MCU 205 may first receive a sampling rate configuration signal sent by the AP 206, and in response to the sampling rate configuration signal, detect the voltage of the sampling resistor 203 through the ADC sampling channel 204 according to a preset sampling frequency to obtain multiple voltage signals of the sampling resistor 203, and determine the quotient of each voltage signal and the resistance value of the sampling resistor 203 as the input current signal of the sampling resistor 203.
[0108] Step S406: Perform spectrum analysis on the multiple input current signals to determine the DC component and other frequency components.
[0109] Exemplarily, the number of the plurality of input current signals is related to the preset sampling frequency and the spectrum analysis interval. In some examples, the number of the plurality of input current signals may be the quotient of the spectrum analysis interval and the sampling interval corresponding to the preset sampling frequency. For example, if the spectrum analysis interval is 8 ms (milliseconds) and the preset sampling rate is 10 kHz, the corresponding sampling interval is 0.1 ms, and the number of the plurality of input current signals is 80.
[0110] For example, reference Figure 2As shown, AP 206 may generate a processing interval configuration signal and output the processing interval configuration signal to MCU 205. MCU 205 performs spectrum analysis on multiple input current signals collected within the spectrum analysis interval in response to the processing interval configuration signal to obtain DC components and other frequency components.
[0111] Exemplarily, the implementation method of spectrum analysis may include wavelet transform, Fourier transform (FT), fast Fourier transform (FFT), short-time Fourier transform (STFT) ... etc. The implementation method of spectrum analysis is not limited in the embodiment of the present application. The embodiment of the present application takes the implementation method of spectrum analysis including wavelet transform as an example for exemplary description.
[0112] In some examples, the implementation method of spectrum analysis includes wavelet transform as an example, refer to Figure 2 As shown, step S403 may include: MCU 205 transforms multiple input current signals from the time domain to the frequency domain through wavelet transform to obtain frequency spectra corresponding to the multiple input current signals, and determines the component with a frequency of 0 in the spectrum as a DC component, and determines other components in the spectrum except the DC component as other frequency components.
[0113] Since the spectrum of the signal includes multiple peaks, each peak corresponds to a frequency component in the signal, and the height of each peak may correspond to the amplitude of the frequency component. Therefore, the height of the DC component in the spectrum corresponding to the multiple input current signals is the amplitude of the DC component, and the height of each frequency component is the amplitude of the corresponding frequency component.
[0114] Step S407: performing frequency domain to time domain transformation on the DC component to obtain a first current value.
[0115] Exemplarily, since the value of the periodic signal in the time domain corresponds to the amplitude of the corresponding frequency component in the frequency domain, reference Figure 2 As shown, step S404 may include: the MCU 205 obtains a pre-stored correspondence between an amplitude in the frequency domain and a current value in the time domain, converts the amplitude of the DC component into a current value according to the correspondence, and determines the current value as the first current value.
[0116] In some examples, there may be a proportional relationship between the amplitude in the frequency domain and the current value in the time domain. For example, the amplitude in the frequency domain may be the same as the current value in the time domain, that is, there is a 1:1 proportional relationship between the amplitude in the frequency domain and the current value in the time domain.
[0117] Step S408 : splitting the first current value based on the input current ratio relationship between the first load module and the second load module to obtain a first sub-current value corresponding to the first load module and a second sub-current value corresponding to the second load module.
[0118] For example, reference Figure 2 As shown, step S405 may include: MCU 205 reads the stored k:1 value, splits the first current value based on the k:1 value, and obtains a first sub-current value corresponding to the first load module and a second sub-current value corresponding to the second load module.
[0119] In some examples, splitting the first current value based on the value of k:1 to obtain a first sub-current value corresponding to the first load module and a second sub-current value corresponding to the second load module may include: determining a quotient of the first current value and (k+1), and using the quotient as the second sub-current value corresponding to the second load module, and using k times the quotient as the first sub-current value corresponding to the first load module. For example, if k=10 and the first current value is 1.1A, 0.1A may be used as the second sub-current value corresponding to the second load module, and 1A may be used as the first sub-current value corresponding to the first load module.
[0120] Step S409: determining at least one target frequency component from the other frequency components based on the amplitude of each frequency component in the other frequency components.
[0121] Exemplarily, the number of target frequency components in the at least one target frequency component can be determined according to the detection accuracy requirements of the electronic device, and the embodiment of the present application does not limit the specific number of target frequency components in the at least one target frequency component. The embodiment of the present application takes the example that the at least one target frequency component includes 2 target frequency components as an example for exemplary description.
[0122] For example, reference Figure 2 As shown, step S406 may include: MCU 205 determines the amplitude of each frequency component in other frequency components, and sorts the frequency components according to the amplitude, takes the top two frequency components as the frequency components with the largest amplitude, and determines the top two frequency components as two target frequency components.
[0123] Step S410: Perform frequency domain to time domain transformation on each target frequency component of at least one target frequency component to obtain a second current value corresponding to each target frequency component.
[0124] In some examples, if at least one target frequency component includes a first target frequency component and a second target frequency component, a frequency domain-to-time domain transform is performed on the first target frequency component to obtain a second current value corresponding to the first target frequency component, and a frequency domain-to-time domain transform is performed on the second target frequency component to obtain a second current value corresponding to the second target frequency component.
[0125] Exemplarily, the frequency-to-time domain transformation is performed on each target frequency component in at least one target frequency component to obtain the second voltage value corresponding to each target frequency component, which is similar to the frequency-to-time domain transformation of the DC component to obtain the first current value. For details, please refer to step S404, and the embodiments of the present application will not be repeated here.
[0126] Step S411, splitting the second current value corresponding to each target frequency component based on the input current ratio relationship between the first load module and the second load module to obtain at least one third sub-current value corresponding to the first load module and at least one fourth sub-current value corresponding to the second load module.
[0127] Exemplarily, if at least one target frequency component includes a first target frequency component and a second target frequency component, then at least one third sub-current value includes a first third sub-current value corresponding to the first target frequency component and a second third sub-current value corresponding to the second target frequency component. At least one fourth sub-current value includes a first fourth sub-current value corresponding to the first target frequency component and a second fourth sub-current value corresponding to the second target frequency component.
[0128] refer to Figure 2 As shown, taking at least one third sub-current value including a first third sub-current value corresponding to the first target frequency component and a second sub-current value corresponding to the second target frequency component as an example. Step S408 may include: MCU 205 splits the second voltage value corresponding to the first target frequency component based on the input current proportional relationship between the first load module and the second load module to obtain the first third sub-current value corresponding to the first load module and the first fourth sub-current value corresponding to the second load module; splits the second voltage value corresponding to the second target frequency component based on the input current proportional relationship between the first load module and the second load module to obtain the second third sub-current value corresponding to the first load module and the second fourth sub-current value corresponding to the second load module.
[0129] Exemplarily, since the second voltage value corresponding to the first target frequency component is split based on the input current proportional relationship between the first load module and the second load module, the first third sub-current value corresponding to the first load module and the first fourth sub-current value corresponding to the second load module are obtained, and the second voltage value corresponding to the second target frequency component is split based on the input current proportional relationship between the first load module and the second load module to obtain the second third sub-current value corresponding to the first load module and the second fourth sub-current value corresponding to the second load module. The implementation method is similar to the implementation method of splitting the first current value based on the input current proportional relationship between the first load module and the second load module to obtain the first sub-current value corresponding to the first load module and the second sub-current value corresponding to the second load module. For details, please refer to step S405, and the embodiments of the present application will not be repeated here.
[0130] Step S412: determine a first input current of the first load module based on at least one third sub-current value and the first sub-current value; determine a second input current of the second load module based on at least one fourth sub-current value and the second sub-current value.
[0131] For example, reference Figure 2 As shown, step S409 may include: MCU 205 determines the sum of at least one third sub-current value and the first sub-current value as the first input current of the first load module, and determines the sum of at least one fourth sub-current value and the second sub-current value as the second input current of the second load module.
[0132] Step S413, determining a first power consumption of the first load module based on a first input current of the first load module and a first input voltage of the first load module; determining a second power consumption of the second load module based on a second input current of the second load module and a second input voltage of the second load module.
[0133] For example, reference Figure 2 As shown, step S410 may include: the MCU 205 determines the product of the first input current of the first load module 201 and the first input voltage of the first load module as the first power consumption of the first load module 201; and determines the product of the second input current of the second load module 202 and the second input voltage of the second load module 202 as the second power consumption of the second load module 202.
[0134] In the embodiment of the present application, by detecting the input current signal of the first load module and the second load module using a resistor shared by the first load module and the second load module according to the preset sampling frequency, the input current signal is subjected to spectrum analysis to obtain a DC component and other frequency components. The DC component and other frequency components are processed separately according to the proportional relationship between the input currents of the first load module and the second load module, so that the first input current of the first load module and the second input current of the second load module can be obtained more accurately, and then the power consumption of the first load module and the power consumption of the second load module can be determined more accurately. In this way, the power consumption detection of multiple load modules can be realized through the resistor shared by the first load module and the second load module and an ADC sampling path, which not only improves the efficiency of the electronic device, but also reduces the cost, power consumption and layout area of the electronic device. At the same time, the possibility of current fluctuation and instability in the load module is also reduced.
[0135] In other embodiments of the present application, if there is an obvious difference between the input currents of multiple load modules (greater than or equal to 3 load modules) in the electronic device, the multiple load modules may share a sampling resistor, and the power consumption detection of the multiple load modules is implemented through the shared sampling resistor. The implementation method of the power consumption detection of the multiple loads is similar to the above steps S401 to S413.
[0136] Figure 6 is a flow chart of another power consumption detection method provided in an embodiment of the present application, refer to Figure 6 As shown, the power consumption detection method may include the following steps S601 to S605.
[0137] Step S601: obtaining an input current ratio relationship between a plurality of load modules that share a first sampling resistor in an electronic device.
[0138] Exemplarily, the number of load modules in the multiple load modules may be greater than or equal to 2. In some examples, the number of load modules in the multiple load modules may be 3. In other examples, the number of load modules in the multiple load modules may be 2, and the embodiment of the present application does not limit the number of load modules in the multiple load modules. The embodiment of the present application takes the number of load modules in the multiple load modules as 2 as an example for exemplary description.
[0139] Take the case where the number of load modules in the multiple load modules is 2 as an example. Figure 2 As shown, the first sampling resistor may correspond to the sampling resistor 203 , and the plurality of load modules may include a first load module 201 and a second load module 202 .
[0140] In some embodiments of the present application, obtaining an input current proportional relationship between multiple load modules that share a first sampling resistor in an electronic device includes: obtaining a corresponding relationship between a switching frequency and an input current of each load module; determining an input current corresponding to the switching frequency of each load module based on the corresponding relationship between the switching frequency and the input current; and determining an input current proportional relationship between multiple load modules based on the input current corresponding to the switching frequency of each load module.
[0141] Exemplarily, the corresponding relationship between the switching frequency and the input current of each load module is obtained; based on the corresponding relationship between the switching frequency and the input current, the input current corresponding to the switching frequency of each load module is determined; based on the input current corresponding to the switching frequency of each load module, the input current ratio relationship between multiple load modules is determined. Figure 4 Steps S401 to S404 of the illustrated embodiment will not be described in detail in the embodiment of the present application.
[0142] Step S602: Detect an input current signal of a first sampling resistor.
[0143] In some embodiments of the present application, detecting the input current signal detected by the first sampling resistor may include: detecting a voltage signal of the first sampling resistor; and determining the input current signal of the first sampling resistor based on the voltage signal of the first sampling resistor and the resistance value of the first sampling resistor.
[0144] Exemplarily, step S602 may include: detecting an input current signal of the first sampling resistor according to a preset sampling frequency.
[0145] Since the implementation method of detecting the input current signal of the first sampling resistor according to the preset sampling frequency is similar to the implementation method of detecting the input current signal of the sampling resistor shared by the first load module and the second load module in the electronic device according to the preset sampling frequency, the specific implementation method can be seen in Figure 4 Step S405 of the illustrated embodiment will not be described in detail in the embodiment of the present application.
[0146] Step S603: Perform spectrum analysis on the input current signal to determine the DC component and other frequency components.
[0147] The other frequency components are the remaining frequency components in the frequency spectrum of the input current signal except the DC component.
[0148] For example, the implementation of performing spectrum analysis on the input current signal to determine the DC component and other frequency components can be found in Figure 4 Step S406 of the illustrated embodiment will not be described in detail in the embodiment of the present application.
[0149] Step S604: Process the DC component and other frequency components based on the input current proportional relationship to obtain the input current corresponding to each load module.
[0150] In some embodiments of the present application, the input current includes a first current component corresponding to a DC component and a second current component corresponding to other frequency components; the DC component and other frequency components are processed separately based on the proportional relationship of the input current to obtain the input current corresponding to each load module, including: processing the DC component based on the proportional relationship of the input current to obtain the first current component corresponding to each load module; processing other frequency components based on the proportional relationship of the input current to obtain the second current component corresponding to each load module; determining the input current corresponding to each load module based on the first current component corresponding to each load module and the second current component corresponding to each load module.
[0151] For example, if the plurality of load modules include a first load module and a second load module, the first current component corresponding to the first load module may correspond to: Figure 4 In the embodiment shown, the first sub-current value and the first current component corresponding to the second load module may correspond to: Figure 4 The second sub-current value in the embodiment shown; the second current component corresponding to the first load module may correspond to Figure 4 The third sub-current values in the embodiment shown; the second current component corresponding to the second load module may correspond to Figure 4 A plurality of fourth sub-current values in the illustrated embodiment.
[0152] In some embodiments of the present application, the DC component is processed based on the proportional relationship of the input current to obtain the first current component corresponding to each load module, including: performing frequency domain to time domain processing on the DC component to obtain a first current value; and splitting the first current value based on the proportional relationship of the input current to obtain the first current component corresponding to each load module.
[0153] Exemplarily, the DC component is processed from the frequency domain to the time domain to obtain the first current value; the first current value is split based on the input current ratio to obtain the first current component corresponding to each load module. For an implementation method, see Figure 4 The step S408 of the illustrated embodiment will not be described in detail in the embodiment of the present application.
[0154] In some embodiments of the present application, multiple load modules include a first load module and a second load module, and the input current proportional relationship includes a ratio of a first input current of the first load module to a second input current of the second load module of k:1; wherein k is a positive number; based on the input current proportional relationship, the first current value is split to obtain the first current component corresponding to each load module, including: dividing the first current value by (k+1) to obtain the first current component corresponding to the second load module; and determining the first current component corresponding to the second load module with k times as the first current component corresponding to the first load module.
[0155] Exemplarily, the first current value is divided by (k+1) to obtain the first current component corresponding to the second load module; the implementation method of determining the first current component corresponding to the second load module k times as the first current component corresponding to the first load module can be seen in Figure 4 The step S408 of the illustrated embodiment will not be described in detail in the embodiment of the present application.
[0156] In some embodiments of the present application, other frequency components are processed based on the proportional relationship of the input current to obtain second current components corresponding to each load module, including: determining at least one target frequency component from the other frequency components; performing frequency domain to time domain processing on each target frequency component in at least one target frequency component to obtain a second current value corresponding to each target frequency component; and splitting each second current value in multiple second current values based on the proportional relationship of the input current to obtain a second current component corresponding to each load module.
[0157] Exemplarily, at least one target frequency component is determined from other frequency components; each target frequency component in the at least one target frequency component is processed from the frequency domain to the time domain to obtain a second current value corresponding to each target frequency component; each second current value in the plurality of second current values is split based on the input current proportional relationship to obtain a second current component corresponding to each load module. For an implementation method, see Figure 4 Steps S409 to S4011 of the illustrated embodiment will not be described in detail in the embodiment of the present application.
[0158] In some embodiments of the present application, determining at least one target frequency component from other frequency components includes: determining the amplitude of each frequency component in the other frequency components; and determining at least one frequency component with the largest amplitude as the at least one target frequency component.
[0159] Exemplarily, the amplitude of each frequency component in the other frequency components is determined; and the implementation method of determining at least one frequency component with the largest amplitude as at least one target frequency component can be seen in Figure 4 Step S409 of the illustrated embodiment will not be described in detail in the embodiment of the present application.
[0160] In some embodiments of the present application, based on the first current component corresponding to each load module and the second current component corresponding to each load module, the input current corresponding to each load module is determined, including: determining the sum of the first current component corresponding to each load module and the second current component corresponding to each load module as the input current corresponding to each load module.
[0161] For example, the implementation method of determining the sum of the first current component corresponding to each load module and the second current component corresponding to each load module as the input current corresponding to each load module can be seen in FIG. Figure 4 The step S412 of the illustrated embodiment will not be described in detail in the embodiment of the present application.
[0162] Step S605: determining the power consumption of each load module based on the input current corresponding to each load module.
[0163] For example, based on the input current corresponding to each load module, the implementation method of determining the power consumption of each load module can be seen in Figure 4 Step S413 in the illustrated embodiment will not be described in detail in the embodiment of the present application.
[0164] It is understandable that, in order to realize the above functions, the above electronic device includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the embodiments of the present invention can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiments of the present application.
[0165] The embodiment of the present application can divide the functional modules of the above-mentioned electronic device according to the above-mentioned method example. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present invention is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0166] In the case of dividing each functional module into corresponding functional modules, refer to Figure 7As shown, the embodiment of the present application provides an electronic device, which can implement the power consumption detection method provided in the above embodiment. The electronic device 700 may include an acquisition module 701, a detection module 702, a spectrum analysis module 703, a processing module 704 and a determination module 705.
[0167] The acquisition module 701 is used to acquire the input current ratio relationship between multiple load modules that share a first sampling resistor in the electronic device;
[0168] A detection module 702, used to detect an input current signal of a first sampling resistor;
[0169] The spectrum analysis module 703 is used to perform spectrum analysis on the input current signal to determine the DC component and other frequency components; wherein the other frequency components are the remaining frequency components in the spectrum of the input current signal except the DC component;
[0170] A processing module 704 is used to process the DC component and other frequency components respectively based on the proportional relationship of the input current to obtain the input current corresponding to each load module;
[0171] The determination module 705 is used to determine the power consumption of each load module based on the input current corresponding to each load module.
[0172] Optionally, the acquisition module 701 is specifically used to obtain the corresponding relationship between the switching frequency and the input current of each load module; based on the corresponding relationship between the switching frequency and the input current, determine the input current corresponding to the switching frequency of each load module; based on the input current corresponding to the switching frequency of each load module, determine the input current proportional relationship between multiple load modules.
[0173] Optionally, the input current includes a first current component corresponding to the DC component and a second current component corresponding to other frequency components; the processing module 704 is specifically used to process the DC component based on the proportional relationship of the input current to obtain the first current component corresponding to each load module; process the other frequency components based on the proportional relationship of the input current to obtain the second current component corresponding to each load module; determine the input current corresponding to each load module based on the first current component corresponding to each load module and the second current component corresponding to each load module.
[0174] Optionally, the processing module 704 is specifically configured to perform frequency domain to time domain processing on the DC component to obtain a first current value; and split the first current value based on a proportional relationship of the input current to obtain a first current component corresponding to each load module.
[0175] Optionally, the multiple load modules include a first load module and a second load module, and the input current proportional relationship includes a ratio of a first input current of the first load module to a second input current of the second load module of k:1; wherein k is a positive number. The processing module 704 is specifically used to divide the first current value by (k+1) to obtain a first current component corresponding to the second load module; and determine the first current component corresponding to the second load module of k times as the first current component corresponding to the first load module.
[0176] Optionally, the processing module 704 is specifically used to determine at least one target frequency component from other frequency components; perform frequency domain to time domain processing on each target frequency component in the at least one target frequency component to obtain a second current value corresponding to each target frequency component; and split each second current value in the multiple second current values based on the input current proportional relationship to obtain a second current component corresponding to each load module.
[0177] Optionally, the processing module 704 is specifically configured to determine the amplitude of each frequency component in the other frequency components; and determine at least one frequency component with the largest amplitude as at least one target frequency component.
[0178] Optionally, the processing module 704 is specifically configured to determine the sum of the first current component corresponding to each load module and the second current component corresponding to each load module as the input current corresponding to each load module.
[0179] Regarding the electronic device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment of the power consumption detection method in the above embodiment, and will not be elaborated here. The relevant beneficial effects can also refer to the relevant beneficial effects of the above power consumption detection method, and will not be repeated here.
[0180] The present application also provides an electronic device, which includes: a display screen, a memory and one or more processors; the display screen, the memory and the processor are coupled; wherein the memory stores a computer program code, the computer program code includes computer instructions, and when the computer instructions are executed by the processor, the electronic device executes the power consumption detection method provided in the above embodiment. The specific structure of the electronic device can be referred to Figure 3 The structure of the electronic device shown in .
[0181] An embodiment of the present application also provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the power consumption detection method provided in the above embodiment.
[0182] An embodiment of the present application also provides a computer program product, which includes executable instructions. When the computer program product is run on an electronic device, the electronic device executes the power consumption detection method provided in the above embodiment.
[0183] The present application also provides a chip system, such as Figure 8 As shown, the chip system 800 includes at least one processor 801 and at least one interface circuit 802. The processor 801 and the interface circuit 802 can be interconnected through a line. For example, the interface circuit 802 can be used to receive signals from other devices (such as a memory of an electronic device). For another example, the interface circuit 802 can be used to send signals to other devices (such as the processor 110).
[0184] Exemplarily, the interface circuit 802 can read the instruction stored in the memory and send the instruction to the processor 801. When the instruction is executed by the processor 801, the electronic device can execute each step in the above embodiment. Of course, the chip system can also include other discrete devices, which is not specifically limited in the embodiment of the present application.
[0185] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0186] In the several embodiments provided in the present application, it should be understood that the disclosed devices / equipment and methods can be implemented in other ways. For example, the device / equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0187] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0188] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0189] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0190] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A power consumption detection method, characterized in that: Applied to electronic equipment, the method comprises: Acquire the input current ratio relationship between multiple load modules that share a first sampling resistor in the electronic device; Detecting an input current signal of the first sampling resistor; Performing spectrum analysis on the input current signal to obtain a DC component and other frequency components; wherein the other frequency components are the remaining frequency components in the spectrum of the input current signal except the DC component; Based on the input current proportional relationship, the DC component and the other frequency components are processed respectively to obtain the input current corresponding to each load module; The power consumption of each load module is determined based on the input current corresponding to each load module.
2. The method according to claim 1, characterized in that: The step of obtaining the input current proportional relationship between a plurality of load modules in the electronic device that share a first sampling resistor includes: Obtaining the corresponding relationship between the switching frequency and the input current of each load module; Based on the corresponding relationship between the switching frequency and the input current, determining the input current corresponding to the switching frequency of each load module; Based on the input current corresponding to the switching frequency of each load module, the input current proportional relationship between the multiple load modules is determined.
3. The method according to claim 1, characterized in that The input current includes a first current component corresponding to the DC component and a second current component corresponding to the other frequency components; The processing of the DC component and the other frequency components based on the input current proportional relationship to obtain the input current corresponding to each load module includes: Processing the DC component based on the input current proportional relationship to obtain the first current component corresponding to each load module; Processing the other frequency components based on the input current proportional relationship to obtain the second current components corresponding to each load module; Based on the first current component corresponding to each of the load modules and the second current component corresponding to each of the load modules, an input current corresponding to each of the load modules is determined.
4. The method according to claim 3, characterized in that The processing of the DC component based on the input current proportional relationship to obtain the first current component corresponding to each load module includes: Performing frequency-domain-to-time-domain processing on the DC component to obtain a first current value; The first current value is split based on the input current proportional relationship to obtain the first current components corresponding to each load module.
5. The method according to claim 4, characterized in that The multiple load modules include a first load module and a second load module, the input current proportional relationship includes a ratio of a first input current of the first load module to a second input current of the second load module of k:1; wherein k is a positive number; the first current value is split based on the input current proportional relationship to obtain the first current components corresponding to each of the load modules, including: Performing a division operation on the first current value and (k+1) to obtain a first current component corresponding to the second load module; The k-fold first current component corresponding to the second load module is determined as the first current component corresponding to the first load module.
6. The method according to claim 3, characterized in that The processing of the other frequency components based on the input current proportional relationship to obtain the second current components corresponding to each load module includes: determining at least one target frequency component from the other frequency components; Performing frequency-domain-to-time-domain processing on each target frequency component of the at least one target frequency component to obtain a second current value corresponding to each target frequency component; Each of the plurality of second current values is split based on the input current proportional relationship to obtain the second current component corresponding to each load module.
7. The method according to claim 6, characterized in that The determining at least one target frequency component from the other frequency components comprises: Determining the amplitude of each frequency component in the other frequency components; At least one frequency component with the largest amplitude is determined as the at least one target frequency component.
8. The method according to claim 3, characterized in that The determining the input current corresponding to each load module based on the first current component corresponding to each load module and the second current component corresponding to each load module includes: The sum of the first current component corresponding to each of the load modules and the second current component corresponding to each of the load modules is determined as the input current corresponding to each of the load modules.
9. An electronic device, characterized in that: It includes a display screen, a memory and one or more processors; the display screen and the memory are coupled to the processor; wherein the memory stores computer program code, the computer program code includes computer instructions, and when the computer instructions are executed by the processor, the electronic device executes the power consumption detection method as described in any one of claims 1-8.
10. A computer-readable storage medium, characterized in that: The method comprises computer instructions, and when the computer instructions are executed on an electronic device, the electronic device executes the power consumption detection method according to any one of claims 1 to 8.