Communication error prevention method based on CAN and RS485 bus two-in-one BMS protocol

By adopting the CAN and RS485 bus two-in-one communication protocol in the BMS system, data packets are automatically identified and processed, which solves the problem of error-prone interfaces, improves system performance and reliability, and adapts to complex industrial environments.

CN118611828BActive Publication Date: 2024-10-29深圳市华芯控股有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411045079.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-01
Publication Date
2024-10-29
Estimated Expiration
2044-08-01

AI Technical Summary

Technical Problem

In existing BMS communication technology, CAN and RS485 physical interfaces are prone to connection errors, resulting in reduced system performance and frequent communication errors.

Method used

Using the BMS protocol based on CAN and RS485 bus, it automatically identifies the communication protocol, adds frame headers, read and write bits, function codes, heartbeat packets and check codes, monitors the communication status in real time, and implements data packet verification and exception handling. , ensuring the reliability and stability of communication.

Benefits of technology

It effectively avoids physical interface errors, improves the performance of the BMS system, reduces communication errors, improves the overall reliability and flexibility of the system, and adapts to complex industrial environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118611828B_ABST
    Figure CN118611828B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical fields of transmission of digital information, and provides a communication error prevention method based on a two-in-one BMS protocol of a CAN bus and an RS485 bus. The method comprises the following steps: setting the CAN bus and the RS485 bus as a communication bus of the two-in-one BMS protocol, carrying N BMS systems for parallel communication, automatically identifying whether the communication is CAN communication or RS485 communication when the same interface is connected to the RS485 bus or the CAN bus, adding a frame header, a read / write bit, a function code, a heartbeat packet, a check code, and a frame tail bit to each data packet at a data sending end during communication, performing check code verification on the received data packet at a data receiving end using the same check algorithm as that at a data sending end, if the check code does not match, determining that the data packet transmission is erroneous, requesting retransmission, monitoring the communication state and the data transmission situation, and automatically starting a corresponding processing flow according to the type of the abnormality when a communication abnormality is detected, thereby being compatible with the same interface to implement two different physical communication protocols, improving the performance of the BMS system, and reducing communication errors.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical fields of digital information transmission, electric digital data processing, BMS protocol and the like, and in particular to a communication error prevention method based on a BMS protocol combining a CAN bus and an RS485 bus. Background Art

[0002] RS485 and CAN bus are two widely used communication protocols in the field of industrial automation. RS485 is used in many occasions due to its advantages such as long communication distance and high differential signal anti-interference. The CAN bus occupies an important position in complex industrial environments with its high real-time performance and multi-master communication capabilities. However, the traditional BMS communication RS485 and CAN have two physical interfaces and two communication protocols. In a complex working environment, it is easy to have the physical interface connected incorrectly, resulting in the degradation of BMS system performance, causing communication errors such as packet loss and connection failure. To solve this problem, there is currently a technology that merges the CAN and RS485 physical buses on the same bus, but because the CAN and RS485 physical buses are differential signals, communication errors still occur frequently.

[0003] In summary, the existing BMS communication technology has technical problems such as physical interface misconnection, BMS system performance degradation, and frequent communication errors. Summary of the invention

[0004] In view of the deficiencies in the above-mentioned prior art, the present invention provides a communication error prevention method based on a BMS protocol combining CAN and RS485 buses in one, so as to avoid wrong connection of physical interfaces, improve the performance of the BMS system, and reduce communication errors.

[0005] The communication error prevention method based on the BMS protocol of the CAN and RS485 bus two-in-one provided by the present invention comprises the following steps:

[0006] The CAN and RS485 buses are set as a two-in-one BMS protocol communication bus, the two-in-one BMS protocol communication bus carries N BMS systems for parallel communication, and the same interface automatically identifies whether it is CAN communication or RS485 communication when connected to the RS485 bus or the CAN bus. The BMS system is configured as a slave, and the upper computer communicating with the BMS system is the master; N is a natural number greater than 1;

[0007] When data transmission communication occurs between the host and the slave, at the data sending end, a frame header, a read / write bit, a function code, a heartbeat packet, a check code and a frame tail bit are added to each data packet, and at the data receiving end, the check code of the received data packet is verified using the same check algorithm as that of the data sending end. If the check code does not match, it is determined that the data packet transmission is erroneous and a retransmission is requested;

[0008] A communication anomaly detection mechanism is set in the BMS system, and the communication anomaly detection mechanism monitors the communication status and data transmission status in real time. When a communication anomaly is detected, a corresponding processing flow is automatically started according to the anomaly type.

[0009] Furthermore, the communication bus of the two-in-one BMS protocol carries N BMS systems for parallel communication, including:

[0010] The communication bus of the two-in-one BMS protocol is connected to the RS485 communication interface and the CAN communication interface at the same time, the RS485 communication interface is connected to M BMS systems, and the CAN communication interface is connected to P BMS systems; the sum of the M BMS systems and the P BMS systems is equal to N BMS systems, which are respectively connected to the communication bus of the two-in-one BMS protocol for parallel communication.

[0011] Furthermore, when the M BMS systems and the P BMS systems communicate in parallel, the RS485 and CAN communication protocols are transparently transmitted on the bus through the configured bus controller and interface adapter.

[0012] Furthermore, the shared node information of the N BMS systems supports a minimum of 16 nodes, and different control units in the N BMS systems communicate with each other through the shared node information.

[0013] Furthermore, when N BMS systems communicate in parallel, it includes: according to the data transmission requirements of different control units in the N BMS systems, selecting a bus technology adapted to the data transmission requirements for communication.

[0014] Further, according to the data transmission requirements of different control units in the N BMS systems, a bus technology adapted to the data transmission requirements is selected for communication, including:

[0015] Determine the data volume and transmission speed requirements of different control units in the N BMS systems;

[0016] When the amount of data to be transmitted is greater than a preset large data amount threshold and the data transmission speed is greater than a preset high rate threshold, the communication format of the CAN bus in the communication bus of the two-in-one BMS protocol is automatically selected for communication;

[0017] When the amount of data to be transmitted is less than a preset large data amount threshold or the data transmission speed is less than a preset high rate threshold, the communication format of the RS485 bus in the communication bus of the two-in-one BMS protocol is automatically selected for communication.

[0018] Further, the communication format of the RS485 bus is selected for communication, and when the host sends a command, the frame header of the data packet occupies 1 byte, the read-write bit occupies 1 byte, the function code 1 byte, the heartbeat packet occupies 1 byte, the check code occupies 1 byte, and the frame tail occupies 1 byte; when the slave responds to a command, the frame header of the data packet occupies 1 byte, the read-write bit occupies 1 byte, the function code 1 byte, the heartbeat packet occupies 1 byte, the check code occupies 1 byte, and the frame tail occupies 1 byte.

[0019] Further, the communication format of the CAN bus is selected for communication. When the host sends a CAN data frame, the CAN communication format includes a data length code DLC of 8, and the bytes of the data DATA corresponding to the data length code DLC are Byte0, Byte1, Byte2, Byte3, Byte4, Byte5, Byte6, and Byte7; Byte0 is the frame header, Byte1 is the start function code, Byte2 is the index bit, Byte3 is the start byte, Byte4 is the length, Byte5 and Byte6 are both 0, and Byte7 is the check code CRC; the slave responds to the data content of the CAN data frame, and the CAN communication format includes a data length code DLC of 8, and the bytes of the data DATA corresponding to the data length code DLC are Byte0-Byte7.

[0020] Furthermore, a communication error prevention method based on a two-in-one BMS protocol of the CAN and RS485 buses includes: setting a communication asynchronous mechanism, wherein the communication asynchronous mechanism is used to ensure that the CAN bus and the RS485 bus perform asynchronous communication during data transmission to prevent mutual signal interference between the two communications.

[0021] Furthermore, when receiving data, the data receiver verifies the data using the verification code. If the verification result is incorrect, it is considered that an error has occurred in the data, and corresponding error handling measures are taken.

[0022] Compared with the prior art, the present invention has the following beneficial effects:

[0023] The present invention provides a communication error prevention method based on a BMS protocol of a two-in-one CAN and RS485 bus. The method comprises the following steps: setting a CAN and RS485 bus as a communication bus of a two-in-one BMS protocol, wherein the two-in-one BMS protocol communication bus carries N BMS systems for parallel communication, and automatically identifies whether it is CAN communication or RS485 communication when the same interface is connected to an RS485 bus or a CAN bus. The BMS system is configured as a slave, and a host computer that communicates with the BMS system is a host. When data transmission communication occurs between the host and the slave, at the data sending end, a data transmission error prevention method is used for each data. The packet adds a frame header, a read / write bit, a function code, a heartbeat packet, a check code and a frame tail bit. At the data receiving end, the check code of the received data packet is verified using the same check algorithm as the data sending end. If the check code does not match, the data packet transmission error is determined and retransmission is requested. A communication anomaly detection mechanism is set in the BMS system. The communication anomaly detection mechanism monitors the communication status and data transmission status in real time. When a communication anomaly is detected, the corresponding processing flow is automatically started according to the anomaly type, thereby being compatible with the same interface to implement two different physical communication protocols, improving the performance of the BMS system and reducing communication errors. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their description are used to explain the present invention and do not constitute an improper limitation of the present invention. Some specific embodiments of the present invention will be described in detail in an exemplary and non-restrictive manner with reference to the drawings. The same reference numerals in the drawings indicate the same or similar components or parts. It should be understood by those skilled in the art that these drawings are not necessarily drawn to scale. In the drawings:

[0025] Figure 1 It is a flow chart of a communication error prevention method based on a two-in-one BMS protocol of a CAN and RS485 bus according to an embodiment of the present invention;

[0026] Figure 2 This is a communication format schematic diagram of RS485 bus communication according to an embodiment of the present invention;

[0027] Figure 3 This is a schematic diagram of a communication format of CAN bus communication according to an embodiment of the present invention;

[0028] Figure 4 Schematic diagram of CAN / RS485 communication of N BMS systems in parallel according to an embodiment of the present invention. DETAILED DESCRIPTION

[0029] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is only an embodiment of a part of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work should fall within the scope of protection of the present invention.

[0030] See also Figure 1-Figure 4 The embodiment of the present invention provides a communication error prevention method based on a two-in-one BMS protocol of a CAN and RS485 bus, comprising step S101, step S102 and step S103.

[0031] S101, setting the CAN and RS485 buses as a two-in-one BMS protocol communication bus, the two-in-one BMS protocol communication bus carries N BMS systems for parallel communication, and automatically identifies whether it is CAN communication or RS485 communication when the same interface is connected to the RS485 bus or the CAN bus, the BMS system is configured as a slave, and the upper computer communicating with the BMS system is the master; N is a natural number greater than 1;

[0032] S102, when data transmission communication occurs between the host and the slave, at the data sending end, a frame header, a read / write bit, a function code, a heartbeat packet, a check code and a frame tail bit are added to each data packet, and at the data receiving end, the check code of the received data packet is verified using the same check algorithm as that of the data sending end, and if the check code does not match, it is determined that the data packet transmission is erroneous, and a retransmission is requested;

[0033] S103: A communication anomaly detection mechanism is set in the BMS system, and the communication anomaly detection mechanism monitors the communication status and data transmission status in real time. When a communication anomaly is detected, a corresponding processing flow is automatically started according to the anomaly type.

[0034] It should be noted that CAN and RS485 buses each have their own advantages. By merging them, the advantages of both can be utilized to improve the overall performance and reliability of the system. At the same time, a unified communication bus can simplify system design and reduce the risk of misconnecting the physical interface. In step S101, through a two-in-one bus design, the same interface can be compatible with two different physical communication protocols, reducing the probability of misconnecting the interface, and can improve the system's integration and communication flexibility to adapt to more complex industrial environments.

[0035] It should also be noted that the frame header and frame tail are used to identify the start and end of the data packet to ensure the integrity of the data packet. The read-write bit and function code are used to indicate the type and function of the data packet, which is convenient for the receiving end to parse. The heartbeat packet is used to maintain the activity of the communication link to prevent the link from being interrupted due to long-term non-data transmission. The check code is used for data integrity verification to ensure that there are no errors in the data transmission process. In step S102, by adding a frame header, a read-write bit, a function code, a heartbeat packet, a check code and a frame tail bit field to each data packet, the structural integrity of the data packet and the reliability of the transmission can be ensured. Among them, the heartbeat packet can monitor the communication link status in real time to prevent the link from being disconnected. In addition, the check code verification mechanism can promptly discover and correct transmission errors and improve the reliability of communication.

[0036] It should also be noted that in a complex industrial environment, communication anomalies may occur at any time, and the real-time monitoring mechanism can quickly detect and respond to these anomalies. Starting the corresponding processing flow according to the type of anomaly can minimize the impact of communication errors on the system. In step S103, by real-time monitoring of the communication status and data transmission, anomalies can be discovered in time and measures can be taken. Automatically starting the corresponding processing flow can quickly restore communication, reduce packet loss and connection failure, and improve the stability and reliability of the system.

[0037] In some preferred embodiments, when a communication anomaly is detected, the corresponding processing flow is automatically started according to the anomaly type, including: when the data packet receiving end detects the integrity of the data packet through the check code, if the check code does not match, it is determined that the data packet is interfered with by the signal during the transmission process, and the data packet receiving end sends a retransmission request to the sending end, requiring the data packet to be retransmitted, and the communication anomaly is recorded in the system log for subsequent analysis and processing; if multiple retransmission requests cannot solve the problem, the communication rate is reduced to reduce the impact of signal interference. It should be noted that in this embodiment, the integrity of the data packet is detected by the check code, and a retransmission request is initiated when the check fails, which can ensure that there is no error in the data transmission process and improve the reliability of data transmission. In addition, recording communication anomalies helps to identify and analyze common communication problems and provide data support for subsequent system maintenance and optimization. In addition, when multiple retransmission requests cannot solve the problem, by reducing the communication rate, signal interference can be reduced and the stability and reliability of communication can be improved.

[0038] In some preferred embodiments, when a communication anomaly is detected, the corresponding processing flow is automatically started according to the anomaly type, including: monitoring the activity of the communication link through a heartbeat packet, if no heartbeat packet is received within a preset time, it is determined that there is a physical connection problem, and the connection is reestablished by restarting the communication module through software. If the restart of the communication module cannot restore the connection, an alarm message is sent to the system administrator to prompt the physical connection to be checked; or, when the restart of the communication module cannot restore the connection, the redundant line is configured to automatically switch to the backup line to continue communication. It should be noted that in this embodiment, through the real-time monitoring of the heartbeat packet, the physical connection problem in the communication link can be quickly detected, so that the corresponding processing measures can be taken in time to avoid long-term communication interruption. At the same time, software restarting the communication module is a fast recovery means, which can try to restore communication in a short time. In the case that restarting the communication module cannot restore the connection, an alarm message is sent to the system administrator, so that manual intervention can be made to check and repair the physical connection, thereby ensuring that the problem can be handled in time. In addition, configuring redundant lines and automatically switching to backup lines can ensure the continuity and stability of communication when problems occur in the main line, reduce the time of communication interruption, and improve the reliability of the system. It is understandable that in this embodiment, the automated detection and processing process can reduce the frequency of manual intervention and maintenance costs. The system can autonomously detect and attempt to restore the connection, and only notify the administrator when necessary to avoid unnecessary maintenance operations. At the same time, the configuration of redundant lines can enhance the fault tolerance of the system when facing physical connection problems. Even if the main line fails, the system can still maintain communication through the backup line, improving the robustness of the overall system.

[0039] In some preferred embodiments, the communication bus of the two-in-one BMS protocol carries N BMS systems for parallel communication, including: the communication bus of the two-in-one BMS protocol is connected to the RS485 communication interface and the CAN communication interface at the same time, the RS485 communication interface is connected to M BMS systems, and the CAN communication interface is connected to P BMS systems; the sum of the M BMS systems and the P BMS systems is equal to N BMS systems, which are respectively connected to the communication bus of the two-in-one BMS protocol for parallel communication. It should be noted that in this embodiment, by reasonably allocating N BMS systems on the RS485 and CAN communication interfaces, the characteristics of the two communication interfaces can be fully utilized to improve the communication efficiency and performance of the overall system. At the same time, by dispersing the communication load, the pressure of a single communication interface can be reduced, and the response speed and processing capacity of the system can be improved. In addition, by connecting M and P BMS systems to the RS485 and CAN communication interfaces respectively, a redundant communication architecture can be formed. When a problem occurs in a certain communication interface, other interfaces can still work normally to ensure the continuity and reliability of the system.

[0040] In some preferred embodiments, when the M BMS systems and the P BMS systems communicate in parallel, the RS485 and CAN communication protocols are transparently transmitted on the bus through the configured bus controller and interface adapter. It should be noted that in this embodiment, the bus controller is responsible for managing and controlling the operation of the entire communication bus to ensure that the data of the RS485 and CAN protocols can be smoothly transmitted on the same bus. The interface adapter is responsible for converting the RS485 and CAN protocols into a unified bus protocol format to achieve transparent data transmission between different protocols. Further, through the bus controller and the interface adapter, errors occurring during the communication process can be detected and processed to enhance the fault tolerance and reliability of the system. When a communication failure occurs, the bus controller can automatically switch to a backup line or reinitialize the communication module to ensure the stable operation of the system. In addition, the transparent transmission technology enables the system to be compatible with more types of equipment and meet the needs of different application scenarios. Users can flexibly configure the number and type of BMS systems according to specific needs without worrying about protocol compatibility issues.

[0041] In some preferred embodiments, the shared node information of the N BMS systems supports at least 16 nodes, and different control units in the N BMS systems communicate through the shared node information. It should be noted that in this embodiment, through shared node information, different BMS control units can efficiently exchange data to achieve faster response speed and higher communication efficiency. Among them, the shared node information may include battery status, charge and discharge information, temperature data, etc., to ensure that each control unit has real-time knowledge of the system status. In addition, the shared node information mechanism can simplify the communication architecture of the system, so that each control unit can communicate through a unified interface, reducing complex point-to-point communication configuration. Supporting shared information of 16 nodes can easily expand and integrate more BMS control units to adapt to different application scenarios and needs.

[0042] In some preferred embodiments, when N BMS systems communicate in parallel, it includes: according to the data transmission requirements of different control units in the N BMS systems, a bus technology adapted to the data transmission requirements is selected for communication. Further, according to the data transmission requirements of different control units in the N BMS systems, a bus technology adapted to the data transmission requirements is selected for communication, including: judging the data volume requirements and transmission speed requirements of different control units in the N BMS systems; when the data volume to be transmitted is greater than the preset large data volume threshold and the data transmission speed is greater than the preset high rate threshold, the communication format of the CAN bus in the communication bus of the two-in-one BMS protocol is automatically selected for communication; when the data volume to be transmitted is less than the preset large data volume threshold or the data transmission speed is less than the preset high rate threshold, the communication format of the RS485 bus in the communication bus of the two-in-one BMS protocol is automatically selected for communication. It should be noted that in this embodiment, for the situation where a large amount of data needs to be transmitted and the speed requirement is high, the CAN bus has the characteristics of high bandwidth and high real-time performance, which can ensure fast and reliable data transmission. For situations where the amount of data to be transmitted is small and the speed requirement is not high, the RS485 bus has the advantages of long-distance transmission and high anti-interference, which can ensure stable communication. At the same time, by automatically selecting the adapted data bus, the system can optimize the use of communication resources, reduce unnecessary expenses, and improve the performance and efficiency of the overall system while ensuring performance. The dynamic selection bus technology enables the system to easily adapt to different application requirements and environmental changes, and has strong scalability and adaptability.

[0043] In some preferred embodiments, the communication format of the RS485 bus is selected for communication. When the host sends a command, the frame header of the data packet occupies 1 byte, the read-write bit occupies 1 byte, the function code 1 byte, the heartbeat packet occupies 1 byte, the check code occupies 1 byte, and the frame tail occupies 1 byte; when the slave responds to the command, the frame header of the data packet occupies 1 byte, the read-write bit occupies 1 byte, the function code 1 byte, the heartbeat packet occupies 1 byte, the check code occupies 1 byte, and the frame tail occupies 1 byte. Further, when the data is received, the data receiving party verifies the data through the check code. If the check result is incorrect, it is considered that the data is wrong and corresponding error handling measures are taken. It should be noted that in this embodiment, the 1-byte frame header is used to identify the beginning of the data packet to ensure that the receiving end can correctly identify and parse the data packet. The 1-byte frame tail bit is used to identify the end of the data packet to ensure that the receiving end can correctly judge the integrity of the data packet. The 1-byte read-write bit is used to indicate whether the current operation is read or write, which helps to distinguish different operation types. The 1-byte function code is used to indicate a specific operation type or command, so that the system can flexibly implement multiple functions. The 1-byte heartbeat packet is used for regular transmission to ensure the activity and stability of the communication link and prevent link interruption due to long-term no data transmission. The 1-byte checksum is used to verify the integrity of the data packet, ensure that the data is not tampered with or damaged during transmission, and improve the reliability of communication. It can be understood that in this embodiment, the use of a fixed 1-byte length field can simplify the structure of the data packet, making it easier to parse and process. The fixed-length field makes the data packet parsing algorithm simpler and reduces the complexity of encoding and decoding. A 1-byte (8-bit) length field is sufficient to represent most control and status information, thereby reducing the overall length of the data packet and reducing communication overhead. Shorter data packets can be transmitted quickly on the bus, reducing communication delays and improving real-time performance.

[0044] In some preferred embodiments, the communication format of the CAN bus is selected for communication. When the host sends a CAN data frame, the CAN communication format includes a data length code DLC of 8, and the bytes of the data DATA corresponding to the data length code DLC are Byte0, Byte1, Byte2, Byte3, Byte4, Byte5, Byte6, and Byte7; Byte0 is the frame header, Byte1 is the start function code, Byte2 is the index bit, Byte3 is the start byte, Byte4 is the length, Byte5 and Byte6 are both 0, and Byte7 is the check code CRC; the slave responds to the data content of the CAN data frame, and the CAN communication format includes a data length code DLC of 8, and the bytes of the data DATA corresponding to the data length code DLC are Byte0-Byte7. It should be noted that in this embodiment, Byte0 is the frame header, and the frame header clarifies the starting position of the data packet to ensure the synchronization and identification of the data packet. The function code clarifies the operation type of the data packet, which helps to realize multiple functions and commands. The index bit helps the receiving end to correctly sort and manage the data packet, especially when transmitting in segments. The start byte clarifies the position of the data in the data packet, which facilitates the accurate transmission and reception of the data. The length field specifies the actual data length of the data packet to avoid errors in data packet parsing. Byte5 and Byte6 are both 0, which means they are not used in the current implementation, but leave space for future expansion and compatibility, facilitating future function expansion and protocol updates. The CRC checksum is an error detection mechanism that can effectively detect and correct errors in data transmission.

[0045] In some preferred embodiments, the communication error prevention method of the BMS protocol based on the two-in-one CAN and RS485 bus includes: setting a communication asynchronous mechanism, which is used to ensure that the CAN bus and the RS485 bus perform asynchronous communication during data transmission to prevent the two communications from interfering with each other's signals. It should be noted that in the present embodiment, CAN and RS485 are differential signals, but their communication modes and timings are different. Synchronous communication can cause signal interference, affecting the accuracy and reliability of data transmission. The asynchronous mechanism can ensure that the two buses transmit data in different time periods, thereby avoiding mutual interference of signals. In addition, asynchronous communication can reduce the chance of signal conflict and interference, ensure that the communication of each bus can proceed smoothly, and improve the stability and reliability of data transmission. The asynchronous communication mechanism allows the CAN and RS485 buses to perform data transmission under their respective optimal timing conditions, thereby improving the communication efficiency of the overall system.

[0046] In some improved embodiments, when data times out or is lost during transmission, the sender resends the data according to a preset number of retransmissions. It should be noted that in this embodiment, when data times out or is lost during transmission, the sender resends the data according to a preset number of retransmissions, which can ensure reliable transmission of the data. At the same time, the preset number of retransmissions can avoid the exhaustion of system resources due to infinite retransmissions.

[0047] It should be pointed out that the above embodiments are only preferred specific implementation modes of the present invention, and the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention. The protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A communication error prevention method based on a two-in-one BMS protocol of CAN and RS485 bus, characterized in that: include: The CAN and RS485 buses are set as a two-in-one BMS protocol communication bus, the two-in-one BMS protocol communication bus carries N BMS systems for parallel communication, and the same interface automatically identifies whether it is CAN communication or RS485 communication when connected to the RS485 bus or the CAN bus. The BMS system is configured as a slave, and the upper computer communicating with the BMS system is the master; N is a natural number greater than 1; When data transmission communication occurs between the host and the slave, at the data sending end, a frame header, a read / write bit, a function code, a heartbeat packet, a check code and a frame tail bit are added to each data packet, and at the data receiving end, the check code of the received data packet is verified using the same check algorithm as that of the data sending end. If the check code does not match, it is determined that the data packet transmission is erroneous and a retransmission is requested; A communication anomaly detection mechanism is set in the BMS system, and the communication anomaly detection mechanism monitors the communication status and data transmission status in real time. When a communication anomaly is detected, a corresponding processing flow is automatically started according to the anomaly type.

2. The communication error prevention method based on the BMS protocol of CAN and RS485 bus two-in-one as claimed in claim 1 is characterized in that: The communication bus of the two-in-one BMS protocol carries N BMS systems for parallel communication, including: The communication bus of the two-in-one BMS protocol is connected to the RS485 communication interface and the CAN communication interface at the same time, the RS485 communication interface is connected to M BMS systems, and the CAN communication interface is connected to P BMS systems; the sum of the M BMS systems and the P BMS systems is equal to N BMS systems, which are respectively connected to the communication bus of the two-in-one BMS protocol for parallel communication.

3. The communication error prevention method based on the BMS protocol of CAN and RS485 bus two-in-one as claimed in claim 2, characterized in that: When the M BMS systems and the P BMS systems communicate in parallel, the RS485 and CAN communication protocols are transparently transmitted on the bus through the configured bus controller and interface adapter.

4. The communication error prevention method based on the BMS protocol of CAN and RS485 bus two-in-one as claimed in claim 1 is characterized in that: The shared node information of the N BMS systems supports a minimum of 16 nodes, and different control units in the N BMS systems communicate with each other through the shared node information.

5. The communication error prevention method based on the BMS protocol of CAN and RS485 bus two-in-one as claimed in claim 1 is characterized in that: When N BMS systems communicate in parallel, the method includes: according to data transmission requirements of different control units in the N BMS systems, selecting a bus technology adapted to the data transmission requirements for communication.

6. The communication error prevention method based on the BMS protocol of CAN and RS485 bus two-in-one as claimed in claim 5, characterized in that: According to the data transmission requirements of different control units in the N BMS systems, a bus technology adapted to the data transmission requirements is selected for communication, including: Determine the data volume and transmission speed requirements of different control units in the N BMS systems; When the amount of data to be transmitted is greater than a preset large data amount threshold and the data transmission speed is greater than a preset high rate threshold, the communication format of the CAN bus in the communication bus of the two-in-one BMS protocol is automatically selected for communication; When the amount of data to be transmitted is less than a preset large data amount threshold or the data transmission speed is less than a preset high rate threshold, the communication format of the RS485 bus in the communication bus of the two-in-one BMS protocol is automatically selected for communication.

7. The communication error prevention method based on the BMS protocol of CAN and RS485 bus two-in-one as claimed in claim 6 is characterized in that: The communication format of the RS485 bus is selected for communication. When the host sends a command, the frame header of the data packet occupies 1 byte, the read-write bit occupies 1 byte, the function code 1 byte, the heartbeat packet occupies 1 byte, the check code occupies 1 byte, and the frame tail occupies 1 byte; when the slave responds to a command, the frame header of the data packet occupies 1 byte, the read-write bit occupies 1 byte, the function code 1 byte, the heartbeat packet occupies 1 byte, the check code occupies 1 byte, and the frame tail occupies 1 byte.

8. The communication error prevention method based on the BMS protocol of CAN and RS485 bus two-in-one as claimed in claim 6, characterized in that: The communication format of the CAN bus is selected for communication. When the host sends a CAN data frame, the CAN communication format includes a data length code DLC of 8, and the bytes of the data DATA corresponding to the data length code DLC are Byte0, Byte1, Byte2, Byte3, Byte4, Byte5, Byte6, and Byte7; Byte0 is a frame header, Byte1 is a start function code, Byte2 is an index bit, Byte3 is a start byte, Byte4 is a length, Byte5 and Byte6 are both 0, and Byte7 is a check code CRC; the slave responds to the data content of the CAN data frame, and the CAN communication format includes a data length code DLC of 8, and the bytes of the data DATA corresponding to the data length code DLC are Byte0-Byte7.

9. The communication error prevention method based on the BMS protocol of CAN and RS485 bus two-in-one as claimed in claim 1, characterized in that: include: A communication asynchronous mechanism is set up, and the communication asynchronous mechanism is used to ensure that the CAN bus and the RS485 bus perform asynchronous communication during data transmission to prevent the two communications from interfering with each other's signals.

10. The communication error prevention method based on the BMS protocol of CAN and RS485 bus two-in-one as claimed in claim 7, characterized in that: When receiving data, the data receiver verifies the data using the verification code. If the verification result is incorrect, it is considered that the data is erroneous and corresponding error handling measures are taken.

Citation Information

Patent Citations

  • Energy storage station and communication method therefor

    CN106787166A

  • FSK and LAN protocol converter apparatus for rail transit signal system

    WO2024051003A1