Parameter adjustment method and electronic equipment

By obtaining the difference between the current temperature and the temperature corresponding to the offset parameters in the voltage detection device, and timely updating the offset parameters, the problem of offset parameter fluctuations caused by temperature changes is solved, and the accuracy of the detection results is improved.

CN117706182BActive Publication Date: 2025-02-18HONOR DEVICE CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310648401.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-01
Publication Date
2025-02-18
Estimated Expiration
2043-06-01

AI Technical Summary

Technical Problem

When the temperature of the voltage detection unit changes, there is fluctuation in the offset parameter, which affects the accuracy of the detection result.

Method used

By acquiring the current temperature of the detection device, when the difference between the temperature corresponding to the offset parameter is greater than or equal to the target difference threshold, the acquisition of the second detection voltage and the update of the offset parameter are performed, and the offset parameter is adjusted in a timely manner.

Benefits of technology

It improves the accuracy of the detection results, ensures timely update of offset parameters, and reduces the impact of temperature changes on the detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117706182B_ABST
    Figure CN117706182B_ABST
Patent Text Reader

Abstract

The present application is applied to the detection field, and provides a parameter adjustment method and electronic device, the method comprising: obtaining the current temperature of the detection device; when the difference between the temperature corresponding to the predetermined offset parameter and the current temperature is greater than or equal to the target difference threshold, obtaining a second detection voltage, the second detection voltage is obtained by the voltage detection unit in the detection device detecting the voltage between the two input terminals when the two input terminals are short-circuited; according to the second detection voltage, updating the offset parameter, and taking the current temperature as the temperature corresponding to the updated offset parameter; the offset parameter is used for the processing unit in the detection device to correct the first detection voltage to obtain the detection result of the electrical signal on the resistor to be measured, the first detection voltage is obtained by the voltage detection unit detecting the voltage between the two input terminals when the two input terminals are respectively connected to the two ends of the resistor to be measured. The technical method based on the present application can improve the accuracy of the detection result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of detection, and more specifically, to a parameter adjustment method and an electronic device. Background Art

[0002] Electronic devices have become an indispensable communication and entertainment tool in people's work and life. With the development of energy storage technology, more and more mobile energy storage devices are used in electronic devices, making electronic devices portable and making people's lives more convenient.

[0003] In order to detect the use of the energy storage device, the resistor to be tested can be connected to the energy storage device. Using a voltage detection device, the detection voltage across the resistor to be tested is detected to obtain an initial detection voltage. Substituting the initial detection voltage into the expression, the detection result can be determined, and the detection result can represent the voltage across the resistor to be tested or the current flowing through the detection resistor. According to the expression, the detection result is obtained based on the initial detection voltage and the offset parameter. The offset parameter refers to the offset between the initial detection voltage detected by the voltage detection device and 0 when the voltage across the resistor to be tested is 0.

[0004] When the temperature of the voltage detection unit changes, the offset parameter fluctuates, thereby affecting the accuracy of the detection result. How to improve the accuracy of the detection result is an urgent problem to be solved. Summary of the invention

[0005] The present application provides a parameter adjustment method and an electronic device, which can improve the accuracy of current or voltage detection results.

[0006] In a first aspect, a parameter adjustment method is provided, the method comprising: obtaining a current temperature of a detection device; when a difference between a temperature corresponding to a predetermined offset parameter and the current temperature is greater than or equal to a target difference threshold, obtaining a second detection voltage, the second detection voltage being obtained by a voltage detection unit in the detection device detecting a voltage between two input terminals when the two input terminals are short-circuited; updating the offset parameter according to the second detection voltage, and using the current temperature as the temperature corresponding to the updated offset parameter; the offset parameter is used by a processing unit in the detection device to correct a first detection voltage to obtain a detection result of an electrical signal on a resistor to be measured, the first detection voltage being obtained by the voltage detection unit detecting a voltage between the two input terminals when the two input terminals are respectively connected to the two ends of the resistor to be measured.

[0007] The parameter adjustment method provided in the embodiment of the present application adjusts the offset parameter according to the second detection voltage detected by the voltage detection unit when the two input terminals are short-circuited, when the difference between the current temperature of the detection device and the temperature corresponding to the offset parameter is greater than or equal to the target difference threshold. The offset parameter fluctuates due to the influence of temperature changes. When the difference between the current temperature and the temperature corresponding to the offset parameter is greater than or equal to the target difference threshold, the offset parameter is adjusted so that the adjustment of the offset parameter is more timely, thereby improving the accuracy of the detection result determined according to the offset parameter.

[0008] When the two input terminals of the detection device are respectively connected to the two ends of the resistor to be tested, the voltage detection unit detects the voltage between the two input terminals to obtain a first detection voltage, which is used by the processing unit to subsequently determine the detection result. During the use of the detection device, when the difference between the current temperature and the temperature corresponding to the offset parameter is greater than or equal to the target difference threshold, the offset parameter is adjusted based on the second detection voltage obtained by detecting the voltage between the two input terminals when the two input terminals are short-circuited, so that the adjusted offset parameter is more accurate, thereby improving the accuracy of the detection result subsequently determined by the detection device based on the adjusted offset parameter.

[0009] In one possible implementation, obtaining the second detection voltage includes: in a first detection cycle of the first detection voltage, the voltage detection unit detects a non-detection time period outside the first detection voltage, controlling the two input terminals to be short-circuited, and using the voltage detection unit to perform detection to obtain the second detection voltage.

[0010] In the case where the voltage detection unit detects the first detection voltage according to the first detection cycle, in a non-detection time period other than when the voltage detection unit detects the first detection voltage, the voltage detection unit is used to perform detection to obtain the second detection voltage, so that the detection of the first detection voltage is carried out normally, thereby avoiding the influence of the adjustment of the bias parameter on the detection of the first detection voltage, that is, the adjustment of the bias parameter does not affect the normal detection of the detection result by the detection device, and the detection function of the detection device on the detection result is not affected by the adjustment of the bias parameter.

[0011] In addition, the adjustment of the bias parameter is completed within a first detection cycle, thereby improving the timeliness of the adjustment of the bias parameter. Thus, the detection device can determine the detection result according to the bias parameter adjusted in time, thereby improving the accuracy of the detection result.

[0012] In a possible implementation, the detecting by the voltage detection unit to obtain the second detection voltage includes: controlling the voltage detection unit to perform multiple detections to obtain multiple third detection voltages, wherein the second detection voltage is a representative value of the multiple third detection voltages.

[0013] Using representative values ​​of multiple third detection voltages as the second detection voltage can reduce the error of the second detection voltage and improve the accuracy of the offset parameter determined based on the second detection voltage, thereby improving the accuracy of the detection result determined by the detection device based on the adjusted offset parameter after the offset parameter is adjusted.

[0014] In one possible implementation, the number of the multiple third detection voltages is the maximum number of cycles that meets the cycle condition, and the cycle condition is that the duration of the non-detection time period is greater than or equal to the product of the length of the second detection cycle of the third detection voltage and the number of cycles.

[0015] The plurality of third detection voltages may be obtained by periodically detecting the voltage detection unit according to the second detection cycle. The number of the third detection voltages affects the accuracy of the offset parameter. The number of the plurality of third detection voltages is obtained by rounding down the quotient of the length of the non-detection time period divided by the length of the second detection cycle, maximizing the number of the plurality of third detection voltages, and improving the accuracy of the adjusted offset parameter, thereby improving the accuracy of the detection result determined by the detection device according to the adjusted offset parameter after the offset parameter is adjusted.

[0016] The second detection period may be a minimum sampling time interval of the voltage detection unit.

[0017] In a possible implementation, the detection device is located in an electronic device, and the method further includes: obtaining a current state of the electronic device, wherein multiple states of the electronic device correspond to multiple difference thresholds, the target difference threshold is a difference threshold corresponding to the current state among the multiple states, and the electronic device has different requirements for power consumption in different states.

[0018] In the process of adjusting the offset parameters, the voltage detection unit is required to perform voltage detection in a non-detection time period other than the first detection voltage detection. The number of detections performed by the voltage detection unit increases, and the power consumption increases. In addition, the size of the target difference threshold affects the frequency of adjustment of the offset parameters. The smaller the target difference threshold, the more frequent the adjustment of the offset parameters, and the greater the increase in power consumption. According to the power consumption needs of the electronic device in multiple states, different difference thresholds are set for each state, and the difference threshold corresponding to the current state of the electronic device is used as the target threshold, balancing the contradiction between the increase in power consumption caused by the adjustment of the offset parameters and the actual power consumption needs of the electronic device, so that the adjustment of the offset parameters can better meet the power consumption needs of the electronic device.

[0019] In one possible implementation, the electronic device includes an energy storage device, the multiple states include a charging state and a discharging state, in the charging state, an external power supply powers the electronic device, in the discharging state, the energy storage device powers the electronic device, and the difference threshold corresponding to the charging state is less than the difference threshold of the discharging state.

[0020] In the charging state, the external power supply supplies power to the electronic device, and the electronic device has a lower power consumption requirement, so a smaller difference threshold can be set. In the discharging state, the energy storage device supplies power to the electronic device, and the electronic device has a higher power consumption requirement, so a larger difference threshold can be set. This allows timely adjustment of the offset parameters while better meeting the higher power consumption requirements of the electronic device in the discharging state.

[0021] In a possible implementation, the detection device is located in an electronic device, and the electronic device includes an energy storage device; obtaining the second detection voltage includes: obtaining the second detection voltage when an external power supply is powering the electronic device, or when the energy storage device is powering the electronic device and the electronic device is in a non-standby state.

[0022] When the energy storage device is used to power the electronic device, the power consumption of the electronic device is relatively high. When the electronic device is in standby mode, the power consumption of the electronic device is very low, the temperature of the electronic device is relatively stable, the fluctuation of the bias parameter is small, and the bias parameter adjustment is not required, thereby reducing the power consumption while the detection result accuracy is high.

[0023] In a second aspect, a parameter adjustment device is provided, comprising various units for executing the method in the first aspect. The device may be an electronic device or a chip in an electronic device.

[0024] In a third aspect, an electronic device is provided, comprising a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program from the memory, so that the electronic device executes the method of the first aspect.

[0025] A fourth aspect provides a chip, comprising a processor. When the processor executes instructions, the processor executes the method of the first aspect.

[0026] According to a fifth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program code, and the computer program code is used to implement the method according to the first aspect.

[0027] According to a sixth aspect, a computer program product is provided, the computer program product comprising: a computer program code, wherein the computer program code is used to implement the method according to the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 is a schematic diagram of a hardware system of an electronic device applicable to the present application;

[0029] Figure 2 is a schematic diagram of a software system for an electronic device applicable to the present application;

[0030] Figure 3 is a schematic structural diagram of a detection device;

[0031] Figure 4 is a schematic flow chart of a parameter adjustment method provided in an embodiment of the present application;

[0032] Figure 5 is a schematic flow chart of another parameter adjustment method provided in an embodiment of the present application;

[0033] Figure 6 is a schematic structural diagram of a detection device provided in an embodiment of the present application;

[0034] Figure 7 is a schematic structural diagram of a parameter adjustment device provided by the present application;

[0035] Figure 8 It is a schematic structural diagram of an electronic device for parameter adjustment provided by the present application. DETAILED DESCRIPTION

[0036] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0037] Figure 1 A hardware system of an electronic device suitable for the present application is shown.

[0038] The method provided in the embodiments of the present application can be applied to various electronic devices capable of network communication, such as mobile phones, tablet computers, wearable devices, laptop computers, netbooks, personal digital assistants (PDAs), etc. The embodiments of the present application do not impose any restrictions on the specific types of electronic devices.

[0039] Figure 11 shows a schematic diagram of the structure of the electronic device 100. The electronic device 100 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 camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0040] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0041] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (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.

[0042] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of reading instructions and executing instructions.

[0043] The processor 110 may also be provided with a memory 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 cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0044] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (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.

[0045] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 communicates with the touch sensor 180K through the I2C bus interface, thereby realizing the touch function of the electronic device 100.

[0046] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to achieve communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 via the I2S interface to achieve the function of answering a call through a Bluetooth headset.

[0047] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface to realize the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0048] The UART interface is a universal serial data bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.

[0049] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate via the DSI interface to implement the display function of the electronic device 100.

[0050] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0051] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and a peripheral device. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices, etc.

[0052] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0053] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device through the power management module 141.

[0054] 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 external memory, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. 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.

[0055] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0056] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0057] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from 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.

[0058] 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 194. 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.

[0059] 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 the electronic device 100. 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.

[0060] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).

[0061] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 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.

[0062] The display screen 194 is used to display images, videos, etc. The display screen 194 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, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0063] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0064] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the 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 ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.

[0065] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0066] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0067] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0068] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.

[0069] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0070] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0071] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0072] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.

[0073] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.

[0074] The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the human ear.

[0075] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to microphone 170C to input the sound signal into microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the sound source, realize directional recording function, etc.

[0076] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130 or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0077] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 can also calculate the touch position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity 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 intensity 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.

[0078] The gyro sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyro sensor 180B. The gyro sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyro sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyro sensor 180B can also be used for navigation and somatosensory game scenes.

[0079] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.

[0080] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip leather case. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover according to the magnetic sensor 180D. Then, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, the flip cover can be automatically unlocked.

[0081] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in all directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.

[0082] The distance sensor 180F is used to measure the distance. The electronic device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.

[0083] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode and pocket mode to automatically unlock and lock the screen.

[0084] The ambient light sensor 180L is used to sense the ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.

[0085] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.

[0086] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of a processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 due to low temperature. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 performs a boost on the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.

[0087] The touch sensor 180K is also called a "touch panel". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180K is used to detect touch operations 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. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.

[0088] The bone conduction sensor 180M can obtain a vibration signal. In some embodiments, the bone conduction sensor 180M can obtain a vibration signal of a vibrating bone block of the vocal part of the human body. The bone conduction sensor 180M can also contact the human pulse to receive a blood pressure beat signal. In some embodiments, the bone conduction sensor 180M can also be set in an earphone and combined into a bone conduction earphone. The audio module 170 can parse out a voice signal based on the vibration signal of the vibrating bone block of the vocal part obtained by the bone conduction sensor 180M to realize a voice function. The application processor can parse the heart rate information based on the blood pressure beat signal obtained by the bone conduction sensor 180M to realize a heart rate detection function.

[0089] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.

[0090] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0091] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.

[0092] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the electronic device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.

[0093] The software system of the electronic device 100 may 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 takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device 100.

[0094] Figure 2 1 is a software structure diagram of the electronic device 100 of the embodiment of the present application. The layered architecture divides the software into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, namely, the application layer, the application framework layer, the system library of the Android runtime (Android runtime), and the kernel layer. The application layer can include a series of application packages.

[0095] like Figure 2 As shown, the application package may include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications.

[0096] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0097] like Figure 2 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.

[0098] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0099] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0100] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.

[0101] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including connecting, hanging up, etc.).

[0102] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0103] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.

[0104] Android runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.

[0105] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.

[0106] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0107] The system library may include multiple functional modules, such as surface manager, media libraries, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0108] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.

[0109] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0110] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0111] A 2D graphics engine is a drawing engine for 2D drawings.

[0112] The kernel layer is the layer between hardware and software. The kernel layer can include driver modules such as display driver, camera driver, audio driver and sensor driver.

[0113] The power management module 141 can be used to detect the current, voltage, power, etc. of the battery 142. The capacity of the battery is used to indicate the amount of charge that the battery can hold or release. The coulomb counting method estimates the power usage of the energy storage device by measuring the current of the energy storage device. When the battery outputs a constant current, the capacity of the battery can be expressed as the product of the constant current and the discharge time. Therefore, the detection of the battery power depends on the detection of the battery current.

[0114] In order to detect the voltage of the battery 142 , the two ends of the battery can be connected to the two ends of the resistor to be measured respectively. The voltage across the resistor to be measured is the voltage across the battery 142 .

[0115] In order to detect the current of the battery 142, the battery 142 can be connected in series with the resistor to be measured. During the discharge process of the battery 142, the current output by the battery 142 is equal to the current flowing through the resistor to be measured. The power management module 141 detects the voltage across the resistor to be measured and can determine the output current of the battery 142. Figure 3 , the detection device in the power management module 141 is explained by taking current detection as an example.

[0116] like Figure 3As shown, the detection device may include a programmable gain amplifier (PGA) 301 , an analog to digital converter (ADC) 302 , and a register 303 .

[0117] The PGA 301 is used to process the input voltage signals of the two input terminals to obtain a difference voltage signal.

[0118] The two input terminals are connected to the two ends of the resistor to be measured. Therefore, the voltage difference between the two input terminals is the voltage value across the resistor to be measured.

[0119] Both the input voltage signal and the difference voltage signal are analog signals. Ideally, the voltage value represented by the difference voltage signal is The voltage value of the input voltage signal at the two input terminals , Has the following relationship:

[0120]

[0121] in, and are the voltage values ​​of the two reference voltage signals input to the PGA 301 respectively.

[0122] ADC 302 is used to convert the differential voltage signal output by PGA 301 into a differential digital signal represented by a digital signal, and store the differential digital signal in register 303. Due to errors in the processing of input data by PGA 301 and ADC 302, the voltage value indicated by the differential digital signal The ideal voltage value of the difference voltage signal The processor 304 can be used to eliminate this difference.

[0123] The processor 304 can be used to read the difference digital signal from the register 303 and determine the detection result according to the difference digital signal. The detection result can be the voltage across the resistor to be measured, the current flowing through the resistor to be measured, etc.

[0124] The detection device may include the processor 304, or the processor 304 may not be part of the detection device. For example, the processor 304 may be Figure 1 That is, the power management module 141 can independently detect the current, voltage, and power of the battery 142, or it can cooperate with the processor 110 to jointly detect the current, voltage, and power of the battery 142.

[0125] When the detection device is used to detect the amount of electricity, the detection device may also be called an electricity meter.

[0126] The processor 304 can use the digital interface to read the difference digital signal from the register 303. The processor 304 The determined detection result can be expressed as a difference digital signal Subtract the offset parameter The difference and coefficient of The product of .

[0127] When the test result indicates the voltage across the resistor to be tested, the coefficient The voltage values ​​of the two reference voltage signals input to PGA 301 can be and and the gain error of ADC 302. With voltage value and The gain error of ADC 302 represents the difference between the estimated transfer function slope of ADC 302 and the actual slope.

[0128] When the test result represents the current flowing through the two ends of the resistor to be tested, the coefficient The voltage values ​​of the two reference voltage signals input to PGA 301 can be and , the resistance of the resistor to be measured and the gain error of ADC 302. Inversely proportional to the resistance of the resistor to be measured and inversely proportional to the voltage value and is proportional to the difference between and is proportional to the gain error.

[0129] Offset Parameters It can be expressed as the sum of the board offset parameter and the ADC offset parameter. The board offset parameter is used to indicate the offset error caused by the printed circuit board (PCB) where the PGA 301 and the ADC 302 are located, that is, the offset error caused by the components or structures on the PCB except the ADC 302. The ADC offset parameter is used to indicate the offset error caused by the ADC 302.

[0130] To determine the offset parameters , the two input terminals of PGA 301 can be short-circuited so that the actual voltage between the two input terminals is 0. According to the difference between the voltage indicated by the difference voltage signal output by ADC 302 and 0, the offset parameter .

[0131] In determining the offset parameters Then, connect the two input terminals of PGA 301 to the resistor to be measured, and determine the coefficient according to the voltage value actually applied across the resistor to be measured (or the current value actually flowing through the resistor to be measured). .

[0132] For example, the voltage value of the input voltage signal , The effective range of the power management module 141 can be -60 millivolts (mV) to 60 mV. The voltage difference between the two reference voltage signals input to the PGA 301 The difference digital signal output by ADC 302 can be expressed as . Then, under the effective range of the power management module 141, the range of the differential digital signal output by ADC 302 can be -32768 to 32767. Among them, -32768 can be understood as the negative full-scale differential conversion result of ADC 302, and can also be expressed as 8000H or 0x8000; 32767 can be understood as the positive full-scale differential conversion result of ADC 302 and can also be expressed as 7FFFH or 0x7FFF. "H" and "0x" both represent hexadecimal. Table 1 shows the binary values ​​corresponding to some differential digital signals.

[0133] Table 1

[0134] Difference digital signal 8000H C000H FFFFH 0000H 0001H 4000H 7FFF Decimal value -32768 -16384 -1 0 1 16384 32767

[0135] The board offset parameter can be expressed as a hexadecimal board offset error code, which can also be called a board current offset register (BOR) code. The ADC offset parameter is expressed as a hexadecimal ADC offset error code, which can also be called a current offset register (COR) code.

[0136] The conversion period of ADC 302 may be, for example, 250 milliseconds (ms), 125 ms, 31.5 ms, 15.63 ms, 7.81 ms, 1.95 ms, etc., or other values. In each conversion period, ADC 302 may perform an analog-to-digital conversion to convert the differential voltage signal into a differential digital signal.

[0137] When the difference digital signal output by the ADC 302 is used to calculate the current, the ADC 302 may also be referred to as a current ADC (current analog to digital converter, CADC).

[0138] The processor 304 can control the conversion cycle of the ADC 302. The processor 304 can send a CADC enable start (CADCENGO) signal to the ADC 302 to control the ADC 302 to start analog-to-digital conversion. While or after the ADC 302 stores the difference digital signal in the register 303, it can send a CADC interrupt flag (CADCIF) signal to the processor 304 to notify the processor 304 that the conversion of the ADC 302 is finished.

[0139] After completing a digital-to-analog conversion, if the CADCENGO signal is not cleared, the ADC 302 can perform analog-to-digital conversion again. That is, the processor 304 stops sending the CADCENGO signal, that is, clears the CADCENGO signal, and controls the ADC 302 to stop performing digital-to-analog conversion.

[0140] Offset Parameters With coefficient Thus, the processor 304 can use the preset offset parameter and coefficient The difference digital signal is calculated to obtain the detection result.

[0141] The board offset parameter is the inherent bias error of the PCB and can be understood as a fixed value that remains unchanged during the conversion process of the ADC 302. However, the ADC offset parameter changes with temperature, making the offset parameter The processor 304 uses the preset offset parameter The voltage or current is calculated using the sum coefficient, which results in low accuracy of the calculation result.

[0142] In order to solve the above problems, an embodiment of the present application provides a parameter adjustment method and an electronic device.

[0143] Combine the following Figures 4 to 8 The parameter adjustment method provided in the embodiment of the present application is described in detail.

[0144] Figure 4 It is a schematic flow chart of the parameter adjustment method provided in the embodiment of the present application.

[0145] Figure 4 The parameter adjustment method shown includes steps S410 to S430, and these steps are described in detail below.

[0146] Step S410, obtaining the current temperature of the detection device.

[0147] Temperature detection can be performed using a temperature sensor.

[0148] The detection device includes a voltage detection unit, a processing unit and two input terminals, wherein the voltage detection unit is used to detect the voltage between the two input terminals to obtain a first detection voltage when the two input terminals are respectively connected to the two ends of the resistor to be measured, and the processing unit is used to correct the first detection voltage using an offset parameter to determine a detection result of an electrical signal on the resistor to be measured. The detection result can represent the voltage across the two ends of the resistor to be measured, the current flowing through the resistor to be measured, the power consumption of the resistor to be measured, etc.

[0149] The offset parameter is determined according to the difference between the voltage value detected by the voltage detection unit and the actual voltage value when the two input terminals are short-circuited.

[0150] The first detection voltage can be expressed as , the offset parameter can be expressed as .

[0151] In some embodiments, the first detection voltage may be the output of the voltage detection unit, and the detection result may be expressed as the first detection voltage With offset parameters The sum and coefficient The product of When the two input terminals are short-circuited, the voltage value detected by the voltage detection unit is the first detection voltage. The difference between the actual voltage value and the offset parameter With coefficient The product of .

[0152] In some other embodiments, the first detection voltage It can be the output of the voltage detection unit and the coefficient The detection result can be expressed as the first detection voltage With offset parameters The sum of When the two input terminals are short-circuited, the output of the voltage detection unit is proportional to the coefficient The product of the first detection voltage The difference between the actual voltage value and the offset parameter .

[0153] In the case where the test result indicates a voltage, the coefficient It is proportional to the gain error of the voltage detection unit, which represents the difference between the estimated transfer function slope and the actual slope of the voltage detection unit.

[0154] In the case where the test result indicates current, the coefficient It is proportional to the gain error of the voltage detection unit and inversely proportional to the resistance value of the resistor to be measured.

[0155] The voltage detection unit and the resistance to be measured are pre-set in the electronic device, and the coefficient It can also be preset.

[0156] The voltage detection unit may include an ADC. The ADC is used to perform analog-to-digital conversion to obtain the first detection voltage and the second detection voltage. That is, the first detection voltage and the second detection voltage are digital signals.

[0157] ADC can be used to convert the voltage signal between two input terminals into a digital signal. The voltage signal between two input terminals is an analog signal.

[0158] The voltage detection unit may further include a PGA. The PGA is used to amplify the signal. The PGA can be used to amplify the voltage signal between the two input terminals, so that the ADC can convert the amplified voltage signal to obtain a digital signal.

[0159] The PGA amplifies the voltage signal between the two input terminals, so that the voltage range of the amplified voltage signal is more consistent with the effective conversion range of the ADC, thereby making the digital signal more accurate. Inversely proportional to the amplification factor of the PGA.

[0160] The specific structure of the detection device can be found in Figure 6 Description.

[0161] The temperature sensor can be used to detect the temperature of the voltage detection unit and other units in the detection device, and use the detection result as the temperature of the detection device. Alternatively, the temperature sensor can also detect the temperature of other units in the electronic device where the device is located, and determine the temperature of the detection device based on the correlation between the temperature of the unit and the temperature of the detection device.

[0162] The temperature sensor can detect the temperature periodically or non-periodically.

[0163] The change of the offset parameter with temperature is mainly caused by the analog-to-digital converter in the voltage detection unit. Using a temperature sensor to detect the temperature of the analog-to-digital converter to determine whether to update the offset parameter makes the update of the offset parameter more reasonable and the detection result determined by the offset parameter more accurate.

[0164] In some embodiments, in the detection device, the voltage detection unit and the processing unit may be integrated into the same chip or packaged into a hardware unit. For the convenience of temperature detection, the detection device may be detected.

[0165] The process of redetermining and updating the offset parameters may also be understood as the process of adjusting the offset parameters.

[0166] Step S420, when the difference between the temperature corresponding to the predetermined offset parameter and the current temperature exceeds the target difference threshold, obtain a second detection voltage, wherein the second detection voltage is obtained by the voltage detection unit detecting the voltage between the two input terminals when the two input terminals are short-circuited.

[0167] The voltage detection unit may detect the first detection voltage periodically or non-periodically.

[0168] When the voltage detection unit detects the first detection voltage according to the first detection cycle, the voltage detection unit detects a non-detection time period other than the first detection voltage in the first detection cycle, the two input terminals can be controlled to be short-circuited, and the voltage detection unit is used to perform detection to obtain a second detection voltage.

[0169] In the non-detection time period other than when the voltage detection unit detects the first detection voltage, the voltage detection unit is used to detect to obtain the second detection voltage, thereby avoiding the influence of the adjustment of the bias parameter on the detection of the first detection voltage, so that the detection of the first detection voltage is performed normally. The adjustment of the bias parameter does not affect the normal detection of the detection result by the detection device, and the detection function of the detection device on the detection result is not affected.

[0170] In addition, the adjustment of the bias parameter is completed within a first detection cycle, thereby improving the timeliness of updating the bias parameter. Thus, the detection device can determine the detection result according to the bias parameter updated in time, thereby improving the accuracy of the detection result.

[0171] To obtain the second detection voltage, a voltage detection unit is used for detection, and the voltage detection unit may be controlled to perform at least one detection to obtain at least one third detection voltage. The second detection voltage may be determined based on the at least one third detection voltage.

[0172] In the case where the number of the third detection voltage is one, the third detection voltage may serve as the second detection voltage.

[0173] In the case where the number of the third detection voltages is plural, the second detection voltage may be a representative value of the plurality of third detection voltages.

[0174] The representative value of the plurality of third detection voltages may also be understood as a data concentration trend of the plurality of third detection voltages, and may be an average value, a median, etc. of the plurality of third detection voltages.

[0175] By using representative values ​​of the plurality of third detection voltages as the second detection voltage, an error of the second detection voltage can be reduced and the accuracy of the offset parameter determined according to the second detection voltage can be improved.

[0176] The plurality of third detection voltages may be obtained by periodically detecting the voltage detection unit according to the second detection cycle. The number of the third detection voltages affects the accuracy of the offset parameter. In order to increase the number of the plurality of third detection voltages and improve the accuracy of the offset parameter, the number of the plurality of third detection voltages may be the maximum number of cycles that satisfies the cycle condition, wherein the cycle condition is that the duration of the non-detection time period is greater than or equal to the product of the length of the second detection cycle of the third detection voltage and the number of cycles.

[0177] That is, the quantity of the third detection voltage can be obtained by rounding down the quotient of the length of the non-detection time period divided by the length of the second detection period. Rounding down means taking an integer less than the calculation result when the calculation result is not an integer, and taking an integer when the calculation result is an integer.

[0178] The number of the plurality of third detection voltages is maximized, and the accuracy of the updated offset parameter is improved, thereby improving the accuracy of the detection result determined by the detection device according to the updated offset parameter after the offset parameter is updated.

[0179] In order to increase the number of the third detection voltages and improve the accuracy of the offset parameter, the minimum detection period of the voltage detection unit can be used as the second detection period of the third detection voltage.

[0180] Step S430, updating the offset parameter according to the second detection voltage, and using the current temperature as the temperature corresponding to the updated offset parameter; the offset parameter is used by the processing unit in the detection device to correct the first detection voltage to obtain a detection result of the electrical signal on the resistor to be measured, and the first detection voltage is obtained by the voltage detection unit detecting the voltage between the two input terminals when the two input terminals are respectively connected to the two ends of the resistor to be measured.

[0181] Updating the offset parameter according to the second detection temperature can be understood as determining a new offset parameter according to the second detection temperature, and setting the preset offset parameter as the new offset parameter, thereby updating the preset offset parameter.

[0182] The offset parameter can be understood as the offset error caused by the voltage detection unit.

[0183] In the case where the voltage detection unit includes an ADC, the offset parameter may be the sum of a board offset parameter and an ADC offset parameter. The board offset parameter is used to indicate an offset error caused by a printed circuit board where the voltage detection unit is located, and the ADC offset parameter may be indicated as an offset error caused by an ADC in the voltage detection unit. The board offset parameter is an inherent bias error of the PCB, and may be understood as a fixed value that does not fluctuate with temperature changes. Therefore, the update of the offset parameter may also be the update of the ADC offset parameter.

[0184] In the case where the offset parameter is determined based on the voltage between the two input terminals when the two input terminals are short-circuited, the temperature corresponding to the offset parameter may be the temperature when the offset parameter is determined.

[0185] That is, the temperature corresponding to the predetermined offset parameter used in S410 can be understood as the temperature when the offset parameter adjustment was last started. The difference between the temperature corresponding to the offset parameter and the current temperature can be understood as the temperature change after the last offset parameter adjustment.

[0186] The predetermined offset parameter may also be an initial value or a default value preset manually or the like. In the case where the offset parameter is a preset initial value or a default value, the temperature corresponding to the offset parameter may also be preset. Exemplarily, after the electronic device in which the detection device is located is powered on, the processing unit in the detection device may use the predetermined offset parameter to correct the first detection voltage detected by the voltage detection unit to obtain a detection result.

[0187] The detection device may be located in the electronic device, and before performing S410, the current state of the electronic device may be acquired.

[0188] Multiple states of the electronic device correspond to multiple difference thresholds, and the electronic device has different requirements on power consumption in different states. The target difference threshold may be a difference threshold corresponding to the current state among the multiple states.

[0189] In the process of adjusting the offset parameters, the voltage detection unit is required to perform voltage detection in a non-detection time period other than the first detection voltage detection. The number of detections performed by the voltage detection unit increases, and the power consumption increases. In addition, the size of the target difference threshold affects the frequency of adjustment of the offset parameters. The smaller the target difference threshold, the more frequent the adjustment of the offset parameters, and the greater the increase in power consumption. According to the power consumption needs of the electronic device in multiple states, different difference thresholds are set for each state, and the difference threshold corresponding to the current state of the electronic device is used as the target threshold, balancing the contradiction between the increase in power consumption caused by the adjustment of the offset parameters and the actual power consumption needs of the electronic device, so that the adjustment of the offset parameters can better meet the power consumption needs of the electronic device.

[0190] The electronic device may include an energy storage device. The multiple states may include a charging state and a discharging state, and the difference threshold corresponding to the charging state may be smaller than the difference threshold corresponding to the discharging state.

[0191] In the charging state, the external power supply supplies power to the electronic device, and the electronic device has a lower requirement for power consumption, so a smaller difference threshold can be set. In the charging state, the external power supply can also charge the energy storage device. The charging state can also be understood as the state of power supply by the external power supply.

[0192] In the discharge state, the energy storage device supplies power to the electronic devices, which have higher requirements on power consumption, so a larger difference threshold can be set. This can achieve timely adjustment of the offset parameters and better meet the higher requirements of the electronic devices on power consumption in the discharge state.

[0193] The discharge state may also include a power-saving state and a non-power-saving state. The difference threshold corresponding to the charging state is smaller than the difference threshold of the discharge state, which can be understood as the difference threshold corresponding to the charging state is smaller than the difference threshold corresponding to each state included in the discharge state, that is, the difference threshold corresponding to the charging state is smaller than the difference threshold corresponding to the power-saving state, and smaller than the difference threshold corresponding to the non-power-saving state.

[0194] The power saving state can also be called the low power consumption state. In the power saving state, the electronic device can reduce power consumption by reducing the brightness of the display, limiting the operation of some applications, disabling certain functions, turning off software background refresh, limiting the operating frequency and performance of the processor, etc.

[0195] Compared with the non-power saving state, the electronic device has higher requirements on power consumption in the power saving state, so the difference threshold corresponding to the power saving state can be greater than the difference threshold corresponding to the non-power saving state.

[0196] For example, when the power of the energy storage device is lower than a preset power, the electronic device may enter a power saving state. Alternatively, the electronic device may obtain a power saving instruction operation from a user and enter a power saving state.

[0197] The electronic device is in standby mode, which can be understood as a state where the electronic device is turned on but does not perform any substantial work, that is, the electronic device in standby mode does not perform various operations on files and programs. In the standby mode, the energy storage device may no longer supply power to components such as the display.

[0198] When the energy storage device is powering the electronic device and the electronic device is in standby mode, the power consumption of the electronic device is very low, the output current of the energy storage device is small, and the temperature of the electronic device is relatively stable. The temperature of the voltage detection unit is less affected by the temperature of other components, the temperature of the voltage detection unit is also relatively stable, and the fluctuation of the bias parameter is small.

[0199] It should be understood that when the electronic device is in standby mode, the offset parameter used by the processing unit in the detection device in determining the detection result may be the offset parameter last updated before the electronic device was in standby mode, or the initial value or default value of the offset parameter. Alternatively, within a preset time after the start of standby mode, the processing unit in the detection device may determine the detection result using the offset parameter last updated before the start of standby mode; after the preset time after the start of standby mode, the processing unit in the detection device may determine the detection result using the initial value or default value as the offset parameter.

[0200] Therefore, when the energy storage device is powering the electronic device and the electronic device is in a standby state, S420 and S430 may no longer be performed. In other words, when an external power supply is powering the electronic device, or when the energy storage device is powering the electronic device and the electronic device is in a non-standby state, S420 and S430 may be performed.

[0201] That is to say, when an external power supply is powering the electronic device, or when the energy storage device is powering the electronic device and the electronic device is in a non-standby state, the target difference threshold corresponding to the current state of the electronic device can be determined based on the correspondence between multiple states and multiple difference thresholds.

[0202] The non-standby state can be understood as a state in which the electronic device operates files and / or programs.

[0203] In the case where S420 is not performed, S410 may not be performed, that is, the temperature sensor may not detect the temperature any more, thereby further reducing the power consumption of the electronic device.

[0204] Similar to the case where the electronic device is in standby mode, when the energy storage device powers the electronic device and the electronic device is in the off state, the power consumption of the electronic device is very low, the output current of the energy storage device is small, and the fluctuation of the bias parameters due to temperature is small.

[0205] When the electronic device is powered off, S420 may not be performed. Further, when the electronic device is powered off, the electronic device state may not be detected, and thus S420 may not be performed.

[0206] It should be understood that when the electronic device is in a powered-off state, the voltage detection unit may or may not detect the first detection voltage.

[0207] Exemplarily, the electronic device may include a resistor to be measured, and the resistor to be measured may be connected to a component in the electronic device, so that the detection result may represent the usage of the component.

[0208] For example, the resistor to be tested can be connected to the energy storage device. By detecting the current flowing through the resistor to be tested, the voltage across the resistor to be tested and other information, the use of the energy storage device can be determined, and the capacity, number of cycles, health status and other parameters of the energy storage device can be monitored.

[0209] The parameter adjustment method provided in the embodiment of the present application adjusts the offset parameter according to the second detection voltage detected by the voltage detection unit when the two input terminals are short-circuited, when the difference between the current temperature of the detection device and the temperature corresponding to the offset parameter is greater than or equal to the target difference threshold. The offset parameter fluctuates due to the influence of temperature changes. When the difference between the current temperature and the temperature corresponding to the offset parameter is greater than or equal to the target difference threshold, the offset parameter is adjusted so that the update of the offset parameter is more timely, so that the processing unit in the detection device determines the detection result according to the offset parameter updated in time, thereby improving the accuracy of the detection result.

[0210] When the two input terminals of the detection device are respectively connected to the two ends of the resistor to be tested, the voltage detection unit detects the voltage between the two input terminals to obtain a first detection voltage, which is used by the processing unit to subsequently determine the detection result. During the use of the detection device, when the difference between the current temperature and the temperature corresponding to the offset parameter is greater than or equal to the target difference threshold, the offset parameter is adjusted based on the second detection voltage obtained by detecting the voltage between the two input terminals when the two input terminals are short-circuited, so that the adjusted offset parameter is more accurate, thereby improving the accuracy of the detection result subsequently determined by the detection device based on the adjusted offset parameter.

[0211] Combine the following Figures 5 and 6 ,right Figure 4 An example of the parameter adjustment method is shown.

[0212] Figure 5 It is a schematic flow chart of a parameter adjustment method provided in an embodiment of the present application. Figure 5 The parameter adjustment method shown can be applied to Figure 6 In the detection device shown.

[0213] Figure 6 The detection device 630 shown is used to detect the resistor to be measured 620. The energy storage device 610 is connected to the resistor to be measured 620. The energy storage device 610, the energy storage device 610 and the detection device 630 may be located in an electronic device.

[0214] The energy storage device 610 may also be called a power storage device or a battery, which supplies power to electronic devices. The resistor to be tested 620 is connected to the energy storage device 610 , and the voltage across the resistor to be tested 620 can reflect the usage of the energy storage device 610 .

[0215] When the resistor to be measured 620 is connected in series with the energy storage device 610, the current flowing through the resistor to be measured 620 is equal to the current flowing through the energy storage device 610. If the resistance value of the resistor to be measured 620 remains unchanged, the voltage across the resistor to be measured 620 is proportional to the current flowing through the energy storage device 610. The voltage across the resistor to be measured 620 can reflect the current flowing through the energy storage device 610.

[0216] When the energy storage device 610 supplies power to the electronic device, the energy storage device 610 is connected in series with the resistor to be measured 620 , which can also be understood as the resistor to be measured 620 and the load of the energy storage device 610 are connected in series.

[0217] When the resistor to be tested 620 is connected in parallel with the energy storage device 610 , the voltage across the resistor to be tested 620 is equal to the voltage across the energy storage device 610 , and the voltage across the resistor to be tested 620 can reflect the voltage of the energy storage device 610 .

[0218] The detection device 630 includes a temperature detection unit 631 , a voltage detection unit 632 and a processing unit 633 .

[0219] The temperature detection unit 631 may be a temperature sensor for performing temperature detection. For example, the temperature detection unit may detect the temperature of the energy storage device 610, the temperature of the processing unit 633, the temperature of the voltage detection unit 632 or the temperature of other units in the electronic device.

[0220] The voltage detection unit 632 is used to detect the voltage across the resistor 620 to obtain a first detection voltage.

[0221] The processing unit 633 is used to determine a detection result according to the sum of the offset parameter and the first detection voltage.

[0222] The detection result may indicate the current flowing through the resistor to be tested 620 and / or the voltage across the resistor to be tested.

[0223] The voltage detection unit 632 may include an ADC for converting the voltage across the resistor 620 to be tested represented by an analog signal into a first detection voltage represented by a digital signal. The voltage detection unit 632 may also include a PGA for amplifying the analog signal so that the ADC can convert the amplified signal to improve the accuracy and precision of the first detection voltage.

[0224] The temperature change of the ADC in the voltage detection unit 632 has a more direct impact on the offset parameter. The temperature detection unit 631 can detect the temperature of the ADC in the voltage detection unit 632, so that the judgment result of whether to adjust the offset parameter is more reasonable and the detection result determined by the offset parameter is more accurate.

[0225] The volume of each component in the detection device 630 is relatively small. The ADC and PGA in the voltage detection unit 632 can be set in one hardware unit, or the voltage detection unit 632 and the processing unit 633 can also be set in one hardware unit. The various components in the hardware unit can be integrated on one chip, or the hardware unit can be obtained by packaging the various components in the hardware unit together. The temperature detection unit 631 can also detect the overall temperature of each component in the detection device 630 except the temperature detection unit 631, for example, detect the temperature of the hardware unit where the voltage detection unit 632 is located, so as to make the temperature detection easier.

[0226] The voltage detection unit 632 may detect the first detection voltage periodically. By reasonably setting the detection period of the first detection voltage, the detection device 630 may obtain detection results periodically to realize timely detection of the current, voltage and power of the energy storage device 610.

[0227] The voltage detection unit 632 includes two input terminals, which can also be understood as two sampling points, for example, which can be respectively recorded as SRN and SRP.

[0228] When the two input terminals are connected to the two ends of the resistor 620, the voltage detection unit 632 can detect the voltage across the resistor 620 to obtain a first detection voltage. When the two input terminals are short-circuited, the voltage detection unit 632 can detect a third detection voltage.

[0229] When the two input terminals are short-circuited, the actual voltage between the two input terminals is 0. The third detection voltage can reflect the offset of the detection result of the voltage detection unit 632. Therefore, the processing unit 633 determines the offset parameter according to the third detection voltage. After the offset parameter is adjusted, the processing unit 633 can determine the detection result according to the sum of the first detection voltage and the adjusted offset parameter for obtaining the first detection voltage output by the voltage detection unit 632, so that the detection result has higher precision and accuracy.

[0230] The processing unit 633 can execute Figure 5 The method shown is used to adjust the offset parameter. The processing unit 633 may be an independent device or may be integrated in one or more processors.

[0231] Figure 5 The parameter adjustment method shown may include steps S501 to S511 , which are described in detail below.

[0232] Step S501, determining the state of the electronic device.

[0233] The state of the electronic device may be a first state, a second state, or a third state.

[0234] In the first state, the energy storage device 610 supplies power to the electronic device, and the electronic device is in standby mode; in the second state, the external power supply supplies power to the electronic device; in the third state, the energy storage device 610 supplies power to the electronic device, and the electronic device is in a non-standby mode.

[0235] The electronic device is in standby mode, which can be understood as the electronic device is turned on but does not perform any substantial work, that is, the electronic device in standby mode does not perform various operations on files and programs. The electronic device is powered by the energy storage device 610, which can also be called a non-charging state or a discharging state.

[0236] When the electronic device is in the first state, the subsequent steps are not performed and S501 can be returned to be executed. For example, the processing unit 633 can periodically execute S501. Returning to execute S501 can be understood as the processing of the current execution cycle of S501 is completed, and S501 is executed again after the next execution cycle of S501 starts.

[0237] In the case of the first state of the electronic device, the electronic device is in standby mode, power consumption is low, the current output by the energy storage device 610 is small, and the temperature of the electronic device is relatively stable. The temperature of the voltage detection unit 632 is less affected by the temperature of other components, the temperature of the voltage detection unit 632 is also relatively stable, and the fluctuation of the bias parameter due to the temperature is small. Therefore, for electronic devices in a low-power operation state, even if the bias parameter is not adjusted, the detection result determined by the detection device 630 based on the bias parameter still has a high accuracy.

[0238] When the electronic device is in standby mode, the offset parameter used by the processing unit 633 in determining the detection result may be the offset parameter last updated before the electronic device is in standby mode, or the initial value or default value of the offset parameter. Alternatively, within a preset time after the start of standby mode, the processing unit 633 may determine the detection result using the offset parameter last updated before the start of standby mode; after the preset time after the start of standby mode, the processing unit 633 may determine the detection result using the initial value or default value as the offset parameter.

[0239] In the process of adjusting the bias parameters, the voltage detection unit 632 is required to detect the third detection voltage, which consumes relatively high power. When the electronic device is in different states, different power consumption requirements are required. By respectively setting different start-up conditions for adjusting the bias parameters of the electronic device in different states, the accuracy of the detection result can be improved while meeting the power consumption requirements of the electronic device.

[0240] When the electronic device is in the first state, the electronic device has very high requirements on power consumption, and the bias parameters may no longer be adjusted, thereby reducing power consumption.

[0241] When the electronic device is in the second state, S502 may be performed.

[0242] The electronic device is in the second state, that is, the external power supply supplies power to the electronic device. The external power supply can also charge the energy storage device 610. The second state can also be called a charging state.

[0243] Step S502: setting the temperature difference threshold T to a first preset difference T1.

[0244] When the electronic device is in the second state, the electronic device has a lower requirement for power consumption, and a smaller first preset difference T1 can be set as the temperature difference threshold T. This makes the adjustment of the offset parameter more timely, and improves the accuracy of the detection result determined by the detection device 630.

[0245] When the electronic device is in the third state, S503 may be performed.

[0246] Step S503, setting the temperature difference threshold T to a second preset difference T2.

[0247] The first preset difference T1 is smaller than the second preset difference T2. For example, T1 may be 5°C, and T2 may be 10°C.

[0248] When the electronic device is in the third state, the energy storage device 610 supplies power to the electronic device, and the electronic device is not in standby mode. The energy storage device 610 supplies power to the electronic device, and the electronic device has high requirements for power consumption. However, when the electronic device is not in standby mode, the temperature may change greatly during the process of the electronic device processing a file or program, and the offset parameter may fluctuate.

[0249] In order to balance the contradiction between the power consumption requirement of the electronic device and the accuracy of the detection result, when the electronic device is in the third state, the larger second preset difference T2 can be set as the temperature difference threshold T. Taking into account the power consumption requirement of the electronic device and the timeliness of the adjustment of the offset parameter, the adjustment of the offset parameter has better timeliness when the power consumption requirement of the electronic device is met, thereby improving the accuracy of the detection result.

[0250] After S502 or S503 , S504 may be performed.

[0251] Step S504, determining whether the difference between the current temperature and the preset temperature is greater than or equal to a temperature difference threshold T.

[0252] The difference between the current temperature and the preset temperature may be expressed as an absolute value of the difference between the current temperature and the preset temperature.

[0253] If the judgment result is no, the process returns to S501. If the judgment result is yes, the process proceeds to S505.

[0254] Step S505, determining whether the calibration flag is 1.

[0255] The calibration flag is used to indicate whether steps from S507 to S511 are in progress. When the calibration flag is 1, the calibration flag is 1 indicating that steps from S507 to S511 are in progress, and the execution of steps from S507 to S511 continues. When the calibration flag is not 1, S506 to S511 are performed.

[0256] Step S506, setting the calibration flag to 1.

[0257] Step S507 , in the detection cycle of the first detection voltage, in the non-detection time period other than when the voltage detection unit 632 detects the first detection voltage, the two input terminals of the voltage detection unit 632 are controlled to be short-circuited.

[0258] Step S508 , controlling the voltage detection unit 632 to perform n samplings when the two input terminals are short-circuited, so as to obtain n third detection voltages.

[0259] In the detection cycle of the first detection voltage, the voltage detection unit 632 performs a non-detection time period other than the detection of the first detection voltage, and uses the control voltage detection unit to detect the third detection voltage when the two input terminals are short-circuited, thereby avoiding the adjustment of the bias parameters from affecting the periodicity of the detection results obtained by the detection device.

[0260] The detection of the third detection voltage may also be performed periodically.

[0261] The product of the second detection period of the third detection voltage and the sampling number n may be less than or equal to the duration of the non-detection time period, where n is a positive integer.

[0262] Step S509 , determining a second detection voltage, where the second detection voltage is a representative value of the n third detection voltages.

[0263] Step S510: updating the bias parameter according to the second detected temperature.

[0264] The second detection voltage is determined according to the plurality of third detection voltages, and thus the bias parameter is determined according to the second detection temperature, which can reduce the influence of errors and make the bias parameter more accurate.

[0265] In order to improve the accuracy of the bias parameter, the number of third detection voltages needs to be increased. Therefore, when the product of the second detection period of the third detection voltage and the sampling number n can be less than or equal to the duration of the non-detection period, n can take the maximum value.

[0266] In order to make the value of n as large as possible, the second detection period of the third detection voltage may be the minimum detection period of the voltage detection unit 632. That is, during the process of detecting the third detection voltage, the voltage detection unit 632 may perform detection at the highest frequency.

[0267] The conversion period of the ADC can be used as the voltage detection period or sampling period of the voltage detection unit 632. The minimum detection period of the voltage detection unit 632 can be understood as the minimum conversion period of the ADC in the voltage detection unit 632.

[0268] Step S511, setting the calibration flag to 0 and setting the current temperature to a preset temperature.

[0269] The reset preset temperature is used in the next process of S501 to S510. That is, the preset temperature in step S504 may be the trigger temperature of the last parameter adjustment.

[0270] S511 may be performed after S509 or S510. Alternatively, S511 may be performed during the process of performing S509 and / or S510.

[0271] When the quasi-flag is 0, the voltage detection unit 632 can detect the first detection voltage. During S509 and / or S510, S511 is performed, and the voltage detection unit 632 can detect the first detection voltage in time to reduce the impact of the offset parameter adjustment process on the detection of the first detection voltage.

[0272] After S511, the processing unit 633 can control the two input terminals of the voltage detection unit 632 to be respectively connected to the two ends of the resistor to be measured 620, and control the voltage detection unit 632 to detect the first detection voltage according to the detection cycle of the first detection voltage when the two input terminals are respectively connected to the two ends of the resistor to be measured 620. That is, the detection frequency of the voltage detection unit 632 is restored to the detection frequency of the first detection voltage.

[0273] The detection of the first detection voltage and the detection of the third detection voltage by the voltage detection unit 632 can be understood as two different sampling modes. In the first sampling mode for the first detection voltage, the two input terminals are respectively connected to the two ends of the resistor to be measured, and the detection frequency of the voltage detection unit 632 is relatively low. In the second sampling mode for the third detection voltage, the two input terminals are short-circuited, and the detection frequency of the voltage detection unit 632 is relatively high. The voltage detection unit 632 can only operate in one sampling mode at the same time. In S508, the voltage detection unit 632 operates in the second sampling mode for the third detection voltage. After S511, the voltage detection unit 632 resumes operating in the first sampling mode for the first detection voltage.

[0274] Through S501 to S511, according to the current power consumption requirement of the electronic device, the temperature difference threshold is determined, and when the difference between the current temperature and the temperature when the parameter was last adjusted exceeds the temperature difference threshold, the offset parameter is adjusted. The offset parameter is dynamically updated, so that the detection result of the voltage detection unit 632 has a higher accuracy.

[0275] It should be understood that the above examples are intended to help those skilled in the art understand the embodiments of the present application, rather than to limit the embodiments of the present application to the specific numerical values ​​or specific scenarios illustrated. Those skilled in the art can obviously make various equivalent modifications or changes based on the above examples, and such modifications or changes also fall within the scope of the embodiments of the present application.

[0276] Combination of the above Figures 1 to 6 The parameter adjustment method of the embodiment of the present application is described in detail. Figure 7 and Figure 8 , describes the device embodiment of the present application in detail. It should be understood that the parameter adjustment device in the embodiment of the present application can execute the various parameter adjustment methods in the aforementioned embodiment of the present application, that is, the specific working process of the following various products can refer to the corresponding process in the aforementioned method embodiment.

[0277] Figure 7 It is a schematic diagram of a parameter adjustment device provided in an embodiment of the present application.

[0278] It should be understood that the parameter adjustment device 700 can perform Figure 4 and Figure 5 The parameter adjustment method shown in Figure 6 In the detection device 630 shown, the parameter adjustment device 700 can be arranged in the processing unit 633 or outside the processing unit 633.

[0279] The parameter adjustment device 700 includes: an acquisition unit 710 and an update unit 720 .

[0280] The acquisition unit 710 is used to acquire the current temperature of the detection device.

[0281] The acquisition unit 710 is also used to acquire a second detection voltage when the difference between the temperature corresponding to the predetermined offset parameter and the current temperature is greater than or equal to the target difference threshold. The second detection voltage is obtained by the voltage detection unit in the detection device detecting the voltage between the two input terminals when the two input terminals are short-circuited.

[0282] The updating unit 720 is used to update the offset parameter according to the second detection voltage, and use the current temperature as the temperature corresponding to the updated offset parameter; the offset parameter is used by the processing unit in the detection device to correct the first detection voltage to obtain a detection result of the electrical signal on the resistor to be measured, and the first detection voltage is obtained by the voltage detection unit detecting the voltage between the two input terminals when the two input terminals are respectively connected to the two ends of the resistor to be measured.

[0283] Optionally, the acquisition unit 710 is specifically used to, in a first detection cycle of the first detection voltage, the voltage detection unit detects a non-detection time period outside the first detection voltage, control the two input terminals to be short-circuited, and use the voltage detection unit to perform detection to obtain the second detection voltage.

[0284] Optionally, the acquisition unit 710 is specifically configured to control the voltage detection unit to perform multiple detections to obtain multiple third detection voltages, and the second detection voltage is a representative value of the multiple third detection voltages.

[0285] Optionally, the number of the plurality of third detection voltages is the maximum number of cycles that satisfies a cycle condition, wherein the cycle condition is that the duration of the non-detection time period is greater than or equal to the product of the length of the second detection cycle of the third detection voltage and the number of cycles.

[0286] Optionally, the detection device is located in an electronic device.

[0287] The acquisition unit 710 is also used to acquire the current state of the electronic device, wherein the multiple states of the electronic device correspond to multiple difference thresholds, the target difference threshold is the difference threshold corresponding to the current state among the multiple states, and the electronic device has different requirements for power consumption in different states.

[0288] Optionally, the multiple states include a charging state and a discharging state, in the charging state an external power supply supplies power to the electronic device, in the discharging state the energy storage device supplies power to the electronic device, and a difference threshold corresponding to the charging state is smaller than a difference threshold of the discharging state.

[0289] Optionally, the electronic device includes an energy storage device, and the resistor to be measured is connected to the energy storage device in the electronic device.

[0290] The acquisition unit 710 is specifically configured to acquire the second detection voltage when an external power source is powering the electronic device, or when the energy storage device is powering the electronic device and the electronic device is in a non-standby state.

[0291] It should be noted that the parameter adjustment device 700 is implemented in the form of a functional unit. The term "unit" here can be implemented in the form of software and / or hardware, and is not specifically limited to this.

[0292] For example, a "unit" may be a software program, a hardware circuit, or a combination of the two that implements the above functions. The hardware circuit may include an application specific integrated circuit (ASIC), an electronic circuit, a processor (such as a shared processor, a dedicated processor, or a group processor, etc.) and a memory for executing one or more software or firmware programs, a combined logic circuit, and / or other suitable components that support the described functions.

[0293] Therefore, the units of each example described in the embodiments of the present application can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software 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 be beyond the scope of the present application.

[0294] Figure 8 A structural schematic diagram of an electronic device provided by the present application is shown. Figure 8 The dotted line in indicates that the unit or the module is optional. The electronic device 800 can be used to implement the parameter adjustment method described in the above method embodiment.

[0295] The electronic device 800 includes one or more processors 801, which can support the electronic device 800 to implement the parameter adjustment method in the method embodiment. The processor 801 can be a general-purpose processor or a special-purpose processor. For example, the processor 801 can be a central processing unit (CPU), a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, such as discrete gates, transistor logic devices, or discrete hardware components.

[0296] The processor 801 may be used to control the electronic device 800, execute software programs, and process data of the software programs. The electronic device 800 may also include a communication unit 805 to implement input (reception) and output (transmission) of signals.

[0297] For example, the electronic device 800 may be a chip, the communication unit 805 may be an input and / or output circuit of the chip, or the communication unit 805 may be a communication interface of the chip, and the chip may be a component of a terminal device or other electronic devices.

[0298] For another example, the electronic device 800 may be a terminal device, and the communication unit 805 may be a transceiver of the terminal device, or the communication unit 805 may be a transceiver circuit of the terminal device.

[0299] The electronic device 800 may include one or more memories 802 on which a program 804 is stored. The program 804 can be executed by the processor 801 to generate instructions 803, so that the processor 801 executes the parameter adjustment method described in the above method embodiment according to the instructions 803.

[0300] Optionally, data may be stored in the memory 802. Optionally, the processor 801 may read data stored in the memory 802. The data may be stored at the same storage address as the program 804, or may be stored at a different storage address than the program 804.

[0301] The processor 801 and the memory 802 may be provided separately or integrated together; for example, integrated on a system on chip (SOC) of a terminal device.

[0302] Exemplarily, the detection device includes a voltage detection unit, a processing unit and two input terminals, the voltage detection unit is used to detect the voltage between the two input terminals when the two input terminals are respectively connected to the two ends of the resistor to be measured to obtain a first detection voltage, and the processing unit is used to determine the detection result according to the sum of the first detection voltage and the offset parameter, and the detection result indicates the current or voltage. The memory 802 can be used to store the relevant program 804 of the parameter adjustment method provided in the embodiment of the present application, and the processor 801 can be used to call the relevant program 804 of the parameter adjustment method stored in the memory 802 during the process of determining the detection result when the detection device is periodic or non-periodic, and execute the parameter adjustment method of the embodiment of the present application; for example, the current temperature of the detection device is obtained; when the difference between the temperature corresponding to the offset parameter and the current temperature is greater than or equal to the target difference threshold, a second detection voltage is obtained, and the second detection voltage is obtained by the voltage detection unit detecting the voltage between the two input terminals when the two input terminals are short-circuited; according to the second detection voltage, the offset parameter is updated, and the current temperature is used as the temperature corresponding to the updated offset parameter.

[0303] The present application also provides a computer program product, which, when executed by the processor 801, implements the parameter adjustment method described in any method embodiment of the present application.

[0304] The computer program product may be stored in the memory 802 , for example, a program 804 , which is finally converted into an executable target file that can be executed by the processor 801 after preprocessing, compiling, assembling, and linking.

[0305] The present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a computer, the parameter adjustment method described in any method embodiment of the present application is implemented. The computer program can be a high-level language program or an executable target program.

[0306] The computer-readable storage medium is, for example, a memory 802. The memory 802 may be a volatile memory or a nonvolatile memory, or the memory 802 may include both a volatile memory and a nonvolatile memory. Among them, the nonvolatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).

[0307] The present application also provides a detection device, including a voltage detection unit, a processing unit and a parameter adjustment device, wherein the parameter adjustment device is used to execute the parameter adjustment method described above.

[0308] Exemplarily, the parameter adjustment device may be Figure 7 The parameter adjustment device 700 shown in FIG. 1 may also be Figure 8 Electronic equipment for parameter adjustment is shown.

[0309] In the description of this application, the terms "first", "second", etc. are used only for descriptive purposes and should not be understood as indicating or implying relative importance, or a specific order or sequence. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood according to specific circumstances.

[0310] In this application, "at least one" means one or more, and "plurality" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.

[0311] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0312] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software 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 be beyond the scope of this application.

[0313] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0314] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic; for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation; for example, multiple units or components can be combined or integrated into another system, 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.

[0315] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0316] 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.

[0317] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A parameter adjustment method, characterized in that: Applied to electronic equipment, the electronic equipment includes an energy storage device, and the method includes: Acquiring a current temperature of a detection device in the electronic device and a current state of the electronic device; In a case where the difference between the temperature corresponding to the predetermined offset parameter and the current temperature is greater than or equal to the target difference threshold, a second detection voltage is obtained, where the second detection voltage is obtained by a voltage detection unit in the detection device detecting the voltage between the two input terminals when the two input terminals are short-circuited, and the target difference threshold is a difference threshold corresponding to the current state, where the current state is a charging state or a discharging state, where an external power supply supplies power to the electronic device in the charging state, where the energy storage device supplies power to the electronic device in the discharging state, and where the difference threshold corresponding to the charging state is less than the difference threshold of the discharging state; According to the second detection voltage, the offset parameter is updated, and the current temperature is used as the temperature corresponding to the updated offset parameter; the offset parameter is used by the processing unit in the detection device to correct the first detection voltage to obtain a detection result of the electrical signal on the resistor to be measured, and the first detection voltage is obtained by the voltage detection unit detecting the voltage between the two input terminals when the two input terminals are respectively connected to the two ends of the resistor to be measured.

2. The method according to claim 1, characterized in that The obtaining of the second detection voltage includes: in a first detection cycle of the first detection voltage, the voltage detection unit detects a non-detection time period outside the first detection voltage, controls the two input terminals to be short-circuited, and uses the voltage detection unit to perform detection to obtain the second detection voltage.

3. The method according to claim 2, characterized in that The using the voltage detection unit to perform detection to obtain the second detection voltage includes: The voltage detection unit is controlled to perform multiple detections to obtain multiple third detection voltages, and the second detection voltage is a representative value of the multiple third detection voltages.

4. The method according to claim 3, characterized in that The number of the plurality of third detection voltages is the maximum number of cycles that satisfies a cycle condition, wherein the cycle condition is that the duration of the non-detection time period is greater than or equal to the product of the length of the second detection cycle of the third detection voltage and the number of cycles.

5. The method according to any one of claims 1 to 4, characterized in that The detection device is located in an electronic device, and the electronic device includes an energy storage device; The obtaining of the second detection voltage comprises: When an external power source is powering the electronic device, or when the energy storage device is powering the electronic device and the electronic device is in a non-standby state, the second detection voltage is acquired.

6. An electronic device, characterized in that: The electronic device comprises a processor and a memory, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program from the memory, so that the electronic device executes the method according to any one of claims 1 to 5.

7. A chip, characterized in that: The method comprises a processor, and when the processor executes instructions, the processor performs the method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Automatic gain and offset compensation for an electronic circuit

    CN105048974A

  • Grounding resistance measurement device and measurementmethod

    CN110456164A

  • Automatic carbon monoxide sensor zero setting device and system

    CN202974941U