Multi-terminal master-slave adaptive control method

By using multicast channels for adaptive management of terminal identities in the energy storage control system, the problem of multi-terminal control conflicts is solved, ensuring system stability and rapid switching of master and slave identities, and achieving stable operation without the need for additional hardware.

CN121509486APending Publication Date: 2026-02-10GUIZHOU MEILING POWER SUPPLY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511790829.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-01
Publication Date
2026-02-10

AI Technical Summary

Technical Problem

In energy storage control systems, the deployment of multiple terminals can lead to control conflicts and inconsistent decision-making, and the inability to add a central server or communication interface results in insufficient system stability.

Method used

The multicast channel of the energy storage control system is used to achieve adaptive identity management between terminals. A unique login ID is generated based on the power-on time, and identity and status data are broadcast periodically to maintain the local device status list, ensuring that there is only one master controller and multiple slave controllers, thus avoiding control conflicts.

Benefits of technology

It achieves multi-terminal master-slave adaptive control without the need for additional hardware or communication interfaces, ensuring stable system operation, quickly switching master and slave identities, avoiding control interruptions, and improving the system's fault resistance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121509486A_ABST
    Figure CN121509486A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of multi-terminal control, in particular to a multi-terminal master-slave adaptive control method, which comprises the following steps that: a plurality of terminals generate unique login IDs after being electrified, and run as a slave control machine by default; each terminal periodically broadcasts a self login ID, key state data and a life signal value based on an existing multicast channel of the energy storage control system, and receives data of other terminals at the same time; each terminal independently maintains a local equipment state list and updates the local equipment state list in real time; determining master and slave identities based on whether a master control machine field in the list is determined, keeping a one-master and multi-slave mode, starting a display and control function by the master control machine, and only starting a display function by the slave control machine; detecting the online state of the terminal through the life signal numerical value, and deleting the terminal if the terminal is not updated overtime; and supporting the slave control computer to apply for the master control identity and the master control computer to actively exit, and triggering the master and slave identities to reconfirm. Hardware or a communication interface does not need to be newly added, control conflicts are avoided, master-slave adaptive switching is achieved, and stable operation of the system is guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of multi-terminal control technology, and more specifically to a multi-terminal master-slave adaptive control method. Background Technology

[0002] In existing energy storage control systems, the lower-level computer and multiple integrated display and control terminals belong to the same network. Each integrated display and control terminal has display and control functions, including automated energy storage charging and discharging control capabilities. The integrated display and control terminal needs to calculate and implement complex automated energy storage charging and discharging processes based on instructions from the upper-level computer and sensor data fed back from the lower-level computer. The lower-level computer is responsible for sensor data sampling, data feedback, and simple response to the terminal's device control commands, but does not have the automated energy storage charging and discharging control function.

[0003] If only a single terminal is deployed in an energy storage control system, the system will collapse due to the loss of its automated control core if that terminal fails, potentially leading to a major quality incident. To avoid this and improve system robustness, multiple terminals are typically deployed in the energy storage control system. As long as one terminal is functioning normally, the automated charging and discharging process of the energy storage control system can continue. However, if each terminal autonomously activates its control function, inconsistent decision-making and control may occur, leading to duplicate or erroneous control of the equipment by the lower-level machine, resulting in unpredictable control risks and reducing the system's robustness. Therefore, it is necessary to assign master and slave controllers to the multiple terminals. This requires communication between the terminals or a central server to assign master and slave controllers. However, since the energy storage control system is already established, it is impossible to add a central server to achieve master-slave assignment. The energy storage control system also does not reserve dedicated communication interfaces between terminals, and the communication addresses of the entire system are planned by the upper-level system, making it impossible to allocate additional communication addresses. Therefore, a multi-terminal master-slave adaptive control method based on the existing energy storage control system is urgently needed.

[0004] Considering that each terminal can receive multicast data from the energy storage control system, all terminals can receive all data sent to the multicast channel after listening to it. Therefore, using the existing multicast channel resources to realize the status data interaction between terminals is a feasible path to realize the multi-terminal master-slave adaptive control method. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this invention aims to provide a multi-terminal master-slave adaptive control method. It leverages the existing multicast resources of the energy storage control system to enable communication between multiple terminals without requiring additional hardware or communication interfaces. This method avoids control conflicts among multiple terminals and ensures the continuous and stable operation of the system.

[0006] The basic solution provided by this invention is a multi-terminal master-slave adaptive control method, comprising the following steps: S1: After multiple terminals are powered on, they are connected to the energy storage control system. The terminals have display and control functions. Each terminal runs as a slave controller by default and generates a unique login ID based on its own power-on time. S2: Each terminal, based on the multicast channel of the energy storage control system, broadcasts its own login ID, key status data, and life signal value at a preset period through the master-slave synchronous transmission protocol, while simultaneously receiving login IDs, key status data, and life signal values ​​broadcast by other terminals; the key status data includes whether it is a master controller field and whether it has applied for master controller identity field; the life signal value increments by 1 each time the terminal broadcasts; S3: Each terminal creates its own local device status list, storing its own login ID, key status data, and life signal values ​​as well as those of other terminals; S4: Each terminal confirms its status as the master controller based on the master controller field in its local device status list, always maintaining a system with one master controller and multiple slave controllers. If each terminal reads from its local device status list that it is currently in a masterless state, the terminal with the earliest power-on time corresponding to the login ID becomes the master controller. The master controller enables both display and control functions, while the slave controllers only enable the display function. S5: If the life signal value of a terminal is not updated within a preset time threshold, other terminals shall delete the login ID, key status data and life signal value of the terminal from their respective local device status lists. S6: When a slave device needs to obtain master control identity, it initiates a master control application by updating its own "whether it has applied for master control identity" field; after the current master device reads from the local device status list that a slave device has applied for master control identity, it updates its own "whether it is a master device" field to exit the master control identity; after the slave device that initiated the application reads from the local device status list that it is currently in a no-master state, it updates its own "whether it is a master device" field to become the master device; S7: When the master controller needs to actively relinquish its master controller status, it becomes a slave controller by updating its own master controller status field; after each terminal reads the current state of no master controller from the local device status list, each terminal executes S4 to determine the master controller.

[0007] The principle of this invention lies in: based on the existing multicast channel of the energy storage control system, it realizes distributed data interaction and adaptive master-slave identity management among multiple terminals without relying on a central server or adding new communication interfaces, as detailed below: During terminal initialization, a unique login ID is generated based on the power-on time to ensure that each terminal's identity is distinguishable, laying the foundation for subsequent data association and identity recognition. Terminals periodically broadcast their complete identity (login ID), key status data (whether they are the master controller and whether they have applied for master controller status), and life signal values ​​via multicast channels, while simultaneously receiving relevant data from other terminals to achieve distributed data synchronization. Each terminal independently maintains its local device status list, uniformly storing its own data and data related to other terminals, ensuring that each terminal has complete decision-making basis and preventing a single node failure from affecting the entire system. Based on the "whether it is the master controller" field in the local device status list, a master-slave operation mode restricts control functions to only the master controller, fundamentally preventing control conflicts between multiple terminals. Based on the periodic update characteristics of life signal values, real-time detection of terminal online status is achieved, promptly clearing offline terminal data and ensuring the validity of the list data. When a slave controller applies for master controller status or the master controller actively exits, the system triggers master-slave identity reconfirmation through updates and broadcasts of relevant fields in the key status data, ensuring that the system always has one and only one master controller and guaranteeing uninterrupted control flow.

[0008] The beneficial effects of this invention are as follows: 1. Adapt to existing system architecture, without relying on a central server or adding new communication interfaces: Data interaction is achieved by utilizing the existing multicast channels of the energy storage control system. There is no need to add a central server, dedicated communication interface or allocate new communication address. It perfectly adapts to the established energy storage control system and reduces the transformation cost. 2. Avoid conflicts in multi-terminal control and improve system stability: Through the master-slave operation mode, only the master controller enables the control function, while the slave controllers only retain the display function, which solves the problems of inconsistent decision-making, duplicate control or erroneous control caused by autonomous control of multiple terminals. 3. Enables adaptive master-slave switching to ensure continuous system operation: Supports slave devices to apply for master status and master devices to voluntarily exit. The switching process is automatically triggered without manual intervention. When the original master device fails or exits, the system can quickly re-confirm the new master device to avoid interruption of the control process. At the same time, each terminal independently maintains its local device status list. Even if some terminals are offline, the remaining terminals can still operate normally and complete the master-slave switching, further improving the system's fault resistance.

[0009] 4. Accurately detect the online status of terminals to ensure data validity: Through the periodic update and timeout cleanup mechanism of life signal values, offline terminal data is promptly removed to avoid invalid data affecting master-slave identity confirmation and system decision-making.

[0010] Furthermore, both the "whether it is a master controller" field and the "whether it has applied for master controller identity" field have only two values: true and false. When the "whether it is a master controller" field is true, it indicates that the terminal is a master controller; when it is false, it indicates that the terminal is a slave controller. When the "whether it has applied for master controller identity" field is true, it indicates that the terminal has initiated a master controller application; when it is false, it indicates that the terminal has not initiated a master controller application. The specific steps of S4 include: S41: Each terminal reads its own local device status list. If the local device status list contains only one terminal's login ID, key status data, and life signal value, then that terminal sets its own master / master status field to true and becomes the master / master. Then, S5 is executed. Otherwise, S42 is executed. S42: Each terminal reads its own local device status list. If a terminal with the "whether it is the master controller" field set to true already exists in the local device status list, then the terminal with the "whether it is the master controller" field set to false remains a slave controller, and then S5 is executed; otherwise, each terminal continues to execute S43. S43: Each terminal reads its own local device status list. If all terminals in the local device status list have the "Whether it is the master controller" field as false, it indicates that the current state is without a master controller. Each terminal then checks whether the login ID of the terminal with the earliest online time in the list is the login ID of its own terminal. If so, it sets its own "Whether it is the master controller" field to true and switches to become the master controller. Otherwise, it remains a slave controller.

[0011] By dividing the system into "automatically becoming the master controller when only it is online," "maintaining slave control when a master controller already exists," and "confirming by online time when there is no master controller," conflicts in master / slave identity confirmation or situations where no one is the master controller are avoided. Using online time as the method for determining the master controller when there is no master controller is efficient and stable: the online time is uniquely identified by the login ID, eliminating the need for additional related parameters and function calculations, making the logic simple and traceable. In addition, the earliest online terminal usually runs more stably, and acting as the master controller can improve the system's operational reliability. Under this scheme, it can be ensured that regardless of the initial state of the system, a mode of operation with one master controller and multiple slave controllers can be achieved in the end, effectively avoiding control conflicts.

[0012] Furthermore, the specific steps of S6 include: S61: When a slave device initiates a master control request, it updates its own master control status field to true; S62: When the current master controller reads that a terminal in the local device status list has a "whether it has applied for master controller identity" field that is true, it updates its own "whether it is a master controller" field to false and switches to a slave controller. S63: When the slave device that initiated the master control application reads that all terminals in the local device status list have the "Whether it is a master control device" field as false, it indicates that it is currently in a state without a master control device. It then updates its own "Whether it is a master control device" field to true and the "Whether it has applied for master control status" field to false, and becomes the master control device.

[0013] Clearly define the response logic of the current master controller to ensure a smooth transition during master-slave switching: After the current master controller reads the request, it first updates its own status to slave controller, and then triggers the process of reconfirming the master controller, avoiding a brief conflict period when the old and new master controllers coexist, and ensuring seamless connection of the control process; In addition, by binding the login ID with the broadcast of key status data, all terminals can synchronously perceive the change in master-slave identity, which facilitates subsequent fault diagnosis and status backtracking and improves system maintainability. Attached Figure Description

[0014] Figure 1 This is a flowchart of an embodiment of a multi-terminal master-slave adaptive control method according to the present invention. Detailed Implementation

[0015] The following detailed description illustrates the specific implementation method: The basic implementation examples are as follows: Figure 1 As shown: A multi-terminal master-slave adaptive control method includes the following steps: S1: After multiple terminals are powered on, they are connected to the energy storage control system. The terminals have display and control functions. Each terminal runs as a slave controller by default and generates a unique login ID based on its own power-on time. In this embodiment, the login ID is accurate to the millisecond level (e.g., 20251001143000143) to ensure that multiple terminals can generate their own unique login IDs when they are powered on at similar times. S2: Each terminal, based on the multicast channel of the energy storage control system, broadcasts its own login ID, key status data, and life signal value at a preset period through a master-slave synchronous transmission protocol, while simultaneously receiving login IDs, key status data, and life signal values ​​broadcast by other terminals; the key status data includes whether it is a master controller field and whether it has applied for master controller identity field; the life signal value increments by 1 each time the terminal broadcasts; in this embodiment, the preset period is set to 200ms, which ensures data real-time performance while avoiding excessive bandwidth consumption from frequent broadcasts; S3: Each terminal creates its own local device status list to store its own login ID, key status data, and vital sign values ​​as well as those of other terminals. In this embodiment, the list is stored in key-value pair format, with the login ID as the index, which facilitates quick querying, updating, and deletion of data for the corresponding terminal. S4: Each terminal confirms its status as the master controller based on the master controller field in its local device status list, always maintaining a system with one master controller and multiple slave controllers. If each terminal reads from its local device status list that it is currently in a masterless state, the terminal with the earliest power-on time corresponding to the login ID becomes the master controller. The master controller enables both display and control functions, while the slave controllers only enable the display function. S5: If the life signal value of a terminal is not updated within a preset time threshold, other terminals delete the login ID, key status data and life signal value of the terminal from their respective local device status lists. In this embodiment, the preset time threshold is set to 3s. That is, if a terminal does not broadcast data for 3 consecutive seconds (the life signal value does not increment), it is determined to be offline. Other terminals will simultaneously clean up its data to avoid invalid data occupying storage resources or affecting decision-making. S6: When a slave device needs to obtain master control identity, it initiates a master control application by updating its own "whether it has applied for master control identity" field; after the current master device reads from the local device status list that a slave device has applied for master control identity, it updates its own "whether it is a master device" field to exit the master control identity; after the slave device that initiated the application reads from the local device status list that it is currently in a no-master state, it updates its own "whether it is a master device" field to become the master device; S7: When the master controller needs to actively relinquish its master controller status, it becomes a slave controller by updating its own master controller status field; after each terminal reads the current state of no master controller from the local device status list, each terminal executes S4 to determine the master controller.

[0016] The "Whether it is a master controller" field and the "Whether it applies for master controller identity" field both have only two values: true and false. When the "Whether it is a master controller" field is true, it indicates that the terminal is a master controller; when it is false, it indicates that the terminal is a slave controller. When the "Whether it applies for master controller identity" field is true, it indicates that the terminal has initiated a master controller application; when it is false, it indicates that the terminal has not initiated a master controller application. The specific steps of S4 include: S41: Each terminal reads its own local device status list. If the local device status list contains only one terminal's login ID, key status data, and life signal value, then that terminal sets its own master / master status field to true and becomes the master / master. Then, S5 is executed. Otherwise, S42 is executed. S42: Each terminal reads its own local device status list. If a terminal with the "whether it is the master controller" field set to true already exists in the local device status list, then the terminal with the "whether it is the master controller" field set to false remains a slave controller, and then S5 is executed; otherwise, each terminal continues to execute S43. S43: Each terminal reads its own local device status list. If all terminals in the local device status list have the "Whether it is the master controller" field as false, it indicates that the current state is without a master controller. Each terminal then checks whether the login ID of the terminal with the earliest online time in the list is the login ID of its own terminal. If so, it sets its own "Whether it is the master controller" field to true and switches to become the master controller. Otherwise, it remains a slave controller.

[0017] If only terminal A is powered on in the system, terminal A's local device status list only includes its own data. Terminal A automatically switches to master controller and enables display and control functions. If terminal B powers on after terminal A, terminal B receives and stores terminal A's data. If the "Whether it is a master controller" field in the local device status list of terminal A is true, terminal B remains a slave controller and only enables display functions. Alternatively, if the energy storage control system has terminals A, B, and C that are operating normally after power-on, with A as the master controller, and terminal A fails and goes offline, the "Whether it is a master controller" field for all terminals in the local device status lists of terminals B and C will be false. Comparing the online times corresponding to the login IDs, terminal B went online earlier than terminal C, so terminal B switches to master controller.

[0018] The specific steps of S6 include: S61: When a slave device initiates a master control request, it updates its own master control status field to true; S62: When the current master controller reads that a terminal in the local device status list has a "whether it has applied for master controller identity" field that is true, it updates its own "whether it is a master controller" field to false and switches to a slave controller. S63: When the slave device that initiated the master control application reads that all terminals in the local device status list have the "Whether it is a master control device" field as false, it indicates that it is currently in a state without a master control device. It then updates its own "Whether it is a master control device" field to true and the "Whether it has applied for master control status" field to false, and becomes the master control device.

[0019] If terminal C needs to apply for master control status, it sets the "Apply for master control status" field to true and broadcasts a data packet containing its login ID (e.g., 20251001143000143), updated critical status data, and life signal value (e.g., 15). Assuming terminal B is the current master, and terminal B's local device status list contains terminal (i.e., terminal C) with the "Apply for master control status" field set to true, then terminal B sets its own "Master control status" field to false and broadcasts its login ID, updated critical status data, and life signal value, completing the switch from master to slave. After terminal C reads that all terminals in its local device status list have the "Master control status" field set to false, it updates its own "Master control status" field to true and the "Apply for master control status" field to false, thus becoming the master.

[0020] This embodiment achieves adaptive management of multi-terminal master-slave identities through the above process, without the need for additional hardware or manual intervention, effectively avoiding control conflicts and improving the robustness and continuous operation capability of the energy storage control system.

[0021] The above are merely embodiments of the present invention. Commonly known structures and characteristics are not described in detail here. Those skilled in the art are aware of all common technical knowledge in the field prior to the application date or priority date, are aware of all existing technologies in that field, and have the ability to apply conventional experimental methods prior to that date. Those skilled in the art can, under the guidance of this application, improve and implement this solution in combination with their own capabilities. Some typical known structures or methods should not be obstacles for those skilled in the art to implement this application. It should be noted that those skilled in the art can make several modifications and improvements without departing from the structure of the present invention. These should also be considered within the scope of protection of the present invention, and will not affect the effectiveness of the implementation of the present invention or the practicality of the patent. The scope of protection claimed in this application should be determined by the content of its claims, and the specific embodiments described in the specification can be used to interpret the content of the claims.

Claims

1. A multi-terminal master-slave adaptive control method, characterized in that, Includes the following steps: S1: After multiple terminals are powered on, they are connected to the energy storage control system. The terminals have display and control functions. Each terminal runs as a slave controller by default and generates a unique login ID based on its own power-on time. S2: Each terminal, based on the multicast channel of the energy storage control system, broadcasts its own login ID, key status data, and life signal value at a preset period through the master-slave synchronous transmission protocol, while simultaneously receiving login IDs, key status data, and life signal values ​​broadcast by other terminals; the key status data includes whether it is a master controller field and whether it has applied for master controller identity field; the life signal value increments by 1 each time the terminal broadcasts; S3: Each terminal creates its own local device status list, storing the login ID, key status data, and life signal values ​​of all terminals; S4: Each terminal confirms its status as the master controller based on the master controller field in its local device status list, always maintaining a system with one master controller and multiple slave controllers. If each terminal reads from its local device status list that it is currently in a masterless state, the terminal with the earliest power-on time corresponding to the login ID becomes the master controller. The master controller enables both display and control functions, while the slave controllers only enable the display function. S5: If the life signal value of a terminal is not updated within a preset time threshold, other terminals shall delete the login ID, key status data and life signal value of the terminal from their respective local device status lists. S6: When a slave device needs to obtain master control identity, it initiates a master control application by updating its own "whether it has applied for master control identity" field; after the current master device reads from the local device status list that a slave device has applied for master control identity, it updates its own "whether it is a master device" field to exit the master control identity; after the slave device that initiated the application reads from the local device status list that it is currently in a no-master state, it updates its own "whether it is a master device" field to become the master device; S7: When the master controller needs to actively relinquish its master controller status, it becomes a slave controller by updating its own master controller status field; after each terminal reads the current state of no master controller from the local device status list, each terminal executes S4 to determine the master controller.

2. The multi-terminal master-slave adaptive control method according to claim 1, characterized in that, The "Whether it is a master controller" field and the "Whether it applies for master controller identity" field both have only two values: true and false. When the "Whether it is a master controller" field is true, it indicates that the terminal is a master controller; when it is false, it indicates that the terminal is a slave controller. When the "Whether it applies for master controller identity" field is true, it indicates that the terminal has initiated a master controller application; when it is false, it indicates that the terminal has not initiated a master controller application. The specific steps of S4 include: S41: Each terminal reads its own local device status list. If the local device status list contains only one terminal's login ID, key status data, and life signal value, then that terminal sets its own master / master status field to true and becomes the master / master. Then, S5 is executed. Otherwise, S42 is executed. S42: Each terminal reads its own local device status list. If a terminal with the "whether it is the master controller" field set to true already exists in the local device status list, then the terminal with the "whether it is the master controller" field set to false remains a slave controller, and then S5 is executed; otherwise, each terminal continues to execute S43. S43: Each terminal reads its own local device status list. If all terminals in the local device status list have the "Whether it is the master controller" field as false, it indicates that the current state is without a master controller. Each terminal then checks whether the login ID of the terminal with the earliest online time in the list is the login ID of its own terminal. If so, it sets its own "Whether it is the master controller" field to true and switches to become the master controller. Otherwise, it remains a slave controller.

3. The multi-terminal master-slave adaptive control method according to claim 2, characterized in that, The specific steps of S6 include: S61: When a slave device initiates a master control request, it updates its own master control status field to true; S62: When the current master controller reads that a terminal in the local device status list has a "whether it has applied for master controller identity" field that is true, it updates its own "whether it is a master controller" field to false and switches to a slave controller. S63: When the slave device that initiated the master control application reads that all terminals in the local device status list have the "Whether it is a master control device" field as false, it indicates that it is currently in a state without a master control device. It then updates its own "Whether it is a master control device" field to true and the "Whether it has applied for master control status" field to false, and becomes the master control device.