Method and system for adjusting CAN bus message period based on dynamic load balancing

By dividing the message into levels in the CAN bus network and combining load rate and error count for partitioned frequency modulation, the problems of bandwidth waste, real-time risk and error propagation in traditional CAN bus networks are solved, achieving network load balancing and improved stability.

CN120896946AActive Publication Date: 2025-11-04ENEROC NEW ENERGY TECHNOLOGY CO LTD

Patent Information

Application Number
CN202511419746.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-30
Publication Date
2025-11-04
Estimated Expiration
2045-09-30

AI Technical Summary

Technical Problem

Traditional CAN bus networks suffer from bandwidth waste, real-time risks, lack of dynamic adaptability, and potential for error propagation. Existing adjustment schemes have coarse adjustment granularity, insufficient stability, and limited compatibility.

Method used

By dividing CAN message levels, setting adjustment cycle ranges and frequency modulation parameters, defining partitions based on load rate and error count, and employing strategies of gradual frequency reduction, preventative frequency reduction, and graded frequency increase, network load balancing is achieved.

Benefits of technology

It achieves real-time assurance of critical messages and flexible adjustment of non-critical messages, balances network reliability and bandwidth efficiency, adapts to standard CAN/CAN FD protocols, and improves system robustness and compatibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120896946A_ABST
    Figure CN120896946A_ABST
Patent Text Reader

Abstract

The invention provides a CAN bus message period adjusting method and system based on dynamic load balancing, and the system measures and calculates a network load rate and an error state through a network load real-time detection module, carries out the priority grade division and parameter configuration for different messages, carries out the load partition definition according to the load rate, and carries out the adjustment of the CAN bus message period. And dynamically adjusting a message sending period according to a measurement result, adding a feedback mechanism to realize closed-loop control, and finally realizing load balancing of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of dynamic adjustment technology for CAN bus message cycle, and in particular to a method and system for adjusting the CAN bus message cycle based on dynamic load balancing. Background Technology

[0002] Traditional CAN bus networks generally employ a fixed message cycle strategy, which has limitations in the following aspects: 1. Bandwidth waste: Non-critical data is still sent at fixed intervals when the network is idle, redundantly occupying bandwidth resources; 2. Real-time risk: Under high load, low-priority packets continuously occupy the bus, exacerbating network congestion and causing delays or even loss of critical packets; 3. Lack of dynamic adaptability: It relies on manually preset cycles and cannot automatically optimize network performance based on real-time load (such as sudden traffic surges or node errors); 4. Potential for error propagation: When the CAN bus error counter (REC / TEC) grows abnormally, the lack of an active load reduction mechanism may cause nodes to go offline or the entire network to be paralyzed.

[0003] In recent years, some studies have attempted to optimize CAN network performance by dynamically adjusting message cycles, but the following shortcomings still exist: (1) Coarse adjustment granularity: frequency adjustment is based solely on the load rate, without combining error status or message priority hierarchical control; (2) Insufficient stability: instantaneous load fluctuations can easily trigger frequent frequency adjustments, leading to network jitter; (3) Limited compatibility: it relies on customized hardware or protocol modifications, making it difficult to adapt to existing CAN nodes. With the increasing demands for real-time performance of the CAN bus in intelligent vehicles and industrial automation scenarios, a lightweight and adaptive load balancing solution is urgently needed. This solution should be able to dynamically sense network load and error status while being compatible with standard CAN / CAN FD protocols, and achieve network load balancing through a reasonable frequency adjustment strategy. Summary of the Invention

[0004] This invention addresses the problems of coarse adjustment granularity, insufficient stability, and limited compatibility in dynamically adjusting message cycles. It proposes a method and system for adjusting the CAN bus message cycle based on dynamic load balancing, which can dynamically sense network load and error status, and achieve network load balancing through a reasonable frequency adjustment strategy.

[0005] To achieve the above objectives, the following technical solution is proposed: A method for adjusting the CAN bus message cycle based on dynamic load balancing includes the following steps: S1, divides CAN message levels into several categories based on the CAN ID range; S2, set the adjustment cycle range and frequency modulation parameters for each CAN message level; S3 defines network load partitions based on load rate and error count, and sets frequency adjustment measures for each partition; S4: Obtain real-time load rate and error count, and determine whether the error count increment exceeds the limit or the load rate is greater than a. If so, identify it as a high load area and reduce the frequency step by step according to the CAN message level from high to low. If not, proceed to S5. S5, determine if the load rate is greater than b. If yes, identify it as the second highest load area and perform preventative frequency reduction. If not, proceed to S6. S6. Determine if the load rate is greater than c, where a>b>c. If yes, it is considered a safe zone and no frequency adjustment is needed. If no, it is considered a low load zone and frequency is increased in stages.

[0006] This invention achieves real-time assurance of critical messages and flexible adjustment of non-critical messages through differentiated configuration of priority and frequency adjustment parameters, balancing network reliability and bandwidth efficiency. Through partitioning and frequency adjustment strategies, it achieves regulation and control of load fluctuations to achieve the goal of load balancing, while ensuring differentiated service quality for messages of different priorities.

[0007] Preferably, the CAN message levels are ranked from highest to lowest as highest priority, second highest priority, medium priority, low priority, and lowest priority. The period of the highest priority message is fixed, and the adjustment period range of the second highest priority, medium priority, low priority, and lowest priority messages includes the minimum period and the maximum period. The frequency modulation parameter of each CAN message level gradually increases from high to low according to the priority level.

[0008] This invention defines five priority levels, from 0 to 4, where 0 is the highest priority and 4 is the lowest priority. Each priority level corresponds to a defined CAN ID range. The minimum period Tmin represents the upper limit of the message transmission frequency within the corresponding CAN ID range at that priority level; the maximum period Tmax represents the lower limit of the message transmission frequency within the corresponding CAN ID range at that priority level. It is necessary to ensure that the message period after frequency modulation does not exceed the aforementioned maximum and maximum periods. Specifically, the message period for priorities 0 to the highest priority is fixed and frequency modulation is not allowed; the maximum period for messages from 4 to the lowest priority can be ∞, meaning transmission is paused. ω is the frequency modulation coefficient, which controls the magnitude of each adjustment to the message transmission period. The smaller ω is, the smaller the allowed period adjustment magnitude each time; the larger ω is, the larger the allowed period adjustment range each time. For high-priority messages, the ω value should be set smaller to ensure that the frequency reduction step size of high-priority messages is limited; while for low-priority messages, the ω value should be set larger to allow low-priority messages to obtain a larger frequency modulation step size.

[0009] Preferably, the method of defining network load partitions based on load rate and error count includes the following steps: when the load rate is higher than a or the error count increment exceeds the limit, it is defined as a high load zone; when the load rate is between a and b, it is defined as a second high load zone; when the load rate is between b and c, it is defined as a safe zone; and when the load rate is lower than c, it is defined as a low load zone, where a=70%, b=50%, and c=20%.

[0010] Preferably, the stepwise frequency reduction according to the CAN message level from high to low specifically includes the following steps: Level 1: Directly suspend the transmission of the lowest priority level messages. If the load rate is still greater than 'a', proceed to Level 2 adjustment; otherwise, exit the adjustment process. Level 2: Adjust the low-priority message period according to the frequency modulation parameters until the upper limit of the low-priority message period is reached. If the load rate is still greater than a, proceed to Level 3 adjustment; otherwise, exit the adjustment. Level 3: Adjust the medium-priority message period according to the frequency modulation parameters until the upper limit of the medium-priority message period is reached. If the load rate is still greater than a, proceed to Level 4 adjustment; otherwise, exit the adjustment. Level 4: The message cycles of all priorities except the highest priority are locked at their corresponding maximum cycles. If the load rate is less than d, the adjustment is exited; otherwise, Level 4 adjustment continues. Here, d = ae, and e is the first hysteresis margin, where d = 65% and e = 5%.

[0011] Preferably, the fourth level also includes the following steps: reporting system-level alarms and prompting for troubleshooting the root cause of the fault.

[0012] Preferably, the preventive frequency reduction includes the following steps: successively reducing the frequency of low-priority packets and the lowest priority packets until the frequency is reduced to the maximum period of the corresponding priority packets. After each frequency reduction, it is determined whether the load rate is less than f. If so, the packet is downgraded to the safe zone. If not, it is determined whether the load rate is greater than a. If so, the packet is upgraded to the high load zone. If not, the frequency reduction of low-priority packets and the lowest priority packets continues. f = bg, and g is the second hysteresis margin, where f = 45% and g = 5%.

[0013] Preferably, the graded frequency upsampling in the low-load region specifically includes the following steps: S61, upsampling the frequency of messages of the second highest priority, medium priority, and low priority, and calculating the target period after a single upsampling; S62, calculate the theoretical load increment after each priority message is frequency-upgraded; S63, calculate the maximum allowable load rate increment; S64, calculates the predicted load rate after frequency upsampling; S65, Dynamic constraint on frequency increase: Determine whether the predicted load rate after frequency increase is less than or equal to the constraint threshold. If yes, proceed to S66. If no, reduce the frequency increase proportionally to ensure that the theoretical load rate increment after frequency increase does not exceed the maximum allowable load rate increment, and then proceed to S66. S66: Increase the frequency level step by step according to the message priority from high to low. After each frequency increase, check the load rate. If the load rate after the frequency increase is greater than h, where h=bj and j is the third hysteresis margin, where h=45% and j=5%, then immediately roll back the frequency increase adjustment of this round. If the load rate after the frequency increase is greater than or equal to k, where k=35%, then stop the frequency increase. If the load rate after the frequency increase is less than k, then execute the frequency increase of the next priority. S67: After each priority message completes a full frequency increase, if the load rate after the frequency increase is less than k, repeat S61 to S66; otherwise, stop the frequency increase and enter the safe zone.

[0014] As a preferred approach, the frequency reduction process for each priority level is as follows: Calculate the normalized load deviation ratio factor for the load partition: obtain the lower limit of the load rate, the upper limit of the load rate, and the real-time load rate of the load partition. Normalized load deviation ratio factor = (real-time load rate - lower limit of load rate) / (upper limit of load rate - lower limit of load rate). Calculate the frequency reduction weight = 1 + the frequency modulation parameter of the priority message × the normalized load deviation ratio factor of the load partition. The transmission cycle of the priority message after frequency reduction = the transmission cycle of the current priority message × the frequency reduction weight.

[0015] As a preferred approach, the frequency increase process for each priority level is as follows: Calculate the normalized load deviation ratio factor for the load partition: obtain the upper limit of the allowed load rate and the real-time load rate after frequency boosting for the load partition. Normalized load deviation ratio factor = (upper limit of allowed load rate - real-time load rate) / upper limit of allowed load rate. Calculate the upsampling weight = 1 - (1 - frequency modulation parameter of the priority message) × normalized load deviation ratio factor of the load partition. The transmission cycle of the priority message after frequency increase = the transmission cycle of the current priority message × the frequency increase weight.

[0016] A CAN bus message period adjustment system based on dynamic load balancing, employing the aforementioned method for adjusting the CAN bus message period based on dynamic load balancing, includes: The real-time network load detection module is responsible for collecting and analyzing the communication status of the CAN bus in real time and quantifying the network load level. Specifically, it includes a bus load rate calculation unit for calculating the bus load rate within a unit time window, an error status monitoring unit for calculating the error count increment within a unit time, and a frame density statistics unit for counting the number of frames received within a unit time. The message cycle dynamic adjustment module prioritizes and configures parameters for messages, defines network load partitions based on load rate and error count, formulates partition frequency adjustment strategies based on real-time data provided by the network load detection module, and dynamically adjusts the message sending cycle through algorithms. The message cycle adjustment execution module transmits the frequency modulation result output by the message cycle dynamic adjustment module to each slave node, monitors the execution status, and incorporates a feedback mechanism to achieve closed-loop control. Specifically, it includes an instruction encapsulation and broadcasting unit, an instruction parsing and execution unit, and an execution status monitoring and feedback unit. The main controller is electrically connected to the network load real-time detection module, the message cycle dynamic adjustment module, and the message cycle adjustment execution module.

[0017] This invention utilizes a bus load rate calculation unit, an error status monitoring unit, and a frame density statistics unit to collect bus utilization, error counter increments, and frame type distribution in real time, constructing a multi-dimensional detection system encompassing load rate, error status, and frame density. This invention overcomes the limitations of traditional single load rate detection by integrating physical layer error status and protocol layer frame density, providing a precise data foundation for dynamic frequency modulation.

[0018] This invention designs a dedicated frequency modulation command format, and achieves network-wide policy synchronization and execution status monitoring through command encapsulation broadcasting, slave node parsing and execution, and feedback mechanisms. Closed-loop control based on feedback ensures reliable execution of frequency modulation commands, supports single-point / broadcast modes and fault node detection, improves system robustness and compatibility, and is compatible with standard CAN / CAN FD protocols.

[0019] The beneficial effects of this invention are: 1. Network load dynamic detection technology based on multi-dimensional indicators: Through a bus load rate calculation unit, an error status monitoring unit, and a frame density statistics unit, it collects bus utilization, error counter increment (ΔREC / ΔTEC), and frame type distribution in real time, constructing a multi-dimensional detection system that includes load rate, error status, and frame density. This breaks through the limitations of traditional single load rate detection, integrating physical layer error status (such as abnormal growth of TEC / REC) and protocol layer frame density, providing a precise data foundation for dynamic frequency modulation. 2. Priority Classification and Parameter Predefined Mechanism: CAN messages are divided into 5 priority levels (0-4), with predefined minimum period (Tmin), maximum period (Tmax), and frequency modulation coefficient (ω). The highest priority (level 0) has a fixed period, while the lowest priority (level 4) supports paused transmission (Tmax=∞). The ω value increases as the priority decreases to control the adjustment range. Through differentiated configuration of priority and frequency modulation parameters, the real-time performance of critical messages (such as emergency fault alarms) and the flexible adjustment of non-critical messages (such as debugging information) are ensured, balancing network reliability and bandwidth efficiency.

[0020] 3. Load Partitioning and Tiered Frequency Adjustment Strategy: Based on load rate (thresholds are 20%, 50%, and 70%), the system is divided into low load zone (L), safe zone (S), second-highest load zone (H), and high load zone (HH). Corresponding strategies are triggered based on error status (e.g., error count increment exceeding limits): High load zone (HH): Gradual frequency reduction (first suspending the lowest priority packets, then dynamically adjusting the low / medium priority cycle by ω until the maximum cycle is forcibly locked); Second-highest load zone (H): Preventative frequency reduction (only adjusting low / lowest priority packets to avoid entering HH). The load zone is divided into several zones: a safe zone (S) and a low-load zone (L). The safe zone does not trigger any frequency adjustment operations (focusing on status monitoring and trend prediction, providing a buffer for potential load fluctuations). The low-load zone (L) dynamically increases the frequency (increasing frequency from high to low priority, using a load prediction model to constrain the increase magnitude and avoid exceeding the safe zone's upper limit). Through partitioning strategies and frequency adjustment formulas (including a normalized load deviation factor), load fluctuations are regulated and controlled to achieve load balancing while ensuring differentiated service quality for different priority packets. Hysteresis margin control is introduced during load zone switching to prevent frequent frequency adjustments caused by instantaneous fluctuations. 4. Closed-loop control and collaborative execution mechanism: A dedicated frequency modulation command format (including target node ID, target message type, new period value, effective time offset, and CRC check) is designed. Through command encapsulation and broadcasting, slave node parsing and execution (including whitelist verification and out-of-bounds clamping), and a feedback mechanism (ACK / NACK frame format), network-wide policy synchronization and execution status monitoring are achieved. The feedback-based closed-loop control ensures reliable execution of frequency modulation commands, supports single-point / broadcast modes and fault node detection (such as timeout marking as offline and safe mode switching), improves system robustness and compatibility, and adapts to standard CAN / CAN FD protocols. Attached Figure Description

[0021] Figure 1 This is a flowchart of the method of the present invention; Figure 2 This is a flowchart of the step-by-step frequency reduction process of the present invention; Figure 3 This is a flowchart of the step-by-step frequency ramping process of the present invention; Figure 4 This is a system configuration block diagram of the present invention. Detailed Implementation Example 1:

[0022] This embodiment proposes a method for adjusting the CAN bus message period based on dynamic load balancing, referring to... Figure 1 This includes the following steps: S1, divide the CAN message into several CAN message levels according to the CAN ID range; the CAN message levels are in the following order from high to low: highest priority, second highest priority, medium priority, low priority and lowest priority; S2, set the adjustment period range and frequency modulation parameters for each CAN message level; the period of the highest priority message is fixed, and the adjustment period range of the second highest priority, medium priority, low priority and lowest priority includes the minimum period and the maximum period. The frequency modulation parameters of each CAN message level gradually increase from high to low according to the priority level. Configure the following parameters for CAN messages of different priorities, refer to Table 1.

[0023] Table 1 Message Classification and Parameter Definition Table Priority level CAN ID range <![CDATA[Minimum period (T min )]]> <![CDATA[Maximum period (T max )]]> Frequency modulation coefficient ω 0 - Highest priority <![CDATA[(ID min(0) ,ID max(0) )]]> <![CDATA[T (0) ]]> <![CDATA[T (0) ]]> - 1-High priority <![CDATA[(ID min(1) ,ID max(1) )]]> <![CDATA[T min(1) ]]> <![CDATA[T max(1) ]]> <![CDATA[ω1]]> 2-Medium Priority <![CDATA[(ID min(2) ,ID max(2) )]]> <![CDATA[T min(2) ]]> <![CDATA[T max(2) ]]> <![CDATA[ω2]]> 3-Low priority <![CDATA[(ID min(3) ,ID max(3) )]]> <![CDATA[T min(3) ]]> <![CDATA[T max(3) ]]> <![CDATA[ω3]]> 4-Lowest Priority <![CDATA[(ID min(4) ,ID max(4) )]]> <![CDATA[T min(4) ]]> ∞ <![CDATA[ω4]]> Five priority levels are defined, from 0 to 4, with 0 being the highest priority and 4 being the lowest. Each priority level corresponds to a specific CAN ID range. The minimum period Tmin represents the upper limit of the message transmission frequency within the corresponding CAN ID range at that priority level; the maximum period Tmax represents the lower limit of the message transmission frequency within the corresponding CAN ID range at that priority level. It is necessary to ensure that the message period after frequency adjustment does not exceed the aforementioned maximum and maximum period. Specifically, the message period for priorities 0 to the highest priority is fixed and frequency adjustment is not allowed; the maximum period for messages from 4 to the lowest priority can be ∞, meaning transmission is paused.

[0024] ω is the frequency modulation coefficient, which controls the magnitude of each adjustment in the message transmission period. The smaller ω is, the smaller the allowed period adjustment magnitude each time; the larger ω is, the larger the allowed period adjustment range each time. For high-priority messages, the ω value should be set smaller to ensure that the frequency reduction step size of high-priority messages is limited; while for low-priority messages, the ω value should be set larger to allow low-priority messages to obtain a larger frequency modulation step size.

[0025] S3, define the network load into partitions based on load rate and error count, and set frequency adjustment measures for each partition; the definition of network load partitions based on load rate and error count includes the following steps: when the load rate is higher than a or the error count increment exceeds the limit, it is defined as a high load zone; when the load rate is between a and b, it is defined as a second high load zone; when the load rate is between b and c, it is defined as a safe zone; when the load rate is lower than c, it is defined as a low load zone, where a=70%, b=50%, and c=20%.

[0026] The network load is divided into four zones based on load rate and error rate: high load zone (load rate above 70% / error count increment exceeds limit), medium load zone (load rate between 50% and 70%), safe zone (load rate between 20% and 50%), and low load zone (load rate below 20%). A corresponding frequency adjustment strategy is formulated for each load zone. Refer to Table 2 for the load zone definitions.

[0027] Table 2 Load Partition Definition load area Load range Frequency modulation strategy Core Objectives High load area (HH) >70% or error count increment exceeds limit Gradually reduce the frequency (pause low-priority packets). Quickly alleviate congestion and ensure the real-time performance of critical messages. Second highest load zone (H) 50%~70% Weighted frequency reduction (adjusting only low / medium priority packets) Preventative descent to avoid high load conditions Safe Zone (S) 20%~50% Maintain the current cycle and do not trigger frequency modulation. Maintain stable operation Low load area (L) <20% Weighted frequency increase (improving the update rate of non-critical messages) Improve data real-time performance and optimize bandwidth utilization S4: Obtain real-time load rate and error count, and determine whether the error count increment exceeds the limit or the load rate is greater than a. If so, identify it as a high load area and reduce the frequency step by step according to the CAN message level from high to low. If not, proceed to S5. refer to Figure 2 The stepwise frequency reduction based on CAN message level from high to low specifically includes the following steps: Level 1: Directly suspend the transmission of the lowest priority level messages. If the load rate is still greater than 'a', proceed to Level 2 adjustment; otherwise, exit the adjustment process. Level 2: Adjust the low-priority message period according to the frequency modulation parameters until the upper limit of the low-priority message period is reached. If the load rate is still greater than a, proceed to Level 3 adjustment; otherwise, exit the adjustment. Level 3: Adjust the medium-priority message period according to the frequency modulation parameters until the upper limit of the medium-priority message period is reached. If the load rate is still greater than a, proceed to Level 4 adjustment; otherwise, exit the adjustment. Level 4: The message periods of all priorities except the highest priority are locked at their corresponding maximum periods. A system-level alarm is reported, prompting the investigation of the root cause of the fault. If the load rate is less than d, the adjustment is exited; otherwise, the Level 4 adjustment continues. Here, d = ae, and e is the first hysteresis margin, where d = 65% and e = 5%.

[0028] The frequency reduction process for each priority level is as follows: Calculate the normalized load deviation ratio factor for the load partition: obtain the lower limit of the load rate, the upper limit of the load rate, and the real-time load rate of the load partition. Normalized load deviation ratio factor = (real-time load rate - lower limit of load rate) / (upper limit of load rate - lower limit of load rate). Calculate the frequency reduction weight = 1 + the frequency modulation parameter of the priority message × the normalized load deviation ratio factor of the load partition. The transmission cycle of the priority message after frequency reduction = the transmission cycle of the current priority message × the frequency reduction weight.

[0029] High load zone (HH, Load > 70% or error count increment exceeds limit): In the high load zone (load rate > 70%), bus bandwidth is close to saturation, posing a serious risk of congestion and even packet loss, and the number of error frames increases significantly. The system uses a tiered frequency reduction and priority isolation strategy to quickly release bandwidth resources, ensuring the real-time performance and reliability of high-priority packets and preventing network paralysis. High load zone triggering conditions: The load rate is measured to be > 70% for three consecutive times to avoid accidental triggering due to instantaneous spikes. High load zone frequency reduction strategy: Tiered frequency reduction, specifically including: Level 1: Directly suspend the transmission of 4-lowest priority messages and immediately release bandwidth. If the load rate is still >70% after Level 1 frequency modulation, then proceed to Level 2 frequency modulation.

[0030] Level 2: Adjust the period of low-priority messages (3-level), the adjustment formula is as follows: ; Among them, T new(3) T is the transmission period of the level 3 message after frequency reduction. current(3) This represents the current Level 3 message transmission period, where ω3 is the Level 3 message frequency modulation coefficient. Load current The current real-time load rate, Load HH_LL The lower limit of the load rate in the high load area (HH), Load HH_UL The maximum load rate for the high-load area (100%) is expressed as (Load-Load). HH_LL ) / (Load HH_UL -Load HH_LL The normalized load deviation scaling factor normalizes the excess portion of the network load rate starting from the high load area to the [0,1] interval, and then multiplies it by the frequency modulation coefficient to calculate the down-rate. Simultaneously, it is necessary to ensure that the period of the down-rate Level 3 message does not exceed its maximum period T. max(3) When the 3-low priority message period T new(3) Frequency modulation reaches its maximum period T max(3) After that, the second-level frequency regulation ends. If the load rate is still >70% when it ends, the third-level frequency regulation will begin.

[0031] Level 3: Adjust the message period for medium-priority (2-level) messages. The frequency adjustment formula is: ; Among them, T new(2) T is the transmission period of the Level 2 message after frequency reduction. current(2)ω2 represents the current Level 2 message transmission period, and ω2 is the Level 2 message frequency modulation coefficient. The other parameters are interpreted as above. When the Level 2-medium priority message period T... new(2) Frequency modulation reaches its maximum period T max(2) After that, the third-level frequency regulation ends. If the load rate is still >70% when it ends, the fourth-level frequency regulation will begin.

[0032] Level 4 (Mandatory Protection): Locks the message period of priority levels 1 to 4 to the corresponding maximum period T. max After triggering the fourth level of mandatory protection measures, a system-level alarm is simultaneously reported, prompting manual intervention to investigate the root cause of the fault.

[0033] High load zone exit condition: After frequency reduction, the calculated load rate is <65% (5% hysteresis margin). After exiting, enter the corresponding zone according to the current load rate.

[0034] S5, determine if the load rate is greater than b. If yes, identify it as the second highest load area and perform preventative frequency reduction. If not, proceed to S6. The preventive frequency reduction includes the following steps: successively reducing the frequency of low-priority and lowest-priority packets until it reaches the maximum period of the corresponding priority packets. After each frequency reduction, it is determined whether the load rate is less than f. If so, it is downgraded to the safe zone. If not, it is determined whether the load rate is greater than a. If so, it is upgraded to the high-load zone. If not, it continues to successively reduce the frequency of low-priority and lowest-priority packets. f=bg, and g is the second hysteresis margin, where f=45% and g=5%.

[0035] Second Highest Load Zone (H, Load ∈ 50%~70%): In the second highest load zone (H), low-priority traffic is proactively optimized. Only low-priority and lowest-priority packets are frequency-reduced by a limited margin. This prevents potential congestion risks, avoids the system from directly entering a high-load or even crashing state due to sudden traffic surges, and maximizes the bandwidth retention of important packets. Second Highest Load Zone Trigger Condition: A single detection load rate enters the 50%~70% range (allowing for rapid response to potential risks). Second Highest Load Zone Frequency Reduction Strategy: Preventative frequency reduction. The specific implementation steps are as follows: Packets with priority 2 and above do not participate in frequency adjustment; only priority 3-low priority and 4-lowest priority are adjusted. The frequency adjustment formula is: ; Among them, T new(i) T is the transmission period for priority i-level messages after frequency reduction. current(i) ω represents the transmission period of the current priority level i message. i For the frequency modulation coefficient of priority i-level messages, Load current The current real-time load rate, Load H_LL The lower limit of the load rate for the second highest load zone (H), Load H_ULThe upper limit of the load rate for the second highest load zone, expressed as (Load-Load H_LL ) / (Load H_UL -Load H_LL The normalized load deviation scaling factor normalizes the portion of the network load rate exceeding the second-highest load range to the [0,1] interval, then multiplies it by the frequency modulation coefficient to calculate the down-rate. Simultaneously, it is necessary to ensure that the period of the down-rate i-th level message does not exceed its maximum period T. max(i) .

[0036] Conditions for exiting the second-highest load zone: If the calculated load rate after frequency reduction is <45%, downgrade to the safe zone (5% hysteresis margin); if the calculated load rate is >70%, upgrade to the high load zone.

[0037] S6. Determine if the load rate is greater than c, where a>b>c. If yes, it is considered a safe zone and no frequency adjustment is needed. If no, it is considered a low load zone and frequency is increased in stages.

[0038] refer to Figure 3 The graded frequency upsampling in the low-load region specifically includes the following steps: S61, upsampling the frequency of messages of the second highest priority, medium priority, and low priority, and calculating the target period after a single upsampling; S62, calculate the theoretical load increment after each priority message is frequency-upgraded; S63, calculate the maximum allowable load rate increment; S64, calculates the predicted load rate after frequency upsampling; S65, Dynamic constraint on frequency increase: Determine whether the predicted load rate after frequency increase is less than or equal to the constraint threshold. If yes, proceed to S66. If no, reduce the frequency increase proportionally to ensure that the theoretical load rate increment after frequency increase does not exceed the maximum allowable load rate increment, and then proceed to S66. S66: Increase the frequency level step by step according to the message priority from high to low. After each frequency increase, check the load rate. If the load rate after the frequency increase is greater than h, where h=bj and j is the third hysteresis margin, where h=45% and j=5%, then immediately roll back the frequency increase adjustment of this round. If the load rate after the frequency increase is greater than or equal to k, where k=35%, then stop the frequency increase. If the load rate after the frequency increase is less than k, then execute the frequency increase of the next priority. S67: After each priority message completes a full frequency increase, if the load rate after the frequency increase is less than k, repeat S61 to S66; otherwise, stop the frequency increase and enter the safe zone.

[0039] The process of frequency increase for each priority level is as follows: Calculate the normalized load deviation ratio factor for the load partition: obtain the upper limit of the allowed load rate and the real-time load rate after frequency boosting for the load partition. Normalized load deviation ratio factor = (upper limit of allowed load rate - real-time load rate) / upper limit of allowed load rate. Calculate the upsampling weight = 1 - (1 - frequency modulation parameter of the priority message) × normalized load deviation ratio factor of the load partition. The transmission cycle of the priority message after frequency increase = the transmission cycle of the current priority message × the frequency increase weight.

[0040] Safe Zone (S, Load ∈ 20%~50%): In the safe zone (load rate 20%~50%), the network is in a stable operating state, and bandwidth utilization and data real-time performance are balanced. The system maintains the current packet cycle, does not trigger any frequency adjustment operations, focuses on status monitoring and trend prediction, and provides a buffer for potential load fluctuations. Safe Zone Trigger Condition: Load rate enters the 20%~50% range. No Frequency Adjustment Operation in the Safe Zone: All packets are sent according to the current cycle; Safe Zone Exit Condition: If the calculated load rate > 55%, upgrade to the second highest load zone; if the calculated load rate < 15%, downgrade to the low load zone (5% hysteresis margin).

[0041] Low load zone (L, Load < 20%): In a low load state of the CAN network (load rate < 20%), a fixed message cycle will lead to insufficient bandwidth utilization and decreased data real-time performance. The frequency increase strategy, by dynamically shortening the cycle of some non-critical messages, can improve data freshness, optimize bandwidth utilization, and reduce anomaly detection latency. Simultaneously, to ensure that the load rate remains within the safe zone (S) after frequency increase, it is necessary to dynamically predict load changes and limit the frequency increase amplitude during frequency adjustment. Low load zone trigger condition: load rate < 20% for 3 consecutive times, avoiding false triggering during brief periods of idle time; Low load zone frequency increase strategy: dynamic prediction, tiered frequency increase.

[0042] The following are the specific implementation steps: S61: Increase the frequency of priority messages of levels 1, 2, and 3, and calculate the target period after a single frequency increase. The calculation formula is as follows: ; Among them, T new(i) For the up-frequency target period of priority i-level messages, T current(i) ω represents the transmission period of the current priority level i message. i For the frequency modulation coefficient of priority i-level messages, Load S_MID This is the upper limit of the allowable load rate after frequency upsampling. The median load rate point of the safe zone (a / 2 = 35%) is selected as its value. current This represents the current real-time load rate. Simultaneously, it's necessary to ensure that the message period after frequency upsampling is not less than its minimum period T. min(i) 4. Lowest priority messages do not participate in frequency increase and maintain the original cycle.

[0043] S62: Introduces an upsampling amplitude prediction model to calculate the theoretical load increment ΔLoad after upsampling of each priority message. ; Among them, BitsPerFrame i ΣBitsPerFramei represents the number of bits per frame for a priority i message, where ΣBitsPerFramei represents the total number of bits for all priority i messages, and T represents the total number of bits per frame. new(i) T is the period after the frequency of priority i-level messages is increased. current(i) This represents the current period for priority i-level messages, BitRate represents the CAN bus baud rate, and TimeWindow represents the load statistics window (in seconds).

[0044] S63: Calculate the maximum allowable load rate increment ΔLoad max : ; Wherein, ΔLoad max For the maximum allowable load rate increment, Load S_MID This is the upper limit of the allowable load rate after frequency upsampling. The median load rate point (35%) of the safe zone is selected as its value. current This represents the current real-time load rate.

[0045] S64: Calculate the predicted load rate after frequency upsampling. predict : ; Among them, Load predict For the predicted load rate after frequency upsampling, Load current ΔLoad represents the current load rate, and ΔLoad represents the theoretical load increment calculated in step S2.

[0046] S65: Perform dynamic constraints on the upsampling amplitude, if Load predict ≤Constraint threshold, constraint threshold = 35%, frequency increase is allowed according to formula S1; if Load predict If the frequency increase is greater than 35%, the frequency increase amplitude needs to be reduced proportionally. The message period after reducing the frequency increase amplitude must meet the following requirements: ; Among them, T new(i) T is the up-frequency target period for the priority i-level message calculated in step S1. cut(i) For priority i messages, after reducing the frequency increase amplitude, the transmission period T current(i) This is the original cycle of a priority i-level message.

[0047] ; The formula for calculating the reduction scaling factor is: ; Among them, K cut(i)ω is the scaling factor for the frequency increase reduction of priority i messages. i For the frequency modulation coefficient of priority i-level messages, factor Ensure that the theoretical load increment after reducing the frequency upsampling does not exceed ΔLoad max .

[0048] The formula for calculating the message period after reducing the frequency upsampling amplitude is: ; Among them, T cut(i) For priority i messages, after reducing the frequency increase amplitude, the transmission period T current(i) For the current period of a priority i-level message, T new(i) The up-frequency target period for priority i-level messages calculated in step S1.

[0049] S66: Increment the frequency level step by step according to message priority from high to low, and monitor the load rate in real time after each frequency increase. If the load rate is >45% after the frequency increase, a 5% hysteresis margin is reserved to prevent instantaneous exceedance of the safety zone limit, and the frequency increase adjustment of this round is immediately rolled back; if the load rate is ≥35% after the frequency increase, the frequency increase is stopped; if the load rate is <35% after the frequency increase, the next level of frequency increase is executed.

[0050] S67: After each priority message completes a full frequency increase, if the load rate is still <35%, repeat steps S61~S66. Low load zone exit condition: If the calculated load rate after frequency increase is ≥35%, stop frequency increase and enter the safe zone.

[0051] A CAN bus message period adjustment system based on dynamic load balancing, employing the aforementioned CAN bus message period adjustment method based on dynamic load balancing, referenced... Figure 4 ,include: The real-time network load detection module is responsible for collecting and analyzing the communication status of the CAN bus in real time and quantifying the network load level. Specifically, it includes a bus load rate calculation unit for calculating the bus load rate within a unit time window, an error status monitoring unit for calculating the error count increment within a unit time, and a frame density statistics unit for counting the number of frames received within a unit time. The main controller is electrically connected to the network load real-time detection module, the message cycle dynamic adjustment module, and the message cycle adjustment execution module.

[0052] The message cycle dynamic adjustment module prioritizes and configures parameters for messages, defines network load partitions based on load rate and error count, formulates partition frequency adjustment strategies based on real-time data provided by the network load detection module, and dynamically adjusts the message sending cycle through algorithms. The message cycle adjustment execution module transmits the frequency modulation result output by the message cycle dynamic adjustment module to each slave node, monitors the execution status, and incorporates a feedback mechanism to achieve closed-loop control. Specifically, it includes an instruction encapsulation and broadcasting unit, an instruction parsing and execution unit, and an execution status monitoring and feedback unit. The message cycle adjustment execution module reliably transmits the frequency modulation results output by the dynamic adjustment module to each slave node and monitors its execution status to ensure the synchronization of the entire CAN network strategy. Simultaneously, a feedback mechanism is incorporated to achieve closed-loop control, avoiding deviations between expected results and actual execution. The following details the module's specific structure and implementation method, including: Command Encapsulation and Broadcast Unit: Based on a custom protocol, the master controller encapsulates and packages the frequency modulation results from the dynamic adjustment module and sends them to each slave node in the network. Referring to Table 3, the command format of the frequency modulation message is as follows: [Command Type][Target Node Address][Target Message Type][New Cycle Value][Effective Time Offset][CRC8]; Table 3 Frequency Modulation Command Format Table content length illustrate Instruction type 1 Byte 0x01 = Periodic Adjustment; 0x02 = Priority Switching; 0x03 = Restore Defaults Target node address 1 Byte Uniquely identifies the target node to avoid misreceiving commands; supports broadcast mode, adjusting all nodes simultaneously. Target message type 1 Byte Specify the specific message types that need to be adjusted in the target node. New cycle value 2 Byte The new transmission period of the target message, in milliseconds. Effective time offset 2 Byte This indicates the delay time from the moment the instruction is received, in milliseconds (ms). 0 = immediate effect. CRC8 1 Byte Verify the first 7 bytes of the frequency modulation command. Command parsing and execution unit: Each slave node in the network is responsible for receiving and verifying frequency modulation commands, and updating the local message sending cycle according to the command content to ensure the accuracy and timeliness of the adjustment action.

[0053] (1) Command reception and filtering: The slave node listens to the CAN bus and captures the message with the ID of the frequency modulation command special frame. Check the target node address field in the command. If it is a broadcast address, all nodes process the command; if it is a single-point address, only the matching node processes it.

[0054] (2) Data verification: The slave node calculates the CRC8 value of the first 7 bytes of the frequency modulation instruction frame and compares it with the last byte of the instruction. If the match fails, the data is discarded.

[0055] (3) Message matching and parameter checking: The slave node queries the local adjustable frequency message whitelist (pre-configured or dynamically registered) according to the target message type, and verifies whether the new cycle value of the instruction is within the range of Tmin / Tmax. If it exceeds the limit, it will be automatically clamped to the boundary value.

[0056] (4) Execute frequency adjustment: If the effective time offset = 0, switch to a new cycle immediately; if the effective time offset > 0, start the timer, set the timer value to the effective time offset, and switch the cycle after the timer ends.

[0057] (5) Error handling: If the target message type does not exist, record the error log and reply with a negative response (NACK); if the frequency modulation fails 3 times in a row, switch to safe mode (send at a fixed period).

[0058] Execution status monitoring and feedback unit: The main controller tracks the command execution results in real time and forms a closed-loop control through the feedback mechanism to ensure the consistency and reliability of the frequency regulation strategy of the entire network.

[0059] (1) Feedback protocol design: For each slave node in the network, the instruction execution result needs to be fed back to the master node. If the frequency modulation is successful, the success status and the actual effective period value should be fed back. If the frequency modulation fails, the reason for the failure should be replied. Referring to Table 4, the designed ACK / NACK frame format is as follows: [Original Instruction Type][Execution Status][Current Cycle Value][CRC8]; Table 4 ACK / NACK Frame Format Table content length illustrate Original instruction type 1 Byte Consistent with the received instruction Execution status 1 Byte 0x00 = Success, 0x01 = Invalid message type, 0x02 = Period out of bounds, 0x03 = CRC error Effective period value 2 Byte Actual effective period CRC8 1 Byte Verify the first 4 bytes of data (2) Monitoring and closed-loop control strategy: The master controller monitors the feedback status of the slave node in real time. If a NACK is received, the frequency modulation command is regenerated (such as changing the message type) and resent. If the slave node does not respond within the timeout period, the slave node is marked as "offline" and an alarm is triggered.

[0060] Based on the feedback status from each node, the master control node calculates the command delivery rate and execution success rate to monitor node health. Furthermore, the master control node stores frequency modulation commands and feedback data in its local historical logs, supporting fault rollback.

[0061] This system also includes a collaborative monitoring node, a dedicated hardware node independent of the master and slave controllers, providing global network status monitoring and coordination. This independent hardware node performs load analysis and broadcasts global load status via a custom protocol, providing load prediction suggestions to the master controller to assist in decision-making. In the event of a master controller failure, the collaborative monitoring node can temporarily take over load balancing tasks. Example 2:

[0062] This embodiment details the specific implementation method of the present invention in a master-slave architecture of a battery management system (BMS) based on embodiment 1.

[0063] In this embodiment, the BMS system consists of one master controller and N=10 slave controllers. The slave controllers are responsible for collecting data such as battery cell voltage and temperature, and periodically reporting this data to the master controller via the CAN bus. The master controller monitors the CAN bus load in real time and dynamically adjusts the slave controller message transmission cycle to achieve network load balancing. The hardware configuration of this embodiment is as follows: The main controller (Master) uses the NXP S32K14x series hardware core chip (integrated CAN FD controller, supports dual-channel CAN bus, main frequency 120MHz); the CAN transceiver uses TJA1043 (supports CAN FD, transmission rate up to 5Mbps); the auxiliary module adds external SRAM (1MB) to store historical load data and adjust strategy parameters.

[0064] The slave controller hardware core chip uses the STMicroelectronics STM32G473 (integrated CAN2.0B controller, 170MHz main frequency); the battery sampling circuit is the LTC6813-1 (supporting 12-channel voltage / temperature acquisition, SPI interface for communication with the MCU); the CAN transceiver is the TJA1050 (standard CAN transceiver, 1Mbps rate). The CAN network topology uses a linear topology, with a 120Ω terminating resistor and a baud rate set to 500kbps (standard frame format).

[0065] The software implementation in this embodiment is as follows: For different types of CAN messages during BMS master-slave controller communication, priority levels, CAN ID ranges, and minimum period T are predefined. min Maximum period T max The value of the frequency modulation coefficient ω parameter is shown in Table 5.

[0066] Table 5. Comparison of Priority Levels with CAN ID Range and Frequency Modulation Cycle Range Priority level CAN ID range <![CDATA[Minimum period (T min )]]> <![CDATA[Maximum period (T max )]]> Frequency modulation coefficient ω Application message example 0 - Highest priority 0x000~0x0FF 20ms 20ms - Emergency fault alarm 1-High priority 0x100~0x1FF 20ms 100ms 0.1 Real-time control commands 2-Medium Priority 0x200~0x3FF 100ms 500ms 0.4 Battery parameter information 3-Low priority 0x400~0x5FF 500ms 1000ms 0.8 Historical data log 4-Lowest Priority 0x600~0x7FF 1000ms ∞ 1.0 Debug print information In this embodiment, a BMS application message is used as an example to explain the parameters of each level in detail. For example, the emergency fault alarm (ID=0x0**, where ** is the slave address, ranging from 0x01 to 0x0A) is set as a 0-highest priority message, with a fixed period of 20ms and no frequency adjustment is allowed; Set the real-time control command (ID=0x1**) to a high priority level message (1), period T=50ms, frequency modulation range [20ms, 100ms], frequency modulation coefficient to 0.1, and limit it to a small frequency modulation step size; Set battery parameter information (such as battery voltage information, ID=0x2**) to a medium priority level 2 message, period T=200ms, frequency modulation range [100ms, 500ms], and frequency modulation coefficient to 0.4; Set the historical data log information (ID=0x5**) to a 3-low priority level message, with a period T=500ms, a frequency modulation range [500ms, 1000ms], and a frequency modulation coefficient of 0.8 to obtain a larger frequency modulation step size; Set the debugging print message (ID=0x7**) to a 4-lowest priority message, period T=1000ms, frequency range [1000ms,∞), and maximum period T. max =∞ represents stopping transmission. Setting the frequency modulation coefficient to 1.0 will obtain the maximum amplitude frequency modulation step size.

[0067] Then, the network load is divided into four zones according to the load rate and error rate: high load zone (load rate above 70% / error count increment exceeds limit), second highest load zone (load rate between 50% and 70%), safe zone (load rate between 20% and 50%), and low load zone (load rate below 20%). A corresponding frequency adjustment strategy is formulated for each load zone. For details on the load zone definition, please refer to Table 2 of the invention.

[0068] After completing the pre-definition of all BMS packet priority and other parameters and the definition of load partitions, the partition frequency adjustment strategy is executed based on the load rate and error count calculated by the real-time network load detection module.

[0069] In one specific implementation scenario of this invention, the network load module calculates and outputs a load rate of 80%. Since 80% > 70%, it falls within the high load zone (HH), triggering a step-by-step frequency reduction strategy for the high load zone. The specific frequency adjustment process is as follows: Level 1: Directly suspend the transmission of 4-lowest priority messages and immediately release bandwidth. The network module recalculates the load rate, which drops to 78%. Since 78% is still higher than the lower limit of 70% in the high load zone, it enters Level 2 frequency adjustment. Level 2: Adjust the message cycle for 3-low priority level messages.

[0070] In this embodiment, taking historical data log information (ID=0x5**) as an example, its initial period T current(3) =700ms, the frequency modulation formula is: ; The new cycle after the first frequency adjustment of historical data log information messages is calculated using the above formula: ; After the first frequency adjustment, the new message period was set to 850ms. The load rate recalculated by the real-time network load detection module decreased to 75%, which did not meet the exit condition for the high load zone. Therefore, frequency adjustment for this message continued. ; After the second frequency adjustment, the new message period was adjusted to 825ms. The load rate was recalculated as 73% > 65%, so the frequency of this message was adjusted again. ; After three frequency adjustments, the period of the historical data log message reaches the maximum value of 1000ms for the 3-low priority level message period. At this time, the load rate is calculated to be 72%, which still does not meet the exit condition of the high load area, so it enters the third level of frequency adjustment.

[0071] Level 3: Adjust the message cycle for 2-medium priority level.

[0072] In this embodiment, taking battery parameter information (ID=0x2**) as an example, its initial period T current(2) =400ms, the frequency modulation formula is: ; The new cycle and corresponding real-time load rate of the battery parameter information message after each frequency adjustment are calculated according to the above formula as follows: Load current =72%; Load current =72%; ... Load current =71%; Load current =71%; After 10 frequency adjustments, the battery parameter information message period reached the maximum value of 500ms for the 2-medium priority level message period. At this time, the calculated load rate was 71% > 70%, which still did not meet the exit condition for the high load area. Therefore, it entered the fourth level of frequency adjustment.

[0073] Level 4 (Mandatory Protection): Locks the message period of priority levels 1 to 4 to the corresponding maximum period T. max : ; In this embodiment, the message period of the real-time control command (priority 1) is forcibly locked. Battery parameter information (priority 2) message cycle Historical data log message cycle (priority 3) The message cycle of debug print information (priority 4) .

[0074] After the fourth level of frequency adjustment, the load rate calculated by the real-time network load monitoring module dropped to 65%, successfully exiting the high-load zone. Furthermore, after triggering the fourth level of mandatory protection measures, the main controller simultaneously reported a system-level alarm, prompting manual intervention to investigate the root cause of the fault.

[0075] The above embodiments illustrate the specific frequency reduction strategy when the initial network load rate is in the high load zone. As another specific implementation scenario of the present invention, the load rate calculated and output by the network load module is 15%. 15% < 20%, which belongs to the low load zone (L), triggering the frequency increase strategy in the low load zone. The specific frequency adjustment process is as follows: S1: Increase the frequency of priority messages of levels 1, 2, and 3, and calculate the target period after a single frequency increase using the following formula: ; In this embodiment, the target cycle for a single frequency boost is calculated for real-time control commands (1-high priority), battery parameter information (2-medium priority), and historical data logs (3-low priority), respectively: ; ; ; S2: Introduce an upsampling amplitude prediction model to calculate the theoretical load increment ΔLoad after upsampling of each priority message. calc : ; In this embodiment, BMS messages are all standard frames with 8-byte data segments, therefore the number of bits per frame is BitsPerFrame. i =108. Based on the message level classification, parameter definition table, and number of slave controllers, the total number of bits for priority i-level messages can be calculated sequentially. The CAN bus baud rate is BitRate = 250Kbps, and the load statistics window is set to 1s. Substituting these parameters into the frequency ramp-up prediction model, the theoretical load increment ΔLoad is calculated. calc =21%.

[0076] S3: Calculate the maximum allowable load rate increment ΔLoad max : ; S4: Calculate the predicted load rate after frequency upsampling. predict and maximum allowable load rate increment ΔLoad max : ; S5: Perform dynamic constraints on the frequency ramp-up amplitude, due to Load predict Load S_MID (35%), the frequency increase amplitude needs to be reduced proportionally. Taking the real-time control command (ID=0x100) as an example, calculate its reduction factor: ; Calculate the message period after reducing the upsampling amplitude: ; It can be seen that the period after reducing the frequency upsampling amplitude satisfies Similarly, T can be calculated based on the given conditions. cut(2) =173ms and T cut(3) =500ms.

[0077] S6: Increment the frequency of messages from high to low priority, and monitor the load rate in real time after each increment. In this embodiment, the frequency of real-time control command (1-high priority) messages is increased first, and the load rate increases to 18% < 35% after the increment; then the frequency of battery parameter information (2-medium priority) messages is increased, and the load rate increases to 21% < 35% after the increment; finally, the frequency of historical data log (3-low priority) messages is increased. Since the original period of the historical data log messages is already the minimum period of the 3-low priority messages, i.e., T... current(3) =T min(3) Therefore, no frequency increase is performed, and the load rate remains at 21% of the previous frequency increase level.

[0078] S7: After completing a full frequency upsampling cycle, the load rate is calculated to be 21%, which is still less than 35%. Therefore, repeat steps S1 to S6 until the load rate no longer meets the frequency upsampling conditions.

[0079] The specific execution of the aforementioned frequency modulation strategy requires the message period adjustment execution module. This module reliably transmits the frequency modulation results output by the dynamic adjustment module to each slave node and monitors their execution status to ensure the synchronization of the entire CAN network strategy. Simultaneously, a feedback mechanism is incorporated to achieve closed-loop control, preventing deviations between expected and actual results.

[0080] The following explanation will focus on the frequency reduction operation for battery parameter information messages in Scenario 1 above: The initial period T of the known battery parameter information (ID=0x2**) message current(2) =400ms, the expected period after the first frequency reduction calculation is T. new(2) =410ms, therefore the main controller needs to adjust the battery parameter information message period of all slave devices (0x01~0x0A) to 410ms.

[0081] S1: Command Encapsulation. The main controller encapsulates and packages the frequency modulation results from the dynamic adjustment module and sends them to each slave node in the network. The encapsulated frequency modulation command is as follows:

[01] [FF]

[01] [019A]

[0000] [0E]; Wherein: Instruction type = 0x01, representing period adjustment; Target node address = 0xFF, broadcast mode, representing simultaneous adjustment of all slave devices on the bus (0x01~0x0A); Target message type = 0x01, in this example 0x01 represents battery parameter information type message; New period value = 0x019A = 410ms; Effective time offset = 0x0000, indicating that the instruction takes effect immediately after being received, without delay; CRC8 = 0x0E, verifying the first 7 bytes.

[0082] S2: Slave node receives and executes commands. The slave listens for and captures the broadcast frequency modulation command, calculates the CRC8 value of the first 7 bytes of the command, and compares it with the last byte of the command (0x0E) to confirm a successful match. It confirms that the target message type 0x01 exists in the local adjustable frequency message whitelist, and that the new cycle 410ms is within the (Tmin, Tmax) range of this message. The cycle of the battery parameter information message is updated to 410ms. Since the effective time offset is 0, frequency reduction is immediately executed, switching to the new cycle value.

[0083] S3: Execution status monitoring and feedback. The slave node sends the command execution results back to the master controller node, replying with an ACK frame as follows: [0x01][0x00][019A][CC]; Where: Original instruction type = 0x01, consistent with the received instruction, representing period adjustment; Execution status = 0x00, representing successful frequency modulation; Current period value, 0x019A = 410ms; CRC8 = 0xCC, verifying the first 4 bytes.

[0084] The master controller monitors the feedback status of slave nodes in real time, calculates command delivery rate and execution success rate, and monitors node health. Furthermore, the master controller stores frequency modulation commands and feedback data in a local historical log, supporting fault traceability.

[0085] The above are all preferred embodiments of this application and are not intended to limit the scope of protection of this application. Therefore, all equivalent changes made in accordance with the structure, shape and principle of this application should be covered within the scope of protection of this application.

Claims

1. A method for adjusting the CAN bus message period based on dynamic load balancing, characterized in that, Includes the following steps: S1, divides CAN message levels into several categories based on the CAN ID range; S2, set the adjustment cycle range and frequency modulation parameters for each CAN message level; S3 defines network load partitions based on load rate and error count, and sets frequency adjustment measures for each partition; S4: Obtain real-time load rate and error count, and determine whether the error count increment exceeds the limit or the load rate is greater than a. If so, identify it as a high load area and reduce the frequency step by step according to the CAN message level from high to low. If not, proceed to S5. S5, determine if the load rate is greater than b. If yes, identify it as the second highest load area and perform preventative frequency reduction. If not, proceed to S6. S6. Determine if the load rate is greater than c, where a>b>c. If yes, it is considered a safe zone and no frequency adjustment is needed. If no, it is considered a low load zone and frequency is increased in stages.

2. The method for adjusting the CAN bus message period based on dynamic load balancing according to claim 1, characterized in that, The CAN message levels, from highest to lowest, are highest priority, second highest priority, medium priority, low priority, and lowest priority. The period of the highest priority message is fixed. The adjustment period range of the second highest priority, medium priority, low priority, and lowest priority messages includes the minimum period and the maximum period. The frequency modulation parameter of each CAN message level gradually increases from high to low according to the priority level.

3. The method for adjusting the CAN bus message period based on dynamic load balancing according to claim 1, characterized in that, The method of defining network load partitioning based on load rate and error count includes the following steps: a load rate higher than a or an error count increment exceeding the limit is defined as a high load zone; a load rate between a and b is defined as a second-highest load zone; a load rate between b and c is defined as a safe zone; and a load rate lower than c is defined as a low load zone.

4. The method for adjusting the CAN bus message period based on dynamic load balancing according to claim 2, characterized in that, The step-by-step frequency reduction based on CAN message level from high to low specifically includes the following steps: Level 1: Directly suspend the transmission of the lowest priority level messages. If the load rate is still greater than 'a', proceed to Level 2 adjustment; otherwise, exit the adjustment process. Level 2: Adjust the low-priority message period according to the frequency modulation parameters until the upper limit of the low-priority message period is reached. If the load rate is still greater than a, proceed to Level 3 adjustment; otherwise, exit the adjustment. Level 3: Adjust the medium-priority message period according to the frequency modulation parameters until the upper limit of the medium-priority message period is reached. If the load rate is still greater than a, proceed to Level 4 adjustment; otherwise, exit the adjustment. Level 4: The message cycles of all priorities except the highest priority are locked at their corresponding maximum cycles. If the load rate is less than d, the adjustment is exited; otherwise, the Level 4 adjustment continues, where d = ae and e is the first hysteresis margin.

5. The method for adjusting the CAN bus message period based on dynamic load balancing according to claim 4, characterized in that, The fourth level also includes the following steps: reporting system-level alarms and prompting investigation of the root cause of the fault.

6. The method for adjusting the CAN bus message period based on dynamic load balancing according to claim 2, characterized in that, The preventive frequency reduction includes the following steps: successively reducing the frequency of low-priority and lowest-priority packets until it reaches the maximum period of the corresponding priority packets. After each frequency reduction, it is determined whether the load rate is less than f. If so, it is downgraded to the safe zone. If not, it is determined whether the load rate is greater than a. If so, it is upgraded to the high-load zone. If not, it continues to successively reduce the frequency of low-priority and lowest-priority packets. f=bg, where g is the second hysteresis margin.

7. The method for adjusting the CAN bus message period based on dynamic load balancing according to claim 2, characterized in that, The graded frequency upsampling in the low-load region specifically includes the following steps: S61, upsampling the frequency of messages of the second highest priority, medium priority, and low priority, and calculating the target period after a single upsampling; S62, calculate the theoretical load increment after each priority message is frequency-upgraded; S63, calculate the maximum allowable load rate increment; S64, calculates the predicted load rate after frequency upsampling; S65, Dynamic constraint on frequency increase: Determine whether the predicted load rate after frequency increase is less than or equal to the constraint threshold. If yes, proceed to S66. If no, reduce the frequency increase proportionally to ensure that the theoretical load rate increment after frequency increase does not exceed the maximum allowable load rate increment, and then proceed to S66. S66, according to the message priority from high to low, the frequency is increased step by step. After each frequency increase, the load rate is checked. If the load rate after the frequency increase is greater than h, h=bj, j is the third hysteresis margin, then the frequency increase adjustment of this round is immediately rolled back; if the load rate after the frequency increase is greater than or equal to k, then the frequency increase is stopped; if the load rate after the frequency increase is less than k, then the frequency increase of the next priority is executed. S67: After each priority message completes a full frequency increase, if the load rate after the frequency increase is less than k, repeat S61 to S66; otherwise, stop the frequency increase and enter the safe zone.

8. A method for adjusting the CAN bus message period based on dynamic load balancing according to any one of claims 4-7, characterized in that, The frequency reduction process for each priority level is as follows: Calculate the normalized load deviation ratio factor for the load partition: obtain the lower limit of the load rate, the upper limit of the load rate, and the real-time load rate of the load partition. Normalized load deviation ratio factor = (real-time load rate - lower limit of load rate) / (upper limit of load rate - lower limit of load rate). Calculate the frequency reduction weight = 1 + the frequency modulation parameter of the priority message × the normalized load deviation ratio factor of the load partition. The transmission cycle of the priority message after frequency reduction = the transmission cycle of the current priority message × the frequency reduction weight.

9. A method for adjusting the CAN bus message period based on dynamic load balancing according to any one of claims 4-7, characterized in that, The process of frequency increase for each priority level is as follows: Calculate the normalized load deviation ratio factor for the load partition: obtain the upper limit of the allowed load rate and the real-time load rate after frequency boosting for the load partition. Normalized load deviation ratio factor = (upper limit of allowed load rate - real-time load rate) / upper limit of allowed load rate. Calculate the upsampling weight = 1 - (1 - frequency modulation parameter of the priority message) × normalized load deviation ratio factor of the load partition. The transmission cycle of the priority message after frequency increase = the transmission cycle of the current priority message × the frequency increase weight.

10. A CAN bus message period adjustment system based on dynamic load balancing, employing the CAN bus message period adjustment method based on dynamic load balancing as described in claim 1, characterized in that... include: The real-time network load detection module is responsible for collecting and analyzing the communication status of the CAN bus in real time and quantifying the network load level. Specifically, it includes a bus load rate calculation unit for calculating the bus load rate within a unit time window, an error status monitoring unit for calculating the error count increment within a unit time, and a frame density statistics unit for counting the number of frames received within a unit time. The message cycle dynamic adjustment module prioritizes and configures parameters for messages, defines network load partitions based on load rate and error count, formulates partition frequency adjustment strategies based on real-time data provided by the network load detection module, and dynamically adjusts the message sending cycle through algorithms. The message cycle adjustment execution module transmits the frequency modulation result output by the message cycle dynamic adjustment module to each slave node, monitors the execution status, and incorporates a feedback mechanism to achieve closed-loop control. Specifically, it includes an instruction encapsulation and broadcasting unit, an instruction parsing and execution unit, and an execution status monitoring and feedback unit. The main controller is electrically connected to the network load real-time detection module, the message cycle dynamic adjustment module, and the message cycle adjustment execution module.

Citation Information

Patent Citations

  • CAN bus data processing method and control system

    CN109960177A

  • Engineering machinery and network optimization method and device thereof

    CN112769714A

  • Method and device for dynamically adjusting CAN (Controller Area Network) bus load rate based on vehicle-mounted ECU (Electronic Control Unit), processor and storage medium

    CN118200073A

  • Multi-level caching method and system based on CAN bus communication

    CN119788456A

  • Device for unified data interaction with external system based on load balancing

    CN119892740A

Cited By

  • Heartbeat packet-based BMS broadcast interval dynamic adjustment method and device, computer equipment and storage medium

    CN121619190A

  • Data transmission method and system, variable frequency water-cooled unit and readable storage medium

    CN122475974A

  • Can bus message cycle adjustment method and system based on dynamic load balancing

    WO2026032463A3