Switching method and device for panel equipment and computer readable storage medium
By monitoring the status of the main panel device and broadcasting the status information of the slave panel devices, a new main panel device is elected, which solves the problem of uncontrolled smart devices caused by main panel failure, realizes dynamic backup and seamless switching of the smart home system, and improves the stability and reliability of the system.
Patent Information
- Application Number
- CN202511222710.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-29
- Publication Date
- 2025-12-23
AI Technical Summary
In a smart home system, when the main panel device malfunctions or cannot operate normally, other normal panel devices cannot automatically take over the functions of the main panel, causing the smart devices to go out of control and affecting the stability and reliability of the system.
By monitoring the operational status of the main panel device, a new main panel device is elected based on the status information broadcast by the slave panel device, and the master-slave switch is completed, including the calculation of status weight values and the modification of role flags, to ensure seamless switching and dynamic backup.
It enables dynamic backup and seamless switching between multiple panel devices, improving the reliability and disaster recovery capabilities of the smart home system and ensuring that users can stably control home devices under any circumstances.
Smart Images

Figure CN121193554A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of smart homes, and more specifically, to a method, apparatus, and computer-readable storage medium for switching panel devices. Background Technology
[0002] With the rapid development of smart homes, various smart devices such as lights, switches, curtains, air conditioners, and alarms are widely used in home life. These devices are typically controlled from a single control panel, which serves as the central control hub for the smart devices. Its stability is crucial to the convenience and comfort of home life. In current smart home control systems, the main control panel undertakes the core control tasks, connecting and managing numerous smart devices. These devices are operated and managed through mobile apps and other terminals, enabling intelligent control of the home environment.
[0003] A smart home control solution is disclosed in the related technology, which adopts a strong binding method between a single panel and smart devices. The panel is connected to the home router via a mobile APP and further connected to the cloud. Users can add Zigbee smart devices to the panel through the mobile APP. These devices run in the panel's private Zigbee network, thereby realizing the operation and viewing functions of smart devices. This solution meets the basic control needs of smart homes to a certain extent.
[0004] While the relevant technologies have solved the basic control problem of smart home devices, when the main panel malfunctions or fails to operate normally, other normal panels cannot automatically take over the functions of the main panel. This results in all smart devices bound to the main panel being in an uncontrollable state. For example, lights may remain constantly on and cannot be turned off, leading to a series of problems such as homeowner complaints. This seriously affects the stability and reliability of the smart home system and makes it difficult to meet users' expectations for high availability of smart home systems.
[0005] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this application, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0006] To provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. This summary is not intended as a general commentary, nor is it intended to identify key / important components or describe the scope of protection of these embodiments, but rather as a prelude to the detailed description that follows.
[0007] This disclosure provides a method, apparatus, and computer-readable storage medium for switching panel devices to ensure the stability and reliability of smart home systems.
[0008] In some embodiments, the switching method for panel devices includes: monitoring the operating status of the master panel device to obtain monitoring information; controlling each slave panel device to broadcast its own status information when the monitoring information meets the master-slave switching conditions; electing a new master panel device based on the status information broadcast by each slave panel device; and performing a master-slave switching operation on the master panel device and the new master panel device.
[0009] In some embodiments, the master-slave switching conditions include: no status response is received from the master panel device for N consecutive detection cycles, N≥2; and / or, the cloud connection status of the master panel device is offline; and / or, the wireless signal strength level of the master panel device reaches a preset level; and / or, the Zigbee signal strength level of the master panel device reaches a preset level; and / or, the critical process running status of the master panel device is abnormal.
[0010] In some embodiments, the step of electing a new master panel device based on the respective status information broadcast by each slave panel device includes: calculating the status weight value of each slave panel device based on the respective status information broadcast by each slave panel device; and electing a new master panel device based on the status weight value of each slave panel device.
[0011] In some embodiments, the switching method for panel devices includes: determining, based on the respective status information broadcast by each slave panel device, the cloud connection status weight value, process running status weight value, WiFi signal strength level weight value, Zigbee signal strength level weight value, CPU load rate weight value, and role status weight value of each slave panel device; and using the sum of the cloud connection status weight value, process running status weight value, WiFi signal strength level weight value, Zigbee signal strength level weight value, CPU load rate weight value, and role status weight value of each slave panel device as the status weight value of each slave panel device.
[0012] In some embodiments, the switching method for panel devices includes: assigning weighting coefficients to various status information items; and performing weighted calculations on the weight values corresponding to various status information items according to the weighting coefficients to obtain the status weight values of each slave panel device.
[0013] In some embodiments, the switching method for panel devices includes: if multiple slave panel devices determine that their own state weight value is the largest according to the sorting result and the state weight values broadcast by multiple slave panel devices are the same, then control multiple slave panel devices to send a recommendation broadcast, and select the slave panel device that sends the recommendation broadcast the fastest as the new master panel device; or, if multiple slave panel devices determine that their own state weight value is the largest according to the sorting result and the state weight values broadcast by multiple slave panel devices are the same, then elect a new master panel device according to a pre-stored device state priority strategy.
[0014] In some embodiments, the switching method for panel devices includes: controlling each slave panel device to send its own state weight value to the weight decision module so that the weight decision module obtains a sorting result; if the weight decision module determines based on the sorting result that there are multiple slave panel devices with the largest and the same state weight value, then controlling the multiple slave panel devices to send a recommendation broadcast, and selecting the slave panel device that sends the recommendation broadcast fastest as the new master panel device; or, if the weight decision module determines based on the sorting result that there are multiple slave panel devices with the largest and the same state weight value, then electing a new master panel device according to a pre-stored device state priority strategy.
[0015] In some embodiments, the switching method for panel devices includes: changing the role flag of the master panel device to that of the slave panel device, controlling the master panel device to clear the current Zigbee network configuration, terminating the current service process, and controlling the master panel device to synchronize the latest Zigbee network configuration from the new master panel device.
[0016] In some embodiments, the method for switching panel devices includes: modifying the role identifier of the new main panel device to the main panel device, performing a device upgrade operation, and sending a role change notification to other devices.
[0017] In some embodiments, the switching method for the panel device includes: when the main panel device detects that its own operating state can no longer guarantee full functionality, it initiates a self-degradation mechanism to change the role flag of the main panel device.
[0018] In some embodiments, the switching device for a panel device includes a processor and a memory storing program instructions, the processor being configured to execute the aforementioned switching method for a panel device when running the program instructions.
[0019] In some embodiments, the computer-readable storage medium includes a stored program, wherein the program executes the aforementioned switching method for the panel device when it runs.
[0020] The switching method, apparatus, and computer-readable storage medium for panel devices provided in this disclosure can achieve the following technical effects:
[0021] This solution can monitor the operating status of the main panel device and trigger the slave panel devices to broadcast their respective status information when the switching conditions are met. Based on their respective status information, the optimal new main panel device is selected and the master-slave switch is completed. This solves the problem of smart devices going out of control due to the failure of the main panel device, realizes dynamic backup and seamless switching between multiple panel devices, significantly improves the reliability and disaster recovery capability of the smart home system, and ensures that users can stably control home devices under any circumstances. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 This is a schematic diagram of a switching method for a panel device provided in an embodiment of this disclosure;
[0024] Figure 2 This is a schematic diagram of a method for determining a new main panel device provided in an embodiment of this disclosure;
[0025] Figure 3 This is a schematic diagram of another method for determining a new main panel device provided in this disclosure embodiment;
[0026] Figure 4 This is a schematic diagram of another method for determining a new main panel device provided in this disclosure embodiment;
[0027] Figure 5 This is a schematic diagram of a switching device for a panel device provided in an embodiment of this disclosure;
[0028] Figure 6 This is a schematic diagram of another switching device for a panel device provided in an embodiment of this disclosure.
[0029] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. Detailed Implementation
[0030] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0031] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0032] Figure 1 This is a schematic diagram of a switching method for a panel device provided in an embodiment of this disclosure; combined with Figure 1 As shown, this disclosure provides a switching method for a panel device, including:
[0033] S11, the panel switching system monitors the operating status of the main panel device to obtain monitoring information.
[0034] S12, when the monitoring information meets the master-slave switching conditions, the panel switching system controls each slave panel device to broadcast its own status information.
[0035] S13, the panel switching system elects a new master panel device based on the status information broadcast by each slave panel device.
[0036] S14, the panel switching system performs a master-slave switching operation on the main panel device and the new main panel device.
[0037] In this solution, the panel switching system consists of a master panel device, multiple slave panel devices, a status monitoring module, a weight decision module, and a configuration synchronization module. The master panel device, as the core control node, is responsible for managing the binding and configuration of the Zigbee network and smart devices. Slave panel devices, as backup nodes, periodically synchronize device data with the master panel through the configuration synchronization module. The status monitoring module collects real-time operational status indicators from each panel and achieves distributed status sharing through periodic broadcasts. These operational status indicators include, but are not limited to, cloud connection status, process health, WiFi / Zigbee signal strength, and CPU load rate. The panel switching system also provides two deployment modes for the weight decision module: centralized deployment and distributed deployment. Specifically, centralized deployment uses a single central weight decision module, which centrally receives and processes the status data from all panel devices, uses a unified weight algorithm for global evaluation, and makes a master-slave switching decision. Distributed deployment configures an independent weight decision module for each slave panel device. Each module autonomously calculates weights based on locally stored status information, and a switching scheme is formed through inter-node information exchange and weight ranking. In this way, both deployment modes can effectively achieve anomaly detection and dynamic role switching functions. The centralized mode has the advantage of computational efficiency, while the distributed mode provides stronger system fault tolerance. The panel switching system can flexibly choose the deployment method according to the actual application environment requirements. Through the collaborative work of multiple modules, a highly reliable intelligent device control disaster recovery system is built to ensure the continuous and stable operation of the smart home device control system.
[0038] In this solution, the main panel device's operational status can be monitored in multiple ways to obtain monitoring information. In one approach, the panel switching system can actively collect various monitoring information items through the main panel device's built-in status monitoring module. This monitoring information includes, but is not limited to, cloud connection status for determining device online status, WiFi signal strength level for reflecting network connection quality, Zigbee signal strength level for assessing communication stability with smart devices, and the operational status of key processes. Specifically, the operational status of key processes includes the operational status of core processes such as device control services and network communication services. In another approach, the panel switching system can monitor the main panel device's operational status through status monitoring modules configured on each slave panel device. For example, the status monitoring modules on each slave panel device can continuously receive status response information periodically sent by the main panel to monitor the main panel device's operational status.
[0039] In an optimized solution, the panel switching system can also employ a master-slave collaborative dual monitoring mechanism to achieve comprehensive status monitoring of the master panel device. The master panel device actively collects four core indicators through its built-in status monitoring module: cloud connection status, WiFi signal strength level, Zigbee signal strength level, and critical process running status. Simultaneously, each slave panel device continuously receives and analyzes the status response information periodically broadcast by the master panel through its status monitoring module, forming an external monitoring perspective. The panel switching system compares the master panel's self-test data with the slave panel's monitoring data in real time; when the data matches, a highly reliable status is confirmed. Compared to the fragile architecture of existing technologies that rely solely on device binding, this solution significantly improves system reliability through a dual monitoring mechanism. It avoids the misjudgment problems that may result from single-point monitoring and ensures the accuracy of status detection through multi-dimensional data cross-validation.
[0040] Furthermore, the panel switching system can determine whether the monitoring information meets the master-slave switchover conditions through multi-dimensional condition judgments. The panel switching system continuously monitors the following key indicators: when no status response is received from the master panel device for two or more consecutive detection cycles, it is determined that the master panel device may have a communication failure; when the cloud connection status of the master panel device shows as offline, it indicates that it has lost its cloud connection capability; when the WiFi signal strength level of the master panel device is lower than the preset minimum usable threshold, it is determined that its network connection quality is substandard; when the Zigbee signal strength level of the master panel device is lower than the minimum threshold required for device communication, it is considered that its device control capability is impaired; when the abnormal running status of the master panel device's critical processes is detected, it is confirmed that its core functions are unreliable. The triggering of any of the above conditions is considered to meet the master-slave switchover conditions.
[0041] Thus, once a panel switch is determined to be necessary, the panel switch system will immediately control all slave panel devices to begin broadcasting their complete status information. This status information includes: the current device role status to identify master / slave attributes, the cloud connection status to reflect the device's online status, the running status of key processes to display the health of critical services, the WiFi wireless signal level to indicate network connection quality, the Zigbee wireless signal level to reflect the device's communication capabilities, and the CPU load rate to display the device's processing capabilities.
[0042] This approach, through a multi-condition triggering mechanism, ensures the accuracy of switching decisions and avoids misjudgments that might be caused by a single indicator. Simultaneously, the design requiring the broadcast of complete status information from the panel provides ample data support for subsequent master device election. This significantly improves the system's reliability and response speed. Compared to traditional solutions, this design enables the system to respond quickly and accurately to various abnormal situations, ensuring the continuity and stability of smart home control.
[0043] In this solution, the panel switching system performs weighted calculations on the status information broadcast by each slave panel. The status weight value of each slave panel is calculated from the weight values of its key indicators. There are two specific calculation methods, which can be flexibly selected according to the actual application scenario. In one example, the panel switching system determines six core indicators for each slave panel: cloud connection status weight value, process running status weight value, WiFi signal strength level weight value, Zigbee signal strength level weight value, CPU load rate weight value, and role status weight value. These six weight values are then added together to obtain the status weight value of the slave panel. In another example, the panel switching system assigns differentiated weight coefficients to different indicators. For example, because network-related indicators such as WiFi and Zigbee signal strength directly affect device control capabilities, these indicators receive higher weights; process status and CPU load rate, reflecting system health, are given medium weights; and role status is given a basic weight. Each indicator weight value is multiplied by its corresponding coefficient and then summed to obtain the weighted status weight value. This mode is more suitable for application scenarios with high network stability requirements. Furthermore, the panel switching system can combine the state weight values of each slave panel device to elect a new master panel device. This approach, by comprehensively evaluating the key indicators of slave panels and calculating state weight values, and flexibly employing different calculation methods, can more accurately elect a new master panel device. Compared to existing technologies, this significantly improves the switching reliability and overall stability of the smart home system in the event of a master panel failure.
[0044] Furthermore, when the panel switching system triggers a master-slave switch, it can perform a degradation operation on the original master panel device: changing its role identifier to a slave panel device, forcibly clearing the current Zigbee network configuration to avoid network conflicts, terminating the running service processes, and starting to synchronize the latest Zigbee network configuration from the newly elected master panel device. Simultaneously, it performs an upgrade operation on the new master panel device: changing its role identifier to a master panel device, executing the necessary device upgrade process to activate the master control function, and broadcasting the role change notification to all devices in the network. This solution, through a standardized switchover process and network configuration synchronization mechanism, completely avoids the network configuration conflicts and service interruptions common in traditional solutions, achieving a truly seamless master-slave switchover.
[0045] The switching method for panel devices provided in this disclosure can monitor the operating status of the main panel device and trigger the slave panel devices to broadcast their respective status information when the switching conditions are met. Based on their respective status information, the optimal new main panel device is elected and the master-slave switch is completed. This solves the problem of smart devices going out of control due to the failure of the main panel device, realizes dynamic backup and seamless switching between multiple panel devices, significantly improves the reliability and disaster recovery capability of the smart home system, and ensures that users can stably control home devices under any circumstances.
[0046] Optionally, master-slave switching conditions include:
[0047] No status response is received from the main panel device for N consecutive detection cycles, N≥2; and / or,
[0048] The main panel device's cloud connection status is offline; and / or,
[0049] The WiFi signal strength level of the main panel device reaches the preset level; and / or,
[0050] The Zigbee signal strength level of the main panel device reaches the preset level; and / or,
[0051] The critical processes of the main panel device are running in an abnormal state.
[0052] In this solution, one or more master-slave switching conditions can be designed to ensure the reliability and real-time performance of the panel switching system.
[0053] Specifically, if no status response is received from the main panel device for N consecutive detection cycles, it is determined that the master-slave switching conditions are met. Here, N is usually greater than or equal to 2. This design can effectively avoid false switching caused by brief network fluctuations or single detection errors. The switching mechanism is only triggered when the main panel is detected as unresponsive multiple times consecutively. For example, if N is set to 3, the panel switching system will confirm the abnormal status of the main panel within 3 consecutive cycles before initiating the switching process, thereby reducing the probability of false judgment.
[0054] Specifically, if the main panel device's cloud connection is offline, it is determined that the master-slave switchover condition is met. It's important to note that the cloud connection serves as a bridge between the panel and the remote control and management system. If the main panel cannot connect to the cloud, its control capabilities will be severely affected. In this case, the panel switching system will quickly transfer control to the slave panel, ensuring that the remote control function of the smart device is unaffected. For example, when the main panel goes offline due to network failure or cloud service interruption, the switchover process is then initiated to prevent users from being unable to operate the device via the mobile app.
[0055] Specifically, switching will also be triggered when the WiFi signal strength level of the main panel device reaches a preset level. Understandably, WiFi signal strength directly affects the communication quality between the panel and the home router; if the signal is too weak, control commands may be delayed or lost. The preset level can be set according to the actual environment, for example, triggering switching when the signal strength level is 0 (i.e., extremely weak signal). Similarly, because the Zigbee network is the core of communication between the panel and smart devices, a weak signal will cause device control failure. Therefore, switching will also be triggered when the Zigbee signal strength level reaches a preset level. Here, the preset level can be set according to the actual environment. For example, when the Zigbee signal level is 0, it means that the main panel can no longer communicate normally with smart devices, and panel switching will be triggered at this time.
[0056] Specifically, the monitoring information also includes the running status of key processes on the main panel device. Thus, an abnormal running status of a key process on the main panel device will trigger a switchover. Here, an abnormality in a key process may cause panel functionality to fail, such as the inability to respond to commands or synchronize configurations. The panel switching system monitors these processes in real time, and immediately initiates the switchover process upon detecting an anomaly. For example, if the main panel's process status changes from normal to abnormal, the secondary panel will quickly take over, ensuring uninterrupted control of the smart devices.
[0057] It is important to emphasize that the panel switching will be triggered if any one of the monitoring conditions is met. Furthermore, if multiple or all conditions are met simultaneously, the panel switching system will still execute the switch, ensuring a timely response to any anomalies on the main panel. This design enhances the robustness of the panel switching system and avoids switching delays caused by the failure of a single detection mechanism.
[0058] Understandably, these switching conditions are set to take into full account various abnormal situations that may occur in actual operation. Through multi-dimensional detection, the panel switching system can ensure that it can quickly and accurately complete the switching when the main panel fails.
[0059] Figure 2 This is a schematic diagram of a method for determining a new main panel device provided in an embodiment of this disclosure; combined with Figure 2 As shown, optionally, in S13, the panel switching system elects a new master panel device based on the respective status information broadcast by each slave panel device, including:
[0060] S21, the panel switching system calculates the state weight value of each slave panel device based on the state information broadcast by each slave panel device.
[0061] S22, the panel switching system elects a new master panel device based on the status weight values of each slave panel device.
[0062] In this scheme, the election process for the main panel is based on the state weight values of the slave panel devices, ensuring that the newly selected main panel has optimal operating conditions. The panel switching system employs two methods to implement this election mechanism to adapt to different network architectures and computing resource distributions.
[0063] The first approach relies on a centralized weighted decision-making module. This module receives status information periodically broadcast by all slave panels, including key indicators such as cloud connection status, process status, WiFi signal strength level, Zigbee signal strength level, and CPU load rate. Each indicator corresponds to a specific weight value; for example, a successful cloud connection is worth 13 points, and a failure is worth 0 points; a WiFi signal strength level of 5 points is optimal, and 0 points is the worst. The weighted decision-making module then aggregates and sorts the total scores of all slave panels, and the device with the highest total score is nominated as the new master panel. For example, if slave panel A has a total score of 45 and slave panel B has a total score of 38, the panel switching system will prioritize A as the master panel. This approach is suitable for scenarios with concentrated computing resources, enabling rapid global decision-making and reducing election latency.
[0064] The second approach employs a distributed computing strategy, where each slave panel device possesses independent processing capabilities, enabling it to receive and parse status information broadcast by other slave panels. Each device calculates the total score of other devices according to preset weighting rules and determines the optimal candidate through local comparison. For example, after receiving status information from B and C, slave panel A finds that its total score is the highest and will proactively switch its role to master panel and broadcast a notification to other devices. This approach is suitable for decentralized networks, avoiding the risk of single points of failure, while improving the flexibility and fault tolerance of the panel switching system. Both approaches ensure the rationality of the election results, but the distributed scheme is more suitable for large-scale or highly dynamic network environments.
[0065] It's important to note that, regardless of whether the election is centralized or distributed, the panel switching system updates device status in real time and dynamically adjusts master / slave roles. For example, when the master panel triggers a switch due to a drop in WiFi signal strength to 0, the slave panel immediately initiates the election process, ensuring a seamless transfer of control. This design not only improves the reliability of the panel switching system but also optimizes the master panel selection criteria through multi-dimensional status evaluation, avoiding frequent switching caused by a single abnormal indicator. Ultimately, this solution enables stable control of smart devices in the home environment, reduces service interruptions due to panel failures, and significantly enhances the user experience.
[0066] Optionally, in step S21, the panel switching system calculates the state weight value of each slave panel device based on its respective state information broadcast by each slave panel device, including:
[0067] Based on the status information broadcast by each slave panel device, the panel switching system determines the weight values of each slave panel device's cloud connection status, process running status, WiFi signal strength level, Zigbee signal strength level, CPU load rate, and role status.
[0068] The panel switching system uses the sum of the cloud connection status weight value, process running status weight value, WiFi signal strength level weight value, Zigbee signal strength level weight value, CPU load rate weight value, and role status weight value of each slave panel as the status weight value of each slave panel device.
[0069] In this solution, the core mechanism of panel switching relies on a refined evaluation of various status indicators of the slave panel devices. Each slave panel device periodically broadcasts its operational status information, including key parameters such as cloud connection status, process status, WiFi signal strength level, Zigbee signal strength level, CPU load rate, and current role status. The panel switching system quantifies these statuses according to a preset weighted value mapping table. Specifically, the weighted value mapping table is as follows:
[0070]
[0071]
[0072]
[0073] As shown in the table above, a successful cloud connection is assigned the highest weight of 13 points, while a failed connection results in 0 points. A process running status is assigned a weight of 13 points when running normally and 0 points when abnormal. WiFi signal strength is divided into 0 to 5 levels based on actual received strength, each corresponding to a different score. Zigbee signal strength is also divided into 0 to 5 levels, each corresponding to a different score. CPU load rate is divided into 0 to 3 levels based on load level, with lower load resulting in higher scores. Role status is simply divided into master panel (1 point) and slave panel (0 points). Through this standardized and quantifiable method, the panel switching system can objectively compare the performance of different slave panels.
[0074] In the specific calculation, the panel switching system assigns corresponding weight values to each status indicator of each slave panel, and then adds up the weight values of all indicators to obtain the total status weight value of the device. For example, if a slave panel scores 13 points for successful cloud connection, 13 points for normal process operation, 4 points for WiFi signal strength, 3 points for Zigbee signal strength, 2 points for CPU load rate, and 0 points for slave panel status, then the total status weight value of the device is 35 points. After calculating all slave panels in this way, the panel switching system can accurately identify the candidate device most suitable to replace the main panel. This selection mechanism based on multi-dimensional comprehensive evaluation has significant advantages over traditional single-indicator judgment, effectively avoiding misjudgments caused by abnormalities in a single indicator, and ensuring that the selected new main panel is in a superior operating state in all aspects.
[0075] Optionally, in step S21, the panel switching system calculates the state weight value of each slave panel device based on its respective state information broadcast by each slave panel device, including:
[0076] The panel switching system assigns weighting coefficients to various status information items.
[0077] The panel switching system calculates the weight values of each status information item by weighting the weighting coefficients to obtain the status weight value of each slave panel device.
[0078] In this embodiment, the panel switching system can introduce a weighted coefficient mechanism, assigning different weighted coefficients based on the varying importance of different indicators to the stable operation of the system. For example, considering the criticality of cloud connectivity for remote control, a higher weighting coefficient of 2 can be set for it; while the weighting coefficient for CPU load rate can be set to 1. Through this optimization, the panel switching system can more accurately reflect the actual differences in the importance of various indicators, making the election results more scientific and reasonable. Furthermore, the panel switching system can dynamically adjust the weighting coefficients according to the actual operating environment. For example, in areas with weak network signals, the weight of signal strength can be appropriately increased; in environments with limited computing resources, the weight of CPU load rate can be increased. This adaptive capability can further improve the applicability and reliability of the panel switching system in different scenarios. These optimization measures work together to enable the entire backup switching system to more intelligently and accurately complete the election and switching of master and slave panels, ensuring the continuous and stable operation of the smart home system.
[0079] Figure 3 This is a schematic diagram of a method for determining a new main panel device provided in an embodiment of this disclosure; combined with Figure 3 As shown, optionally, in S22, the panel switching system elects a new master panel device based on the respective state weight values broadcast by each slave panel device, including:
[0080] S31, the panel switching system controls each slave panel device to sort its own status weight value and the status weight values broadcast by other slave panel devices.
[0081] S321, if any slave panel device determines its own state weight value to be the largest according to the sorting result, the panel switching system controls that slave panel device to broadcast and recommend itself as the new master panel device, or...
[0082] S322, if the sorting results determine that all slave panel devices have the same state weight value, the panel switching system controls all slave panel devices to send a recommendation broadcast, and the slave panel device that sends the recommendation broadcast the fastest is designated as the new master panel device.
[0083] In this scheme, the process of electing a new master panel device can achieve efficient decision-making through distributed weight calculation logic. Specifically, after receiving status information broadcast by other devices, each slave panel device independently calculates and sorts the status weight values of all devices. This process is entirely based on local data processing and does not rely on a centralized control node, thus avoiding the risk of single point of failure. For example, when there are three slave panel devices A, B, and C in the panel switching system, device A will calculate and compare the sum of the weight values of the three. If it finds that its own weight value is the highest (e.g., A: 45 points, B: 38 points, C: 40 points), it will immediately broadcast to declare itself as the new master panel device. This distributed calculation method significantly improves the system's response speed, ensuring that role switching can be completed quickly when the master panel fails.
[0084] In another scenario, when all slave panel devices have the same state weight value, the panel switching system resolves conflicts using a time-priority principle. Specifically, all devices with the same weight value will simultaneously send a nomination broadcast, and the slave panel device whose broadcast message is received first by other devices will be confirmed as the new master panel device. For example, if devices B and C both have a weight value of 40 points and are tied for the highest, they will both initiate a nomination broadcast simultaneously. Assuming device B's broadcast is received first by other devices, B will become the new master panel device. This mechanism effectively avoids election deadlock by introducing a time-competition element, while ensuring the immediacy of the decision. Compared to traditional technologies that rely on manual intervention or fixed priorities, this solution is more flexible and efficient.
[0085] The design of these two election scenarios fully considers the complexity of real-world network environments. The weighted priority rule ensures that the panel switching system always selects the device with the best overall performance as the master panel, thus maintaining optimal service quality; while the time-based competition mechanism when weights are equal provides a fair and efficient solution. The entire election process is fully automated, requiring no manual intervention, significantly reducing operational costs. Simultaneously, the distributed computing nature allows the panel switching system to adapt to dynamic changes in network topology, enabling it to complete the election even when communication between some nodes is interrupted. This design significantly improves the reliability and user experience of smart home systems, ensuring a smooth and seamless switching process at the control center.
[0086] Figure 4 This is a schematic diagram of another method for determining a new master panel device provided in this disclosure embodiment; optionally, the panel switching system includes a weight decision module; the panel switching system elects a new master panel device according to the state weight values of each slave panel device, including:
[0087] S41, the panel switching module controls each slave panel device to send its own status weight value to the weight decision module so that the weight decision module can obtain the sorting result.
[0088] S421, if the weight decision module determines based on the sorting result that there are multiple slave panel devices with the largest and the same state weight value, the panel switching system controls the multiple slave panel devices to send a recommendation broadcast, and the slave panel device that sends the recommendation broadcast the fastest is taken as the new master panel device.
[0089] S422, if the weight decision module determines that there are multiple slave panel devices with the largest and the same state weight value based on the sorting result, the panel switching system elects a new master panel device according to the pre-stored device state priority strategy.
[0090] In this scheme, after the weight decision module receives the status weight values of each slave panel device, and after calculating and sorting the status weight values, if multiple slave panels have the same total score and all of them are the highest scores, the panel switching system controls multiple slave panel devices to send a recommendation broadcast, and the slave panel device that sends the recommendation broadcast the fastest is designated as the new master panel device.
[0091] In one example, all slave panel devices that reach the highest weight value simultaneously send a recommendation broadcast message to the network. These messages contain the device's unique identifier and current timestamp. Other devices in the network then use the timestamp and unique identifier to record the device that first sent the recommendation broadcast and identify it as the new master panel.
[0092] In another example, all slave devices that reach the highest weight value simultaneously send a nomination broadcast message to the network. The device that sends the broadcast message that first reaches a majority of devices is recorded and identified as the new master slave device. Here, a majority of devices refers to more than two-thirds of the total number of devices in the network. For example, if devices X and Y both have a total state weight value of 48 points, they will immediately broadcast their election requests. Assuming that device X's broadcast message is received first by more than two-thirds of the other devices, device X will win the election. This mechanism fully utilizes the natural time difference in network transmission as a decision-making basis, ensuring election efficiency while avoiding complex negotiation processes.
[0093] This time-based competition-based election method has significant advantages over traditional technologies. First, it can complete decisions in an extremely short time, typically determining a new lead panel within 100 milliseconds, far faster than distributed consensus algorithms that require multiple rounds of negotiation. Second, this scheme is naturally adaptable to changes in network topology, maintaining stable operation even when network conditions fluctuate. For example, in a smart home environment, when multiple candidate panels are distributed in different locations, panels closer to the smart devices typically have lower network latency, allowing their nomination broadcasts to propagate faster—a situation that aligns perfectly with the physical advantages of device deployment. Furthermore, this mechanism is completely decentralized, not relying on the coordination functions of any specific node; even if some devices temporarily go offline, the election process will not be affected.
[0094] To enhance the fairness of time competition, the panel switching system also incorporates a random backoff mechanism. When panel devices detect identical weight values, they wait for a random delay before sending the nomination broadcast; this delay is typically controlled within the range of 10 to 50 milliseconds. This design effectively avoids network congestion caused by multiple devices sending signals synchronously, while ensuring that the device with the best network conditions still wins the election. For example, if devices M and N both calculate a weight value of 45, device M randomly chooses a 32-millisecond delay, while device N chooses a 30-millisecond delay. Ultimately, device M will send its broadcast first and win the election. This optimization, while ensuring rapid response, further improves the stability and reliability of the panel switching system. The entire solution, through clever utilization of network characteristics and simple algorithms, achieves efficient decision-making in complex scenarios, providing a solid guarantee for the continuous and stable operation of the smart home system.
[0095] In another approach, when the weight decision module determines that multiple slave panel devices have the same and highest state weight values, a second-stage fine-tuning election process begins. This stage first judges based on a preset priority strategy, prioritizing the comparison of the most critical technical indicators for controlling the smart devices. In one example, since the Zigbee network is directly related to the communication quality with the terminal smart devices, the panel switching system will prioritize the device with the higher Zigbee signal strength level. For instance, if device A and device B both have a total weight value of 45 points, but device A has a Zigbee signal level of 4 while device B has a level of 3, the panel switching system will recommend device A as the new master panel device. This design ensures that the selected new master panel device can provide the most stable device control link, avoiding operational delays or failures due to signal problems.
[0096] Furthermore, when Zigbee signal strength levels are also the same, the panel switching system will further compare WiFi signal strength levels. Understandably, WiFi connection quality affects the panel's communication capabilities with the cloud and other devices, and is fundamental to maintaining remote control and status synchronization. For example, if devices C and D have the same total weight and Zigbee signal strength, but device C has a WiFi signal strength of level 5 while device D has level 4, then device C will be selected first. This hierarchical comparison mechanism achieves optimal selection while ensuring core functionality by progressively refining the evaluation criteria. Compared to the simple random election or fixed priority methods in traditional technologies, this multi-dimensional and refined evaluation significantly improves the scientific rigor of the election results and the stability of the system.
[0097] As a final decision-making safeguard, when all technical indicators are indistinguishable, the panel switching system employs a deterministic approach by comparing device MAC addresses. Since MAC addresses are unique, selecting the device with the smaller MAC address ensures consensus among all nodes, avoiding election conflicts. For example, if devices E and F are identical across all comparisons, but device E's MAC address ends in 00:0A while device F's ends in 00:0B, then device E will be selected. This simple design effectively solves the decision-making challenge in extreme cases, ensuring the panel switching system can smoothly complete the main panel switch under any circumstances. The entire multi-level decision-making process considers both the priority of technical indicators and retains a final arbitration mechanism, making the election process both intelligent and reliable, significantly improving the robustness of the smart home system and the user experience.
[0098] On the other hand, when a panel gateway discovers through weight calculation that its total state weights are not the maximum value in the network, it will strictly maintain its slave panel role while continuing to periodically broadcast or multicast its complete state information. This mechanism ensures that the master-slave topology in the network is always dynamically maintained based on real-time state data, significantly improving the response speed and stability of the smart home system.
[0099] Optionally, in step S14, the panel switching system performs a master-slave switching operation on the main panel device, including:
[0100] The panel switching system changes the role of the master panel device to that of a slave panel device, controls the master panel device to clear the current Zigbee network configuration, terminates the current service process, and controls the master panel device to synchronize the latest Zigbee network configuration from the new master panel device.
[0101] In this solution, the panel switching system changes the role of the original master panel device from "master panel device" to "slave panel device" and activates dedicated function modules for slave devices. These modules include configuration synchronization service, status monitoring service, and election message listening service. The configuration synchronization service periodically retrieves the latest configuration from the master panel, the status monitoring service continuously collects local operating metrics for weight calculation, and the election message listening service is ready to respond to new master-slave switchover events. For example, a device converted to a slave panel will proactively request a configuration update from the master panel every 30 seconds, while continuously monitoring its own WiFi signal strength, CPU load, and other metrics to prepare for the next possible election. This design enables the system to form a dynamic master-slave collaborative relationship, offering greater flexibility and reliability compared to the traditional fixed master-slave mode. The entire switchover process, through refined status management and resource scheduling, ensures the continuity and stability of services provided by the smart home system when panel roles change, significantly improving the user experience.
[0102] Simultaneously, the main panel device will proactively clear the current Zigbee network configuration. This crucial step includes clearing core parameters such as the network PAN ID, channel parameters, network key, and coordinator address. By thoroughly clearing this configuration information, it effectively prevents two Zigbee networks with identical network parameters from existing in the same area, thus preventing potential signal interference and device control conflicts. For example, when the main panel triggers a switchover due to a drop in WiFi signal strength to level 0, it will immediately release its Zigbee network resources, creating conditions for the new main panel to take over network control.
[0103] Simultaneously, the panel switching system terminates critical service processes running on the main panel device, including the Zigbee network coordinator service, device control command forwarding service, and cloud communication main link service. These services are terminated using a graceful shutdown mechanism: first, they stop accepting new requests, and then completely terminate the process after existing tasks are completed, ensuring that sudden interruptions do not lead to abnormal device states or data loss. For example, the device control command forwarding service completes all currently executing control commands and sends status confirmation messages to associated devices before stopping. This refined process management significantly reduces the risk of inconsistent device states during service switching compared to the forced termination schemes of traditional technologies.
[0104] Simultaneously, after the panel switching system completes resource release, the original master panel device will synchronize the latest Zigbee network configuration from the newly elected master panel device. This synchronization process uses encrypted channel transmission to ensure the security of sensitive information such as network keys. The synchronized content includes the new master panel's Zigbee network parameters, device binding relationships, and current scenario configuration. For example, the new master panel will package its Zigbee network PAN ID, channel selection, and encrypted network key into a configuration package and transmit it to the original master panel via a dedicated synchronization protocol. This design ensures the integrity and consistency of network configuration changes, avoiding the hassle of re-pairing smart devices.
[0105] Optionally, in step S14, the panel switching system performs a master-slave switching operation on the new master panel device, including:
[0106] The panel switching system changes the role identifier of the new main panel device to the main panel device, performs the device upgrade operation, and sends role change notifications to other devices.
[0107] In this scheme, once a new master panel device is elected, the panel switching system immediately executes a series of refined switching operations to ensure a smooth transition of control. First, the system changes the new master panel device's role identifier from "slave panel" to "master panel." This crucial operation triggers a state machine transition within the device, activating all its functions as the control hub. For example, when device B is promoted from slave panel to master panel, its system kernel immediately loads dedicated service modules for the master panel, including core functions such as the Zigbee network coordinator, device control hub, and cloud communication main link. This identifier modification ensures that only one device holds the master panel identifier at any given time, avoiding "dual master" conflicts.
[0108] Furthermore, the new main panel device automatically performs a device upgrade, a process involving three key steps: First, service process upgrades, where the device initiates or prioritizes main panel-specific processes, such as switching the Zigbee network coordination service from observer mode to coordinator mode; second, resource configuration optimization, where the panel switching system allocates more CPU and memory resources to critical services to ensure real-time response to control commands; and finally, network parameter adjustments, where the device optimizes its WiFi and Zigbee communication parameters to handle greater network traffic load. For example, the new main panel will adjust its Zigbee transmit power to maximum and prioritize high-quality channel resources, thus providing a more stable connection for smart devices. This automated upgrade process significantly reduces switching time compared to traditional methods requiring manual intervention, typically completing the entire upgrade operation within 200 milliseconds. After completing its own upgrade, the new main panel device immediately broadcasts a role change notification to all other devices in the network. This notification is sent using a multicast protocol and includes important data such as the new main panel's device ID, network parameter change information, and configuration synchronization timestamps. Upon receiving the notification, the slave panel devices will make corresponding adaptation adjustments, such as updating the locally stored master panel address and adjusting the heartbeat detection cycle. For example, when slave panel C receives a change notification from the new master panel B, it will immediately change the target address of the configuration synchronization request to device B and reset its election timer. Compared with the traditional passive discovery method, this proactive notification mechanism enables the entire panel switching system to adapt to master-slave changes more quickly, minimizing the impact of the switching process on the control of intelligent devices.
[0109] Compared to existing technologies, this system achieves master-slave switchover time within seconds through automated upgrades. Furthermore, strict flag management and notification mechanisms avoid role conflicts common in traditional systems. The standardized switchover process adapts to IoT deployments of varying scales. In real-world smart home environments, this design ensures uninterrupted service even when a master-slave switchover occurs while the user is operating the device via a mobile app. All control commands are seamlessly transferred to the new master panel, significantly improving the availability and user experience of the panel switching system.
[0110] Optionally, the method further includes:
[0111] If the process running status weight of any slave panel device is set, the panel switching system will prevent that slave panel device from being elected as the new master panel device.
[0112] In this solution, when the process running status weight of a slave panel device is 0 (indicating a critical process abnormality), the panel switching system will actively prevent that device from being elected as the new master panel. This design effectively avoids promoting devices with functional defects to the master control node by monitoring the process health status in real time. Compared with the traditional technology that only detects the online status of devices, it can more accurately identify potential problems and ensure that the elected master panel has complete control capabilities. For example, when the Zigbee coordinator process of a slave panel crashes but its network connection is still maintained, the panel switching system will automatically exclude its candidate status due to its abnormal process status, preventing the election of a "zombie master panel" that cannot properly control smart devices. This fine-grained health check based on the process level greatly improves the reliability of the system, reduces the risk of smart devices going out of control due to incomplete master panel functionality, and provides users with a more stable smart home experience.
[0113] Optionally, when the main panel gateway detects that its own operating status can no longer guarantee full functionality, it initiates a self-degradation mechanism.
[0114] In this embodiment, the role identifier is changed from primary gateway to secondary gateway, and a status broadcast or multicast containing a degradation notification is proactively initiated to inform other devices in the network of this change. Specifically, the primary gateway performs a comprehensive self-check, evaluating core indicators such as cloud connection status, process running status, and wireless signal strength. When any key indicator falls below a threshold (e.g., WiFi signal strength drops to 0 or process status is abnormal), it is determined that the function is impaired. Thus, before performing degradation, the primary gateway's dedicated processes, such as the Zigbee coordinator service, are terminated, and the current Zigbee network configuration is cleared to avoid conflicts. Finally, the status broadcast sent will specifically mark the role change information, so that other secondary gateways can immediately perceive the vacancy of the primary node. For example, when the primary gateway triggers self-degradation due to a continuous CPU load exceeding 90%, it will complete all the above operations within 100 milliseconds to ensure that the system quickly returns to an available state.
[0115] Optionally, in network initialization scenarios, if only one panel gateway in the panel switching system is connected to the router, that gateway will automatically acquire the master role. This design ensures the immediate usability of the panel switching system upon initial deployment. This single panel gateway continuously monitors the network status, and when it detects other gateways connecting, it decides whether to retain the master role according to a standard election process. For example, when a newly installed smart home system is powered on for the first time, the only panel gateway A will default to becoming the master gateway. Three hours later, when gateway B joins the network, the two gateways will determine their master-slave relationship through a weighted comparison. If gateway B's overall performance is better, gateway A will proactively degrade to a slave gateway. This intelligent role allocation mechanism significantly simplifies the deployment process compared to the traditional method requiring manual assignment, while ensuring the optimal operating state of the system.
[0116] This approach prevents overall system degradation due to control node performance decline by using a self-degradation design in the main gateway, while the automatic upgrade mechanism for individual nodes ensures system availability across various deployment scenarios. Compared to traditional failover solutions requiring manual intervention, this design achieves truly automated fault-tolerant management, reducing the average recovery time of smart home systems from minutes to seconds, significantly improving system reliability and user experience. Particularly in large-area residential or multi-story villa applications, this dynamic role management automatically optimizes the control topology based on environmental factors such as device location changes and signal strength fluctuations, consistently maintaining optimal system performance.
[0117] Figure 5 This is a schematic diagram of a switching device for a panel device provided in an embodiment of this disclosure; combined with Figure 5 As shown in the figure, this disclosure provides a switching device 200 for panel devices, including: a monitoring module 51, a control module 52, an election module 53, and a switching module 54. The monitoring module 51 is configured to monitor the operating status of the master panel device to obtain monitoring information. The control module 52 is configured to control each slave panel device to broadcast its own status information when the monitoring information meets the master-slave switching conditions. The election module 53 is configured to elect a new master panel device based on the status information broadcast by each slave panel device. The switching module 54 is configured to perform a master-slave switching operation on the master panel device and the new master panel device.
[0118] The switching device for panel devices provided in this disclosure can monitor the operating status of the main panel device and trigger the slave panel devices to broadcast their respective status weight values when the switching conditions are met. Based on the weight values, the optimal new main panel device is selected and the master-slave switch is completed. This solves the problem of smart devices going out of control due to the failure of the main panel device, realizes dynamic backup and seamless switching between multiple panel devices, significantly improves the reliability and disaster recovery capability of the smart home system, and ensures that users can stably control home devices under any circumstances.
[0119] Figure 6 This is a schematic diagram of another switching device for a panel device provided in an embodiment of this disclosure. (In conjunction with...) Figure 6As shown, this disclosure provides a switching device 10 for a panel device, including a processor 100 and a memory 101. Optionally, the device 10 may further include a communication interface 102 and a bus 103. The processor 100, communication interface 102, and memory 101 can communicate with each other via the bus 103. The communication interface 102 can be used for information transmission. The processor 100 can call logical instructions in the memory 101 to execute the switching method for the panel device described in the above embodiment.
[0120] Furthermore, the logic instructions in the aforementioned memory 101 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium.
[0121] The memory 101, as a computer-readable storage medium, can be used to store software programs and computer-executable programs, such as program instructions / modules corresponding to the methods in the embodiments of this disclosure. The processor 100 executes functional applications and data processing by running the program instructions / modules stored in the memory 101, thereby implementing the switching method for the panel device described above.
[0122] The memory 101 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the terminal device. Furthermore, the memory 101 may include high-speed random access memory and may also include non-volatile memory.
[0123] This disclosure provides a panel device, including a panel device body and the aforementioned switching device 10 (200) for the panel device. The switching device 10 (200) for the panel device is mounted on the panel device body. The panel device can be a master panel device or a slave panel device. The mounting relationship described herein is not limited to placement inside the panel device body, but also includes mounting connections with other components of the panel device, including but not limited to physical connections, electrical connections, or signal transmission connections. Those skilled in the art will understand that the switching device 10 for the panel device can be adapted to feasible panel device bodies to achieve other feasible embodiments.
[0124] This disclosure provides a computer-readable storage medium storing computer-executable instructions configured to perform the above-described switching method for a panel device.
[0125] The technical solutions of this disclosure can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes one or more instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in this disclosure. The aforementioned storage medium can be a non-transitory storage medium, such as a USB flash drive, external hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, etc., and other media capable of storing program code.
[0126] The foregoing description and accompanying drawings fully illustrate embodiments of this disclosure to enable those skilled in the art to practice them. Other embodiments may include structural, logical, electrical, procedural, and other changes. The embodiments represent only possible variations. Individual components and functions are optional unless explicitly required, and the order of operation may vary. Parts and features of some embodiments may be included in or replace parts and features of other embodiments. Moreover, the terminology used in this application is for describing embodiments only and is not intended to limit the claims. As used in the description of embodiments and claims, the singular forms “a,” “an,” and “the” are intended to equally include the plural forms unless the context clearly indicates otherwise. Similarly, the term “and / or” as used in this application means including one or more of the associated listed items and all possible combinations thereof. Additionally, when used in this application, the term "comprise" and its variations "comprises" and / or "comprising" refer to the presence of stated features, integrals, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or groups thereof. Without further limitations, an element defined by the phrase "comprises a..." does not exclude the presence of other identical elements in the process, method, or apparatus that includes said element. In this document, each embodiment may focus on the differences from other embodiments, and similar or identical parts between embodiments can be referred to mutually. For methods, products, etc., disclosed in the embodiments, if they correspond to the method section disclosed in the embodiments, the relevant parts can be referred to the description of the method section.
[0127] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of this disclosure. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0128] The methods and products (including but not limited to devices and equipment) disclosed in the embodiments herein can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of units may be merely a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the shown or discussed units may be through some interfaces, and the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units may be selected to implement this embodiment according to actual needs. Furthermore, the functional units in the embodiments of this disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0129] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than that shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. In the descriptions corresponding to the flowcharts and block diagrams in the accompanying drawings, the operations or steps corresponding to different blocks may also occur in a different order than disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. Each block in a block diagram and / or flowchart, and combinations of blocks in a block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
Claims
1. A switching method for a panel device, characterized in that, Applied to a panel switching system, the panel switching system includes a master panel device and multiple slave panel devices; the method includes: Monitor the operating status of the main panel device to obtain monitoring information; When the monitoring information meets the master-slave switching conditions, control each slave panel device to broadcast its own status information; Based on the status information broadcast by each slave panel device, a new master panel device is elected; Perform master-slave switching operations on the main panel device and the new main panel device.
2. The method according to claim 1, characterized in that, Master-slave switching conditions include: No status response is received from the main panel device for N consecutive detection cycles, N≥2; and / or, The main panel device's cloud connection status is offline; and / or, The WiFi signal strength level of the main panel device reaches the preset level; and / or, The Zigbee signal strength level of the main panel device reaches the preset level; and / or, The critical processes of the main panel device are running in an abnormal state.
3. The method according to claim 1, characterized in that, Based on the status information broadcast by each slave panel device, a new master panel device is elected, including: Calculate the state weight value of each slave panel device based on the state information broadcast by each slave panel device. A new master panel device is elected based on the state weight values of each slave panel device.
4. The method according to claim 3, characterized in that, Based on the status information broadcast by each slave panel device, calculate the status weight value of each slave panel device, including: Based on the status information broadcast by each slave panel device, determine the cloud connection status weight value, process running status weight value, WiFi signal strength level weight value, Zigbee signal strength level weight value, CPU load rate weight value, and role status weight value for each slave panel device. The sum of the cloud connection status weight value, process running status weight value, WiFi signal strength level weight value, Zigbee signal strength level weight value, CPU load rate weight value, and role status weight value of each slave panel is used as the status weight value of each slave panel device.
5. The method according to claim 3, characterized in that, Based on the status information broadcast by each slave panel device, calculate the status weight value of each slave panel device, including: Assign weighting coefficients to each status information item; The weight values corresponding to each state information are weighted according to the weighting coefficients to obtain the state weight value of each slave panel device.
6. The method according to claim 3, characterized in that, Based on the state weight values of each slave panel device, a new master panel device is elected, including: The controller sorts the state weight values of each slave panel device by the state weight values broadcast by other slave panel devices. If any slave panel device determines that its state weight value is the largest according to the sorting result, then the slave panel device is controlled to broadcast a recommendation to become the new master panel device, or... If the sorting results determine that all slave panel devices have the same state weight value, then control all slave panel devices to send a recommendation broadcast, and the slave panel device that sends the recommendation broadcast the fastest will be designated as the new master panel device.
7. The method according to claim 3, characterized in that, The panel switching system includes a weighted decision module; based on the status weight values of each slave panel device, it elects a new master panel device, including: Each slave panel device is controlled to send its own state weight value to the weight decision module, so that the weight decision module can obtain the sorting result; If the weight decision module determines, based on the sorting results, that there are multiple slave panel devices with the largest and identical state weight values, it controls these multiple slave panel devices to send a recommendation broadcast, and designates the slave panel device that sends the recommendation broadcast fastest as the new master panel device; or... If the weight decision module determines, based on the sorting results, that there are multiple slave panel devices with the largest and same state weight values, then a new master panel device is elected according to the pre-stored device state priority strategy.
8. The method according to claim 1, characterized in that, Perform master-slave switchover operations on the main panel device, including: Change the role of the master panel device to a slave panel device, control the master panel device to clear the current Zigbee network configuration, terminate the current service process, and control the master panel device to synchronize the latest Zigbee network configuration from the new master panel device.
9. The method according to claim 1, characterized in that, Perform a master-slave switchover operation on the new main panel device, including: Change the role identifier of the new main panel device to the main panel device, perform the device upgrade operation, and send role change notifications to other devices.
10. The method according to claim 1, characterized in that, The method further includes: When the main panel device detects that its own operating status can no longer guarantee full functionality, it initiates a self-degradation mechanism to change the main panel device's role identifier.
11. A switching device for a panel device, comprising a processor and a memory storing program instructions, characterized in that, The processor is configured to execute, when running the program instructions, the switching method for a panel device as described in any one of claims 1 to 10.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when executed, performs the switching method for a panel device according to any one of claims 1 to 10.
Citation Information
Patent Citations
Multi-main-control redundancy switching control method and system
CN110658718A
Method and device for equipment control, control system and computer readable storage medium
CN117376044A
Main and standby switching method and system based on online and offline mechanism and terminal
CN118900231A