CN117388728B - Battery detection circuit, method and electronic equipment - Google Patents
Battery detection circuit, method and electronic equipment Download PDFInfo
- Publication number
- CN117388728B CN117388728B CN202311698450.8A CN202311698450A CN117388728B CN 117388728 B CN117388728 B CN 117388728B CN 202311698450 A CN202311698450 A CN 202311698450A CN 117388728 B CN117388728 B CN 117388728B
- Authority
- CN
- China
- Prior art keywords
- module
- battery
- voltage
- transistor
- input
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 154
- 238000000034 method Methods 0.000 title claims abstract description 33
- 238000012545 processing Methods 0.000 claims description 59
- 238000004891 communication Methods 0.000 claims description 13
- 238000005516 engineering process Methods 0.000 abstract description 4
- 238000007726 management method Methods 0.000 description 32
- 238000010586 diagram Methods 0.000 description 20
- 230000008569 process Effects 0.000 description 12
- 230000006870 function Effects 0.000 description 6
- 238000010295 mobile communication Methods 0.000 description 6
- 230000001960 triggered effect Effects 0.000 description 4
- 238000013500 data storage Methods 0.000 description 3
- 230000007246 mechanism Effects 0.000 description 3
- 230000005236 sound signal Effects 0.000 description 3
- 238000004590 computer program Methods 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 101000827703 Homo sapiens Polyphosphoinositide phosphatase Proteins 0.000 description 1
- 102100023591 Polyphosphoinositide phosphatase Human genes 0.000 description 1
- 238000013528 artificial neural network Methods 0.000 description 1
- 238000007664 blowing Methods 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000003862 health status Effects 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 229910044991 metal oxide Inorganic materials 0.000 description 1
- 150000004706 metal oxides Chemical class 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000005855 radiation Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01R—MEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
- G01R31/00—Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
- G01R31/36—Arrangements for testing, measuring or monitoring the electrical condition of accumulators or electric batteries, e.g. capacity or state of charge [SoC]
- G01R31/385—Arrangements for measuring battery or accumulator variables
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02E—REDUCTION OF GREENHOUSE GAS [GHG] EMISSIONS, RELATED TO ENERGY GENERATION, TRANSMISSION OR DISTRIBUTION
- Y02E60/00—Enabling technologies; Technologies with a potential or indirect contribution to GHG emissions mitigation
- Y02E60/10—Energy storage using batteries
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Secondary Cells (AREA)
- Charge And Discharge Circuits For Batteries Or The Like (AREA)
Abstract
本申请涉及电子技术领域,公开了一种电池检测电路、方法及电子设备。其中,电池检测电路包括:开关模块、分压模块和输入模块。其中,开关模块的第一端连接电池的熔断模块和标识模块;分压模块的两端分别连接电池的标识模块和输入模块。在控制开关模块处于断开状态,并且控制输入模块输出低电平的情况下,可以确定出电池的新旧。此外,在控制开关模块处于闭合状态,并且控制输入模块输出高电平的情况下,可以确定出电池型号和/或厂家。如此,基于上述电池检测电路,可以实现对电池新旧和厂家的识别,进而,可以根据不同的充电策略和充电参数对电池充电。
The present application relates to the field of electronic technology, and discloses a battery detection circuit, method and electronic device. The battery detection circuit includes: a switch module, a voltage divider module and an input module. The first end of the switch module is connected to the fuse module and the identification module of the battery; the two ends of the voltage divider module are respectively connected to the identification module and the input module of the battery. When the control switch module is in an open state and the control input module outputs a low level, the newness of the battery can be determined. In addition, when the control switch module is in a closed state and the control input module outputs a high level, the battery model and/or manufacturer can be determined. In this way, based on the above-mentioned battery detection circuit, the identification of the newness and manufacturer of the battery can be realized, and then, the battery can be charged according to different charging strategies and charging parameters.
Description
技术领域Technical Field
本申请涉及电子技术领域,特别涉及一种电池检测电路、方法及电子设备。The present application relates to the field of electronic technology, and in particular to a battery detection circuit, method and electronic equipment.
背景技术Background technique
当前,一些电池中内嵌电池管理芯片,电池管理芯片中具有唯一标识电池的防伪集成电路(integrated circuit,IC),在需要对电池进行充电时,手机等电子设备可以读取电池管理芯片中的防伪IC,通过防伪IC区分不同的电池厂家,并选择对应电池厂家的充电参数(如,最佳电流范围等)进行充电。Currently, some batteries have built-in battery management chips. The battery management chip has an anti-counterfeiting integrated circuit (IC) that uniquely identifies the battery. When the battery needs to be charged, mobile phones and other electronic devices can read the anti-counterfeiting IC in the battery management chip, distinguish different battery manufacturers through the anti-counterfeiting IC, and select the charging parameters of the corresponding battery manufacturer (such as the optimal current range, etc.) for charging.
此外,电子设备还可以记录电池的充放电次数,通过分析电池的充放电次数,确定出电池的新旧,以选择对应的充电策略。例如,若电池的充电次数为0,则确定电池为新电池;若电池的充电次数大于预设次数后,则确定电池为旧电池;其中,对新电池充电的总容量大于对旧电池充电的总容量。In addition, the electronic device can also record the number of times the battery is charged and discharged, and determine the age of the battery by analyzing the number of times the battery is charged and discharged, so as to select a corresponding charging strategy. For example, if the number of times the battery is charged is 0, the battery is determined to be a new battery; if the number of times the battery is charged is greater than a preset number of times, the battery is determined to be an old battery; wherein the total capacity charged to the new battery is greater than the total capacity charged to the old battery.
然而,在一些情况下,若电池中没有防伪IC,电子设备无法确定出电池的厂家,则无法选择对应的充电参数对电池进行充电。此外,在将旧电池更换为新电池时,若旧电池和新电池中均没有防伪IC,会导致电子设备无法基于防伪IC检测到电池的更换,仍然采用旧电池所对应的充电策略对新电池进行充电。However, in some cases, if there is no anti-counterfeiting IC in the battery, the electronic device cannot determine the manufacturer of the battery and cannot select the corresponding charging parameters to charge the battery. In addition, when replacing an old battery with a new one, if there is no anti-counterfeiting IC in both the old and new batteries, the electronic device will not be able to detect the replacement of the battery based on the anti-counterfeiting IC and will still use the charging strategy corresponding to the old battery to charge the new battery.
因此,在电池中没有防伪IC时,如何确定出电池的厂家和电池的新旧,以选择合适的充电参数和充电策略对电池进行充电,是当前急需解决的问题。Therefore, when there is no anti-counterfeiting IC in the battery, how to determine the manufacturer of the battery and the age of the battery in order to select appropriate charging parameters and charging strategies to charge the battery is an issue that urgently needs to be solved.
发明内容Summary of the invention
为解决上述问题,本申请实施例提供了一种电池检测电路、方法及电子设备。To solve the above problems, embodiments of the present application provide a battery detection circuit, method and electronic device.
第一方面,本申请提供了一种电池检测电路,包括:开关模块、分压模块和输入模块;其中,开关模块的第一端连接电池的熔断模块和标识模块;分压模块的两端分别连接电池的标识模块和输入模块;其中,在开关模块处于导通状态,并且输入模块向分压模块施加第一电压的情况下,电池的标识模块端具有第二电压,其中,第二电压能够用于确定出电池的型号。In a first aspect, the present application provides a battery detection circuit, comprising: a switch module, a voltage divider module and an input module; wherein the first end of the switch module is connected to the fuse module and the identification module of the battery; the two ends of the voltage divider module are respectively connected to the identification module and the input module of the battery; wherein, when the switch module is in an on state and the input module applies a first voltage to the voltage divider module, the identification module end of the battery has a second voltage, wherein the second voltage can be used to determine the model of the battery.
本申请中,开关模块可以为后文提及的开关模块106;分压模块可以为后文提及的分压模块107;输入模块可以为后文提及的输入模块108;标识模块可以为后文提及的标识模块104;熔断模块可以为后文提及的熔断模块105;第一电压可以为后文提及的输入模块108输出的高电平所对应的电压;第二电压可以为后文提及的识别电池厂家时检测到的电压值。In the present application, the switch module may be the switch module 106 mentioned later; the voltage divider module may be the voltage divider module 107 mentioned later; the input module may be the input module 108 mentioned later; the identification module may be the identification module 104 mentioned later; the fuse module may be the fuse module 105 mentioned later; the first voltage may be the voltage corresponding to the high level output by the input module 108 mentioned later; the second voltage may be the voltage value detected when identifying the battery manufacturer mentioned later.
可以理解,本申请中,电池内部包括熔断模块和标识模块,由于不同型号和/或厂家的电池中的标识模块具有不同的阻值,通过检测标识模块两端的电压值,得到标识模块的阻值,从而区分出电池型号和/或厂家。It can be understood that in the present application, the battery includes a fuse module and an identification module. Since the identification modules in batteries of different models and/or manufacturers have different resistance values, the resistance value of the identification module is obtained by detecting the voltage value at both ends of the identification module, thereby distinguishing the battery model and/or manufacturer.
在一些实施例中,熔断模块的一端与电池的正极连接,另一端与标识模块连接。开关模块的一端与熔断模块和标识模块连接,另一端接地。分压模块的一端与标识模块连接,另一端与输入模块连接。当通过处理器控制开关模块导通,并控制输入模块输出高电平的情况下,通过检测标识模块两端的电压值,可以得到标识模块的阻值,从而区分出电池型号和/或厂家。In some embodiments, one end of the fuse module is connected to the positive electrode of the battery, and the other end is connected to the identification module. One end of the switch module is connected to the fuse module and the identification module, and the other end is grounded. One end of the voltage divider module is connected to the identification module, and the other end is connected to the input module. When the processor controls the switch module to be turned on and controls the input module to output a high level, the resistance value of the identification module can be obtained by detecting the voltage value at both ends of the identification module, thereby distinguishing the battery model and/or manufacturer.
在上述第一方面的一种可能的实现中,电路还包括:处理模块,用于在检测到识别电池型号的第一检测指令的情况下,控制开关模块处于导通状态,并控制输入模块向分压模块施加第一电压;并且,处理模块还用于:在开关模块处于导通状态,并且输入模块向分压模块施加第一电压的情况下,获取电池的标识模块端的第二电压,并基于第一电压和第二电压确定出电池的型号。In a possible implementation of the first aspect above, the circuit also includes: a processing module, which is used to control the switch module to be in an on state and control the input module to apply a first voltage to the voltage divider module when a first detection instruction for identifying the battery model is detected; and the processing module is also used to: when the switch module is in an on state and the input module applies the first voltage to the voltage divider module, obtain a second voltage at the identification module end of the battery, and determine the battery model based on the first voltage and the second voltage.
本申请中,处理模块可以为后文提及的处理模块600;第一检测指令可以为后文提及的识别电池型号和/厂家的指令;第一电压可以为后文提及的输入模块108输出的高电平所对应的电压;第二电压可以为后文提及的识别电池厂家时检测到的电压值。In the present application, the processing module may be the processing module 600 mentioned later; the first detection instruction may be the instruction for identifying the battery model and/or manufacturer mentioned later; the first voltage may be the voltage corresponding to the high level output by the input module 108 mentioned later; the second voltage may be the voltage value detected when identifying the battery manufacturer mentioned later.
在本申请实施例中,处理模块用于控制开关模块的开关状态,并且处理模块还用于控制输入模块输出高电平或低电平。In the embodiment of the present application, the processing module is used to control the switch state of the switch module, and the processing module is also used to control the input module to output a high level or a low level.
在一些实施例中,当处理模块控制开关模块导通,并且控制输入模块输出高电平时,通过检测标识模块两端的电压值,可以得到标识模块的阻值,从而区分出电池型号和/或厂家。In some embodiments, when the processing module controls the switch module to be turned on and controls the input module to output a high level, the resistance value of the identification module can be obtained by detecting the voltage value across the identification module, thereby distinguishing the battery model and/or manufacturer.
在上述第一方面的一种可能的实现中,处理模块还用于基于第一电压、第二电压和分压模块对应的第一阻值,确定出标识模块对应的第一电流,并且在处理模块确定出标识模块对应的第一电流的情况下,处理模块基于第一电流和第二电压确定出标识模块对应的第二阻值,并基于标识模块对应的第二阻值确定出电池的型号。In a possible implementation of the first aspect above, the processing module is also used to determine the first current corresponding to the identification module based on the first voltage, the second voltage and the first resistance corresponding to the voltage divider module, and when the processing module determines the first current corresponding to the identification module, the processing module determines the second resistance corresponding to the identification module based on the first current and the second voltage, and determines the battery model based on the second resistance corresponding to the identification module.
本申请中,第一电流可以为后文提及的在识别电池厂家时,计算出的通过标识模块的电流;第一阻值可以为后文提及的分压模块的阻值;第二阻值为后文提及的标识模块的阻值。In the present application, the first current may be the current passing through the identification module calculated when identifying the battery manufacturer mentioned later; the first resistance may be the resistance of the voltage divider module mentioned later; and the second resistance may be the resistance of the identification module mentioned later.
在本申请中,在识别电池厂家时,通过第一电压、第二电压和第一阻值,可以确定出通过标识模块的电流,基于标识模块两端的电压和电流,可以确定出标识模块的阻值。由于不同型号和/或厂家的标识模块具有不同的阻值,因此,基于标识模块的阻值可以确定出标识模块的型号和/或厂家。In the present application, when identifying the battery manufacturer, the current passing through the identification module can be determined by the first voltage, the second voltage and the first resistance, and the resistance of the identification module can be determined based on the voltage and current at both ends of the identification module. Since identification modules of different models and/or manufacturers have different resistance values, the model and/or manufacturer of the identification module can be determined based on the resistance value of the identification module.
在上述第一方面的一种可能的实现中,处理模块还用于:在检测到识别电池使用程度的第二检测指令的情况下,控制开关模块处于断开状态,并控制输入模块向分压模块施加第三电压;并且,在开关模块处于断开状态,并且输入模块向分压模块施加第三电压的情况下,获取电池的标识模块端的第四电压,并基于第四电压确定出电池的使用程度。In a possible implementation of the first aspect above, the processing module is also used to: when a second detection instruction for identifying the battery usage level is detected, control the switch module to be in an off state, and control the input module to apply a third voltage to the voltage divider module; and, when the switch module is in an off state and the input module applies a third voltage to the voltage divider module, obtain a fourth voltage at the identification module end of the battery, and determine the battery usage level based on the fourth voltage.
本申请中,第二检测指令可以为后文提及的识别电池新旧的指令;第三电压可以为后文提及的输入模块108输出的低电平所对应的电压;第四电压可以为后文提及的识别电池新旧时检测到的电压值。In the present application, the second detection instruction can be the instruction for identifying the newness of the battery mentioned later; the third voltage can be the voltage corresponding to the low level output by the input module 108 mentioned later; the fourth voltage can be the voltage value detected when identifying the newness of the battery mentioned later.
在本申请实施例中,当处理模块控制开关模块断开,并且控制输入模块输出低电平时,通过检测标识模块端的电压值,可以区分出电池型号和/或厂家。In the embodiment of the present application, when the processing module controls the switch module to be disconnected and controls the input module to output a low level, the battery model and/or manufacturer can be distinguished by detecting the voltage value at the identification module end.
在上述第一方面的一种可能的实现中,上述电池的使用程度与第四电压的关系包括:对应于第四电压属于第一电压范围,电池为未使用过的电池;对应于第四电压属于第二电压范围,电池为已使用过的电池;其中,第一电压范围内的各电压大于第二电压范围内的各电压。In a possible implementation of the first aspect, the relationship between the usage level of the battery and the fourth voltage includes: corresponding to the fourth voltage belonging to the first voltage range, the battery is an unused battery; corresponding to the fourth voltage belonging to the second voltage range, the battery is a used battery; wherein each voltage within the first voltage range is greater than each voltage within the second voltage range.
本申请中,第一电压范围为后文提及的第一电压区间;第二电压范围为后文提及的第三电压区间。In the present application, the first voltage range is the first voltage interval mentioned later; the second voltage range is the third voltage interval mentioned later.
在本申请实施例中,在识别电池使用程度时,若第四电压属于第一电压范围,则确定电池为新电池。其中,第一电压范围可以基于多个未使用的电池在标识模块端的电压值设置,例如,若存在三种型号电池,其中,未使用的型号A在标识模块端的电压为[2.8V,3V],未使用的型号B在标识模块端的电压为[3.1V,3.2V],未使用的型号C在标识模块端的电压为[2.7V,2.9V],若第四电压处于任意一个电压区间内,则确定电池为未使用过的电池(即新电池)。In an embodiment of the present application, when identifying the battery usage level, if the fourth voltage belongs to the first voltage range, the battery is determined to be a new battery. The first voltage range can be set based on the voltage values of multiple unused batteries at the identification module end. For example, if there are three types of batteries, the voltage of the unused model A at the identification module end is [2.8V, 3V], the voltage of the unused model B at the identification module end is [3.1V, 3.2V], and the voltage of the unused model C at the identification module end is [2.7V, 2.9V]. If the fourth voltage is within any voltage range, the battery is determined to be an unused battery (i.e., a new battery).
在一些实施例中,若第四电压处于第二电压范围,则确定电池为旧电池。其中,第二电压范围可以为较低的电压范围,如,[0V,1V]。In some embodiments, if the fourth voltage is within the second voltage range, the battery is determined to be a used battery, wherein the second voltage range may be a lower voltage range, such as [0V, 1V].
在上述第一方面的一种可能的实现中,电路还包括:电压检测模块,用于检测标识模块端的电压;电压检测模块还用于,向处理模块发送标识模块端的电压。In a possible implementation of the first aspect above, the circuit further includes: a voltage detection module, configured to detect a voltage at the identification module end; and the voltage detection module is further configured to send the voltage at the identification module end to the processing module.
本申请中,电压检测模块可以为后文提及的电压检测模块500。In the present application, the voltage detection module may be the voltage detection module 500 mentioned later.
在本申请实施例中,电压检测模块与标识模块连接,用于检测标识模块端的电压,同时处理器可以直接获取电压检测模块检测到的电压值。In the embodiment of the present application, the voltage detection module is connected to the identification module to detect the voltage at the identification module end, and the processor can directly obtain the voltage value detected by the voltage detection module.
在上述第一方面的一种可能的实现中,上述开关模块包括晶体管、可控开关中的至少一种,输入模块包括通用输入输出接口、串行通信接口中的至少一种,分压模块包括至少一个电阻。In a possible implementation of the first aspect, the switch module includes at least one of a transistor and a controllable switch, the input module includes at least one of a universal input/output interface and a serial communication interface, and the voltage divider module includes at least one resistor.
在本申请中,开关模块具有断开和导通状态,开关模块包括但不限于晶体管、可控开关;输入模块用于向电池检测电路输出高电平或低电平,输入模块包括但不限于通用输入输出接口、串行通信接口;分压模块具有确定的阻值,可以为一个或多个电阻。In the present application, the switch module has an open and closed state, and the switch module includes but is not limited to a transistor and a controllable switch; the input module is used to output a high level or a low level to the battery detection circuit, and the input module includes but is not limited to a general input and output interface and a serial communication interface; the voltage divider module has a certain resistance value, which can be one or more resistors.
在上述第一方面的一种可能的实现中,电路包括电压检测模块;开关模块包括第一晶体管、输入模块包括第一通用输入输出接口,分压模块包括第一电阻,电池的标识模块包括第二电阻,电压检测模块包括模数转换器;并且第一晶体管的第一端连接电池的熔断模块的第一端和第二电阻的第一端;第一晶体管的第二端接地;第一电阻的第一端连接第二电阻的第二端,并且第一电阻的第二端连接第一通用输入输出接口;模数转换器连接第二电阻的第二端。In a possible implementation of the first aspect above, the circuit includes a voltage detection module; the switch module includes a first transistor, the input module includes a first universal input-output interface, the voltage divider module includes a first resistor, the battery identification module includes a second resistor, and the voltage detection module includes an analog-to-digital converter; and the first end of the first transistor is connected to the first end of the battery fuse module and the first end of the second resistor; the second end of the first transistor is grounded; the first end of the first resistor is connected to the second end of the second resistor, and the second end of the first resistor is connected to the first universal input-output interface; the analog-to-digital converter is connected to the second end of the second resistor.
本申请中,熔断模块可以为后文提及的保险丝F1;第一晶体管可以为后文提及的开关模块中的晶体管元件;第一通用输入输出接口可以为后文提及的通用输入输出接口(general purpose input output,GPIO)1;第一电阻可以为后文提及的电阻R1;第二电阻可以为后文提及的电阻R2。In the present application, the fuse module may be the fuse F1 mentioned later; the first transistor may be the transistor element in the switch module mentioned later; the first general input and output interface may be the general purpose input and output interface (GPIO) 1 mentioned later; the first resistor may be the resistor R1 mentioned later; and the second resistor may be the resistor R2 mentioned later.
在本申请中,电池的熔断模块的第二端连接电池正极,电池的熔断模块的第一端连接电阻R2的第一端;第一晶体管的第一端连接电池的熔断模块的第一端和电阻R2的第一端;第一晶体管的第二端接地;电阻R1的第一端连接电阻R2的第二端,并且电阻R1的第二端连接引脚GPIO1;模数转换器(analog-to-digital converter,ADC)连接电阻R2的第二端。In the present application, the second end of the fuse module of the battery is connected to the positive electrode of the battery, and the first end of the fuse module of the battery is connected to the first end of the resistor R2; the first end of the first transistor is connected to the first end of the fuse module of the battery and the first end of the resistor R2; the second end of the first transistor is grounded; the first end of the resistor R1 is connected to the second end of the resistor R2, and the second end of the resistor R1 is connected to the pin GPIO1; the analog-to-digital converter (ADC) is connected to the second end of the resistor R2.
在上述第一方面的一种可能的实现中,上述第一晶体管处于导通状态,并且第一通用输入输出接口输出高电平的情况下:熔断模块熔断,第一电阻和第二电阻串联,模数转换器检测到第二电阻的第二电压。In a possible implementation of the first aspect, when the first transistor is in an on state and the first universal input/output interface outputs a high level, the fuse module blows, the first resistor and the second resistor are connected in series, and the analog-to-digital converter detects a second voltage of the second resistor.
本申请中,电池的熔断模块的第二端连接电池正极,电池的熔断模块的第一端连接第一晶体管的第一端,第一晶体管的第二端接地。当第一晶体管处于导通状态时,电流从电池的正极经过熔断模块、第一晶体管流向大地,在一些实施例中,由于第一晶体管的阻值可以忽略不计,电流过大,会导致熔断模块熔断。In the present application, the second end of the fuse module of the battery is connected to the positive electrode of the battery, the first end of the fuse module of the battery is connected to the first end of the first transistor, and the second end of the first transistor is grounded. When the first transistor is in the on state, the current flows from the positive electrode of the battery through the fuse module and the first transistor to the ground. In some embodiments, since the resistance of the first transistor can be ignored, the current is too large, which will cause the fuse module to melt.
在一些实施例中,当引脚GPIO1输出高电平时,电流从电阻R1流向电阻R2,通过ADC检测电阻R2的电压,可以得到电阻R2的阻值,从而识别出电池型号和/或厂家。In some embodiments, when the pin GPIO1 outputs a high level, current flows from the resistor R1 to the resistor R2. By detecting the voltage of the resistor R2 through the ADC, the resistance value of the resistor R2 can be obtained, thereby identifying the battery model and/or manufacturer.
在上述第一方面的一种可能的实现中,第一晶体管的第一端为漏极,第一晶体管的第二端为源极,第一晶体管的第三端为栅极;并且第一晶体管的栅极连接第二通用输入输出接口,其中,第二通用输入输出接口位于电池检测电路所在的电子设备中的主板上。In a possible implementation of the first aspect above, the first end of the first transistor is a drain, the second end of the first transistor is a source, and the third end of the first transistor is a gate; and the gate of the first transistor is connected to a second universal input-output interface, wherein the second universal input-output interface is located on a mainboard of the electronic device where the battery detection circuit is located.
本申请中,第一晶体管可以为后文提及的金属氧化物半导体(metal oxidesemiconductor,MOS)晶体管T1;第一晶体管的第一端可以为后文提及的漏极引脚N2;第一晶体管的第二端可以为后文提及的源极引脚N1;第一晶体管的第三端可以为后文提及的栅极引脚N3;第二通用输入输出接口可以为后文提及的引脚GPIO2。In the present application, the first transistor may be the metal oxide semiconductor (MOS) transistor T1 mentioned later; the first end of the first transistor may be the drain pin N2 mentioned later; the second end of the first transistor may be the source pin N1 mentioned later; the third end of the first transistor may be the gate pin N3 mentioned later; and the second general input and output interface may be the pin GPIO2 mentioned later.
在本申请中,MOS晶体管T1的源极引脚N1与电子设备的接地点(ground,GND)连接,漏极引脚N2与熔断模块和电阻R2连接,栅极引脚N3与引脚GPI02连接。其中,引脚GPIO2可以接入电子设备的电路板(如,主板)的输入输出接口。In the present application, the source pin N1 of the MOS transistor T1 is connected to the ground point (ground, GND) of the electronic device, the drain pin N2 is connected to the fuse module and the resistor R2, and the gate pin N3 is connected to the pin GPIO2. Among them, the pin GPIO2 can be connected to the input and output interface of the circuit board (such as the mainboard) of the electronic device.
在上述第一方面的一种可能的实现中,电路还包括处理模块;并且处理模块控制第二通用输入输出接口向第一晶体管的栅极输出高电平,第一晶体管处于导通状态;处理模块控制第二通用输入输出接口向第一晶体管的栅极输出低电平,第一晶体管处于断开状态。In a possible implementation of the first aspect above, the circuit also includes a processing module; and the processing module controls the second general input and output interface to output a high level to the gate of the first transistor, and the first transistor is in an on state; the processing module controls the second general input and output interface to output a low level to the gate of the first transistor, and the first transistor is in an off state.
本申请中,处理模块在控制引脚GPIO2向MOS晶体管T1的栅极引脚N3输出高电平时,MOS晶体管T1处于闭合状态;处理模块在控制引脚GPIO2向MOS晶体管T1的栅极引脚N3输出低电平时,MOS晶体管T1处于断开状态。In the present application, when the processing module outputs a high level to the gate pin N3 of the MOS transistor T1 through the control pin GPIO2, the MOS transistor T1 is in a closed state; when the processing module outputs a low level to the gate pin N3 of the MOS transistor T1 through the control pin GPIO2, the MOS transistor T1 is in a disconnected state.
在上述第一方面的一种可能的实现中,还包括第三电阻;其中,第三电阻的第一端连接第一通用输入输出接口;第三电阻的第二端接地。In a possible implementation of the first aspect above, a third resistor is further included; wherein a first end of the third resistor is connected to the first universal input/output interface; and a second end of the third resistor is grounded.
本申请中,第三电阻可以为后文提及的电阻R3。In the present application, the third resistor may be the resistor R3 mentioned below.
在本申请中,电阻R3的第一端连接引脚GPIO1,第二端接地。其中,电阻R3用于保护引脚GPIO1。In the present application, a first end of the resistor R3 is connected to the pin GPIO1, and a second end is grounded. The resistor R3 is used to protect the pin GPIO1.
第二方面,本申请提供一种电池检测方法,应用于电池检测电路,其中,电池检测电路包括开关模块、分压模块和输入模块;电池包括标识模块和熔断模块;并且方法包括:在检测到识别电池型号的第一检测指令的情况下,控制开关模块处于闭合状态,并且控制输入模块向分压模块施加第一电压,以使得分压模块和标识模块串联;获取标识模块端的第二电压,并基于电池的标识模块端的第二电压值,确定电池的型号。In a second aspect, the present application provides a battery detection method, which is applied to a battery detection circuit, wherein the battery detection circuit includes a switch module, a voltage divider module and an input module; the battery includes an identification module and a fuse module; and the method includes: when a first detection instruction for identifying the battery model is detected, controlling the switch module to be in a closed state, and controlling the input module to apply a first voltage to the voltage divider module so that the voltage divider module and the identification module are connected in series; obtaining a second voltage at the identification module end, and determining the battery model based on the second voltage value at the identification module end of the battery.
本申请中,开关模块可以为后文提及的开关模块106;分压模块可以为后文提及的分压模块107;输入模块可以为后文提及的输入模块108;标识模块可以为后文提及的标识模块104;熔断模块可以为后文提及的熔断模块105;第一检测指令可以为后文提及的识别电池型号和/厂家的指令;第一电压可以为后文提及的输入模块108输出的高电平所对应的电压;第二电压可以为后文提及的识别电池厂家时检测到的电压值。In the present application, the switch module may be the switch module 106 mentioned later; the voltage divider module may be the voltage divider module 107 mentioned later; the input module may be the input module 108 mentioned later; the identification module may be the identification module 104 mentioned later; the fuse module may be the fuse module 105 mentioned later; the first detection instruction may be the instruction for identifying the battery model and/or manufacturer mentioned later; the first voltage may be the voltage corresponding to the high level output by the input module 108 mentioned later; the second voltage may be the voltage value detected when identifying the battery manufacturer mentioned later.
在本申请实施例中,在识别电池型号和/或厂家时,电子设备会控制开关模块闭合,并且控制输入模块输出高电平。通过获取电压检测模块检测到的电压值,得到电池标识模块的阻值,从而识别出电池的型号和/或厂家。In the embodiment of the present application, when identifying the battery model and/or manufacturer, the electronic device controls the switch module to close and controls the input module to output a high level. By acquiring the voltage value detected by the voltage detection module, the resistance value of the battery identification module is obtained, thereby identifying the battery model and/or manufacturer.
在上述第二方面的一种可能的实现中,方法还包括:在检测到识别电池使用程度的第二检测指令的情况下,控制开关模块处于断开状态,并且控制输入模块向分压模块施加第三电压,以使得电池的正极和电池的熔断模块串联,并且电池的熔断模块和标识模块串联;获取标识模块端的第四电压,并基于电池的标识模块端的第四电压值,确定电池的使用程度。In a possible implementation of the second aspect above, the method also includes: when a second detection instruction for identifying the battery usage level is detected, controlling the switch module to be in an off state, and controlling the input module to apply a third voltage to the voltage divider module so that the positive electrode of the battery and the fuse module of the battery are connected in series, and the fuse module of the battery and the identification module are connected in series; obtaining a fourth voltage at the identification module end, and determining the battery usage level based on the fourth voltage value at the identification module end of the battery.
本申请中,第二检测指令可以为后文提及的识别电池新旧的指令;第三电压可以为后文提及的输入模块108输出的低电平所对应的电压;第四电压可以为后文提及的识别电池新旧时检测到的电压值。In the present application, the second detection instruction can be the instruction for identifying the newness of the battery mentioned later; the third voltage can be the voltage corresponding to the low level output by the input module 108 mentioned later; the fourth voltage can be the voltage value detected when identifying the newness of the battery mentioned later.
在本申请实施例中,在识别电池新旧时,电子设备会控制开关模块断开,并且控制输入模块输出低电平,通过获取标识模块端的电压值识别出电池的新旧。In an embodiment of the present application, when identifying whether a battery is new or old, the electronic device controls the switch module to disconnect and controls the input module to output a low level, and identifies whether the battery is new or old by obtaining the voltage value at the identification module end.
第三方面,本申请提供一种电子设备,电子设备包括本申请提及的电池检测电路。In a third aspect, the present application provides an electronic device, and the electronic device includes the battery detection circuit mentioned in the present application.
第四方面,本申请提供一种电子设备,包括:电池;电池检测电路,电池检测电路包括处理模块;存储器,存储器用于存储电子设备的一个或多个处理器执行的指令,至少一个处理器包括在处理模块中,用于执行本申请提及的电池检测方法。In a fourth aspect, the present application provides an electronic device, comprising: a battery; a battery detection circuit, the battery detection circuit comprising a processing module; a memory, the memory being used to store instructions executed by one or more processors of the electronic device, at least one processor being included in the processing module, for executing the battery detection method mentioned in the present application.
第五方面,本申请提供一种可读存储介质,其中,可读存储介质上存储有指令,指令在电子设备上执行时使得电子设备执行本申请提及的电池检测方法。In a fifth aspect, the present application provides a readable storage medium, wherein the readable storage medium stores instructions, and when the instructions are executed on an electronic device, the electronic device executes the battery detection method mentioned in the present application.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1A根据本申请的一些实施例,示出了一种具有电池管理芯片的电池的内部结构示意图;FIG1A is a schematic diagram showing the internal structure of a battery with a battery management chip according to some embodiments of the present application;
图1B根据本申请的一些实施例,示出了一种没有电池管理芯片的电池的内部结构示意图;FIG1B is a schematic diagram showing the internal structure of a battery without a battery management chip according to some embodiments of the present application;
图1C根据本申请的一些实施例,示出了一种电池的部分内部结构示意图;FIG1C is a schematic diagram showing a partial internal structure of a battery according to some embodiments of the present application;
图2A根据本申请的一些实施例,示出了一种电池检测电路的框架结构示意图;FIG2A is a schematic diagram showing a framework structure of a battery detection circuit according to some embodiments of the present application;
图2B根据本申请的一些实施例,示出了一种电池检测电路的示意图;FIG2B shows a schematic diagram of a battery detection circuit according to some embodiments of the present application;
图2C根据本申请的一些实施例,示出了一种识别电池新旧时的电池检测电路的结构示意图;FIG2C shows a schematic diagram of a battery detection circuit for identifying whether a battery is new or old according to some embodiments of the present application;
图2D根据本申请的一些实施例,示出了一种识别电池厂家时的电池检测电路的结构示意图;FIG2D shows a schematic diagram of a battery detection circuit for identifying a battery manufacturer according to some embodiments of the present application;
图3A根据本申请的一些实施例,示出了一种电池检测电路的具体电路结构示意图;FIG3A is a schematic diagram showing a specific circuit structure of a battery detection circuit according to some embodiments of the present application;
图3B根据本申请的一些实施例,示出了一种区分电池新旧时的等效电路结构示意图;FIG3B shows a schematic diagram of an equivalent circuit structure for distinguishing between new and old batteries according to some embodiments of the present application;
图3C根据本申请的一些实施例,示出了一种识别电池厂家时的等效电路结构示意图;FIG3C shows a schematic diagram of an equivalent circuit structure for identifying a battery manufacturer according to some embodiments of the present application;
图4根据本申请的一些实施例,示出了一种识别电池新旧和电池厂家的流程示意图;FIG4 is a schematic diagram showing a process of identifying the age of a battery and the battery manufacturer according to some embodiments of the present application;
图5根据本申请的一些实施例,示出了一种基于电池检测电路识别电池新旧和电池厂家的具体流程示意图;FIG5 shows a schematic diagram of a specific process of identifying the age of a battery and the battery manufacturer based on a battery detection circuit according to some embodiments of the present application;
图6根据本申请的一些实施例,示出了一种电子设备硬件结构示意图。FIG6 shows a schematic diagram of a hardware structure of an electronic device according to some embodiments of the present application.
具体实施方式Detailed ways
本申请的说明性实施例包括但不限于一种电池检测电路、方法及电子设备。The illustrative embodiments of the present application include, but are not limited to, a battery detection circuit, method, and electronic device.
为更加清楚理解本申请的方案,首先对本申请涉及到的相关领域术语进行解释说明。In order to more clearly understand the solution of the present application, the relevant field terms involved in the present application are first explained.
模数转换器(analog to digital converter,ADC):可以将接收到的模拟电压转换为数字电压,并基于数字电压得到对应的电压值。例如,若ADC测量电压的上限设置为3V,且将模拟电压通过4位的数字电压表示,则ADC输出的数字电压为15(即1111)时,表示测到的电压值为3V;此外,若ADC输出的数字电压为5(即0101)时,表示测到的电压值为1V;若ADC输出的数字电压为10(即1010)时,表示测到的电压值为2V。其中,处理器可以读取ADC上的数字电压,并得到该数字电压对应的电压值。Analog to digital converter (ADC): can convert the received analog voltage into a digital voltage and obtain the corresponding voltage value based on the digital voltage. For example, if the upper limit of the ADC measurement voltage is set to 3V, and the analog voltage is represented by a 4-bit digital voltage, when the digital voltage output by the ADC is 15 (i.e., 1111), it means that the measured voltage value is 3V; in addition, if the digital voltage output by the ADC is 5 (i.e., 0101), it means that the measured voltage value is 1V; if the digital voltage output by the ADC is 10 (i.e., 1010), it means that the measured voltage value is 2V. Among them, the processor can read the digital voltage on the ADC and obtain the voltage value corresponding to the digital voltage.
通用输入输出接口(general purpose input output,GPIO):一种输入输出端口,当与其它电子元件连接时,可以向连接的电子元件输出高电平或低电平。其中,低电平信号表示GPIO输出最低的电压值,一般为0V;高电平信号表示GPIO输出最大的电压值。在一些情况下,可以将高电平信号设置为固定的电压值,例如,将高电平信号设置为4V,当GPIO向电子元件输出高电平信号时,表示向电子元件施加了4V的电压。General purpose input output (GPIO): An input and output port that, when connected to other electronic components, can output a high level or a low level to the connected electronic components. A low level signal indicates the lowest voltage value output by the GPIO, which is generally 0V; a high level signal indicates the maximum voltage value output by the GPIO. In some cases, the high level signal can be set to a fixed voltage value. For example, the high level signal is set to 4V. When the GPIO outputs a high level signal to an electronic component, it means that a voltage of 4V is applied to the electronic component.
下面对本申请提及的电池检测电路的背景进行简单介绍。The following is a brief introduction to the background of the battery detection circuit mentioned in this application.
如前所述,电池中通常具有电池管理芯片,电子设备可以读取电池管理芯片中的防伪IC,通过防伪IC区分不同的电池厂家,并且可以通过防伪IC确定出是否更换电池,从而选择合适的充电参数和充电策略对电池进行充电。例如,如图1A所示,以电子设备为手机100、且手机100中内嵌电池200为例,对电池的内部结构进行介绍。As mentioned above, the battery usually has a battery management chip, and the electronic device can read the anti-counterfeiting IC in the battery management chip, distinguish different battery manufacturers through the anti-counterfeiting IC, and determine whether to replace the battery through the anti-counterfeiting IC, so as to select appropriate charging parameters and charging strategies to charge the battery. For example, as shown in FIG1A, taking the electronic device as a mobile phone 100, and the mobile phone 100 having a built-in battery 200 as an example, the internal structure of the battery is introduced.
如图1A所示,电池200中包括电池管理芯片101、保护芯片102、晶体管Q1以及电池200的正极和负极,其中,电池200的正极和负极为电芯(图中未示出)的正负极,电芯中存储电能,可以向手机100中的各器件供电。As shown in Figure 1A, the battery 200 includes a battery management chip 101, a protection chip 102, a transistor Q1, and the positive and negative electrodes of the battery 200, wherein the positive and negative electrodes of the battery 200 are the positive and negative electrodes of a battery cell (not shown in the figure), and the battery cell stores electrical energy and can supply power to various devices in the mobile phone 100.
在图1A中,电池管理芯片101的一端与电池200的正极连接,另一端与手机100的身份识别模块(图中未示出)连接,手机100的身份识别模块可以读取电池管理芯片101中的防伪IC,通过防伪IC区分不同的电池厂家,并且可以通过防伪IC确定出是否更换电池。In Figure 1A, one end of the battery management chip 101 is connected to the positive electrode of the battery 200, and the other end is connected to the identity recognition module of the mobile phone 100 (not shown in the figure). The identity recognition module of the mobile phone 100 can read the anti-counterfeiting IC in the battery management chip 101, distinguish different battery manufacturers through the anti-counterfeiting IC, and determine whether to replace the battery through the anti-counterfeiting IC.
保护芯片102的一端与电池200的正极连接,另一端与晶体管Q1的第一端a连接。晶体管Q1的第二端b与电池200的负极连接,晶体管Q1的第三端c与手机100连接。当保护芯片102控制晶体管Q1导通时,电流通过晶体管Q1流向手机100,从而可以向手机100中的各器件供电。并且,当电池200中的电流过大时,保护芯片102控制晶体管Q1断开。One end of the protection chip 102 is connected to the positive electrode of the battery 200, and the other end is connected to the first end a of the transistor Q1. The second end b of the transistor Q1 is connected to the negative electrode of the battery 200, and the third end c of the transistor Q1 is connected to the mobile phone 100. When the protection chip 102 controls the transistor Q1 to be turned on, the current flows to the mobile phone 100 through the transistor Q1, so that power can be supplied to various devices in the mobile phone 100. In addition, when the current in the battery 200 is too large, the protection chip 102 controls the transistor Q1 to be turned off.
如前所述,一些电池中没有电池管理芯片101。如图1B所示,以电子设备为手机100,且手机100中内嵌电池300为例,对没有电池管理芯片的电池的内部结构进行简单介绍。As mentioned above, some batteries do not have a battery management chip 101. As shown in FIG1B, taking the electronic device as a mobile phone 100 and the mobile phone 100 having a built-in battery 300 as an example, the internal structure of a battery without a battery management chip is briefly introduced.
如图1B所示,电池300中包括保护芯片102、标识模块104、晶体管Q1以及电池300的正极和负极,其中,电池300的正极和负极为电芯(图中未示出)的正负极,电芯中存储电能,可以向手机100中的各器件供电。As shown in Figure 1B, the battery 300 includes a protection chip 102, an identification module 104, a transistor Q1, and the positive and negative electrodes of the battery 300, wherein the positive and negative electrodes of the battery 300 are the positive and negative electrodes of a battery cell (not shown in the figure), and the battery cell stores electrical energy and can supply power to various devices in the mobile phone 100.
在图1B中,当电池300中没有电池管理芯片101时,电流可以直接从电池300的正极流向手机100,从而向手机100中的各器件进行供电。In FIG. 1B , when there is no battery management chip 101 in the battery 300 , current can flow directly from the positive electrode of the battery 300 to the mobile phone 100 , thereby supplying power to various devices in the mobile phone 100 .
在图1B中,保护芯片102的一端与电池300的正极连接,另一端与晶体管Q1的第一端a连接。晶体管Q1的第二端b与电池300的负极连接,晶体管Q1的第三端c与手机100连接。当电池300的电流小于保护芯片102的额定值时,保护芯片102控制晶体管Q1导通,当电池300的电流大于保护芯片102的额定值时,保护芯片102控制晶体管Q1断开。In FIG1B , one end of the protection chip 102 is connected to the positive electrode of the battery 300, and the other end is connected to the first end a of the transistor Q1. The second end b of the transistor Q1 is connected to the negative electrode of the battery 300, and the third end c of the transistor Q1 is connected to the mobile phone 100. When the current of the battery 300 is less than the rated value of the protection chip 102, the protection chip 102 controls the transistor Q1 to turn on, and when the current of the battery 300 is greater than the rated value of the protection chip 102, the protection chip 102 controls the transistor Q1 to turn off.
在图1B中,电池300中还包括标识模块104,标识模块104的两端分别与晶体管Q1的第三端c和手机100连接。其中,标识模块104可以为用于识别电池识别码(identification,ID)的电阻元件,由于不同型号和/厂商的电池中的ID电阻具有不同的阻值,基于ID电阻的阻值可以确定出电池的型号和/或厂商。In FIG1B , the battery 300 further includes an identification module 104, and two ends of the identification module 104 are respectively connected to the third end c of the transistor Q1 and the mobile phone 100. The identification module 104 may be a resistor element for identifying a battery identification code (ID). Since the ID resistors in batteries of different models and/or manufacturers have different resistance values, the model and/or manufacturer of the battery may be determined based on the resistance value of the ID resistor.
如图1B所示,和图1A中示出的电池200的内部结构相比,电池300中没有电池管理芯片101,电池300中通过标识模块104识别电池厂家。As shown in FIG. 1B , compared with the internal structure of the battery 200 shown in FIG. 1A , the battery 300 does not have the battery management chip 101 , and the battery manufacturer is identified by the identification module 104 in the battery 300 .
同时,在本申请实施例中,可以通过在电池300中增加熔断模块105(例如,保险丝等),基于熔断模块105和标识模块104识别出电池300的新旧和电池300的厂家。Meanwhile, in the embodiment of the present application, a fuse module 105 (eg, a fuse, etc.) may be added to the battery 300 , and the age of the battery 300 and the manufacturer of the battery 300 may be identified based on the fuse module 105 and the identification module 104 .
如图1C所示,为了便于说明,仅示出了与本申请实施例相关的部分。在电池300的内部,熔断模块105的一端与电池300的正极(即电池300的输出端)连接,另一端与标识模块104连接;当电池300嵌入手机100时,可以将标识模块104接入手机100中的ADC。如此,电池300在向手机100中的各器件供电时,电流还可以从电池300的正极依次经过熔断模块105、标识模块104后流向手机100的ADC。其中,ADC可以将接收到的模拟电压转换为数字电压,处理器可以直接读取ADC的电压值。As shown in FIG. 1C , for the sake of convenience, only the parts related to the embodiment of the present application are shown. Inside the battery 300, one end of the fuse module 105 is connected to the positive electrode of the battery 300 (i.e., the output end of the battery 300), and the other end is connected to the identification module 104; when the battery 300 is embedded in the mobile phone 100, the identification module 104 can be connected to the ADC in the mobile phone 100. In this way, when the battery 300 supplies power to each device in the mobile phone 100, the current can also flow from the positive electrode of the battery 300 through the fuse module 105 and the identification module 104 in sequence to the ADC of the mobile phone 100. Among them, the ADC can convert the received analog voltage into a digital voltage, and the processor can directly read the voltage value of the ADC.
应理解,如图1B所示,电池300中还具有其它的安全装置(即保护芯片102),当熔断模块105处于断开状态时,仍然可以维持电池300的正常工作。It should be understood that, as shown in FIG. 1B , the battery 300 also has other safety devices (ie, the protection chip 102 ), and when the fuse module 105 is in the disconnected state, the normal operation of the battery 300 can still be maintained.
如前所述,在电池中没有防伪IC时,如何确定出电池的厂家和电池的新旧,以选择合适的充电参数和充电策略,是当前急需解决的问题。As mentioned above, when there is no anti-counterfeiting IC in the battery, how to determine the manufacturer of the battery and the age of the battery in order to select appropriate charging parameters and charging strategies is a problem that urgently needs to be solved.
由于不同型号和/或厂家的电池中的标识模块具有不同的阻值,因此,本申请提供了一种电池检测电路,可以通过检测标识模块两端的电压值,得到标识模块的阻值,从而区分出电池型号和/或厂家。同时,在本申请提供的电池检测电路中,当电流从电池的正极依次经过熔断模块、标识模块流向电子设备的ADC时,还可以通过获取ADC的电压值,以区分出电池的新旧;其中,若电压大于预设电压值,则确定电池为新电池;若电压低于预设电压值,则确定电池为旧电池。Since the identification modules in batteries of different models and/or manufacturers have different resistance values, the present application provides a battery detection circuit, which can detect the voltage value at both ends of the identification module to obtain the resistance value of the identification module, thereby distinguishing the battery model and/or manufacturer. At the same time, in the battery detection circuit provided by the present application, when the current flows from the positive electrode of the battery through the fuse module and the identification module to the ADC of the electronic device in sequence, the voltage value of the ADC can also be obtained to distinguish the new and old batteries; wherein, if the voltage is greater than the preset voltage value, it is determined that the battery is a new battery; if the voltage is lower than the preset voltage value, it is determined that the battery is an old battery.
具体地,图2A示出了一种电池检测电路的结构示意图,仍以电子设备为手机100、且手机100中内嵌电池300为例,该电池检测电路中包括熔断模块105、标识模块104和检测电路400。其中,检测电路400的一端与熔断模块105连接,另一端与标识模块104连接。其中,检测电路400具有断开和导通状态。Specifically, FIG2A shows a schematic diagram of the structure of a battery detection circuit, still taking the electronic device as a mobile phone 100, and the mobile phone 100 having a built-in battery 300 as an example, the battery detection circuit includes a fuse module 105, an identification module 104, and a detection circuit 400. Among them, one end of the detection circuit 400 is connected to the fuse module 105, and the other end is connected to the identification module 104. Among them, the detection circuit 400 has a disconnection state and a conduction state.
一方面,当控制检测电路400处于断开状态时,在电池300向手机100供电时,电流还可以从电池300的正极依次经过熔断模块105、标识模块104。手机100的处理器通过获取标识模块104端的电压值,可以区分出电池300的新旧,若电压值大于预设电压值,表示电池300中的熔断模块105为导通状态,则确定电池300为新电池;若电压低于预设电压值,表示电池300中的熔断模块105为断开状态,则确定电池300为旧电池。另一方面,当控制检测电路400处于闭合状态时,手机100的处理器可以通过获取标识模块104端的电压值,得到标识模块104的阻值,从而识别出电池300的型号和/或厂家。On the one hand, when the control detection circuit 400 is in the disconnected state, when the battery 300 supplies power to the mobile phone 100, the current can also pass through the fuse module 105 and the identification module 104 in sequence from the positive electrode of the battery 300. The processor of the mobile phone 100 can distinguish the new and old batteries 300 by obtaining the voltage value at the end of the identification module 104. If the voltage value is greater than the preset voltage value, it means that the fuse module 105 in the battery 300 is in the on state, and the battery 300 is determined to be a new battery; if the voltage is lower than the preset voltage value, it means that the fuse module 105 in the battery 300 is in the disconnected state, and the battery 300 is determined to be an old battery. On the other hand, when the control detection circuit 400 is in the closed state, the processor of the mobile phone 100 can obtain the resistance value of the identification module 104 by obtaining the voltage value at the end of the identification module 104, thereby identifying the model and/or manufacturer of the battery 300.
具体地,如图2B所示,检测电路400中可以包括开关模块106、分压模块107、输入模块108、电压检测模块500和处理模块600。其中,开关模块106一端与熔断模块105和标识模块104连接,另一端接地。分压模块107的一端与标识模块104和电压检测模块500连接,另一端与输入模块108连接。此外,处理模块600可以用于控制开关模块106的开关状态;并且处理模块600还可以通过控制输入模块108,进而向电池检测电路输入检测电压;处理模块600还可以用于获取电压检测模块500检测到的电压值。Specifically, as shown in FIG2B , the detection circuit 400 may include a switch module 106, a voltage divider module 107, an input module 108, a voltage detection module 500, and a processing module 600. Among them, one end of the switch module 106 is connected to the fuse module 105 and the identification module 104, and the other end is grounded. One end of the voltage divider module 107 is connected to the identification module 104 and the voltage detection module 500, and the other end is connected to the input module 108. In addition, the processing module 600 can be used to control the switch state of the switch module 106; and the processing module 600 can also input the detection voltage to the battery detection circuit by controlling the input module 108; the processing module 600 can also be used to obtain the voltage value detected by the voltage detection module 500.
一方面,在识别电池300的新旧时,手机100的处理器可以通过读取电压检测模块500的电压值,以区分出电池300的新旧。具体地,处理模块600可以控制开关模块106断开,且控制输入模块108输出低电平(即0V电压),此时,电路结构如图2C所示,电流从电池300的正极依次经过熔断模块105、标识模块104后流向电压检测模块500。处理模块600可以读取电压检测模块500上的电压值,若电压值大于预设电压值,表示电流可以从电池300的正极流向电压检测模块500,即电池300中的熔断模块105为导通状态,则确定电池300为新电池;若电压低于预设电压值,表示电池300中的熔断模块105为断开状态,则确定电池300为旧电池。On the one hand, when identifying whether the battery 300 is new or old, the processor of the mobile phone 100 can distinguish whether the battery 300 is new or old by reading the voltage value of the voltage detection module 500. Specifically, the processing module 600 can control the switch module 106 to be disconnected, and control the input module 108 to output a low level (i.e., 0V voltage). At this time, the circuit structure is shown in FIG. 2C, and the current flows from the positive electrode of the battery 300 to the voltage detection module 500 after passing through the fuse module 105 and the identification module 104 in sequence. The processing module 600 can read the voltage value on the voltage detection module 500. If the voltage value is greater than the preset voltage value, it means that the current can flow from the positive electrode of the battery 300 to the voltage detection module 500, that is, the fuse module 105 in the battery 300 is in the on state, and it is determined that the battery 300 is a new battery; if the voltage is lower than the preset voltage value, it means that the fuse module 105 in the battery 300 is in the off state, and it is determined that the battery 300 is an old battery.
此外,在识别电池300的型号和/或厂家时,手机100的处理器可以通过获取标识模块104两端的电压值,得到标识模块104的阻值,从而区分出电池300的型号和/或厂家。具体地,处理模块600可以控制开关模块106闭合,且控制输入模块108向电路输入检测电压(例如,输入5V的电压)。在一些情况下,由于开关模块106的阻值可以忽略不计,电流直接从电池300的正极经过熔断模块105流向大地,电流过大导致熔断模块105断开。此时,电路可以如图2D所示,由于标识模块104的一端连接电压检测模块500检测电压,一端接地,则处理器读取的电压检测模块500的电压值即为标识模块104两端的电压值。基于输入模块108输入的检测电压、分压模块107的阻值、以及检测到的标识模块104两端的电压值,即可得到标识模块104的阻值,从而区分出电池300的型号和/或厂家,基于电池300的型号和/或厂家选择对应的充电参数,对电池300进行充电。In addition, when identifying the model and/or manufacturer of the battery 300, the processor of the mobile phone 100 can obtain the voltage value at both ends of the identification module 104 to obtain the resistance value of the identification module 104, thereby distinguishing the model and/or manufacturer of the battery 300. Specifically, the processing module 600 can control the switch module 106 to close, and control the input module 108 to input a detection voltage (for example, input a voltage of 5V) to the circuit. In some cases, since the resistance value of the switch module 106 can be ignored, the current flows directly from the positive electrode of the battery 300 through the fuse module 105 to the ground, and the current is too large to cause the fuse module 105 to disconnect. At this time, the circuit can be as shown in Figure 2D. Since one end of the identification module 104 is connected to the voltage detection module 500 to detect the voltage, and one end is grounded, the voltage value of the voltage detection module 500 read by the processor is the voltage value at both ends of the identification module 104. Based on the detection voltage input by the input module 108, the resistance value of the voltage divider module 107, and the detected voltage value across the identification module 104, the resistance value of the identification module 104 can be obtained, thereby distinguishing the model and/or manufacturer of the battery 300, and selecting corresponding charging parameters based on the model and/or manufacturer of the battery 300 to charge the battery 300.
如此,在本申请中,通过一个电池检测电路即可实现对电池新旧和电池型号、电池厂家的识别。进而,可以根据不同的充电策略和充电参数对电池充电。Thus, in this application, the age, model and manufacturer of a battery can be identified through a battery detection circuit, and the battery can be charged according to different charging strategies and charging parameters.
在一些实施例中,开关模块106可以包括金属氧化物半导体(metal-oxide-semiconductor,MOS)晶体管,通过连接GPIO引脚控制MOS晶体管的开关状态。同时,GPIO引脚可以连接手机100的主板,处理模块600在控制GPIO引脚向MOS晶体管输出高电平时,可以闭合MOS晶体管,此时开关模块106处于闭合状态。处理模块600在控制GPIO引脚向MOS晶体管输出低电平时,可以断开MOS晶体管,此时开关模块106处于断开状态。此外,在一些实施例中,在MOS晶体管闭合时,MOS晶体管的阻值可以忽略不计。在一些实施例中,输入模块可以为GPIO引脚,其中,GPIO引脚可以连接手机100的主板,用于向电池检测电路输出高电平或低电平。In some embodiments, the switch module 106 may include a metal-oxide-semiconductor (MOS) transistor, and the switch state of the MOS transistor is controlled by connecting the GPIO pin. At the same time, the GPIO pin can be connected to the mainboard of the mobile phone 100, and the processing module 600 can close the MOS transistor when controlling the GPIO pin to output a high level to the MOS transistor, and the switch module 106 is in a closed state. When the processing module 600 controls the GPIO pin to output a low level to the MOS transistor, the MOS transistor can be disconnected, and the switch module 106 is in an open state. In addition, in some embodiments, when the MOS transistor is closed, the resistance of the MOS transistor can be ignored. In some embodiments, the input module can be a GPIO pin, wherein the GPIO pin can be connected to the mainboard of the mobile phone 100, and is used to output a high level or a low level to the battery detection circuit.
在另一些实施例中,开关模块106还可以为任意具有断开和闭合状态的电子元件,例如,开关等,本申请对开关模块106的具体形态不做限定。In other embodiments, the switch module 106 may also be any electronic component having an open state and a closed state, such as a switch, etc. The present application does not limit the specific form of the switch module 106.
在一些实施例中,开关模块106还可以位于电池300中,本申请对开关模块106的具体位置不做限定。In some embodiments, the switch module 106 may also be located in the battery 300 , and the present application does not limit the specific location of the switch module 106 .
在另一些实施例中,开关模块106的两端还可以增加其它的电子元件,例如,电阻、晶体管、开关等。则在识别电池300的型号和/或厂家时,电压检测模块500检测到的电压值为标识模块104和增加的电子元件的总电压,通过手机100中的ADC可以检测到增加的电子元件的电压,将电压检测模块500检测到的电压值减去增加的电子元件的电压值,即可得到标识模块104两端的电压,从而确定出标识模块104的阻值。In other embodiments, other electronic components, such as resistors, transistors, switches, etc., may be added to both ends of the switch module 106. When identifying the model and/or manufacturer of the battery 300, the voltage value detected by the voltage detection module 500 is the total voltage of the identification module 104 and the added electronic components. The voltage of the added electronic components can be detected by the ADC in the mobile phone 100. The voltage value detected by the voltage detection module 500 minus the voltage value of the added electronic components can be used to obtain the voltage across the identification module 104, thereby determining the resistance value of the identification module 104.
在另一些实施例中,分压模块107中可以包括多个电阻,输入模块输出的高电平对应的电压减去电压检测模块500检测到的电压值,即可得到分压模块107两端的电压值。基于分压模块107的阻值和分压模块107两端的电压,可以获得通过分压模块107和标识模块104的电流,基于标识模块104两端的电压和通过标识模块104的电流,即可确定出标识模块104的阻值,从而识别出电池300的厂家。In other embodiments, the voltage divider module 107 may include multiple resistors, and the voltage value across the voltage divider module 107 may be obtained by subtracting the voltage value detected by the voltage detection module 500 from the voltage corresponding to the high level output by the input module. Based on the resistance value of the voltage divider module 107 and the voltage across the voltage divider module 107, the current passing through the voltage divider module 107 and the identification module 104 may be obtained, and based on the voltage across the identification module 104 and the current passing through the identification module 104, the resistance value of the identification module 104 may be determined, thereby identifying the manufacturer of the battery 300.
下面以上述提及的各模块中的电路元件为例,基于图3A、图3B以及图3C对本申请实施例提及的电池检测电路进行举例介绍。The following takes the circuit elements in each module mentioned above as an example, and introduces the battery detection circuit mentioned in the embodiment of the present application based on Figures 3A, 3B and 3C.
在本申请实施例中,如图3A所示,电池中存在保险丝F1以及电阻R2。此外,通过新增MOS晶体管T1、电阻R1、电阻R3、引脚GPIO1以及引脚GPIO2实现电池新旧和电池厂家的识别。其中,保险丝F1为上述提及的电池中的熔断模块105;电阻R2为上述提及的电池中的标识模块104;MOS晶体管T1为上述提及的开关模块106中的电路元件;引脚GPIO2可以通过上述提及的处理模块600控制,通过处理模块600控制引脚GPIO2向MOS晶体管输出高电平或低电平,从而控制MOS晶体管T1的开关状态。电阻R1为上述提及的分压模块107中的电路元件;引脚GPIO1可以为上述提及的输入模块108中的电路元件。In the embodiment of the present application, as shown in FIG3A , there are fuses F1 and resistors R2 in the battery. In addition, the identification of the new and old batteries and the battery manufacturers is achieved by adding MOS transistors T1, resistors R1, resistors R3, pins GPIO1 and pins GPIO2. Among them, fuse F1 is the fuse module 105 in the battery mentioned above; resistor R2 is the identification module 104 in the battery mentioned above; MOS transistor T1 is the circuit element in the switch module 106 mentioned above; pin GPIO2 can be controlled by the processing module 600 mentioned above, and the processing module 600 controls pin GPIO2 to output a high level or a low level to the MOS transistor, thereby controlling the switching state of MOS transistor T1. Resistor R1 is a circuit element in the voltage divider module 107 mentioned above; pin GPIO1 can be a circuit element in the input module 108 mentioned above.
在一些实施例中,保险丝F1和电阻R2为电池的内部电路元件。在另一些实施例中,保险丝F1、电阻R2和MOS晶体管T1均可以为电池的内部电路元件。本申请对于MOS晶体管T1的具体位置不做限定。In some embodiments, the fuse F1 and the resistor R2 are internal circuit elements of the battery. In other embodiments, the fuse F1, the resistor R2 and the MOS transistor T1 can all be internal circuit elements of the battery. The present application does not limit the specific position of the MOS transistor T1.
具体地,电路方案如图3A所示,保险丝F1的一端与电池正极连接,另一端与电阻R2和MOS晶体管T1的漏极引脚N2连接。电阻R2的一端与保险丝F1和MOS晶体管T1的漏极引脚N2连接,另一端与电阻R1和节点1连接。其中,节点1接入电子设备的ADC(即上述提及的电压检测模块500),电子设备的处理器通过读取ADC的电压值,可以检测到节点1处的电压值。Specifically, the circuit scheme is shown in FIG3A , where one end of the fuse F1 is connected to the positive electrode of the battery, and the other end is connected to the resistor R2 and the drain pin N2 of the MOS transistor T1. One end of the resistor R2 is connected to the fuse F1 and the drain pin N2 of the MOS transistor T1, and the other end is connected to the resistor R1 and the node 1. Among them, the node 1 is connected to the ADC of the electronic device (i.e., the voltage detection module 500 mentioned above), and the processor of the electronic device can detect the voltage value at the node 1 by reading the voltage value of the ADC.
此外,MOS晶体管T1的源极引脚N1与电子设备的接地点(ground,GND)连接,漏极引脚N2与保险丝F1和电阻R2连接,栅极引脚N3与引脚GPI02连接。其中,引脚GPIO2接入电子设备的电路板(如,主板)的输入输出接口,可以通过处理器(即上述提及的处理模块600)控制引脚GPIO2向MOS晶体管T1的栅极引脚N3输出高电平或低电平。In addition, the source pin N1 of the MOS transistor T1 is connected to the ground point (ground, GND) of the electronic device, the drain pin N2 is connected to the fuse F1 and the resistor R2, and the gate pin N3 is connected to the pin GPIO2. Among them, the pin GPIO2 is connected to the input and output interface of the circuit board (such as the main board) of the electronic device, and the processor (that is, the processing module 600 mentioned above) can control the pin GPIO2 to output a high level or a low level to the gate pin N3 of the MOS transistor T1.
其中,电子设备的处理器在控制引脚GPIO2向MOS晶体管T1的栅极引脚N3输出高电平时,MOS晶体管T1处于闭合状态,此时电流可以通过MOS晶体管T1且MOS晶体管T1的阻值可以忽略不计。电子设备的处理器在控制引脚GPIO2向MOS晶体管T1的栅极引脚N3输出低电平时,MOS晶体管T1处于断开状态,电流无法从漏极引脚N2流向源极引脚N1。When the processor of the electronic device outputs a high level to the gate pin N3 of the MOS transistor T1 through the control pin GPIO2, the MOS transistor T1 is in a closed state, at which time the current can pass through the MOS transistor T1 and the resistance of the MOS transistor T1 can be ignored. When the processor of the electronic device outputs a low level to the gate pin N3 of the MOS transistor T1 through the control pin GPIO2, the MOS transistor T1 is in an open state, and the current cannot flow from the drain pin N2 to the source pin N1.
在图3A中,电阻R1的一端与电阻R2和节点1连接,另一端与电阻R3和引脚GPIO1连接。其中,引脚GPIO1可以连接电子设备的电路板(如,主板)的输入输出接口,通过电子设备的处理器控制引脚GPIO1向电池检测电路输出高电平或低电平。此外,在电子设备初始化(如,重启等)的过程中,引脚GPIO1会处于不稳定状态,可以通过增加电阻R3以保护引脚GPIO1。其中,电阻R3还与GND连接,在识别电池的新旧和厂家的过程中不起作用。In FIG3A , one end of resistor R1 is connected to resistor R2 and node 1, and the other end is connected to resistor R3 and pin GPIO1. Pin GPIO1 can be connected to the input/output interface of the circuit board (e.g., motherboard) of the electronic device, and the processor of the electronic device controls pin GPIO1 to output a high level or a low level to the battery detection circuit. In addition, during the initialization of the electronic device (e.g., restart, etc.), pin GPIO1 will be in an unstable state, and resistor R3 can be added to protect pin GPIO1. Resistor R3 is also connected to GND, and does not play a role in identifying the newness and manufacturer of the battery.
在识别电池新旧的过程中,处理器可以控制引脚GPIO2向MOS晶体管T1的栅极引脚N3输出低电平,使得MOS晶体管T1处于断开状态。同时,处理器控制引脚GPIO1向电池检测电路输出低电平,则电阻R3获取到的电压值为0V。此时,等效电路结构图可以如图3B所示,电流从电池的正极依次流向保险丝F1、电阻R2以及电阻R1,通过电子设备的ADC可以测得节点1处的电压值,其中,若电压值处于预设的电压范围区间,则确定该电池为新电池,反之,若电压值低于预设的电压范围区间,则确定该电池为旧电池。应理解,电压范围区间可以基于多个未使用的电池在节点1处的电压值任意设置,例如,若存在三种型号电池,其中,未使用的型号A在节点1处的电压为[2.8V,3V],未使用的型号B在节点1处的电压为[3.1V,3.2V],未使用的型号C在节点1处的电压为[2.7V,2.9V],若节点1处的电压值处于任意一个电压区间,则确定电池为新电池;若节点1处的电压值低于所有的电压区间,则确定电池为旧电池。In the process of identifying whether the battery is new or old, the processor can control pin GPIO2 to output a low level to the gate pin N3 of MOS transistor T1, so that MOS transistor T1 is in a disconnected state. At the same time, the processor controls pin GPIO1 to output a low level to the battery detection circuit, and the voltage value obtained by resistor R3 is 0V. At this time, the equivalent circuit structure diagram can be shown in Figure 3B, and the current flows from the positive electrode of the battery to the fuse F1, resistor R2 and resistor R1 in sequence. The voltage value at node 1 can be measured by the ADC of the electronic device, where if the voltage value is within the preset voltage range, it is determined that the battery is a new battery. Conversely, if the voltage value is lower than the preset voltage range, it is determined that the battery is an old battery. It should be understood that the voltage range interval can be arbitrarily set based on the voltage values of multiple unused batteries at node 1. For example, if there are three types of batteries, among which the voltage of the unused model A at node 1 is [2.8V, 3V], the voltage of the unused model B at node 1 is [3.1V, 3.2V], and the voltage of the unused model C at node 1 is [2.7V, 2.9V], if the voltage value at node 1 is in any voltage interval, the battery is determined to be a new battery; if the voltage value at node 1 is lower than all voltage intervals, the battery is determined to be an old battery.
在一些实施例中,未使用的电池在节点1处的电压范围可以通过ADC检测得到;也可以基于电池的输出电压、电阻R2的阻值以及电阻R1的阻值计算得到,例如,若电池的输出电压为4V~4.4V,电阻R2的阻值为3Ω,电阻R1的阻值为1Ω,基于串联分压可以得到节点1处的电压范围为[1V,1.1V]。In some embodiments, the voltage range of an unused battery at node 1 can be obtained by ADC detection; it can also be calculated based on the output voltage of the battery, the resistance value of resistor R2, and the resistance value of resistor R1. For example, if the output voltage of the battery is 4V to 4.4V, the resistance value of resistor R2 is 3Ω, and the resistance value of resistor R1 is 1Ω, the voltage range at node 1 can be obtained as [1V, 1.1V] based on series voltage division.
在识别电池型号和/或厂家的过程中,电子设备的处理器可以控制引脚GPIO2向MOS晶体管T1的栅极引脚N3输出高电平,使得MOS晶体管T1处于闭合状态,其中MOS晶体管T1闭合时,电流可以从漏极引脚N2流向源极引脚N1,且MOS晶体管T1的阻值可以忽略不计,则电流从电池的正极直接经过保险丝F1流向GND,由于电流过大保险丝F1会烧断。同时,控制引脚GPIO1向电池检测电路输出高电平。此时,等效电路结构图可以如图3C所示,电阻R2和电阻R1串联,其中,电阻R3为电阻R2和电阻R1的并联电阻,对电阻R2和电阻R1电路路径上的电流无影响。In the process of identifying the battery model and/or manufacturer, the processor of the electronic device can control the pin GPIO2 to output a high level to the gate pin N3 of the MOS transistor T1, so that the MOS transistor T1 is in a closed state, wherein when the MOS transistor T1 is closed, the current can flow from the drain pin N2 to the source pin N1, and the resistance of the MOS transistor T1 can be ignored, then the current flows directly from the positive electrode of the battery through the fuse F1 to GND, and the fuse F1 will burn out due to excessive current. At the same time, the control pin GPIO1 outputs a high level to the battery detection circuit. At this time, the equivalent circuit structure diagram can be shown in Figure 3C, where the resistor R2 and the resistor R1 are connected in series, wherein the resistor R3 is a parallel resistor of the resistor R2 and the resistor R1, and has no effect on the current on the circuit path of the resistor R2 and the resistor R1.
在图3C中,电流可以从GPIO1流出,依次经过电阻R1和电阻R2流向GND,其中,由于电阻R2的一端接地,则引脚GPIO1输出的高电平所对应的电压即为电阻R2和电阻R1的总电压,并且节点1处的电压为电阻R2两端的电压。通过使用ADC测出节点1处的电压,即可得到电阻R2的阻值,从而区分出电池型号和/或厂家。In FIG3C , current can flow out of GPIO1, and flow to GND through resistors R1 and R2 in sequence. Since one end of resistor R2 is grounded, the voltage corresponding to the high level output by pin GPIO1 is the total voltage of resistors R2 and R1, and the voltage at node 1 is the voltage across resistor R2. By using ADC to measure the voltage at node 1, the resistance value of resistor R2 can be obtained, thereby distinguishing the battery model and/or manufacturer.
示例性地,以上述图3C为例,公式(一)和公式(二)示出了本申请提及的电阻R2的阻值的计算方法:For example, taking FIG. 3C as an example, formula (I) and formula (II) show the calculation method of the resistance value of the resistor R2 mentioned in the present application:
(一) (one)
其中,V是引脚GPIO1输出的高电平所对应的电压;R2是电阻R2的阻值;R1是电阻R1的阻值;V1是测出的节点1处的电压值,即电阻R2两端的电压;V/(R2+R1)表示电阻R2和电阻R1电路路径的电流;V1/R2表示通过电阻R2的电流。Among them, V is the voltage corresponding to the high level output by pin GPIO1; R2 is the resistance value of resistor R2; R1 is the resistance value of resistor R1; V1 is the measured voltage value at node 1, that is, the voltage across resistor R2; V/(R2+R1) represents the current in the circuit path of resistor R2 and resistor R1; V1/R2 represents the current passing through resistor R2.
基于上述公式(一)即可计算出电阻R2的阻值,如公式(二)所示:Based on the above formula (I), the resistance value of resistor R2 can be calculated, as shown in formula (II):
(二) (two)
其中,R2是电阻R2的阻值;V1是测出的节点1处的电压值,即电阻R2两端的电压;R1是电阻R1的阻值;V是引脚GPIO1输出的高电平所对应的电压。Among them, R2 is the resistance value of resistor R2; V1 is the measured voltage value at node 1, that is, the voltage across resistor R2; R1 is the resistance value of resistor R1; V is the voltage corresponding to the high level output by pin GPIO1.
应理解,不同型号和/或厂家的电池中的电阻R2具有不同的阻值,当确定出电阻R2的阻值后,即可识别出电池的厂家。It should be understood that the resistor R2 in batteries of different models and/or manufacturers has different resistance values. Once the resistance value of the resistor R2 is determined, the manufacturer of the battery can be identified.
在另一些实施例中,开关模块106具有断开和闭合状态,可以包括但不限于,一个或多个晶体管、一个或多个可控开关等电子元件。分压模块107中可以包括但不限于一个或多个电阻、开关等电子元件;输入模块108中可以包括但不限于GPIO管脚、串行通信接口等任意可以输出高电平或低电平的电子元件。本申请对此不做限定。In other embodiments, the switch module 106 has an open and closed state, and may include, but is not limited to, one or more transistors, one or more controllable switches and other electronic components. The voltage divider module 107 may include, but is not limited to, one or more resistors, switches and other electronic components; the input module 108 may include, but is not limited to, any electronic component that can output a high level or a low level, such as a GPIO pin, a serial communication interface, etc. This application does not limit this.
如此,基于上述电池检测电路,可以实现对电池新旧和电池型号、电池厂家的识别。进而,可以根据不同的充电策略和充电参数对电池充电。例如,对于新电池的充电总容量高于对于旧电池的充电总容量。Thus, based on the battery detection circuit, the newness and oldness of the battery, the battery model, and the battery manufacturer can be identified. Furthermore, the battery can be charged according to different charging strategies and charging parameters. For example, the total charging capacity for a new battery is higher than the total charging capacity for an old battery.
可以理解,本申请上述电池检测电路可以应用于电子设备,其中,电子设备可以为手机、平板电脑、笔记本电脑、可穿戴设备(例如包括:手表、智能指环、手环、计步器等)、汽车、物联网(internet of things,IOT)设备(例如包括:体重秤、烤箱等)、智能门锁等内嵌电池的任意电子设备,本申请实施例中对电子设备的形态不做具体限定。It can be understood that the above-mentioned battery detection circuit of the present application can be applied to electronic devices, wherein the electronic device can be any electronic device with a built-in battery, such as a mobile phone, a tablet computer, a laptop computer, a wearable device (for example, including: a watch, a smart ring, a bracelet, a pedometer, etc.), a car, an Internet of Things (IoT) device (for example, including: a weight scale, an oven, etc.), a smart door lock, etc. The form of the electronic device is not specifically limited in the embodiments of the present application.
对应地,基于上述电池检测电路,本申请实施例还提供了一种电池检测方法。在本申请的方法中,在到达检测周期或检测到电池接口有插拔电池操作时,会触发电子设备执行电池检测方法。首先,电子设备会控制开关模块断开,并且控制输入模块输出低电平,通过获取电压检测模块检测到的电压值识别出电池的新旧。接下来,电子设备会控制开关模块闭合,并且控制输入模块输出高电平,通过获取电压检测模块检测到的电压值,得到电池标识模块的阻值,从而识别出电池的型号和/或厂家。Correspondingly, based on the above-mentioned battery detection circuit, an embodiment of the present application also provides a battery detection method. In the method of the present application, when the detection cycle is reached or the battery interface is detected to have a battery plugging and unplugging operation, the electronic device will be triggered to execute the battery detection method. First, the electronic device will control the switch module to disconnect, and control the input module to output a low level, and identify the newness of the battery by obtaining the voltage value detected by the voltage detection module. Next, the electronic device will control the switch module to close, and control the input module to output a high level, and obtain the voltage value detected by the voltage detection module to obtain the resistance value of the battery identification module, thereby identifying the model and/or manufacturer of the battery.
在一些实施例中,如图2B所示,检测电路400中可以包括开关模块106、分压模块107、以及输入模块108。In some embodiments, as shown in FIG. 2B , the detection circuit 400 may include a switch module 106 , a voltage divider module 107 , and an input module 108 .
下面基于图4所示的流程示意图,对本申请实施例提及的电池检测方法进行简单介绍。The following is a brief introduction to the battery detection method mentioned in the embodiment of the present application based on the flow chart shown in FIG. 4 .
具体地,该电池检测方法可以由电子设备执行,方法包括如下步骤:Specifically, the battery detection method can be performed by an electronic device, and the method includes the following steps:
S401:检测到电池检测指令。S401: A battery detection instruction is detected.
可以理解,本申请实施例中,检测到电池检测的指令可以包括:到达检测周期(如,每间隔5天进行一次检测),检测到电子设备重启,或检测到电池的电池对电池(battery tobattery,BTB)具有插拔电池的操作,本申请实施例对此不做限定。其中,BTB是一种电池连接接口,可以检测到电池是否被插入或拔出。It is understood that in the embodiment of the present application, the instruction for detecting the battery detection may include: reaching the detection cycle (e.g., performing a detection every 5 days), detecting that the electronic device is restarted, or detecting that the battery has a battery-to-battery (BTB) operation of plugging and unplugging the battery, which is not limited in the embodiment of the present application. Among them, the BTB is a battery connection interface that can detect whether the battery is inserted or unplugged.
在本申请实施例中,电池检测指令可以分为识别电池新旧的指令和识别电池厂家的指令。In the embodiment of the present application, the battery detection instruction can be divided into an instruction for identifying the newness of the battery and an instruction for identifying the battery manufacturer.
S402:控制开关模块断开。S402: Control the switch module to disconnect.
可以理解,本申请实施例中,在接收到识别电池新旧的电池检测指令后,首先电子设备的处理器会控制开关模块断开,此时开关模块处于断开状态。It can be understood that in the embodiment of the present application, after receiving the battery detection instruction for identifying whether the battery is new or old, the processor of the electronic device will first control the switch module to disconnect, and the switch module is in the disconnected state.
在一些实施例中,开关模块可以包括MOS管,MOS管的开关状态可以通过GPIO引脚控制。其中,GPIO引脚可以接入电子设备的主板的输入输出接口上,通过电子设备的处理器控制GPIO引脚输出高电平或低电平。同时,GPIO引脚还与MOS管连接,当GPIO引脚输出低电平时,MOS管接收到低电平会处于断开状态。In some embodiments, the switch module may include a MOS tube, and the switch state of the MOS tube may be controlled by a GPIO pin. The GPIO pin may be connected to the input and output interface of the mainboard of the electronic device, and the GPIO pin may be controlled by the processor of the electronic device to output a high level or a low level. At the same time, the GPIO pin is also connected to the MOS tube, and when the GPIO pin outputs a low level, the MOS tube receives the low level and is in a disconnected state.
S403:控制输入模块输出低电平。S403: Control the input module to output a low level.
可以理解,本申请实施例中,可以通过电子设备的处理器,控制输入模块向电池检测电路输出低电平(即0V)。It can be understood that in the embodiment of the present application, the processor of the electronic device can be used to control the input module to output a low level (ie, 0V) to the battery detection circuit.
在一些实施例中,输入模块可以为GPIO引脚,其中,GPIO引脚可以接入电子设备的主板的输入输出接口上,可以通过电子设备的处理器,控制GPIO引脚向电池检测电路输出高电平或低电平。In some embodiments, the input module may be a GPIO pin, wherein the GPIO pin may be connected to an input/output interface of a motherboard of an electronic device, and the processor of the electronic device may control the GPIO pin to output a high level or a low level to the battery detection circuit.
应理解,本申请对步骤S402和步骤S403的顺序不做限定,即可以先执行步骤S402,再执行步骤S403;或者,可以先执行步骤S403,再执行步骤S402;又或者,可以同时执行步骤S402和步骤S403。It should be understood that the present application does not limit the order of step S402 and step S403, that is, step S402 may be executed first, and then step S403; or, step S403 may be executed first, and then step S402; or, step S402 and step S403 may be executed simultaneously.
S404:获取电压检测模块检测到的第一电压值。S404: Acquire a first voltage value detected by the voltage detection module.
可以理解,本申请实施例中,可以通过处理器直接读取电压检测模块检测到的第一电压值。It can be understood that in the embodiment of the present application, the first voltage value detected by the voltage detection module can be directly read by the processor.
在一些实施例中,电压检测模块可以为电子设备中的ADC,处理器可以直接读取ADC的电压值。In some embodiments, the voltage detection module may be an ADC in an electronic device, and the processor may directly read the voltage value of the ADC.
在一些实施例中,参考上述图2B所示,当通过步骤S402控制开关模块106处于断开状态,以及通过步骤S403控制输入模块108输出低电平后,电路结构可以如图2C所示,电流从电池300的正极依次经过熔断模块105、标识模块104流向电压检测模块500。通过读取电压检测模块500上的电压值,可以确定出电池300的新旧。In some embodiments, referring to FIG. 2B , when the switch module 106 is controlled to be in an off state through step S402, and the input module 108 is controlled to output a low level through step S403, the circuit structure may be as shown in FIG. 2C , where the current flows from the positive electrode of the battery 300 through the fuse module 105 and the identification module 104 to the voltage detection module 500 in sequence. By reading the voltage value on the voltage detection module 500, the newness of the battery 300 can be determined.
S405:判断第一电压值是否处于第一电压范围区间。若是,则进入S406;若否,则进入S407。S405: Determine whether the first voltage value is within the first voltage range. If yes, proceed to S406; if no, proceed to S407.
可以理解,本申请实施例中,若电压检测模块检测到的第一电压值处于第一电压范围区间,则转至步骤S406,确定该电池为新电池;若电压检测模块检测到的第一电压值不在第一电压范围区间内,则转至步骤S407,确定该电池为旧电池。It can be understood that in the embodiment of the present application, if the first voltage value detected by the voltage detection module is within the first voltage range, then go to step S406 to determine that the battery is a new battery; if the first voltage value detected by the voltage detection module is not within the first voltage range, then go to step S407 to determine that the battery is an old battery.
在一些实施例中,第一电压范围区间可以为多个电压范围区间的集合,其中,第一电压范围区间基于多个未使用的电池在节点1处的电压值设置,例如,若存在三种型号电池,其中,未使用的型号A在节点1处的电压为[2.8V,3V],未使用的型号B在节点1处的电压为[3.1V,3.2V],未使用的型号C在节点1处的电压为[2.7V,2.9V],则第一电压范围区间可以为{[2.7V,2.9V],[2.8V,3V],[3.1V,3.2V]},若节点1处的电压值处于任意一个电压区间内,则确定电池为新电池;若节点1处的电压值低于所有的电压区间,则确定电池为旧电池。In some embodiments, the first voltage range interval may be a set of multiple voltage range intervals, wherein the first voltage range interval is set based on the voltage values of multiple unused batteries at node 1. For example, if there are three types of batteries, wherein the voltage of the unused model A at node 1 is [2.8V, 3V], the voltage of the unused model B at node 1 is [3.1V, 3.2V], and the voltage of the unused model C at node 1 is [2.7V, 2.9V], then the first voltage range interval may be {[2.7V, 2.9V], [2.8V, 3V], [3.1V, 3.2V]}. If the voltage value at node 1 is within any voltage interval, the battery is determined to be a new battery; if the voltage value at node 1 is lower than all voltage intervals, the battery is determined to be an old battery.
S406:确定为新电池。S406: Determine that the battery is a new one.
可以理解,本申请实施例中,当第一电压值处于第一电压范围区间时,可以将电池确定为新电池,在对电池充电时的充电总容量较大。It can be understood that in the embodiment of the present application, when the first voltage value is within the first voltage range, the battery can be determined as a new battery, and the total charging capacity when charging the battery is large.
S407:确定为旧电池。S407: Determine that the battery is old.
可以理解,本申请实施例中,当第一电压值较小时,例如,低于预设的第一电压范围区间,可以将电池确定为旧电池,对电池进行充电时的充电总容量较小。It can be understood that in the embodiment of the present application, when the first voltage value is small, for example, lower than the preset first voltage range, the battery can be determined as an old battery, and the total charging capacity when charging the battery is small.
S408:控制开关模块闭合。S408: Control the switch module to close.
可以理解,本申请实施例中,在接收到识别电池型号和/或厂家的电池检测指令后,需要控制开关模块闭合。It can be understood that in the embodiment of the present application, after receiving a battery detection instruction for identifying the battery model and/or manufacturer, the switch module needs to be controlled to close.
在一些实施例中,参考上述图2B所示,在闭合开关模块106后,电流从电池300的正极依次经过熔断模块105、开关模块106流向大地。在一些情况下,开关模块106的阻值可以忽略不计,由于电流过大,会触发熔断模块105的保护机制,导致熔断模块105处于断开状态。In some embodiments, referring to FIG. 2B , after the switch module 106 is closed, the current flows from the positive electrode of the battery 300 to the ground through the fuse module 105 and the switch module 106. In some cases, the resistance of the switch module 106 can be ignored, and the protection mechanism of the fuse module 105 is triggered due to excessive current, causing the fuse module 105 to be in an open state.
S409:控制输入模块输出高电平。S409: Control the input module to output a high level.
可以理解,在本申请实施例中,可以通过处理器控制输入模块向电池检测电路输出高电平。It can be understood that in the embodiment of the present application, the processor can control the input module to output a high level to the battery detection circuit.
应理解,本申请对步骤S408和步骤S409的顺序不做限定,即可以先执行步骤S408,再执行步骤S409;或者,可以先执行步骤S409,再执行步骤S408;又或者,可以同时执行步骤S408和步骤S409。It should be understood that the present application does not limit the order of step S408 and step S409, that is, step S408 can be executed first, and then step S409; or, step S409 can be executed first, and then step S408; or, step S408 and step S409 can be executed at the same time.
S410:获取电压检测模块检测到的第二电压值。S410: Acquire a second voltage value detected by a voltage detection module.
可以理解,在本申请实施例中,电压检测模块检测到的第二电压值即为电池标识模块的电压值。其中,电压检测模块可以为电子设备的ADC,处理器可以直接读取ADC检测到的电压值。It can be understood that in the embodiment of the present application, the second voltage value detected by the voltage detection module is the voltage value of the battery identification module. The voltage detection module can be an ADC of the electronic device, and the processor can directly read the voltage value detected by the ADC.
其中,参考上述图2B所示,当通过步骤S408控制开关模块106闭合,以及通过步骤S409控制输入模块108输出高电平后,熔断模块105会断开。在一些情况下,开关模块106的阻值可以忽略,电流从电池300的正极依次经过熔断模块105、开关模块106流向大地,由于电流过大,会触发熔断模块105的保护机制,导致熔断模块105处于断开状态。此时,电路可以如图2D所示,处理模块600通过读取电压检测模块500的电压值,可以得到标识模块104的阻值,由于各型号和/或厂家的电池中标识模块104的阻值均不同,因此基于得到的标识模块104的阻值可以确定出电池300的型号和/或厂家。Wherein, referring to FIG. 2B , when the switch module 106 is controlled to be closed through step S408 and the input module 108 is controlled to output a high level through step S409, the fuse module 105 will be disconnected. In some cases, the resistance of the switch module 106 can be ignored, and the current flows from the positive electrode of the battery 300 to the ground through the fuse module 105 and the switch module 106 in sequence. Due to the excessive current, the protection mechanism of the fuse module 105 will be triggered, causing the fuse module 105 to be in a disconnected state. At this time, the circuit can be as shown in FIG. 2D , and the processing module 600 can obtain the resistance of the identification module 104 by reading the voltage value of the voltage detection module 500. Since the resistance of the identification module 104 in batteries of different models and/or manufacturers is different, the model and/or manufacturer of the battery 300 can be determined based on the obtained resistance of the identification module 104.
S411:基于第二电压值,计算标识模块的阻值。S411: Calculate the resistance value of the identification module based on the second voltage value.
在一些实施例中,如图2D所示,输入模块108输出的高电平所对应的电压为分压模块107和标识模块104的总电压;分压模块107的电阻为已知阻值;第二电压值为标识模块104的电压。基于串联回路中电流处处相等的规律,即可得到标识模块104的阻值。In some embodiments, as shown in FIG2D , the voltage corresponding to the high level output by the input module 108 is the total voltage of the voltage divider module 107 and the identification module 104; the resistance of the voltage divider module 107 is a known resistance; and the second voltage value is the voltage of the identification module 104. Based on the rule that the current in the series circuit is equal everywhere, the resistance value of the identification module 104 can be obtained.
在一些实施例中,如图2D所示,处理模块600可以基于输入模块108输出的高电平所对应的电压、分压模块107的阻值、检测到的标识模块104端的第二电压,得到通过标识模块104的电流,然后基于电流和第二电压,确定出标识模块104的阻值。In some embodiments, as shown in FIG. 2D , the processing module 600 can obtain the current passing through the identification module 104 based on the voltage corresponding to the high level output by the input module 108, the resistance value of the voltage divider module 107, and the second voltage detected at the end of the identification module 104, and then determine the resistance value of the identification module 104 based on the current and the second voltage.
S412:基于标识模块的阻值,识别出电池的型号或厂家。S412: Identify the model or manufacturer of the battery based on the resistance value of the identification module.
可以理解,本申请实施例中,不同类型和/或厂家的电池中的标识模块具有不同的阻值,当确定出标识模块的阻值后,即可识别出电池的型号和/或厂家。It can be understood that in the embodiment of the present application, the identification modules in batteries of different types and/or manufacturers have different resistance values. After the resistance value of the identification module is determined, the model and/or manufacturer of the battery can be identified.
S413:执行充电策略。S413: Execute charging strategy.
可以理解,本申请实施例中,在识别出电池新旧、电池型号和/或电池厂家后,可以执行对应的充电策略。例如,选择对应电池厂家的充电参数进行充电;同时,在对电池进行充电时,对新电池充电的总容量大于对旧电池充电的总容量。It can be understood that in the embodiment of the present application, after identifying the age of the battery, the battery model and/or the battery manufacturer, the corresponding charging strategy can be executed. For example, the charging parameters of the corresponding battery manufacturer are selected for charging; at the same time, when charging the battery, the total capacity charged to the new battery is greater than the total capacity charged to the old battery.
如此,基于上述电池检测方法,可以实现对电池新旧和电池型号、电池厂家的识别。进而,可以根据不同的充电策略和充电参数对电池充电。Thus, based on the above battery detection method, the age, model and manufacturer of the battery can be identified, and the battery can be charged according to different charging strategies and charging parameters.
下面结合上述图3A示出的具体电池检测电路,基于图5所示的流程示意图,对本申请提及的电池检测方法进行具体介绍。In the following, in combination with the specific battery detection circuit shown in FIG. 3A above, based on the flow chart shown in FIG. 5 , the battery detection method mentioned in the present application is specifically introduced.
具体地,图5所示流程图中的各电路元件均参照上述图3A示出的电池检测电路,且该电池检测方法可以由电子设备执行,方法包括如下步骤:Specifically, each circuit element in the flowchart shown in FIG5 refers to the battery detection circuit shown in FIG3A above, and the battery detection method can be executed by an electronic device, and the method includes the following steps:
S501:检测到电池检测指令。S501: A battery detection instruction is detected.
可以理解,本申请实施例中,检测到电池检测的指令可以包括:到达检测周期(如,每间隔5天进行一次检测),检测到电子设备重启,或检测到电池BTB具有插拔电池的操作等,本申请实施例对此不做限定。It can be understood that in the embodiment of the present application, the instructions for detecting battery detection may include: reaching the detection cycle (for example, performing a detection every 5 days), detecting that the electronic device is restarted, or detecting that the battery BTB has an operation of plugging and unplugging the battery, etc. The embodiment of the present application is not limited to this.
S502:控制引脚GPIO2输出低电平断开MOS晶体管T1,控制引脚GPIO1输出低电平。S502: Control pin GPIO2 outputs a low level to disconnect MOS transistor T1, and control pin GPIO1 outputs a low level.
可以理解,本申请实施例中,引脚GPIO2可以连接电子设备的电路板(如,主板)的输入输出接口,在处理器控制引脚GPIO2向MOS晶体管T1的栅极引脚N3输出低电平时,MOS晶体管T1会处于断开状态,电流无法从漏极引脚N2流向源极引脚N1。It can be understood that in the embodiment of the present application, pin GPIO2 can be connected to the input and output interface of the circuit board (such as the mainboard) of the electronic device. When the processor controls pin GPIO2 to output a low level to the gate pin N3 of the MOS transistor T1, the MOS transistor T1 will be in a disconnected state, and the current cannot flow from the drain pin N2 to the source pin N1.
在一些实施例中,引脚GPIO1可以连接电子设备的电路板(如,主板)的输入输出接口,通过处理器控制引脚GPIO1可以向电池检测电路输出低电平。In some embodiments, the pin GPIO1 may be connected to an input/output interface of a circuit board (eg, a mainboard) of an electronic device, and the pin GPIO1 may be controlled by a processor to output a low level to a battery detection circuit.
S503:判断节点1处的第一电压值是否处于第一电压区间。若是,则进入S504;若否,则进入S510。S503: Determine whether the first voltage value at node 1 is in the first voltage interval. If yes, proceed to S504; if no, proceed to S510.
可以理解,本申请实施例中,节点1与电子设备的ADC连接,处理器通过读取ADC的电压值,即可检测到节点1处的第一电压值。其中,若第一电压值处于第一电压区间,则转至S504,控制引脚GPIO2输出高电平闭合MOS晶体管T1,烧断保险丝F1;若第一电压值未处于第一电压区间,则转至S510,判断节点1处的第一电压值是否处于第三电压区间。It can be understood that in the embodiment of the present application, node 1 is connected to the ADC of the electronic device, and the processor can detect the first voltage value at node 1 by reading the voltage value of the ADC. If the first voltage value is in the first voltage range, the process goes to S504, and the control pin GPIO2 outputs a high level to close the MOS transistor T1 and blow the fuse F1; if the first voltage value is not in the first voltage range, the process goes to S510 to determine whether the first voltage value at node 1 is in the third voltage range.
在一些实施例中,第一电压区间可以基于多个未使用的电池在节点1处的电压值设置,例如,若存在三种型号电池,其中,未使用的型号A在节点1处的电压为[2.8V,3V],未使用的型号B在节点1处的电压为[3.1V,3.2V],未使用的型号C在节点1处的电压为[2.7V,2.9V],若节点1处的第一电压值处于任意一个电压区间,则转至S504;若节点1处的第一电压值不在任意一个电压区间内,则转至S510。In some embodiments, the first voltage interval can be set based on the voltage values of multiple unused batteries at node 1. For example, if there are three types of batteries, among which the voltage of unused type A at node 1 is [2.8V, 3V], the voltage of unused type B at node 1 is [3.1V, 3.2V], and the voltage of unused type C at node 1 is [2.7V, 2.9V], if the first voltage value at node 1 is within any voltage interval, go to S504; if the first voltage value at node 1 is not within any voltage interval, go to S510.
在一些实施例中,当通过步骤S502控制引脚GPIO2输出低电平断开MOS晶体管T1,且控制引脚GPIO1输出低电平后,MOS晶体管T1处于断开状态,且电流不会通过电阻R3。此时,等效电路结构图可以如图3B所示,电流从电池的正极依次流向保险丝F1、电阻R2以及电阻R1,通过电子设备的ADC可以测得节点1处的电压值。In some embodiments, when the control pin GPIO2 outputs a low level to disconnect the MOS transistor T1 through step S502, and the control pin GPIO1 outputs a low level, the MOS transistor T1 is in a disconnected state, and the current does not pass through the resistor R3. At this time, the equivalent circuit structure diagram can be shown in Figure 3B, and the current flows from the positive electrode of the battery to the fuse F1, the resistor R2, and the resistor R1 in sequence, and the voltage value at the node 1 can be measured by the ADC of the electronic device.
S504:控制引脚GPIO2输出高电平闭合MOS晶体管T1,烧断保险丝F1。S504: Control pin GPIO2 to output a high level to close MOS transistor T1 and blow fuse F1.
可以理解,本申请实施例中,在确定出节点1处的第一电压值处于第一电压区间后,还需要通过烧断保险丝F1,确认电池是否为标准电池。It can be understood that in the embodiment of the present application, after determining that the first voltage value at the node 1 is in the first voltage interval, it is also necessary to confirm whether the battery is a standard battery by blowing the fuse F1.
在一些实施例中,在控制引脚GPIO2向MOS晶体管T1的栅极引脚N3输出高电平时,使得MOS晶体管T1处于闭合状态,其中MOS晶体管T1闭合时,电流可以从漏极引脚N2流向源极引脚N1,且MOS晶体管T1的阻值可以忽略不计,则电流从电池的正极直接经过保险丝F1流向GND,由于电流过大导致保险丝F1烧断。In some embodiments, when the control pin GPIO2 outputs a high level to the gate pin N3 of the MOS transistor T1, the MOS transistor T1 is in a closed state. When the MOS transistor T1 is closed, current can flow from the drain pin N2 to the source pin N1, and the resistance of the MOS transistor T1 can be ignored. Then, the current flows directly from the positive electrode of the battery through the fuse F1 to GND, and the fuse F1 is blown due to the excessive current.
S505:判断节点1处的第二电压值是否处于第二电压区间。若否,则进入S506;若是,则进入S507。S505: Determine whether the second voltage value at node 1 is in the second voltage interval. If not, proceed to S506; if yes, proceed to S507.
可以理解,本申请实施例中,如图3A所示,在通过上述步骤S504烧断保险丝F1后,且上述步骤S502中控制引脚GPIO1输出低电平,此时电池检测电路中无电流通过。若判断出节点1处的第二电压值处于第二电压区间,则转至S507,确定为新电池,并清除存储的电池充放电循环次数;否则,转至S506,确定为非标准电池。It can be understood that in the embodiment of the present application, as shown in FIG3A , after the fuse F1 is blown through the above step S504, and the control pin GPIO1 outputs a low level in the above step S502, no current flows through the battery detection circuit at this time. If it is determined that the second voltage value at the node 1 is in the second voltage interval, then go to S507 to determine that it is a new battery and clear the stored number of battery charge and discharge cycles; otherwise, go to S506 to determine that it is a non-standard battery.
应理解,在通过上述步骤S504烧断保险丝后,节点1处的第二电压值可以为0V,因此,第二电压区间可以设置为较小的电压范围,如[0V,0.1V],本申请对此不做限定。It should be understood that after the fuse is blown through the above step S504, the second voltage value at node 1 can be 0V, so the second voltage interval can be set to a smaller voltage range, such as [0V, 0.1V], which is not limited in this application.
S506:确定为非标准电池。S506: Determine that the battery is a non-standard battery.
可以理解,本申请实施例中,若第一电压值处于较大的电压范围内,在烧断保险丝F1后,测得节点1处的第二电压值仍处于较大的电压范围,表示电池在烧断保险丝F1的情况下仍然可以向ADC供电,则该电池为非标准电池。It can be understood that in the embodiment of the present application, if the first voltage value is within a larger voltage range, after the fuse F1 is blown, the second voltage value measured at the node 1 is still within a larger voltage range, indicating that the battery can still supply power to the ADC when the fuse F1 is blown, then the battery is a non-standard battery.
在一些实施例中,在通过上述步骤S504烧断保险丝F1后,表示切断了电池与电子设备ADC间的电路路径,处理器读取到的ADC的第二电压值应该为0V,若第二电压值高于0V,表示电池不符合安全条件,为非标准电池。In some embodiments, after the fuse F1 is blown through the above step S504, it means that the circuit path between the battery and the ADC of the electronic device is cut off, and the second voltage value of the ADC read by the processor should be 0V. If the second voltage value is higher than 0V, it means that the battery does not meet the safety conditions and is a non-standard battery.
S507:确定为新电池,并清除存储的电池充放电循环次数。S507: Determine that the battery is a new battery, and clear the stored number of battery charge and discharge cycles.
可以理解,本申请实施例中,在通过上述步骤S503确定出第一电压值处于第一电压区间,且通过步骤S505确定出第二电压值处于第二电压区间,则确定出该电池为标准新电池。It can be understood that in the embodiment of the present application, when it is determined through the above step S503 that the first voltage value is in the first voltage interval, and it is determined through step S505 that the second voltage value is in the second voltage interval, it is determined that the battery is a standard new battery.
在一些实施例中,电子设备中存储的电池充放电循环次数,为更换新电池之前的旧电池的充放电循环次数,若确定出电子设备中当前内嵌的电池为新电池时,可以将存储的电池充放电循环次数清零。In some embodiments, the number of battery charge and discharge cycles stored in the electronic device is the number of charge and discharge cycles of the old battery before the new battery is replaced. If it is determined that the battery currently embedded in the electronic device is a new battery, the stored number of battery charge and discharge cycles can be cleared.
S508:控制引脚GPIO2输出高电平闭合MOS晶体管T1,控制引脚GPIO1输出高电平。S508: Control pin GPIO2 outputs a high level to close MOS transistor T1, and control pin GPIO1 outputs a high level.
可以理解,本申请实施例中,在识别出电池为新电池后,还需对电池厂家进行识别。其中,在识别电池厂家的过程中,可以控制引脚GPIO2向MOS晶体管T1的栅极引脚N3输出高电平,使得MOS晶体管T1处于闭合状态;同时,控制引脚GPIO1向电池检测电路输出高电平。It can be understood that in the embodiment of the present application, after identifying that the battery is a new battery, the battery manufacturer needs to be identified. In the process of identifying the battery manufacturer, the control pin GPIO2 can output a high level to the gate pin N3 of the MOS transistor T1, so that the MOS transistor T1 is in a closed state; at the same time, the control pin GPIO1 outputs a high level to the battery detection circuit.
S509:检测节点1处的第三电压值,并计算电阻R2的阻值识别出电池厂家。S509: Detect the third voltage value at the node 1, and calculate the resistance value of the resistor R2 to identify the battery manufacturer.
可以理解,本申请实施例中,在通过步骤S508控制引脚GPIO2输出高电平闭合MOS晶体管T1时,MOS晶体管T1闭合时,电流可以从漏极引脚N2流向源极引脚N1,且MOS晶体管T1的阻值可以忽略不计,则电流从电池的正极直接经过保险丝F1流向GND,由于电流过大保险丝F1会烧断。同时,控制引脚GPIO1向电池检测电路输出高电平。此时,等效电路结构图可以如图3C所示,通过检测节点1处的第三电压值,基于上述公式(一)和公式(二)可得到电阻R2的阻值。It can be understood that in the embodiment of the present application, when the control pin GPIO2 outputs a high level to close the MOS transistor T1 through step S508, when the MOS transistor T1 is closed, the current can flow from the drain pin N2 to the source pin N1, and the resistance of the MOS transistor T1 can be ignored, then the current flows directly from the positive electrode of the battery through the fuse F1 to GND, and the fuse F1 will burn out due to excessive current. At the same time, the control pin GPIO1 outputs a high level to the battery detection circuit. At this time, the equivalent circuit structure diagram can be shown in Figure 3C, and the resistance of the resistor R2 can be obtained based on the above formula (I) and formula (II) by detecting the third voltage value at the node 1.
应理解,不同电池厂家的电池中的电阻R2具有不同的阻值,当确定出电阻R2的阻值后,即可识别出电池的厂家。It should be understood that the resistor R2 in batteries from different battery manufacturers has different resistance values. Once the resistance value of the resistor R2 is determined, the manufacturer of the battery can be identified.
S510:判断节点1处的第一电压值是否处于第三电压区间。若否,则进入S511;若是,则进入S512。S510: Determine whether the first voltage value at node 1 is in the third voltage interval. If not, proceed to S511; if yes, proceed to S512.
可以理解,本申请实施例中,在通过上述步骤S503判断出第一电压值不在第一电压区间内后,还需要判断第一电压值是否处于第三电压区间,若是,则转至S512,确定电池为旧电池,并存储电池的充放电循环次数;若否,则转至S511,确定电池为非标准电池。It can be understood that in the embodiment of the present application, after determining that the first voltage value is not within the first voltage range through the above step S503, it is also necessary to determine whether the first voltage value is in the third voltage range. If so, go to S512 to determine that the battery is an old battery and store the number of charge and discharge cycles of the battery; if not, go to S511 to determine that the battery is a non-standard battery.
在一些实施例中,第三电压区间可以为较低的电压范围,如,[0V,1V],应理解,第三电压区间可以任意设置,本申请实施例对此不做限定。In some embodiments, the third voltage interval may be a lower voltage range, such as [0V, 1V]. It should be understood that the third voltage interval may be set arbitrarily, and the embodiments of the present application do not limit this.
S511:确定为非标准电池。S511: Determine that the battery is a non-standard battery.
可以理解,本申请实施例中,若通过上述步骤S503判断出第一电压值不在第一电压区间,且通过步骤S511判断出第一电压值不在第三电压区间,可以确定电池为非标准电池。It can be understood that in the embodiment of the present application, if it is determined through step S503 that the first voltage value is not in the first voltage interval, and it is determined through step S511 that the first voltage value is not in the third voltage interval, it can be determined that the battery is a non-standard battery.
在一些实施例中,例如,若第一电压区间为[3.8V,4V],第二电压区间为[0V,3.8V],若节点1处的电压值为4.2V,表示向ADC输出的电压过高,可能会导致电子设备过热,则电池为非标准电池。In some embodiments, for example, if the first voltage interval is [3.8V, 4V], the second voltage interval is [0V, 3.8V], if the voltage value at node 1 is 4.2V, it means that the voltage output to the ADC is too high, which may cause the electronic device to overheat, and the battery is a non-standard battery.
S512:确定为旧电池,并存储电池的充放电循环次数。S512: Determine that the battery is an old battery, and store the number of charge and discharge cycles of the battery.
可以理解,本申请实施例中,若通过上述步骤S503判断出第一电压值不在第一电压区间,且通过步骤S510判断出第一电压值处于第三电压区间,可以确定电池为标准的旧电池。It can be understood that in the embodiment of the present application, if it is determined through step S503 that the first voltage value is not in the first voltage interval, and it is determined through step S510 that the first voltage value is in the third voltage interval, it can be determined that the battery is a standard old battery.
在一些实施例中,在确定电池为旧电池后,可以存储电池的充放电循环次数,其中,每执行一次本申请提及的电池检测方法,电池的充放电循环次数增加一次。若第二次充电时,未触发电子设备执行电池检测方法(如,未达到检测周期等),可以直接采用存储的电池充放电循环次数对应的充电策略进行充电。In some embodiments, after determining that the battery is an old battery, the number of charge and discharge cycles of the battery can be stored, wherein each time the battery detection method mentioned in this application is executed, the number of charge and discharge cycles of the battery increases once. If the electronic device is not triggered to execute the battery detection method during the second charging (e.g., the detection cycle is not reached, etc.), the charging strategy corresponding to the stored number of charge and discharge cycles of the battery can be directly used for charging.
S513:控制引脚GPIO2输出高电平闭合MOS晶体管T1,控制引脚GPIO1输出高电平。S513: Control pin GPIO2 outputs a high level to close MOS transistor T1, and control pin GPIO1 outputs a high level.
可以理解,在识别出电池为标准旧电池后,还需对电池厂家进行识别。其中,在识别电池厂家的过程中,可以控制引脚GPIO2向MOS晶体管T1的栅极引脚N3输出高电平,使得MOS晶体管T1处于闭合状态;同时,控制引脚GPIO1向电池检测电路输出高电平。It can be understood that after identifying the battery as a standard old battery, the battery manufacturer needs to be identified. In the process of identifying the battery manufacturer, the pin GPIO2 can be controlled to output a high level to the gate pin N3 of the MOS transistor T1, so that the MOS transistor T1 is in a closed state; at the same time, the pin GPIO1 can be controlled to output a high level to the battery detection circuit.
S514:检测节点1处的第四电压值,并计算电阻R2的阻值识别出电池型号或厂家。S514: Detect a fourth voltage value at the node 1, and calculate the resistance value of the resistor R2 to identify the battery model or manufacturer.
可以理解,本申请实施例中,在通过步骤S513控制引脚GPIO2输出高电平闭合MOS晶体管T1时,MOS晶体管T1闭合时,电流可以从漏极引脚N2流向源极引脚N1,且MOS晶体管T1的阻值可以忽略不计,则电流从电池的正极直接经过保险丝F1流向GND,由于电流过大保险丝F1会烧断。同时,控制引脚GPIO1向电池检测电路输出高电平。此时,等效电路结构图可以如图3C所示,通过检测节点1处的第四电压值,基于上述公式(一)和公式(二)可得到电阻R2的阻值。It can be understood that in the embodiment of the present application, when the control pin GPIO2 outputs a high level to close the MOS transistor T1 through step S513, when the MOS transistor T1 is closed, the current can flow from the drain pin N2 to the source pin N1, and the resistance of the MOS transistor T1 can be ignored, then the current flows directly from the positive electrode of the battery through the fuse F1 to GND, and the fuse F1 will burn out due to excessive current. At the same time, the control pin GPIO1 outputs a high level to the battery detection circuit. At this time, the equivalent circuit structure diagram can be shown in Figure 3C, and the resistance of the resistor R2 can be obtained based on the above formula (I) and formula (II) by detecting the fourth voltage value at the node 1.
应理解,不同型号和/或厂家的电池中的电阻R2具有不同的阻值,当确定出电阻R2的阻值后,即可识别出电池的型号和/或厂家。It should be understood that the resistor R2 in batteries of different models and/or manufacturers has different resistance values. Once the resistance value of the resistor R2 is determined, the model and/or manufacturer of the battery can be identified.
S515:执行充电策略。S515: Execute the charging strategy.
可以理解,本申请实施例中,在识别出电池新旧和电池型号、厂家后,可以执行对应的充电策略。例如,选择对应电池厂家的充电参数进行充电;同时,在对电池进行充电时,对新电池充电的总容量大于对旧电池充电的总容量。It can be understood that in the embodiment of the present application, after identifying the age, model and manufacturer of the battery, a corresponding charging strategy can be executed. For example, the charging parameters of the corresponding battery manufacturer are selected for charging; at the same time, when charging the battery, the total capacity charged to the new battery is greater than the total capacity charged to the old battery.
如此,基于上述电池检测方法,可以实现对电池新旧和电池型号、电池厂家的识别。进而,可以根据不同的充电策略和充电参数对电池充电。Thus, based on the above battery detection method, the age, model and manufacturer of the battery can be identified, and the battery can be charged according to different charging strategies and charging parameters.
本申请实施例还提供了一种电子设备,其中,电子设备中包括上述提及的电池检测电路。An embodiment of the present application further provides an electronic device, wherein the electronic device includes the battery detection circuit mentioned above.
此外,该电子设备还包括:电池;电池检测电路,电池检测电路包括处理模块;存储器,存储器用于存储电子设备的一个或多个处理器执行的指令,至少一个处理器包括在处理模块中,用于本申请提及的电池检测方法。In addition, the electronic device also includes: a battery; a battery detection circuit, the battery detection circuit includes a processing module; a memory, the memory is used to store instructions executed by one or more processors of the electronic device, at least one processor is included in the processing module, and is used for the battery detection method mentioned in this application.
本申请实施例还提供了一种可读存储介质,其中,该可读存储介质上存储有指令,指令在电子设备上执行时使得电子设备执行本申请提及的电池检测方法。An embodiment of the present application further provides a readable storage medium, wherein the readable storage medium stores instructions, and when the instructions are executed on an electronic device, the electronic device executes the battery detection method mentioned in the present application.
本申请实施例还提供了一种计算机程序产品,包括:非易失性计算机可读存储介质,非易失性计算机可读存储介质包含用于执行本申请提及的电池检测方法。An embodiment of the present application further provides a computer program product, including: a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium contains a program for executing the battery detection method mentioned in the present application.
可以理解,本申请上述电池检测电路和电池检测方法可以应用于电子设备,其中,电子设备可以为手机、平板电脑、笔记本电脑、可穿戴设备(例如包括:手表、智能指环、手环、计步器等)、汽车、物联网(internet of things,IOT)设备(例如包括:体重秤、烤箱等)、智能门锁等安装电池的任意电子设备,本申请实施例中对电子设备的形态不做具体限定。It can be understood that the above-mentioned battery detection circuit and battery detection method of the present application can be applied to electronic devices, wherein the electronic device can be any electronic device equipped with a battery, such as a mobile phone, a tablet computer, a laptop computer, a wearable device (for example, including: a watch, a smart ring, a bracelet, a pedometer, etc.), a car, an Internet of Things (IOT) device (for example, including: a weight scale, an oven, etc.), a smart door lock, etc. The form of the electronic device is not specifically limited in the embodiments of the present application.
如图6所示,以电子设备为手机100为例,示例性说明本申请的一个实施例的电子设备的硬件结构示意图。As shown in FIG6 , taking the electronic device as a mobile phone 100 as an example, a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application is exemplified.
如图6所示,手机100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,移动通信模块150,无线通信模块160,音频模块170,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriberidentification module,SIM)卡接口195等。As shown in Figure 6, the mobile phone 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, a mobile communication module 150, a wireless communication module 160, an audio module 170, 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, etc.
可以理解的是,本申请实施例示意的结构并不构成对手机100的具体限定。在本申请另一些实施例中,手机100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the mobile phone 100. In other embodiments of the present application, the mobile phone 100 may include more or fewer components than shown in the figure, or combine some components, or separate 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.
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processingunit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digitalsignal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。在本申请实施例中,处理器110可以获取ADC检测到的电压值,从而确定出电池的新旧以及电池厂家和/或型号。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 video codec, a digital signal processor (DSP), a baseband processor, and/or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated into one or more processors. In an embodiment of the present application, the processor 110 may obtain the voltage value detected by the ADC, thereby determining the age of the battery and the battery manufacturer and/or model.
在本申请实施例中,处理器110还可以为上文提及的处理模块600,可以用于控制开关模块106的开关状态,以及控制输入模块108输出高电平或低电平。In the embodiment of the present application, the processor 110 may also be the processing module 600 mentioned above, which may be used to control the switch state of the switch module 106 and control the input module 108 to output a high level or a low level.
控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。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.
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为手机100充电,也可以用于手机100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其它电子设备,例如虚拟设备等。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 mobile phone 100, and can also be used to transfer data between the mobile phone 100 and peripheral devices. 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 virtual devices, etc.
可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对手机100的结构限定。在本申请另一些实施例中,手机100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。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 mobile phone 100. In other embodiments of the present application, the mobile phone 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
电源管理模块141用于连接电池142、充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110、内部存储器121、显示屏194、摄像头193、和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量、电池循环次数、电池健康状态(漏电,阻抗)等参数。在其它一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 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.
在本申请实施例中,电源管理模块141可以向电池检测电路进行供电,如图2C所示,在进行电池142的型号和/或厂家识别时,电源管理模块141可以向输入模块108进行供电。In an embodiment of the present application, the power management module 141 can supply power to the battery detection circuit. As shown in FIG. 2C , when the model and/or manufacturer of the battery 142 is identified, the power management module 141 can supply power to the input module 108 .
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过手机100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。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 mobile phone 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.
在本申请实施例中,在确定出电池142的新旧以及电池142的厂家和/或型号后,充电管理模块140可以采用不同的充电策略为电池142充电,例如,若电池142为新电池,可以控制向电池142中充入较高的总容量;若电池142为旧电池,可以控制向电池142中充入较低的总容量。In an embodiment of the present application, after determining the age of battery 142 and the manufacturer and/or model of battery 142, the charging management module 140 can adopt different charging strategies to charge battery 142. For example, if battery 142 is a new battery, a higher total capacity can be controlled to be charged into battery 142; if battery 142 is an old battery, a lower total capacity can be controlled to be charged into battery 142.
移动通信模块150可以提供应用在手机100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(lownoise amplifier,LNA)等。移动通信模块150可以对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。The mobile communication module 150 can provide solutions for wireless communications including 2G/3G/4G/5G, etc., applied to the mobile phone 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 filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. 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.
无线通信模块160可以提供应用在手机100上的包括无线局域网(wireless localarea networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(blue tooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequencymodulation,FM),近距离无线通信技术(nearfield communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信模块的一个或多个器件。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线(图中未示出)转为电磁波辐射出去。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), nearfield communication technology (NFC), infrared technology (IR), etc., which are applied to the mobile phone 100. The wireless communication module 160 can be one or more devices integrating at least one communication module. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency, amplify it, and convert it into electromagnetic waves for radiation through the antenna (not shown in the figure).
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展手机100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。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 mobile phone 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.
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储手机100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。处理器110通过运行存储在内部存储器121的指令,和/或存储在设置于处理器中的存储器的指令,执行手机100的各种功能应用以及数据处理。The internal memory 121 can be used to store computer executable program codes, which include instructions. 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 mobile phone 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. The processor 110 executes various functional applications and data processing of the mobile phone 100 by running instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。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.
本申请公开的各实施例可以被实现在硬件、软件、固件或这些实现方法的组合中。本申请的实施例可实现为在可编程系统上执行的计算机程序或程序代码,该可编程系统包括至少一个处理器、存储系统(包括易失性和非易失性存储器和/或存储元件)、至少一个输入设备以及至少一个输出设备。The embodiments disclosed in the present application may be implemented in hardware, software, firmware or a combination of these implementation methods. The embodiments of the present application may be implemented as a computer program or program code executed on a programmable system, the programmable system including at least one processor, a storage system (including volatile and non-volatile memory and/or storage elements), at least one input device and at least one output device.
可将程序代码应用于输入指令,以执行本申请描述的各功能并生成输出信息。可以按已知方式将输出信息应用于一个或多个输出设备。为了本申请的目的,处理系统包括具有诸如例如数字信号处理器、微控制器、专用集成电路或微处理器之类的处理器的任何系统。Program code can be applied to input instructions to perform the functions described in this application and generate output information. The output information can be applied to one or more output devices in a known manner. For the purposes of this application, a processing system includes any system having a processor such as, for example, a digital signal processor, a microcontroller, an application specific integrated circuit, or a microprocessor.
程序代码可以用高级程序化语言或面向对象的编程语言来实现,以便与处理系统通信。在需要时,也可用汇编语言或机器语言来实现程序代码。事实上,本申请中描述的机制不限于任何特定编程语言的范围。在任一情形下,该语言可以是编译语言或解释语言。Program code can be implemented with high-level programming language or object-oriented programming language to communicate with the processing system. When necessary, program code can also be implemented with assembly language or machine language. In fact, the mechanism described in this application is not limited to the scope of any specific programming language. In either case, the language can be a compiled language or an interpreted language.
在附图中,可以以特定布置和/或顺序示出一些结构或方法特征。然而,应该理解,可能不需要这样的特定布置和/或排序。而是,在一些实施例中,这些特征可以以不同于说明性附图中所示的方式和/或顺序来布置。另外,在特定图中包括结构或方法特征并不意味着暗示在所有实施例中都需要这样的特征,并且在一些实施例中,可以不包括这些特征或者可以与其它特征组合。In the accompanying drawings, some structural or method features may be shown in a specific arrangement and/or order. However, it should be understood that such a specific arrangement and/or order may not be required. Instead, in some embodiments, these features may be arranged in a manner and/or order different from that shown in the illustrative drawings. In addition, the inclusion of structural or method features in a particular figure does not mean that such features are required in all embodiments, and in some embodiments, these features may not be included or may be combined with other features.
需要说明的是,本申请各设备实施例中提到的各单元/模块都是逻辑单元/模块,在物理上,一个逻辑单元/模块可以是一个物理单元/模块,也可以是一个物理单元/模块的一部分,还可以以多个物理单元/模块的组合实现,这些逻辑单元/模块本身的物理实现方式并不是最重要的,这些逻辑单元/模块所实现的功能的组合才是解决本申请所提出的技术问题的关键。此外,为了突出本申请的创新部分,本申请上述各设备实施例并没有将与解决本申请所提出的技术问题关系不太密切的单元/模块引入,这并不表明上述设备实施例并不存在其它的单元/模块。It should be noted that the units/modules mentioned in the various device embodiments of the present application are all logical units/modules. Physically, a logical unit/module can be a physical unit/module, or a part of a physical unit/module, or can be implemented as a combination of multiple physical units/modules. The physical implementation method of these logical units/modules themselves is not the most important. The combination of functions implemented by these logical units/modules is the key to solving the technical problems proposed by the present application. In addition, in order to highlight the innovative part of the present application, the above-mentioned device embodiments of the present application do not introduce units/modules that are not closely related to solving the technical problems proposed by the present application, which does not mean that there are no other units/modules in the above-mentioned device embodiments.
需要说明的是,在本专利的示例和说明书中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其它变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其它要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that in the examples and description of this patent, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "including one" do not exclude the existence of other identical elements in the process, method, article or device including the elements.
虽然通过参照本申请的某些优选实施例,已经对本申请进行了图示和描述,但本领域的普通技术人员应该明白,可以在形式上和细节上对其作各种改变,而不偏离本申请的范围。Although the present application has been illustrated and described with reference to certain preferred embodiments thereof, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the scope of the present application.
Claims (14)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311698450.8A CN117388728B (en) | 2023-12-12 | 2023-12-12 | Battery detection circuit, method and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311698450.8A CN117388728B (en) | 2023-12-12 | 2023-12-12 | Battery detection circuit, method and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN117388728A CN117388728A (en) | 2024-01-12 |
CN117388728B true CN117388728B (en) | 2024-06-07 |
Family
ID=89463502
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311698450.8A Active CN117388728B (en) | 2023-12-12 | 2023-12-12 | Battery detection circuit, method and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117388728B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117826002A (en) * | 2024-03-04 | 2024-04-05 | 荣耀终端有限公司 | Electronic device and battery testing methods |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107271917A (en) * | 2017-07-19 | 2017-10-20 | 上海鼎为电子科技(集团)有限公司 | Battery detection circuit and mobile terminal |
CN108336793A (en) * | 2018-03-23 | 2018-07-27 | 深圳奥特能电气有限公司 | A kind of battery management system and its battery pack address recognition circuit |
CN115642659A (en) * | 2021-07-20 | 2023-01-24 | 中兴通讯股份有限公司 | Battery connector state detection method, controller, terminal device, and storage medium |
CN116365079A (en) * | 2023-05-23 | 2023-06-30 | 荣耀终端有限公司 | Electronic device, method for determining whether battery is new or old, and computer-readable storage medium |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080238357A1 (en) * | 2007-03-26 | 2008-10-02 | Bourilkov Jordan T | Ultra fast battery charger with battery sensing |
US20140232326A1 (en) * | 2010-04-07 | 2014-08-21 | Black & Decker Inc. | Battery pack and charger platform for power tool systems including battery pack identification scheme |
US8829911B2 (en) * | 2011-09-16 | 2014-09-09 | Blackberry Limited | Diagnostic use of a plurality of electrical battery parameters |
-
2023
- 2023-12-12 CN CN202311698450.8A patent/CN117388728B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107271917A (en) * | 2017-07-19 | 2017-10-20 | 上海鼎为电子科技(集团)有限公司 | Battery detection circuit and mobile terminal |
CN108336793A (en) * | 2018-03-23 | 2018-07-27 | 深圳奥特能电气有限公司 | A kind of battery management system and its battery pack address recognition circuit |
CN115642659A (en) * | 2021-07-20 | 2023-01-24 | 中兴通讯股份有限公司 | Battery connector state detection method, controller, terminal device, and storage medium |
CN116365079A (en) * | 2023-05-23 | 2023-06-30 | 荣耀终端有限公司 | Electronic device, method for determining whether battery is new or old, and computer-readable storage medium |
Non-Patent Citations (3)
Title |
---|
Dynamic Battery Type Detection Using Neural Networks;Hector K. Lopez et al.;2023 IEEE 20th International Conference on Smart Communities: Improving Quality of Life using AI, Robotics and IoT (HONET);20231206;第132-136页 * |
电池管理系统充放电仿真测试系统设计;于杰 等;广西大学学报(自然科学版);20171025(第5期);第44-51页 * |
电路分析技巧片谈;阮许平;娄底师专学报;19970630(第2期);第64-73页 * |
Also Published As
Publication number | Publication date |
---|---|
CN117388728A (en) | 2024-01-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9484759B2 (en) | Method for detecting a type of charger coupled to an input-output circuit and input-output circuit therefor | |
JP5717005B2 (en) | Method and terminal for selecting an internal circuit according to the status of a USB interface | |
CN102694400B (en) | Imput output circuit | |
US7343147B2 (en) | Method and apparatus for powering and loading software into a battery-less electronic device | |
US9979220B2 (en) | Electronic device and method for controlling charging of the same | |
CN103530250B (en) | Portable electronic device, its accessory device and operation method of portable electronic device | |
CN104272216A (en) | Electronic device and control method thereof | |
CN117388728B (en) | Battery detection circuit, method and electronic equipment | |
CN116365079B (en) | Electronic equipment, methods for determining battery condition and computer-readable storage media | |
CN107658916A (en) | Cue circuit and electronic equipment | |
TW201836233A (en) | Electronic device and charging method thereof | |
TW201523266A (en) | Electronic device using USB plugging set to load firmware and firmware loading method thereof | |
CN112448448A (en) | Charging control method and device, earphone, electronic equipment and readable storage medium | |
US20130238824A1 (en) | Semiconductor device and mobile terminal device | |
CN111431149B (en) | Battery protection circuit, terminal and battery protection method | |
TWI615704B (en) | Electronic device and the control method thereof | |
CN105988962B (en) | Overcurrent detecting system and circuit for detecting | |
JP2023040805A (en) | Physical layer chip and electronic apparatus | |
CN116073458A (en) | Adapter unplugging detection method and device, storage medium and electronic equipment | |
Furtner et al. | BIF—Battery interface standard for mobile devices | |
CN102681955B (en) | Multi-interface memory card and operational approach | |
CN119181877A (en) | Method and circuit for improving output voltage of battery and electronic equipment | |
JP5479194B2 (en) | Backup system, portable device | |
CN112737057A (en) | Charging and discharging circuit and electronic equipment | |
CN116774092A (en) | Battery testing methods, circuits, equipment, chips and readable storage media |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
CP03 | Change of name, title or address |
Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040 Patentee after: Honor Terminal Co.,Ltd. Country or region after: China Address before: 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong Patentee before: Honor Device Co.,Ltd. Country or region before: China |
|
CP03 | Change of name, title or address |