A method and system for managing redundancy of device group control based on CAN bus

CN122525872APending Publication Date: 2026-08-07ANHUI ZHONGKE ZHONGHUAN INTELLIGENT EQUIP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ANHUI ZHONGKE ZHONGHUAN INTELLIGENT EQUIP CO LTD
Filing Date
2026-07-10
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

(1)心跳同步采用固定周期,多主同时发送易造成总线冲突,或需复杂的冲突检测与退避算法;

Benefits of technology

[0013]本发明中,所提出的基于CAN总线的设备群控冗余管理方法和系统,在所有设备上电时,所有设备作为在线的从机进入等待状态,并监测是否接收到心跳帧;若某一从机在等待状态结束前接收到心跳帧,则该从机继续作为从机;若所有从机在等待状态结束时均未接收到心跳帧,则分别根据各自的ID、预设的偏移量和基础周期计算各自的心跳发送周期,并分别开始计时;其中,心跳发送周期T=基准周期+ID×偏移量,等待状态的时长小于偏移量,偏移量小于基准周期;若某一从机在其计时达到心跳发送周期时未接收到心跳帧,则立即通过CAN总线向其余从机发送心跳帧,以竞争成为主机;若某一从机在其计时达到心跳发送周期之前接收到心跳帧,则继续作为从机;主机按照其心跳发送周期向所有从机下发心跳帧,每个在线的从机按照基准周期向主机上报状态帧。由于各设备ID不同,心跳周期被自然错开,有效防止多机同时发送导致的仲裁失败,主机离线后可快速确定地选出新主机;而且,主机根据所有在线的从机的状态帧,构建或更新设备状态表;根据设备状态表,实时判断是否满足决策触发条件;若是,则启动主机决策与切换控制流程,兼顾实时性与可靠性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122525872A_ABST
    Figure CN122525872A_ABST
Patent Text Reader

Abstract

The application discloses a kind of CAN bus-based equipment group control redundancy management method and system, it is related to redundancy control field, comprising: determining host and slave from multiple devices;Host sends heartbeat frame to all online slaves according to its heartbeat sending period, and each online slave reports state frame to host according to reference period;Host constructs or updates device state table according to the state frame of all online slaves;According to device state table, whether decision trigger condition is satisfied is judged in real time;If yes, then start host decision and switching control process.The application can effectively prevent arbitration failure caused by simultaneous sending of multiple machines, and a new host can be quickly determined after the host is offline;Moreover, host decision and switching control are carried out according to device state table, and real-time performance and reliability are considered.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial equipment group control and redundancy control technology, and in particular to a method and system for equipment group control redundancy management based on CAN bus. Background Technology

[0002] In scenarios such as data centers and industrial cooling, multiple similar devices (such as CDUs) often need to work collaboratively. Existing group control solutions typically employ fixed master-slave relationships or simple arbitration mechanisms, which have the following shortcomings: (1) Heartbeat synchronization uses a fixed period. Multiple masters sending at the same time can easily cause bus conflicts, or require complex conflict detection and backoff algorithms; (2) Fault switching is based solely on the simple "faulty / no fault" without considering the differences in fault levels, which may result in equipment in slightly worse condition running for a long time while healthier equipment is left idle; (3) When multiple devices are fault-free, one device is often fixed to operate while the other devices are kept on standby, resulting in uneven wear of the operating devices and a reduction in overall lifespan. (4) The lack of an immediate response mechanism for events such as the dynamic addition of new equipment and changes in fault level means that switching decisions are either too frequent and cause oscillations, or the response is slow. Summary of the Invention

[0003] To address the technical problems existing in the background art, this invention proposes a device group control redundancy management method and system based on CAN bus.

[0004] Firstly, the present invention proposes a device group control redundancy management method based on a CAN bus, applicable to multiple similar device groups connected via CAN bus communication, wherein each device has a unique identifier ID, characterized in that it includes: The master and slave devices are determined from multiple devices; the process of determining the master and slave devices includes: all devices are powered on and enter a waiting state as online slave devices, and monitor whether a heartbeat frame is received; When the waiting state ends, if none of the slave devices have received a heartbeat frame, they will calculate their respective heartbeat transmission period based on their ID, preset offset, and base period, and start timing accordingly. The heartbeat transmission period T = base period + ID × offset. The duration of the waiting state is less than the offset, and the offset is less than the base period. If a slave device fails to receive a heartbeat frame when its timer reaches the heartbeat transmission cycle, it immediately sends a heartbeat frame to the other slave devices via the CAN bus to compete for becoming the master. If a slave device receives a heartbeat frame before its timer reaches the heartbeat transmission period, it continues to act as a slave device. The master sends heartbeat frames to all online slaves according to its heartbeat sending cycle, and each online slave reports a status frame to the master according to the reference cycle. The host constructs or updates the device status table based on the status frames of all online slaves; Based on the equipment status table, determine in real time whether the decision triggering conditions are met; If so, then initiate the host decision and switching control process.

[0005] Preferably, during operation, if all online slave devices have not received a heartbeat frame from the master when the waiting time after receiving the previous heartbeat frame reaches the preset waiting time, they calculate their respective heartbeat transmission cycles based on their IDs, preset offsets, and base cycles, and start timing accordingly. If a slave device does not receive a heartbeat frame when its timing reaches the heartbeat transmission cycle, it immediately sends a heartbeat frame to the other slave devices via the CAN bus to compete for becoming the master. If a slave device receives a heartbeat frame before its timing reaches the heartbeat transmission cycle, it continues to act as a slave device. The preset waiting time is greater than two base cycles, and the maximum value of the heartbeat transmission cycle is less than two base cycles.

[0006] Preferably, the heartbeat frame includes: operating parameters and fault level, the operating parameters including pump frequency and valve opening degree; the status frame includes operating status, fault level and operating parameters, the operating status is divided into running and stopped; The fault levels are divided into three levels: Level 1, Level 2, and Level 3. The lower the fault level, the healthier the equipment.

[0007] Preferably, the decision triggering condition includes any one of the following: The interval between the current moment and the start time of the last decision reaches a preset interval; wherein, the preset interval is greater than the preset waiting time; A new slave device has come online; When traversing the device status table, it was found that the fault level of any device had changed. The number of devices currently in operation is not 1.

[0008] Preferably, the host decision-making and switching control process is initiated, specifically including: Based on the device status table, count the number of online devices; Determine if the number of online devices is 1; if yes, start or continue running the current host; if no, determine if the number of online devices is greater than or equal to 2; if yes, compare the fault level of the current host with that of the online slaves; the lower the fault level value, the healthier the device. If the lowest fault level of the online slave is lower than the fault level of the current master, the current master will stop and send a start command and corresponding operating parameters to the slave corresponding to the lowest fault level. The slave corresponding to the lowest fault level will then take over as the new master. If the current host has the lowest fault level, the current host continues to run and sends a stop command to all online slaves; When the fault level of all online slave devices is the same as that of the current master device, the ID of the current master device is recorded, and the start command and corresponding operating parameters are sent to each online slave device in sequence according to the preset operating cycle, so that the current master device and each online slave device can rotate in turn; wherein, the preset operating cycle is longer than the preset interval time.

[0009] Preferably, after a new host takes over operation, the current host, which is acting as a slave, sets a waiting timer period during which it suspends triggering new operation count statistics and switching decisions; wherein, the waiting timer period is the same as the duration of the waiting state.

[0010] Preferably, the base period is 500ms, the offset is 50ms, the preset waiting time is 1100ms, the preset interval time is 10min, and the preset running cycle is 24h.

[0011] Secondly, the present invention also proposes a CAN bus-based device group control redundancy management system for implementing the CAN bus-based device group control redundancy management method described in any one of the first aspects, comprising: The master-slave determination module is used to identify the master and slave devices from multiple devices. The process of determining the master and slave includes: all devices powering on and entering a waiting state as online slaves, and monitoring whether a heartbeat frame is received; when the waiting state ends, if none of the slaves have received a heartbeat frame, they calculate their respective heartbeat transmission period based on their ID, preset offset, and base period, and start timing accordingly; the heartbeat transmission period T = base period + ID × offset, the waiting state duration is less than the offset, and the offset is less than the base period; if a slave device does not receive a heartbeat frame when its timer reaches the heartbeat transmission period, it immediately sends a heartbeat frame to the other slaves via the CAN bus to compete for the master position; if a slave device receives a heartbeat frame before its timer reaches the heartbeat transmission period, it continues to act as a slave. The status synchronization module is used to send heartbeat frames to all slave devices according to the master's heartbeat sending cycle, and each online slave device reports status frames to the master according to the reference cycle; the master uses the status frames of all online slave devices to build or update the device status table. The decision module is used to determine in real time whether the decision triggering conditions are met based on the device status table; if so, the host decision and switching control process is initiated.

[0012] Preferably, the host decision-making and switching control process is initiated, specifically including: Based on the device status table, count the number of online devices; Determine if the number of online devices is 1; if yes, start or continue running the current host; if no, determine if the number of online devices is greater than or equal to 2; if yes, compare the fault level of the current host with that of the online slaves; the lower the fault level value, the healthier the device. If the lowest fault level of the online slave is lower than the fault level of the current master, the current master will stop and send a start command and corresponding operating parameters to the slave corresponding to the lowest fault level. The slave corresponding to the lowest fault level will then take over as the new master. If the current host has the lowest fault level, the current host continues to run and sends a stop command to all online slaves; When the fault level of all online slave devices is the same as that of the current master device, the ID of the current master device is recorded, and the start command and corresponding operating parameters are sent to each online slave device in sequence according to the preset operating cycle, so that the current master device and each online slave device can rotate in turn.

[0013] In this invention, the proposed CAN bus-based device group control redundancy management method and system, when all devices are powered on, all devices enter a waiting state as online slaves and monitor whether a heartbeat frame is received. If a slave receives a heartbeat frame before the waiting state ends, it continues to act as a slave. If none of the slaves receive a heartbeat frame by the end of the waiting state, they calculate their respective heartbeat transmission periods based on their ID, preset offset, and base period, and start timing accordingly. The heartbeat transmission period T = base period + ID × offset, where the waiting state duration is less than the offset and the offset is less than the base period. If a slave does not receive a heartbeat frame when its timing reaches the heartbeat transmission period, it immediately sends a heartbeat frame to the other slaves via the CAN bus to compete for the master position. If a slave receives a heartbeat frame before its timing reaches the heartbeat transmission period, it continues to act as a slave. The master sends heartbeat frames to all slaves according to its heartbeat transmission period, and each online slave reports a status frame to the master according to the base period. Because each device has a different ID, the heartbeat cycles are naturally staggered, effectively preventing arbitration failures caused by multiple devices sending simultaneously. After the host goes offline, a new host can be quickly and accurately selected. Moreover, the host builds or updates the device status table based on the status frames of all online slave devices. Based on the device status table, it determines in real time whether the decision triggering conditions are met. If so, the host decision and switching control process is initiated, taking into account both real-time performance and reliability. Attached Figure Description

[0014] Figure 1 This is a schematic diagram illustrating the connection between a CAN bus and multiple devices in one embodiment of the present invention.

[0015] Figure 2 This is a schematic diagram of the heartbeat transmission cycle when all devices compete for the master position as slaves in one embodiment of the present invention.

[0016] Figure 3 This is a schematic diagram of the period of heartbeat frames and status frames in one embodiment of the present invention.

[0017] Figure 4 This is a schematic diagram of the period of the heartbeat frame and the status frame in another embodiment of the present invention. Detailed Implementation

[0018] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.

[0019] Firstly, this invention proposes a device group control redundancy management method based on a CAN bus, applicable to multiple similar devices connected via CAN bus communication, each device having a unique identifier ID, including: Identify the master and slave devices from multiple devices; The master sends heartbeat frames to all slaves according to its heartbeat sending cycle, and each online slave reports a status frame to the master according to the reference cycle. The host constructs or updates the device status table based on the status frames of all online slaves; Based on the equipment status table, determine in real time whether the decision triggering conditions are met; If so, then initiate the host decision and switching control process.

[0020] In this invention, the host calculates the heartbeat transmission period of the heartbeat frame based on its ID and sends heartbeat frames to all slave devices according to the heartbeat transmission period. Each online slave device reports a status frame to the host according to the baseline period. Since the device IDs are different, the heartbeat periods are naturally staggered, effectively preventing arbitration failure caused by multiple devices sending simultaneously. When the host goes offline, a new host can be quickly and accurately selected. Moreover, host decision-making and switching control are performed based on the device status table, taking into account both real-time performance and reliability.

[0021] In some embodiments, determining the master and slave devices from a plurality of devices specifically includes: The process of determining the master and slave devices includes: all devices are powered on and enter a waiting state as online slave devices, and monitor whether a heartbeat frame is received; If a slave device receives a heartbeat frame before the waiting state ends, that slave device will continue to act as a slave device. When the waiting state ends, if none of the slave devices have received a heartbeat frame, each slave device calculates its own heartbeat transmission period based on its ID, preset offset, and base period, and starts timing accordingly. The heartbeat transmission period T = base period + ID × offset. The duration of the waiting state is less than the offset, and the offset is less than the base period. If a slave device fails to receive a heartbeat frame when its timer reaches the heartbeat transmission cycle, it immediately sends a heartbeat frame to the other slave devices via the CAN bus to compete for becoming the master. If a slave device receives a heartbeat frame before its timer reaches the heartbeat transmission period, it continues to act as a slave device. This embodiment utilizes an ID staggered peak mechanism to ensure that heartbeat frames do not conflict without additional communication overhead, and a new host can be quickly selected after the host goes offline.

[0022] During operation, if all online slave devices have not received a heartbeat frame from the master after the preset waiting time following the receipt of the previous heartbeat frame, they will calculate their respective heartbeat transmission cycles based on their ID, preset offset, and base period, and start timing accordingly. If a slave device fails to receive a heartbeat frame when its time reaches the heartbeat transmission cycle, it will immediately send a heartbeat frame to the other slave devices via the CAN bus to compete for the master position. If a slave device receives a heartbeat frame when its time reaches the heartbeat transmission cycle, it will continue to act as a slave device. The preset waiting time is greater than two base periods, and the maximum value of the heartbeat transmission cycle is less than two base periods.

[0023] With this setup, if a host fails and goes offline during operation, a new host can be quickly selected, ensuring that at least one host is still running.

[0024] In some embodiments, the heartbeat frame includes: operating parameters and fault level.

[0025] The operating parameters include pump frequency and valve opening degree.

[0026] In some embodiments, the status frame includes operating status, fault level, and operating parameters.

[0027] The operating status is divided into stopped and running.

[0028] The fault levels are divided into three levels: Level 1, Level 2, and Level 3. The lower the fault level, the healthier the equipment.

[0029] When the fault level is Level 1, it means that the fault does not affect the normal operation of the equipment. Under this fault level, the equipment's functional parameters deviate from their acceptable range.

[0030] When the fault level is level two, it means that the fault does not affect the equipment performance and main functions. Under this fault level, the unit is allowed to continue to operate for a period of time without causing irreversible damage to the equipment.

[0031] When the fault level is three, it means that the fault will affect the equipment performance control, affect the main functions or operation, and will lead to irreversible losses of the unit.

[0032] In some embodiments, the decision triggering conditions include one or more of the following: the interval between the current time and the last decision start time reaches a preset interval time, a new slave device comes online (flag set), the fault level of any device is found to have changed when traversing the device status table (count increases), and the number of devices currently in operation is not 1 (i.e., multiple operation or all shutdown occurs).

[0033] With this configuration, this embodiment can promptly initiate the host decision-making and switching control process.

[0034] In some embodiments, initiating host device decision and switching control specifically includes: Based on the device status table, count the number of online devices; Determine if the number of online devices is 1; if yes, the current host continues to run; if no, determine if the number of online devices is greater than or equal to 2; if yes, compare the fault level of the current host with that of the online slaves; where a lower fault level value indicates a healthier device. If the lowest fault level among the online slave devices is lower than the fault level of the current master device, then the slave device with the lower fault level is selected as the preferred slave device. Then the current master device stops and sends a start command and corresponding operating parameters to the preferred slave device, which then takes over as the new master device. If the current host has the lowest failure level, the current host continues to run and sends a stop command to all online slaves; When all online devices have the same fault level, instead of sticking to a particular device, the ID of the currently running host is recorded, and the running rights are forcibly switched to each online slave device in sequence according to the preset running cycle. This allows each online slave device to take over as the new host in turn, thereby realizing the cyclical rotation of the current host and each online slave device, making the working time of each device tend to be consistent. The preset running cycle is longer than the preset interval time.

[0035] This embodiment, based on a quantitative comparison of fault levels, always selects the healthiest equipment to operate, ensuring the system is in optimal condition. Furthermore, when multiple devices are functioning normally, a rotation operation strategy is enforced to even out equipment wear, extend overall lifespan, and reduce single-point fatigue.

[0036] In some further embodiments, after a new master takes over operation, the current master acting as a slave is set to a waiting timer period during which the triggering of new running quantity statistics and switching decisions is suspended; wherein, the waiting timer period is the same as the duration of the waiting state.

[0037] This embodiment is configured in such a way that it can effectively shield the instantaneous state changes during the slave device startup process, preventing old running equipment that has just stopped from being mistakenly judged as still running due to residual state, thereby causing confusion in the decision-making logic.

[0038] In summary, this invention can automatically complete master-slave establishment, rapid fault switching, load balancing rotation, and parameter synchronization without human intervention, greatly improving redundancy reliability and ease of maintenance.

[0039] Secondly, the present invention also proposes a CAN bus-based device group control redundancy management system for implementing the CAN bus-based device group control redundancy management method described in any one of the first aspects, comprising: The master-slave determination module is used to identify the master and slave devices from multiple devices. The process of determining the master and slave includes: all devices powering on and entering a waiting state as online slaves, and monitoring whether a heartbeat frame is received; when the waiting state ends, if none of the slaves have received a heartbeat frame, they calculate their respective heartbeat transmission period based on their ID, a preset offset, and a base period, and start timing accordingly; the heartbeat transmission period T = base period + ID × offset, the waiting state duration is less than the offset, and the offset is less than the base period; if a slave device does not receive a heartbeat frame when its timer reaches the heartbeat transmission period, it immediately sends a heartbeat frame to the other slaves via the CAN bus to compete for the master position; if a slave device receives a heartbeat frame before its timer reaches the heartbeat transmission period, it continues to act as a slave. The status synchronization module is used to send heartbeat frames to all slave devices according to the master's heartbeat sending cycle, and each online slave device reports status frames to the master according to the reference cycle; the master uses the status frames of all online slave devices to build or update the device status table. The decision module is used to determine in real time whether the decision triggering conditions are met based on the device status table; if so, the host decision and switching control process is initiated.

[0040] Preferably, the host decision-making and switching control process is initiated, specifically including: Based on the device status table, count the number of online devices; Determine if the number of online devices is 1; if yes, the current host continues to run; if no, determine if the number of online devices is greater than or equal to 2; if yes, compare the fault level of the current host with that of the online slaves; where a lower fault level value indicates a healthier device. If the lowest fault level of the online slave is lower than the fault level of the current master, the current master will stop and send a start command and corresponding operating parameters to the slave corresponding to the lowest fault level. The slave corresponding to the lowest fault level will then take over as the new master. If the current host has the lowest fault level, the current host continues to run and sends a stop command to all online slaves; When the fault level of all online slave devices is the same as that of the current master device, the ID of the current master device is recorded, and the start command and corresponding operating parameters are sent to each online slave device in sequence according to the preset operating cycle, so that the current master device and each online slave device can rotate in turn.

[0041] The present invention will now be described in conjunction with specific embodiments.

[0042] Example 1

[0043] like Figures 1-4As shown, this embodiment proposes a device group control redundancy management method based on CAN bus, applied to six data center cooling distribution units (CDUs) connected via CAN bus communication. Each device has a unique identifier ID, ID1~6. The method includes: The master and slave are determined from multiple CDUs; specifically, the process of determining the master and slave includes: all CDUs are powered on and enter a waiting state as online slaves, and monitor whether a heartbeat frame is received; If none of the slave devices receive a heartbeat frame after 3 seconds, they will calculate their respective heartbeat transmission period based on their ID, preset offset, and base period, and start timing accordingly. The heartbeat transmission period is T = 500ms + ID × 50ms. If a slave device fails to receive a heartbeat frame when its timer reaches the heartbeat transmission cycle, it immediately sends a heartbeat frame to the other slave devices via the CAN bus to compete for becoming the master. If a slave device receives a heartbeat frame before its timer reaches the heartbeat transmission period, it continues to act as a slave device. As the master CDU, it sends a heartbeat frame (CAN ID: 0x66) every (500 + local ID × 50) milliseconds. The data segment of the heartbeat frame includes the master ID, its own fault level, the current pump frequency, and the valve opening. At the same time, the slave reports its own status frame (CAN ID: 0x70 + local ID) every 500ms for the master to collect. While sending a heartbeat frame, the host writes its own status into the device status table; when it receives a status frame from the slave, it extracts information such as the slave's ID, operating status (0 stopped / 1 running), fault level, pump frequency, valve opening, etc., and updates it to the device status table; the device status table contains real-time data from all online CDUs. The host performs trigger condition detection, and initiates host decision and handover control when any of the following events occur: The timer has been set after 10 minutes since the last decision. A new slave device has come online (flag set). When traversing the device status table, it was found that the fault level of any CDU had changed (count increased); The number of devices currently in operation (i.e. online) is not 1 (i.e., multiple operation or all shutdowns have occurred); when the number of online devices is 2, in the start host decision and switching control process, the CDU with the lowest fault level in the device status table is first found; if the CDU is a slave and the fault level is different from that of the current host, it means that there is a healthier backup device available. At this time, the current host will perform a set of operations to stop the host and start the slave: switch the current host to the stop state and send a 0x80 control command to the slave, which carries the pump frequency and valve opening inherited from the original running equipment, as well as the forced start flag (1). If the CDU with the lowest fault level is the current master unit itself, the current master unit continues to run and sends a stop command to other slave units. In the command, the valve opening is set to 100 (fully closed) and a stop flag is included.

[0044] When all online CDUs have the same fault level (usually 0, i.e., no fault), the fixed master operation mode is not used; instead, the number of the currently running device is read. If the current operating system is the master, then a start command and corresponding operating parameters are sent to the slave corresponding to the lowest level to forcibly switch the operating rights to the online slave, so that the slave can run for 24 hours. If the current device is a slave device, the running rights are returned to the master device, thus achieving a "rotation" effect and making the working time of each device more consistent. After each switch of operating rights is completed, the master currently acting as a slave starts a wait counter (approximately 3 seconds); before the counter reaches zero, the actual number of running devices is not counted, and no new decisions are triggered. During operation, if all online slave devices have not received a heartbeat frame from the master within 1100ms of waiting after receiving the previous heartbeat frame, they will calculate their own heartbeat transmission period based on their respective IDs, preset offsets, and base periods, and start timing accordingly. If a slave device does not receive a heartbeat frame when its timer reaches the heartbeat transmission period, it will immediately send a heartbeat frame to the other slave devices via the CAN bus to compete for the master position. If a slave device receives a heartbeat frame when its timer reaches the heartbeat transmission period, it will continue to act as a slave device.

[0045] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A CAN bus-based device group control redundancy management method, applied to a plurality of same type device groups connected by a CAN bus communication, each device having a unique identifier ID, characterized in that, include: The master and slave devices are determined from multiple devices; the process of determining the master and slave devices includes: all devices are powered on and enter a waiting state as online slave devices, and monitor whether a heartbeat frame is received; When the waiting state ends, if none of the slave devices have received a heartbeat frame, they will calculate their respective heartbeat transmission period based on their ID, preset offset, and base period, and start timing accordingly. The heartbeat transmission period T = base period + ID × offset. The duration of the waiting state is less than the offset, and the offset is less than the base period. If a slave device fails to receive a heartbeat frame when its timer reaches the heartbeat transmission cycle, it immediately sends a heartbeat frame to the other slave devices via the CAN bus to compete for becoming the master. If a slave device receives a heartbeat frame before its timer reaches the heartbeat transmission period, it continues to act as a slave device. The master sends heartbeat frames to all online slaves according to its heartbeat sending cycle, and each online slave reports a status frame to the master according to the reference cycle. The host constructs or updates the device status table based on the status frames of all online slaves; Based on the equipment status table, determine in real time whether the decision triggering conditions are met; If so, then initiate the host decision and switching control process.

2. The CAN bus-based device group control redundancy management method according to claim 1, characterized in that, During operation, if all online slave devices have not received a heartbeat frame from the master after the waiting time after receiving the previous heartbeat frame reaches the preset waiting time, they will calculate their own heartbeat transmission period according to their ID, preset offset and base period, and start timing respectively. If a slave device has not received a heartbeat frame when its time reaches the heartbeat transmission period, it will immediately send a heartbeat frame to the other slave devices through the CAN bus to compete to become the master. If a slave device receives a heartbeat frame when its timer reaches the heartbeat transmission period, it continues to act as a slave device. The preset waiting time is greater than two reference periods, and the maximum value of the heartbeat transmission period is less than two reference periods.

3. The CAN bus-based device group control redundancy management method according to claim 2, characterized in that, Decision triggering conditions include any of the following: The interval between the current moment and the start time of the last decision reaches a preset interval; wherein, the preset interval is greater than the preset waiting time; A new slave device has come online; When traversing the device status table, it was found that the fault level of any device had changed; The number of devices currently in operation is not 1.

4. The CAN bus-based device group control redundancy management method according to claim 2, characterized in that, The heartbeat frame includes: operating parameters and fault level. The operating parameters include pump frequency and valve opening. The status frame includes the operating status, fault level, and operating parameters. The operating status is divided into stopped and running. The fault levels are divided into three levels: Level 1, Level 2, and Level 3. The lower the fault level, the healthier the equipment.

5. The CAN bus-based device group control redundancy management method according to claim 4, characterized in that, The host decision-making and switchover control process is initiated, specifically including: Based on the device status table, count the number of online devices; Determine if the number of online devices is 1; if yes, start or continue running the current host; if no, determine if the number of online devices is greater than or equal to 2; if yes, compare the fault levels of the current host and the online slave devices. If the lowest fault level of the online slave is lower than the fault level of the current master, the current master will stop and send a start command and corresponding operating parameters to the slave corresponding to the lowest fault level. The slave corresponding to the lowest fault level will then take over as the new master. If the current host has the lowest fault level, the current host continues to run and sends a stop command to all online slaves; When the fault level of all online slave devices is the same as that of the current master device, the ID of the current master device is recorded, and the start command and corresponding operating parameters are sent to each online slave device in sequence according to the preset operating cycle, so that the current master device and each online slave device can rotate in turn; wherein, the preset operating cycle is longer than the preset interval time.

6. The CAN bus-based device group control redundancy management method according to claim 5, characterized in that, After the new master takes over, the current master, which is acting as a slave, sets a waiting timer period. During this waiting timer period, it suspends triggering new running quantity statistics and switching decisions. The waiting timer period is the same as the duration of the waiting state.

7. The device group control redundancy management method based on CAN bus according to claim 5, characterized in that, The base period is 500ms, the offset is 50ms, the preset waiting time is 1100ms, the preset interval time is 10min, and the preset running cycle is 24h.

8. A device group control redundancy management system based on CAN bus, used to implement the device group control redundancy management method based on CAN bus as described in any one of claims 1-7, characterized in that, include: The master-slave determination module is used to identify the master and slave devices from multiple devices. The process of determining the master and slave devices includes: all devices powering on and entering a waiting state as online slaves, and monitoring whether a heartbeat frame is received; when the waiting state ends, if none of the slaves have received a heartbeat frame, they calculate their respective heartbeat transmission period based on their ID, a preset offset, and a base period, and start timing accordingly; the heartbeat transmission period T = base period + ID × offset, the waiting state duration is less than the offset, and the offset is less than the base period; if a slave device does not receive a heartbeat frame when its timer reaches the heartbeat transmission period, it immediately sends a heartbeat frame to the other slaves via the CAN bus to compete for the master position; if a slave device receives a heartbeat frame when its timer reaches the heartbeat transmission period, it continues to act as a slave. The status synchronization module is used to send heartbeat frames to all online slave devices according to the master's heartbeat sending cycle, and each online slave device reports status frames to the master according to the reference cycle; the master uses the status frames of all online slave devices to build or update the device status table. The decision module is used to determine in real time whether the decision trigger conditions are met based on the device status table; if so, the host decision and switching control process is initiated.

9. The device group control redundancy management system based on CAN bus according to claim 8, characterized in that, The host decision-making and switchover control process is initiated, specifically including: Based on the device status table, count the number of online devices; Determine if the number of online devices is 1; if yes, start or continue running the current host; if no, determine if the number of online devices is greater than or equal to 2; if yes, compare the fault level of the current host with that of the online slaves; the lower the fault level value, the healthier the device. If the lowest fault level of the online slave is lower than the fault level of the current master, the current master will stop and send a start command and corresponding operating parameters to the slave corresponding to the lowest fault level. The slave corresponding to the lowest fault level will then take over as the new master. If the current host has the lowest fault level, the current host continues to run and sends a stop command to all online slaves; When the fault level of all online slave devices is the same as that of the current master device, the ID of the current master device is recorded, and the start command and corresponding operating parameters are sent to each online slave device in sequence according to the preset operating cycle, so that the current master device and each online slave device can rotate in turn.