Communication control method and apparatus, terminal device, and storage medium
By pre-setting interface functions in the terminal device, the data acquisition problem caused by communication abnormalities in the battery management system was solved, ensuring the safety of charging and discharging.
Patent Information
- Application Number
- CN202210743869.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-28
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2042-06-28
AI Technical Summary
In battery management systems, communication anomalies between the controller and terminal devices can prevent timely acquisition of charging and discharging information, posing a safety hazard.
By pre-setting interface functions in the terminal device, if an abnormality is detected in the communication with the microcontroller unit of the battery management system, the interface functions are directly called to obtain the battery's operating data from the analog front end, and the abnormality is detected and handled through data acquisition and processing functions.
This ensures that the terminal device can still obtain battery operating data in the event of communication failure, enabling safe monitoring of charging and discharging and avoiding potential safety hazards.
Smart Images

Figure CN114977427B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of battery management technology, specifically to a communication control method, device, terminal equipment, and storage medium. Background Technology
[0002] During the operation of the Battery Management System (BMS), communication anomalies inevitably occur between the BMS controller and the terminal device due to the influence of the external environment and the aging of components. This can cause the terminal device to be unable to obtain charging and discharging information in a timely manner, thereby posing a safety hazard to the charging and discharging of the terminal product. Summary of the Invention
[0003] In view of this, this application provides a communication control method, apparatus, terminal device, and storage medium, which can continue to provide charging and discharging information to the terminal device when the communication between the controller of the BMS and the terminal device is abnormal, thereby ensuring the charging and discharging safety of the terminal device.
[0004] To achieve the above objectives, this application adopts the following technical solution:
[0005] The first aspect of this application provides a communication control method applied to a terminal device, the terminal device including a first microcontroller unit and a battery management system, and the terminal device having pre-configured interface functions; the battery management system including an analog front-end and a second microcontroller unit; the communication control method includes:
[0006] If communication between the first microcontroller unit and the second microcontroller unit fails, the interface function is invoked to obtain battery operating data from the analog front end.
[0007] Optionally, the interface functions include data acquisition and processing functions and exception handling functions;
[0008] The step of calling the interface function to obtain battery operating data from the simulated front end includes:
[0009] The data acquisition and processing function is invoked to obtain the battery's operating data from the simulation front end;
[0010] The method further includes:
[0011] The exception handling function is invoked to detect whether there is an anomaly in the running data. If there is an anomaly in the running data, the abnormal behavior is determined and the abnormal behavior is marked.
[0012] Optionally, the operating data includes current data, voltage data, and temperature data;
[0013] The exception handling function detects whether there are any anomalies in the running data, specifically for:
[0014] The operating state of the battery device is determined based on the current data; the operating state includes charging state or discharging state.
[0015] Based on the operating status, detect whether there are any abnormalities in the operating data.
[0016] Optionally, detecting whether there are any abnormalities in the operating data based on the operating status includes:
[0017] If the operating state is the charging state, then it is detected whether the operating data meets the preset charging operating conditions. If the operating data meets the preset charging operating conditions, then the operating data is not abnormal. If the operating data does not meet the charging operating conditions, then the operating data is abnormal.
[0018] The preset charging operation conditions include: the current data is less than or equal to the charging current threshold, or the duration of the current data being greater than the charging current threshold does not exceed a first threshold; the voltage data is less than or equal to the charging voltage threshold, or the duration of the voltage data being greater than the charging voltage threshold does not exceed a second threshold; and the temperature data is within the charging temperature threshold range, or the duration of the temperature data being outside the charging temperature threshold range does not exceed a third threshold.
[0019] If the operating state is the discharge state, then it is detected whether the operating data meets the preset discharge operating conditions; if the operating data meets the preset discharge operating conditions, then the operating data is not abnormal; if the operating data does not meet the charging operating conditions, then the operating data is abnormal.
[0020] The preset discharge operation conditions include: the current data is less than or equal to the discharge current threshold, or the duration of the current data being greater than the discharge current threshold does not exceed a fourth threshold; the voltage data is less than or equal to the discharge voltage threshold, or the duration of the voltage data being greater than the discharge voltage threshold does not exceed a fifth threshold; and the temperature data is within the discharge temperature threshold range, or the duration of the temperature data being outside the discharge temperature threshold range does not exceed a sixth threshold.
[0021] Optionally, the exception handling function determines the abnormal behavior, specifically for:
[0022] When the operation is in charging mode, if the current data is greater than the charging current threshold for a duration exceeding the first threshold, the abnormal behavior includes charging overcurrent; if the voltage data is greater than the charging voltage threshold for a duration exceeding the second threshold, the abnormal behavior includes charging overvoltage; if the temperature data is greater than the maximum threshold within the charging temperature threshold range for a duration exceeding the third threshold, the abnormal behavior includes charging high temperature; if the temperature data is less than the minimum threshold within the charging temperature threshold range for a duration exceeding the third threshold, the abnormal behavior includes charging low temperature.
[0023] When the operating state is in discharge state, if the current data is greater than the discharge current threshold for a duration exceeding the fourth threshold, the abnormal behavior includes discharge overcurrent; if the voltage data is greater than the discharge voltage threshold for a duration exceeding the fifth threshold, the abnormal behavior includes discharge overvoltage; if the temperature data is greater than the maximum threshold within the discharge temperature threshold range for a duration exceeding the sixth threshold, the abnormal behavior includes discharge high temperature; if the temperature data is less than the minimum threshold within the discharge temperature threshold range for a duration exceeding the sixth threshold, the abnormal behavior includes discharge low temperature.
[0024] Optionally, the method further includes:
[0025] Within a preset reset time, a reset command is sent to the second microcontroller unit at preset time intervals until a successful reset feedback is received, confirming that the communication anomaly between the first microcontroller unit and the second microcontroller unit has been restored.
[0026] Optionally, the interface function further includes an exception recovery function; the method further includes:
[0027] The exception recovery function is invoked to check whether the running data corresponding to the abnormal behavior has returned to normal. If it has returned to normal, the mark on the abnormal behavior is cleared.
[0028] Optionally, communication anomalies between the first microcontroller unit and the second microcontroller unit include:
[0029] The first microcontroller sends a data acquisition command to the second microcontroller a preset number of times, but does not acquire any data from the second microcontroller in response to the data acquisition command.
[0030] A second aspect of this application provides a communication control device, comprising:
[0031] The function call module is used to call the interface function to obtain the battery's operating data from the analog front end if there is a communication failure between the first microcontroller unit and the second microcontroller unit.
[0032] A third aspect of this application provides a terminal device, including: a battery management system and a first microcontroller unit, wherein the terminal device has pre-configured interface functions; the battery management system includes an analog front-end and a second microcontroller unit;
[0033] The second microcontroller includes a processor and a memory connected to the processor;
[0034] The memory is used to store computer programs;
[0035] The processor is used to invoke and execute the computer program in the memory to perform the communication control method as described in the first aspect of this application.
[0036] A fourth aspect of this application provides a computer-readable storage medium having a computer program stored thereon, characterized in that the computer program, when executed by a processor, implements the steps of the method described in the first aspect of this application.
[0037] The technical solution provided in this application may include the following beneficial effects:
[0038] In this application, the terminal device includes a first microcontroller unit and a battery management system. The battery management system includes an analog front-end and a second microcontroller unit. Furthermore, the terminal device has pre-built interface functions. Based on this, if a communication anomaly is detected with the second microcontroller unit, indicating that battery operating data cannot be obtained from the battery management system, the interface functions can be called to retrieve the battery operating data from the analog front-end. This solves the problem of the terminal device being unable to monitor battery operating data due to communication anomalies with the second microcontroller unit, ensuring the charging and discharging safety of the terminal device.
[0039] Furthermore, by using pre-defined interface functions, a new operational data transmission channel is established between the terminal device and the battery management system. Only the function calling method of the terminal device when communication with the first microcontroller unit fails needs to be adjusted, without requiring significant changes to the original control logic of the terminal device, making it easy to implement. Attached Figure Description
[0040] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0041] Figure 1This is a schematic diagram of the structure of a communication control method provided in one embodiment of this application.
[0042] Figure 2 This is a schematic diagram of the structure of a communication control device provided in another embodiment of this application.
[0043] Figure 3 This is a schematic diagram of the structure of a terminal device provided in another embodiment of this application.
[0044] Figure 4 This is a schematic diagram of the structure of a first microcontroller unit provided in another embodiment of this application. Detailed Implementation
[0045] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be described in detail below. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other implementation methods obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0046] Embodiments of this application provide a communication control method, which can be applied to a terminal device. The terminal device may include a first microcontroller unit and a battery management system, and the terminal device has pre-configured interface functions. The battery management system may include an analog front-end and a second microcontroller unit. Taking the execution on the first microcontroller unit side as an example... Figure 1 As shown, the communication control method may include the following implementation steps:
[0047] S101. If there is a communication error between the first microcontroller unit and the second microcontroller unit, the interface function is called to obtain the battery's operating data from the analog front end.
[0048] A communication anomaly between the first and second microcontroller units can be identified if the first microcontroller unit sends a data acquisition command to the second microcontroller unit a preset number of times without receiving any data in response. For example, if the preset number of times is 10, then if the first microcontroller unit sends a data acquisition command to the second microcontroller unit 10 times consecutively without receiving any data in response, a communication anomaly between the two microcontroller units can be confirmed.
[0049] If communication between the first microcontroller unit and the second microcontroller unit is abnormal, the first microcontroller unit will be unable to obtain battery operating data from the second microcontroller unit, and therefore will be unable to monitor the battery charging and discharging operation in real time based on the operating data. In this case, the first microcontroller unit can be directly connected to the analog front-end of the battery management system, and communicate with the analog front-end by calling interface functions to obtain the battery operating data.
[0050] In implementation, the interface function possesses data acquisition and processing capabilities. Specifically, when a communication anomaly occurs between the first and second microcontroller units, the interface function is invoked to communicate with the analog front-end to obtain the battery's simulated operating data, thus achieving the data acquisition function. Since the simulated operating data output by the analog front-end is an analog value, the interface function also needs to perform analog-to-digital conversion on the obtained analog values to obtain the battery's operating data, and then use the obtained operating data as the return value of the interface function.
[0051] In this embodiment, the terminal device includes a first microcontroller unit and a battery management system. The battery management system includes an analog front-end and a second microcontroller unit. Furthermore, the terminal device has pre-defined interface functions. Based on this, if a communication anomaly is detected with the second microcontroller unit, indicating that battery operating data cannot be obtained from the battery management system, the interface functions can be called to retrieve the battery operating data from the analog front-end. This solves the problem of the terminal device being unable to monitor battery operating data due to communication anomalies with the second microcontroller unit, ensuring the charging and discharging safety of the terminal device.
[0052] Furthermore, by using pre-defined interface functions, a new operational data transmission channel is established between the terminal device and the battery management system. Only the function calling method of the terminal device when communication with the first microcontroller unit fails needs to be adjusted, without requiring significant changes to the original control logic of the terminal device, making it easy to implement.
[0053] In some embodiments, the aforementioned interface functions may include data acquisition and processing functions and exception handling functions; correspondingly, the aforementioned calling interface functions to obtain battery operating data from the simulation front end may specifically include: calling the data acquisition and processing functions to obtain battery operating data from the simulation front end.
[0054] The data acquisition and processing functions can include data acquisition functions and data processing functions. In implementation, the data acquisition function can be called to communicate with the simulation front end to obtain the battery's simulated operating data. Then, the corresponding data acquisition function calls the data processing function to perform analog-to-digital conversion on the simulated operating data, obtaining the battery's operating data. This operating data is then used as the return value of the data acquisition and processing function, i.e., the return value of the interface function.
[0055] To ensure that the newly constructed operational data transmission channel can also achieve real-time monitoring of operational data and further ensure the safety of charging and discharging, the communication control method may also include: calling an exception handling function to detect whether there is an anomaly in the operational data; if there is an anomaly in the operational data, determining the abnormal behavior and marking the abnormal behavior.
[0056] In implementation, the battery's operating data obtained from calling the data acquisition and processing function can be passed as a parameter to the called exception handling function. The exception handling function detects whether there are any anomalies in the operating data. When an anomaly is detected, it determines the corresponding abnormal behavior based on the abnormal operating data and marks the abnormal behavior.
[0057] In some embodiments, the operational data may include current data, voltage data, and temperature data. Correspondingly, the data acquisition functions may include current acquisition functions, voltage acquisition functions, and temperature acquisition functions.
[0058] In implementation, the current acquisition function, voltage acquisition function, temperature acquisition function, and data processing function can be encapsulated into library functions (interface functions) by the compiler. When calling the interface functions, the analog values of current, voltage, and temperature can be obtained through the current acquisition function, voltage acquisition function, and temperature acquisition function, respectively. Then, the data processing function is called in the corresponding acquisition function to convert the acquired analog values of current, voltage, and temperature into current data, voltage data, and temperature data, and then the current data, voltage data, and temperature data are passed to the interface function as the return value of the interface function.
[0059] The above-mentioned exception handling function detects whether there are any anomalies in the operating data. Specifically, it can be used to: determine the operating status of the battery device based on the current data; wherein the operating status may include charging status or discharging status; and then, based on the operating status, it can detect whether there are any anomalies in the operating data.
[0060] When detecting anomalies in runtime data based on runtime status, different anomaly detection methods can be applied to the runtime data depending on the runtime status.
[0061] Specifically, if the running status is charging, it can detect whether the running data meets the preset charging running conditions. If the running data meets the preset charging running conditions, then there is no abnormality in the running data. If the running data does not meet the charging running conditions, then there is an abnormality in the running data.
[0062] The preset charging operation conditions may include: current data being less than or equal to a charging current threshold, or the duration of data exceeding the charging current threshold not exceeding a first threshold; voltage data being less than or equal to a charging voltage threshold, or the duration of data exceeding the charging voltage threshold not exceeding a second threshold; and temperature data being within a charging temperature threshold range, or the duration of data exceeding the charging temperature threshold range not exceeding a third threshold.
[0063] For example, in the preset charging operation conditions, the charging voltage threshold is 4.25V and the second threshold is 3s. Then, if the highest voltage Vmax (the highest cell voltage in the cell) in the operation data is >4.25V and lasts for more than 3s during the charging state, it can be determined that the voltage data does not meet the preset charging operation conditions, that is, the operation data does not meet the preset charging operation conditions and there is an anomaly in the operation data.
[0064] In implementation, the charging current threshold, charging voltage threshold, charging temperature threshold range, first threshold, second threshold, and third threshold can be set according to actual needs, and are not limited here. Preferably, the charging current threshold, charging voltage threshold, and charging temperature threshold range can be the rated current, rated voltage, and rated operating temperature range of the terminal device, so as to avoid the terminal device being charged beyond the rated requirements, which could pose a safety hazard to the terminal device.
[0065] If the operating state is in discharge state, check whether the operating data meets the preset discharge operating conditions; if the operating data meets the preset discharge operating conditions, the operating data is not abnormal; if the operating data does not meet the charging operating conditions, the operating data is abnormal.
[0066] The preset discharge operation conditions may include: the current data is less than or equal to the discharge current threshold, or the duration of the current data being greater than the discharge current threshold does not exceed the fourth threshold; the voltage data is less than or equal to the discharge voltage threshold, or the duration of the voltage data being greater than the discharge voltage threshold does not exceed the fifth threshold; and the temperature data is within the discharge temperature threshold range, or the duration of the temperature data being outside the discharge temperature threshold range does not exceed the sixth threshold.
[0067] For example, in the preset discharge operation conditions, the discharge current threshold is 30A and the second threshold is 1s. Then, if the current in the operation data is greater than 30A and the duration exceeds 1s during the discharge state, it can be determined that the current data does not meet the preset discharge operation conditions, that is, the operation data does not meet the preset discharge operation conditions and the operation data is abnormal.
[0068] Similarly, the discharge current threshold, discharge voltage threshold, discharge temperature threshold range, fourth threshold, fifth threshold, and sixth threshold can be set according to actual needs, and are not limited here.
[0069] In some embodiments, the exception handling function, when determining abnormal behavior, can specifically be used as follows: when the operating state is charging, if the current data is greater than the charging current threshold for a duration exceeding a first threshold, the abnormal behavior includes charging overcurrent; if the voltage data is greater than the charging voltage threshold for a duration exceeding a second threshold, the abnormal behavior includes charging overvoltage; if the temperature data is greater than the maximum threshold within the charging temperature threshold range for a duration exceeding a third threshold, the abnormal behavior includes charging high temperature; if the temperature data is less than the minimum threshold within the charging temperature threshold range for a duration exceeding a third threshold, the abnormal behavior includes charging low temperature.
[0070] Similarly, when the operating state is in discharge state, if the current data is greater than the discharge current threshold for a duration exceeding the fourth threshold, the abnormal behavior includes discharge overcurrent; if the voltage data is greater than the discharge voltage threshold for a duration exceeding the fifth threshold, the abnormal behavior includes discharge overvoltage; if the temperature data is greater than the maximum threshold within the discharge temperature threshold range for a duration exceeding the sixth threshold, the abnormal behavior includes discharge high temperature; if the temperature data is less than the minimum threshold within the discharge temperature threshold range for a duration exceeding the sixth threshold, the abnormal behavior includes discharge low temperature.
[0071] In implementation, the anomaly handling functions can include charging anomaly protection functions, discharging anomaly protection functions, and temperature anomaly protection functions. Specifically, the charging anomaly protection function detects current and voltage data separately when the operation is in charging mode; the discharging anomaly protection function detects current and voltage data separately when the operation is in discharging mode; and the temperature anomaly protection function detects temperature data during operation. Thus, by adding encapsulated functions, the detection of operational data during operation is achieved, enabling real-time monitoring of operational data while also simplifying implementation.
[0072] In practical implementation, the charging anomaly protection function can include a charging overvoltage protection function and a charging overcurrent protection function. The charging overvoltage protection function detects whether a voltage value exceeding the charging voltage threshold for a duration exceeding a second threshold. If so, charging overvoltage exists, and a charging overvoltage flag value is returned. The charging overcurrent protection function detects whether a current value exceeding the discharging current threshold for a duration exceeding a fourth threshold. If so, charging overcurrent exists, and a charging overcurrent flag value is returned.
[0073] The discharge anomaly protection function can include a discharge overvoltage protection function and a discharge overcurrent protection function. The discharge overvoltage protection function detects whether a voltage value exceeding the discharge voltage threshold for a duration exceeding the fifth threshold. If so, discharge overvoltage exists, and the discharge overvoltage flag value is returned. The discharge overcurrent protection function detects whether a current value exceeding the discharge current threshold for a duration exceeding the fourth threshold. If so, discharge overcurrent exists, and the discharge overcurrent flag value is returned.
[0074] The temperature anomaly protection functions can include a charging high-temperature protection function, a charging low-temperature protection function, a discharging high-temperature protection function, and a discharging low-temperature protection function. The charging high-temperature protection function detects whether, during charging, the temperature data exceeds the maximum threshold within the charging temperature threshold range for a duration exceeding the third threshold. If so, a charging high-temperature flag is established, and a charging high-temperature flag value is returned. The charging low-temperature protection function detects whether, during charging, the temperature data is below the minimum threshold within the charging temperature threshold range for a duration exceeding the third threshold. If so, a charging low-temperature flag value is returned. The discharging high-temperature protection function detects whether, during discharging, the temperature data exceeds the maximum threshold within the discharging temperature threshold range for a duration exceeding the sixth threshold. If so, a discharging high-temperature flag value is established, and a discharging high-temperature flag value is returned. The discharging low-temperature protection function detects whether, during discharging, the temperature data is below the minimum threshold within the discharging temperature threshold range for a duration exceeding the sixth threshold. If so, a discharging low-temperature flag value is established, and a discharging low-temperature flag value is returned.
[0075] After obtaining the operating data, the current, voltage, and temperature data can be passed as parameters to the corresponding abnormal protection functions based on the operating status. For example, in the discharge state, the current data is passed to the discharge overcurrent protection function. Then, based on the flag values returned by each abnormal protection function, all abnormal behaviors are determined, and the returned flag values are used as markers for the abnormal behaviors.
[0076] In some embodiments, the charging anomaly protection function may further include a charging total voltage protection function. This function detects the total voltage value of the voltage data during charging. If the total voltage value exceeds a seventh threshold for a duration exceeding the seventh threshold, it determines that a charging total voltage overvoltage exists and returns a charging total voltage overvoltage flag value. Similarly, the discharging anomaly protection function may also include a discharging total voltage protection function. This function detects the total voltage value of the voltage data during discharging. If the total voltage value exceeds a eighth threshold for a duration exceeding the eighth threshold, it determines that a discharging total voltage overvoltage exists and returns a discharging total voltage overvoltage flag value.
[0077] Of course, this embodiment is only used as an example to illustrate the abnormal handling function, which includes the charging abnormal protection function, the discharging abnormal protection function, and the temperature abnormal protection function. However, this application is not limited to this. In some other embodiments, the abnormal handling function may also include other types of abnormal protection functions for abnormal detection of operating data, such as short circuits, etc., which will not be elaborated here.
[0078] In some embodiments, to protect charging and discharging safety, the communication control method may further include: executing corresponding abnormal protection measures based on abnormal behavior to restore the abnormal operating data.
[0079] During implementation, a correspondence between abnormal behaviors and abnormal protection measures can be established in advance. In this way, after the abnormal behavior is identified, the corresponding abnormal protection measures can be determined and implemented based on the abnormal behavior, thereby eliminating the abnormal behavior.
[0080] For example, if the abnormal protection measure corresponding to charging overcurrent is to shut down the charging CMOS, then when the abnormal behavior is determined to be charging overcurrent, the charging CMOS can be shut down. After the charging CMOS is shut down, charging stops, and the charging current value begins to decrease, thereby preventing the abnormal charging from continuing and achieving charging protection.
[0081] In some embodiments, the interface function may also include an exception recovery function. Correspondingly, the communication control method may also include: calling the exception recovery function to detect whether the running data corresponding to the abnormal behavior has returned to normal, and if it has returned to normal, clearing the mark on the abnormal behavior.
[0082] In implementation, after an abnormal behavior is identified, the corresponding runtime data is no longer passed to the exception handling function, but instead to the exception recovery function. The exception recovery function checks whether the passed runtime data meets the recovery conditions, which can be that the runtime data is within a preset safety threshold range. If the runtime data meets the corresponding recovery conditions, a safety flag value is returned to clear the mark of the abnormal behavior; otherwise, the corresponding exception flag value is returned to retain the mark of the abnormal behavior.
[0083] Each abnormal behavior has a corresponding recovery condition. For example, the recovery condition for overvoltage charging is that the voltage data is less than or equal to the eighth threshold or the operating state changes. In implementation, the recovery conditions for abnormal behaviors can be set according to actual needs, and are not limited here.
[0084] In practical implementation, anomaly recovery functions and anomaly handling functions are set accordingly. These anomaly recovery functions can include charging anomaly protection recovery functions, discharging anomaly protection recovery functions, and temperature anomaly protection recovery functions. Specifically, charging anomaly protection recovery functions can include charging current protection recovery functions and charging voltage protection recovery functions; discharging anomaly protection recovery functions can include discharging current protection recovery functions and discharging voltage protection recovery functions; and temperature anomaly protection recovery functions include discharging high temperature protection recovery functions, discharging low temperature protection recovery functions, charging high temperature protection recovery functions, and charging low temperature protection recovery functions. After identifying the abnormal behavior, the appropriate anomaly protection recovery function can be determined based on the corresponding operational data. For example, if the anomaly handling function returns a discharging overcurrent protection flag value, the battery management system's main loop will no longer pass current data to the discharging overcurrent protection function in the next loop. Instead, it will pass the current data as a parameter to the discharging overcurrent protection recovery function. The discharging overcurrent protection recovery function will then detect the current data and return a discharging current safety flag value when the recovery conditions are met.
[0085] For example, the current data during charging is passed to the charging overcurrent protection function. When the current is found to be greater than 30A (charging current threshold) and the duration exceeds 1s (first threshold), charging overcurrent exists. The charging CMOS can then be turned off, and the charging overcurrent flag can be raised according to the charging overcurrent flag value. In the next cycle, the main loop of the battery management system will no longer pass the current data to the charging overcurrent protection function, but will pass the current data as a parameter to the charging overcurrent protection recovery function. This function will judge the current data. When the current data is less than 100mA or the BMS changes from charging mode to discharging mode (meeting the recovery condition), the charging overcurrent protection function will return a charging overcurrent safety flag value of zero, and the charging overcurrent protection flag will be cleared.
[0086] In some embodiments, in order to restore normal communication, after determining that the communication between the first microcontroller unit and the second microcontroller unit is abnormal, a reset command can be sent to the second microcontroller unit at a preset time interval within a preset reset time, until a successful reset feedback is received, then it is determined that the communication abnormality between the first microcontroller unit and the second microcontroller unit has been restored.
[0087] If no successful reset feedback is received during the preset reset, the reset timeout will occur, and a prompt message can be issued to indicate to the user that the BMS communication is abnormal and needs to be handled.
[0088] The preset reset time and preset time interval can be set according to actual needs. For example, the preset reset time can be set to 120s and the preset time interval to 100ms. When there is a communication failure between the first microcontroller and the second microcontroller, a reset command is sent to the second microcontroller every 100ms. If no successful reset feedback is received within 120s, a reset timeout is triggered, and a prompt message can be sent to the user to inform the user that there is a communication failure during battery charging, so that the user can perform a hardware reset in time (short-circuit the MCU reset pin in the BMS to the ground line).
[0089] In practical applications, all function names in the aforementioned interface functions can be recorded in the BMS library file (.h) for easy access. The interface function libraries and the BMS library file (.h) are then provided to the terminal device. The terminal device only needs to mount the interface function libraries on its compilation platform and add the BMS library file (.h) to its project program. The terminal device sends and reads battery operation data from the BMS every 250ms. If it fails to receive operation data from the second microcontroller unit ten times consecutively, the terminal device uses the aforementioned communication control method to communicate with the BMS's analog front-end chip via the interface functions to obtain the operation data. Furthermore, if an anomaly is found in the operation data, the corresponding abnormal behavior is determined.
[0090] Embodiments of this application provide a communication control device, such as... Figure 2 As shown, the device may include: a function call module 201, used to call an interface function to obtain battery operating data from the analog front end if there is a communication failure between the first microcontroller unit and the second microcontroller unit.
[0091] Among them, the communication between the first microcontroller unit and the second microcontroller unit is abnormal, including: the first microcontroller unit sends a data acquisition command to the second microcontroller unit for a preset number of consecutive times, but does not acquire the data fed back by the second microcontroller unit in response to the data acquisition command.
[0092] Optionally, the interface function may include a data acquisition and processing function and an exception handling function. Correspondingly, when calling the interface function to obtain battery operating data from the simulation front end, the function call module 201 can specifically be used to: call the data acquisition and processing function to obtain battery operating data from the simulation front end. Furthermore, the function call module 201 can also be used to: call the exception handling function to detect whether there are any anomalies in the operating data; if there are anomalies, determine the abnormal behavior and mark the abnormal behavior.
[0093] Optionally, the operating data may include current data, voltage data, and temperature data; correspondingly, when the anomaly handling function detects whether there are anomalies in the operating data, it is specifically used to: determine the operating status of the battery device based on the current data; the operating status includes charging status or discharging status; and detect whether there are anomalies in the operating data based on the operating status.
[0094] Optionally, when detecting whether there are any anomalies in the runtime data based on the runtime status, function call module 201 can be used for:
[0095] If the operating status is charging, the system checks whether the operating data meets the preset charging operating conditions. If the operating data meets the preset charging operating conditions, the operating data is not abnormal. If the operating data does not meet the charging operating conditions, the operating data is abnormal. The preset charging operating conditions include: the current data is less than or equal to the charging current threshold, or the duration of the current data being greater than the charging current threshold does not exceed the first threshold; the voltage data is less than or equal to the charging voltage threshold, or the duration of the voltage data being greater than the charging voltage threshold does not exceed the second threshold; and the temperature data is within the charging temperature threshold range, or the duration of the temperature data being outside the charging temperature threshold range does not exceed the third threshold.
[0096] If the operating state is in discharge state, the system checks whether the operating data meets the preset discharge operating conditions. If the operating data meets the preset discharge operating conditions, the operating data is not abnormal. If the operating data does not meet the charging operating conditions, the operating data is abnormal. The preset discharge operating conditions include: the current data is less than or equal to the discharge current threshold, or the duration of the current data being greater than the discharge current threshold does not exceed the fourth threshold; the voltage data is less than or equal to the discharge voltage threshold, or the duration of the voltage data being greater than the discharge voltage threshold does not exceed the fifth threshold; and the temperature data is within the discharge temperature threshold range, or the duration of the temperature data being outside the discharge temperature threshold range does not exceed the sixth threshold.
[0097] Optionally, when the exception handling function determines the abnormal behavior, the function call module 201 can be used as follows: When the running state is charging, if the current data is greater than the charging current threshold for a duration exceeding the first threshold, the abnormal behavior includes charging overcurrent; if the voltage data is greater than the charging voltage threshold for a duration exceeding the second threshold, the abnormal behavior includes charging overvoltage; if the temperature data is greater than the maximum threshold within the charging temperature threshold range for a duration exceeding the third threshold, the abnormal behavior includes charging high temperature; if the temperature data is less than the minimum threshold within the charging temperature threshold range for a duration exceeding the third threshold, the abnormal behavior includes charging low temperature. When the running state is discharging, if the current data is greater than the discharging current threshold for a duration exceeding the fourth threshold, the abnormal behavior includes discharging overcurrent; if the voltage data is greater than the discharging voltage threshold for a duration exceeding the fifth threshold, the abnormal behavior includes discharging overvoltage; if the temperature data is greater than the maximum threshold within the discharging temperature threshold range for a duration exceeding the sixth threshold, the abnormal behavior includes discharging high temperature; if the temperature data is less than the minimum threshold within the discharging temperature threshold range for a duration exceeding the sixth threshold, the abnormal behavior includes discharging low temperature.
[0098] Optionally, the communication control device may also include a reset module, which can be used to: send a reset command to the second microcontroller unit at a preset time interval within a preset reset time, until a successful reset feedback is received, and determine that the communication abnormality between the first microcontroller unit and the second microcontroller unit has been restored.
[0099] Optionally, the interface function also includes an exception recovery function; the function call module 201 can also be used to: call the exception recovery function to detect whether the running data corresponding to the abnormal behavior has returned to normal, and if it has returned to normal, clear the mark on the abnormal behavior.
[0100] It should be understood that the specific implementation of the communication control device provided in the embodiments of this application can refer to the specific implementation of the communication control method described in any of the above embodiments, and will not be repeated here.
[0101] Embodiments of this application provide a terminal device, such as... Figure 3 As shown, the terminal device may include a battery management system 301 and a first microcontroller unit 302, and the terminal device has pre-installed interface functions; the battery management system 301 includes an analog front-end 3011 and a second microcontroller unit 3012. The interface functions may be pre-installed in the first microcontroller unit 302.
[0102] like Figure 4As shown, the first microcontroller unit may include: a memory 3021 and a processor 3022; wherein, the memory 3021 is connected to the processor 3022 and is used to store programs; the processor 3022 is used to implement the communication control method disclosed in any of the above embodiments by running the programs stored in the memory 3021.
[0103] Specifically, the aforementioned first microcontroller unit may further include: a bus, a communication interface 3023, an input device 3024, and an output device 3025.
[0104] The processor 3022, memory 3021, communication interface 3023, input device 3024, and output device 3025 are interconnected via a bus. Among them:
[0105] A bus can include a pathway for transmitting information between various components of a computer system.
[0106] The processor 3022 can be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, etc., or an application-specific integrated circuit (ASIC), or one or more integrated circuits used to control the execution of the program of the present invention. It can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0107] Processor 3022 may include a main processor, as well as a baseband chip, modem, etc.
[0108] The memory 3021 stores a program that executes the technical solution of the present invention, and may also store an operating system and other key business functions. Specifically, the program may include program code, which includes computer operation instructions. More specifically, the memory 3021 may include read-only memory (ROM), other types of static storage devices capable of storing static information and instructions, random access memory (RAM), other types of dynamic storage devices capable of storing information and instructions, disk storage, flash memory, etc.
[0109] Input device 3024 may include a device for receiving user input data and information, such as a keyboard, mouse, camera, scanner, light pen, voice input device, touch screen, pedometer, or gravity sensor.
[0110] Output device 3025 may include devices that allow information to be output to a user, such as a display screen, a speaker, etc.
[0111] The communication interface 3023 may include a device that uses any transceiver to communicate with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), etc.
[0112] The processor 3022 executes the program stored in the memory 3021, which can be used to implement the various steps of the communication control method provided in the embodiments of this application.
[0113] Another embodiment of this application provides a storage medium storing a computer program, which, when executed by a processor, implements the various steps of the communication control method provided in any of the above embodiments.
[0114] For the foregoing method embodiments, in order to simplify the description, they are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, because according to this application, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0115] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For apparatus embodiments, since they are basically similar to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.
[0116] The steps in the methods of the various embodiments of this application can be adjusted, combined, or deleted according to actual needs.
[0117] The modules and sub-modules in the apparatus and terminal in the various embodiments of this application can be merged, divided, and deleted according to actual needs.
[0118] It should be understood that the disclosed terminals, devices, and methods can be implemented in other ways, given the several embodiments provided in this application. For example, the terminal embodiments described above are merely illustrative. For instance, the division of modules or sub-modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple sub-modules or modules may be combined or integrated into another module, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or modules, and may be electrical, mechanical, or other forms.
[0119] The modules or submodules described as separate components may or may not be physically separate. The components that constitute a module or submodule may or may not be physical modules or submodules; that is, they may be located in one place or distributed across multiple network modules or submodules. Some or all of the modules or submodules can be selected to achieve the purpose of this embodiment's solution, depending on actual needs.
[0120] Furthermore, the functional modules or sub-modules in the various embodiments of this application can be integrated into one processing module, or each module or sub-module can exist physically separately, or two or more modules or sub-modules can be integrated into one module. The integrated modules or sub-modules described above can be implemented in hardware or in the form of software functional modules or sub-modules.
[0121] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0122] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software unit executed by a processor, or a combination of both. The software unit can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0123] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0124] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A communication control method, characterized in that, A first microcontroller unit is applied to a terminal device, the terminal device further including a battery management system, and the terminal device has pre-built interface functions, the interface functions including data acquisition and processing functions and exception handling functions, the battery management system including an analog front-end and a second microcontroller unit; the communication control method includes: If communication between the first microcontroller unit and the second microcontroller unit is abnormal, the data acquisition and processing function is called to obtain the simulated operating data of the battery from the simulation front end, and the obtained simulated operating data is processed by analog-to-digital conversion to obtain the operating data of the battery; at the same time, the exception handling function is called to detect whether there is an exception in the operating data. If there is an exception in the operating data, the abnormal behavior is determined and the abnormal behavior is marked. Within a preset reset time, a reset command is sent to the second microcontroller unit at preset time intervals until a successful reset feedback is received, confirming that the communication abnormality between the first microcontroller unit and the second microcontroller unit has been restored; if no successful reset feedback is received within the preset reset time, a prompt message is issued to notify the user of the BMS communication abnormality.
2. The method according to claim 1, characterized in that, The operating data includes current data, voltage data, and temperature data; The exception handling function detects whether there are any anomalies in the running data, specifically for: The operating status of the battery device is determined based on the current data; the operating status includes charging status or discharging status. Based on the operating status, detect whether there are any abnormalities in the operating data.
3. The method according to claim 2, characterized in that, The step of detecting whether there are any abnormalities in the operating data based on the operating status includes: If the operating state is the charging state, then it is detected whether the operating data meets the preset charging operating conditions. If the operating data meets the preset charging operating conditions, then the operating data is not abnormal. If the operating data does not meet the charging operating conditions, then the operating data is abnormal. The preset charging operation conditions include: the current data is less than or equal to the charging current threshold, or the duration of the current data being greater than the charging current threshold does not exceed a first threshold; the voltage data is less than or equal to the charging voltage threshold, or the duration of the voltage data being greater than the charging voltage threshold does not exceed a second threshold; and the temperature data is within the charging temperature threshold range, or the duration of the temperature data being outside the charging temperature threshold range does not exceed a third threshold. If the operating state is the discharge state, then it is detected whether the operating data meets the preset discharge operating conditions; if the operating data meets the preset discharge operating conditions, then the operating data is not abnormal; if the operating data does not meet the charging operating conditions, then the operating data is abnormal. The preset discharge operation conditions include: the current data is less than or equal to the discharge current threshold, or the duration of the current data being greater than the discharge current threshold does not exceed a fourth threshold; the voltage data is less than or equal to the discharge voltage threshold, or the duration of the voltage data being greater than the discharge voltage threshold does not exceed a fifth threshold; and the temperature data is within the discharge temperature threshold range, or the duration of the temperature data being outside the discharge temperature threshold range does not exceed a sixth threshold.
4. The method according to claim 3, characterized in that, The exception handling function determines the abnormal behavior and is specifically used for: When the operation is in charging mode, if the current data is greater than the charging current threshold for a duration exceeding the first threshold, the abnormal behavior includes charging overcurrent; if the voltage data is greater than the charging voltage threshold for a duration exceeding the second threshold, the abnormal behavior includes charging overvoltage; if the temperature data is greater than the maximum threshold within the charging temperature threshold range for a duration exceeding the third threshold, the abnormal behavior includes charging high temperature; if the temperature data is less than the minimum threshold within the charging temperature threshold range for a duration exceeding the third threshold, the abnormal behavior includes charging low temperature. When the operating state is in discharge state, if the current data is greater than the discharge current threshold for a duration exceeding the fourth threshold, the abnormal behavior includes discharge overcurrent; if the voltage data is greater than the discharge voltage threshold for a duration exceeding the fifth threshold, the abnormal behavior includes discharge overvoltage; if the temperature data is greater than the maximum threshold within the discharge temperature threshold range for a duration exceeding the sixth threshold, the abnormal behavior includes discharge high temperature; if the temperature data is less than the minimum threshold within the discharge temperature threshold range for a duration exceeding the sixth threshold, the abnormal behavior includes discharge low temperature.
5. The method according to any one of claims 2-4, characterized in that, The interface function also includes an exception recovery function; the method further includes: The exception recovery function is invoked to check whether the running data corresponding to the abnormal behavior has returned to normal. If it has returned to normal, the mark on the abnormal behavior is cleared.
6. The method according to claim 1, characterized in that, The communication between the first microcontroller unit and the second microcontroller unit is abnormal, including: The first microcontroller sends a data acquisition command to the second microcontroller a preset number of times, but does not acquire any data from the second microcontroller in response to the data acquisition command.
7. A communication control device, characterized in that, A first microcontroller unit is applied to a terminal device, the terminal device further including a battery management system, and the terminal device has pre-built interface functions, including data acquisition and processing functions and exception handling functions; the battery management system includes an analog front-end and a second microcontroller unit; the communication control device includes: The function call module is used to call the data acquisition and processing function if there is a communication failure between the first microcontroller unit and the second microcontroller unit, so as to obtain the simulated operation data of the battery from the simulation front end, and perform analog-to-digital conversion processing on the obtained simulated operation data to obtain the operation data of the battery; at the same time, the exception handling function is called to detect whether there is an exception in the operation data, and if there is an exception in the operation data, the exception behavior is determined and the exception behavior is marked. The reset module is used to send a reset command to the second microcontroller unit at preset time intervals within a preset reset time until a reset success feedback is received, confirming that the communication abnormality between the first microcontroller unit and the second microcontroller unit has been restored; if no reset success feedback is received within the preset reset time, a prompt message is issued to notify the user of the BMS communication abnormality.
8. A terminal device, characterized in that, include: The battery management system includes a first microcontroller unit; the terminal device has pre-installed interface functions, including data acquisition and processing functions and exception handling functions; the battery management system includes an analog front-end and a second microcontroller unit. The first microcontroller unit includes a processor and a memory connected to the processor; The memory is used to store computer programs; The processor is used to call and execute the computer program in the memory to perform the communication control method as described in any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Battery protection circuit
CN103532104A
Battery module protection method, BMS (Battery Management System), battery cluster and electric device
CN113921921A
Control device and micro-grid system
CN114400701A