Vehicle control method and system based on J1939 protocol
By designing a vehicle control algorithm based on J1939 protocol in the vehicle communication system, dynamic adjustment of data priority and communication load balancing are achieved, and communication blockage and control delay problems in existing systems when data traffic increases and real-time requirements are increased, significantly Improves the stability and reliability of the vehicle control system.
Patent Information
- Application Number
- CN202510020603.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-07
- Publication Date
- 2025-02-14
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the face of increasing data traffic, increasing real-time requirements and complex control logic, existing vehicle communication systems based on J1939 protocol are difficult to achieve dynamic data priority adjustment and communication load balancing, resulting in communication blockage or control delay, affecting Vehicle operation efficiency and safety.
A vehicle control algorithm based on J1939 protocol is designed. By defining vehicle control messages, setting PGN, source address, target address and priority, the priority sorting and message routing of vehicle functional modules are realized. The hybrid structure of FIFO and independent mailboxes is adopted, combined with a high-speed communication link of 500Kbps, ensuring real-time processing of high-priority messages and delay processing of low-priority messages.
By optimizing data transmission efficiency and real-time performance, the stability and reliability of the vehicle control system are significantly improved, communication blockage and control delay are avoided, and the overall performance of heavy truck vehicles is improved.
Smart Images

Figure CN119449522A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of J1939 heavy truck communication control, and in particular to a vehicle control method and system based on the J1939 protocol. Background Art
[0002] With the rapid development of automotive electronic technology, the level of vehicle intelligence and automation continues to improve, especially in the field of heavy trucks, the demand for multi-module coordinated control of vehicles is increasing. In order to achieve efficient communication and precise control between multiple key components such as engines, gearboxes, braking systems, and steering systems, vehicle network technology has emerged. As a serial communication protocol based on the CAN (Controller Area Network) 2.0B technical specification, the SAE J1939 protocol has become the mainstream communication standard in the field of commercial vehicles and heavy machinery.
[0003] The J1939 protocol is a network protocol that supports a multi-master-slave architecture, allowing multiple electronic control units (ECUs) to achieve high-speed communication through a single bus. Its standard communication rate is 250 Kbps, and it can reach 500 Kbps in the J1939-14 extended version. The protocol uses parameter group numbers (PGNs) and priority bits to manage communication frames, allowing different modules to transmit data in an orderly manner in the same network. At the same time, J1939 supports closed-loop control and can transmit key operating data in real time, providing strong technical support for engine control, vehicle status monitoring, fault diagnosis, etc. However, with the continuous increase in vehicle functions, the existing J1939-based communication system faces challenges such as increased data traffic, increased real-time requirements, and complex control logic.
[0004] In practical applications, traditional J1939 communication design mainly focuses on the management of sending and receiving data frames, lacking optimization means for dynamic adjustment of data priority and communication load balancing. In addition, the integration of vehicle control algorithms and communication protocols in existing systems is not high, making it difficult to fully utilize the advantages of multi-priority scheduling and modular design of the protocol. This limitation can easily lead to communication congestion or control delays under complex working conditions, thus affecting the operating efficiency and safety of the vehicle. Summary of the invention
[0005] Purpose of the invention: The purpose of the present invention is to address the deficiencies in the prior art and provide a vehicle control algorithm and system based on the J1939 protocol, which can not only give full play to the advantages of the J1939 protocol in multi-module communication, but also solve the problems of insufficient real-time and stability of traditional control systems, thereby improving the comprehensive performance of heavy-duty trucks.
[0006] Technical solution: The vehicle control algorithm based on the J1939 protocol described in the present invention includes the following steps: S1: Define vehicle control messages based on the J1939 protocol and set J1939 attributes including PGN, source address, destination address, and priority; S2: classifying vehicle control according to vehicle function modules, and setting the order of execution of vehicle control actions in the vehicle control modules based on the priority of vehicle functions; S3: Receive or send vehicle control messages through the CAN communication module, report the messages to the application layer with the help of the CANIF component, and update the vehicle control signal data value corresponding to the PGN at the application layer; S4: Process the vehicle control message within a specified period, enter the data value difference detection process of the corresponding vehicle control signal according to the PGN, and detect whether there is a difference in the vehicle control signal data value (such as the air conditioning switch signal data value, the driving mode type data value, etc.). If there is, execute S5; if not, maintain the state and do not execute the vehicle control action; S5: When there is a difference in the vehicle control signal data value in S4, enter the vehicle control module according to the received vehicle control message, send a request confirmation message, wait for the confirmation response message to be received, transfer the state and execute the vehicle control action.
[0007] To further improve the above technical solution, the vehicle control is classified according to the following vehicle functional modules, including: tire pressure detection module, air conditioning module, OTA upgrade module, bed side module, driving mode module and heating plan module; each vehicle functional module has an independent J1939 source address, and the target address of each vehicle functional module points to All or the source address of the vehicle control module. When the target address points to ALL, it means that the sent vehicle control message can be received by all vehicle functional modules, and other vehicle functional modules need to be coordinated during the vehicle control process; when the target address points to the source address of the vehicle control module, it means that the sent vehicle control message is only received by the vehicle control module.
[0008] Furthermore, the CAN communication module performs functional settings by configuring the baud rate, filter and receiving mailbox of the CAN peripheral; the baud rate configuration includes: calculating the CAN clock according to the PLL configuration of the MCU and the clock division factor of the CAN peripheral; setting the pre-divider value to generate the bit time unit; configuring the length of the time periods TSEG1 and TSEG2 so that the sampling point is between 75%-87.5% of the bit time; setting the synchronization jump width to one or two time quanta.
[0009] Furthermore, the receiving mailbox is configured as a combination mode of FIFO and a single mailbox; wherein the FIFO is used to receive high-frequency or continuous data; and the single mailbox is used to send high-priority data.
[0010] Furthermore, the workflow of the CANIF component includes: in the receiving path, receiving messages from the CAN driver layer, parsing the message PDU ID, performing route matching according to the PDU information table, storing the matched messages in the receiving buffer or directly passing them to the application layer; in the sending path, receiving application layer messages, determining the target channel and message format according to the PDU ID, mapping the messages to the corresponding CAN channel and sending mailbox, and completing the sending request.
[0011] Furthermore, when the vehicle control message supports the point-to-point CMDT mode and the broadcast BAM mode when being received or sent, and when it exceeds 8 bytes, the following processing is performed: at the sending end, the vehicle control message is split into multiple data segments, which are sent segment by segment through TP.CM and TP.DT messages, and the timeout and retransmission mechanism is managed; at the receiving end, the data segment TP.DT is received and reassembled according to TP.CM, and the complete data is provided to the application layer after parsing is completed.
[0012] A control system for implementing the vehicle control method based on the J1939 protocol, comprising: an embedded control unit configured to support a CAN transceiver controller, a message processing module, a J1939TP big data processing module and a timer module, wherein the embedded control unit stores a predefined J1939 attribute table including a PGN, a source address, a target address and a priority configuration; CAN transceiver controller, based on TJA1042 chip design, supports 500 Kbps communication rate, uses FIFO and independent mailbox structure for message processing, and is responsible for receiving, parsing and transmitting J1939 protocol messages; J1939TP big data processing module, used to process J1939 protocol messages with a data length exceeding 8 bytes during reception and transmission, and to reassemble and verify the received data segments through the segment assembly mechanism; a message processing module configured to parse the J1939 protocol message, update the vehicle control signal content based on the PGN and priority in the message, and transmit the updated signal to the vehicle control algorithm module, the vehicle control algorithm module classifies and manages the message according to the vehicle function module category, sets the vehicle control action according to the priority of the vehicle function, and triggers the vehicle control action for the message that detects a difference in the vehicle control signal; The timer module is configured to provide time management and task scheduling, support multi-channel timing, and flexibly configure the time base.
[0013] Furthermore, the message processing module classifies messages according to the priorities of PGN messages, realizes real-time processing of high-priority messages and delayed processing of low-priority messages; performs message routing and control signal updates through a predefined PGN information table; and performs periodic message scanning and status monitoring.
[0014] Furthermore, after starting the CAN transceiver controller, the transmitted J1939 protocol messages are sent and received through the CANIF component; when receiving, the CANIF component routes the message to the application layer according to the PDU information table; the user layer updates the corresponding control signal content according to the predefined PGN information table; when sending, the user layer selects the specified PDU and calls the driver layer interface through the CANIF component to send the message; the processing order is determined according to the message priority to ensure the real-time performance of high-priority messages.
[0015] Furthermore, the vehicle control algorithm module processes the received J1939 protocol messages at an interval of 10ms based on the periodic polling and state machine transfer mechanism, and runs the state machine at an interval of 10ms to process the received vehicle control signals. It determines whether the vehicle state transfer needs to be executed according to the PGN and priority of the vehicle control signal, and completes the state switching and executes specific vehicle control actions when the conditions are met.
[0016] The embedded control unit contains the following hardware resources: internal memory, CAN controller, IO controller, DMA controller, timer. The embedded control unit stores the vehicle control method and the predefined J1939 attribute table, which contains the PGN, source address, target address and priority configuration to ensure that each module can communicate efficiently through a unique source address and target address.
[0017] The CAN communication module is designed based on the TJA1042 chip, supports a communication rate of 500 Kbps, and uses FIFO and independent mailbox structures to achieve efficient message processing. The module is responsible for receiving, parsing and transmitting J1939 protocol messages, ensuring real-time communication and data synchronization between multiple modules, and providing reliable communication support for vehicle control and monitoring. The FIFO queue and independent mailbox structure are used to ensure the real-time performance of high-priority messages, while processing low-priority messages when the bus is idle.
[0018] The message processing module is responsible for parsing the J1939 messages received through the CAN bus. According to the PGN and priority defined in the message, the vehicle control signal content is updated accordingly, and the updated signal is passed to the control algorithm module. The message processing module classifies and manages messages by module category (such as tire pressure detection module, air conditioning module, OTA upgrade module, etc.), and sets and executes vehicle control methods according to the priority response process set by the vehicle function. The module can realize periodic polling and real-time scanning of messages, detect control differences and trigger subsequent actions.
[0019] The J1939TP big data processing module is used to efficiently process long message data transmitted in segments, and adapt to the complex and diverse transmission requirements of vehicle control and operation information. The module supports receiving and sending multi-frame messages exceeding the 8-byte data length of a CAN single frame through the protocol's BAM (Broadcast Announce Message) and CMDT (Connection Mode Data Transfer). Through the segmented assembly mechanism, the module can reassemble the complete message data according to the frame sequence number and verify the data to ensure the integrity and accuracy of the transmission.
[0020] The timer module is built into the embedded control unit, providing precise time management and task scheduling functions. The module supports multi-channel timing and can flexibly configure the time base for periodic scanning of J1939 messages, triggering of control tasks, and conditional judgment of the state machine. By working in conjunction with the CAN communication module and the big data processing module, the timer module ensures the real-time performance of the system and the synchronization of data processing, effectively improving the operating efficiency and stability of the vehicle control system.
[0021] The vehicle control algorithm processes the received control signals based on periodic polling and state machine transfer mechanisms. According to the PGN and priority of the control signal, it is determined whether the vehicle state transfer needs to be executed. When the conditions are met, the state switching is completed and specific vehicle control actions are performed, such as adjusting tire pressure, setting air conditioning temperature, or activating driving mode. The vehicle control algorithm adapts to different functional modules, including tire pressure detection module, air conditioning module, OTA upgrade module, bedside module, driving mode module and heating plan module, providing flexible control solutions.
[0022] Configure the registers of the DMA controller or set the functions to form a DMA channel to achieve high-speed data transmission between the CAN control module and the internal memory. The internal memory stores the J1939 attribute table, control signal parameters and vehicle control logic to provide support for real-time calculation and data update.
[0023] Each control module is assigned an independent J1939 source address, and the target address points to "ALL" or the source address of other modules to achieve point-to-point or broadcast communication. The control signals of each module are scanned within a specified period, differences are detected and adjusted to ensure that the vehicle control action is consistent with the preset logic.
[0024] Beneficial effects: Compared with the prior art, the beneficial effects of the present invention include: by adopting a hybrid structure of FIFO and independent mailboxes, combined with a 500Kbps high-speed communication link, the data transmission efficiency is significantly improved; based on the PDU message routing mechanism and priority processing strategy, real-time response of key control instructions is ensured while avoiding resource contention; support for data transmission of more than 8 bytes, and the use of segmentation management and reorganization mechanism to ensure the integrity and reliability of large data transmission.
[0025] By reasonably configuring the baud rate and sampling point, the reliability and anti-interference ability of data transmission are improved. The sampling point is between 75%-87.5% of the bit time, which can adapt to the signal delay caused by buses of different lengths. The flexible synchronization jump width setting improves the clock synchronization ability between network nodes. The baud rate reaches 500Kbps, which significantly improves the data transmission efficiency and ensures the stability and reliability of system operation.
[0026] The PGN-based message classification and priority processing mechanism improves the execution efficiency of control instructions; the perfect state transfer and response mechanism ensures the reliability and accuracy of the control process; the multi-module collaborative working mechanism improves the coordination and real-time performance of the entire vehicle control.
[0027] The present invention combines multiple aspects such as hardware configuration, message processing mechanism, big data processing mechanism and program design, and provides an efficient and stable solution for generating vehicle control, which is suitable for commercial vehicle control scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 It is a flow chart of the vehicle control method based on the J1939 protocol provided by the present invention. DETAILED DESCRIPTION
[0029] The technical solution of the present invention is described in detail below with reference to the accompanying drawings, but the protection scope of the present invention is not limited to the embodiments.
[0030] Embodiment 1: The vehicle control system based on the J1939 protocol provided by the present invention includes the following parts.
[0031] 1. Hardware preparation: Make sure the embedded control unit (MCU) supports the CAN transceiver controller (TJA1042), has IO resources to control the CAN transceiver controller, RAM space for static resources to store J1939 information, and timer resources. Connect the MCU's CAN control interface to the TJA1042.
[0032] 2. Configure the CAN transceiver controller: When configuring the CAN transceiver controller, the MCU register or configuration function is used to initialize and set parameters of the CAN transceiver controller, including baud rate, filter, mailbox mode, etc. In order to adapt to different data transceiver requirements, a mixed use mode of FIFO and single mailbox is adopted, in which FIFO is mainly used to receive high-frequency or continuous data, which can improve the efficiency and reliability of reception, while a single mailbox is used to send critical or high-priority data to ensure the accuracy and timeliness of data transmission.
[0033] Clock: In the MCU's control of the transceiver controller, enable the CAN transceiver controller, and calculate the appropriate CAN transceiver controller clock as the operating frequency of the CAN transceiver controller based on the MCU's PLL configuration and the CAN transceiver controller's clock division factor.
[0034] Baud rate: Baud rate configuration is a crucial part of CAN communication, which determines the speed and stability of data transmission. When configuring the baud rate, it is necessary to select a suitable rate according to the system requirements and the actual operating conditions of the bus. This is usually achieved by setting the clock source, time segmentation parameters and synchronization jump width (SJW) of the CAN transceiver controller. First, determine the clock frequency used by the CAN transceiver controller, calculate and set the prescaler value according to the target baud rate to generate a suitable bit time unit. Next, by configuring the length of time segment 1 (TSEG1) and time segment 2 (TSEG2), optimize the position of the sampling point to be close to 75%-87.5% of the bit time, thereby improving anti-interference ability and data accuracy. The synchronization jump width is used to adjust the clock synchronization range and is usually set to one or two time quanta (TQ) to ensure synchronization between nodes. The choice of baud rate not only needs to match the communication requirements of the system, but also needs to consider the bus load, cable length, and the capabilities of other nodes to avoid communication errors or packet loss caused by too high baud rates.
[0035] Filter: Filter configuration is an important step in CAN communication for filtering data frames. By matching the identifiers of data frames, accurate reception of target data can be achieved. The settings of the filter mainly include the selection of identifier mode, mask configuration and filter mode. The J1939 identifier mode is set to extended frame (29 bits). The mask configuration is used to define which bits need to be involved in the match. Through flexible mask settings, filtering of a specific identifier range or acceptance of all frames can be achieved. Reasonable filter configuration can effectively reduce the interference of irrelevant data, reduce bus load, optimize communication performance, and ensure that the system only receives the required key information.
[0036] Mailbox configuration: Mailboxes are divided into sending and receiving. The receiving mailbox configuration structure is in the form of FIFO and single mailbox. The FIFO mailbox processes messages in a large range to solve the mailbox resource shortage problem caused by too many received messages. A single mailbox is used to process the data corresponding to large data messages to ensure their data continuity. The number of FIFO messages should be within a reasonable range to avoid the risk of frame loss. The FIFO interface can accommodate a larger range of messages, and a single mailbox can respond quickly to bus data.
[0037] In the process of receiving CAN messages, the above reasonable configuration can correctly and stably transmit and receive messages. When the bus message meets the filter configuration, the message can be received in the mailbox. According to the configuration of the mailbox, the upper layer updates the mailbox data to the storage in time through interruption.
[0038] 3. CAN communication abstraction layer: The communication abstraction layer is an important part of realizing modularization and hardware independence in embedded systems. It mainly shields the complexity of the underlying hardware through a unified interface and provides consistent communication services for upper-layer applications. This layer is mainly responsible for message routing, buffer management and status monitoring, and supports flexible configuration of multiple channels and multiple protocols. In the sending path, the communication abstraction layer completes the channel and target mapping according to the message ID passed in by the upper layer, and sends it to the specific hardware. In the receiving path, it receives messages from the bottom layer and routes them to the corresponding upper-layer modules according to the configured rules. The communication abstraction layer in this method uses the CNAIF module. CANIF receives messages from the CAN driver in the receiving path, matches the routing with the upper layer according to the configured PDU ID, and passes the qualified messages to the upper-layer module. In the sending path, CANIF receives messages from the upper layer, parses the PDU ID, maps the messages to the corresponding CAN channels and mailboxes, and completes the sending request.
[0039] CNAIF: The CANIF module is the core part of the CAN communication abstraction layer, responsible for managing the sending and receiving of messages, routing and status query. It provides a unified interface to shield hardware differences, supports dynamic PDU configuration, multi-channel management, error handling and efficient interaction with upper-layer modules, and improves the flexibility and portability of the system.
[0040] PDU: PDU (Protocol Data Unit) is the basic data unit in CAN communication, which contains message identifier, data content and related control information. PDU is used to implement message routing and mapping in CANIF module. Through static or dynamic configuration, it supports multi-channel and multi-protocol communication requirements and ensures accurate data transmission and management.
[0041] Receiving path: In the receiving path, the CANIF module receives messages from the CAN driver layer and parses its message ID, matching the target upper layer module through the configured PDU routing rules. Messages that meet the conditions are stored in the receiving buffer or directly passed to the upper layer, while supporting status feedback and error handling to ensure the reliability of data transmission.
[0042] Sending path: The CANIF module receives the message from the upper layer, parses its target channel and message format according to the configured PDU ID, and maps it to the corresponding CAN channel and sending mailbox. Subsequently, the data is passed to the CAN driver layer to complete the sending, and the transmission status feedback is provided to ensure the reliable sending of the message.
[0043] As the core of the CAN communication abstraction layer, the CANIF module is responsible for the efficient management and routing of messages in the sending and receiving paths. In the receiving path, CANIF routes qualified messages to the upper-layer module through PDU rules and provides status feedback and error handling. In the sending path, it parses the PDU ID passed in by the upper layer, maps the message to the specified channel and mailbox, and completes the transmission. CANIF shields the underlying hardware differences through a unified interface, supports dynamic configuration, multi-channel management, and flexible expansion, and improves the portability and communication efficiency of the system.
[0044] 4. Big data processing module: The big data processing module uses the transport layer protocol (J1939TP) in the J1939 protocol for efficient data transmission and management. J1939TP is designed for long data frames. It realizes data transmission of more than 8 bytes through segmentation. It supports point-to-point (CMDT) and broadcast (BAM) modes. The CMDT mode has high data reliability and is suitable for scenarios that require point-to-point communication. Data transmission is safer; the BAM mode has high transmission efficiency. A broadcast can be received by multiple nodes at a time. It is suitable when the bus load is low and the bus resources are sufficient. At the sending end, the big data is split into multiple data segments, which are sent segment by segment through TP.CM and TP.DT messages, and the timeout and retransmission mechanism is managed to ensure reliable data transmission. At the receiving end, the module receives and reorganizes the data segments according to the control message (TP.CM), and provides the complete data to the upper-layer application after parsing.
[0045] TP.CM (Transport Protocol Connection Management) is a control message in the J1939TP protocol, which is used to manage the establishment, removal and flow control of connections. Each TP.CM message carries information used to control data transmission, including sequence numbers and grouping information of data segments.
[0046] TP.DT (Transport Protocol Data Transfer) is a data transmission segment in the J1939TP protocol, which is used to transmit segmented data. Each TP.DT message contains a portion of data and is accompanied by a sequence number to ensure the correct order of reception. Each data segment must strictly manage timeout and retransmission to ensure data integrity. The receiver reassembles the complete data through these data segments to ensure reliable transmission of large amounts of data.
[0047] CMDT (Connection Mode Data Transfer) is a data transmission mode in the J1939TP protocol, which is used to reliably transmit data larger than 8 bytes in point-to-point communication. With the CMDT mode, the sender splits the large data into multiple data segments (TP.DT messages) and sends them one by one in sequence. Each data segment contains data content and a sequence number, and the receiver reassembles the message based on these data segments. During this process, the sender manages data transmission through control messages (TP.CM), including starting, continuing or stopping data transmission, and handles timeouts and retransmissions to ensure data integrity and reliable transmission. The CMDT mode is often used in application scenarios that require high reliability and high data capacity.
[0048] BAM (Broadcast Announce Message) is a broadcast data transmission mode in the J1939TP protocol, which is used to broadcast data to multiple receivers. Unlike the CMDT mode, BAM does not require point-to-point confirmation. Each data segment is broadcast to all nodes through the TP.DT message, which is suitable for broadcast large data transmission without confirmation reception.
[0049] 5. Message data processing flow: Configure the baud rate, mailbox and other general configurations of the CAN driver layer. After starting the CAN controller, the communication abstraction layer is responsible for sending and receiving bus messages. When receiving, the CANIF module converts it into PDU information for the user. The user compares the stored J1939 information list, and after the index matches, updates the signal value of the corresponding PGN. When sending, the user selects the specified PDU in the J1939 information list to send, and CANIF calls the driver layer interface to send message communication.
[0050] 6. Program design and integration: Write corresponding program codes to implement module classification control and realize vehicle control according to the messages received or sent.
[0051] Example 2: Figure 1 The vehicle control method shown comprises the following steps: S1: Define vehicle control messages based on the J1939 protocol and set J1939 attributes including PGN, source address, destination address, and priority; S2: classifying vehicle control according to vehicle function modules, and setting the order of execution of vehicle control actions in the vehicle control modules based on the priority of vehicle functions; S3: Receive or send vehicle control messages through the CAN communication module, report the messages to the application layer with the help of the CANIF component, and update the vehicle control signal data value corresponding to the PGN at the application layer; S4: Process the vehicle control message within a specified period, enter the data value difference detection process of the corresponding vehicle control signal according to the PGN, detect whether there is a vehicle control signal data value difference, if yes, execute S5; if no, maintain the state and do not execute the vehicle control action; S5: When there is a difference in the vehicle control signal data value in S4, enter the vehicle control module according to the received vehicle control message, send a request confirmation message, wait for the confirmation response message to be received, transfer the state and execute the vehicle control action.
[0052] As described above, although the present invention has been shown and described with reference to specific preferred embodiments, it should not be construed as limiting the present invention itself. Various changes in form and details may be made without departing from the spirit and scope of the present invention as defined in the appended claims.
Claims
1. A vehicle control method based on the J1939 protocol, characterized in that: The steps include: S1: Define vehicle control messages based on the J1939 protocol and set J1939 attributes including PGN, source address, destination address, and priority; S2: classifying vehicle control according to vehicle function modules, and setting the order of execution of vehicle control actions in the vehicle control modules based on the priority of vehicle functions; S3: Receive or send vehicle control messages through the CAN communication module, report the messages to the application layer with the help of the CANIF component, and update the vehicle control signal data value corresponding to the PGN at the application layer; S4: Process the vehicle control message within a specified period, enter the data value difference detection process of the corresponding vehicle control signal according to the PGN, detect whether there is a vehicle control signal data value difference, if yes, execute S5; if no, maintain the state and do not execute the vehicle control action; S5: When there is a difference in the vehicle control signal data value in S4, enter the vehicle control module according to the received vehicle control message, send a request confirmation message, wait for the confirmation response message to be received, transfer the state and execute the vehicle control action.
2. The vehicle control method based on the J1939 protocol according to claim 1, characterized in that: The vehicle control is classified according to the following vehicle functional modules, including: tire pressure detection module, air conditioning module, OTA upgrade module, bed side module, driving mode module and heating plan module; each vehicle functional module has an independent J1939 source address, and the target address of each vehicle functional module points to All or the source address of the vehicle control module. When the target address points to ALL, it means that the sent vehicle control message can be received by all vehicle functional modules. When the target address points to the source address of the vehicle control module, it means that the sent vehicle control message is only received by the vehicle control module.
3. The vehicle control method based on the J1939 protocol according to claim 1, characterized in that: The CAN communication module performs function settings by configuring the baud rate, filter and receiving mailbox of the CAN peripheral; the baud rate configuration includes: calculating the CAN clock according to the PLL configuration of the MCU and the clock division factor of the CAN peripheral; setting the pre-divider value to generate the bit time unit; configuring the length of the time period TSEG1 and TSEG2 so that the sampling point is between 75% and 87.5% of the bit time; setting the synchronization jump width to one or two time quanta.
4. The vehicle control method based on the J1939 protocol according to claim 2, characterized in that: The receiving mailbox is configured as a combination mode of FIFO and a single mailbox; wherein the FIFO is used to receive high-frequency or continuous data; and the single mailbox is used to send high-priority data.
5. The vehicle control method based on the J1939 protocol according to claim 4 is characterized in that: The workflow of the CANIF component includes: in the receiving path, receiving messages from the CAN driver layer, parsing the message PDU ID, performing route matching according to the PDU information table, storing the matched messages in the receiving buffer or directly passing them to the application layer; in the sending path, receiving application layer messages, determining the target channel and message format according to the PDU ID, mapping the messages to the corresponding CAN channel and sending mailbox, and completing the sending request.
6. The vehicle control method based on the J1939 protocol according to claim 1 or 5, characterized in that: When the vehicle control message supports the point-to-point CMDT mode and the broadcast BAM mode when receiving or sending, and exceeds 8 bytes, the following processing is performed: At the sending end, the vehicle control message is split into multiple data segments, which are sent segment by segment through TP.CM and TP.DT messages, and the timeout and retransmission mechanism is managed; At the receiving end, the data segment TP.DT is received and reassembled according to TP.CM, and the complete data is provided to the application layer after parsing.
7. A vehicle control system for implementing the vehicle control method based on the J1939 protocol as claimed in claim 1, characterized in that: include: an embedded control unit configured to support a CAN transceiver controller, a message processing module, a J1939TP big data processing module, and a timer module, the embedded control unit storing a predefined J1939 attribute table including a PGN, a source address, a destination address, and a priority configuration; CAN transceiver controller, based on TJA1042 chip design, supports 500 Kbps communication rate, uses FIFO and independent mailbox structure for message processing, and is responsible for receiving, parsing and transmitting J1939 protocol messages; J1939TP big data processing module, used to process J1939 protocol messages with a data length exceeding 8 bytes during reception and transmission, and to reassemble and verify the received data segments through the segment assembly mechanism; a message processing module configured to parse the J1939 protocol message, update the vehicle control signal content based on the PGN and priority in the message, and transmit the updated signal to the vehicle control algorithm module, the vehicle control algorithm module classifies and manages the message according to the vehicle function module category, sets the vehicle control action according to the priority of the vehicle function, and triggers the vehicle control action for the message that detects a difference in the vehicle control signal; The timer module is configured to provide time management and task scheduling, support multi-channel timing, and flexibly configure the time base.
8. The vehicle control system according to claim 7, characterized in that: The message processing module classifies messages according to the priorities of PGN messages, realizes real-time processing of high-priority messages and delayed processing of low-priority messages; performs message routing and control signal update through a predefined PGN information table; and performs periodic message scanning and status monitoring.
9. The vehicle control system according to claim 7, characterized in that: After starting the CAN transceiver controller, the transmitted J1939 protocol messages are sent and received through the CANIF component; when receiving, the CANIF component routes the message to the application layer according to the PDU information table; the user layer updates the corresponding control signal content according to the predefined PGN information table; When sending, the user layer selects the specified PDU and calls the driver layer interface through the CANIF component to send the message; the processing order is determined according to the message priority to ensure the real-time performance of high-priority messages.
10. The vehicle control system according to claim 7, characterized in that: The vehicle control algorithm module is based on periodic polling and state machine transfer mechanism, processes the received J1939 protocol message at an interval of 10ms, runs the state machine at an interval of 10ms, processes the received vehicle control signal, and determines whether the vehicle state transfer needs to be executed according to the PGN and priority of the vehicle control signal. When the conditions are met, the state switching is completed and the specific vehicle control action is executed.
Citation Information
Patent Citations
Method for forwarding two-way controller area network (CAN) bus data in central information integrated system
CN101870278A
CAN (Controller Area Network) bus-based vehicle remote control method
CN102975668A
Method for remotely controlling vehicle
CN103770742A
Electric whole passenger vehicle control system based on programmable logic controller technology
CN104442445A
High-pressure system integrated control method and device and pure electric automobile
CN106515456A