Communication mode switching method and apparatus, and energy storage device
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN HELLO TECH ENERGY CO LTD
- Filing Date
- 2026-05-11
- Publication Date
- 2026-08-07
AI Technical Summary
[0004]本发明实施例的目的是提供一种通信模式切换方法、装置和储能设备,能够解决无法在通信中断风险发生前完成通信链路的无缝预备与切换,储能设备的运行安全性不足的问题
[0015]可以理解地,通过硬件接口的资源分组与虚拟化,实现了以极少引脚资源管理多台从设备的能力。这种架构为储能设备中一个微控制单元需集中监控多个电池模组或AFE芯片的场景提供了理想的解决方案。不仅大幅节省了主控芯片宝贵的引脚资源,降低了系统复杂性与成本,还通过创建多条独立总线实现了通信负载的分散与故障的隔离,显著增强了系统管理的灵活性及整体通信架构的可靠性。
Smart Images

Figure CN122533932A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of energy storage technology, and more specifically, to a communication mode switching method, apparatus, and energy storage device. Background Technology
[0002] Currently, the communication mode management between the active front end (AFE) and the microcontroller unit (MCU) in related technologies mostly adopts a passive fault switching mechanism, which only initiates the switching of the backup communication mode when there is an explicit fault such as a clear interruption or continuous verification failure in the current communication link.
[0003] The passive failover mechanism lacks quantitative perception and trend prediction of communication link quality, and cannot intervene in the early stage of gradual degradation of communication quality, nor can it complete seamless preparation and switching of communication links before the risk of communication interruption occurs. This exposes the system to potential risks such as data acquisition distortion, delayed safety warnings, and even control failure caused by the degradation of communication link performance, resulting in insufficient operational safety of energy storage devices. Summary of the Invention
[0004] The purpose of this invention is to provide a communication mode switching method, apparatus, and energy storage device that can solve the problem of insufficient operational safety of energy storage devices due to the inability to complete seamless preparation and switching of communication links before the risk of communication interruption occurs.
[0005] In view of this, an embodiment of the first aspect of the present invention provides a communication mode switching method.
[0006] A second aspect of the present invention provides a communication mode switching device.
[0007] An embodiment of the third aspect of the present invention provides an energy storage device.
[0008] To achieve the above objectives, an embodiment of the first aspect of the present invention provides a communication mode switching method applied to an energy storage device. The energy storage device includes a microcontroller unit and an analog front-end, which are connected via a communication interface. The communication interface includes a protocol selection line and at least one general-purpose data line. The communication mode switching method includes: acquiring the level state of the protocol selection line; determining a first communication allocation characteristic of the at least one general-purpose data line based on the level state; performing data interaction with the analog front-end based on the first communication allocation characteristic to determine communication quality parameters; determining a communication degradation trend based on the communication quality parameters; determining a pre-switching decision to perform communication mode switching before the communication quality parameters drop to a preset switching threshold based on the communication degradation trend; responding to the pre-switching decision, determining a second communication allocation characteristic based on the communication degradation trend; and determining a target level state corresponding to the protocol selection line based on the second communication allocation characteristic, so that the at least one general-purpose data line switches from the first communication allocation characteristic to the second communication allocation characteristic.
[0009] Understandably, by quantitatively monitoring communication quality and intelligently predicting trends, it is possible to complete the hardware preparation and seamless switching of backup communication paths in advance, before the communication link truly deteriorates to the point of affecting data transmission. This fundamentally avoids the distortion or loss of critical battery status information due to communication quality degradation or interruption, significantly improving the real-time perception and proactive prevention capabilities of energy storage devices against safety hazards such as overcharging, over-discharging, and internal short circuits, thereby greatly enhancing the inherent safety and reliability of energy storage device operation.
[0010] In some technical solutions, optionally, determining a first communication allocation feature of at least one general-purpose data line based on the level state includes: determining a target mode from a preset variety of communication protocol modes based on the level state; determining the first communication allocation feature corresponding to each general-purpose data line based on the interface definition of the target mode; and determining a communication link for data interaction with the analog front end based on the first communication allocation feature, so as to perform data interaction with the analog front end through the communication link.
[0011] Understandably, the dynamic reconfiguration of the communication hardware interface is achieved through programmable level signals, enabling the same set of physical data lines to switch instantly to functional pins supporting different communication protocols according to instructions. This virtualization and dynamic scheduling capability of hardware resources allows energy storage devices to be compatible with various types of analog front-end chips without adding extra physical connections, and can flexibly select the optimal communication scheme according to the operating environment, thereby significantly enhancing the flexibility of hardware adaptation at the system level.
[0012] In some technical solutions, optionally, the first communication allocation feature corresponding to each general data line is determined based on the interface definition of the target mode, including: determining the first communication allocation feature according to the target mode, wherein the first communication allocation feature specifies that all general data lines belong to the same logical interface group; and configuring all general data lines as different signal lines with complementary functions within the logical interface group according to the first communication allocation feature, so as to jointly form a synchronous serial communication interface.
[0013] Understandably, by integrating all communication resources into a single fully functional synchronous interface, communication efficiency is maximized. This provides a high-speed data link for core status monitoring of energy storage devices, ensuring that critical safety parameters such as voltage and temperature can be collected and reported in real time without obstruction. This provides crucial high-bandwidth, low-latency communication assurance for precise battery management and safety early warning, effectively meeting the extreme performance requirements of high-reliability energy storage devices for core data stream transmission.
[0014] In some technical solutions, optionally, the first communication allocation feature corresponding to each general data line is determined based on the interface definition of the target mode, including: determining the first communication allocation feature according to the target mode, wherein the first communication allocation feature specifies that the general data line is divided into multiple independent logical interface groups; and configuring the general data lines in each logical interface group as signal line pairs with the same function according to the first communication allocation feature, thereby forming multiple independently addressable shared bus communication interfaces.
[0015] Understandably, by grouping and virtualizing hardware interface resources, the ability to manage multiple slave devices with minimal pin resources is achieved. This architecture provides an ideal solution for scenarios in energy storage devices where a single microcontroller unit needs to centrally monitor multiple battery modules or AFE chips. It not only significantly saves valuable pin resources of the main control chip, reducing system complexity and cost, but also achieves distributed communication load and fault isolation by creating multiple independent buses, significantly enhancing the flexibility of system management and the reliability of the overall communication architecture.
[0016] In some technical solutions, optionally, the first communication allocation feature corresponding to each general data line is determined based on the interface definition of the target mode, including: determining the first communication allocation feature according to the target mode, wherein the first communication allocation feature specifies that each general data line is independently configured as a logical interface; and configuring time-division communication capability for each general data line as an independent logical interface according to the first communication allocation feature, thereby forming multiple parallel communication interfaces.
[0017] Understandably, through extreme hardware decoupling and time-sharing scheduling, the highest level of redundancy and anti-interference capability of the communication link is achieved. Even if some lines fail due to interference, aging, or physical damage, any remaining single-line interface can still independently maintain critical communication between the system and the analog front end, achieving communication fault tolerance where a single point of failure does not affect the overall system. This fundamentally solves the major safety hazard of blind spots in system monitoring caused by communication interruptions under harsh conditions, and improves the operational safety of energy storage devices.
[0018] In some technical solutions, optionally, the communication degradation trend is determined based on communication quality parameters, including: determining the communication degradation trend based on the change data of communication quality parameters within at least one data transmission cycle, wherein the data transmission cycle corresponds to the analog front end.
[0019] Understandably, upgrading the assessment of communication status from a static, single-threshold-based judgment to a dynamic, time-series-based trend prediction enables the system to anticipate potential downlink risks before communication link performance substantially deteriorates and reaches traditional fault thresholds. By identifying early signs, a time window is gained for subsequent preventative optimization or forward-looking switching decisions, thereby improving the foresight of mode switching.
[0020] In some technical solutions, optionally, determining the communication degradation trend based on communication quality parameters includes: determining the communication quality level based on the communication quality parameters; and determining the pre-handover decision based on the communication quality level and the communication degradation trend.
[0021] Understandably, the collaborative decision-making mechanism of current situation assessment and trend prediction greatly enhances the intelligence and accuracy of switching decisions.
[0022] In some technical solutions, optionally, the communication quality level is determined based on communication quality parameters, including: determining the delay matching result based on the delay parameter in the communication quality parameters; determining the failure frequency matching result based on the failure frequency parameter in the communication quality parameters; determining the check error matching result based on the check error parameter in the communication quality parameters; and determining the communication quality level based on the delay matching result, the failure frequency matching result, and the check error matching result.
[0023] Understandably, by setting clear quantitative thresholds for different dimensions and making comprehensive judgments, the ambiguity and one-sidedness of traditional single thresholds or subjective judgments are eliminated. This multi-dimensional hierarchical evaluation enables the microcontroller unit to determine the exact health level of the current communication link in real time and accurately, providing a clear and reliable immediate basis for subsequent judgments on whether it is stable, needs optimization, or is on the verge of failure.
[0024] In some technical solutions, optionally, after switching at least one general-purpose data line from a first communication allocation feature to a second communication allocation feature, the communication mode switching method further includes: obtaining interface configuration information corresponding to the first communication allocation feature; during operation based on the second communication allocation feature, obtaining actual communication quality parameters based on the second communication allocation feature, and simulated communication quality parameters obtained by simulating operation based on the saved interface configuration information; determining a comparison result based on the actual communication quality parameters and the simulated communication quality parameters; and triggering a switch from the second communication allocation feature to the first communication allocation feature when the comparison result meets a preset switchback condition.
[0025] Understandably, by introducing dynamic optimization and adaptive back-switch capabilities based on performance comparison, the management of the communication link becomes a continuously self-optimizing closed loop. This ensures that the system not only proactively avoids risks but also pursues optimal performance, thus adaptively maintaining the best-matched and highest-performing communication state with the current environment at any given time. This further enhances the long-term reliability of the communication link throughout the entire lifecycle of the energy storage device.
[0026] In some technical solutions, the communication mode switching method may optionally include: determining a historical operating dataset based on communication quality parameters, communication degradation trends, pre-switching decisions, and characteristic switching events; determining an optimization objective based on the historical operating dataset, the optimization objective including at least one of a threshold parameter for determining the communication quality level, an algorithm model parameter for determining the communication degradation trend, and a strategy rule for generating pre-switching decisions; and updating the corresponding threshold parameter, algorithm model parameter, or strategy rule based on the optimization objective.
[0027] Understandably, microcontrollers can continuously calibrate their judgment criteria, optimize their prediction models, and refine their decision-making strategies based on real data from long-term operation on specific energy storage devices. This makes them increasingly adaptable to the unique electromagnetic environment and hardware characteristics of the devices, significantly improving communication reliability and the overall level of intelligent safety management during long-term operation.
[0028] A second aspect of the present invention provides a communication mode switching device, comprising: a state acquisition module for acquiring the level state of a protocol selection line; a feature allocation module for determining a first communication allocation feature of at least one general data line based on the level state; a parameter determination module for performing data interaction with an analog front end based on the first communication allocation feature to determine communication quality parameters; a trend prediction module for determining a communication degradation trend based on the communication quality parameters; a decision module for determining a pre-switching decision to perform a communication mode switching before the communication quality parameters drop to a preset switching threshold based on the communication degradation trend; a target determination module for determining a second communication allocation feature based on the communication degradation trend in response to the pre-switching decision; and a switching execution module for determining a target level state corresponding to the protocol selection line based on the second communication allocation feature, so that at least one general data line switches from the first communication allocation feature to the second communication allocation feature.
[0029] An embodiment of the third aspect of this application provides an energy storage device, including a microcontroller unit and an analog front-end, which are connected via a communication interface, including a protocol selection line and at least one general data line; the energy storage device also includes the communication mode switching device described in the second aspect.
[0030] Additional aspects and advantages of the technical solutions of the present invention will become apparent in the following description or may be learned by practice of the invention. Attached Figure Description
[0031] Figure 1 One of the flowcharts of the communication mode switching method according to this application is shown;
[0032] Figure 2 A second flowchart illustrating the communication mode switching method according to this application is shown;
[0033] Figure 3 A third flowchart illustrating the communication mode switching method according to this application is shown;
[0034] Figure 4 A fourth flowchart illustrating the communication mode switching method according to this application is shown;
[0035] Figure 5 Fifth of the flowcharts illustrating the communication mode switching method according to this application is shown;
[0036] Figure 6 A flowchart of the communication mode switching method according to this application is shown in diagram six;
[0037] Figure 7 A flowchart of the communication mode switching method according to this application is shown in diagram seven;
[0038] Figure 8 Eighth flowchart of the communication mode switching method according to this application is shown;
[0039] Figure 9 A flowchart of the communication mode switching method according to this application is shown in diagram number nine;
[0040] Figure 10 A schematic block diagram of the communication mode switching device according to this application is shown;
[0041] Figure 11 A schematic block diagram of the energy storage device according to this application is shown;
[0042] Figure 12 A schematic diagram of the circuit connection relationship according to this application is shown;
[0043] Figure 13 The tenth flowchart of the communication mode switching method according to this application is shown.
[0044] Among them, 900: communication mode switching device; 902: status acquisition module; 904: feature allocation module; 906: parameter determination module; 908: trend prediction module; 910: decision module; 912: target determination module; 914: switching execution module;
[0045] 1000: Energy storage device; 1002: Microcontroller unit; 1004: Analog front end; 2000: Communication interface; 2002: Protocol selection line; 2004: General data line. Detailed Implementation
[0046] To better understand the above-described objectives, features, and advantages of the embodiments of the present invention, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.
[0047] As a core component for parameter acquisition in various electronic systems, the AFE chip is responsible for real-time acquisition of key data such as voltage, temperature, and current of the battery cell (or sensing element), and transmitting the data to the MCU for processing and analysis. This enables system operation control, safety warnings, and fault handling. In energy storage devices, the reliability of communication between the AFE and the MCU directly determines the operational safety and stability of the device. Communication interruptions or data transmission errors can prevent the MCU from accurately obtaining the battery cell status, potentially leading to safety hazards such as overcharging, over-discharging, internal short circuits, and leakage, or even serious accidents like fires and explosions. Therefore, the communication link between the AFE and the MCU is a core element of active safety protection for energy storage devices. In other electronic scenarios, communication anomalies can also lead to data acquisition distortion, causing system misjudgments and operational malfunctions.
[0048] Currently, most systems use a "passive fault switching" mechanism for switching between AFE and MCU communication modes, meaning that the system will only switch to the secondary communication mode when a significant fault occurs in the primary communication mode. This switching method has significant technical flaws: First, the switching timing is delayed. When communication quality gradually deteriorates but is not completely interrupted, data transmission may experience errors and increased latency, leading to distorted parameter acquisition and an inability to detect cell or system anomalies in a timely manner. This violates the requirements of proactive safety control, especially in energy storage devices, where defects can directly amplify safety hazards. Second, it lacks a quantitative assessment mechanism for communication quality, relying solely on the number of error checks to determine the communication status. This judgment logic is crude and prone to incorrect or missed switching, affecting system stability. Third, it lacks a self-healing optimization mechanism for communication parameters. Once a minor communication anomaly occurs, the communication mode is switched directly, increasing communication link fluctuations and failing to address communication problems caused by minor interference at their root. This makes it difficult to adapt to complex operating environments such as energy storage devices and industrial control systems (e.g., electromagnetic interference, temperature fluctuations, and wiring aging in energy storage power stations). Fourth, the switching strategy is not designed in conjunction with proactive safety requirements, making it impossible to proactively avoid safety hazards caused by data acquisition distortion through communication switching, and failing to meet the requirements for high safety and high reliability.
[0049] Therefore, in response to the proactive safety requirements of various scenarios, including energy storage devices, designing an AFE multi-communication mode adaptive switching method that can quantify and classify communication quality, achieve proactive predictive switching, possess self-healing optimization capabilities, and link with system safety control has become an urgent technical problem to be solved.
[0050] Many specific details are set forth in the following description in order to provide a full understanding of this application. However, embodiments of the invention may also be implemented in other ways different from those described herein. Therefore, the scope of protection of this application is not limited to the specific embodiments disclosed below.
[0051] The communication mode switching method, apparatus, and energy storage device provided in this application will be described in detail below with reference to specific embodiments and application scenarios.
[0052] This embodiment provides a communication mode switching method applied to an energy storage device. The energy storage device includes a microcontroller unit and an analog front-end, which are connected via a communication interface. The communication interface includes a protocol selection line and at least one general-purpose data line, such as... Figure 1 As shown, the communication mode switching method includes:
[0053] Step S100: Obtain the level status of the protocol selection line;
[0054] Step S102: Determine the first communication allocation characteristic of at least one general-purpose data line based on the level state;
[0055] Step S104: Based on the first communication allocation characteristics, perform data interaction with the analog front end to determine the communication quality parameters;
[0056] Step S106: Determine the communication degradation trend based on communication quality parameters;
[0057] Step S108: Determine a pre-switching decision based on the communication degradation trend to switch communication modes before the communication quality parameters drop to a preset switching threshold;
[0058] Step S110: In response to the pre-switching decision, determine the second communication allocation characteristics based on the communication degradation trend;
[0059] Step S112: Determine the target level state corresponding to the protocol selection line according to the second communication allocation feature, so that at least one general data line switches from the first communication allocation feature to the second communication allocation feature.
[0060] This invention provides a communication mode switching method for energy storage devices. The microcontroller unit first determines the first communication allocation characteristic used for communication with the analog front end by reading the level state of the protocol selection line, and collects multi-dimensional communication quality parameters in real time during this communication process. Based on trend analysis of the historical sequences of these parameters, the degradation trend of the communication link can be predicted in advance.
[0061] When a decline in communication quality is predicted in the future but has not yet reached the threshold requiring a switchover, the microcontroller unit proactively generates a pre-switching decision. Based on the degradation trend, it intelligently selects a more robust secondary communication allocation feature and drives the hardware logic of the communication interface to reconfigure in the background by changing the level state of the protocol selection line, thereby achieving a seamless switchover from the current communication mode to the target mode.
[0062] Understandably, by quantitatively monitoring communication quality and intelligently predicting trends, it is possible to complete the hardware preparation and seamless switching of backup communication paths in advance, before the communication link truly deteriorates to the point of affecting data transmission. This fundamentally avoids the distortion or loss of critical battery status information due to communication quality degradation or interruption, significantly improving the real-time perception and proactive prevention capabilities of energy storage devices against safety hazards such as overcharging, over-discharging, and internal short circuits, thereby greatly enhancing the inherent safety and reliability of energy storage device operation.
[0063] Specifically, the communication mode switching method is mainly applied to energy storage devices with extremely high requirements for operational safety and reliability, including but not limited to large-scale energy storage power stations, industrial and commercial energy storage devices, and home energy storage devices.
[0064] In these energy storage devices, the microcontroller unit is responsible for operation control, status management, and safety decision-making; the analog front end is directly connected to multiple battery cells, which collect key analog signals such as voltage, temperature, and current in real time and convert them into digital signals.
[0065] The microcontroller unit is connected to the analog front end via a communication interface, which includes a protocol selection line and at least one general data line.
[0066] Acquiring the protocol select line's level status refers to the process by which the microcontroller unit (MCU) reads the current electrical level (e.g., high or low) of the protocol select line through its configured general-purpose input / output pins during power-on initialization or operation. This level status is a predefined hardware configuration instruction, with different values corresponding to different communication protocol rules to be followed when communicating with the analog front-end. By reading this status, the MCU determines what type of logical communication connection should be established with the analog front-end.
[0067] After acquiring the current level state, a first communication allocation characteristic for at least one general-purpose data line is determined based on the level state. The communication allocation characteristic specifically defines the functional role that each general-purpose data line should play in the current communication session and the logical connection relationship between these data lines.
[0068] For example, the microcontroller internally stores a mapping table between voltage levels and communication protocol modes. Based on the specific voltage level value read, the corresponding target communication protocol mode is determined by looking up the table, such as synchronous serial peripheral interface mode, integrated circuit bus mode, or single-wire communication protocol mode. Based on the hardware interface definition of the determined target communication protocol mode, a specific signal function role is assigned to each general-purpose data line participating in the communication.
[0069] For example, if the target mode is a synchronous serial peripheral interface mode, the communication allocation feature may specify that all general data lines are configured into a logical interface group, and within this group they are defined as clock lines, master output / slave input data lines, master input / slave output data lines, and chip select lines, respectively.
[0070] Based on the established first communication allocation characteristics, the microcontroller unit and the analog front end begin periodic data interaction.
[0071] In this process, the communication quality parameters are determined as follows: at the start of each data read or configuration command sent by the microcontroller to the analog front end, the microcontroller records a precise timestamp; at the completion of successfully receiving the response data returned by the analog front end, another timestamp is recorded. The difference between the two timestamps is calculated as the response delay for this interaction.
[0072] Meanwhile, the microcontroller maintains two sliding time windows, such as a short window of 3 seconds and a long window of 10 seconds, and continuously counts the number of times no valid response is received within these two windows, i.e., the communication failure frequency.
[0073] In addition, the microcontroller performs integrity checks such as cyclic redundancy check on each frame of data received, and also counts the number of verification errors in both the short and long windows.
[0074] Response latency, short window failure frequency, long window failure frequency, short window check error frequency, and long window check error frequency—these indicators collected in real time together constitute communication quality parameters that reflect the real-time health status of the current communication link.
[0075] After obtaining continuous communication quality parameters, the communication degradation trend is determined based on the communication quality parameters, and time series feature analysis and trend prediction are performed on the sequence data of communication quality parameters changing over time.
[0076] The microcontroller organizes communication quality parameters from current and historical consecutive data transmission cycles into a time series. Using specific prediction algorithms or large language models, it learns and analyzes the patterns of change in these parameters. The algorithm analyzes whether recent response latency shows a continuous linear increase or an accelerating increase, and whether the error frequency within the statistical window shows a clustered increase. Based on this analysis, it outputs a qualitative or semi-quantitative judgment on the direction and rate of communication quality changes over a future period, i.e., the communication degradation trend. Multiple different levels are set for the communication degradation trend to proactively detect the risk of future communication link deterioration.
[0077] The determination of communication degradation trends based on communication quality parameters is achieved through a specially trained lightweight artificial intelligence prediction model.
[0078] Artificial intelligence prediction models use time-series communication quality parameters as core input features.
[0079] Specifically, the model receives a sequence of historical and real-time communication quality parameters within a fixed-length time window. The sequence of historical and real-time communication quality parameters includes multivariate time series data such as response delay at each sampling time, communication failure frequency and verification error frequency within multiple statistical windows.
[0080] The artificial intelligence prediction model is structurally designed to include two parts: feature extraction and trend classification.
[0081] The feature extraction section typically consists of a temporal feature engineering module or a shallow temporal network, responsible for automatically extracting key features from the input multivariate parameter sequence that characterize the changing patterns of communication link health. These features may include, but are not limited to: the moving average and standard deviation of latency, the short-term gradient of error frequency, the cross-correlation characteristics between different quality parameters, and the frequency of occurrence of specific anomaly patterns. Based on the extracted deep features, the model then performs comprehensive reasoning and judgment in the trend classification section, ultimately outputting a qualitative prediction of the direction of communication quality changes within a preset time period, i.e., the communication degradation trend.
[0082] Artificial intelligence prediction models need to undergo offline supervised learning training before deployment.
[0083] The training dataset is derived from a large amount of historical operational data, which records the evolution of communication quality parameters and their ultimate consequences of communication failures under various typical operating scenarios and different interference conditions. The goal of model training is to learn the complex mapping relationship between parameter sequences and future trend levels, enabling it to identify potential degradation patterns from early, subtle parameter changes.
[0084] In actual operation, the artificial intelligence prediction model is integrated into the software algorithm of the microcontroller unit, and runs with low power consumption and low latency in a forward inference manner, periodically performing health prognosis diagnosis on the communication link status.
[0085] The AI prediction model also has the ability to learn online or fine-tune parameters. The system continuously compares the actual evolution of communication quality with the model's predictions to generate new training samples.
[0086] Based on this real-time generated operational data, the system can periodically make minor adjustments and optimizations to the model's internal parameters, thereby enabling the prediction model to adapt to the unique operating environment of a specific energy storage device.
[0087] If a trend indicates that the quality of the communication link is continuously declining and is expected to reach or exceed the handover threshold in the foreseeable future, a pre-handover decision is immediately generated. By making a pre-handover decision, handover preparations are initiated in advance, before the communication quality deteriorates to the point of affecting data collection, thus transforming the handover action from a passive response after a failure to a proactive intervention before risks arise.
[0088] Once the pre-handover decision is generated, the microcontroller unit responds immediately. In response to the pre-handover decision, it determines a second communication allocation characteristic based on the communication degradation trend. Based on the type of interference or the degree of link attenuation implied by the degradation trend, it selects a target mode from a variety of pre-set available communication protocol modes that is expected to have stronger anti-interference capabilities or is more suitable for the current environment.
[0089] The microcontroller unit looks up the target communication protocol mode corresponding to the second communication allocation feature to obtain the level state value that should be output, i.e. the target level state.
[0090] The microcontroller controls the pins of its connection protocol selection line to output this target level state.
[0091] A change in the voltage level on the protocol selection line is a clear hardware reconfiguration instruction for the analog front-end. Upon detecting the voltage change, the analog front-end immediately reconfigures its internal data interface circuitry to the corresponding communication protocol mode based on the new voltage level.
[0092] Simultaneously, the microcontroller also reconfigures its own drive logic connected to the universal data line to conform to the settings of the second communication allocation feature. Through this synchronous hardware logic reconfiguration process, the physical layer and protocol layer of the communication interface are switched instantly. The function carried by the universal data line seamlessly transitions from the mode defined by the first communication allocation feature to the new mode defined by the second communication allocation feature. Thus, the communication link is strengthened and switched in advance without the user's awareness and without interruption of the data acquisition stream.
[0093] In some embodiments, the order and combination of target protocol modes in the communication protocol mode can be preset and variable, and / or the target protocol mode can be dynamically selected from a predefined set of alternative protocols. This allows the system to dynamically combine and switch communication protocols according to different types of interference encountered by the energy storage device in actual operation (such as periodic electromagnetic interference, sudden impulse noise) or different power consumption and reliability priorities, thereby expanding the system's adaptability in complex and variable operating environments and improving the flexibility and robustness of communication link management.
[0094] In some embodiments, optionally, the data used to determine communication quality parameters and communication degradation trends also includes energy storage device operating environment parameters synchronized with the communication interaction time. Determining the trend includes using operating environment parameters to assist in judging the causes of the communication degradation trend or to compensate the prediction model for parameters. The operating environment parameters include at least one of the following: internal device temperature, ambient electromagnetic field strength monitoring data, and power supply ripple parameters. By introducing environmental parameters for joint analysis, the system's ability to distinguish whether communication quality degradation stems from link aging or transient changes in the external environment is improved.
[0095] In some embodiments, optionally, such as Figure 2 As shown, step S102: determining a first communication allocation characteristic of at least one general-purpose data line based on the level state, including:
[0096] Step S1020: Determine the target mode from a variety of preset communication protocol modes based on the level status;
[0097] Step S1022: Determine the first communication allocation feature corresponding to each general data line based on the interface definition of the target mode;
[0098] Step S1024: Determine the communication link for data interaction with the analog front end based on the first communication allocation feature, so as to interact with the analog front end through the communication link.
[0099] In this embodiment, the microcontroller first reads the specific level state of the protocol selection line and uses it as a lookup key to parse the corresponding target communication protocol mode from an internally stored mapping table. Based on the hardware interface definition of the target communication protocol mode, a suitable functional role is assigned to each available general-purpose data line, thus forming a complete pin configuration scheme, i.e., the first communication allocation feature. Based on the first communication allocation feature, the hardware interface between the microcontroller and the analog front-end is bidirectionally configured, establishing a communication link on the physical connection that conforms to the protocol specification and is capable of data exchange.
[0100] Understandably, the dynamic reconfiguration of the communication hardware interface is achieved through programmable level signals, enabling the same set of physical data lines to switch instantly to functional pins supporting different communication protocols according to instructions. This virtualization and dynamic scheduling capability of hardware resources allows energy storage devices to be compatible with various types of analog front-end chips without adding extra physical connections, and can flexibly select the optimal communication scheme according to the operating environment, thereby significantly enhancing the flexibility of hardware adaptation at the system level.
[0101] The level state is a specific digital logic level. For example, a high voltage level represents logic "1" and a low voltage level represents logic "0". It is obtained directly from the protocol selection line by the input detection circuit of the microcontroller unit.
[0102] In the non-volatile memory of the microcontroller, a mapping table between voltage level values and communication protocol modes is permanently stored.
[0103] Once the microcontroller reads the current level status value, it immediately uses it as a query key to compare and retrieve the data in the internal mapping table, thereby uniquely and definitively resolving the type of communication protocol that should be used, i.e., the target mode.
[0104] After determining the target mode, it needs to be converted into control instructions for specific hardware pins. This is the step of determining the first communication allocation feature corresponding to each general data line based on the interface definition of the target mode.
[0105] Each communication protocol has a strict and unique hardware interface definition. The hardware interface definition specifies in detail the number of signal lines required to implement the protocol, the functional role of each signal line, the working sequence, and the electrical connection relationship.
[0106] The fixed set of functional roles assigned to each physical data line together constitutes a complete and executable logical communication interface configuration scheme, namely the first communication allocation feature.
[0107] A communication link refers to a data transmission channel that conforms to the target mode specification and is actually established between the microcontroller unit and the analog front end based on the determined first communication allocation characteristics.
[0108] Determining the communication link means that the microcontroller will program and configure its internal input / output controllers, which are connected to the general data lines, according to the first communication allocation characteristics.
[0109] At the same time, the configuration information is also indirectly notified to the analog front end through the level state of the protocol selection line, and the analog front end will synchronously configure its own interface to the same mode.
[0110] Once both sides are configured, these general-purpose data lines, which have been given specific functions, are no longer independent pins, but become a complete path that follows strict timing and protocol rules and can transmit bidirectional data streams.
[0111] The establishment of this pathway enables the microcontroller to send commands to the analog front end and receive the battery status data returned by it, thus achieving stable and orderly data interaction between the two.
[0112] In some embodiments, optionally, a target mode is determined from a set of preset communication protocol modes based on the level state, wherein the preset conditions include requiring the level state to remain stable and consistent over multiple consecutive detection cycles. This ensures that the level signal used for mode determination is a valid and reliable instruction, rather than a false signal generated by noise or jitter, thereby avoiding communication link oscillations between different modes due to misjudgment of configuration instructions, and guaranteeing the determinism of the configuration process and the stability of system startup.
[0113] In some embodiments, optionally, such as Figure 3 As shown, step S1022: Based on the interface definition of the target mode, determine the first communication allocation feature corresponding to each general data line, including:
[0114] Step S10220: Determine the first communication allocation feature according to the target mode. The first communication allocation feature specifies that all general data lines belong to the same logical interface group.
[0115] Step S10222: Based on the first communication allocation feature, configure all general data lines as different signal lines with complementary functions within the logic interface group to jointly form a synchronous serial communication interface.
[0116] In this embodiment, all general data lines are defined as an indivisible single logical interface group. According to the specifications of the target synchronous serial protocol, each physical data line in the logical interface group is assigned a unique and complementary signal role, such as clock line, transmit data line, receive data line and control line.
[0117] Through this centralized and complementary role allocation, these physical connections are logically and electrically integrated into a complete and standardized synchronous serial communication interface, thereby establishing a high-bandwidth, time-guaranteed exclusive data channel between master and slave devices.
[0118] Understandably, by integrating all communication resources into a single fully functional synchronous interface, communication efficiency is maximized. This provides a high-speed data link for core status monitoring of energy storage devices, ensuring that critical safety parameters such as voltage and temperature can be collected and reported in real time without obstruction. This provides crucial high-bandwidth, low-latency communication assurance for precise battery management and safety early warning, effectively meeting the extreme performance requirements of high-reliability energy storage devices for core data stream transmission.
[0119] When the microcontroller unit determines that the target mode belongs to the first type of protocol based on the level of the protocol selection line, the first type of protocol here specifically refers to those communication protocols that require a set of signal lines with independent and complementary functions to perform full-duplex or half-duplex high-speed data exchange in a master-slave manner under synchronous clock beats.
[0120] All general-purpose data lines are assigned to the same logical interface group, treating all physical data lines as an indivisible whole. They must be scheduled together and work together to support a single, complete communication transaction, rather than being split into multiple independent or parallel communication units.
[0121] After establishing the top-level architecture of a single logical interface group, all general-purpose data lines are configured as different signal lines with complementary functions within the logical interface group.
[0122] The system is based on the standardized interface definition of the target synchronous serial communication protocol. The standardized interface definition clearly requires a set of signal lines with different functions, which typically include at least one clock signal line that provides a synchronization timing reference, one data signal line for the master device to send data to the slave device, one data signal line for the slave device to return data to the master device, and one chip select signal line for selecting a specific slave device.
[0123] Based on this, each general data line in the logical interface group is assigned a unique and complementary role.
[0124] All these signal lines work together under strictly synchronized timing control, enabling the microcontroller unit to reliably exchange data with the analog front-end at a high rate. This interface structure is particularly suitable for scenarios within energy storage devices where the microcontroller unit and the analog front-end need to frequently, quickly, and reliably transmit large amounts of critical monitoring parameters such as battery cell voltage and temperature.
[0125] In some embodiments, all general-purpose data lines may be configured as different signal lines with complementary functions within a logical interface group, including dynamically mapping the set of standard signal lines defined by the target synchronous serial communication interface based on the total number of currently available general-purpose data lines.
[0126] When the number of available data lines is less than the total number of signal lines required by the standard interface, the system automatically selects a preset simplified or multiplexed interface scheme. For example, it may multiplex the chip select signal function onto a single data line or enable a simplified communication mode that does not require a separate chip select line. This allows the system to establish a working synchronous serial communication link even when hardware resources are limited or some lines fail, improving the fault tolerance of the hardware design and the system's survivability under non-ideal hardware conditions.
[0127] In some embodiments, optionally, such as Figure 4 As shown, step S1022: Based on the interface definition of the target mode, determine the first communication allocation feature corresponding to each general data line, including:
[0128] Step S10224: Determine the first communication allocation feature according to the target mode. The first communication allocation feature specifies that the general data line is divided into multiple independent logical interface groups.
[0129] Step S10226: Based on the first communication allocation feature, configure the general data lines in each logical interface group as signal line pairs with the same function, thereby forming multiple independently addressable shared bus communication interfaces.
[0130] In this embodiment, based on the total number of available physical connections, all general-purpose data lines are logically divided into multiple independent, parallel logical interface groups. Following the standard definition of the target shared bus protocol, a pair of physical data lines is allocated to each logical interface group, and they are configured as signal line pairs with completely identical functional roles, namely, one serial clock line and one serial data line.
[0131] Through this grouping and pairing configuration, a group of physical connection resources are instantiated into multiple complete shared bus-type communication interfaces that can operate simultaneously or in a time-sharing manner. Each interface can independently perform device addressing and data exchange.
[0132] Understandably, by grouping and virtualizing hardware interface resources, the ability to manage multiple slave devices with minimal pin resources is achieved. This architecture provides an ideal solution for scenarios in energy storage devices where a single microcontroller unit needs to centrally monitor multiple battery modules or AFE chips. It not only significantly saves valuable pin resources of the main control chip, reducing system complexity and cost, but also achieves distributed communication load and fault isolation by creating multiple independent buses, significantly enhancing the flexibility of system management and the reliability of the overall communication architecture.
[0133] The microcontroller unit, based on the level of the protocol selection line, determines that the target mode belongs to the second type of protocol. The second type of protocol includes, but is not limited to, synchronous serial protocols that use a shared bus topology, address via device address, and require only two signal lines to complete communication. It specifies that the general-purpose data lines are divided into multiple independent logical interface groups. Based on the total number of physical connections, these are logically divided into several independent and non-interfering communication units.
[0134] Each logic interface group will independently undertake the task of communicating with one or more analog front-end devices. This division allows a single microcontroller unit to manage multiple independent communication buses simultaneously through the same set of physical interface hardware, providing a physical basis for connecting multiple analog front-end chips or achieving communication redundancy.
[0135] The general data lines in each logical interface group are configured as signal line pairs with the same function. The system follows the standardized interface definition of the target shared bus protocol. The standardized interface definition strictly requires two functional lines: one serial data line for bidirectional data transmission and one serial clock line for providing a communication synchronization clock.
[0136] Based on this, the system allocates two physical general-purpose data lines to each predefined logical interface group, and configures these two lines as a pair with identical functions: one is designated as the serial clock line and the other as the serial data line. Each logical interface group obtains such a pair of signal lines with identical functions, thus possessing all the elements necessary to run a complete shared bus protocol interface in hardware.
[0137] Through the above configuration, these grouped and defined general data lines form multiple independently addressable shared bus-type communication interfaces.
[0138] Each logic interface group consisting of two wires is initialized and configured as an independent host controller instance within the microcontroller unit. Each such instance has its own independent clock speed, timing configuration, and interrupt management.
[0139] Each interface is independently addressable, which means that the microcontroller can initiate communication transactions on each interface simultaneously or in a time-sharing manner, addressing and accessing different analog front-end devices mounted on the bus by sending data frames containing different slave device addresses.
[0140] This shared bus architecture allows multiple devices to share the same pair of signal lines, distinguished by address, which greatly saves the pin resources of the microcontroller unit while providing good scalability.
[0141] In energy storage devices, this is ideal for scenarios where a microcontroller manages multiple AFE chips located in different battery modules, or for creating a dedicated redundant diagnostic bus.
[0142] In some embodiments, the general data line may be divided into multiple independent logical interface groups, the specific number of groups and their composition relationship being dynamically determined based on the physical topology and address planning of the analog front-end devices that currently need to communicate within the system.
[0143] Based on a pre-stored device connection table, the system automatically calculates the optimal grouping scheme to balance the load on different buses with similar numbers of connected devices and minimize communication timing risks caused by address conflicts or excessive bus capacitance. This allows the hardware resource configuration of the communication interface to match the actual system device deployment, optimizing the overall performance and stability of the communication network.
[0144] Optionally, during operation, the communication load rate and error rate of each independent logical interface group are continuously monitored. When the load of a certain interface group is found to be persistently high or the error rate is abnormally rising, a load migration process between interface groups is automatically triggered. Load migration includes migrating some device communication tasks on the faulty interface group to another logical interface group with a lighter load according to a preset strategy, and updating the relevant configurations. This provides dynamic load balancing and fault self-healing capabilities for the multi-bus system, enhancing the overall resilience of the system in the face of local communication anomalies.
[0145] In some embodiments, optionally, such as Figure 5 As shown, step S1022: Based on the interface definition of the target mode, determine the first communication allocation feature corresponding to each general data line, including:
[0146] Step S10228: Determine the first communication allocation feature according to the target mode. The first communication allocation feature specifies that each general data line is configured independently as a logical interface.
[0147] Step S10230: Based on the first communication allocation feature, configure time-division communication capability for each general data line that is an independent logical interface, thereby forming multiple parallel communication interfaces.
[0148] In this embodiment, each general-purpose data line is assigned a completely independent communication interface identity, and each physical connection is defined as a self-contained logical interface. To avoid conflicts when multiple independent interfaces access the same device, the system configures a time-division communication scheduling strategy for each such logical interface. Through a precise time-slice polling mechanism, it ensures that only one interface can drive the line to communicate with the analog front end at any given time. Through this one-line-one-interface architecture and time-division multiplexing scheduling, physically isolated data lines logically form multiple parallel communication interfaces that can work alternately.
[0149] Understandably, through extreme hardware decoupling and time-sharing scheduling, the highest level of redundancy and anti-interference capability of the communication link is achieved. Even if some lines fail due to interference, aging, or physical damage, any remaining single-line interface can still independently maintain critical communication between the system and the analog front end, achieving communication fault tolerance where a single point of failure does not affect the overall system. This fundamentally solves the major safety hazard of blind spots in system monitoring caused by communication interruptions under harsh conditions, and improves the operational safety of energy storage devices.
[0150] Specifically, each physical general-purpose data line is upgraded to a fully functional independent communication entity. Through a time-division multiplexing mechanism, they can exchange data with the analog front end in parallel and independently, thereby achieving the highest level of redundancy and anti-interference capability of the communication link.
[0151] When the microcontroller unit determines that the target mode belongs to the third type of protocol based on the level of the protocol selection line, the third type of protocol specifically refers to asynchronous serial protocols that can complete all data exchange with only a single signal line and encode instructions and data through specific pulse widths or intervals.
[0152] The system-generated first communication allocation feature specifies that each general-purpose data line is configured independently as a logical interface. This assigns each physical connection a complete, self-contained communication interface identity. Each data line no longer needs to be paired or combined with other lines; it constitutes itself a complete, independently addressable and operable communication endpoint.
[0153] Having established the principle of one line, one interface, the next step is to configure time-division communication capabilities for each general-purpose data line, which is an independent logical interface, based on the first communication allocation characteristics. A scheduling strategy is then assigned to each independent single-line interface to manage the key step of multiple interfaces accessing the shared medium (i.e., the analog front end) in parallel.
[0154] Since multiple independent single-line interfaces are physically connected to the same analog front-end device, the system must introduce a time-division multiplexing coordination mechanism for these interfaces to avoid communication conflicts.
[0155] Configuring time-sharing communication capabilities specifically refers to assigning a dedicated, periodically occurring time window or communication token to each logical interface. Within each time window, only the authorized logical interface can drive its corresponding physical data line, initiate a communication session with the analog front end, and perform data read or configuration write operations. Other logical interfaces remain in a silent, high-impedance state during this period, listening to the bus or waiting for their assigned time slice.
[0156] Through the aforementioned independent and time-division scheduling configuration, these general-purpose data lines form multiple parallel communication interfaces. These interfaces possess equal and independent communication functions, and under the management of the scheduler, they can process multiple communication transactions in parallel using time-division multiplexing, achieving a near-concurrent communication effect on a macroscopic level.
[0157] Each interface can independently initiate, execute, and complete a full data interaction with the analog front end. In energy storage devices, especially in harsh environments facing strong electromagnetic interference, connector corrosion, or aging wiring, this architecture provides unparalleled robustness. Even if one or more data lines fail completely due to a fault, any remaining single-line interface can still independently maintain critical communication between the system and the analog front end, ensuring uninterrupted battery monitoring data.
[0158] In some embodiments, step S106: determining the communication degradation trend based on communication quality parameters includes: determining the communication degradation trend based on the change data of communication quality parameters within at least one data transmission cycle, wherein the data transmission cycle corresponds to the analog front end.
[0159] In this embodiment, the data transmission cycle, which strictly corresponds to the working cycle of the simulated front end, is used as the basic time unit. The evolution sequence of parameters over time is continuously collected and observed. By analyzing the dynamic change data formed by these parameter values arranged in chronological order, the temporal evolution pattern is identified, which is ultimately transformed into a qualitative conclusion: whether the communication link tends to stabilize or deteriorate in the future, and the degree of deterioration.
[0160] Understandably, upgrading the assessment of communication status from a static, single-threshold-based judgment to a dynamic, time-series-based trend prediction enables the system to anticipate potential downlink risks before communication link performance substantially deteriorates and reaches traditional fault thresholds. By identifying early signs, a time window is gained for subsequent preventative optimization or forward-looking switching decisions, thereby improving the foresight of mode switching.
[0161] The set of communication quality parameters includes at least the response delay for each command interaction, as well as the number of communication no-response times and data verification errors accumulated within statistical time windows of different lengths.
[0162] Communication quality parameters are continuously updated and arranged in chronological order with each communication event. The term "changing data" emphasizes the dynamic and sequential nature of the parameters, serving as the fundamental raw material for trend analysis. The system continuously appends the latest collected parameter values to a historical sequence strictly ordered by timestamps, thus forming a time curve that reflects the real-time performance and short-term fluctuations of the communication link.
[0163] Specifically, the data transmission cycle refers to the time interval required for the microcontroller unit to initiate a complete data read or configuration write transaction to the analog front end according to a predetermined sampling strategy and successfully receive a response. The data transmission cycle corresponds to the analog front end because any change in communication quality is essentially reflected in the interaction with this specific device.
[0164] Aligning the analysis window with this actual data transmission cycle means that trend analysis is based on complete, meaningful business interaction units, avoiding noise or misjudgment introduced by misaligned observation timescales.
[0165] Determining the communication degradation trend based on the changes in communication quality parameters over at least one data transmission cycle is a specific time series analysis and feature extraction process.
[0166] Using the current moment as a baseline, one or more consecutive data transmission cycles are traced back to extract all relevant communication quality parameter sequences within this time window. A pre-defined algorithm is then used to analyze these sequenced data changes. This analysis is not a simple comparison of single-point thresholds, but rather aims to capture the patterns and directions of parameter evolution over time.
[0167] By quantitatively calculating deep-seated characteristics such as the rate of increase in latency and the frequency and density of errors, a qualitative or semi-quantitative conclusion is ultimately reached: the communication degradation trend. The communication degradation trend is used to identify the signs and speed at which the performance of the communication link is deteriorating or about to deteriorate.
[0168] In some embodiments, optionally, the communication degradation trend is determined based on the changing data, the process of which includes a data cleansing step to remove parameter spikes caused by known transient, non-persistent external events.
[0169] The system maintains a pre-defined database of interference event features. When a parameter mutation pattern is identified that highly matches a certain instantaneous interference pattern in the database, such as a microsecond-level burst interference caused by high-power load switching, abnormal parameter values near the identified time point are automatically masked or corrected during trend analysis. This ensures that the data foundation used for trend analysis more accurately reflects the long-term health changes of the communication link itself, rather than being distorted by occasional events, thus improving the accuracy of trend prediction.
[0170] In some embodiments, optionally, such as Figure 6 As shown, step S106: Determining the communication degradation trend based on communication quality parameters includes:
[0171] Step S1060: Determine the communication quality level based on the communication quality parameters;
[0172] Step S1062: Determine the pre-handover decision based on the communication quality level and communication degradation trend.
[0173] In this embodiment, before predicting future communication degradation trends based on historical data, the system first comprehensively evaluates the real-time collected communication quality parameters according to preset multi-dimensional threshold conditions, classifying them into a discrete communication quality level that characterizes the current link's immediate health. The communication quality level and communication degradation trend are then collaboratively analyzed and combined, inputting a preset set of strategy rules. The system ultimately generates a pre-switching decision that comprehensively considers both the urgency of the current situation and the foresight of risks.
[0174] Understandably, the collaborative decision-making mechanism of current situation assessment and trend prediction greatly enhances the intelligence and accuracy of switching decisions.
[0175] Before determining the communication degradation trend based on communication quality parameters, it also includes determining the communication quality level based on communication quality parameters, which is a key status assessment step inserted in the time dimension.
[0176] Communication quality parameters, as raw data collected in real time, are themselves a collection of values across multiple dimensions. To reduce the dimensionality and qualitatively analyze this multi-dimensional, high-frequency raw data, transforming it into a more human-friendly and logically sound summary description, the communication quality level needs to be determined.
[0177] Specifically, key indicators extracted from the parameters, such as the latest response latency, the number of communication no-response instances within the most recent short statistical window, the number of verification errors, and the cumulative number of errors within the most recent long statistical window, are compared one by one with pre-set threshold conditions for different levels, such as "Excellent," "Good," "Poor," and "Inferior." Based on the satisfaction of all preset conditions, the current complex parameter state is mapped to a single, discrete communication quality level label. This level label, such as "Excellent" or "Poor," provides an authoritative and clear qualitative summary of the instantaneous performance and recent reliability of the current communication link, offering a stable benchmark for subsequent decision-making regarding the current state of affairs.
[0178] After obtaining the communication quality level that represents the current situation and obtaining the communication degradation trend that represents the future through trend analysis, the pre-handover decision is determined based on the communication quality level and the communication degradation trend.
[0179] The decision engine internally maintains a decision matrix or set of policy rules consisting of these two dimensions. For example, even if the current communication quality level is "good," indicating that the link can still work normally, if the predicted communication degradation trend is "rapid degradation," the decision rule may determine that the risk is high, thus generating a decision to "perform a pre-switching."
[0180] Conversely, if the current level is "poor" but the trend shows "stable," the system may choose to implement conservative strategies such as parameter optimization first, rather than switching immediately. This decision-making logic based on the combination of level and trend allows the system to distinguish between the warning scenario of "current quality is acceptable but about to deteriorate" and the observation scenario of "current quality is poor but tending to stabilize," thereby making more refined, reasonable, and proactive decisions. This avoids overreacting to instantaneous fluctuations and prevents sluggish responses to slow deterioration.
[0181] In some embodiments, the decision rule base is optionally supported for dynamic adjustment and learning, and the system continuously records each combination of level trends, the decisions made, and their final communication effects.
[0182] Based on this feedback data, the system can periodically evaluate and optimize the decision rule base, such as adjusting the strictness of the combination of levels and trends required to trigger a certain decision, or adding new and more refined decision branches. This allows the decision logic to continuously evolve as the equipment operates in the real environment over a long period of time, gradually approaching the optimal strategy for a specific installation scenario, thus improving the system's long-term adaptive capability.
[0183] In some embodiments, optionally, such as Figure 7 As shown, step S1060: Determine the communication quality level based on communication quality parameters, including:
[0184] Step S10602: Determine the delay matching result based on the delay parameter in the communication quality parameters;
[0185] Step S10604: Determine the failure frequency matching result based on the failure frequency parameter in the communication quality parameters;
[0186] Step S10606: Determine the check error matching result based on the check error parameter in the communication quality parameters;
[0187] Step S10608: Determine the communication quality level based on the delay matching result, failure frequency matching result, and verification error matching result.
[0188] In this embodiment, the most representative latency, failure frequency, and checksum error parameters are selected as core evaluation indicators from the multi-dimensional communication quality parameters collected in real time. The system presets threshold conditions for each parameter corresponding to different quality levels. During evaluation, the real-time parameters are compared with these conditions to obtain an independent matching result for each parameter. A preset comprehensive judgment rule is used to fuse the matching results of the three dimensions—latency, failure frequency, and checksum error—and, for example, select the worst result to determine a unique communication quality level that comprehensively reflects the current communication link's overall status in terms of speed, connectivity, and accuracy.
[0189] Understandably, by setting clear quantitative thresholds for different dimensions and making comprehensive judgments, the ambiguity and one-sidedness of traditional single thresholds or subjective judgments are eliminated. This multi-dimensional hierarchical evaluation enables the microcontroller unit to determine the exact health level of the current communication link in real time and accurately, providing a clear and reliable immediate basis for subsequent judgments on whether it is stable, needs optimization, or is on the verge of failure.
[0190] The latency parameter in communication quality parameters refers to the time interval from when the microcontroller sends a command to the analog front-end until it fully receives valid response data, i.e., the response latency.
[0191] Determining the delay matching result based on the delay parameter in the communication quality parameters is a process of mapping continuous time measurements to discrete level labels. The system internally stores delay threshold conditions corresponding to different communication quality levels. Representative delay parameter values from the latest or most recent statistical window are compared one by one with these preset delay threshold conditions. Through this comparison, it is determined which level's delay condition the current delay parameter specifically meets (i.e., matches).
[0192] The failure frequency parameter in the communication quality parameters specifically refers to the number of times the microcontroller unit fails to receive any valid response after initiating communication within a preset statistical time window, i.e., the number of times communication fails to respond.
[0193] This typically includes the recent failure frequency within a short statistical window and the cumulative failure frequency within a long statistical window.
[0194] The failure frequency matching result is determined based on the failure frequency parameter in the communication quality parameters, which refers to frequency data characterizing link connectivity reliability. The failure frequency parameter obtained through real-time statistics is compared with these conditions to determine which level of reliability standard the current failure frequency performance matches, thus generating the failure frequency matching result.
[0195] The verification error parameter in communication quality parameters refers to the number of times a received data frame fails integrity checks such as cyclic redundancy check within a preset statistical time window; that is, the number of data verification errors. This reflects the data integrity and anti-interference capability during data transmission. Based on preset verification error threshold conditions linked to each level, the collected error frequencies are matched and judged to obtain the verification error matching result, indicating the current data accuracy level.
[0196] The matching results, which are evaluated from three independent dimensions—latency, connectivity, and data accuracy—are merged into a unique, comprehensive communication quality level.
[0197] For example, the final communication quality level is determined by the worst of the three matching results, defining the overall link level based on the weakest link.
[0198] In some embodiments, optionally, such as Figure 8 As shown, after switching at least one general-purpose data line from a first communication allocation feature to a second communication allocation feature, the communication mode switching method further includes:
[0199] Step S1140: Obtain the interface configuration information corresponding to the first communication allocation feature;
[0200] Step S1142: During the operation based on the second communication allocation feature, obtain the actual communication quality parameters based on the second communication allocation feature, and the simulated communication quality parameters obtained by simulating the operation based on the saved interface configuration information;
[0201] Step S1144: Determine the comparison result based on the actual communication quality parameters and the simulated communication quality parameters;
[0202] Step S1146: When the comparison result meets the preset back-switch condition, trigger the switch from the second communication allocation feature to the first communication allocation feature.
[0203] In this embodiment, when switching from the first communication allocation feature to the second communication allocation feature, the system completely saves the interface configuration information of the original mode as a backup. During operation based on the new feature, two tasks are executed in parallel: collecting the actual communication quality parameters under the new link, and simultaneously using the saved configuration information and environmental parameters, calculating the simulated performance parameters of the original link under the current conditions through a simulation model.
[0204] By continuously comparing actual parameters with simulated parameters, when the comparison results show that the predicted performance of the original mode is significantly better than the current new mode while meeting safety requirements, the system automatically triggers a switchback operation from the second communication allocation feature to the first communication allocation feature, thereby dynamically restoring the communication link to the optimal configuration under the current environment.
[0205] Understandably, by introducing dynamic optimization and adaptive back-switch capabilities based on performance comparison, the management of the communication link becomes a continuously self-optimizing closed loop. This ensures that the system not only proactively avoids risks but also pursues optimal performance, thus adaptively maintaining the best-matched and highest-performing communication state with the current environment at any given time. This further enhances the long-term reliability of the communication link throughout the entire lifecycle of the energy storage device.
[0206] After switching at least one general-purpose data line from the first communication allocation feature to the second communication allocation feature, the first step is to obtain the interface configuration information corresponding to the first communication allocation feature. This interface configuration information is a comprehensive dataset that fully describes all reproducible settings of the communication interface corresponding to the first communication allocation feature at both the hardware logic and software driver levels.
[0207] Specifically, the interface configuration information includes at least: the identifier of the target communication protocol mode corresponding to the first communication allocation feature, the specific level state value required to be output by the protocol selection line, the specific functional role assigned to each general data line under the first communication allocation feature, the driving parameters of the communication interface, the working timing configuration, and any calibration or compensation parameters related to the operation of the interface.
[0208] Before or simultaneously with initiating the handover, this configuration information is retrieved from runtime memory and completely stored in non-volatile memory or a dedicated backup area. This creates an accurate backup image of the original communication mode, enabling the system to logically and completely reproduce and restore the communication interface before the handover at any point in the future.
[0209] During the system's successful switch to the second communication allocation feature and its data interaction with the analog front-end based on this new feature, two data acquisition tasks are performed in parallel. The first task is to acquire the actual communication quality parameters based on the second communication allocation feature. During each data interaction with the analog front-end via the new communication link, the response latency, communication failure frequency, and data verification error frequency within a statistical window are measured and calculated in real time.
[0210] Simultaneously, the system also performs a second key task: acquiring simulated communication quality parameters obtained from the simulation run based on the saved interface configuration information. This is achieved by running a lightweight communication link simulation model. The inputs to the communication link simulation model include: complete interface configuration information of the saved first communication allocation feature, and background information obtainable from the current operating environment but not dependent on a specific communication mode, such as the overall load status of the energy storage device, internal ambient temperature, and power supply noise level.
[0211] Using these inputs, combined with the theoretical performance model and historical statistical characteristics of the communication protocol corresponding to the first communication allocation feature, the simulation model calculates the key performance indicators that might be exhibited if the original first communication allocation feature were still used for communication at this time. These indicators include the estimated latency range and the expected error rate baseline. These calculated performance indicators are the simulated communication quality parameters.
[0212] After obtaining both actual and simulated communication quality parameters that reflect the current situation, the process involves determining a comparison result based on these parameters. The comparison result could be a simple judgment of superiority or inferiority, or it could be a quantified difference value.
[0213] When the comparison result meets the preset back-switch conditions, a switch from the second communication allocation feature to the first communication allocation feature is triggered. The back-switch conditions are a set of preset logical judgment rules used to define under what circumstances it is a better choice to switch back to the original mode.
[0214] When this condition is met, it indicates that the interference that initially caused the switching may have weakened or disappeared, and the original communication mode has regained its performance advantage in the current environment. At this time, the system will generate a switchback decision and initiate a process similar to but in the opposite direction to the forward switch: based on the saved interface configuration information of the first communication allocation feature, the level of the protocol selection line and the function of the general data line are reconfigured, and the communication link is switched from the second communication allocation feature back to the first communication allocation feature.
[0215] In some embodiments, the preset threshold for the switchback condition is optionally dynamically adjusted based on the historical switching success rate and switchback success rate of both the first and second communication allocation features. If the historical success rate of switching from the first to the second communication allocation feature is high, but the historical number of failures when switching back from the second to the first communication allocation feature is high, the system will automatically increase the performance advantage threshold required for the switchback, making the switchback decision more cautious. This introduces a dynamic risk assessment mechanism based on historical experience, enabling the switchback strategy to learn and optimize itself, avoiding frequent and unstable oscillations between the two modes, and improving the long-term stability of the system.
[0216] Optionally, in some embodiments, a progressive verification step is included before triggering the switch from the second communication allocation feature to the first communication allocation feature. Instead of immediately performing a full hardware reconfiguration switchback, a very short pulse is output to the control protocol selection line, temporarily switching the communication interface to the first communication allocation feature for only one or a few data transmission cycles. This quickly acquires a real, temporary communication quality parameter and verifies it against the previously simulated parameters. If the verification passes, a full switchback is performed; if the verification fails, the switchback is canceled, and the simulation model is corrected accordingly. This adds a layer of instantaneous verification based on the real physical link to the switchback decision, further eliminating erroneous switchbacks caused by simulation errors and greatly improving the success rate and reliability of the switchback operation.
[0217] In some embodiments, optionally, such as Figure 9 As shown, the communication mode switching method also includes:
[0218] Step S116: Determine the historical operation dataset based on communication quality parameters, communication degradation trends, pre-handover decisions, and characteristic handover events;
[0219] Step S118: Determine the optimization objective based on the historical operation dataset. The optimization objective includes at least one of the following: a threshold parameter for determining the communication quality level, an algorithm model parameter for determining the communication degradation trend, and a strategy rule for generating pre-switching decisions.
[0220] Step S120: Update the corresponding threshold parameters, algorithm model parameters, or strategy rules according to the optimization objective.
[0221] In this embodiment, the microcontroller unit continuously records communication quality parameters, communication degradation trends, pre-switching decisions, and actual switching events during operation, forming a structured historical operation dataset.
[0222] Based on the analysis of this dataset, the system automatically diagnoses areas for improvement and determines specific optimization goals. These goals target core judgment and decision-making units, including level threshold parameters for evaluating the current state, trend analysis model parameters for predicting future trends, and strategy rules for generating instructions. The system then uses data-driven methods, such as statistical analysis or machine learning, to perform targeted calculations and updates on the identified target parameters or rules, thereby completing a self-optimization iteration.
[0223] Understandably, microcontrollers can continuously calibrate their judgment criteria, optimize their prediction models, and refine their decision-making strategies based on real data from long-term operation on specific energy storage devices. This makes them increasingly adaptable to the unique electromagnetic environment and hardware characteristics of the devices, significantly improving communication reliability and the overall level of intelligent safety management during long-term operation.
[0224] Throughout the entire lifecycle of an energy storage device, the microcontroller unit not only performs monitoring, prediction, and switching, but also continuously packages and stores the key process and result data generated in each evaluation cycle.
[0225] These data include: the original communication quality parameter sequence collected periodically, the judgment results of each communication degradation trend based on this analysis, the content of each pre-switching decision generated by combining the quality level and trend, and each actual feature switching event from the first communication allocation feature to the second communication allocation feature (or reverse backswitching) and its timestamp.
[0226] These multi-dimensional data, which are correlated in chronological order, are structured and stored as a queryable and analyzable historical dataset.
[0227] Optimization objectives are determined based on accumulated historical operating datasets. These objectives specify which adjustable parameters or models in the system need to be improved to enhance future performance.
[0228] Specific optimization objectives include, but are not limited to, the following three categories: threshold parameters for determining communication quality levels, algorithm model parameters for determining communication degradation trends, and policy rules for generating pre-handover decisions. The process of determining optimization objectives is a problem diagnosis and prioritization process based on statistical data analysis.
[0229] After defining the specific optimization objectives, the system updates the corresponding threshold parameters, algorithm model parameters, or strategy rules according to the optimization objectives.
[0230] For the selected optimization objective, relevant subsets are extracted from the historical operational dataset, and optimization algorithms are used to calculate new parameter values or rules, which are then safely updated into the system's operational configuration. For the strategy rules used to generate pre-switching decisions, the system can, based on a large amount of historical decisions and their subsequent effect feedback, use reinforcement learning or rule mining algorithms to deduce decision strategies that will bring better long-term returns under new combinations of rank trends, and update the rule base accordingly.
[0231] In one specific embodiment, the circuit connection relationship may optionally be as follows: Figure 12 As shown, the hardware employs a 5-wire unified communication interface, with one wire designated as the communication protocol selection line (SEL) and the remaining four as general-purpose communication data lines (D1, D2, D3, and D4). The system dynamically configures the functions of the four general-purpose data lines based on the level state of the protocol selection line, supporting multiple communication modes with time-division multiplexing: when configured as a Serial Peripheral Interface (SPI) mode, all four data lines are used as SPI communication lines; when configured as an Inter-Integrated Circuit (I2C) bus mode, the four data lines are divided into two independent communication interfaces; and when configured as a Hardware Data Queue (HDQ) mode, the four data lines constitute four independent HDQ single-bus communication channels.
[0232] SEL is used for mode switching control, and the functions of D1~D4 are configured through level commands.
[0233] D1 is a general-purpose communication data line 1, dynamically adaptable to SPI / I2C / HDQ modes; D2 is a general-purpose communication data line 2, dynamically adaptable to SPI / I2C / HDQ modes; D3 is a general-purpose communication data line 3, dynamically adaptable to SPI / I2C / HDQ modes; D4 is a general-purpose communication data line 4, dynamically adaptable to SPI / I2C / HDQ modes.
[0234] like Figure 13 As shown, the communication mode switching method includes:
[0235] Step S200: System initialization;
[0236] Step S202: Real-time acquisition of communication quality;
[0237] Step S204: Communication quality trend classification;
[0238] Step S206: Execution of proactive safety adaptive handover strategy;
[0239] Step S208: Execute repeatedly, then return to step S202.
[0240] System initialization: After the MCU is powered on, it completes the initialization configuration of itself and the AFE chip. It uses SPI communication by default, but supports other communication methods such as I2C and HDQ. At the same time, it presets the communication quality classification threshold, the long and short window statistical duration (3s short window, 10s long window), the self-healing strategy and the active safety warning threshold, starts the communication quality acquisition unit, and starts the artificial intelligence (AI) prediction and early perception module, timestamp timing unit, classification judgment unit and safety linkage unit.
[0241] Real-time communication quality acquisition: The MCU interacts with the AFE chip according to a preset data transmission cycle and the currently enabled communication mode. Before each interaction, the MCU timestamps the moment it sends a command and the MCU timestamps the moment it receives a response from the AFE. The system records the response delay, the number of no responses within 3 seconds, the number of no responses within 10 seconds, the number of Cyclic Redundancy Check (CRC) errors within 3 seconds, and the total number of CRC errors within 10 seconds. These parameters collectively serve as the communication quality parameters for the current communication mode. After acquisition, all parameters are synchronously transmitted to the AI intelligent prediction and early perception module. The module extracts the temporal features of the parameters and, combined with historical data, performs early perception of communication quality degradation trends (predicting the communication quality change trend within the next 1-3 data transmission cycles and outputting the prediction result: stable, slightly degraded, rapidly degraded, or about to fail).
[0242] Based on response delay, 3-second short window statistics, and 10-second long window statistics, communication quality is graded using a trend-based classification system, resulting in four levels: Excellent, Good, Poor, and Inferior.
[0243] Excellent rating: Stable response delay ≤50μs, number of no response within 3s = 0, number of CRC errors = 0, total number of no response within 10s = 0, total number of CRC errors = 0.
[0244] Good rating: Response delay > 50μs and ≤ 100μs, number of no response within 3s ≤ 1, number of CRC errors ≤ 1, total number of no response within 10s ≤ 3, total number of CRC errors ≤ 5.
[0245] Poor rating: Response delay > 100μs and ≤ 200μs, or no response time within 3s = 2~3 times, CRC error time = 2~3 times, or no response time within 10s = 4~10 times, CRC error time = 6~20 times.
[0246] Poor rating: Response delay > 200μs, or no response ≥ 4 times within 3s, CRC error ≥ 4 times, or no response ≥ 11 times within 10s, CRC error ≥ 21 times, or no response for 5 consecutive interactions.
[0247] Execution of proactive safety adaptive switching strategy:
[0248] If the current communication quality is excellent and the AI predicts "stable": the current communication mode continues to operate, the MCU receives and processes the energy storage cell data transmitted by the AFE chip normally; the safety linkage module monitors in real time whether the cell data exceeds the active safety warning threshold, and if it does, it immediately triggers the corresponding safety warning; the AI intelligent prediction and early perception module continuously receives communication quality parameters, records the current operating data, and uses it for online model fine-tuning to continuously improve the accuracy of early perception and maintain the communication quality at an excellent level.
[0249] If the current communication quality is excellent and the AI predicts "slight degradation" (predicting a future deterioration): without waiting for the quality to drop, proactive preventative optimization is performed in advance: fine-tuning the communication rate (appropriately reducing it by 5%), optimizing communication timing, enhancing anti-interference filtering, and simultaneously activating the pre-initialization of the secondary communication mode in advance (without switching, only completing the configuration), to ensure that if degradation occurs later, a quick switch can be made to avoid data acquisition interruption caused by a sudden drop in communication quality.
[0250] If the current communication quality is at a good level and the AI predicts "slight degradation": continue to perform proactive prevention optimization, gradually reduce the communication rate and adjust the sampling phase. For each adjustment, re-collect the communication quality parameters 3 times. Combined with the AI prediction results, if the predicted trend turns to "stable", stop the adjustment; if the AI predicts to turn to "rapid degradation" (predicting that it will quickly deteriorate to a poor level), trigger the 5-line topology pre-reconstruction in advance: group the 4 general data lines into two groups of I2C in advance, complete the pre-configuration and pre-detection, and avoid the collection delay caused by reconstruction after the level deteriorates.
[0251] If the current communication quality is good and the AI predicts "rapid degradation": immediately perform 5-line topology reconstruction (group the 4 general data lines into two groups of I2C). After reconstruction, select the group with better quality and use it as a redundant backup, so as to achieve "early switching and seamless connection" and avoid communication quality deteriorating to poor level.
[0252] If the current communication quality is poor and the AI predicts "rapid degradation": the AI intelligent prediction and early perception module determines that there is continuous strong interference or link attenuation, and triggers multi-mode redundancy scheduling in advance: the four general data lines are reconstructed into four independent HDQ single buses (with the strongest anti-interference), and all available communication modes (SPI, dual I2C, four HDQ) are activated at the same time. Real-time quality acquisition and prediction are performed on all modes, and the best quality path is selected and activated. At the same time, interference characteristics are recorded in advance for subsequent self-healing parameter optimization.
[0253] If the current communication quality is poor and the AI predicts that it will "fail soon": emergency preparation is initiated in advance, the safety linkage module retains the current real-time data of the battery cell in advance, the MCU performs pre-connectivity detection on all available communication modes, completes the switching preparation, and ensures that once the quality deteriorates, it can switch immediately and seamlessly to avoid data collection interruption.
[0254] If all communication methods are of poor quality and the AI predicts "imminent failure": immediately activate the proactive safety emergency protection mechanism: ① The safety linkage module quickly records the current communication anomaly information, interference characteristics, and real-time data of the energy storage cell (for fault tracing); ② The MCU immediately switches to the optimal communication mode that has passed the pre-detection to ensure uninterrupted cell data acquisition; ③ If all modes are unusable, immediately trigger the first-level safety warning of the energy storage device, control the AFE chip to stop data acquisition, cut off the charging and discharging circuit of the corresponding energy storage cell, and completely block the safety hazard.
[0255] Looping execution: Repeatedly execute the steps from real-time acquisition of communication quality to execution of the proactive safety adaptive switching strategy to achieve proactive safety adaptive switching of AFE multi-communication modes; at the same time, the MCU records the communication quality classification results, switching events, self-healing optimization status and AI prediction results in real time. The AI intelligent decision module learns online based on the above recorded data, dynamically optimizes the communication quality classification threshold, self-healing optimization parameters and prediction model weights, and continuously improves the reliability, adaptability and proactive safety control level of communication switching, adapting to the complex electromagnetic interference, temperature fluctuation and other operating environments of energy storage equipment.
[0256] In one specific embodiment, the communication mode switching method may optionally include:
[0257] 1) System Initialization: After the MCU is powered on, the main communication mode is configured as SPI mode (1MHz baud rate, CRC-16 verification method, 20ms data transmission period), and the secondary communication mode supports I2C mode and HDQ mode; the I2C mode baud rate is 100kHz, and the verification method is CRC-8; the HDQ mode is four-way independent single-bus communication; set the long and short window statistics duration: 3s short window, 10s long window; set the communication quality classification thresholds: response delay thresholds of 50μs, 100μs, 200μs, and classification thresholds for the number of no response within 3s, the number of CRC errors within 3s, the total number of no response within 10s, and the total number of CRC errors within 10s; set the active safety warning thresholds: cell safety voltage range of 3.0V~4.2V, safety temperature range of -20℃~60℃, and safety current range of -10A~10A; start the communication quality acquisition unit, timestamp timing unit, classification judgment unit, and safety linkage unit, and simultaneously start the AI intelligent prediction and early perception module.
[0258] 2) Real-time communication quality acquisition: The MCU interacts with the AFE chip via SPI mode (currently enabled mode), reading the voltage, temperature, and current data of the ternary lithium battery collected by the AFE chip every 20ms; the timestamp of the sent command and the timestamp of the received response are recorded during each interaction, and the response delay is calculated; at the same time, the communication quality parameters are statistically analyzed in real time: number of no response within 3s = 0, number of CRC check errors within 3s = 0, total number of no response within 10s = 0, total number of CRC check errors within 10s = 0, response delay = 35μs; after the acquisition is completed, the parameters are input into the AI intelligent prediction and early perception module to complete the degradation trend prediction, and the prediction result is output as: stable.
[0259] 3) Communication quality classification: Based on the collected response delay, 3s short window statistics, and 10s long window statistics, and in accordance with the classification standard, the communication quality of the current SPI communication mode is determined to be excellent, and the AI prediction result is stable.
[0260] 4) Strategy execution: Maintain continuous operation in SPI communication mode, the MCU processes cell data normally, and the safety linkage module monitors cell data in real time. If the cell voltage is 3.8V, the temperature is 25℃, and the current is 5A, all of which are within the active safety warning threshold range, no safety warning will be triggered. The AI intelligent prediction and early perception module continuously collects data and fine-tunes the model online to maintain stable communication quality.
[0261] 5) Repeat steps 2) to 4) every 20ms to maintain SPI communication mode to ensure stable acquisition of cell data, continuous updating of AI prediction, and real-time monitoring of communication quality.
[0262] The hardware function configurations for different communication modes include:
[0263] (1) SPI mode (default mode):
[0264] Triggering condition: When the SEL line outputs a high level (3.3V), the MCU sends an SPI mode configuration command to the AFE chip.
[0265] Hardware configuration: All D1~D4 general-purpose data lines are used as SPI communication lines, corresponding to the four core pins of the SPI protocol, to achieve high-speed data transmission.
[0266] D1 to SPI_CS (chip select pins): Controls the communication enable of the AFE chip;
[0267] D2 to SPI_CLK (clock pin): Transmits the SPI communication clock signal;
[0268] D3 to SPI_MOSI (Master Transmit / Slave Receive Pin): The MCU sends commands to the AFE;
[0269] D4 to SPI_MISO (Master Receive / Slave Transmit Pin): AFE transmits cell data (voltage, temperature, current) to the MCU.
[0270] Working logic: The four wires work together to achieve high-speed SPI communication (baud rate up to 1MHz) to meet the high-frequency data acquisition requirements of energy storage cells.
[0271] (2) I2C mode:
[0272] Triggering condition: When the SEL line outputs a low level (0V), the MCU sends an I2C mode configuration command to the AFE chip.
[0273] Hardware configuration: The D1~D4 universal data lines are divided into two independent I2C interfaces to achieve dual-channel I2C parallel communication and improve anti-interference capability.
[0274] The first group of I2C lines: D1 to SCL1 (clock line), D2 to SDA1 (data line);
[0275] The second group of I2C lines: D3 to SCL2 (clock line), D4 to SDA2 (data line).
[0276] Operating logic: The two sets of I2C interfaces can work independently or be redundantly backed up. When one set is affected by electromagnetic interference, it can quickly switch to the other set to avoid data acquisition interruption and adapt to the complex electromagnetic interference environment of energy storage devices.
[0277] (3) HDQ mode:
[0278] Triggering condition: The SEL line outputs alternating high and low levels (100ms high level + 100ms low level), and the MCU sends an HDQ mode configuration command to the AFE chip.
[0279] Hardware configuration: Four general-purpose data lines each function independently as a single HDQ bus, forming four independent HDQ communication links:
[0280] D1 to HDQ1 (first HDQ single bus).
[0281] D2 to HDQ2 (second HDQ single bus);
[0282] D3 to HDQ3 (third HDQ single bus).
[0283] D4 to HDQ4 (fourth HDQ single bus).
[0284] Operating logic: Each HDQ single bus transmits data independently, providing the strongest anti-interference capability and making it suitable for strong interference scenarios in energy storage devices; when both SPI and I2C modes are interfered with, it can switch to HDQ mode to ensure uninterrupted cell data acquisition. At the same time, the four independent buses can realize parallel acquisition of multiple cells, improving acquisition efficiency.
[0285] like Figure 10 As shown in the illustration, this application embodiment also provides a communication mode switching device 900, comprising: a status acquisition module 902, used to acquire the level status of a protocol selection line; a feature allocation module 904, used to determine a first communication allocation feature of at least one general data line based on the level status; a parameter determination module 906, used to perform data interaction with an analog front end based on the first communication allocation feature to determine communication quality parameters; a trend prediction module 908, used to determine a communication degradation trend based on the communication quality parameters; a decision module 910, used to determine a pre-switching decision to perform communication mode switching before the communication quality parameters drop to a preset switching threshold based on the communication degradation trend; a target determination module 912, used to determine a second communication allocation feature based on the communication degradation trend in response to the pre-switching decision; and a switching execution module 914, used to determine a target level status corresponding to the protocol selection line based on the second communication allocation feature, so that at least one general data line switches from the first communication allocation feature to the second communication allocation feature.
[0286] like Figure 11 As shown, this application embodiment also provides an energy storage device 1000, including a microcontroller unit 1002 and an analog front-end 1004. The microcontroller unit 1002 and the analog front-end 1004 are connected through a communication interface 2000. The communication interface 2000 includes a protocol selection line 2002 and at least one general data line 2004. The energy storage device 1000 also includes a communication mode switching device 900.
[0287] In this invention, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance; the term "multiple" refers to two or more unless otherwise explicitly defined. The terms "install," "connect," "link," and "fix" should be interpreted broadly. For example, "connect" can be a fixed connection, a detachable connection, or an integral connection; "link" can be a direct connection or an indirect connection through an intermediate medium. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0288] In the description of this invention, it should be understood that the terms "upper," "lower," "left," "right," "front," "rear," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or unit referred to must have a specific orientation or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.
[0289] In the description of this specification, the terms "one embodiment," "some embodiments," "specific embodiment," etc., refer to specific features, structures, materials, or characteristics described in connection with an embodiment or example that are included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0290] The above are merely preferred embodiments of the present invention and are not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A communication mode switching method, characterized in that, Applied to energy storage devices, the energy storage devices include a microcontroller unit and an analog front-end, the microcontroller unit and the analog front-end are connected via a communication interface, the communication interface includes a protocol selection line and at least one general data line, the communication mode switching method includes: Obtain the level state of the protocol selection line; A first communication allocation characteristic of the at least one general-purpose data line is determined based on the level state; Based on the first communication allocation feature, data interaction is performed with the simulated front end to determine communication quality parameters; The communication degradation trend is determined based on the aforementioned communication quality parameters; Based on the communication degradation trend, a pre-switching decision is made to switch the communication mode before the communication quality parameters drop to a preset switching threshold. In response to the pre-switching decision, a second communication allocation characteristic is determined based on the communication degradation trend; The target level state corresponding to the protocol selection line is determined according to the second communication allocation feature, so that the at least one general data line is switched from the first communication allocation feature to the second communication allocation feature.
2. The communication mode switching method according to claim 1, characterized in that, Determining the first communication allocation feature of the at least one general-purpose data line based on the level state includes: The target mode is determined from a set of preset communication protocol modes based on the level state. Based on the interface definition of the target mode, the first communication allocation feature corresponding to each of the general data lines is determined; A communication link for data interaction with the simulated front end is determined based on the first communication allocation feature, so as to perform data interaction with the simulated front end through the communication link.
3. The communication mode switching method according to claim 2, characterized in that, The interface definition based on the target pattern determines the first communication allocation feature corresponding to each of the general data lines, including: A first communication allocation feature is determined based on the target pattern, wherein the first communication allocation feature specifies that all the general data lines belong to the same logical interface group; Based on the first communication allocation feature, all the general data lines are configured as different signal lines with complementary functions within the logic interface group to jointly form a synchronous serial communication interface.
4. The communication mode switching method according to claim 2, characterized in that, The interface definition based on the target pattern determines the first communication allocation feature corresponding to each of the general data lines, including: The first communication allocation feature is determined according to the target mode, and the first communication allocation feature specifies that the general data line is divided into multiple independent logical interface groups. Based on the first communication allocation feature, the general data lines in each of the logical interface groups are configured as signal line pairs with the same function, thereby forming multiple independently addressable shared bus-type communication interfaces.
5. The communication mode switching method according to claim 2, characterized in that, The interface definition based on the target pattern determines the first communication allocation feature corresponding to each of the general data lines, including: The first communication allocation feature is determined according to the target mode, and the first communication allocation feature specifies that each of the general data lines is independently configured as a logical interface; Based on the first communication allocation feature, time-division communication capability is configured for each general data line that serves as an independent logical interface, thereby forming multiple parallel communication interfaces.
6. The communication mode switching method according to claim 1, characterized in that, The step of determining the communication degradation trend based on the communication quality parameters includes: The communication degradation trend is determined based on the changes in the communication quality parameters over at least one data transmission cycle, where the data transmission cycle corresponds to the analog front end.
7. The communication mode switching method according to claim 1, characterized in that, The step of determining the communication degradation trend based on the communication quality parameters includes: The communication quality level is determined based on the aforementioned communication quality parameters; The pre-switching decision is determined based on the communication quality level and the communication degradation trend.
8. The communication mode switching method according to claim 7, characterized in that, Determining the communication quality level based on the communication quality parameters includes: The delay matching result is determined based on the delay parameter in the communication quality parameters; The failure frequency matching result is determined based on the failure frequency parameter in the communication quality parameters; The check error matching result is determined based on the check error parameter in the communication quality parameters; The communication quality level is determined based on the latency matching result, the failure frequency matching result, and the verification error matching result.
9. The communication mode switching method according to claim 1, characterized in that, After switching the at least one general-purpose data line from the first communication allocation feature to the second communication allocation feature, the communication mode switching method further includes: Obtain the interface configuration information corresponding to the first communication allocation feature; During operation based on the second communication allocation feature, the actual communication quality parameters based on the second communication allocation feature and the simulated communication quality parameters obtained by simulation operation based on the saved interface configuration information are acquired. The comparison result is determined based on the actual communication quality parameters and the simulated communication quality parameters; When the comparison result meets the preset back-switch condition, a switch from the second communication allocation feature to the first communication allocation feature is triggered.
10. The communication mode switching method according to any one of claims 1 to 9, characterized in that, Also includes: The historical operational dataset is determined based on the communication quality parameters, the communication degradation trend, the pre-switching decision, and the characteristic switching events. The optimization objective is determined based on the historical operation dataset. The optimization objective includes at least one of the following: a threshold parameter for determining the communication quality level, an algorithm model parameter for determining the communication degradation trend, and a strategy rule for generating the pre-switching decision. The corresponding threshold parameters, algorithm model parameters, or strategy rules are updated according to the optimization objective.
11. A communication mode switching device, characterized in that, include: The status acquisition module is used to acquire the level status of the protocol selection line; Feature allocation module, used to determine a first communication allocation feature of at least one general data line based on the level state; The parameter determination module is used to determine communication quality parameters by interacting with the analog front end based on the first communication allocation feature. The trend prediction module is used to determine the communication degradation trend based on the communication quality parameters; The decision module is used to determine a pre-switching decision to switch the communication mode before the communication quality parameters drop to a preset switching threshold, based on the communication degradation trend. A target determination module is used to determine a second communication allocation characteristic based on the communication degradation trend in response to the pre-switching decision; The switching execution module is used to determine the target level state corresponding to the protocol selection line according to the second communication allocation feature, so that the at least one general data line switches from the first communication allocation feature to the second communication allocation feature.
12. An energy storage device, characterized in that, It includes a microcontroller unit and an analog front-end, the microcontroller unit and the analog front-end are connected via a communication interface, the communication interface including a protocol selection line and at least one general data line; The energy storage device also includes the communication mode switching device as described in claim 11.