A battery water inlet detection and control method, device, equipment and storage medium

By initializing and configuring the battery water ingress detection circuit and performing time series analysis, the problem of false alarms or missed detections in existing battery water ingress detection technologies has been solved. This enables highly accurate water ingress detection and power-off control in humid environments, ensuring battery safety.

CN122172044APending Publication Date: 2026-06-09JIADE ENERGY TECH (ZHUHAI) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
JIADE ENERGY TECH (ZHUHAI) CO LTD
Filing Date
2026-03-10
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

Existing technologies lack the ability to dynamically analyze the battery water ingress detection process, leading to false alarms or missed detections, especially in humid environments.

Method used

By initializing and configuring the input pins of the battery water ingress detection circuit, a water ingress detection channel is established, electrical sampling is performed, the first detection signal of the on/off state between the solder pads is obtained, and the signal quality parameters are judged by time series analysis to generate a water ingress judgment result. Finally, a power-off control signal is generated based on the judgment result to disconnect the battery output path.

Benefits of technology

It improves the accuracy of battery water ingress detection, can stably identify water ingress behavior in complex environments, significantly enhances detection accuracy and anti-interference ability, and ensures battery safety.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122172044A_ABST
    Figure CN122172044A_ABST
Patent Text Reader

Abstract

The application provides a battery water inlet detection and control method, device, equipment and storage medium. The method comprises the following steps: initializing and configuring an input pin of a battery water inlet detection circuit according to a starting signal of a battery system, establishing a water inlet detection channel for a water inlet pad in the battery water inlet detection circuit; electrically sampling the water inlet pad according to the water inlet detection channel, obtaining a first detection signal representing the on-off state between pads; judging the signal quality parameter of the first detection signal by time series analysis on the first detection signal, and generating a water inlet judgment result; based on the water inlet judgment result, outputting an instruction to a battery power supply control circuit, generating a power-off control signal, and disconnecting the battery output path according to the power-off control signal. Through the implementation of the application scheme, the first detection signal composed of a level sequence is obtained, and time series analysis is performed thereon to judge the signal quality parameter and generate the water inlet judgment result, thereby effectively improving the accuracy of water inlet detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of battery technology, and in particular to a method, apparatus, equipment and storage medium for detecting and controlling water ingress into a battery. Background Technology

[0002] With the widespread application of new energy vehicles, energy storage systems and underwater electronic equipment, the frequency of battery use in humid, waterlogged, and even high-pressure water environments has increased significantly. Especially in application scenarios such as electric ships, underwater robots, and unmanned platforms with replaceable battery modules, batteries are very prone to internal short circuits due to water ingress during use, which can lead to serious safety accidents such as overheating, fire, or even explosion.

[0003] To address this, existing technologies, such as Chinese patent CN111751743A, propose a water ingress detection device and control method based on a resistor-capacitor network structure. This method detects abnormal loop voltage caused by water ingress by setting series resistors, capacitors, and voltage divider sampling points, and determines whether water ingress or an open circuit occurs based on different voltage divider states. However, such methods generally rely on single sampling results of instantaneous voltage. They compare the voltage level acquired from the input pin with a "voltage value versus threshold," lacking the ability to dynamically analyze signal changes. This leads to false alarms or missed detections when detecting pad contamination, chronic pad oxidation, electrochemical micro-conductivity, or moisture fluctuations. Summary of the Invention

[0004] This application provides a battery water ingress detection and control method, apparatus, device and storage medium to solve the problem that the lack of dynamic analysis capability of signal change process in related technologies easily leads to false alarms or missed detections.

[0005] The first aspect of this application provides a method for detecting and controlling water ingress in a battery, the method comprising: The input pins of the battery water ingress detection circuit are initialized and configured according to the start signal of the battery system, and a water ingress detection channel for the water ingress pad in the battery water ingress detection circuit is established. Electrical sampling is performed on the water inlet pads according to the water inlet detection channel to obtain a first detection signal indicating the on / off state between the pads; By performing time series analysis on the first detection signal, the signal quality parameters of the first detection signal are determined, and an influent judgment result is generated. Based on the water ingress determination result, the battery power supply control circuit is given a command output to generate a power-off control signal, and the battery output path is disconnected according to the power-off control signal.

[0006] Optionally, in a first implementation of the first aspect of this application, the step of initializing the input pins of the battery water ingress detection circuit according to the battery system's startup signal, and establishing a water ingress detection channel for the water ingress pads in the battery water ingress detection circuit, includes: The controller's initialization command is obtained based on the battery system's start signal, and the working status register of the battery detection module is read through the initialization command to determine whether the water ingress detection module is in standby mode. Configure the resistance parameters of the input pins of the water ingress detection module in standby mode, and obtain the pin number and port mapping information corresponding to the input pins based on the resistance parameter configuration results; Based on the pin number and port mapping information, channel mapping is performed on the data path between the water ingress pad and the controller to establish a water ingress detection channel for the water ingress pad in the battery water ingress detection circuit.

[0007] Optionally, in a second implementation of the first aspect of this application, the step of electrically sampling the water inlet pads according to the water inlet detection channel to obtain a first detection signal representing the on / off state between the pads includes: Based on the channel number established after the water inlet detection channel is established, the internal sampling trigger unit of the controller is invoked, and the electrical sampling trigger configuration parameters are generated by setting the sampling period and trigger conditions; The electrical connection status between the water inlet pads is periodically sampled according to the trigger configuration parameters to obtain the level sampling data of the instantaneous conduction status between the pads; By performing numerical verification on the level sampling data, a preliminary stable level sequence signal is generated; Based on the duration of the level change in the level sequence signal, the conduction state between the water inlet pads is logically determined to obtain the first detection signal of the on / off state between the pads.

[0008] Optionally, in a third implementation of the first aspect of this application, the step of determining the signal quality parameters of the first detection signal by performing time series analysis on the first detection signal and generating an influent judgment result includes: Based on the sampling time axis of the first detection signal, the level state sequence within multiple consecutive sampling periods is extracted, and the level state sequence is grouped by time window segmentation to generate a grouped time segment set; By performing level transition frequency analysis on the time sequence segment set, the number of high-level and low-level transitions in each segment is obtained, and the level stability index of each segment is calculated based on the number of transitions. Based on the level stability index and combined with the preset electrical noise threshold range, it is determined whether the first detection signal has abnormal characteristics, and a corresponding signal quality flag bit is generated. The state is fused based on the signal quality flag and the duration of the conduction state in the timing segment, and a water ingress judgment result is generated based on a preset water ingress state judgment threshold.

[0009] Optionally, in the fourth implementation of the first aspect of this application, the step of outputting a command to the battery power supply control circuit based on the water ingress judgment result, generating a power-off control signal, and disconnecting the battery output path according to the power-off control signal includes: The controller's state switching command is obtained based on the state determination value of the water inlet judgment result, and the execution priority of the power outage control process is determined by filtering the interrupt priority of the controller's interrupt management module. According to the execution priority, the command encoding unit inside the controller is invoked to convert the state switching instruction into an instruction format and generate a power-off control instruction sequence; According to the output format of the power-off control command sequence, the execution module of the battery power supply control circuit is driven, and a power-off control signal is applied to the control switching device through the power drive pin; Based on the transmission feedback status of the shutdown control signal, the voltage of the battery output path is electrically sampled, and the collected real-time voltage value is compared with a set threshold to determine that the battery output path has been disconnected.

[0010] Optionally, in the fifth implementation of the first aspect of this application, after the step of initializing the input pins of the battery water ingress detection circuit according to the battery system's startup signal and establishing a water ingress detection channel for the water ingress pads in the battery water ingress detection circuit, the method further includes: According to the self-test start command of the battery system, the pin configuration status of the battery water ingress detection circuit is obtained, and the path configuration parameters are generated. According to the path configuration parameters, a preset voltage signal is injected into the water ingress pad, and at least one input pin of the battery water ingress detection circuit is set to a high impedance state to construct a closed-loop test path. Based on the difference between the feedback voltage of the closed-loop test path and the preset reference voltage, and combined with the preset difference threshold range, the electrical consistency of the conduction characteristics of the closed-loop test path is determined, and a corresponding conduction validity flag is generated. The self-test result of the battery water ingress detection circuit is obtained by comparing the conduction status flag with the readback logic level of the input pin, and the detection validity status of the subsequent water ingress detection module is updated based on the self-test result.

[0011] Optionally, in the sixth implementation of the first aspect of this application, after the step of initializing the input pins of the battery water ingress detection circuit according to the battery system's startup signal and establishing a water ingress detection channel for the water ingress pads in the battery water ingress detection circuit, the method further includes: According to the port mapping table of the controller, the pin group information of multiple preset water inlet detection channels is obtained, and the corresponding multiple water inlet detection channels are established by performing time-division polling initialization configuration on the pin groups. By periodically sampling each of the water inlet detection channels, the conduction state data sequence of each water inlet detection channel in multiple consecutive sampling periods is obtained, and the transition edge of the conduction state data sequence is identified. Based on the frequency and duration of the transition edge within a set time window, level stability parameters corresponding to each water inlet detection channel are generated, and the level stability parameters are compared with the baseline parameters under historical no-water-inlet conditions to generate a comparison result. Based on the difference comparison results, the target water inlet detection channel with unstable signal is determined, and a conduction judgment result of abnormal water inlet detection channel status is generated. Based on the conduction determination result, a corresponding power-off control command is generated.

[0012] A second aspect of this application provides a battery water ingress detection and control device, which is used to implement a battery water ingress detection and control method. The battery water ingress detection and control device includes: The module is used to initialize and configure the input pins of the battery water ingress detection circuit according to the start signal of the battery system, and to establish a water ingress detection channel for the water ingress pad in the battery water ingress detection circuit. The acquisition module is used to perform electrical sampling on the water inlet pads according to the water inlet detection channel to acquire a first detection signal indicating the on / off state between the pads; The judgment module is used to determine the signal quality parameters of the first detection signal by performing time series analysis on the first detection signal, and generate an influent judgment result; The control module is used to output instructions to the battery power supply control circuit based on the water ingress judgment result, generate a power-off control signal, and disconnect the battery output path according to the power-off control signal.

[0013] A third aspect of this application provides an electronic device, including a memory and a processor, wherein the processor is configured to execute a computer program stored in the memory, and when the processor executes the computer program, it implements the steps of the battery water ingress detection and control method provided in the first aspect of this application.

[0014] The fourth aspect of this application provides a computer-readable storage medium storing a computer program thereon. When the computer program is executed by a processor, it implements the steps of the battery water ingress detection and control method provided in the first aspect of this application.

[0015] In summary, the battery water ingress detection and control method, apparatus, device, and storage medium provided in this application initialize the input pins of the battery water ingress detection circuit based on the battery system's startup signal, establishing a water ingress detection channel for the water-ingress pads in the battery water ingress detection circuit. Electrical sampling is performed on the water-ingress pads using the water ingress detection channel to obtain a first detection signal representing the on / off state between the pads. Time series analysis is performed on the first detection signal to determine its signal quality parameters and generate a water ingress judgment result. Based on the water ingress judgment result, a command is output to the battery power supply control circuit to generate a power-off control signal, and the battery output path is disconnected according to the power-off control signal. By implementing this application, a first detection signal composed of a level sequence is obtained, and time series analysis is performed on it to determine signal quality parameters and generate a water ingress judgment result, effectively improving the accuracy of water ingress detection. Attached Figure Description

[0016] Figure 1 This is a flowchart illustrating the battery water ingress detection and control method provided in an embodiment of this application. Figure 2 A schematic diagram of the program modules of the battery water ingress detection and control device provided in an embodiment of this application; Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0017] To make the inventive objectives, features, and advantages of this application more apparent and understandable, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0018] To address the problem of false alarms or missed detections caused by the lack of dynamic analysis capabilities for signal changes in related technologies, embodiments of this application provide a battery water ingress detection and control method, such as... Figure 1 This is a flowchart illustrating the battery water ingress detection and control method provided in this embodiment. The battery water ingress detection and control method includes the following steps: Step 110: Initialize the input pins of the battery water ingress detection circuit according to the battery system's startup signal, and establish a water ingress detection channel for the water ingress pads in the battery water ingress detection circuit.

[0019] Specifically, the input pins of the battery water ingress detection module are initialized and configured using the battery system's startup signal. This is achieved through the embedded controller's configuration function for input / output pins. The controller sets specific pins to high-impedance input, no pull-up, or weak pull-up modes based on the startup state, ensuring accurate reading of the voltage levels connected to the pads during subsequent sampling. Simultaneously, the sampling trigger logic, channel number mapping, and initial voltage levels are configured one by one to establish a complete signal reading path. Based on this, the controller electrically connects the pads to the designated detection channel, forming an electrical closed loop for water ingress sensing. Due to the battery system's power consumption and real-time requirements, the input pin initialization process is typically combined with a startup interrupt trigger or a low-power wake-up mechanism to ensure that the detection path is activated and prepared the moment the device is powered on.

[0020] In one optional implementation of this embodiment, the step of initializing the input pins of the battery water ingress detection circuit according to the battery system's startup signal to establish a water ingress detection channel for the water ingress pads in the battery water ingress detection circuit includes: obtaining the controller's initialization command according to the battery system's startup signal, and reading the working status register of the battery detection module through the initialization command to determine whether the water ingress detection module is in standby mode; configuring the resistance parameters of the input pins of the water ingress detection module in standby mode, and obtaining the pin number and port mapping information corresponding to the input pins according to the resistance parameter configuration result; and mapping the data path between the water ingress pads and the controller according to the pin number and port mapping information to establish a water ingress detection channel for the water ingress pads in the battery water ingress detection circuit.

[0021] Specifically, in the battery water ingress detection circuit's workflow, to ensure the effective establishment of the detection channel, the controller's internal initialization mechanism must first be triggered by the battery system's startup signal during the system startup phase. This generates initialization instructions and completes the pre-configuration of the water ingress detection circuit. The battery system startup signal refers to the effective control signal generated by the battery pack or battery management system (BMS) during initial power-on, power-on wake-up, or software startup. It can be triggered by the power-on detection signal output by the power management unit (PMU), the battery pack's power enable signal, or an external interrupt signal from the MCU. The purpose of this startup signal is to enable the controller to enter the initialization phase and activate key system modules, including the water ingress detection module used to detect external moisture penetration, through initialization instructions. After receiving the initialization instructions, the controller first reads the battery water ingress detection module's operating status register. The operating status register is an internal configuration register used to record whether the module is in sleep, standby, or operating mode. Its contents are typically stored as bit flags, such as one bit indicating "standby state" and another indicating "operating." The purpose of reading this register is to confirm whether the water ingress detection module is in a low-power standby state suitable for acceptable initialization operations, preventing inconsistent states caused by inserting configuration commands during module operation. After confirming that the detection module is in standby mode, the controller begins configuring the resistance parameters of the input pins connected to the water ingress pads. Resistance parameter configuration refers to setting the connection method of the internal pull-up / pull-down resistors for the input pins, thereby affecting the default level response of the pins in the open-circuit state. The pull-up / pull-down configuration of the pins is controlled by the GPIO (General Purpose Input / Output) configuration register inside the MCU or controller. By setting the Pull-up or Pull-down parameters of the input pins, it determines whether the pins present a high or low level when not connected or in a high-impedance state. This configuration is crucial for the water ingress detection process because, in a dry state, the pads should be disconnected or in a high-impedance state. Correctly configuring the resistance parameters helps to stably identify the open-circuit state as a high or low level, thus accurately identifying level transitions when a short circuit is detected. For example, if the sampling pin reads a low level after setting the pull-up resistor, it indicates a continuity or water ingress short circuit between the pads. After configuration, the controller extracts the corresponding pin number and port mapping information based on the resistor configuration and the physical address information of the input pin. The pin number refers to the GPIO number or ADC channel number, such as PA0 and PB1 in the STM32 series controller; the port mapping information is a description of the logical path connecting the pin to the internal functional units of the controller (such as samplers, timers, and peripheral buses). This process relies on the controller's IO remapping function, which allows different pins to be mapped as water ingress detection, analog input, or digital sampling channels.The significance of extracting this information lies in determining the data path for subsequent detection logic, ensuring that the controller can accurately receive the electrical signals transmitted from the water ingress detection circuit. Finally, based on the aforementioned pin numbers and port mapping information, the controller completes the channel mapping of the data path between the water ingress pads and its internal processing unit. Channel mapping refers to establishing a logical channel in the controller, so that the pins connected to each pair of pads are connected to the detection module through an internal bus, thus forming a complete signal sampling closed loop. In this channel, the controller can periodically activate the ADC or GPIO module to read the level states between the pads and identify the presence of water ingress by analyzing signal changes. After the channel mapping is established, the water ingress detection circuit has a complete connection capability from the physical pads to the controller's logical judgment link, enabling the system to stably capture and process water ingress signals during the detection phase. For example, when a pad is shorted to form a low level, the controller detects the signal change through the mapped channel, which can further trigger the water ingress judgment logic or power-off control mechanism, completing the first stage preparation of the entire battery protection process.

[0022] Step 120: Perform electrical sampling on the water inlet pads according to the water inlet detection channel to obtain the first detection signal indicating the on / off state between the pads.

[0023] Specifically, in this embodiment, the established detection channel is used to electrically sample the water ingress detection pads on the exposed area of ​​the battery. The technology employed is analog-to-digital conversion or digital I / O level detection mechanism. The controller can collect the on / off state between the pads within a set period, reading high and low levels via GPIO or obtaining voltage values ​​via ADC. This process is based on the conductivity of water; when water bridges two pads, it changes the original high-resistance state to a low-resistance or short-circuit state, causing a sudden change in the output level. After reading the data, the controller stores the sampling results in an internal register or buffer, providing a signal basis for subsequent behavioral analysis. To enhance accuracy and anti-interference capabilities, the sampling process often incorporates level dejittering, sampling filtering, and soft calibration to eliminate abnormal sampling values ​​caused by electromagnetic interference, occasional signal jumps, or device temperature drift, thereby ensuring the representativeness and reliability of the acquired detection signal.

[0024] In one optional implementation of this embodiment, the step of electrically sampling the water-ingress pads according to the water ingress detection channel to obtain a first detection signal representing the on / off state between the pads includes: calling the internal sampling trigger unit of the controller according to the channel number established after the water ingress detection channel is established, and generating trigger configuration parameters for electrical sampling by setting the sampling period and trigger conditions; periodically sampling the electrical connection state between the water-ingress pads according to the trigger configuration parameters to obtain level sampling data of the instantaneous conduction state between the pads; generating a preliminary stable level sequence signal by numerically verifying the level sampling data; and logically judging the conduction state between the water-ingress pads according to the duration of the level change in the level sequence signal to obtain the first detection signal of the on / off state between the pads.

[0025] Specifically, after establishing the water inlet detection channel, the controller calls its internal sampling trigger unit according to the assigned channel number. The sampling trigger unit is a control logic module responsible for sequentially activating analog sampling, digital level reading, or peripheral input sampling during system operation. This unit activates the corresponding ADC channel or GPIO input function based on the preset channel number and sampling source mapping. To ensure sampling continuity and data controllability, the controller sets the sampling period and trigger conditions for the sampling trigger unit. The sampling period represents the time interval between two sampling events, while the trigger conditions define the conditions under which sampling is allowed to begin, such as system power-on, timer interrupt, or external event triggering. Setting the sampling period establishes a fixed-frequency data acquisition mechanism to prevent discontinuous signal sampling or dead zones; setting the trigger conditions ensures sampling operates in an effective state, avoiding unnecessary power consumption waste or interference with signal acquisition. After the sampling trigger configuration is complete, the controller periodically activates the sampling logic according to the set parameters to continuously measure the electrical connection status between the water inlet pads. The technology used can be digital input sampling or reading pin voltages through the ADC module. If the system uses GPIO input mode, the acquired data is a logic level, i.e., high or low level; if using ADC mode, the acquired result is an analog voltage value, typically between 0 and a reference voltage. The goal of the sampling process is to capture the instantaneous conduction state between the pads, which can change due to conductive paths formed by moisture. For example, in a dry environment, the pads should be in a high-impedance state, with the level maintained at a high level or floating state; if water enters and forms a short circuit, the pads will be in a low-impedance state, and the level will drop sharply to a low level. After a certain number of consecutive samples, the controller performs numerical verification on the acquired level sampling data. Numerical verification refers to confirming the validity of the sampled values, filtering out anomalies, and normalizing the format. The core technologies of this process include dejittering, edge detection, and sampling stability judgment. Dejittering is used to filter out pseudo-signals caused by electromagnetic interference, cable disturbances, or transient fluctuations of the controller itself. For example, an abnormally high level appearing in a single sampling cycle can be identified as a jitter signal and discarded. Edge detection identifies transition points between high and low voltage levels, while stability assessment evaluates whether the sampled data exhibits a consistent trend. After verification, the sampled values ​​are grouped into a preliminarily stable voltage level sequence, forming the basic data structure for judging the trend of electrical state changes. Based on this stable voltage level sequence, the controller further analyzes the duration of voltage level changes to logically determine the conduction status between the inlet pads. Duration refers to the span of time during which the voltage level remains in a certain state. For example, three consecutive sampling cycles (corresponding to 1.5 seconds) with a low voltage level can be considered as a continuous conduction.The controller analyzes the voltage level sequence using predefined logic rules, such as determining whether the duration of the low level exceeds a threshold or the number of transitions exceeds a set frequency, to determine if the conduction is a genuine water ingress caused by a liquid bridge. Ultimately, the controller generates a first detection signal between the pads based on the judgment result. This first detection signal is a binary logic output indicating whether a stable conduction relationship exists between the pads. If the detection indicates "continuity," this signal is used to drive the subsequent power-off control link; if it indicates "non-continuity," the system remains in monitoring mode and does not execute any protection actions. For example, if water ingress causes the voltage level between the pads to remain low for more than 2 seconds, the controller will generate a first detection signal with a value of 1 as the condition input for triggering the power-off process. Through this method, the system can stably identify water ingress behavior in complex environments, significantly enhancing detection accuracy and anti-interference capabilities.

[0026] Step 130: By performing time series analysis on the first detection signal, determine the signal quality parameters of the first detection signal and generate the water inflow judgment result.

[0027] Specifically, based on the collected electrical signals, time series analysis is performed to determine the behavioral characteristics of the water ingress state. The techniques used include signal sequence segmentation, level transition statistics, duration detection, and behavioral feature extraction. The controller assembles multiple continuous sampling points into a time series and slices it into windows of fixed length. By analyzing parameters such as the number of transitions between high and low levels, the transition frequency, and the duration of continuous conduction, it determines whether the signal exhibits typical water ingress patterns. This processing method differs from the traditional single-voltage determination method; it focuses more on the signal's behavioral evolution trend along the time axis, thus effectively identifying false trigger signals such as water mist, moisture, and electrochemical micro-conduction. In actual execution, the controller, according to set logical rules, such as the number of transitions exceeding a threshold or the continuous conduction time exceeding a set value, determines whether the sequence meets the "stable conduction" condition, thereby generating a water ingress judgment result and providing data for the power-off control logic.

[0028] In one optional implementation of this embodiment, the step of determining the signal quality parameters of the first detection signal and generating a water ingress judgment result by performing time series analysis on the first detection signal includes: extracting the level state sequence within multiple consecutive sampling periods according to the sampling time axis of the first detection signal, and grouping the level state sequence into groups by segmenting through a time window to generate a set of grouped time segments; performing level transition frequency analysis on the time segment set to obtain the number of high-level and low-level transitions in each group of segments, and calculating the level stability index of each segment based on the number of transitions; determining whether the first detection signal has abnormal characteristics based on the level stability index and a preset electrical noise threshold range, and generating a corresponding signal quality flag bit; performing state fusion based on the signal quality flag bit and the conduction state duration in the time segment, and generating a water ingress judgment result based on a preset water ingress state judgment threshold.

[0029] Specifically, after initial sampling of the conduction status between solder pads, in order to further identify whether it is a genuine water ingress behavior, it is necessary to conduct in-depth analysis of the changing trend of the first detection signal in the time dimension. The first detection signal is a binary level state obtained by the controller based on periodic sampling, representing the conduction status of the solder pad corresponding to each sampling point. Its sampling time axis refers to the time sequence of level states recorded by the controller during continuous operation, with the horizontal axis being the timestamp and the vertical axis being the logic level. The controller first extracts the level state sequence within multiple consecutive sampling periods from this time axis and segments the sequence according to a set time window. The time window is a preset time length unit, such as every 1 second or every 4 sampling points as a segment. Its function is to structure and organize the long time sequence into a set of time segments that are easy to calculate. Each time segment contains a set of continuous level states, and the set of all segments is called the time segment set, which is used for subsequent behavioral feature identification. After obtaining the time segment set, the controller performs level transition frequency analysis on each group of segments. This analysis is used to identify the number of times the level switches between high and low states. A level transition refers to the transition of a logic level from high to low or from low to high, with each transition representing a sudden change in electrical state. The controller iterates through the level sequence within each time segment, counting the number of high-to-low level transitions within that segment, and uses this count as the transition frequency value for that segment. For example, if the sampling point sequence within a segment is {1,1,0,1,0,0}, then there are 3 transitions. Transition frequency is a key indicator for evaluating the stability of electrical signals because, under actual water ingress conditions, the conduction state between pads often exhibits a continuous and stable low or high level; however, in unstable contacts caused by interference, accidental touches, water mist, or vibration, the level state changes frequently, forming segments with high transition frequencies. Therefore, the controller calculates a level stability index for each segment based on the number of transitions. This index is the reciprocal of the transition frequency or a compensation value for the rate of change, used to quantify the electrical stability of a particular segment. Based on the above stability index, the controller further introduces an electrical noise threshold range for screening. This threshold is determined by the system environmental characteristics and reflects the maximum permissible transition frequency of the system under non-water ingress conditions. For example, in a dry environment, the number of occasional jumps caused by device noise or power supply ripple should not exceed 2 per second; therefore, 2 jumps / second is used as the threshold. The controller compares the stability index of each segment with this threshold. If the stability is too low or the jump frequency is too high, the segment is determined to contain abnormal signal behavior, and a signal quality flag is generated for that segment. This flag is a binary identifier indicating whether the signal segment is considered "interferenced" or "acceptable." For example, if a segment has 5 jumps, significantly exceeding the normal fluctuation range, it is marked as a low-quality state for subsequent elimination or downweighting. Finally, the controller performs a state fusion operation by combining the signal quality flag with the duration of the conduction state in each timing segment.Duration refers to the longest time a signal level remains low or high within a segment, used to determine the continuity of conduction. For example, if there are four consecutive low-level samples in a segment, each with a sampling period of 0.5 seconds, then that segment has a continuous conduction state for 2 seconds. State fusion refers to the controller combining the conduction continuity in "high-quality" segments for logical judgment, avoiding misleading judgment results due to low-quality segments. The system accumulates, averages, or selects the maximum value of the conduction time of multiple valid segments and compares it with a preset water ingress state judgment threshold. This threshold represents the minimum conduction duration and signal quality requirements that the system must meet to determine a water ingress state, such as a continuous stable low level for 2 seconds with fewer than 2 transitions. When the fusion result meets this judgment criterion, the controller outputs a water ingress judgment result, providing a trigger basis for subsequent power control logic, thereby ensuring that the detection system not only has a fast response speed but also anti-interference capabilities and false judgment suppression capabilities.

[0030] Step 140: Based on the water ingress judgment result, output a command to the battery power supply control circuit to generate a power-off control signal, and disconnect the battery output path according to the power-off control signal.

[0031] Specifically, in this embodiment, based on the aforementioned water ingress judgment result, the controller sends a control command to the battery power supply control circuit and disconnects the battery output path by controlling MOSFETs, relays, or other electronic switch drive components. The controller generates a power-off signal based on the judgment result, which is sent to the execution module of the power supply control circuit to guide the main circuit into an open / closed state. Such control circuits typically use drive devices to control the main power switch element, cutting off the electrical connection between the battery output and the load, thereby interrupting current output and preventing short circuits or thermal runaway under water ingress conditions. In some designs, a feedback detection mechanism is also introduced to monitor the disconnection status of the output path in real time, ensuring that the execution of the control command is consistent with the electrical state, forming a complete closed-loop protection system.

[0032] In one optional implementation of this embodiment, the steps of outputting instructions to the battery power supply control circuit based on the water ingress judgment result, generating a power-off control signal, and disconnecting the battery output path according to the power-off control signal include: obtaining the controller's state switching instruction based on the state determination value of the water ingress judgment result, and determining the execution priority of the power-off control process by filtering the interrupt priority of the controller's interrupt management module; calling the command encoding unit inside the controller according to the execution priority to convert the state switching instruction into an instruction format and generate a power-off control instruction sequence; driving the execution module of the battery power supply control circuit according to the output format of the power-off control instruction sequence, and applying a shutdown control signal to the control switching device through the power drive pin; and electrically sampling the voltage of the battery output path according to the transmission feedback state of the shutdown control signal, and comparing the collected real-time voltage value with a set threshold to determine that the battery output path has been disconnected.

[0033] Specifically, after analyzing and judging the water ingress status, the controller initiates the subsequent power-off control mechanism based on the status judgment value generated in the water ingress judgment result. The status judgment value is a logical flag indicating whether the system is currently in a dangerous state. It can be derived from the fusion of multiple signals, such as the combined result of level stability, conduction duration, and signal quality flags. When the status judgment value is high or the set trigger bit is valid, the controller considers the battery to be at risk of water ingress and needs to immediately switch to the protection state. After receiving the status judgment value, the controller generates a status switching command through the status judgment logic. This command is used to switch from the "normal power supply" state to the "emergency protection" state in the control flow and is then handled by the interrupt management module. The interrupt management module is a key structure within the controller responsible for multi-task scheduling; it maintains the priority relationship of multiple concurrent interrupt requests. Upon receiving the status switching command, the controller performs priority filtering on the interrupt management module. The filtering process is based on the priority values ​​set for different events in the interrupt vector table. For example, water ingress power outage is a high-priority event, while data reporting or status refresh may be a low-priority event. The significance of filtering lies in ensuring that when multiple interrupt sources trigger simultaneously, the water ingress event can preempt other tasks and immediately enter the control flow. For example, if interrupt priority 0 represents the highest level, and the current interrupt request for the water ingress event is level 1, the controller will immediately jump to the power-off process, suspending low-priority tasks to ensure the immediacy of the battery power-off response and system safety. Next, the controller calls its internal command encoding unit to convert the received state switching instructions into an instruction format. The command encoding unit is a module for instruction standardization, responsible for converting the upper-level logic control language into a hardware-recognizable sequence of low-level control instructions. This process involves instruction code generation, address allocation, execution cycle setting, etc., and the purpose of the conversion is to ensure that the control target and the controller have a compatible data protocol. For example, if the state switching instruction means "enter protection mode," the generated instruction sequence after conversion may contain multiple bytes of control code such as "close main channel," "disconnect relay," and "enable buzzer." This instruction sequence is prepared according to the output format designed by the controller and queued in the output buffer, waiting to be sent to the control execution module. Subsequently, the controller, based on the output format of the aforementioned power-off control command sequence, controls the execution module of the battery-powered control circuit via the power drive pin. The power drive pin is a dedicated output port for controlling high-current or high-voltage switching elements; its output level can directly drive MOSFETs, power relays, or solid-state relays. When executing a power-off command, the controller sets this pin to a high or low level, depending on the control logic of the connected device, generating a shutdown control signal that instructs the execution module to disconnect the battery's electrical connection to the load. To ensure the battery output is indeed disconnected, the controller further samples the voltage of the battery output path based on the transmission status of the shutdown control signal.The controller acquires the output port voltage after a power outage and compares this real-time voltage value with a preset voltage threshold. This threshold is a system-defined "successful power outage" judgment threshold; for example, a voltage less than 0.3 volts is considered an open state. If the sampled result is lower than the threshold, it indicates that the output path has been effectively disconnected, and the controller can set the power outage flag to the completed state. Conversely, if the output voltage is still higher than the threshold, it indicates that the switching device has not been successfully turned off or there is a short circuit fault. The system will enter an alarm or retry mechanism, re-outputting the shutdown command or activating secondary protection. For example, in a battery-driven motor application, if there is still a 5-volt residual voltage after a power outage, the controller will determine that the power outage has failed, possibly due to a MOSFET not being turned off or a short circuit in the output cable, thus triggering the backup power outage path or issuing a fault report. Through the above complete process, the system realizes a closed-loop control structure from risk identification, command generation, control output to power outage verification, ensuring that the battery can quickly and safely cut off the power output after detecting the risk of water ingress, preventing subsequent thermal runaway or electrical damage events.

[0034] In one optional embodiment of this example, after initializing the input pins of the battery water ingress detection circuit according to the battery system's startup signal and establishing a water ingress detection channel for the water ingress pad in the battery water ingress detection circuit, the method further includes: obtaining the pin configuration status of the battery water ingress detection circuit according to the battery system's self-test startup command and generating path configuration parameters; injecting a preset voltage signal into the water ingress pad according to the path configuration parameters and setting at least one input pin of the battery water ingress detection circuit to a high-impedance state to construct a closed-loop test path; determining the electrical consistency of the conduction characteristics of the closed-loop test path based on the difference between the feedback voltage of the closed-loop test path and a preset reference voltage, combined with a preset differential threshold range, and generating a corresponding conduction validity flag bit; comparing the conduction status flag bit with the readback logic level of the input pin to obtain the self-test result of the battery water ingress detection circuit, and updating the detection validity status of the subsequent water ingress detection module according to the self-test result.

[0035] Specifically, in this embodiment, during battery system startup or periodic self-test operation, the controller enters the health status assessment process of the water ingress detection circuit according to a preset self-test start command. This self-test start command is issued by the system master controller during the initialization phase via software command or a timed trigger mechanism. Its function is to activate the controller's internal self-test logic to confirm whether the critical paths of the water ingress detection circuit have stable electrical transmission capabilities. The controller first obtains the pin configuration status related to the water ingress detection circuit according to the command, including the pin numbers, current configuration modes (e.g., input / output, pull-up / pull-down), and their mapping relationship with the pads. By reading the status bits in the pin control register, the controller integrates the above configuration information to generate path configuration parameters. These parameters define the pin functions to be activated in this round of self-test, their level states, and the selection of devices participating in path establishment, used for the subsequent construction of the closed-loop detection path. After obtaining the path configuration parameters, the controller reconfigures the pin functions of the water ingress detection circuit according to the set configuration operation and injects a preset voltage signal into the water ingress pads through the internal signal source module. The signal can be a low-current constant voltage source, such as the 0.6V reference voltage inside the controller, or a low-frequency square wave level, used to simulate the response behavior when water is introduced. The significance of the injected voltage is to construct a test path, allowing the voltage to flow back from the output terminal through the detection circuit to the sampling input terminal, thus forming a closed-loop test path. Simultaneously with the signal injection, the controller configures the corresponding input pin to a high-impedance state. A high-impedance state means that the pin is set not to be actively pulled high or low; it only exhibits a high input impedance state when reading the level, thereby avoiding interference or load effects on the signal source. In this structure, the preset voltage signal can freely return to the controller input terminal through the electrical path between the pads, ensuring that the sampling result accurately reflects the connection integrity and impedance state of the path. Subsequently, the controller acquires the feedback voltage of the closed-loop path through an ADC or voltage sampling logic and performs a differential operation between this feedback voltage value and the reference voltage set in the system. The reference voltage is the standard level value recorded by the system under dry, water-free, and normally connected circuit conditions; the differential result represents the degree of deviation between the actual measured value and the ideal state. The controller further categorizes and judges the deviation value based on a preset differential threshold range. For example, if the reference voltage is 0.6 volts and the allowable deviation is set to ±0.05 volts, the actual sampled value must be between 0.55 and 0.65 volts to be considered a normal circuit. If the differential result exceeds this range, it indicates that there are abnormalities such as poor soldering, open circuit, corrosion, or resistance drift in the test path. Based on the differential analysis results, the controller generates a continuity validity flag, which is a logic signal used to indicate whether the current detection path meets the electrical consistency judgment criteria.After generating the continuity validity flag, the controller further compares it with the readback logic level of the input pin. The readback logic level refers to the level value read by the controller from the high-impedance input pin, which is the high / low logic representation of the feedback voltage after conversion by a level comparator or analog-to-digital converter. This comparison process verifies whether the sampling link is complete. If the continuity validity flag is "valid" and the readback level correctly reflects the direction of the injected voltage, the detection path is considered to be working normally. Based on this, the controller generates a self-test result, indicating whether the current structure and functional state of the battery water ingress detection circuit meets the detection conditions. For example, if the continuity flag is invalid and the readback level is floating, it may indicate a broken circuit or solder pad corrosion. The controller will mark the self-test result as "detection failure" and update the detection module status, temporarily preventing it from participating in the water ingress judgment logic in this round of system testing, thereby avoiding misjudgment or erroneous control behavior caused by signal drift. Through this self-test mechanism, the system can evaluate its own detection capabilities before each water ingress detection, ensuring the reliability and safety of subsequent judgment results.

[0036] In one optional implementation of this embodiment, after initializing the input pins of the battery water ingress detection circuit according to the battery system's startup signal and establishing the water ingress detection channel for the water ingress pad in the battery water ingress detection circuit, the method further includes: obtaining pin group information of multiple preset water ingress detection channels according to the controller's port mapping table, and establishing multiple corresponding water ingress detection channels by performing time-division polling initialization configuration on the pin groups; periodically sampling each water ingress detection channel to obtain the conduction state data sequence of each water ingress detection channel in multiple consecutive sampling periods, and identifying the transition edge of the conduction state data sequence; generating a level stability parameter corresponding to each water ingress detection channel based on the frequency and duration of the transition edge within a set time window, and comparing the level stability parameter with the reference parameter under historical no-water ingress state to generate a difference comparison result; determining the target water ingress detection channel with unstable signal based on the difference comparison result, and generating a conduction judgment result for abnormal water ingress detection channel status; and generating a corresponding power-off control command based on the conduction judgment result.

[0037] Specifically, in the control process for multi-channel water ingress detection, the controller first obtains the pin group information corresponding to all preset water ingress detection channels based on the internally configured port mapping table. The port mapping table is a data structure loaded by software or embedded in the controller's memory during system initialization. It describes the mapping relationship between each pin and the physical detection pad, and is typically organized as a structure or lookup table, including fields such as pin number, logic channel number, sampling priority, and functional area. By reading this mapping table, the controller can identify multiple available detection points in the system and arrange them into pin groups in sequence. After obtaining the pin group information, the controller performs time-division multiplexing initialization configuration for each pin group. Time-division multiplexing refers to dividing multiple channels into time slices for sequential activation, allowing a limited number of sampling resources to serve multiple detection channels. The initialization configuration process includes pin function settings, input mode configuration, resistor parameter settings, and channel number registration. For example, when using an STM32 series controller, the controller configures the GPIO port as an analog or digital input mode and specifies its corresponding ADC channel or logic detection channel number, thereby completing the binding relationship between the channel and hardware resources. Within each polling cycle, the controller activates only the pin group corresponding to the current channel; other channels are not sampled until the next cycle. This mechanism enables the establishment of sequential and efficient detection paths across multiple detection pads, even with limited analog input resources. As multiple channels are gradually activated, the controller periodically samples each water inlet detection channel using timer-driven sampling logic. Each sample records a conduction state, either a logic high or low level, reflecting the current conduction status between the pads. The continuously sampled data forms a conduction state data sequence. This sequence, based on time, records the electrical behavior of each channel as a time series of logic levels. The controller performs edge detection on this data sequence, comparing the levels between adjacent sampling points to determine if a signal transition has occurred. Edge detection can be implemented using XOR operations or a state machine. The identified edge types include rising edges (low to high) and falling edges (high to low), and the timing of the transition is recorded. Subsequently, the controller counts the frequency of transition edges within a set time window and generates a level stability parameter for the detection channel based on the duration of the conduction state. The time window refers to a fixed-length period, such as 10 samples taken within 5 seconds. The controller analyzes the number of transitions and level continuity within this interval. If the number of transitions is frequent and the level duration is short, the channel signal is considered unstable; conversely, if there are few transitions and the level duration is long, the channel is considered stable. The level stability parameter can be calculated using algorithms such as transition count, maximum conduction duration, and state hold ratio, and is used to quantify the stability of each channel within this time period.The controller compares the aforementioned stability parameters with historical baseline parameters taken under water-free conditions. These baseline parameters are data collected during factory calibration or initial operation of the equipment in a water-free state, describing the standard electrical behavior of each channel under normal conditions. The comparison method can be difference calculation, standard deviation analysis, or similarity calculation. If the current stability parameter deviates significantly from historical values, it indicates that the channel's state may be affected by environmental interference, abnormal contact, or moisture erosion. Based on the comparison results, the controller identifies the target detection channel with unstable signals and generates a continuity judgment result for that channel. This result is marked as an abnormal state, indicating a potential water ingress or connection failure in that channel. Finally, the controller generates a corresponding power-off control command based on the continuity judgment result. This command is converted into a hardware control signal by the command encoding unit and sent to the power management module to cut off the main power supply path. This control logic ensures that even in multi-channel detection, timely protective measures can be taken when only one channel experiences an anomaly, preventing system-wide failure or delayed response due to insufficient single-point detection capability, thereby improving the system's robustness and safety in complex environments.

[0038] According to the battery water ingress detection and control method provided in this application, the input pins of the battery water ingress detection circuit are initialized and configured based on the battery system's startup signal, establishing a water ingress detection channel for the water ingress pads in the battery water ingress detection circuit; electrical sampling is performed on the water ingress pads according to the water ingress detection channel to obtain a first detection signal indicating the on / off state between the pads; time series analysis is performed on the first detection signal to determine the signal quality parameters of the first detection signal and generate a water ingress judgment result; based on the water ingress judgment result, a command is output to the battery power supply control circuit to generate a power-off control signal, and the battery output path is disconnected according to the power-off control signal. By implementing this application, a first detection signal composed of a level sequence is obtained, and time series analysis is performed on it to determine the signal quality parameters and generate a water ingress judgment result, effectively improving the accuracy of water ingress detection.

[0039] Figure 2 This application provides a battery water ingress detection and control device, which can be used to implement the battery water ingress detection and control method described in the foregoing embodiments. Figure 2 As shown, the battery water ingress detection and control device mainly includes: Module 10 is used to initialize the input pins of the battery water ingress detection circuit according to the start signal of the battery system, and to establish a water ingress detection channel for the water ingress pad in the battery water ingress detection circuit. The acquisition module 20 is used to perform electrical sampling on the water inlet pads according to the water inlet detection channel and acquire a first detection signal indicating the on / off state between the pads; The judgment module 30 is used to determine the signal quality parameters of the first detection signal by performing time series analysis on the first detection signal, and generate an influent judgment result; The control module 40 is used to output instructions to the battery power supply control circuit based on the water ingress judgment result, generate a power-off control signal, and disconnect the battery output path according to the power-off control signal.

[0040] In one optional implementation of this embodiment, the construction module is specifically used to: obtain the controller's initialization instruction based on the battery system's startup signal, and read the working status register of the battery detection module through the initialization instruction to determine whether the water ingress detection module is in standby mode; configure the resistance parameters of the input pins of the water ingress detection module in standby mode, and obtain the pin number and port mapping information corresponding to the input pins based on the resistance parameter configuration result; and perform channel mapping on the data path between the water ingress pad and the controller based on the pin number and port mapping information to establish a water ingress detection channel for the water ingress pad in the battery water ingress detection circuit.

[0041] In one optional implementation of this embodiment, the acquisition module is specifically used for: calling the internal sampling trigger unit of the controller according to the channel number after the water inlet detection channel is established, generating electrical sampling trigger configuration parameters by setting the sampling period and trigger conditions; periodically sampling the electrical connection status between the water inlet pads according to the trigger configuration parameters to obtain the level sampling data of the instantaneous conduction status between the pads; generating a preliminary stable level sequence signal by performing numerical verification on the level sampling data; and logically judging the conduction status between the water inlet pads according to the duration of the level change in the level sequence signal to obtain the first detection signal of the on / off status between the pads.

[0042] In an optional implementation of this embodiment, the judgment module is specifically used to: extract the level state sequence within multiple consecutive sampling periods according to the sampling time axis of the first detection signal, and group the level state sequence into groups by segmenting through a time window to generate a set of grouped time segments; analyze the level transition frequency of the time segment set to obtain the number of high-level and low-level transitions in each group of segments, and calculate the level stability index of each segment based on the number of transitions; based on the level stability index and combined with a preset electrical noise threshold range, determine whether the first detection signal has abnormal characteristics, and generate a corresponding signal quality flag bit; perform state fusion based on the signal quality flag bit and the conduction state duration in the time segment, and generate a water ingress judgment result based on a preset water ingress state judgment threshold.

[0043] In one optional implementation of this embodiment, the control module is specifically used to: obtain the controller's state switching instruction based on the state determination value of the water inflow judgment result, and determine the execution priority of the power-off control process by filtering the interrupt priority of the controller's interrupt management module; call the command encoding unit inside the controller according to the execution priority to convert the state switching instruction into an instruction format and generate a power-off control instruction sequence; drive the execution module of the battery power supply control circuit according to the output format of the power-off control instruction sequence, and apply a shutdown control signal to the control switching device through the power drive pin; and perform electrical sampling of the voltage of the battery output path according to the transmission feedback status of the shutdown control signal, and compare the collected real-time voltage value with a set threshold to determine that the battery output path has been disconnected.

[0044] In an optional implementation of this embodiment, the control module is further configured to: obtain the pin configuration status of the battery water ingress detection circuit according to the self-test start command of the battery system, and generate path configuration parameters; inject a preset voltage signal into the water ingress pad according to the path configuration parameters, and set at least one input pin of the battery water ingress detection circuit to a high impedance state to construct a closed-loop test path; perform electrical consistency determination on the conduction characteristics of the closed-loop test path according to the difference result between the feedback voltage of the closed-loop test path and the preset reference voltage, combined with a preset differential threshold range, and generate a corresponding conduction validity flag bit; compare the conduction status flag bit with the readback logic level of the input pin to obtain the self-test result of the battery water ingress detection circuit, and update the detection validity status of the subsequent water ingress detection module according to the self-test result.

[0045] In an optional embodiment of this example, the control module is further configured to: obtain pin group information of multiple preset water inlet detection channels according to the port mapping table of the controller, and establish multiple corresponding water inlet detection channels by performing time-division polling initialization configuration on the pin groups; obtain the conduction state data sequence of each water inlet detection channel in multiple consecutive sampling periods by periodically sampling each water inlet detection channel, and identify the transition edge of the conduction state data sequence; generate the level stability parameter corresponding to each water inlet detection channel according to the frequency and duration of the transition edge in a set time window, and compare the level stability parameter with the reference parameter in the historical no-water-inlet state to generate a difference comparison result; determine the target water inlet detection channel with unstable signal according to the difference comparison result, and generate a conduction judgment result of abnormal water inlet detection channel state; and generate a corresponding power-off control command according to the conduction judgment result.

[0046] According to the battery water ingress detection and control device provided in this application, the input pins of the battery water ingress detection circuit are initialized and configured based on the battery system's start signal, establishing a water ingress detection channel for the water ingress pads in the battery water ingress detection circuit; electrical sampling is performed on the water ingress pads according to the water ingress detection channel to obtain a first detection signal indicating the on / off state between the pads; time series analysis is performed on the first detection signal to determine the signal quality parameters of the first detection signal and generate a water ingress judgment result; based on the water ingress judgment result, a command is output to the battery power supply control circuit to generate a power-off control signal, and the battery output path is disconnected according to the power-off control signal. By implementing this application, a first detection signal composed of a level sequence is obtained, and time series analysis is performed on it to determine the signal quality parameters and generate a water ingress judgment result, effectively improving the accuracy of water ingress detection.

[0047] According to the scheme provided in this application Figure 3 An electronic device is provided as an embodiment of this application. This electronic device can be used to implement the battery water ingress detection and control method in the foregoing embodiments, and mainly includes: The system includes a memory 301, a processor 302, and a computer program 303 stored on the memory 301 and executable on the processor 302. The memory 301 and the processor 302 are connected via communication. When the processor 302 executes the computer program 303, it implements the battery water ingress detection and control method described in the foregoing embodiments. The number of processors can be one or more.

[0048] The memory 301 can be a high-speed random access memory (RAM) or a non-volatile memory, such as a disk storage device. The memory 301 is used to store executable program code, and the processor 302 is coupled to the memory 301.

[0049] Furthermore, embodiments of this application also provide a computer-readable storage medium, which may be disposed in the electronic device described in the above embodiments, and the computer-readable storage medium may be as described above. Figure 3 The memory in the illustrated embodiment.

[0050] The computer-readable storage medium stores a computer program that, when executed by a processor, implements the battery water ingress detection and control method described in the foregoing embodiments. Furthermore, the computer-readable storage medium can also be a USB flash drive, external hard drive, read-only memory (ROM), RAM, magnetic disk, or optical disk, or any other medium capable of storing program code.

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

[0052] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0053] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A method for detecting and controlling water ingress in a battery, characterized in that, include: The input pins of the battery water ingress detection circuit are initialized and configured according to the start signal of the battery system, and a water ingress detection channel for the water ingress pad in the battery water ingress detection circuit is established. Electrical sampling is performed on the water inlet pads according to the water inlet detection channel to obtain a first detection signal indicating the on / off state between the pads; By performing time series analysis on the first detection signal, the signal quality parameters of the first detection signal are determined, and an influent judgment result is generated. Based on the water ingress determination result, the battery power supply control circuit is given a command output to generate a power-off control signal, and the battery output path is disconnected according to the power-off control signal.

2. The battery water ingress detection and control method according to claim 1, characterized in that, The step of initializing the input pins of the battery water ingress detection circuit according to the battery system's startup signal, and establishing a water ingress detection channel for the water ingress pads in the battery water ingress detection circuit, includes: The controller's initialization command is obtained based on the battery system's start signal, and the working status register of the battery detection module is read through the initialization command to determine whether the water ingress detection module is in standby mode. Configure the resistance parameters of the input pins of the water ingress detection module in standby mode, and obtain the pin number and port mapping information corresponding to the input pins based on the resistance parameter configuration results; Based on the pin number and port mapping information, channel mapping is performed on the data path between the water ingress pad and the controller to establish a water ingress detection channel for the water ingress pad in the battery water ingress detection circuit.

3. The battery water ingress detection and control method according to claim 2, characterized in that, The step of performing electrical sampling on the water inlet pads according to the water inlet detection channel to obtain a first detection signal representing the on / off state between the pads includes: Based on the channel number established after the water inlet detection channel is established, the internal sampling trigger unit of the controller is invoked, and the electrical sampling trigger configuration parameters are generated by setting the sampling period and trigger conditions; The electrical connection status between the water inlet pads is periodically sampled according to the trigger configuration parameters to obtain the level sampling data of the instantaneous conduction status between the pads; By performing numerical verification on the level sampling data, a preliminary stable level sequence signal is generated; Based on the duration of the level change in the level sequence signal, the conduction state between the water inlet pads is logically determined to obtain the first detection signal of the on / off state between the pads.

4. The battery water ingress detection and control method according to claim 1, characterized in that, The step of performing time series analysis on the first detection signal to determine the signal quality parameters of the first detection signal and generating an influent judgment result includes: Based on the sampling time axis of the first detection signal, the level state sequence within multiple consecutive sampling periods is extracted, and the level state sequence is grouped by time window segmentation to generate a grouped time segment set; By performing level transition frequency analysis on the time sequence segment set, the number of high-level and low-level transitions in each segment is obtained, and the level stability index of each segment is calculated based on the number of transitions. Based on the level stability index and combined with the preset electrical noise threshold range, it is determined whether the first detection signal has abnormal characteristics, and a corresponding signal quality flag bit is generated. The state is fused based on the signal quality flag and the duration of the conduction state in the timing segment, and a water ingress judgment result is generated based on a preset water ingress state judgment threshold.

5. The battery water ingress detection and control method according to claim 1, characterized in that, The step of outputting a command to the battery power supply control circuit based on the water ingress determination result, generating a power-off control signal, and disconnecting the battery output path according to the power-off control signal includes: The controller's state switching command is obtained based on the state determination value of the water inlet judgment result, and the execution priority of the power outage control process is determined by filtering the interrupt priority of the controller's interrupt management module. According to the execution priority, the command encoding unit inside the controller is invoked to convert the state switching instruction into an instruction format and generate a power-off control instruction sequence; According to the output format of the power-off control command sequence, the execution module of the battery power supply control circuit is driven, and a power-off control signal is applied to the control switching device through the power drive pin; Based on the transmission feedback status of the shutdown control signal, the voltage of the battery output path is electrically sampled, and the collected real-time voltage value is compared with a set threshold to determine that the battery output path has been disconnected.

6. The battery water ingress detection and control method according to claim 1, characterized in that, After the step of initializing the input pins of the battery water ingress detection circuit according to the battery system's startup signal and establishing a water ingress detection channel for the water ingress pads in the battery water ingress detection circuit, the method further includes: According to the self-test start command of the battery system, the pin configuration status of the battery water ingress detection circuit is obtained, and the path configuration parameters are generated. According to the path configuration parameters, a preset voltage signal is injected into the water ingress pad, and at least one input pin of the battery water ingress detection circuit is set to a high impedance state to construct a closed-loop test path. Based on the difference between the feedback voltage of the closed-loop test path and the preset reference voltage, and combined with the preset difference threshold range, the electrical consistency of the conduction characteristics of the closed-loop test path is determined, and a corresponding conduction validity flag is generated. The self-test result of the battery water ingress detection circuit is obtained by comparing the conduction status flag with the readback logic level of the input pin, and the detection validity status of the subsequent water ingress detection module is updated based on the self-test result.

7. The battery water ingress detection and control method according to claim 2, characterized in that, After the step of initializing the input pins of the battery water ingress detection circuit according to the battery system's startup signal and establishing a water ingress detection channel for the water ingress pads in the battery water ingress detection circuit, the method further includes: According to the port mapping table of the controller, the pin group information of multiple preset water inlet detection channels is obtained, and the corresponding multiple water inlet detection channels are established by performing time-division polling initialization configuration on the pin groups. By periodically sampling each of the water inlet detection channels, the conduction state data sequence of each water inlet detection channel in multiple consecutive sampling periods is obtained, and the transition edge of the conduction state data sequence is identified. Based on the frequency and duration of the transition edge within a set time window, level stability parameters corresponding to each water inlet detection channel are generated, and the level stability parameters are compared with the baseline parameters under historical no-water-inlet conditions to generate a comparison result. Based on the difference comparison results, the target water inlet detection channel with unstable signal is determined, and a conduction judgment result of abnormal water inlet detection channel status is generated. Based on the conduction determination result, a corresponding power-off control command is generated.

8. A battery water ingress detection and control device, characterized in that, The battery water ingress detection and control device is used to implement the battery water ingress detection and control method according to claim 1, and the battery water ingress detection and control device includes: The module is used to initialize and configure the input pins of the battery water ingress detection circuit according to the start signal of the battery system, and to establish a water ingress detection channel for the water ingress pad in the battery water ingress detection circuit. The acquisition module is used to perform electrical sampling on the water inlet pads according to the water inlet detection channel to acquire a first detection signal indicating the on / off state between the pads; The judgment module is used to determine the signal quality parameters of the first detection signal by performing time series analysis on the first detection signal, and generate an influent judgment result; The control module is used to output instructions to the battery power supply control circuit based on the water ingress judgment result, generate a power-off control signal, and disconnect the battery output path according to the power-off control signal.

9. An electronic device, characterized in that, Includes memory and processor, of which: The processor is used to execute computer programs stored in the memory; When the processor executes the computer program, it implements the steps in the battery water ingress detection and control method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the battery water ingress detection and control method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Battery pack water inlet detection device with self-checking function and control method thereof

    CN111751743A