A system and method supporting seamless switching between PLC and intelligent controller
By using the bidirectional mapping technology of multidimensional state maintainers and data isolation synchronization modules, the connection interruption problem during the switching between traditional PLCs and intelligent controllers is solved, realizing the continuity of PLC-side protocol connection and equipment-side control, and ensuring the stability and security of production control.
Patent Information
- Application Number
- CN202611108908.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-24
- Publication Date
- 2026-11-17
AI Technical Summary
Existing technologies struggle to maintain continuous operation of industrial protocol connections on the PLC side and continuous operation of physical control on the equipment side when seamlessly switching between traditional PLCs and heterogeneous intelligent controllers. Furthermore, the lack of effective alternative feedback mechanisms leads to connection interruptions, alarms, and sudden changes in program state.
By employing a multi-dimensional state maintainer and a data isolation and synchronization module, the mapping between PLC downlink data and real equipment is isolated through bidirectional mapping between the northbound device protocol endpoint and the southbound control protocol endpoint, generating an alternative process image, and using the state continuity and back-off determination unit to achieve seamless switching between PLC and intelligent controller.
It enables seamless switching between traditional PLCs and intelligent controllers while maintaining continuous operation of industrial protocol connections on the PLC side and continuous operation of physical control on the equipment side, avoiding protocol timeouts and sudden state changes, and ensuring the continuity and security of production control.
Smart Images

Figure CN123113645A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial control technology, and in particular to a system and method that supports seamless switching between PLC and intelligent controller. Background Technology
[0002] In control systems employing PROFINET, EtherCAT, or other cyclic industrial communication protocols, the PLC and field devices not only exchange process variables but also maintain protocol states such as device identity, module configuration, control status words, watchdog timers, and application relationships. Traditional PLCs typically treat the continuity of protocol connections and physical device control as a single link: if the PLC no longer receives periodic feedback directly from the actual device, it may interpret the device as offline or experiencing a communication failure; if a field device establishes a new connection with another controller, it may need to re-parameterize, re-handshake, or wait for a watchdog timer reset. Therefore, in current scenarios, when physical control is temporarily delegated to a local intelligent controller, even if the local control itself functions normally, connection interruptions, alarms, and sudden program state changes may still occur on the remote hardware PLC side, thus affecting subsequent production control.
[0003] Traditional master-slave PLC redundancy typically requires two controllers to run the same or compatible control programs and continuously synchronize memory, I / O images, and internal states. This approach is suitable for fault backup, but it struggles to cover scenarios where the traditional PLC maintains its original program while a local heterogeneous intelligent controller temporarily takes over the actual device. Intelligent controllers generally employ different hardware, runtime environments, and control algorithms; their purpose is not simply to replicate the logic of a traditional PLC, but rather to achieve functions such as visual correction or advanced optimization. If the connection between the PLC and the device is simply disconnected and the intelligent controller takes over, the PLC protocol session is prone to timeouts; if the PLC output is still passed through to the actual device, exclusive local control cannot be established; and if real feedback is restored immediately after the takeover, the difference between the PLC's expected state and the physical state may cause output step shifts or reverse corrections.
[0004] Existing technology 1: Authorized patent CN101004587B, "A Synchronization Method for Redundant Controllers for Seamless Switching During Normal and Mismatch Conditions." This method discloses the transmission of process control area status information from the primary controller to the backup controller, and the initialization of the backup controller using other process control network information in the event of program mismatch, thereby achieving seamless fault switching of the redundant controllers. This scheme focuses on the state synchronization of the primary and backup controllers and the initialization of the backup controller, and is applicable to redundant controller pairs. However, it does not decouple the PLC-side protocol session from the physical control of the actual equipment, nor does it disclose the provision of alternative feedback based on model extrapolation to the PLC by a continuously existing proxy endpoint during the period when the heterogeneous intelligent controller takes over the actual equipment.
[0005] Existing technology two: Authorized patent US6411857B1, "Redundant, multitasking industrial controllers with synchronized data tables." It discloses primary and backup industrial controllers and synchronized I / O data tables. Before the primary controller sends its output value to the controlled industrial process via the I / O module, the complete output value is first transmitted to the backup controller, and an isolated data table is used to avoid partial updates and data bounces. This scheme can reduce "data spurts" during redundancy switching, but it requires the backup controller to keep a copy of the user program and synchronize I / O data through a dedicated or shared link. The control structure still belongs to the same type of primary-backup redundancy. Its isolation table is used for primary-backup data consistency, not for simultaneously isolating the PLC virtual feedback domain and the intelligent controller's real device domain, and it does not form a continuous device protocol endpoint for the PLC.
[0006] Existing technology three: Authorized patent CN104536413B, "A method and system for seamless redundant transmission of I / O data in a communication control system." It discloses two communication cards acquiring the same I / O data, with master and slave control stations receiving data separately. When the master station or its communication card malfunctions, the data forwarded by the slave station is used, thereby shortening the cycle of rereading I / O data. This solution focuses on ensuring that I / O data can still reach the master control station when the communication channel or communication card fails, with the actual I / O data being transmitted between redundant channels. However, it does not address the problem that the local intelligent controller has changed the actual device state while the PLC still needs to maintain the original protocol cycle, nor does it generate an alternative process image with sequence numbers, quality, and amplitude constraints based on the model.
[0007] Based on the existing technologies described above, traditional bumpless handover mainly relies on homogeneous or compatible primary and backup controllers, user program copies, memory or I / O image synchronization, and redundant communication links. Its shortcomings are: Existing solutions are mainly designed for fault switching of homogeneous master and backup controllers. They do not effectively decouple the PLC protocol connection from the physical control path, making it difficult to support the continuous operation of traditional PLCs and allow heterogeneous intelligent controllers to independently take over the real equipment. The existing process image is mainly used for master-slave state replication, and lacks a mechanism to generate verifiable alternative feedback during the feedback isolation between PLC and real equipment, and to isolate and manage remote commands, local commands and real feedback. Existing switchback conditions typically only focus on synchronization completion or backup controller readiness, without comprehensively considering the continuous convergence of multi-source commands, real feedback, alternative feedback, and time difference. Summary of the Invention
[0008] This invention provides a system and method for supporting seamless switching between PLCs and intelligent controllers. This system allows for the transfer of control of underlying devices between a traditional PLC and a local intelligent controller while maintaining continuous operation of the industrial protocol connection on the PLC side and continuous physical control on the device side. The technical solution is as follows: On the one hand, a system supporting seamless switching between PLC and intelligent controller is provided, including: a remote hardware PLC, a northbound device protocol endpoint for the PLC, an application status channel, a southbound control protocol endpoint for the real device, the underlying real device, a multi-dimensional state holder, a local intelligent controller, a data isolation and synchronization module, and a state continuity and switchback determination unit; among which, The northbound device protocol endpoint is used to communicate with the remote hardware PLC; The southbound control protocol endpoint is used to communicate with the actual device; The application status channel is used to map the PLC downlink data received by the northbound device protocol endpoint to the southbound device protocol endpoint under normal control conditions, and to map the real feedback received by the southbound device protocol endpoint back to the northbound device protocol endpoint; wherein, under normal control conditions, the remote hardware PLC is the only write source of the real device. The multi-dimensional state maintainer communicates with the northbound device protocol endpoint to isolate the mapping between PLC downlink data and the real device during takeover, making the local intelligent controller the sole write source for the real device, and generating an alternative process image based on the state before switching, PLC remote instructions, and device model, so that the northbound device protocol endpoint responds to the PLC according to the original protocol cycle. The local intelligent controller is used to generate local control commands to drive real devices to perform corresponding local tasks. The data isolation and synchronization module is used to store traceable and consistent data through a remote command pool, a local command pool, and a real feedback pool. The state continuity and back-cut determination unit is used to compare the control states of the remote and local systems using data from the remote instruction pool, local instruction pool, and real feedback pool after the local task is completed. It adopts the method of physical state to virtual state convergence or alternative feedback to real feedback gradual convergence. When the command difference, feedback difference, and time difference meet the threshold for N consecutive cycles, the original PLC mapping is restored at the common cycle boundary time.
[0009] Furthermore, the northbound device protocol endpoint presents the PLC with a module structure, process data length, and device identity that match the actual equipment engineering configuration, and maintains the PLC-side session, cycle number, and data status from system startup. The southbound control protocol endpoint establishes a connection with the actual equipment as an independent control source, and is responsible for process data transmission and reception, equipment diagnosis, and actual output submission.
[0010] Furthermore, the northbound device protocol endpoint and the southbound control protocol endpoint are integrated in the same edge device; or, the northbound device protocol endpoint and the southbound control protocol endpoint are deployed in gateway A, which is close to the remote hardware PLC, and gateway B, which is close to the actual device, respectively. When both are deployed in a distributed manner, the protocol interaction cycle between the northbound device protocol endpoint and the remote hardware PLC is maintained by the local real-time scheduler of gateway A, and the protocol interaction cycle between the southbound control protocol endpoint and the actual device is maintained by the local real-time scheduler of gateway B. The application status with timestamp, sequence number and validity period is transmitted between the northbound device protocol endpoint and the southbound control protocol endpoint through the application status channel.
[0011] Furthermore, the system also includes: a safety bypass unit; The multidimensional state maintainer includes: a downlink protocol isolation unit, a northbound protocol state machine, a virtual process mapping unit, a state deduction unit, and a periodic scheduler; wherein... The downlink protocol isolation unit is used to allow PLC downlink data to be mapped to the southbound device protocol endpoint under normal conditions; after the takeover cycle boundary, it writes the PLC downlink data to the remote instruction pool and saves the last valid control word, target position, target speed, cycle number and timestamp before the switchover. The northbound protocol state machine is used to accept the connection from the PLC side from the initialization phase. The virtual process image unit is used to construct the input and output areas according to the data layout configured in the PLC project. It replaces process data and only updates ordinary process variables and non-safe operating states. Emergency stops, safety I / O, real drive faults, and communication device faults are directly transmitted by the safety bypass unit with the highest priority. The state simulation unit is used to generate an alternative process image associated with the cycle number, status word and quality identifier, and whose process variables have been limited, based on the last confirmed real state before the switch, the last valid remote command of the PLC and the equipment model, and to feed the alternative process image back to the PLC. The periodic scheduler uses the monotonic clock and real-time scheduling thread of its edge device to update the sequence number, data validity identifier, and alternative process image in each northbound protocol cycle, and submits uplink data according to the time specified in the protocol. If the state projection is not completed before the end of the current cycle, the periodic scheduler uses the valid state after the limit of the previous cycle and records the device model hysteresis diagnosis. If the allowed number of consecutive occurrences is exceeded, it enters the degraded state and requests controlled stop.
[0012] Furthermore, the data isolation and synchronization module includes: a remote command pool, a local command pool, and a real feedback pool that are mutually isolated; wherein, The remote instruction pool is used to store the remote control commands uR, timestamp tR, cycle number seqR, and validity period generated by the PLC. The local command pool is used to store the actual commands (uL), task stages, and control epochs issued by the local intelligent controller. The real feedback pool is used to store real feedback yP, device status, quality bits and timestamp tP collected by the southbound control protocol endpoint; When receiving data, the three data pools—remote instruction pool, local instruction pool, and real feedback pool—each use independent pointers for asynchronous writing. When reading data, a global monotonic clock and control cycle number are used as a reference to align the data of the three data pools at the same time, forming a consistent snapshot so as to extract a set of state-synchronized data.
[0013] Furthermore, during the takeover, in the real physical domain, real feedback is only written to the real feedback pool and uploaded to the local intelligent controller and the safety bypass unit. During the takeover, in the replacement process image domain, the PLC reads the replacement process image, and the PLC's downlink commands are only written to the remote instruction pool. The PLC does not have the actual device write permissions.
[0014] Furthermore, the records in the remote instruction pool, local instruction pool, and real feedback pool carry a maximum validity period; data that has exceeded its validity period cannot be used for PLC switchback determination. When a sequence number rollback, timestamp jump, or data loss occurs, the state continuity and backtracking determination unit will trigger the system to re-accumulate N complete cycles.
[0015] Furthermore, the state continuity and cutback determination unit is specifically used to construct the most recently valid remote control command u after the local task has ended. R Local terminal control command u L Real feedback P and alternative feedback y V The data consistency instructions are given, and the command difference Δu, feedback difference Δy, and time difference Δt are calculated: Δu = ||u R -u L ||,Δy = ||y P -y V ||,Δt = max(|t R -t P |, |t V -t P |); Where, ε u ε y ε t These represent the command difference threshold, feedback difference threshold, and time difference threshold, respectively.R Indicates remote control command u R timestamp, t P Indicates genuine feedback y P timestamp, t V Indicates alternative feedback y V The generation or effective timestamp; Δt represents the maximum time deviation between the remote command, the alternative feedback, and the actual feedback; When Δu≤ε u Δy≤ε y Δt≤ε t If the conditions are met continuously for N cycles, and the actual equipment has no real faults and both the northbound and southbound protocols are in normal condition, then the system is allowed to enter the cutback commit state. The cutback commit selects the nearest common cycle boundary k. r When the boundary system stops updating the replacement process image, the real feedback is mapped to the north input area, and the PLC output is remapped to the south control protocol endpoint, the PLC mainline task process is restored. When the real feedback is y P With alternative feedback y V When the back-cut condition is not met, perturbation-free back-cut is achieved by either converging the physical state to the virtual state or gradually converging the alternative feedback to the real feedback; among which, Physical state convergence to virtual state: The local intelligent controller, while maintaining control, guides the real device to the endpoint of the alternative trajectory at a limited speed, so that y P Gradually approaching y V ; Gradual convergence of alternative feedback to real feedback: When the real device is in the allowable range and the PLC output is isolated, the alternative feedback provided to the PLC is gradually shifted from y to real feedback according to a constrained slope. V Gradually merge into y P This allows the PLC's internal expected state to smoothly follow the actual state. If the physical state converges to the virtual state or the alternative feedback gradually converges to the real feedback without satisfying the threshold within the maximum convergence time, then the backsliding is rejected and the current control is maintained or a controlled stop is executed.
[0016] On the other hand, a method is also provided to support seamless switching between PLCs and intelligent controllers, including: From the moment the system starts up, a persistent northbound device protocol endpoint for the PLC and a southbound control protocol endpoint for the actual devices are established. The PLC communicates with the northbound device protocol endpoint throughout the entire operation, and the actual devices are always accessed through the southbound control protocol endpoint. Under normal control conditions, the remote hardware PLC is set as the only write source for the real device, and bidirectional mapping is performed. During the takeover, the mapping between PLC downlink data and real equipment is isolated, the local intelligent controller is set as the only write source for real equipment, and an alternative process image is generated based on the state before the switchover, PLC remote instructions and equipment model, so that the northbound equipment protocol endpoint still responds to the PLC according to the original protocol cycle. After the local task is completed, the control states of the remote and local systems are compared using data from the isolated remote instruction pool, local instruction pool, and real feedback pool. The system adopts a convergence method from physical state to virtual state or a gradual convergence method from alternative feedback to real feedback. When the command difference, feedback difference, and time difference are lower than the corresponding threshold for N consecutive cycles, the original PLC mapping is restored at the common cycle boundary moment.
[0017] Furthermore, after the local task is completed, the control states of the remote and local systems are compared using data from the remote command pool, the local command pool, and the real feedback pool. The convergence of the physical state to the virtual state or the gradual convergence of alternative feedback to real feedback is adopted. When the command difference, feedback difference, and time difference are lower than the corresponding thresholds for N consecutive cycles, the original PLC mapping is restored at the common cycle boundary time, including: After the local task completes, construct the most recently valid remote control command u. R Local terminal control command u L Real feedback P and alternative feedback y V The data consistency instructions are given, and the command difference Δu, feedback difference Δy, and time difference Δt are calculated: Δu = ||u R -u L ||,Δy = ||y P -y V ||,Δt = max(|t R -t P |, |t V -t P |); Where, ε u ε y ε t These represent the command difference threshold, feedback difference threshold, and time difference threshold, respectively. R Indicates remote control command u R timestamp, t P Indicates genuine feedback y P timestamp, t V Indicates alternative feedback y V The generation or effective timestamp; Δt represents the maximum time deviation between the remote command, the alternative feedback, and the actual feedback; When Δu≤ε u Δy≤ε y Δt≤ε tIf the conditions are met continuously for N cycles, and the actual equipment has no real faults and both the northbound and southbound protocols are in normal condition, then the system is allowed to enter the cutback commit state. The cutback commit selects the nearest common cycle boundary k. r When the boundary system stops updating the replacement process image, the real feedback is mapped to the north input area, and the PLC output is remapped to the south control protocol endpoint, the PLC mainline task process is restored. When the real feedback is y P With alternative feedback y V When the back-cut condition is not met, perturbation-free back-cut is achieved by either converging the physical state to the virtual state or gradually converging the alternative feedback to the real feedback; among which, Physical state convergence to virtual state: The local intelligent controller, while maintaining control, guides the real device to the endpoint of the alternative trajectory at a limited speed, so that y P Gradually approaching y V ; Gradual convergence of alternative feedback to real feedback: When the real device is in the allowable range and the PLC output is isolated, the alternative feedback provided to the PLC is gradually shifted from y to real feedback according to a constrained slope. V Gradually merge into y P This allows the PLC's internal expected state to smoothly follow the actual state. If the physical state converges to the virtual state or the alternative feedback gradually converges to the real feedback without satisfying the threshold within the maximum convergence time, then the backsliding is rejected and the current control is maintained or a controlled stop is executed.
[0018] The beneficial effects of the technical solutions provided in the embodiments of the present invention include at least the following: 1) From the initialization phase, the system establishes a persistent northbound device protocol endpoint for the PLC and a southbound control protocol endpoint for the actual devices. The PLC communicates with the northbound device protocol endpoint throughout the entire operation, and the actual devices are always connected through the southbound control protocol endpoint. The system does not require copying MAC addresses, device names, or temporarily inheriting existing handshake states to meet control requirements at the moment of switching control.
[0019] 2) During the takeover period, the mapping between the PLC downlink data and the real equipment is isolated. The local intelligent controller becomes the only writing source for the real equipment. At the same time, the multi-dimensional state holder generates a replacement process image based on the last effective control state before the switch, remote instructions and equipment model. The northbound equipment protocol endpoint still responds to the PLC according to the original protocol cycle, maintaining the PLC-side protocol state machine and watchdog, thereby avoiding protocol timeout caused by the sudden disappearance of field equipment connection.
[0020] 3) Remote commands, local commands, and real feedback are stored in isolated data pools through remote command pool, local command pool, and real feedback pool to prevent different control domains from overlapping.
[0021] 4) After the local task is completed, in order to align the actual device position with the expected PLC feedback and prevent errors caused by data gaps, the system compares the control states on both sides using data from the remote command pool, local command pool, and actual feedback pool. It ensures the continuity of remote commands, actual states, and alternative states by converging the physical state to the virtual state or gradually converging the alternative feedback to the actual feedback. Only when the command difference, feedback difference, and time difference meet the threshold for N consecutive cycles does the system restore the original PLC mapping at the common cycle boundary, avoiding abrupt changes in process variables and control commands. This achieves protocol continuity and process abruptness without requiring the PLC program to add handshake logic specifically for heterogeneous takeover, thus balancing protocol session continuity, exclusive control of the actual device, and seamless backoff without modifying traditional PLC programs.
[0022] 5) Taking into account situations such as safety I / O, emergency stop, and real faults, a safety bypass unit is used to ensure that safety I / O, emergency stop, and real faults are always bypassed and directly connected. Attached Figure Description
[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0024] Figure 1 This is a schematic diagram of the structure of a system that supports seamless switching between PLC and intelligent controller according to an embodiment of the present invention; Figure 2 This is a schematic diagram of a dual-end protocol proxy provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of the multidimensional state maintainer provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of dual-domain data stream and multi-source isolated data pool provided in an embodiment of the present invention; Figure 5 This is a schematic diagram of the control switching and state convergence back-cut timing provided in an embodiment of the present invention. Detailed Implementation
[0025] The technical solution of the present invention will now be described with reference to the accompanying drawings.
[0026] In embodiments of the present invention, words such as "exemplarily," "for example," etc., are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" in the present invention should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the word "exemplary" is intended to present the concept in a concrete manner. Furthermore, in embodiments of the present invention, the meaning expressed by "and / or" can be both, or either one.
[0027] In the embodiments of this invention, the terms "image" and "picture" may sometimes be used interchangeably. It should be noted that, without emphasizing the distinction between them, they convey the same meaning. Similarly, the terms "of," "corresponding (relevant)," and "corresponding" may sometimes be used interchangeably. It should be noted that, without emphasizing the distinction between them, they convey the same meaning.
[0028] In this embodiment of the invention, sometimes a subscript such as W1 may be written in a non-subscript form such as W1. When the difference is not emphasized, the meaning they express is the same.
[0029] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.
[0030] This invention provides a system that supports seamless switching between PLCs and intelligent controllers. It decouples industrial protocol session maintenance from actual equipment control, allowing for the transfer of underlying equipment control between traditional PLCs and local intelligent controllers while maintaining continuous operation of the industrial protocol connection on the PLC side and continuous operation of physical control on the equipment side. Figure 1 and Figure 2 As shown, the system includes: a remote hardware PLC, a northbound device protocol endpoint for the PLC, an application status channel, a southbound control protocol endpoint for the actual devices, the underlying actual devices (i.e., physical devices), a multi-dimensional state holder, a local intelligent controller (short for local heterogeneous intelligent controller), a data isolation and synchronization module, and a state continuity and switchback determination unit; among which, The northbound device protocol endpoint is used to communicate with the remote hardware PLC; The southbound control protocol endpoint is used to communicate with the actual device; the actual device is determined by the actual application scenario and may include: servo / frequency converter drives, field I / O devices, low-level actuators, safety I / O and emergency stop devices, etc.
[0031] The application status channel is used to map the PLC downlink data received by the northbound device protocol endpoint to the southbound device protocol endpoint under normal control conditions, and to map the real feedback received by the southbound device protocol endpoint back to the northbound device protocol endpoint; wherein, under normal control conditions, the remote hardware PLC is the only write source of the real device. The multi-dimensional state maintainer communicates with the northbound device protocol endpoint to isolate the mapping between PLC downlink data and the real device during takeover, making the local intelligent controller the sole write source for the real device, and generating an alternative process image based on the state before switching, PLC remote instructions, and device model, so that the northbound device protocol endpoint responds to the PLC according to the original protocol cycle. The local intelligent controller is used to generate local control commands to drive real devices to perform corresponding local tasks. The data isolation and synchronization module is used to store traceable and consistent data through a remote command pool, a local command pool, and a real feedback pool. The state continuity and back-cut determination unit is used to compare the control states of the remote and local systems using data from the remote instruction pool, local instruction pool, and real feedback pool after the local task is completed. It adopts the method of physical state to virtual state convergence or alternative feedback to real feedback gradual convergence. When the command difference, feedback difference, and time difference meet the threshold for N consecutive cycles, the original PLC mapping is restored at the common cycle boundary time.
[0032] In this embodiment, a dual-end protocol proxy is adopted. The northbound device protocol endpoint presents the PLC with a module structure, process data length and device identity that match the actual equipment engineering configuration, and maintains the PLC-side session, cycle number and data status from system startup. The southbound control protocol endpoint establishes a connection with the actual equipment as an independent control source and is responsible for process data transmission and reception, equipment diagnosis and actual output submission.
[0033] In this embodiment, the northbound device protocol endpoint and the southbound control protocol endpoint can be integrated into the same edge device in the form of software or hardware functional modules, or they can be deployed in gateway A, which is close to the remote hardware PLC, and gateway B, which is close to the actual device, respectively. When both are deployed in a distributed manner, the protocol interaction cycle between the northbound device protocol endpoint and the remote hardware PLC is maintained by the local real-time scheduler of gateway A, and the protocol interaction cycle between the southbound control protocol endpoint and the actual device is maintained by the local real-time scheduler of gateway B. The application status with timestamp, sequence number and validity period is transmitted between the northbound device protocol endpoint and the southbound control protocol endpoint through the application status channel. This eliminates the need for ordinary wireless links to implement the same millisecond-level cyclic protocol as fieldbus, greatly increasing the flexibility of the system.
[0034] In this embodiment, the system further includes a safety bypass unit.
[0035] In this embodiment, the application state channel, multi-dimensional state maintainer, local intelligent controller, security bypass unit, data isolation and synchronization module, and state continuity and switchback determination unit can also be integrated into the same edge device as software or hardware functional modules. The local intelligent controller and the southbound control protocol endpoint can also be deployed in the same low-latency network.
[0036] In this embodiment, the multi-dimensional state maintainer is connected to the northbound device protocol endpoint for maintaining the alternative process image during takeover; the data isolation and synchronization module is simultaneously connected to the northbound device protocol endpoint, the southbound control protocol endpoint, and the local intelligent controller, storing three types of data sources and implementing switchback determination. The edge device needs to operate in a real-time kernel environment with deterministic thread scheduling, high-precision clocking, and priority isolation capabilities to function.
[0037] In this embodiment, the multidimensional state maintainer is the core component of the system, such as... Figure 3 As shown, it includes: a downlink protocol isolation unit, a northbound protocol state machine, a virtual process mapping unit, a state deduction unit, and a periodic scheduler; wherein, The downlink protocol isolation unit is used to allow PLC downlink data to be mapped to the southbound device protocol endpoint under normal conditions; after the takeover cycle boundary, the PLC downlink data is written to the remote instruction pool instead of being sent to the real device, and the last valid control word, target position, target speed, cycle number and timestamp before the switch are saved. The northbound protocol state machine is used to take over the connection from the PLC side from the initialization phase, rather than temporarily building a virtual device when taking over; the northbound protocol state machine maintains the protocol states such as connection establishment, parameterization, cyclic data exchange, alarms and diagnostics; The virtual process image unit is used to construct the input and output areas according to the data layout configured in the PLC project. It replaces process data and only updates ordinary process variables and non-safe operating states. Emergency stops, safety I / O, real drive faults and communication device faults are directly transmitted by the safety bypass unit with the highest priority and are not covered by the state inference model. The periodic scheduler uses the monotonic clock and real-time scheduling thread of its edge device to update the sequence number, data validity identifier, and alternative process image in each northbound protocol cycle, and submits uplink data according to the time specified in the protocol. If the state deduction is not completed before the end of the current cycle, the periodic scheduler uses the valid state after the limit of the previous cycle and records the device model hysteresis diagnosis. If the allowed number of consecutive times is exceeded, it enters the degraded state and requests controlled stop instead of continuously outputting unverified normal state. The state simulation unit, as a key component of the PLC in receiving feedback data to maintain normal operation, is determined by a multi-dimensional state holder based on the last confirmed real state before the switch and the remote command u. R (k) and the equipment model generate an alternative process image associated with the cycle number, status word, and quality identifier, and whose process variables have been processed by position, speed, acceleration, and stroke limiting. This alternative process image is then fed back to the PLC. For position and speed control equipment, a discrete-state equipment model with saturation, acceleration, and stroke constraints is used, i.e.: (k+1) = sat X (A· (k) + B·u R (k) + d(k)), V (k) = C· (k); Where A is the state transition matrix, B is the control input matrix, and C is the output mapping matrix; subscripts V Represents a virtual domain. V (k) is a complete symbol representing the alternative feedback vector generated by the discrete device model in the k-th protocol cycle. (k) represents at least the alternative position, alternative speed, and unsafe operating state of the k-th protocol cycle. (k+1) represents at least the alternative position, alternative speed, and unsafe operating state of the (k+1)th protocol cycle. X This indicates that the amplitude is limited according to the allowable position, speed, and acceleration of the equipment, and d(k) represents the correction amount set based on the last known load or process stage. For discrete I / O, the model is updated according to the equipment state machine and control word transition conditions; for continuous processes, a first-order or second-order model can be used. Model parameters are obtained during the configuration phase from the equipment manual, historical operating data, or trial operation.
[0038] Each data point in the replacement process image simultaneously stores the numerical value, generation time, model quality, and source identifier. The state projection unit continuously updates the predicted values based on model residuals, takeover duration, and the actual state of the most recent equipment, and then feeds this information back to the PLC. When a predicted value falls below a set threshold, the takeover exceeds the maximum duration, or the actual equipment malfunctions, the system triggers a safety strategy, either by switching back or through manual intervention, to eliminate the risk. The system will no longer use the replacement value identifier as data usable for normal control. This mechanism maintains the PLC's protocol connection without interruption while also not concealing potential dangerous states that may arise in the system.
[0039] In this embodiment, the data isolation and synchronization module consists of three parts: a remote command pool, a local command pool, and a real feedback pool, all of which are isolated from each other. The remote instruction pool is used to store the remote control commands uR, timestamp tR, cycle number seqR, and validity period generated by the PLC. The local command pool is used to store the actual commands uL, task stages tL, and control epoch numbers seqL issued by the local intelligent controller. The real feedback pool is used to store the real feedback yP, device status, quality bit qP, and timestamp tP collected by the southbound control protocol endpoint; When receiving data, the three data pools—remote instruction pool, local instruction pool, and real feedback pool—use independent pointers for asynchronous writing without interfering with each other. When reading data, the system relies on a global monotonic clock and control cycle number as a reference to align the data of the three data pools at the same time, forming a consistent snapshot, thereby extracting a set of state-synchronized data.
[0040] In this embodiment, as Figure 4 As shown, during the takeover period, in the real physical domain, the real feedback from the real devices is only written to the real feedback pool and provided only to the local intelligent controller and safety bypass unit. During the takeover period, in the replacement process image domain, the PLC reads the replacement process image, and PLC downlink commands only enter the remote instruction pool; the PLC does not have write permissions to the real devices. This dual-domain isolation method prevents real local fine-tuning feedback from entering the PLC that is still executing the main logic, and also prevents old PLC commands from overwriting the real-time output of the local intelligent controller, ensuring the normal operation of the system.
[0041] In this embodiment, the records in the remote instruction pool, local instruction pool, and real feedback pool carry a maximum validity period. Data that has exceeded its validity period cannot be used for PLC switchback determination. When a sequence number rollback, timestamp jump, or data loss occurs, the state continuity and switchback determination unit will trigger the system to re-accumulate N complete cycles.
[0042] In this embodiment, as Figure 5 As shown, the state continuity and cutback determination unit is specifically used to construct the most recently valid remote control command u after the local task ends. R Local terminal control command u L Real feedback P and alternative feedback y V The data consistency instructions are given, and the command difference Δu, feedback difference Δy, and time difference Δt are calculated: Δu = ||u R -u L ||,Δy = ||y P -yV ||,Δt = max(|t R -t P |, |t V -t P |); Where, ε u ε y ε t These represent the command difference threshold, feedback difference threshold, and time difference threshold, respectively. R Indicates remote control command u R timestamp, t P Indicates genuine feedback y P timestamp, t V Indicates alternative feedback y V The generation or effective timestamp; Δt represents the maximum time deviation between the remote command, the alternative feedback, and the actual feedback; When Δu≤ε u Δy≤ε y Δt≤ε t And when the conditions are met continuously for N cycles, and the actual device has no real faults and both the northbound and southbound protocols are in normal condition, the device is allowed to enter the cutback commit state. N and the thresholds are configured based on the device's maximum allowed position step, velocity step, and control cycle. The cutback commit selects the nearest common cycle boundary k. r When the boundary system stops updating the replacement process image, the real feedback is mapped to the north input area, and the PLC output is remapped to the south control protocol endpoint, the PLC mainline task process is restored. When the real feedback is y P With alternative feedback y V If the back-cut condition is not met, the system will provide two convergence methods from the perspective of real devices and feedback data: either convergence from physical state to virtual state or gradual convergence from alternative feedback to real feedback to achieve perturbation-free back-cut; among these, Physical state convergence to virtual state: The local intelligent controller, while maintaining control, guides the real device to the endpoint of the alternative trajectory at a limited speed, so that y P Gradually approaching y V ; Gradual convergence of alternative feedback to real feedback: When the real device is in the allowable range and the PLC output is isolated, the alternative feedback provided to the PLC is gradually shifted from y to real feedback according to a constrained slope. V Gradually merge into y P This allows the PLC's internal expected state to smoothly follow the actual state. If the threshold is not reached within the maximum convergence time using either of the above two convergence methods, the system will refuse to switch back and maintain current control or execute a controlled stop.
[0043] The system supporting seamless switching between PLCs and intelligent controllers provided in this invention can be deployed in industrial edge gateways, protocol conversion devices, or industrial computers with deterministic scheduling capabilities. It can be used for temporary takeover and seamless switching between traditional PLCs and soft PLCs, motion controllers, robot controllers, machine vision controllers, or other intelligent controllers. Switching triggers can come from manual instructions, task scheduling, equipment maintenance, external control systems, or fault diagnosis. This invention itself does not rely on specific business state recognition algorithms.
[0044] This invention also provides a method for supporting seamless switching between PLCs and intelligent controllers, which can decouple industrial protocol session maintenance from actual equipment control. This method is used to maintain continuous operation of the industrial protocol connection on the PLC side and continuous operation of physical control on the equipment side when transferring control of the underlying equipment between a traditional PLC and a local intelligent controller. The method includes: S1 establishes a persistent northbound device protocol endpoint for the PLC and a southbound control protocol endpoint for the actual device from system startup. The PLC communicates with the northbound device protocol endpoint throughout the entire operation, and the actual device is always accessed through the southbound control protocol endpoint. S2, under normal control conditions, set the remote hardware PLC as the only write source for the real device and perform bidirectional mapping; S3, during the takeover period, isolates the mapping between PLC downlink data and real equipment, sets the local intelligent controller as the only write source for real equipment, and generates an alternative process image based on the state before switching, PLC remote instructions and equipment model, so that the northbound equipment protocol endpoint still responds to the PLC according to the original protocol cycle. S4, after the local task is completed, compare the control states of the remote and local systems using data from the isolated remote command pool, local command pool, and real feedback pool. Employ a convergence method from physical state to virtual state or a gradual convergence from alternative feedback to real feedback. When the command difference, feedback difference, and time difference are below the corresponding thresholds for N consecutive cycles, restore the original PLC mapping at the common cycle boundary moment. Specifically, this may include the following steps: After the local task completes, construct the most recently valid remote control command u. R Local terminal control command u L Real feedback P and alternative feedback y V The data consistency instructions are given, and the command difference Δu, feedback difference Δy, and time difference Δt are calculated: Δu = ||u R -u L ||,Δy = ||y P -y V ||,Δt = max(|t R -tP |, |t V -t P |); Where, ε u ε y ε t These represent the command difference threshold, feedback difference threshold, and time difference threshold, respectively. R Indicates remote control command u R timestamp, t P Indicates genuine feedback y P timestamp, t V Indicates alternative feedback y V The generation or effective timestamp; Δt represents the maximum time deviation between the remote command, the alternative feedback, and the actual feedback; When Δu≤ε u Δy≤ε y Δt≤ε t If the conditions are met continuously for N cycles, and the actual equipment has no real faults and both the northbound and southbound protocols are in normal condition, then the system is allowed to enter the cutback commit state. The cutback commit selects the nearest common cycle boundary k. r When the boundary system stops updating the replacement process image, the real feedback is mapped to the north input area, and the PLC output is remapped to the south control protocol endpoint, the PLC mainline task process is restored. When the real feedback is y P With alternative feedback y V When the back-cut condition is not met, perturbation-free back-cut is achieved by either converging the physical state to the virtual state or gradually converging the alternative feedback to the real feedback; among which, Physical state convergence to virtual state: The local intelligent controller, while maintaining control, guides the real device to the endpoint of the alternative trajectory at a limited speed, so that y P Gradually approaching y V ; Gradual convergence of alternative feedback to real feedback: When the real device is in the allowable range and the PLC output is isolated, the alternative feedback provided to the PLC is gradually shifted from y to real feedback according to a constrained slope. V Gradually merge into y P This allows the PLC's internal expected state to smoothly follow the actual state. If the physical state converges to the virtual state or the alternative feedback gradually converges to the real feedback without satisfying the threshold within the maximum convergence time, then the backsliding is rejected and the current control is maintained or a controlled stop is executed.
[0045] In summary, the beneficial effects of the technical solutions provided by the embodiments of the present invention include at least the following: 1) From the initialization phase, the system establishes a persistent northbound device protocol endpoint for the PLC and a southbound control protocol endpoint for the actual devices. The PLC communicates with the northbound device protocol endpoint throughout the entire operation, and the actual devices are always connected through the southbound control protocol endpoint. The system does not require copying MAC addresses, device names, or temporarily inheriting existing handshake states to meet control requirements at the moment of switching control.
[0046] 2) During the takeover period, the mapping between the PLC downlink data and the real equipment is isolated. The local intelligent controller becomes the only writing source for the real equipment. At the same time, the multi-dimensional state holder generates a replacement process image based on the last effective control state before the switch, remote instructions and equipment model. The northbound equipment protocol endpoint still responds to the PLC according to the original protocol cycle, maintaining the PLC-side protocol state machine and watchdog, thereby avoiding protocol timeout caused by the sudden disappearance of field equipment connection.
[0047] 3) Remote commands, local commands, and real feedback are stored in isolated data pools through remote command pool, local command pool, and real feedback pool to prevent different control domains from overlapping.
[0048] 4) After the local task is completed, in order to align the actual device position with the expected PLC feedback and prevent errors caused by data gaps, the system compares the control states on both sides using data from the remote command pool, local command pool, and actual feedback pool. It ensures the continuity of remote commands, actual states, and alternative states by converging the physical state to the virtual state or gradually converging the alternative feedback to the actual feedback. Only when the command difference, feedback difference, and time difference meet the threshold for N consecutive cycles does the system restore the original PLC mapping at the common cycle boundary, avoiding abrupt changes in process variables and control commands. This achieves protocol continuity and process abruptness without requiring the PLC program to add handshake logic specifically for heterogeneous takeover, thus balancing protocol session continuity, exclusive control of the actual device, and seamless backoff without modifying traditional PLC programs.
[0049] 5) Taking into account situations such as safety I / O, emergency stop, and real faults, a safety bypass unit is used to ensure that safety I / O, emergency stop, and real faults are always bypassed and directly connected.
[0050] To better understand the system and method for seamless switching between PLC and intelligent controller provided in this invention, a representative scenario of "precision assembly positioning correction based on visual feedback" in an automated assembly line is used for illustration. A remote hardware PLC controls the conveyor shaft to feed the workpiece into the assembly station according to an existing engineering program, and periodically exchanges control words, target position, target speed, status words, actual position, and actual speed with the servo drive via PROFINET. Due to fixture tolerances, incoming material deviations, or mechanical wear, the workpiece may still have planar position or posture deviations after reaching the nominal assembly position. An industrial vision camera and a local intelligent controller are installed at the assembly station. The local intelligent controller can calculate the position compensation amount based on the visual processing results and perform short-term precision correction through a deterministic local network connected to the servo drive.
[0051] If the image or visual deviation is sent back to the remote hardware PLC via a regular wireless link, and then the PLC forms a high-frequency correction closed loop, the variable time delay generated by image acquisition, calculation, and network transmission will enter the perception-decision-execution link. Furthermore, a regular wireless link cannot be directly equated to the deterministic cycle of a fieldbus. Simultaneously, the existing program of the remote hardware PLC typically only contains mainline sequential control and lacks visual coordinate transformation, nonlinear compensation, or high-frequency interpolation functions. If the connection between the PLC and the driver is directly disconnected and re-established by the intelligent controller, the original application relationships and cyclic data monitoring on the PLC side may time out. If, after the takeover, the actual feedback, which differs significantly from the replacement state, is restored to the PLC all at once, it may cause position steps, sudden output changes, or reverse correction.
[0052] In this embodiment, the edge device is configured with a northbound device protocol endpoint and a southbound control protocol endpoint from system startup. The northbound device protocol endpoint, based on the GSDML configuration used in the PLC project, presents a fixed PROFINET IO device, module / submodule structure, and process data length to the remote hardware PLC, and continuously maintains PLC-side application relationships, cyclic IO data, periodic information, and alarm channels. The southbound control protocol endpoint, as an independent IO controller, establishes and continuously maintains another application relationship with the actual servo driver. Under normal conditions, the edge device maps PLC outputs to the southbound control protocol endpoint and maps actual device inputs back to the northbound device protocol endpoint. During takeover, only the data source and output owner within the device are changed; the device identity is not copied, the PLC project configuration is not changed, or the PLC-side connection is not re-established during the switchover.
[0053] When an external trigger indicates that the workpiece has entered the visual correction stage, the system first verifies the local intelligent controller, visual calibration parameters, driver status, and safety clearance, and then transfers control at the predetermined takeover cycle boundary. The local intelligent controller calculates the axis space compensation based on the visual deviation vector e=[Δx, Δy, Δθ] and the calibration relationship between the camera, workpiece, and actuator axis, and generates local control commands under position, speed, acceleration, and travel limit conditions. Feedback from the real device continuously enters the real feedback pool and is used for local closed-loop processing; subsequent outputs from the remote hardware PLC are only written to the remote instruction pool and no longer have write permissions to the real device.
[0054] During the takeover, the multidimensional state maintainer uses the last confirmed real state before the switchover, subsequent PLC commands, and the equipment model as input. It generates replacement positions, replacement speeds, and corresponding unsafe operating states according to the original update cycle of the northbound equipment protocol endpoint, and updates the cycle number, data status, source identifier, and model quality. The replacement process image only covers ordinary process variables, does not fix the status word to "normal," and does not cover actual drive failures, emergency stops, or safety I / O. If an actual equipment failure, insufficient model quality, or expired replacement data occurs, the northbound equipment protocol endpoint reports according to a preset diagnostic or invalid data strategy, triggering controlled stop or manual intervention. When using PROFIsafe, safety messages and F-parameter verification are still processed by the certified F-Host / F-Device safety link and are not included in the ordinary replacement process image.
[0055] The core business workflow and data frame interaction mechanism of "precision assembly positioning correction based on visual feedback" include the following specific steps: Process Data Layout: The following example uses PROFIdrive cyclic process data carried by PROFINET IO RT. The northbound PLC output area can be configured as [Control Word STW1 (16-bit) | Target Position POS_SP (32-bit) | Target Speed VEL_SP (16-bit or 32-bit) | Mode and Existing User Data]; the northbound PLC input area maintains the layout configured in the original PLC project, such as [Status Word ZSW1 (16-bit) | Actual Position POS_ACT (32-bit) | Actual Speed VEL_ACT (16-bit or 32-bit) | Existing User Data]. Under normal conditions, POS_ACT and VEL_ACT come from real feedback; during takeover, their data sources are switched to the alternative process image. The southbound real device output area uses control words and setpoints matched to the drive, and the southbound real device input area stores the real status word, real position POS_ACT_P, and real speed VEL_ACT_P. The model quality, source, and generation time of the alternative data are stored internally by default and are only mapped to the northbound process data when diagnostic fields are reserved in the original PLC project. The specific field arrangement and bit width depend on the selected GSDML and PROFIdrive message types; the period number, Provider / Consumer status, and Ethernet frame checksum of the PROFINET frame are handled by the protocol stack, and the custom CRC is not used as a necessary field for application process data.
[0056] Step S1: Initialize the fixed dual-end protocol agent. After the system powers on, the remote hardware PLC establishes an application relationship with the northbound device protocol endpoint based on the existing engineering configuration. The northbound device protocol endpoint verifies the module / submodule, input / output length, and update cycle. The southbound control protocol endpoint independently establishes an application relationship with the real driver and completes parameterization. The northbound and southbound real-time schedulers are started respectively, the internal monotonic clock is calibrated, the remote instruction pool, local instruction pool, and real feedback pool are established, and the control epoch is set to the initial value. The remote hardware PLC is registered as the unique valid write source. The northbound update cycle can be configured to 4 ms, but this value is only a parameter for this embodiment.
[0057] Step S2: Under normal conditions, normal bidirectional mapping is performed. During the mainline transmission phase, the northbound device protocol endpoint receives the PLC's control word and setpoint in each cycle, and writes them into the remote instruction pool after verifying the cycle number, data status, and validity period; the southbound control protocol endpoint reads the command in the corresponding cycle and submits it to the real driver. The real driver returns the real status word, position, and speed, which are written into the real feedback pool and then mapped to the northbound PLC input area. For example, the PLC can issue "Run Enable, Target Position 1000.0 mm, Target Speed 50.0 mm / s", and the real device can return "Run, Actual Position 950.0 mm, Actual Speed 50.0 mm / s". The above values are only used to illustrate the data flow and do not constitute a performance commitment.
[0058] Step S3: Receive visual correction trigger and prepare for takeover. When the vision processor, workstation controller, or production scheduling module confirms that the workpiece has entered the precision correction stage, it sends a takeover request to the edge device. The device checks the local intelligent controller heartbeat, vision calibration version, actual equipment operating status, northbound and southbound protocol status, output interlocks, and safety clearance, and preloads local control tasks. If any condition is not met, the switchover is rejected and remote control is maintained; if the condition is met, the nearest takeover cycle boundary ks is selected as the takeover submission time.
[0059] Step S4: Atomically transfer write permissions to the real device at the takeover cycle boundary. Upon reaching ks, the token and routing transaction manager simultaneously perform three operations: increment the control epoch and change the output owner to the local intelligent controller; stop mapping PLC downlink data to the southbound control protocol endpoint; and save the last valid real state and remote commands before the switchover. The PLC output after takeover is still received by the northbound device protocol endpoint and written to the remote command pool, but no longer reaches the real driver; local control commands become the only normal process output that the southbound control protocol endpoint can commit, thus preventing simultaneous writing by both controllers.
[0060] Step S5: Parallel operation of the alternative process image domain and the real physical domain. In the northbound virtual domain, the multidimensional state holder uses the original position and velocity before truncation as initial values. Based on remote commands, process stages, and the equipment model with amplitude limits, it calculates the alternative state. In each northbound cycle, it updates POS_ACT_V, VEL_ACT_V, cycle number, data status, and model quality, and continuously provides the PLC with input data whose timing and layout conform to the original application relationships. In the real physical domain, the local intelligent controller receives visual deviations and feedback from the real equipment, generating local commands constrained by velocity, acceleration, and travel. For example, when visual detection shows a lateral deviation of +2.5 mm, the local intelligent controller can adjust the axis target from the nominal position of 1000.0 mm to 1002.5 mm within the allowable range and complete the positioning at a lower correction speed. Real feedback is only used for local control and safety monitoring; remote output only enters the remote command pool, and the two domains do not overlap.
[0061] Step S6: Monitor the quality of the alternative image and the actual safety status. At each deadline, the cycle scheduler checks whether the alternative status is generated on time, whether it meets the position / velocity / acceleration limits, and whether the model quality exceeds the threshold. If the current cycle's simulation is delayed, the valid status from the previous cycle, after being limited, can be used within the allowed number of iterations, and the diagnosis recorded. In cases of consecutive delays, expired data, or model mismatch, the system marks the data as unusable for normal control and enters a degradation process. Actual drive failures, emergency stops, and safety I / O always take precedence over alternative images: once these occur, normal control permissions are immediately revoked, and a preset safety response is executed, instead of continuing to report a fixed normal status to the PLC.
[0062] Step S7: End the local task and implement state convergence. When the visual error is below the process threshold for L consecutive image cycles, and the local intelligent controller confirms that the axis has stabilized, the system records the task completion status, but does not immediately restore the PLC mapping. The data isolation synchronization module generates remote command u according to a unified time base. R Local terminal command u L Real feedback P and alternative feedback y V A consistent snapshot, calculate Δu = ||u R -u L ||,Δy = ||y P -y V || and Δt. If the cutback threshold is not met, the local intelligent controller can guide the real device to the allowed area of the alternative trajectory while maintaining write permissions, or, under the condition that the PLC output remains isolated, gradually transition the alternative feedback to the real feedback with a limited slope and re-accumulate continuous effective cycles. This process avoids forcibly writing the locally corrected real position into the PLC all at once.
[0063] Step S8: Perform a non-disruptive back-switch or fault degradation at the common period boundary. The system selects the common period boundary k only when Δu, Δy, and Δt are all less than their corresponding thresholds and satisfy the conditions for N consecutive periods, and the northbound and southbound protocol states are normal and the actual equipment is fault-free. r Submit the back cutoff. At k r At this point, the token and routing transaction manager atomically restores the real feedback to the northbound PLC input area and remaps the PLC output to the southbound control protocol endpoint, thus updating the control epoch. If the maximum takeover time, maximum convergence time, or protocol monitoring period is exceeded, the system refuses to switch back, maintains the current controlled state, or executes a controlled stop, and outputs a diagnostic record containing the period number, timestamp, model quality, and fault cause.
[0064] Through the above process, the application relationship and cyclic data monitoring on the remote hardware PLC side remain continuous during the takeover period, and there is always only one valid write source on the real device side; the local intelligent controller can complete visual precision correction, while the switchback is constrained by the multi-source state continuity condition. Thus, without modifying the existing mainline program of the remote hardware PLC, temporary takeover of heterogeneous controllers, continuous protocol operation, and smooth recovery of process variables are achieved.
[0065] The above embodiments can be implemented, in whole or in part, by software, hardware (such as circuits), firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. A semiconductor medium can be a solid-state drive.
[0066] It should be understood that the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. A and B can be singular or plural. Additionally, the character " / " in this article generally indicates an "or" relationship between the preceding and following related objects, but it can also represent an "and / or" relationship. Please refer to the context for a more accurate understanding.
[0067] In this invention, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of a single item or a plurality of items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be a single item or multiple items.
[0068] It should be understood that, in various embodiments of the present invention, the order of the above-mentioned process numbers does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0069] 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 implementations should not be considered beyond the scope of this invention.
[0070] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the devices, apparatuses, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0071] In the several embodiments provided by this invention, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only 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 device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0072] 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 can be selected to achieve the purpose of this embodiment according to actual needs.
[0073] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0074] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several 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 methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0075] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A system supporting seamless switching between PLC and intelligent controller, characterized in that, The system includes: a remote hardware PLC, a northbound device protocol endpoint for the PLC, an application status channel, a southbound control protocol endpoint for the actual devices, underlying actual devices, a multi-dimensional state maintainer, a local intelligent controller, a data isolation and synchronization module, and a state continuity and switchback determination unit; wherein... The northbound device protocol endpoint is used to communicate with the remote hardware PLC; The southbound control protocol endpoint is used to communicate with the actual device; The application status channel is used to map the PLC downlink data received by the northbound device protocol endpoint to the southbound device protocol endpoint under normal control conditions, and to map the real feedback received by the southbound device protocol endpoint back to the northbound device protocol endpoint; wherein, under normal control conditions, the remote hardware PLC is the only write source of the real device. The multi-dimensional state maintainer communicates with the northbound device protocol endpoint to isolate the mapping between PLC downlink data and the real device during takeover, making the local intelligent controller the sole write source for the real device, and generating an alternative process image based on the state before switching, PLC remote instructions, and device model, so that the northbound device protocol endpoint responds to the PLC according to the original protocol cycle. The local intelligent controller is used to generate local control commands to drive real devices to perform corresponding local tasks. The data isolation and synchronization module is used to store traceable and consistent data through a remote command pool, a local command pool, and a real feedback pool. The state continuity and back-cut determination unit is used to compare the control states of the remote and local systems using data from the remote instruction pool, local instruction pool, and real feedback pool after the local task is completed. It adopts the method of physical state to virtual state convergence or alternative feedback to real feedback gradual convergence. When the command difference, feedback difference, and time difference meet the threshold for N consecutive cycles, the original PLC mapping is restored at the common cycle boundary time.
2. The system supporting seamless switching between PLC and intelligent controller according to claim 1, characterized in that, The northbound device protocol endpoint presents the PLC with a module structure, process data length, and device identity that match the actual equipment engineering configuration, and maintains the PLC-side session, cycle number, and data status from system startup. The southbound control protocol endpoint establishes a connection with the actual equipment as an independent control source, and is responsible for process data transmission and reception, equipment diagnosis, and actual output submission.
3. The system supporting seamless switching between PLC and intelligent controller according to claim 1, characterized in that, The northbound device protocol endpoint and the southbound control protocol endpoint are integrated in the same edge device; or, the northbound device protocol endpoint and the southbound control protocol endpoint are deployed in gateway A, which is close to the remote hardware PLC, and gateway B, which is close to the actual device, respectively. When both are deployed in a distributed manner, the protocol interaction cycle between the northbound device protocol endpoint and the remote hardware PLC is maintained by the local real-time scheduler of gateway A, and the protocol interaction cycle between the southbound control protocol endpoint and the actual device is maintained by the local real-time scheduler of gateway B. The application status with timestamp, sequence number and validity period is transmitted between the northbound device protocol endpoint and the southbound control protocol endpoint through the application status channel.
4. The system supporting seamless switching between PLC and intelligent controller according to claim 1, characterized in that, The system also includes: a safety bypass unit; The multidimensional state maintainer includes: a downlink protocol isolation unit, a northbound protocol state machine, a virtual process mapping unit, a state deduction unit, and a periodic scheduler; wherein... The downlink protocol isolation unit is used to allow PLC downlink data to be mapped to the southbound device protocol endpoint under normal conditions; after the takeover cycle boundary, it writes the PLC downlink data to the remote instruction pool and saves the last valid control word, target position, target speed, cycle number and timestamp before the switchover. The northbound protocol state machine is used to accept the connection from the PLC side from the initialization phase. The virtual process image unit is used to construct the input and output areas according to the data layout configured in the PLC project. It replaces process data and only updates ordinary process variables and non-safe operating states. Emergency stops, safety I / O, real drive faults, and communication device faults are directly transmitted by the safety bypass unit with the highest priority. The state simulation unit is used to generate an alternative process image associated with the cycle number, status word and quality identifier, and whose process variables have been limited, based on the last confirmed real state before the switch, the last valid remote command of the PLC and the equipment model, and to feed the alternative process image back to the PLC. The periodic scheduler uses the monotonic clock and real-time scheduling thread of its edge device to update the sequence number, data validity identifier, and alternative process image in each northbound protocol cycle, and submits uplink data according to the time specified in the protocol. If the state projection is not completed before the end of the current cycle, the periodic scheduler uses the valid state after the limit of the previous cycle and records the device model hysteresis diagnosis. If the allowed number of consecutive occurrences is exceeded, it enters the degraded state and requests controlled stop.
5. The system supporting seamless switching between PLC and intelligent controller according to claim 1, characterized in that, The data isolation and synchronization module includes: a remote command pool, a local command pool, and a real feedback pool that are isolated from each other; wherein, The remote instruction pool is used to store the remote control commands uR, timestamp tR, cycle number seqR, and validity period generated by the PLC. The local command pool is used to store the actual commands (uL), task stages, and control epochs issued by the local intelligent controller. The real feedback pool is used to store real feedback yP, device status, quality bits and timestamp tP collected by the southbound control protocol endpoint; When receiving data, the three data pools—remote instruction pool, local instruction pool, and real feedback pool—each use independent pointers for asynchronous writing. When reading data, a global monotonic clock and control cycle number are used as a reference to align the data of the three data pools at the same time, forming a consistent snapshot so as to extract a set of state-synchronized data.
6. The system supporting seamless switching between PLC and intelligent controller according to claim 5, characterized in that, During the takeover, in the real physical domain, real feedback is only written to the real feedback pool and uploaded to the local smart controller and safety bypass unit. During the takeover, in the replacement process image domain, the PLC reads the replacement process image, and the PLC's downlink commands are only written to the remote instruction pool. The PLC does not have the actual device write permissions.
7. The system supporting seamless switching between PLC and intelligent controller according to claim 5, characterized in that, Records in the remote instruction pool, local instruction pool, and real feedback pool carry a maximum validity period. Data that has exceeded its validity period cannot be used for PLC cutback determination. When a sequence number rollback, timestamp jump, or data loss occurs, the state continuity and backtracking determination unit will trigger the system to re-accumulate N complete cycles.
8. The system supporting seamless switching between PLC and intelligent controller according to claim 6, characterized in that, The state continuity and cutback determination unit is specifically used to construct the most recently valid remote control command u after the local task ends. R Local terminal control command u L Real feedback P and alternative feedback y V The data consistency instructions are given, and the command difference Δu, feedback difference Δy, and time difference Δt are calculated: Δu = ||u R -u L ||,Δy = ||y P -y V ||,Δt = max(|t R -t P |, |t V -t P |); Where, ε u ε y ε t These represent the command difference threshold, feedback difference threshold, and time difference threshold, respectively. R Indicates remote control command u R timestamp, t P Indicates genuine feedback y P timestamp, t V Indicates alternative feedback y V The generation or effective timestamp; Δt represents the maximum time deviation between the remote command, the alternative feedback, and the actual feedback; When Δu≤ε u Δy≤ε y Δt≤ε t If the conditions are met continuously for N cycles, and the actual equipment has no real faults and both the northbound and southbound protocols are in normal condition, then the system is allowed to enter the cutback commit state. The cutback commit selects the nearest common cycle boundary k. r When the boundary system stops updating the replacement process image, the real feedback is mapped to the north input area, and the PLC output is remapped to the south control protocol endpoint, the PLC mainline task process is restored. When the real feedback is y P With alternative feedback y V When the back-cut condition is not met, perturbation-free back-cut is achieved by either converging the physical state to the virtual state or gradually converging the alternative feedback to the real feedback; among which, Physical state convergence to virtual state: The local intelligent controller, while maintaining control, guides the real device to the endpoint of the alternative trajectory at a limited speed, so that y P Gradually approaching y V ; Gradual convergence of alternative feedback to real feedback: When the real device is in the allowable range and the PLC output is isolated, the alternative feedback provided to the PLC is gradually shifted from y to real feedback according to a constrained slope. V Gradually merge into y P This allows the PLC's internal expected state to smoothly follow the actual state. If the physical state converges to the virtual state or the alternative feedback gradually converges to the real feedback without satisfying the threshold within the maximum convergence time, then the backsliding is rejected and the current control is maintained or a controlled stop is executed.
9. A method for supporting seamless switching between PLC and intelligent controller, characterized in that, The method includes: From the moment the system starts up, a persistent northbound device protocol endpoint for the PLC and a southbound control protocol endpoint for the actual devices are established. The PLC communicates with the northbound device protocol endpoint throughout the entire operation, and the actual devices are always accessed through the southbound control protocol endpoint. Under normal control conditions, the remote hardware PLC is set as the only write source for the real device, and bidirectional mapping is performed. During the takeover, the mapping between PLC downlink data and real equipment is isolated, the local intelligent controller is set as the only write source for real equipment, and an alternative process image is generated based on the state before the switchover, PLC remote instructions and equipment model, so that the northbound equipment protocol endpoint still responds to the PLC according to the original protocol cycle. After the local task is completed, the control states of the remote and local systems are compared using data from the isolated remote instruction pool, local instruction pool, and real feedback pool. The system adopts a convergence method from physical state to virtual state or a gradual convergence method from alternative feedback to real feedback. When the command difference, feedback difference, and time difference are lower than the corresponding threshold for N consecutive cycles, the original PLC mapping is restored at the common cycle boundary moment.
10. The method for supporting seamless switching between PLC and intelligent controller according to claim 9, characterized in that, After the local task is completed, the control states of the remote and local systems are compared using data from the remote instruction pool, the local instruction pool, and the real feedback pool. A convergence method is adopted, where the physical state converges to the virtual state or the alternative feedback gradually converges to the real feedback. When the command difference, feedback difference, and time difference are below the corresponding thresholds for N consecutive cycles, the original PLC mapping is restored at the common cycle boundary time, including: After the local task completes, construct the most recently valid remote control command u. R Local terminal control command u L Real feedback P and alternative feedback y V The data consistency instructions are given, and the command difference Δu, feedback difference Δy, and time difference Δt are calculated: Δu = ||u R -u L ||,Δy = ||y P -y V ||,Δt = max(|t R -t P |, |t V -t P |); Where, ε u ε y ε t These represent the command difference threshold, feedback difference threshold, and time difference threshold, respectively. R Indicates remote control command u R timestamp, t P Indicates genuine feedback y P timestamp, t V Indicates alternative feedback y V The generation or effective timestamp; Δt represents the maximum time deviation between the remote command, the alternative feedback, and the actual feedback; When Δu≤ε u Δy≤ε y Δt≤ε t If the conditions are met continuously for N cycles, and the actual equipment has no real faults and both the northbound and southbound protocols are in normal condition, then the system is allowed to enter the cutback commit state. The cutback commit selects the nearest common cycle boundary k. r When the boundary system stops updating the replacement process image, the real feedback is mapped to the north input area, and the PLC output is remapped to the south control protocol endpoint, the PLC mainline task process is restored. When the real feedback is y P With alternative feedback y V When the back-cut condition is not met, perturbation-free back-cut is achieved by either converging the physical state to the virtual state or gradually converging the alternative feedback to the real feedback; among which, Physical state convergence to virtual state: The local intelligent controller, while maintaining control, guides the real device to the endpoint of the alternative trajectory at a limited speed, so that y P Gradually approaching y V ; Gradual convergence of alternative feedback to real feedback: When the real device is in the allowable range and the PLC output is isolated, the alternative feedback provided to the PLC is gradually shifted from y to real feedback according to a constrained slope. V Gradually merge into y P This allows the PLC's internal expected state to smoothly follow the actual state. If the physical state converges to the virtual state or the alternative feedback gradually converges to the real feedback without satisfying the threshold within the maximum convergence time, then the backsliding is rejected and the current control is maintained or a controlled stop is executed.
Citation Information
Patent Citations
Method for redundant controller synchronization during normal and program mismatch conditions
CN101004587B
A method and system for seamless transmission of IO data redundancy in a communication control system
CN104536413B
Redundant, multitasking industrial controllers with synchronized data tables
US6411857B1
