CN118210751B - Communication method of BMS protocol based on two-in-one of CAN and RS485 bus - Google Patents

Communication method of BMS protocol based on two-in-one of CAN and RS485 bus Download PDF

Info

Publication number
CN118210751B
CN118210751B CN202410599077.9A CN202410599077A CN118210751B CN 118210751 B CN118210751 B CN 118210751B CN 202410599077 A CN202410599077 A CN 202410599077A CN 118210751 B CN118210751 B CN 118210751B
Authority
CN
China
Prior art keywords
data
communication
bus
length
protocol
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202410599077.9A
Other languages
Chinese (zh)
Other versions
CN118210751A (en
Inventor
冯丽莉
莫礼宏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Huaxin Holding Co ltd
Original Assignee
Shenzhen Huaxin Holding Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Huaxin Holding Co ltd filed Critical Shenzhen Huaxin Holding Co ltd
Priority to CN202410599077.9A priority Critical patent/CN118210751B/en
Publication of CN118210751A publication Critical patent/CN118210751A/en
Application granted granted Critical
Publication of CN118210751B publication Critical patent/CN118210751B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/10Program control for peripheral devices
    • G06F13/12Program control for peripheral devices using hardware independent of the central processor, e.g. channel or peripheral processor
    • G06F13/124Program control for peripheral devices using hardware independent of the central processor, e.g. channel or peripheral processor where hardware is a sequential transfer control unit, e.g. microprocessor, peripheral processor or state-machine
    • G06F13/126Program control for peripheral devices using hardware independent of the central processor, e.g. channel or peripheral processor where hardware is a sequential transfer control unit, e.g. microprocessor, peripheral processor or state-machine and has means for transferring I/O instructions and statuses between control unit and main processor
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40215Controller Area Network CAN

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Microelectronics & Electronic Packaging (AREA)
  • Communication Control (AREA)
  • Small-Scale Networks (AREA)

Abstract

The invention relates to the technical field of digital information transmission and the like, and provides a communication method based on a BMS protocol of two-in-one of a CAN and an RS485 bus.

Description

Communication method of BMS protocol based on two-in-one of CAN and RS485 bus
Technical Field
The invention relates to the technical fields of digital information transmission, electric digital data processing, BMS protocol and the like, in particular to a communication method of BMS protocol based on two-in-one of CAN and RS485 bus.
Background
In a BMS (Battery management system: battery MANAGEMENT SYSTEM), common communication methods include a CAN bus and an RS485 bus, and the two bus technologies have characteristics and application scenes. The CAN (controller area network: controller Area Network) bus is suitable for use in environments where high reliability is required for data transmission, provides a powerful error detection and collision resolution mechanism, and is well suited for real-time data transmission. But the data transmission rate of CAN bus is relatively low (up to 1 Mbps) and the communication distance is limited. The RS485 bus is a differential transmission serial communication bus that supports a longer transmission distance and a higher transmission rate (up to 10 Mbps). The RS485 bus supports multiple point connections, i.e. multiple devices may be connected simultaneously on the network. In RS485 bus communication, which is a half duplex point-to-multipoint communication scheme in nature, it is often necessary that the devices have addresses so that the controller can specify which device to communicate with. This is in contrast to the communication mode of the CAN bus protocol, which communicates based on a message identifier, not a device address. The sending and receiving of information is based on an identifier of the message content, rather than on the physical or logical address of the device, on the CAN bus. In the existing BMS protocol, the CAN bus protocol and the RS485 bus protocol are two sets of protocols which are separated, a start address and an end address are not available, the addresses cannot be specified to continuously read any length, the operation is complex, the expansion and modification compatibility is not easy to understand, the working efficiency is reduced, and the operation and maintenance cost is increased.
In summary, the existing BMS protocol has the technical problems that the existing BMS protocol has no start address and no end address, cannot be used for designating the address to continuously read any length, is complex to operate, is not easy to understand, has poor expansion and modification compatibility, has low working efficiency, and has high operation and maintenance cost.
Disclosure of Invention
Aiming at the defects of the prior art, the invention provides a communication method of a BMS protocol based on two-in-one of a CAN bus and an RS485 bus and related equipment thereof, which continuously reads any length by a designated address, simplifies operation, improves expansion and change compatibility, improves working efficiency and reduces operation and maintenance cost.
The invention provides a communication method of a BMS protocol based on two-in-one of a CAN bus and an RS485 bus, which comprises the following steps:
the BMS system is configured as a slave, and an upper computer of the BMS system is configured as a master; the host computer and the slave computer are in communication through a CAN bus or an RS485 bus connection, the CAN bus follows a CAN communication protocol, and the RS485 bus follows an RS485 communication protocol;
Configuring a CAN communication format, wherein during CAN communication, the CAN communication protocol transmits a data packet containing a 28-bit expansion frame identifier, when a host sends a command, the ID0-ID7 bits of the expansion frame identifier are used for specifying a specific address of a function code, the ID8-ID12 bits are used for defining the function code, the ID13 bits are used for distinguishing read-write operation types, and the ID14-ID28 bits are used for distinguishing broadcasting messages of the host; the ID0-ID7 bits of the extended frame identifier are used for specifying the specific address of the function code when the slave responds to the command, the ID8-ID12 bits are used for defining the function code, the ID13 bits of the extended frame identifier are used for distinguishing whether the response state is normal or abnormal, and the ID14-ID28 bits are used for distinguishing the slave address message;
The method comprises the steps of configuring an RS485 communication format, transmitting a variable-length data packet by using an RS485 communication protocol when the RS485 communication is performed, wherein the data length of a frame head, a read-write operation, a function code, a starting address, a length identifier, a check code and a frame tail in the variable-length data packet when a host sends a command is 1 byte, the data length of a slave address is 4 bytes, and the data length of actual data content is specified by a data length field; the data length of the frame head, the read-write operation, the function code, the starting address, the length identifier, the check code and the frame tail in the variable-length data packet is 1 byte when the slave responds to the command, the data length of the slave address is 4 bytes, and the data length of the actual data content is specified by a data length field;
After the CAN communication format and the RS485 communication format are configured, the definition data content CAN and the RS485 share the definition data structure body address, and the definition data continuously grows downwards to be compatible.
Further, the BMS system comprises a main control unit and N microprocessors, wherein the N microprocessors are correspondingly used for monitoring different battery packs, and the main control unit is in communication connection with the N microprocessors through the CAN bus.
Further, the host is in communication connection with the main control unit through the CAN bus.
Further, the BMS system comprises a main control unit and N microprocessors, wherein the N microprocessors are correspondingly used for monitoring different battery packs, and the main control unit is in communication connection with the N microprocessors through an RS485 bus.
Further, the host is in communication connection with the main control unit through the RS485 bus.
Further, the baud rate of data transmission in the CAN communication protocol is 500KHZ, and the baud rate of data transmission in the RS485 communication protocol is 57600HZ.
Further, the frame type in the CAN communication protocol is a data frame, and the frame format is an extended frame.
Further, a small-end mode is adopted for data transmission in the CAN communication protocol, and a small-end mode is adopted for data transmission in the RS485 communication protocol.
Further, a CAN communication format is configured, when CAN communication is carried out, the CAN communication protocol transmission comprises a data field length and a data field, when a host sends a command, the data field length is 8 bytes, and the data field comprises Byte0-Byte7; the slave responds to the command with a data field length of 8 bytes, the data field including Byte0-Byte7.
Further, in CAN communication or RS485 communication, no response is time-out exceeding 200 ms.
Compared with the prior art, the invention has the following beneficial effects:
The invention provides a communication method of a BMS protocol based on two-in-one of a CAN and an RS485 bus, which is characterized in that a BMS system is configured as a slave, an upper computer of the BMS system is configured as a host, the host and the slave are connected and communicated through the CAN bus or the RS485 bus, the CAN bus follows the CAN communication protocol, the RS485 bus follows the RS485 communication protocol, a CAN communication format is configured, the CAN communication protocol transmits a data packet containing 28 bits of an expansion frame identifier, ID0-ID7 bits of the expansion frame identifier are used for specifying a specific address of a function code when the host sends a command, ID8-ID12 bits are used for defining the function code, ID13 bits are used for distinguishing a read-write operation type, ID14-ID28 bits are used for distinguishing a broadcast message of the host, ID0-ID7 bits of the expansion frame identifier are used for specifying a specific address of the function code when the slave responds to the command, ID8-ID12 bits are used for defining the function code, ID13 bits of the expansion frame identifier are used for distinguishing a normal state or abnormal state, ID14-ID28 bits are used for distinguishing a slave address, RS485 communication format is configured, and the length of the data packet CAN be changed from the address of the RS485 communication format to the data packet when the length of the data packet is changed from the address to the address of the data 1, and the length of the data packet CAN be changed from the data length of the data communication frame to the length of the data communication protocol, and the length of the data is changed from the data length of the data frame 1 to the data communication protocol; the data length of the frame head, the read-write operation, the function code, the starting address, the length identifier, the check code and the frame tail in the variable-length data packet is 1 byte when the slave responds to the command, the data length of the slave address is 4 bytes, the data length of the actual data content is specified by the data length field, after the CAN communication format and the RS485 communication format are configured, the definition data structure body address is shared by the definition data content CAN and the RS485, and the definition data is continuously and downwards grown and compatible, so that the specified address CAN continuously read any length, the communication data structure body is shared, the operation is simplified, the expansion and change compatibility is improved, the working efficiency is improved, and the operation and maintenance cost is reduced.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the invention and do not constitute a limitation on the invention. Some specific embodiments of the invention will be described in detail hereinafter by way of example and not by way of limitation with reference to the accompanying drawings. The same reference numbers in the drawings denote the same or similar parts or portions, and it will be understood by those skilled in the art that the drawings are not necessarily drawn to scale, in which:
Fig. 1 is a schematic flow chart of a communication method of a BMS protocol based on two-in-one of a CAN and an RS485 bus according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a communication protocol format of a CAN communication protocol according to an embodiment of the invention;
FIG. 3 is a schematic diagram of a communication protocol format of an RS485 communication protocol according to an embodiment of the invention;
Fig. 4 is a schematic diagram of a communication protocol format of the present invention in which CAN and RS485 communication protocols share data contents.
Detailed Description
In order to enable those skilled in the art to better understand the present invention, the following description will make clear and complete descriptions of the technical solutions according to the embodiments of the present invention with reference to the accompanying drawings. It will be apparent that the described embodiments are merely some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
Referring to fig. 1-4, an embodiment of the present invention provides a communication method of a BMS protocol based on two-in-one of a CAN and an RS485 bus, including step S101, step S102, step S103, and step S104.
S101, configuring a BMS system as a slave, and configuring an upper computer of the BMS system as a master; the host computer and the slave computer are connected and communicated through a CAN bus or an RS485 bus, the CAN bus conforms to a CAN communication protocol, and the RS485 bus conforms to an RS485 communication protocol. In some preferred embodiments, the BMS system includes a main control unit and N microprocessors, which monitor different battery packs, correspondingly, and the main control unit and the N microprocessors are communicatively connected through the CAN bus. Further, the host is in communication connection with the main control unit through the CAN bus. In some preferred embodiments, the BMS system includes a main control unit and N microprocessors, which monitor different battery packs, and the main control unit and the N microprocessors are communicatively connected through the RS485 bus. Further, the host is in communication connection with the main control unit through the RS485 bus.
S102, configuring a CAN communication format, wherein during CAN communication, the CAN communication protocol transmits a data packet containing a 28-bit expansion frame identifier, the ID0-ID7 bits of the expansion frame identifier are used for specifying a specific address of a function code when a host sends a command, the ID8-ID12 bits are used for defining the function code, the ID13 bits are used for distinguishing read-write operation types, and the ID14-ID28 bits are used for distinguishing broadcasting messages of the host; the ID0-ID7 bits of the extended frame identifier are used for designating specific addresses of the function codes when the slave responds to the command, the ID8-ID12 bits are used for defining the function codes, the ID13 bits of the extended frame identifier are used for distinguishing whether the response state is normal or abnormal, and the ID14-ID28 bits are used for distinguishing slave address messages.
In this embodiment, by using the 28-bit extended frame identifier, the host can directly specify the specific address of the function code, and the operation type (read/write) in one command, thereby simplifying the configuration of the command. By using extended frames, more devices may be allowed to communicate on the same network without address collision. The flexibility of expanding frames also makes it easier to add new devices or modify the configuration of existing devices in the future. It should be noted that in this embodiment, the data processing speed can be increased and the possibility of errors can be reduced by optimizing the packet structure (such as explicit allocation of function codes, addresses, and operation types).
S103, configuring an RS485 communication format, wherein during RS485 communication, the RS485 communication protocol transmits a variable-length data packet, the data length of a frame header, a read-write operation, a function code, a start address, a length identifier, a check code and a frame tail in the variable-length data packet is 1 byte when a host sends a command, the data length of a slave address is 4 bytes, and the data length of actual data content is specified by a data length field; the data length of the frame head, the read-write operation, the function code, the starting address, the length identifier, the check code and the frame tail in the variable-length data packet is 1 byte when the slave responds to the command, the data length of the slave address is 4 bytes, and the data length of the actual data content is specified by a data length field.
It should be noted that, the RS485 communication format is configured, and when RS485 communication is performed, the frame header identifies the start of a data packet, and is used for synchronizing and indicating that data transmission is about to start, and the data length is 1 byte, which is sufficient to mark the start point of a data stream. The slave address is used to identify the specific address of the slave, ensuring that the data is properly sent to or from the particular device. The data length is 4 bytes. Longer address fields allow for more accurate device location and a greater number of devices within the network. The read-write operation is used to indicate whether the data packet is for a read operation or a write operation when the host sends a command, and the data length is 1 byte, which is enough to express an operation instruction for reading or writing. The function code is used to define a specific role or command type of the data packet, such as data reading, parameter setting, etc., and its data length is 1 byte, and may contain enough combinations to indicate various functions. The start address is used to specify the start location of the data operation, locate a specific address for data storage or retrieval, and has a data length of 1 byte and an address space sufficient to cover the addressing requirements of small to medium systems. The length identifier is used to define the length of the subsequent data field, indicating how much data should be received or transmitted next. The actual data content (whose occupied bytes are specified by the data length field) is used to carry specific data information, such as configuration parameters, etc. The check code is used for providing an error detection function of the data packet, ensuring the integrity and accuracy of the data, the data length is 1 byte, and a common CRC check such as CRC8 can be performed by one byte, so as to provide basic error detection. The end of frame marks the end of the data packet for synchronizing and indicating the completion of the data transmission, which has a data length of 1 byte, sufficient to mark the end point of the data stream.
In this embodiment, the host may send a command including a start address and a length identifier by designing a variable length packet, thereby specifying the length of data to be read from an arbitrary address. This method allows data to be read continuously without sending commands a plurality of times, thereby simplifying the operation and improving the efficiency of data acquisition. It should be noted that in this embodiment, the variable length data packet includes a start address and a data length identifier, which enable the host to specify that data of a predetermined length be read consecutively starting at any given address. The host may contain a specific start address (slave address field) and a desired data length (length identifier) to be read when sending the command, so that the host may request a large amount of data at a time without sending the command multiple times, which may significantly reduce the number of communications. For example, if a large block of data, such as a contiguous memory area or register, needs to be read, using the RS485 communication format, the master only needs to send a command containing the start address and data length once, and the slave then returns a single response containing all the requested data. By requesting multiple data points at once, the overall system process is more efficient because the round trip time between the request and the response is reduced.
It should also be noted that, in this embodiment, by using the standardized communication protocol and data packet format, the maintenance of the system becomes simpler, and the system downtime and maintenance work caused by communication errors or data parsing errors can be reduced.
In some preferred embodiments, the baud rate of the data transmission in the CAN communication protocol is 500KHZ and the baud rate of the data transmission in the RS485 communication protocol is 57600HZ. The frame type in the CAN communication protocol is a data frame, and the frame format is an extended frame. The data transmission in the CAN communication protocol adopts a small-end mode, and the data transmission in the RS485 communication protocol adopts a small-end mode. The CAN communication format is configured, when in CAN communication, the CAN communication protocol transmission comprises a DATA field length (DLC) and a DATA field (DATA), when a host sends a command, the DATA field length is 8 bytes, and the DATA field comprises Byte0-Byte7; the slave responds to the command with a data field length of 8 bytes, the data field including Byte0-Byte7. In CAN communication or RS485 communication, no response is timed out over 200 milliseconds.
In this embodiment, the baud rate in the CAN communication protocol is 500KHz, and the higher baud rate supports fast data transmission, which is suitable for applications requiring fast response and high data throughput, so as to improve the data transmission speed, reduce the delay, and enable the system to process information and respond more rapidly. In addition, the extended frame can provide longer identifiers, allow more devices to communicate on the network without conflict, realize the enhancement of the expandability and flexibility of the network, and be suitable for complex systems with a large number of devices. In addition, the small end mode is a standard byte order of a plurality of modern computing architectures, so that the data can be directly used at a receiving end without additional byte order conversion, thereby improving the efficiency of data processing, simplifying the interaction of the data among different systems and reducing the processing burden during processing. In addition, in this embodiment, the data field is 8 bytes in length, including Byte0-Byte7, and the fixed data length can simplify the structure of the data frame, so that both the transmitting and receiving parties can easily understand and process the data, and the standardized data length makes the data processing more predictable, thereby reducing programming complexity and error opportunities. In addition, the baud rate in the RS485 communication protocol is 57600Hz, and is lower than 500KHz of CAN communication, but the baud rate is enough to meet the data communication requirement of longer distance in most industrial and automation applications, and the data transmission of longer distance is supported while the proper communication speed is maintained, so that the method is suitable for equipment networks with wide distribution. In addition, the non-response exceeding 200 milliseconds is regarded as overtime, so that the system can be helped to timely detect communication faults or equipment faults, and the system is prevented from waiting for non-response equipment for a long time, thereby improving the robustness and reliability of the system, and ensuring that the system can quickly take measures, such as retrying or switching to standby equipment when the equipment or the network has problems.
In some preferred embodiments, an RS485 communication format is configured, and during RS485 communication, a read-write operation is used to indicate a read-write state when a slave responds to a command, for example, a read normal value is 0, a write normal value is 1, a read abnormal value is 2, and a write abnormal value is 3; the read-write operation is also used for indicating the status of no function code when the slave responds to the command, for example, the no function code is 4; the read-write operation is also used for indicating an error range when the slave responds to the command, for example, the calibrated differential pressure error range is overlarge to 5, the calibrated differential pressure error range is overlarge to 6, the calibrated zero drift error range is overlarge to 7, and the read-write operation is also used for indicating the calibrated current drift error range when the slave responds to the command, and the corresponding value is 8.
In some preferred embodiments, in Byte0-Byte7, byte0 is the frame header, byte1 is the starting Byte of the function code, byte2 is the read/write length, byte3-Byte5 is the reserved field, byte6 is the CRC8 check, and Byte7 is the frame trailer; when the host sends a command, byte0-Byte7 is reserved for a particular type of operation, including a separate read operation or a sequential read and write operation; when the slave responds to the command, byte0-Byte7 is reserved for separate read-write replies.
It should be noted that when the host sends a command and a single data point (e.g., configuration parameter) needs to be read, these bytes do not carry data. When successive data read and write operations need to be performed, function code 0X0E is first sent, indicating that the next operation involves multiple successive data points, which aids in preparing a data buffer or adjusting processing logic to process multiple data items in succession. When the slave responds to the command, byte0-Byte7 is reserved and is used for responding to the read-write command of the host, and the data is not directly contained, in the mode, the slave uses the bytes to confirm the received read-write command, give feedback about the result of the requested operation, and ensure that the necessary information for executing the operation can be obtained.
And S104, after the CAN communication format and the RS485 communication format are configured, the definition data content CAN and the RS485 share the definition data structure body address, and the definition data continuously grows downwards to be compatible.
In this embodiment, the shared definition data structure address means that the data structure (i.e., the organization and format of data) used in the BMS system is the same whether the CAN bus or the RS485 bus is used. The data structure includes organization of information such as function code, operation type, slave address, etc. The shared fabric can ensure that the resolution and processing of data remain consistent regardless of the communication protocol selected. In addition, the definition data is continuously downward-growth compatible, so that the expandability of the data structure can be enhanced. The data structure design allows new data fields to be added under the existing structure without affecting the compatibility of the old system, so that future expansion is supported, and the system can realize the addition of new functions through software update on the premise of not modifying the existing hardware and software. It will be appreciated that definition data continued downward growth compatibility refers to a design methodology that allows new data fields or functions to be added to an existing data structure or system without disrupting or requiring modification of a previous system version. Such a design allows the system to expand over time while maintaining compatibility with older versions. Where down-growth refers to adding new fields or elements at the end of the data structure. For example, if the original data structure defines a fixed set of fields, a new data field may be added to the end of the set of fields, rather than being inserted in the middle or modifying an existing field.
It should be noted that the above embodiments are only preferred embodiments of the present invention, and the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily contemplated by those skilled in the art within the technical scope of the present invention should be covered by the scope of the present invention, which is defined by the claims.

Claims (10)

1. The communication method of the BMS protocol based on two-in-one of the CAN and the RS485 bus is characterized by comprising the following steps of:
the BMS system is configured as a slave, and an upper computer of the BMS system is configured as a master; the host computer and the slave computer are in communication through a CAN bus or an RS485 bus connection, the CAN bus follows a CAN communication protocol, and the RS485 bus follows an RS485 communication protocol;
Configuring a CAN communication format, wherein during CAN communication, the CAN communication protocol transmits a data packet containing a 28-bit expansion frame identifier, when a host sends a command, the ID0-ID7 bits of the expansion frame identifier are used for specifying a specific address of a function code, the ID8-ID12 bits are used for defining the function code, the ID13 bits are used for distinguishing read-write operation types, and the ID14-ID28 bits are used for distinguishing broadcasting messages of the host; the ID0-ID7 bits of the extended frame identifier are used for specifying the specific address of the function code when the slave responds to the command, the ID8-ID12 bits are used for defining the function code, the ID13 bits of the extended frame identifier are used for distinguishing whether the response state is normal or abnormal, and the ID14-ID28 bits are used for distinguishing the slave address message;
The method comprises the steps of configuring an RS485 communication format, transmitting a variable-length data packet by using an RS485 communication protocol when the RS485 communication is performed, wherein the data length of a frame head, a read-write operation, a function code, a starting address, a length identifier, a check code and a frame tail in the variable-length data packet when a host sends a command is 1 byte, the data length of a slave address is 4 bytes, and the data length of actual data content is specified by a data length field; the data length of the frame head, the read-write operation, the function code, the starting address, the length identifier, the check code and the frame tail in the variable-length data packet is 1 byte when the slave responds to the command, the data length of the slave address is 4 bytes, and the data length of the actual data content is specified by a data length field;
After the CAN communication format and the RS485 communication format are configured, the definition data content CAN and the RS485 share the definition data structure body address, and the definition data continuously grow downwards to be compatible; wherein, sharing the address of the defined data structure means that in the BMS system, whether a CAN bus or an RS485 bus is used, the used data structures are the same, and the used data structures refer to the organization and format mode of data; definition data constantly downgrowth compatibility refers to a design methodology that allows new data fields or functions to be added to an existing data structure or system, downgrowth refers to the addition of new fields or elements at the end of a data structure.
2. The communication method of the BMS protocol based on two-in-one of CAN and RS485 bus as claimed in claim 1, wherein the BMS system comprises a main control unit and N microprocessors, the N microprocessors correspondingly monitor different battery packs, and the main control unit and the N microprocessors are in communication connection through the CAN bus.
3. The communication method based on the two-in-one BMS protocol of CAN and RS485 bus according to claim 2, wherein the host and the main control unit are in communication connection through the CAN bus.
4. The communication method of the BMS protocol based on two-in-one of CAN and RS485 bus as claimed in claim 1, wherein the BMS system comprises a main control unit and N microprocessors, the N microprocessors correspondingly monitor different battery packs, and the main control unit and the N microprocessors are in communication connection through the RS485 bus.
5. The communication method of the BMS protocol based on two-in-one of CAN and RS485 bus as claimed in claim 4, wherein the host is in communication connection with the main control unit through the RS485 bus.
6. The communication method based on the two-in-one BMS protocol of CAN and RS485 bus according to any one of claims 1-5, wherein the baud rate of data transmission in the CAN communication protocol is 500KHZ and the baud rate of data transmission in the RS485 communication protocol is 57600HZ.
7. The communication method based on the two-in-one BMS protocol of CAN and RS485 bus according to any one of claims 1-5, wherein the frame type in the CAN communication protocol is a data frame and the frame format is an extended frame.
8. The communication method based on the two-in-one BMS protocol of CAN and RS485 bus according to any one of claims 1 to 5, wherein a small-end mode is adopted for data transmission in the CAN communication protocol, and a small-end mode is adopted for data transmission in the RS485 communication protocol.
9. The communication method based on the two-in-one BMS protocol of CAN and RS485 bus according to any one of claims 1-5, wherein a CAN communication format is configured, and when CAN communication is performed, the CAN communication protocol transmission includes a data field length and a data field, the data field length is 8 bytes when a command is sent by a host, and the data field includes Byte0-Byte7; the slave responds to the command with a data field length of 8 bytes, the data field including Byte0-Byte7.
10. The communication method based on the two-in-one BMS protocol of CAN and RS485 bus according to any of claims 1-5, wherein no response is a timeout exceeding 200 ms when in CAN communication or RS485 communication.
CN202410599077.9A 2024-05-15 2024-05-15 Communication method of BMS protocol based on two-in-one of CAN and RS485 bus Active CN118210751B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410599077.9A CN118210751B (en) 2024-05-15 2024-05-15 Communication method of BMS protocol based on two-in-one of CAN and RS485 bus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410599077.9A CN118210751B (en) 2024-05-15 2024-05-15 Communication method of BMS protocol based on two-in-one of CAN and RS485 bus

Publications (2)

Publication Number Publication Date
CN118210751A CN118210751A (en) 2024-06-18
CN118210751B true CN118210751B (en) 2024-07-23

Family

ID=91446480

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410599077.9A Active CN118210751B (en) 2024-05-15 2024-05-15 Communication method of BMS protocol based on two-in-one of CAN and RS485 bus

Country Status (1)

Country Link
CN (1) CN118210751B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103546354A (en) * 2013-10-22 2014-01-29 天津七一二通信广播有限公司 Communicating method being based on Internet of Things electric temperature measurement equipment and enabling RS485 bus and CAN bus to be compatible
US10757228B1 (en) * 2017-02-28 2020-08-25 Stryker Corporation Patient care devices with on-board network communication

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103546354A (en) * 2013-10-22 2014-01-29 天津七一二通信广播有限公司 Communicating method being based on Internet of Things electric temperature measurement equipment and enabling RS485 bus and CAN bus to be compatible
US10757228B1 (en) * 2017-02-28 2020-08-25 Stryker Corporation Patient care devices with on-board network communication

Also Published As

Publication number Publication date
CN118210751A (en) 2024-06-18

Similar Documents

Publication Publication Date Title
CN110177013B (en) FPGA-based EtherCAT master-slave station design and implementation method
US9432289B2 (en) Method and device for serial data transmission which is adapted to memory sizes
CN106547709B (en) The method and device of flexible configuration multi-channel DMA controller
US20130080585A1 (en) Method for transmitting data via a canopen bus
CN101399700B (en) Apparatus, method and integrated circuit chip having on-line addressing bus type node
US11483240B2 (en) Master-slave bus system and method for operating a bus system
CN110971491B (en) Electric power system 101 and 104 communication protocol processing system and processing method thereof
JP2019534609A (en) Network management information receiving / transmitting method, apparatus, transmitting apparatus, and receiving apparatus
CN112035135A (en) Method, apparatus and storage medium for updating firmware program of slave station apparatus
CN112363479B (en) Digital communication transmission method and system between field devices
CN111510363A (en) Slave station conversion device based on MODBUS protocol and control method thereof
CN118210751B (en) Communication method of BMS protocol based on two-in-one of CAN and RS485 bus
CN212486527U (en) Slave station conversion device based on MODBUS protocol
CN107222379A (en) A kind of method and apparatus of serial communication
CN110768749B (en) Data transmission method and device and power peak shaving system
CN114915515B (en) CAN communication method and system based on SOC
US8554966B2 (en) Method for data exchange
CN115883675A (en) Extensible SPI bus and CAN bus data conversion method
CN114827967A (en) Software updating method, Bluetooth device and storage medium
CN113341853A (en) IP core, FPGA chip, alternating current servo driver and communication method
CN111930582A (en) System management bus detection platform, processor and system management bus detection method
CN112667555B (en) Communication method and device of micro control unit
EP3955484A1 (en) Fec mode synchronization method and system, and primary node and slave node
CN107229571B (en) Control method and system for FMMU in EtherCAT slave station
CN117319512A (en) Network transmission system, method, apparatus, field device, and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant