Search

CN-121985054-A - Data transmission method and system for PTC heater of electric automobile

CN121985054ACN 121985054 ACN121985054 ACN 121985054ACN-121985054-A

Abstract

The invention discloses a data transmission method and a data transmission system of an electric automobile PTC heater, wherein the method comprises the steps of taking a low-voltage side MCU as a host machine and a high-voltage side MCU as a slave machine, constructing an LIN communication network between the host machine and the slave machine, carrying out data transmission by using private LIN messages, respectively constructing communication state machines of the host machine and the slave machine, setting initial communication states of the host machine and the slave machine to be idle states, triggering ETC interruption and entering a data transmission state when the host machine transmits a first private LIN message, transmitting check data after transmitting the check data in a byte-by-byte mode, and resetting the check data to be idle state after transmitting the check data, or triggering RXNE interruption and entering a data receiving state when the host machine receives a second private LIN message in a byte-by-byte mode, entering a check bit receiving state after receiving the preset length, and resetting the check data to be idle state after the check is completed. The technical scheme of the embodiment of the invention can realize stable data transmission and ensure the reliable control of the PTC heater.

Inventors

  • DENG TIANYI
  • LUO YIBO
  • FU ZONGWEI
  • WANG YONG
  • SUN YU
  • WANG WEI

Assignees

  • 孝感华工高理电子有限公司

Dates

Publication Date
20260505
Application Date
20260112

Claims (10)

  1. 1. A data transmission method of an electric vehicle PTC heater, comprising: The method comprises the steps of taking a low-voltage side MCU as a host and a high-voltage side MCU as a slave, constructing an LIN communication network between the host and the slave, and carrying out data transmission by using private LIN messages, wherein the private LIN messages at least comprise a first private LIN message and a second private LIN message which carry out data transmission by preset addresses, frequencies and byte lengths; Respectively constructing communication state machines of a host machine and a slave machine, and setting initial communication states of the host machine and the slave machine as idle states, wherein the communication states of the communication state machines comprise idle states, a data sending state, a data receiving state and a check bit receiving state; Triggering ETC interrupt and entering into a data transmission state when the host transmits the first private LIN message, transmitting check data after byte by byte to a preset length, and resetting to an idle state after transmitting the check data, or triggering RXNE interrupt and entering into a data receiving state when the host receives the second private LIN message, entering into a check bit receiving state after byte by byte is received to the preset length, and resetting to the idle state after checking is completed.
  2. 2. The method of claim 1, wherein the first private LIN message is used for transmitting a PTC enable signal, an IGBT driving frequency, and a duty cycle; The sending end of the second private LIN message is a high-voltage side MCU, the receiving end of the second private LIN message is a low-voltage side MCU, and the second private LIN message is used for receiving the high-voltage of the high-voltage side MCU, bus current, short-circuit fault information and a control mode.
  3. 3. The method of claim 1, wherein the process of the host sending the first private LIN message comprises: The host machine sends frame header data to the slave machine in advance, and judges whether the host machine sends data or receives data based on the frame header data; if the host is judged to be transmitting data, triggering ETC interruption and starting a transmission timeout timer, and simultaneously enabling the host to enter a data transmitting state and transmit byte data; When the length of the transmitted byte data reaches the preset length, the check bit is entered, the first check data is obtained based on the current byte data, the current byte data and the first check data are transmitted to the slave machine, the ETC interrupt and the transmission timeout timer are closed until the data transmission is completed, and the host machine is reset to an idle state.
  4. 4. The method of claim 1, wherein the process of the host receiving the second private LIN message comprises: The host machine sends frame header data to the slave machine in advance, and judges whether the host machine sends data or receives data based on the frame header data; If the host is judged to be receiving data, the host is interrupted by triggering RXNE and starts a receiving timeout timer, and simultaneously the host enters a receiving data state, receives byte data and corresponding first check data, triggers RXNE interruption once when receiving one byte data, and performs timeout detection by the receiving timeout timer; And obtaining second check data based on the current byte data, comparing the first check data with the second check data of the current byte data until all check data are compared, closing RXNE an interrupt and receiving timeout timer and resetting the host to an idle state.
  5. 5. The method of claim 1, wherein the process of computing the verification data comprises: When the first private LIN message Wen Zhuzi is sent to a preset length or the second private LIN message is received to the preset length byte by byte, accumulating the data of each byte; if the accumulated result has no carry, directly carrying out bit inversion on the accumulated result to obtain check data; If the accumulated result has a carry, after the carry of the accumulated result is removed, the accumulated result with the carry removed is subjected to bit-wise inversion to obtain the check data.
  6. 6. The method of claim 1, further comprising detecting whether a first type of communication error and a second type of communication error exist during the transmission of the LIN data between the master and the slave; When the comparison of the check data calculated by the host computer or the slave computer is inconsistent with the received check data, the check data has check errors and is judged to be the first type of communication errors, or when the sending data of the host computer or the slave computer is overtime or the receiving data of the host computer or the slave computer is overtime, the overtime errors exist and are judged to be the first type of communication errors; When the master or the slave has a frame error, a frame overflow error or a synchronization error, the master or the slave is regarded as having a timeout error, and the second type of communication error is determined.
  7. 7. The method of claim 6, further comprising clearing all currently transmitted data when a first type of communication error or a second type of communication error is determined, resetting the state machine to an idle state, closing a timeout timer, interrupting ETC, and setting an error flag corresponding to the bit.
  8. 8. A data transmission system for an electric vehicle PTC heater, wherein the system is configured for implementing the method of any one of claims 1-7, the system comprising: the first construction unit is used for constructing an LIN communication network between the host and the slave by taking the low-voltage side MCU as a host and taking the high-voltage side MCU as a slave, and carrying out data transmission by taking a private LIN message, wherein the private LIN message at least comprises a first private LIN message and a second private LIN message which carry out data transmission by taking a preset address, frequency and byte length; The second construction unit is used for respectively constructing communication state machines of the host machine and the slave machine and setting initial communication states of the host machine and the slave machine to be idle states, wherein the communication states of the communication state machines comprise idle states, a data sending state, a data receiving state and a check bit receiving state; The data transmission unit is used for triggering ETC interruption and entering a data transmission state when the host transmits the first private LIN message, transmitting check data after byte-by-byte transmission to a preset length, and resetting to an idle state after transmitting the check data, or triggering RXNE interruption and entering a data receiving state when the host receives the second private LIN message, entering a check bit receiving state after byte-by-byte reception to the preset length, and resetting to the idle state after checking.
  9. 9. An electronic device, the electronic device comprising: And a memory communicatively coupled to the at least one processor; The memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the steps of the method of any one of claims 1-7.
  10. 10. A computer readable storage medium storing computer instructions for causing a processor to perform the steps of the method of any one of claims 1-7.

Description

Data transmission method and system for PTC heater of electric automobile Technical Field The invention relates to the technical field of automobile electronic control, in particular to a data transmission method and system of an electric automobile PTC heater. Background In the control system of the PTC heater of the electric automobile, in order to realize the isolation control of the heating function and external communication, a dual MCU chip architecture is adopted to divide a high-voltage side module and a low-voltage side module, and stable data interaction is needed between the two modules so as to ensure the reliability of the system. Currently, the high-voltage side module and the low-voltage side module perform data interaction by constructing a LIN communication network. When the high-voltage side module is in a high-voltage heating environment, communication is easily affected by electromagnetic interference, transmission efficiency and data integrity are difficult to balance, time consumption fluctuation of data transmission is large, real-time control requirements of the PTC heater cannot be met, and finally the PTC heater is poor in communication stability and low in data reliability, and heating control accuracy and driving heating experience are affected. Therefore, a data transmission scheme suitable for the dual MCU chip PTC heater and having both anti-interference and fault tolerance is needed. Disclosure of Invention The invention provides a data transmission method and a data transmission system for an electric automobile PTC heater, which are used for solving the problems of communication interference, data loss, message conflict and the like in a high-pressure heating environment. In a first aspect, the present invention provides a data transmission method for a PTC heater of an electric vehicle, including: The method comprises the steps of taking a low-voltage side MCU as a host and a high-voltage side MCU as a slave, constructing an LIN communication network between the host and the slave, and carrying out data transmission by using private LIN messages, wherein the private LIN messages at least comprise a first private LIN message and a second private LIN message which carry out data transmission by preset addresses, frequencies and byte lengths; Respectively constructing communication state machines of a host machine and a slave machine, and setting initial communication states of the host machine and the slave machine as idle states, wherein the communication states of the communication state machines comprise idle states, a data sending state, a data receiving state and a check bit receiving state; Triggering ETC interrupt and entering into a data transmission state when the host transmits the first private LIN message, transmitting check data after byte by byte to a preset length, and resetting to an idle state after transmitting the check data, or triggering RXNE interrupt and entering into a data receiving state when the host receives the second private LIN message, entering into a check bit receiving state after byte by byte is received to the preset length, and resetting to the idle state after checking is completed. Further, the sending end of the first private LIN message is a low-voltage side MCU, and the receiving end of the first private LIN message is a high-voltage side MCU; The sending end of the second private LIN message is a high-voltage side MCU, the receiving end of the second private LIN message is a low-voltage side MCU, and the second private LIN message is used for receiving the high-voltage of the high-voltage side MCU, bus current, short-circuit fault information and a control mode. Further, the process of sending the first private LIN message by the host includes: The host machine sends frame header data to the slave machine in advance, and judges whether the host machine sends data or receives data based on the frame header data; if the host is judged to be transmitting data, triggering ETC interruption and starting a transmission timeout timer, and simultaneously enabling the host to enter a data transmitting state and transmit byte data; When the length of the transmitted byte data reaches the preset length, the check bit is entered, the first check data is obtained based on the current byte data, the current byte data and the first check data are transmitted to the slave machine, the ETC interrupt and the transmission timeout timer are closed until the data transmission is completed, and the host machine is reset to an idle state. Further, the process of receiving the second private LIN message by the host includes: The host machine sends frame header data to the slave machine in advance, and judges whether the host machine sends data or receives data based on the frame header data; If the host is judged to be receiving data, the host is interrupted by triggering RXNE and starts a receiving timeout timer, and simultaneously the host enters a receiv