Multi-battery NTC resistance identification method and system, medium and electronic equipment
By presetting the voltage-temperature table of the battery NTC resistor and the ADC detection thread, the voltage-temperature table of the battery type is identified and adaptively configured, solving the management problem of different battery types, achieving effective protection of the power management system and extending the equipment service life.
Patent Information
- Application Number
- CN202510878354.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-27
- Publication Date
- 2025-09-26
AI Technical Summary
Existing technologies have difficulty effectively managing NTC resistors for different battery types, resulting in the power management system being unable to effectively protect the battery and affecting the device's charging management control.
By presetting the voltage-temperature table of NTC resistors for different types of batteries, the ADC detection thread is used to identify the battery type, and the voltage-temperature table is adaptively configured based on the identification result to perform battery charging management, including initializing the ADC channel, calculating the ADC average value, traversing the voltage-temperature table, obtaining the NTC resistance data of the target battery type, and sending it to the device system.
The device power management system effectively protects different battery types, extends the device life cycle, is compatible with multiple Android systems, and can capture battery anomalies in a timely manner and notify the device system without manual intervention, thereby improving detection efficiency and quality stability.
Smart Images

Figure CN120703609A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of batteries, and in particular relates to a method, system, medium and electronic equipment for identifying NTC resistance of multiple batteries. Background Art
[0002] In order to meet the charging needs of customers, smart POS machines are usually equipped with batteries of different capacities. The resistance values of NTC resistors (negative temperature coefficient thermistors) of different battery types are also different. Common NTC resistors have resistance values of 10k, 47k (usually refers to the resistance value of NTC resistors at 25°C), etc. Different NTC resistors have different resistance values, and the relationship between the detected temperature and voltage change (i.e., resistance change) is different. This makes different NTC resistors affect the device's detection of battery temperature, and thus affect the device's battery charging management and control. For diverse batteries, existing technologies mostly manage and control through hardware lists or multi-version adaptation of software, but the management and control effects are limited by the version updates of the installed hardware or software, which can easily lead to the POS device's power management system being unable to effectively protect the battery. Summary of the Invention
[0003] In order to solve the above problems, the present invention is implemented according to the following technical solutions:
[0004] A multi-battery NTC resistance identification method, comprising:
[0005] Preset voltage-temperature tables for NTC resistors of different battery types;
[0006] When the device is powered on, the ADC detection thread is started and runs at a preset time interval. The ADC value during the device startup process is read and the average ADC value within the set time is calculated.
[0007] Based on the current battery temperature and the ADC average value, traverse multiple preset voltage-temperature tables of NTC resistors of different battery types to obtain the target battery type;
[0008] According to the target battery type, NTC resistance data of the target battery type is obtained and sent to the device system for battery charging management, wherein the NTC resistance data includes a voltage-temperature table of the NTC resistance.
[0009] Furthermore, it also includes initializing the ADC channel and detecting whether the ADC channel is working properly, including:
[0010] The driver applies for the ADC channel and obtains the return value;
[0011] If the return value is 0, it is considered that the ADC channel is working normally; if the return value is negative, it is considered that the ADC channel is abnormal;
[0012] Read the ADC value collected by the ADC channel to determine whether the ADC value is within the normal range;
[0013] If the ADC value is within the normal range, the ADC channel is considered to be operating normally. Otherwise, the ADC channel is considered to be abnormal. The upper limit of the range is the maximum voltage value in the voltage-temperature table of multiple NTC resistors, and the lower limit of the range is the minimum voltage value in the voltage-temperature table of multiple NTC resistors.
[0014] Furthermore, it also includes:
[0015] After obtaining the target battery type, a system flag is added to the data of the target battery type and stored in the database.
[0016] Furthermore, it also includes:
[0017] After the device is powered on, the battery gauge is used to determine whether it is the first time it is powered on;
[0018] If the battery gauge does not have a power-off status bit, it is determined that the device battery has not been replaced, and the system flag bit is read from the database to obtain data of the target battery type, wherein the data of the target battery type includes a voltage-temperature table of the NTC resistor of the target battery.
[0019] Furthermore, the voltage-temperature table of the NTC resistor of the target battery type is sent to the device system for battery charging management, including:
[0020] When the device is charging, the voltage value of the NTC resistor is collected in real time, the real-time battery temperature is calculated based on the voltage-temperature table of the NTC resistor of the target battery type, and then sent to the device system;
[0021] If the real-time battery temperature is high, the device system controls the charging current to reduce or stop charging.
[0022] The present invention also discloses a multi-battery NTC resistance identification system for implementing the multi-battery NTC resistance identification method, comprising:
[0023] Data acquisition module, used to obtain the current temperature and the ADC average value within the set time;
[0024] A target battery type analysis module is used to traverse a plurality of preset voltage-temperature tables of NTC resistors of different battery types based on the current temperature and the ADC average value to obtain the target battery type;
[0025] The NTC resistance identification module is used to obtain NTC resistance data of the target battery type according to the target battery type and send it to the device system for battery management, wherein the NTC resistance data includes a voltage-temperature table of the NTC resistance.
[0026] Furthermore, the data acquisition module includes an ADC acquisition circuit, and the ADC acquisition circuit includes a first resistor and a second resistor connected in series, the other end of the first resistor is connected to the power input, and the other end of the second resistor is grounded.
[0027] The second resistor is also connected in parallel with the NTC resistor.
[0028] The connection point of the first resistor, the second resistor and the NTC resistor is connected to the ADC channel as an output end.
[0029] The present invention also discloses a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the multi-battery NTC resistance identification method are implemented.
[0030] The present invention also discloses an electronic device, comprising a device body and the above-mentioned multi-battery NTC resistance identification system.
[0031] Compared with the prior art, the present invention has the following beneficial effects:
[0032] The present invention discloses a multi-battery NTC resistor identification method and system. The multi-battery NTC resistor identification method includes presetting voltage-temperature tables of NTC resistors of different types of batteries; when a device is turned on, starting an ADC detection thread that runs at a preset time interval, reading the ADC value during the device startup process, and calculating the ADC average value within the set time; based on the current battery temperature and the ADC average value, traversing multiple preset voltage-temperature tables of NTC resistors of different types of batteries to obtain a target battery type; according to the target battery type, obtaining data such as the voltage-temperature table of the NTC resistor of the target battery type and sending it to a device system for battery charging management; and identifying different NTC resistors and batteries with different NTC resistors through an algorithm, adaptively selecting a suitable NTC resistor voltage-temperature table, so that the device's power management system can effectively protect the battery and extend the device's service life. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] The specific embodiments of the present invention will be further described in detail below with reference to the accompanying drawings, wherein:
[0034] Figure 1 This is a flow chart of the multi-battery NTC resistance identification method described in Example 1;
[0035] Figure 2 This is a structural diagram of the multi-battery NTC resistance identification system described in Example 2;
[0036] Figure 3 This is a circuit diagram of the ADC acquisition circuit of the multi-battery NTC resistance identification system described in Example 2;
[0037] Marking Explanation: 100, data acquisition module; 200, target battery type analysis module; 300, NTC resistor identification module. Specific Embodiment
[0038] The following describes the preferred embodiments of the present invention with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are only for the purpose of illustrating and explaining the present invention, and are not used to limit the present invention.
[0039] Embodiment 1
[0040] This embodiment discloses a method for identifying NTC resistors of multiple batteries, as Figure 1 , including:
[0041] S1. Preset a voltage-temperature table for NTC resistors of different types and / or different capacity specifications of batteries.
[0042] Specifically, by adjusting different ambient temperatures, record the ADC voltage every time the temperature rises / falls by 10°C. Based on the first battery with an NTC resistor of 47k and the second battery with an NTC resistor of 10k in this embodiment, preset the corresponding voltage-temperature table <voltage, temperature>:
[0043] Table 1
[0044] R
[0049] , , , , , , NTC , , , ,
[0052] ,
[0048] ,
[0051] ,
[0047] ,
[0050] ,
[0046] , = 47k
[0045] <1215000,700> <1199000,750> <1155000,850> <1046000,1000> <942000,1100> <748000,1250> <547000,1400> <426000,1500> <283000,1650> <212000,1750>
[0046] Table 2
[0047] R NTC = 10k
[0048]
[0049]
[0050] Among them, the voltage unit is uv, and the relationship between the numerical value in the temperature item and the actual temperature is customized according to actual needs. For example, <1215000>, 700> means the voltage is 1215000uv at -30°C, <748000, 1250> means the voltage is 748000uv at 25°C, and <212000, 1750> means the voltage is 212000uv at 75°C.
[0051] In this embodiment, after step S1, when the device is powered on, it includes initializing the ADC channel and detecting whether the ADC channel is working properly:
[0052] The driver applies for the ADC channel and obtains the return value: if the return value is 0, it is considered that the ADC channel is working normally; if the return value is negative, it is considered that the ADC channel is abnormal.
[0053] Read the ADC value collected by the ADC channel and determine whether the ADC value is within the normal range. If the ADC value is within the normal range, the ADC channel is considered to be working normally. Otherwise, the ADC channel is considered to be abnormal or the NTC resistor is considered to be abnormal. The upper limit of the range is the maximum voltage value in the voltage-temperature table of multiple NTC resistors, and the lower limit of the range is the minimum voltage value in the voltage-temperature table of multiple NTC resistors.
[0054] In this embodiment, after step S1, when the device is turned on, it further includes determining whether the voltage-temperature table of the NTC resistor of the preset different types and / or different capacity specifications of batteries is normal:
[0055] Read the voltage-temperature table of the NTC resistors of batteries of different types and / or different capacity specifications preset in the node.
[0056] Randomly read one or more voltage-temperature data in the voltage-temperature table of NTC resistors of batteries of different types and / or different capacity specifications.
[0057] If the return value is negative, the data reading is considered to have failed. Specifically, if the ADC channel or NTC resistor is malfunctioning, an abnormality report is sent to the device system, indicating that the battery temperature cannot be identified.
[0058] S2. When the device is powered on, the ADC detection thread is started and runs at a preset time interval. The ADC value during the device power-on process is read and the ADC average value within the set time is calculated.
[0059] Specifically, the ADC detection thread runs at a time interval of 5 seconds, obtains an ADC value every 5 seconds, converts it into voltage, and calculates the average ADC voltage within a preset time.
[0060] S3. Based on the current battery temperature and the ADC average value, multiple preset NTC resistor voltage-temperature tables for different battery types are traversed to obtain the target battery type. When the device is powered on, the battery temperature is close to room temperature, which defaults to 25°C. Specifically, the target battery type is obtained based on 25°C and the calculated ADC average value.
[0061] S4. According to the target battery type, obtain NTC resistance data of the target battery type and send it to the device system for battery charging management, wherein the NTC resistance data includes a voltage-temperature table of the NTC resistance.
[0062] Specifically, the voltage-temperature table of the NTC resistor of the target battery type is sent to the device system for battery management, including:
[0063] When the device is charging, the voltage value of the NTC resistor is collected in real time, the real-time battery temperature is calculated according to the voltage-temperature table of the NTC resistor of the target battery type, and then sent to the device system through the standard driver power_supply subsystem.
[0064] If the real-time battery temperature is high and exceeds the preset upper temperature threshold, the device system controls the charging current to reduce or stop charging; if the real-time battery charging temperature is too low and exceeds the preset lower temperature threshold, such as below -10°C, the lithium electron activity deteriorates and the device control system controls to stop charging.
[0065] When the target battery type and the corresponding NTC resistor are not identified, the default battery temperature sent to the device system is 25°C to ensure stable operation of the device system.
[0066] In this embodiment, it also includes:
[0067] After obtaining the target battery type, a system flag is added to the data of the target battery type and stored in the database.
[0068] In this embodiment, it also includes:
[0069] After the device is powered on, the battery gauge is used to determine whether it is the first time the device is powered on.
[0070] If the battery gauge does not have a power-off status bit, the device determines that the battery has not been replaced. The system flag is read from the database to obtain the target battery type data, which includes the voltage-temperature table of the target battery's NTC resistor. If the battery gauge has a power-off status bit, the device determines that the battery has been replaced, and the battery type and NTC resistor are re-identified.
[0071] The multi-battery NTC resistance identification method provided by the present invention uses an algorithm to identify batteries with different NTC resistors and adaptively configures a corresponding NTC resistance voltage-temperature table based on the identified NTC resistance. This enables the device's power management system to effectively protect the battery and extend the device's service life. The multi-battery NTC resistance identification method has strong portability and compatibility, adapting to various Android systems and compatible with different interfaces. It automatically identifies batteries with different NTC resistors through an algorithm and adaptively configures a corresponding NTC resistance voltage-temperature table, eliminating the need for manual intervention. It can also promptly detect battery anomalies and notify the device system. It also saves battery data, prioritizing the stored data upon the next power-on, improving detection efficiency and ensuring stable detection quality, allowing the device's power management module to maintain efficient and stable operating conditions.
[0072] Example 2
[0073] Based on the same inventive concept, this embodiment discloses a multi-battery NTC resistance identification system for implementing the multi-battery NTC resistance identification method described in Example 1. The implementation solution provided by this system is similar to the implementation solution described in the above method. Therefore, the specific limitations in one or more multi-battery NTC resistance identification system embodiments provided below can refer to the limitations of the multi-battery NTC resistance identification method above and will not be repeated here.
[0074] In this embodiment, if Figure 2 The multi-battery NTC resistance identification system includes a data acquisition module 100, a target battery type analysis module 200, and an NTC resistance identification module 300. The data acquisition module is used to obtain the current temperature and the ADC average value within a set time; the target battery type analysis module is used to traverse multiple preset voltage-temperature tables of NTC resistors of different types of batteries based on the current battery temperature and the ADC average value to obtain the target battery type; the NTC resistance identification module is used to obtain NTC resistance data of the target battery type based on the target battery type and send it to the device system for battery charging management, wherein the NTC resistance data includes the voltage-temperature table of the NTC resistance.
[0075] In this embodiment, the data acquisition module includes an ADC acquisition circuit, specifically, as Figure 3 The ADC acquisition circuit includes a first resistor R1 and a second resistor R2 connected in series. The other end of the first resistor R1 is connected to the power input VCC, and the other end of the second resistor R2 is grounded. The second resistor R2 is also connected in parallel with the NTC resistor. The connection point of the first resistor R1, the second resistor R2 and the NTC resistor is connected to the ADC channel as the output end VOUT.
[0076] Each module in the multi-battery NTC resistance identification system can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in hardware form, or stored in a computer device memory in software form, so that the processor can call and execute the corresponding operations of each module.
[0077] Example 3
[0078] This embodiment discloses a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the following steps are implemented:
[0079] Preset voltage-temperature tables for NTC resistors of different battery types;
[0080] When the device is powered on, the ADC detection thread is started and runs at a preset time interval. The ADC value during the device startup process is read and the average ADC value within the set time is calculated.
[0081] Based on the current battery temperature and the ADC average value, traverse multiple preset voltage-temperature tables of NTC resistors of different battery types to obtain the target battery type;
[0082] According to the target battery type, NTC resistance data of the target battery type is obtained and sent to the device system for battery charging management, wherein the NTC resistance data includes a voltage-temperature table of the NTC resistance.
[0083] In this embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0084] Initialize the ADC channel and check whether the ADC channel is working properly, including:
[0085] The driver applies for the ADC channel and obtains the return value;
[0086] If the return value is 0, it is considered that the ADC channel is working normally; if the return value is negative, it is considered that the ADC channel is abnormal;
[0087] Read the ADC value collected by the ADC channel to determine whether the ADC value is within the normal range;
[0088] If the ADC value is within the normal range, the ADC channel is considered to be operating normally. Otherwise, the ADC channel is considered to be abnormal. The upper limit of the range is the maximum voltage value in the voltage-temperature table of multiple NTC resistors, and the lower limit of the range is the minimum voltage value in the voltage-temperature table of multiple NTC resistors.
[0089] In this embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0090] After obtaining the target battery type, a system flag is added to the data of the target battery type and stored in the database.
[0091] In this embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0092] After the device is powered on, the battery gauge is used to determine whether it is the first time it is powered on;
[0093] If the battery gauge does not have a power-off status bit, it is determined that the device battery has not been replaced, and the system flag bit is read from the database to obtain data of the target battery type, wherein the data of the target battery type includes a voltage-temperature table of the NTC resistor of the target battery.
[0094] In this embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0095] The voltage-temperature table of the NTC resistor of the target battery type is sent to the device system for battery management, including:
[0096] When the device is charging, the voltage value of the NTC resistor is collected in real time, the real-time battery temperature is calculated based on the voltage-temperature table of the NTC resistor of the target battery type, and then sent to the device system;
[0097] If the real-time battery temperature is high, the device system controls the charging current to reduce or stop charging.
[0098] Example 4
[0099] This embodiment discloses an electronic device, which includes a device body and the multi-battery NTC resistance identification system described in Example 2. For other specific implementation details, please refer to the descriptions and limitations in the above embodiment and will not be repeated here.
[0100] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.
[0101] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0102] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
[0103] The above description is merely a preferred embodiment of the present invention and does not constitute any form of limitation to the present invention. Therefore, any modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention shall still fall within the scope of the technical solution of the present invention.
Claims
1. A multi-battery NTC resistance identification method, characterized in that: include: Preset voltage-temperature tables for NTC resistors of different battery types; When the device is powered on, the ADC detection thread is started and runs at a preset time interval. The ADC value during the device startup process is read and the average ADC value within the set time is calculated. Based on the current battery temperature and the ADC average value, traverse multiple preset voltage-temperature tables of NTC resistors of different battery types to obtain the target battery type; According to the target battery type, NTC resistance data of the target battery type is obtained and sent to the device system for battery charging management, wherein the NTC resistance data includes a voltage-temperature table of the NTC resistance.
2. The multi-battery NTC resistance identification method according to claim 1, characterized in that: It also includes initializing the ADC channel and detecting whether the ADC channel is working properly, including: The driver applies for the ADC channel and obtains the return value; If the return value is 0, it is considered that the ADC channel is working normally; if the return value is negative, it is considered that the ADC channel is abnormal; Read the ADC value collected by the ADC channel to determine whether the ADC value is within the normal range; If the ADC value is within the normal range, the ADC channel is considered to be operating normally. Otherwise, the ADC channel is considered to be abnormal. The upper limit of the range is the maximum voltage value in the voltage-temperature table of multiple NTC resistors, and the lower limit of the range is the minimum voltage value in the voltage-temperature table of multiple NTC resistors.
3. The multi-battery NTC resistance identification method according to claim 1, characterized in that: Also includes: After obtaining the target battery type, a system flag is added to the data of the target battery type and stored in the database.
4. The multi-battery NTC resistance identification method according to claim 3, characterized in that: Also includes: After the device is powered on, the battery gauge is used to determine whether it is the first time it is powered on; If the battery gauge does not have a power-off status bit, it is determined that the device battery has not been replaced, and the system flag bit is read from the database to obtain data of the target battery type, wherein the data of the target battery type includes a voltage-temperature table of the NTC resistor of the target battery.
5. The multi-battery NTC resistance identification method according to claim 1, characterized in that: Send the voltage-temperature table of the NTC resistor of the target battery type to the device system for battery charging management, including: When the device is charging, the voltage value of the NTC resistor is collected in real time, the real-time battery temperature is calculated based on the voltage-temperature table of the NTC resistor of the target battery type, and then sent to the device system; If the real-time battery temperature is high, the device system controls the charging current to reduce or stop charging.
6. A multi-battery NTC resistance identification system, used to implement the multi-battery NTC resistance identification method according to any one of claims 1 to 5, characterized in that: include: Data acquisition module, used to obtain the current temperature and the ADC average value within the set time; A target battery type analysis module is used to traverse multiple preset voltage-temperature tables of NTC resistors of different battery types based on the current battery temperature and the ADC average value to obtain the target battery type; The NTC resistance identification module is used to obtain NTC resistance data of the target battery type according to the target battery type and send it to the device system for battery charging management, wherein the NTC resistance data includes a voltage-temperature table of the NTC resistance.
7. The multi-battery NTC resistance identification system according to claim 6, characterized in that: The data acquisition module includes an ADC acquisition circuit, which includes a first resistor and a second resistor connected in series, the other end of the first resistor is connected to the power input, and the other end of the second resistor is grounded. The second resistor is also connected in parallel with the NTC resistor. The connection point of the first resistor, the second resistor and the NTC resistor is connected to the ADC channel as an output end.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the multi-battery NTC resistance identification method according to any one of claims 1 to 5 are implemented.
9. An electronic device, characterized in that: The invention comprises a device body and the multi-battery NTC resistance identification system according to any one of claims 6 to 7.