CAN bus transmission method based on multiple priorities

By monitoring the bus load rate in real time and dynamically adjusting the priority, the transmission delay and reliability issues in CAN bus transmission were resolved, achieving low-latency and high-reliability transmission of critical messages while ensuring system stability and security.

CN121940238APending Publication Date: 2026-04-28FORYOU GENERAL ELECTRONICS
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
FORYOU GENERAL ELECTRONICS
Filing Date
2026-01-23
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Existing CAN bus transmission methods struggle to effectively manage transmission latency and reliability in complex vehicle networks. In particular, messages with high real-time requirements may experience unacceptable delays due to arbitration failures. Furthermore, existing solutions increase hardware complexity or consume main processor resources.

Method used

By monitoring the bus load rate in real time and dynamically adjusting message priorities, a temporary high-priority sending mode is entered. The idle highest-priority mailbox resources are used to temporarily increase the priority of critical messages. Combined with static resource management and dynamic priority optimization, critical messages are ensured to be sent first when the bus is congested.

Benefits of technology

It achieves low-latency and high-reliability transmission of critical messages in complex vehicle networks, while taking into account the overall stability and security level of the system and avoiding hardware complexity and resource consumption issues.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121940238A_ABST
    Figure CN121940238A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of CAN bus communication, and provides a CAN bus transmission method based on multiple priorities, which performs dynamic priority setting, optimizes the bus bandwidth utilization rate in real time, improves the communication efficiency and ensures the transmission timeliness of key data based on the real-time bus load rate. According to the method, the temporary priority adjustment is carried out on the target message only by entering the temporary high-priority sending mode, and through temporary optimization improvement, it can be ensured that the key message preempts the bandwidth when the bus is congested, hardware resources are fully utilized, low time delay and high reliability of the key message are ensured, and meanwhile it is ensured that dynamic improvement does not endanger the highest-security-level message.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of CAN bus communication technology, specifically relating to a multi-priority CAN bus transmission method. Background Technology

[0002] Controller Area Networks (CAN) are a multi-master, broadcast serial communication bus standard widely used in automotive and industrial control fields. They employ a non-destructive arbitration mechanism based on message identifiers to resolve bus access conflicts. Generally, smaller identifier values ​​indicate higher priority. While the standard CAN protocol defines priorities, these priorities are determined solely by static arbitration IDs, lacking a comprehensive consideration of message criticality, real-time requirements, and real-time network status. However, in the complex in-vehicle networks of electric vehicles, which include Advanced Driver Assistance Systems (ADAS) and Battery Management Systems (BMS), the latency and reliability requirements for different messages vary significantly.

[0003] As the number and functionality of onboard electronic control units increase, the traditional CAN bus is gradually facing bottlenecks in bandwidth and scheduling flexibility. CAN FD, as its evolution, improves data transmission rates (up to 5Mbps or even higher) and payloads (up to 64 bytes), but still uses the original arbitration mechanism. Therefore, when network load surges, low-priority but high-real-time messages may experience unacceptable delays due to arbitration failures.

[0004] Therefore, existing technologies, such as Chinese Patent Publication No. CN117914645A, propose a method for controlling bus access through an external arbitrator. This technology achieves priority control to a certain extent, but increases hardware complexity and cost, and may introduce single points of failure.

[0005] Alternatively, simple transmission delays or scheduling can be implemented by relying on upper-layer application software, but this would consume main processor resources and be difficult to control precisely. Summary of the Invention

[0006] The purpose of this invention is to disclose a multi-priority CAN bus transmission method that solves the technical problems of existing CAN bus transmission management for transmission delay issues, whether relying on external arbitrators or upper-layer software scheduling, such as increased hardware costs, introduction of single points of failure or occupation of main processor resources, and insufficient control precision.

[0007] To achieve the above objectives, this invention discloses a multi-priority CAN bus transmission method, comprising the following steps: Perform initialization configuration, pre-configuring multi-level priority message groups and their corresponding sending mailboxes; Acquire and identify messages to be sent, classify the messages, and assign them to the corresponding sending mailboxes; The system monitors the current bus load rate in real time and executes a dynamic priority strategy based on the bus load rate, entering a temporary high-priority transmission mode to temporarily adjust the priority of the target message. All messages to be sent in the sending mailbox are sorted in the first level, and message sending scheduling is performed based on standard arbitration rules.

[0008] This basic solution uses real-time bus load rate to dynamically set priorities, optimize bus bandwidth utilization in real time, improve communication efficiency, and ensure the timely transmission of critical data. By simply entering a temporary high-priority sending mode, the priority of target messages is temporarily adjusted. Through temporary priority upgrades, critical messages can be ensured to preempt bandwidth when the bus is congested, making full use of hardware resources and ensuring low latency and high reliability. At the same time, it ensures that dynamic upgrades do not jeopardize messages with the highest security level.

[0009] As an optional implementation, a dynamic priority strategy is executed based on the bus load rate, entering a temporary high-priority transmission mode to temporarily adjust the priority of the target message, specifically as follows: Determine whether the bus load rate is less than a preset threshold. If so, execute normal transmission scheduling; otherwise, enter a temporary high-priority transmission mode. Identify the messages to be sent in the next highest priority message group as target messages and perform temporary priority adjustment on the target messages. The adjusted priority of the target messages is higher than their inherent priority and lower than the arbitration priority of all messages to be sent in the highest priority message group.

[0010] This solution involves a temporary priority adjustment, making the target message's adjusted priority higher than its inherent priority but lower than the arbitration priority of all pending messages in the highest priority message group. In this way, while ensuring that the highest priority message is not affected, the right to send the second-highest priority target critical message is temporarily transferred to the high-priority sending resource, enabling it to be sent first in the event of a bus conflict. This effectively balances the real-time requirements of urgent messages with the overall arbitration fairness of the system.

[0011] As an optional implementation, the target message is temporarily prioritized, including: Calculate the arbitration ID of the target message based on the ID range of the dynamic priority enhancement zone; The arbitration ID is temporarily mapped to the dynamic priority enhancement zone, which is the ID range between the highest priority and the second highest priority static segment.

[0012] As an optional implementation, the arbitration ID of the target message is calculated using the following formula: Quorum ID=Pt_Base+Node_ID In the formula, Pt_Base represents the starting CAN ID of the dynamic priority boosting zone, and Node_ID represents the unique logical node number.

[0013] This solution calculates the arbitration ID based on the starting CAN ID of the dynamic priority enhancement zone and the unique node logical number. Through a conflict-free and deterministic temporary ID allocation algorithm, it achieves regular temporary ID allocation, ensuring that the dynamic adjustment of priorities among multiple nodes is orderly and conflict-free, and realizing precise management of arbitration resources and real-time optimization of bus load.

[0014] As an optional implementation, the target message is temporarily prioritized, specifically as follows: Traverse the target messages and directly place the messages to be sent in the second highest priority message group into the target sending mailbox, which is the currently idle highest priority sending mailbox reserved for the highest priority message group.

[0015] This solution directly places the target message into and occupies the currently idle highest-priority mailbox reserved for the highest-priority message group, flexibly utilizing idle highest-priority mailbox resources and opening a temporary "fast track" for the next highest-priority critical messages. Without interfering with the existing highest-priority message scheduling sequence, it significantly reduces the sending latency of these critical messages, thereby effectively improving the system's overall responsiveness and real-time performance to important events when bus resources are scarce.

[0016] As an optional implementation, it also includes: when the bus load rate drops to less than a preset threshold, exiting the temporary high-priority transmission mode and resuming the transmission of messages to be sent in the second-highest priority message group from their inherent transmission mailbox and CAN ID.

[0017] When the bus load rate drops below a preset threshold, this solution exits the temporary high-priority sending mode, adaptively releases the preempted high-priority mailbox resources, restores the standard arbitration order, and ensures long-term system stability and fairness.

[0018] As an optional implementation, an initialization configuration is performed, pre-configuring multi-level priority message groups and their corresponding sending mailboxes, including: Set the bit rate of the arbitration segment and the data segment, initialize each sending mailbox, statically allocate non-overlapping CAN ID segments for messages in message groups of different priorities, and initialize the association between the sending mailbox and the message group.

[0019] This scheme directly sets the bit rate of the arbitration segment and data segment, initializes each sending mailbox, and statically allocates non-overlapping CAN ID segments for messages of different priority groups. In other words, through static configuration and hardware buffers bound to specific IDs (CAN ID segments), deterministic transmission channels are pre-defined for messages of different priorities. Based on distributed single-level arbitration, all nodes compete equally for the bus within their respective ID segments, effectively simplifying the scheduling logic, avoiding the overhead of complex dynamic arbitration, and maintaining the predictability and overall stability of system behavior while ensuring low latency for high-priority messages.

[0020] As an optional implementation, all messages to be sent in the sending mailbox are sorted in the first level, and message sending scheduling is performed based on standard arbitration rules, specifically as follows: Iterate through the messages to be sent in the highest priority sending email address and sort them according to the first-level priority of the sending email address. Within the message queue of the same mailbox, the dynamically adjusted arbitration ID is identified and message sending is scheduled according to the standard CAN arbitration rules.

[0021] This solution is based on fixed sending mailboxes with different priorities. Within the message queue of the same mailbox, the dynamically adjusted arbitration ID is identified according to the standard CAN arbitration rules and message sending is scheduled. The mailbox performs CAN standard arbitration based on the adjusted arbitration ID, which realizes the combination of static resource protection and dynamic priority optimization, and takes into account both scheduling determinism and real-time flexibility.

[0022] As an optional implementation, when the target message is temporarily adjusted after entering the temporary high-priority sending mode, the sending requests of all messages to be sent in the lowest priority message group are simultaneously suspended. After exiting the temporary high-priority sending mode, restore the pending status of all messages in the lowest-priority message group.

[0023] This solution temporarily suppresses non-critical communication (suspends the sending requests of all pending messages in the lowest priority message group) when the bus is under high load, freeing up bandwidth for critical messages; after the load is restored, the complete service is rebuilt and bandwidth is dynamically allocated, balancing the immediacy of emergency response with the integrity of system functions.

[0024] As an optional implementation, it also includes: performing transmission protection, performing data security verification and initiating automatic hardware retransmission when it is detected that the message to be sent in the highest priority / second highest priority message group has failed to be sent.

[0025] This solution is based on hardware automatic retransmission to ensure transmission reliability. It performs real-time verification and hardware retransmission for critical message transmission failures, ensuring absolute transmission reliability and improving the robustness and data determinism of CAN bus transmission in interference environments. Attached Figure Description

[0026] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0027] Figure 1 This is a flowchart of a multi-priority CAN bus transmission method provided by an embodiment of the present invention. Detailed Implementation

[0028] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0029] In this invention, the terms "upper," "lower," "left," "right," "front," "rear," "top," "bottom," "inner," "outer," "middle," "vertical," "horizontal," "lateral," and "longitudinal" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. These terms are primarily for the purpose of better describing the invention and its embodiments, and are not intended to limit the indicated devices, elements, or components to having a specific orientation, or to be constructed and operated in a specific orientation.

[0030] Furthermore, in addition to indicating direction or positional relationship, some of the aforementioned terms may also have other meanings. For example, the term "above" may also be used in certain situations to indicate a dependency or connection. Those skilled in the art can understand the specific meaning of these terms in this invention based on the specific circumstances.

[0031] Furthermore, the terms "installation," "setup," "equipped with," "connection," and "linked" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral structure; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium, or an internal connection between two devices, components, or parts. Those skilled in the art can understand the specific meaning of these terms in this invention based on the specific circumstances.

[0032] Furthermore, the terms "first," "second," etc., are primarily used to distinguish different devices, components, or parts (which may be the same or different in specific type and construction), and are not intended to indicate or imply the relative importance or quantity of the indicated devices, components, or parts. Unless otherwise stated, "a plurality of" means two or more.

[0033] The technical solution of the present invention will be further described below with reference to the embodiments and accompanying drawings.

[0034] Example 1 Please see Figure 1 As shown, this application provides a multi-priority CAN bus transmission method, including the following steps: S1. Perform initialization configuration, pre-configuring multi-level priority message groups and their corresponding sending mailboxes, including: Set the bit rate of the arbitration segment and the data segment, initialize each sending mailbox, statically allocate non-overlapping CAN ID segments for messages in message groups of different priorities, and initialize the association between the sending mailbox and the message group.

[0035] This invention can be implemented on any microprocessor (MCU) that integrates a CAN or CAN FD controller that supports mailbox mechanisms and configurable priority functions. For example, common automotive-grade MCUs, such as NXP Semiconductors' S32K series (using its integrated FlexCAN module as an example) and many products with ARM Cortex-M cores, can all serve as the hardware foundation for implementing this solution.

[0036] For ease of explanation, this invention will take the FlexCAN module of the NXP S32K148 microcontroller as an example, configure the CAN controller of the current MCU (S32K148), set the bit rate of the arbitration segment and the data segment (e.g., 500Kbps for the arbitration segment and 2Mbps for the data segment), initialize each message mailbox, statically allocate non-overlapping CAN ID segments (identifiers) for messages of different priorities, and initialize the association between mailboxes and message groups.

[0037] The defined key static ID segments include: P0 security critical message segments (e.g., 0x000-0x07F), P1 real-time control message segments (e.g., 0x0C0-0x0FF), P2 periodic status message segments (e.g., 0x100-0x17F), and P3 event log message segments (e.g., 0x180-0x1FF). Meanwhile, to support dynamic priority escalation, the system pre-configures a sending mailbox for high-priority P0 and P1 messages during initialization and reserves the resources required for dynamic scheduling.

[0038] Among them, the multi-level ID partitioning strategy formed by P0~P4, combined with the distributed, single-level arbitration architecture, ensures that all nodes compete equally without a central arbitrator, thereby achieving secure isolation and ensuring that dynamic upgrades do not jeopardize messages with the highest security level.

[0039] The message group configuration after initialization is shown in Table 1 below:

[0040] Table 1 This embodiment directly sets the bit rate of the arbitration segment and the data segment, initializes each sending mailbox, and statically allocates non-overlapping CAN ID segments for messages of different priority groups. In other words, through static configuration and hardware buffers bound to specific IDs (CAN ID segments), deterministic transmission channels are pre-defined for messages of different priorities. Based on distributed single-level arbitration, all nodes compete equally for the bus within their respective ID segments, effectively simplifying the scheduling logic, avoiding the overhead of complex dynamic arbitration, and maintaining the predictability and overall stability of system behavior while ensuring low latency for high-priority messages.

[0041] S2. Obtain and identify messages to be sent, classify the messages, and assign them to the corresponding sending mailboxes. Specifically: After an application generates messages to be sent, a message priority classifier categorizes them based on the message's criticality, periodicity, and data volume. The message priority classifier matches messages against a pre-defined rule table, for example: Messages whose data source is Electronic Stability Program (ESP) and whose command code is emergency braking are classified as P0; Messages whose data source is the wheel speed sensor and whose period is ≤20ms are classified as P1; Door status messages whose data source is the Body Controller (BCM) are classified as P2; Diagnostic log messages are categorized as P3.

[0042] In this way, the message to be sent (CAN message) is placed into the hardware transmission mailbox of the CAN controller for preparation.

[0043] S3. Monitor the current bus load rate in real time, and execute a dynamic priority strategy based on the bus load rate, enter a temporary high-priority sending mode, and temporarily adjust the priority of the target message. In this embodiment, the formula for calculating the bus load rate is as follows: L=[1-(C / (T*R))]*100% Where L represents the bus load rate, T represents the sampling period (e.g., T=10ms), C represents the bus idle time count, which can be obtained through the bus status information (such as the bus idle time counter) provided by the CAN controller, and R represents the bit rate.

[0044] In this embodiment, a dynamic priority strategy is executed based on the bus load rate, entering a temporary high-priority transmission mode to temporarily adjust the priority of the target message, including: A. Determine whether the bus load rate is less than a preset threshold. If so, execute normal transmission scheduling; otherwise, enter temporary high-priority transmission mode.

[0045] Specifically: If the bus load rate L < the preset threshold L0 (e.g., 60%), all messages are sent according to their inherent priority. If the bus load rate L ≥ the preset threshold L0, then a temporary high-priority sending mode is enabled for P1 level messages, and all P3 level message sending requests are suspended.

[0046] In the temporary high-priority transmission mode, by temporarily transferring the transmission right of P1 messages to high-priority transmission resources, it obtains an arbitration priority in bus arbitration that is higher than its inherent priority (i.e. higher than static P1, P2, P3 messages) but lower than the highest safety critical (P0) message, thereby achieving priority improvement.

[0047] B. Identify the messages to be sent in the second-highest priority message group as target messages, and perform a temporary priority adjustment on the target messages; the adjusted priority of the target messages is higher than their inherent priority, but lower than the arbitration priority of all messages to be sent in the highest priority message group.

[0048] In this embodiment, the temporary priority adjustment of the target message includes: Calculate the arbitration ID of the target message based on the ID range of the dynamic priority enhancement zone; The arbitration ID is temporarily mapped to the dynamic priority enhancement zone, which is the ID range between the highest priority and the second highest priority static segment.

[0049] In this embodiment, the arbitration ID of the target message is calculated using the following formula: Quorum ID=Pt_Base+Node_ID In the formula, Pt_Base represents the starting CAN ID of the dynamic priority boosting zone, and Node_ID represents the unique logical node number.

[0050] Specifically, the arbitration ID of the P1 level message to be sent is temporarily mapped to a higher priority ID interval Pt (called the dynamic priority enhancement area) between the P0 and P1 static segments according to a preset formula; Node_ID is a unique logical node number in the system.

[0051] In this way, through dynamic mapping of CAN IDs, the priority of P1 level messages to be sent is increased to higher than all original P1, P2, and P3 messages, but lower than P0 safety-critical messages, thereby enhancing real-time performance without compromising the highest safety level.

[0052] This embodiment calculates the arbitration ID based on the starting CAN ID of the dynamic priority enhancement zone and the unique node logical number. Through a conflict-free and deterministic temporary ID allocation algorithm, it achieves regular temporary ID allocation, ensuring that the dynamic adjustment of priorities among multiple nodes is orderly and conflict-free, and realizing precise management of arbitration resources and real-time optimization of bus load.

[0053] C. When entering the temporary high-priority sending mode and making temporary priority adjustments to the target message, the sending requests of all pending messages in the lowest priority message group are simultaneously suspended.

[0054] This embodiment temporarily suppresses non-critical communication (suspends the sending requests of all pending messages in the lowest priority message group) when the bus is under high load, freeing up bandwidth for critical messages; after the load is restored, the complete service is rebuilt and bandwidth is dynamically allocated, balancing the immediacy of emergency response with the integrity of system functions.

[0055] D. When the bus load rate drops to less than the preset threshold, exit the temporary high-priority transmission mode and resume the transmission of messages to be sent in the second-highest priority message group from their inherent transmission mailbox and CAN ID.

[0056] After exiting the temporary high-priority sending mode, restore the pending status of all messages in the lowest-priority message group.

[0057] Specifically, when the bus load rate L falls below the preset threshold L0 and remains below it for a period of time (e.g., 100ms), the system exits the temporary high-priority transmission mode, all P1 level messages to be transmitted resume transmission from their inherent mailboxes and CAN IDs, and P3 level messages to be transmitted resume the state of being ready to be transmitted.

[0058] In this embodiment, when the bus load rate drops below a preset threshold, the temporary high-priority sending mode is exited, the preempted high-priority mailbox resources are adaptively released, the standard arbitration order is restored, and the long-term stability and fairness of the system are ensured.

[0059] This embodiment performs a temporary priority adjustment, making the priority of the target message higher than its inherent priority and lower than the arbitration priority of all pending messages in the highest priority message group. In this way, while ensuring that the highest priority message is not affected, the right to send the second highest priority target critical message is temporarily transferred to the high priority sending resource, so that it can be sent first when there is a bus conflict. This effectively balances the real-time requirements of urgent messages with the overall arbitration fairness of the system.

[0060] S4. Perform a first-level sorting on all messages to be sent in the sending mailbox, and execute message sending scheduling based on standard arbitration rules, specifically as follows: Iterate through the messages to be sent in the highest priority sending email address and sort them according to the first-level priority of the sending email address. Within the message queue of the same mailbox, the dynamically adjusted arbitration ID is identified and message sending is scheduled according to the standard CAN arbitration rules.

[0061] Specifically, for messages already placed in the transmission mailbox, the CAN controller performs first-level sorting based on the mailbox's configured priority. Within the same mailbox queue, the standard CAN arbitration rule, based on a dynamically adjusted arbitration ID ("the smaller the value, the higher the priority"), is used for final transmission.

[0062] This embodiment is based on fixed sending mailboxes with different priorities. Within the message queue of the same mailbox, the dynamically adjusted arbitration ID is identified according to the standard CAN arbitration rules and message sending is scheduled. The mailbox performs CAN standard arbitration based on the adjusted arbitration ID, which realizes the combination of static resource protection and dynamic priority optimization, and takes into account both scheduling determinism and real-time flexibility.

[0063] S5. Perform transmission guarantee and dynamic resource adjustment, including: S51. Perform transmission protection: When a message to be sent in the highest priority / second highest priority message group fails to be sent, perform data security verification and start hardware automatic retransmission.

[0064] Specifically, for P0 and P1 level messages to be sent, the automatic retransmission function provided by the CAN controller hardware is enabled. In the event of a transmission failure, the hardware encryption module (such as the CSEc module of the S32K148) can perform an integrity signature on the message, which is then verified by the receiver to ensure data trustworthiness.

[0065] This embodiment relies on hardware automatic retransmission to ensure transmission reliability. It performs real-time verification and hardware retransmission for critical message transmission failures, ensuring absolute transmission reliability and improving the robustness and data determinism of CAN bus transmission in interference environments.

[0066] S52. Perform dynamic resource adjustment and monitor node sending status in real time. When a node enters the "error passive" state, automatically configure the sending mailbox of the low-priority message group to be inactive or clear its sending request, so as to concentrate communication resources to ensure the reliable transmission of critical messages.

[0067] Specifically, the system continuously monitors the error counter. When a node enters the "error passive" state, it automatically configures the sending mailbox corresponding to the P2 and P3 level messages to be sent to "inactive" or clears its sending request bit, and concentrates resources to ensure critical communication of P0 and P1.

[0068] In this embodiment, when a node fails, non-critical communication is proactively downgraded, and limited bus resources are concentrated on ensuring the transmission of the highest / second highest priority messages, thereby maintaining the security and availability of the system's core functions in the event of a local anomaly.

[0069] Example 2 This application provides a multi-priority CAN bus transmission method. The difference between this embodiment and Embodiment 1 is that: In this embodiment, the target message undergoes a temporary priority adjustment, specifically as follows: Traverse the target messages and directly place the messages to be sent in the second highest priority message group into the target sending mailbox and occupy it. The target sending mailbox is the currently idle highest priority sending mailbox reserved for the highest priority message group (e.g., physical sending mailbox MB0).

[0070] In this embodiment, the target message is directly placed into and occupies the currently idle highest priority mailbox reserved for the highest priority message group. This flexibly utilizes the idle highest priority mailbox resources, creating a temporary "fast track" for the next highest priority critical messages. Without interfering with the existing highest priority message scheduling sequence, the sending delay of these critical messages is significantly reduced, thereby effectively improving the system's overall responsiveness and real-time performance to important events when bus resources are scarce.

[0071] This invention embodiment sets dynamic priorities based on real-time bus load rate, optimizes bus bandwidth utilization in real time, improves communication efficiency, and ensures the timeliness of critical data transmission. By simply entering a temporary high-priority sending mode, the priority of target messages is temporarily adjusted. Through temporary priority upgrade, it can ensure that critical messages preempt bandwidth when the bus is congested, make full use of hardware resources, and ensure their low latency and high reliability. At the same time, it ensures that dynamic upgrade does not jeopardize messages with the highest security level.

[0072] The technical means disclosed in this invention are not limited to those disclosed in the above embodiments, but also include technical solutions composed of any combination of the above technical features. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of this invention, and these improvements and modifications are also considered within the scope of protection of this invention.

Claims

1. A transmission method based on a multi-priority CAN bus, characterized in that, Including the following steps: Perform initialization configuration, pre-configuring multi-level priority message groups and their corresponding sending mailboxes; Acquire and identify messages to be sent, classify the messages, and assign them to the corresponding sending mailboxes; The system monitors the current bus load rate in real time and executes a dynamic priority strategy based on the bus load rate, entering a temporary high-priority transmission mode to temporarily adjust the priority of the target message. All messages to be sent in the sending mailbox are sorted in the first level, and message sending scheduling is performed based on standard arbitration rules.

2. The multi-priority CAN bus transmission method as described in claim 1, characterized in that, Based on the bus load rate, a dynamic priority strategy is executed, entering a temporary high-priority transmission mode to temporarily adjust the priority of the target message, specifically as follows: Determine whether the bus load rate is less than a preset threshold. If so, execute normal transmission scheduling; otherwise, enter temporary high-priority transmission mode. Identify the messages to be sent in the second-highest priority message group as target messages and perform temporary priority adjustment on the target messages. The adjusted priority of the target message is higher than its inherent priority, but lower than the arbitration priority of all pending messages in the highest priority message group.

3. The multi-priority CAN bus transmission method as described in claim 2, characterized in that, Temporarily adjust the priority of the target message, including: Calculate the arbitration ID of the target message based on the ID range of the dynamic priority enhancement zone; The arbitration ID is temporarily mapped to the dynamic priority enhancement zone, which is the ID range between the highest priority and the second highest priority static segment.

4. The multi-priority CAN bus transmission method as described in claim 3, characterized in that, The formula for calculating the arbitration ID of the target message is as follows: Quorum ID=Pt_Base+Node_ID In the formula, Pt_Base represents the starting CAN ID of the dynamic priority boosting zone, and Node_ID represents the unique logical node number.

5. A multi-priority CAN bus transmission method as described in claim 2, characterized in that, The target message is temporarily prioritized, specifically as follows: Traverse the target messages and directly place the messages to be sent in the second highest priority message group into the target sending mailbox, which is the currently idle highest priority sending mailbox reserved for the highest priority message group.

6. The multi-priority CAN bus transmission method as described in claim 1, characterized in that, Also includes: When the bus load rate drops below a preset threshold, the temporary high-priority transmission mode is exited, and the messages to be sent in the second-highest priority message group are resumed to be sent from their inherent transmission mailbox and CAN ID.

7. The multi-priority CAN bus transmission method as described in claim 1, characterized in that, Perform initialization configuration, pre-configuring multi-level priority message groups and their corresponding sending mailboxes, including: Set the bit rate of the arbitration segment and the data segment, initialize each sending mailbox, statically allocate non-overlapping CAN ID segments for messages in message groups of different priorities, and initialize the association between the sending mailbox and the message group.

8. The multi-priority CAN bus transmission method as described in claim 1, characterized in that, All messages to be sent in the sending mailbox are sorted at the first level, and message sending scheduling is performed based on standard arbitration rules, specifically as follows: Iterate through the messages to be sent in the highest priority sending email address and sort them according to the first-level priority of the sending email address. Within the message queue of the same mailbox, the dynamically adjusted arbitration ID is identified and message sending is scheduled according to the standard CAN arbitration rules.

9. A multi-priority CAN bus transmission method as described in claim 2, characterized in that: When entering the temporary high-priority sending mode, and when making temporary priority adjustments to the target message, the sending requests of all pending messages in the lowest priority message group are simultaneously suspended. After exiting the temporary high-priority sending mode, restore the pending status of all messages in the lowest-priority message group.

10. A multi-priority CAN bus transmission method as described in claim 1, characterized in that, Also includes: To ensure transmission, when a message to be sent in the highest / second highest priority message group fails to be sent, a data security check is performed and automatic hardware retransmission is initiated.

Citation Information

Patent Citations

  • Control method and structure of CAN bus with priority

    CN117914645A