A method and device for determining the working role of a controller

By exchanging role determination data via optical fiber links and industrial Ethernet links and comparing proportional control values, total fault scores, and startup time, the reliability problem of controller working role determination is solved, ensuring continuous control of the control system.

CN116136669BActive Publication Date: 2025-10-03SUPCON TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111368915.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-18
Publication Date
2025-10-03
Estimated Expiration
2041-11-18

AI Technical Summary

Technical Problem

In the field of industrial automation intelligent control, how to effectively determine the working role of the controller to ensure that the slave controller switches to the master role when the main controller fails, ensuring continuous control of the control system.

Method used

It is connected to the second controller through an optical fiber link and an industrial Ethernet link to exchange role judgment data. It uses factors such as proportional control value, total fault score value and startup time to compare and determine the working role of the controller.

Benefits of technology

The reliability of the controller's working role is improved, ensuring the control system's continuous control of the controlled object.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116136669B_ABST
    Figure CN116136669B_ABST
Patent Text Reader

Abstract

The present disclosure provides a method and device for determining the working roles of controllers, which are applied to a first controller. The first controller is connected to a second controller via at least one optical fiber link and at least one industrial Ethernet link, respectively. The first controller sends first role determination data corresponding to the first controller to the second controller via the optical fiber link or industrial Ethernet link without connection anomalies, and obtains second role determination data corresponding to the second controller. The first role determination data is compared with the second role determination data to determine the working roles of the first and second controllers. The present disclosure determines the working roles of the controllers by exchanging role determination data via the optical fiber link or industrial Ethernet link without connection anomalies, thereby improving the reliability of determining the working roles of the controllers and ensuring the continuous control of the control system over the controlled object.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of automation control technology, and in particular to a method and device for determining a working role of a controller. Background Art

[0002] Currently, multi-network-based intelligent controllers are increasingly being used in the field of intelligent control in industrial automation. Typically, two controllers operate in separate roles: master and slave. Both controllers perform tasks such as data acquisition and control logic execution. Since the master controller is responsible for external data exchange, if the master controller fails, the slave controller must switch to the master role to ensure continuous control of the controlled object.

[0003] Therefore, how to effectively determine the working role of the controller has become a technical problem that technicians in this field urgently need to solve. Summary of the Invention

[0004] In view of the above problems, the present disclosure provides a method and device for determining the working role of a controller to overcome the above problems or at least partially solve the above problems. The technical solution is as follows:

[0005] A method for determining a working role of a controller is applied to a first controller, wherein the first controller is connected to a second controller via at least one optical fiber link and at least one industrial Ethernet link, the method comprising:

[0006] Obtaining first role determination data corresponding to the first controller;

[0007] Determining that there is no abnormal connection between the optical fiber link and the second controller;

[0008] sending the first role determination data to the second controller via the optical fiber link that has no abnormal connection with the second controller, so that the second controller compares the first role determination data with second role determination data corresponding to the second controller to determine the working role of the second controller;

[0009] In a case where it is determined that there is no optical fiber link with no abnormal connection to the second controller, determining that there is no industrial Ethernet link with no abnormal connection to the second controller;

[0010] sending the first role determination data to the second controller via the industrial Ethernet link that has no connection abnormality with the second controller, so that the second controller compares the first role determination data with the second role determination data corresponding to the second controller to determine the working role of the second controller;

[0011] obtaining the second role determination data corresponding to the second controller;

[0012] The first role determination data is compared with the second role determination data to determine the working role of the first controller.

[0013] Optionally, the determining that there is no abnormal connection between the optical fiber link and the second controller includes:

[0014] According to the preset optical fiber link selection order, the connection detection is performed on the at least one optical fiber link in sequence until the optical fiber link with no connection abnormality with the second controller is detected or the detection of each optical fiber link in the at least one optical fiber link is completed.

[0015] Optionally, the determining that there is no abnormal connection between the industrial Ethernet link and the second controller includes:

[0016] According to the preset Ethernet link selection order, the connection detection is performed on the at least one industrial Ethernet link in sequence until the industrial Ethernet link with no connection abnormality with the second controller is detected or the detection of each industrial Ethernet link in the at least one industrial Ethernet link is completed.

[0017] Optionally, the method further includes:

[0018] Receiving heartbeat packets sent by the second controller from each of the optical fiber links and each of the industrial Ethernet links respectively;

[0019] For any link among the optical fiber links and the industrial Ethernet links: if the heartbeat packet sent by the second controller is not received within the preset heartbeat packet transmission interval corresponding to the link, it is determined that the connection of the link is abnormal.

[0020] Optionally, the method further includes:

[0021] When it is determined that all the optical fiber links and all the industrial Ethernet links are abnormally connected, the working role of the first controller is set to a master controller.

[0022] Optionally, the first role determination data includes a first proportional control value, a first total fault score value, a first current working role and a first start-up time, and the second role determination data includes a second proportional control value, a second total fault score value, a second current working role and a second start-up time.

[0023] Optionally, comparing the first role determination data with the second role determination data to determine the working role of the first controller includes:

[0024] Comparing the first proportional control value with the second proportional control value, if the first proportional control value is greater than the second proportional control value, setting the working role of the first controller to be a master controller; if the first proportional control value is less than the second proportional control value, setting the working role of the first controller to be a slave controller;

[0025] When the first proportional control value is equal to the second proportional control value, the first fault total score value is compared with the second fault total score value. If the first fault total score value is greater than the second fault total score value, the working role of the first controller is set to the master controller; if the first fault total score value is less than the second fault total score value, the working role of the first controller is set to the slave controller;

[0026] When the first fault total score value is equal to the second fault total score value, determine whether the first current working role and the second current working role are the same. If they are not the same, maintain the working role of the first controller as the first current working role. If they are the same, compare the first startup time with the second startup time. If the first startup time is earlier than the second startup time, set the working role of the first controller to the master controller. If the first startup time is later than the second startup time, set the working role of the first controller to the slave controller.

[0027] Optionally, the optical fiber link and the industrial Ethernet link are links based on the Transmission Control Protocol.

[0028] Optionally, the first controller includes a first fiber optic interface, a second fiber optic interface, a first Ethernet interface and a second Ethernet interface, the second controller includes a third fiber optic interface, a fourth fiber optic interface, a third Ethernet interface and a fourth Ethernet interface, the at least one fiber optic link includes: a first fiber optic link connecting the first fiber optic interface and the third fiber optic interface and a second fiber optic link connecting the second fiber optic interface and the fourth fiber optic interface, and the at least one industrial Ethernet link includes: a first industrial Ethernet link connecting the first Ethernet interface and the third Ethernet interface and a second industrial Ethernet link connecting the second Ethernet interface and the fourth Ethernet interface.

[0029] A controller work role determination device is applied to a first controller, wherein the first controller is connected to a second controller via at least one optical fiber link and at least one industrial Ethernet link, respectively. The device comprises: a first role determination data obtaining unit, an optical fiber link connection determination unit, a first role determination data sending unit, a second role determination data sending unit, an industrial Ethernet link connection determination unit, a second role determination data obtaining unit, and a work role determination unit.

[0030] The first role determination data obtaining unit is configured to obtain first role determination data corresponding to the first controller;

[0031] The optical fiber link connection determining unit is configured to determine the optical fiber link having no connection abnormality with the second controller;

[0032] The first role determination data sending unit is configured to send the first role determination data to the second controller via the optical fiber link that has no connection abnormality with the second controller, so that the second controller compares the first role determination data with second role determination data corresponding to the second controller to determine the working role of the second controller;

[0033] The industrial Ethernet link connection determination unit is configured to determine the industrial Ethernet link with no connection abnormality to the second controller when it is determined that there is no optical fiber link with no connection abnormality to the second controller;

[0034] The second role determination data sending unit is configured to send the first role determination data to the second controller via the industrial Ethernet link that has no connection abnormality with the second controller, so that the second controller compares the first role determination data with the second role determination data corresponding to the second controller to determine the working role of the second controller;

[0035] The second role determination data obtaining unit is configured to obtain the second role determination data corresponding to the second controller;

[0036] The working role determining unit is configured to compare the first role determination data with the second role determination data to determine the working role of the first controller.

[0037] By means of the above technical solution, the present disclosure provides a method and device for determining the working role of a controller, which is applied to a first controller. The first controller is connected to a second controller via at least one optical fiber link and at least one industrial Ethernet link, respectively. The first controller sends first role determination data corresponding to the first controller to the second controller via an optical fiber link or an industrial Ethernet link without connection anomalies, and obtains second role determination data corresponding to the second controller. The first role determination data is compared with the second role determination data to determine the working roles of the first and second controllers. The present disclosure determines the working roles of the controllers by exchanging role determination data via an optical fiber link or an industrial Ethernet link without connection anomalies, thereby improving the reliability of determining the working roles of the controllers and ensuring continuous control of the control system over the controlled objects.

[0038] The above description is only an overview of the technical solution of the present disclosure. In order to more clearly understand the technical means of the present disclosure, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present disclosure more obvious and easy to understand, the specific implementation methods of the present disclosure are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Various other advantages and benefits will become apparent to those skilled in the art upon reading the detailed description of the preferred embodiment below. The accompanying drawings are for illustration purposes only and are not to be considered as limiting the present disclosure. The same reference symbols are used throughout the drawings to represent the same components. In the drawings:

[0040] Figure 1 A schematic diagram showing a flow chart of an implementation of a method for determining a working role of a controller provided in an embodiment of the present disclosure;

[0041] Figure 2 A flowchart illustrating a specific implementation of step S700 of the method for determining a working role of a controller provided in an embodiment of the present disclosure is shown;

[0042] Figure 3 A schematic structural diagram of a working role determination device for a controller provided in an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0043] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0044] The controller work role determination method provided by the embodiment of the present disclosure can be applied to a first controller, and the first controller is connected to a second controller via at least one optical fiber link and at least one industrial Ethernet link.

[0045] The first controller and the second controller may be APC (Advanced Process Control) controllers. The first controller and the second controller provided in the embodiment of the present disclosure may each include at least one optical fiber interface and at least one industrial Ethernet interface. The first controller and the second controller may be directly connected to their respective optical fiber interfaces via optical fibers to achieve an optical fiber link connection. The industrial Ethernet interface of the first controller may be connected to the industrial Ethernet interface of the second controller via a switch to achieve an industrial Ethernet link.

[0046] Among them, the optical fiber interface is also called an optical fiber redundant port, and can also be called an optical fiber redundant network port. The industrial Ethernet interface can be a high-speed redundant industrial Ethernet communication port, also known as an SCNET communication port. Optionally, the controller provided in the embodiment of the present disclosure may include two optical fiber redundant ports and two SCENT communication ports. The first controller includes a first optical fiber interface, a second optical fiber interface, a first Ethernet interface and a second Ethernet interface, and the second controller includes a third optical fiber interface, a fourth optical fiber interface, a third Ethernet interface and a fourth Ethernet interface. At least one optical fiber link includes: a first optical fiber link connected to the first optical fiber interface and the third optical fiber interface, and a second optical fiber link connected to the second optical fiber interface and the fourth optical fiber interface. At least one industrial Ethernet link includes: a first industrial Ethernet link connected to the first Ethernet interface and the third Ethernet interface, and a second industrial Ethernet link connected to the second Ethernet interface and the fourth Ethernet interface. It is understandable that the controller may also include an indicator light, a display screen and an external communication port. It is understandable that when the optical fiber interface of the controller is not configured as an optical fiber link with other controllers, the optical fiber interface can be used as an external communication port to improve the data access capability of the controller.

[0047] Optionally, the optical fiber link and the industrial Ethernet link are links based on the Transmission Control Protocol (TCP). In the embodiment of the present disclosure, when the first controller and the second controller are connected via an optical fiber interface and an Ethernet interface, after the first controller and the second controller are started, the first controller and the second controller respectively establish an optical fiber link connected by the optical fiber interface and an industrial Ethernet link connected by the Ethernet interface based on the TCP protocol.

[0048] like Figure 1 As shown, a flowchart of an implementation of a method for determining a working role of a controller provided by an embodiment of the present disclosure is provided. The method may include:

[0049] S100: Obtain first role determination data corresponding to a first controller.

[0050] The role decision data is communication data between the controller and the controller's work role decision. The disclosed embodiments can determine the role decision factors included in the role decision data based on actual needs. Optionally, the role decision factors may include: proportional control value (P value), total fault score (Total Weight), current work role (IsWork), and startup time.

[0051] Optionally, embodiments of the present disclosure may design fault scores based on pre-set controller fault types and calculate a total fault score during controller operation. Optionally, embodiments of the present disclosure may integrate the fault scores for each fault type to calculate a proportional control value.

[0052] It is understandable that the controller may collect its own role determination data. The embodiment of the present disclosure uses the role determination data as a basis for determining the working role of the controller, and may scientifically determine the working role of the controller.

[0053] S200: Determine that there is no abnormal optical fiber link connected to the second controller.

[0054] The embodiment of the present disclosure may send the first role determination data to the second controller at a first preset time interval. For example, the first preset time interval may be 500 milliseconds. Optionally, under normal circumstances, the embodiment of the present disclosure selects only one link to send the first role determination data to the second controller.

[0055] Optionally, the embodiment of the present disclosure may select the link for sending the first role determination data in the order of the optical fiber link and the industrial Ethernet. For example, assuming that the first controller includes two optical fiber interfaces and two Ethernet interfaces, the embodiment of the present disclosure may first select the link for sending the first role determination data from the optical fiber links corresponding to the two optical fiber interfaces. If both optical fiber links are abnormally connected, the link for sending the first role determination data from the industrial Ethernet links corresponding to the two Ethernet interfaces may be selected.

[0056] The embodiment of the present disclosure can quickly transmit large amounts of data by preferentially using optical fiber links to send role decision data without affecting the switch and its network, thereby reducing the load on the Ethernet.

[0057] Optionally, the embodiment of the present disclosure can perform connection detection on at least one optical fiber link in sequence according to a preset optical fiber link selection order until an optical fiber link with no connection abnormality with the second controller is detected or the detection of each optical fiber link in at least one optical fiber link is completed.

[0058] For ease of understanding, an example is provided here: assuming that the first controller includes an upper fiber optic interface and a lower fiber optic interface, the disclosed embodiment can first perform a connection test on the fiber optic link corresponding to the upper fiber optic interface. If there is no connection abnormality, the fiber optic link corresponding to the upper fiber optic interface is determined to be a fiber optic link with no connection abnormality to the second controller. If there is a connection abnormality, a connection test is performed on the fiber optic link corresponding to the lower fiber optic interface. If there is no connection abnormality, the fiber optic link corresponding to the lower fiber optic interface is determined to be a fiber optic link with no connection abnormality to the second controller. Otherwise, it is determined that there is no fiber optic link with no connection abnormality to the second controller.

[0059] S300: Sending first role determination data to the second controller via an optical fiber link that has no abnormal connection with the second controller, so that the second controller compares the first role determination data with second role determination data corresponding to the second controller to determine the working role of the second controller.

[0060] If it is determined that there is no optical fiber link with the second controller that has no abnormal connection, step S400 is performed.

[0061] S400: Determine that there is no abnormal industrial Ethernet link connected to the second controller.

[0062] Optionally, the embodiment of the present disclosure can perform connection detection on at least one industrial Ethernet link in sequence according to a preset Ethernet link selection order until an industrial Ethernet link with no connection abnormality with the second controller is detected or the detection of each industrial Ethernet link in at least one industrial Ethernet link is completed.

[0063] For ease of understanding, an example is provided here: assuming that the first controller includes a left Ethernet interface and a right Ethernet interface, the disclosed embodiment can first perform a connection check on the industrial Ethernet link corresponding to the left Ethernet interface. If there is no connection abnormality, the industrial Ethernet link corresponding to the left Ethernet interface is determined to be an industrial Ethernet link with no connection abnormality to the second controller. If there is a connection abnormality, a connection check is performed on the industrial Ethernet link corresponding to the right Ethernet interface. If there is no connection abnormality, the industrial Ethernet link corresponding to the right Ethernet interface is determined to be an industrial Ethernet link with no connection abnormality to the second controller. Otherwise, it is determined that each optical fiber link and each industrial Ethernet link has a connection abnormality.

[0064] S500. Send the first role determination data to the second controller via an industrial Ethernet link with no connection abnormality with the second controller, so that the second controller compares the first role determination data with second role determination data corresponding to the second controller to determine the working role of the second controller.

[0065] Optionally, embodiments of the present disclosure may receive heartbeat packets sent by the second controller from each fiber link and each industrial Ethernet link. For any fiber link or industrial Ethernet link, if no heartbeat packet is received from the second controller within a preset heartbeat packet transmission interval corresponding to the link, a connection abnormality is determined for the link.

[0066] It can be understood that the embodiment of the present disclosure sends heartbeat packets to the second controller according to the preset heartbeat packet transmission interval corresponding to each link, so that the second controller can determine whether the link connection is abnormal.

[0067] Optionally, in the embodiment of the present disclosure, if it is determined that all optical fiber links and all industrial Ethernet links are abnormally connected, the first controller may be set to the master controller. Similarly, if it is determined that all optical fiber links and all industrial Ethernet links are abnormally connected, the second controller may be set to the master controller.

[0068] S600: Obtain second role determination data corresponding to the second controller.

[0069] The embodiment of the present disclosure can obtain the second role determination data sent by the second controller through an optical fiber link or an industrial Ethernet link. The second controller can send the second role determination data to the first controller at a second preset time interval. Optionally, the second preset time interval can be the same as the first preset time interval. It can be understood that the link selected by the second controller to send the second role determination data is similar to the link selected by the first controller to send the first role determination data. The process of the second controller selecting the link to send the second role determination data can refer to the process of the first controller selecting the link to send the first role determination data.

[0070] It is understood that the link selected by the second controller to send the second role determination data is determined by the second controller detecting the connection of each link. The link selected by the first controller to send the first role determination data can be the same as or different from the link selected by the second controller to send the second role determination data.

[0071] S700: Compare the first role determination data with the second role determination data to determine the working role of the first controller.

[0072] Optionally, the first role determination data includes a first proportional control value, a first total fault score, a first current working role and a first start-up time, and the second role determination data includes a second proportional control value, a second total fault score, a second current working role and a second start-up time.

[0073] Optional, such as Figure 2 As shown, a flowchart of a specific implementation of step S700 of the method for determining the working role of a controller provided in an embodiment of the present disclosure is provided. Step S700 may include:

[0074] S01. Compare the first proportional control value with the second proportional control value. If the first proportional control value is greater than the second proportional control value, proceed to step S02. If the first proportional control value is less than the second proportional control value, proceed to step S03. If the first proportional control value is equal to the second proportional control value, proceed to step S04.

[0075] S02: Set the working role of the first controller to be a master controller.

[0076] S03: Set the working role of the first controller to a slave controller.

[0077] S04. Compare the first fault total score with the second fault total score. If the first fault total score is greater than the second fault total score, proceed to step S02. If the first fault total score is less than the second fault total score, proceed to step S03. If the first fault total score is equal to the second fault total score, proceed to step S05.

[0078] S05. Determine whether the first current work role and the second current work role are the same. If they are not the same, execute step S06. If they are the same, execute step S07.

[0079] S06: Maintain the working role of the first controller as the first current working role.

[0080] S07: Compare the first startup time with the second startup time. If the first startup time is earlier than the second startup time, execute step S02. If the first startup time is later than the second startup time, execute step S03.

[0081] The embodiment of the present disclosure sets up multiple links for determining the master and slave working roles of the controller. As long as any link remains normal, the master and slave working roles of the controller can be determined, thereby improving the reliability of determining the working roles of the controller.

[0082] When the first controller is a master controller, the first controller exchanges data with the outside. When the first controller is a slave controller, the first controller remains silent to the outside.

[0083] The process by which the second controller determines its own work role based on the comparison of the first role determination data with the second role determination data corresponding to the second controller is similar to that of the first controller. Reference can be made to the aforementioned process by which the first controller compares the first role determination data with the second role determination data to determine its own work role. It is understood that the first and second controllers independently determine their own work roles, and there is no need to communicate the results of the work roles to each other after determination.

[0084] The present disclosure provides a method for determining the working roles of controllers, which is applied to a first controller. The first controller is connected to a second controller via at least one optical fiber link and at least one industrial Ethernet link, respectively. The first controller sends first role determination data corresponding to the first controller to the second controller via the optical fiber link or industrial Ethernet link without connection anomalies, and obtains second role determination data corresponding to the second controller. The first role determination data is compared with the second role determination data to determine the working roles of the first and second controllers. The present disclosure determines the working roles of the controllers by exchanging role determination data via the optical fiber link or industrial Ethernet link without connection anomalies, thereby improving the reliability of determining the working roles of the controllers and ensuring continuous control of the control system over the controlled object.

[0085] Although the operations are depicted in a particular order, this should not be understood as requiring that the operations be performed in the particular order shown or in a sequential order.Multitasking and parallel processing may be advantageous under certain circumstances.

[0086] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0087] Corresponding to the above method embodiment, the embodiment of the present disclosure further provides a working role determination device of a controller, the structure of which is as follows: Figure 3 As shown, the device is applied to a first controller, and the first controller is connected to the second controller via at least one optical fiber link and at least one industrial Ethernet link respectively. The device includes: a first role determination data obtaining unit 100, an optical fiber link connection determination unit 200, a first role determination data sending unit 300, a second role determination data sending unit 400, an industrial Ethernet link connection determination unit 500, a second role determination data obtaining unit 600 and a work role determination unit 700.

[0088] The first role determination data obtaining unit 100 is configured to obtain first role determination data corresponding to the first controller.

[0089] The optical fiber link connection determination unit 200 is configured to determine an optical fiber link with no abnormal connection to the second controller.

[0090] The first role determination data sending unit 300 is used to send the first role determination data to the second controller through an optical fiber link that has no connection abnormalities with the second controller, so that the second controller determines the working role of the second controller based on the comparison between the first role determination data and the second role determination data corresponding to the second controller.

[0091] The industrial Ethernet link connection determination unit 500 is configured to determine an industrial Ethernet link with no abnormal connection to the second controller when it is determined that no optical fiber link with no abnormal connection to the second controller exists.

[0092] The second role determination data sending unit 400 is used to send the first role determination data to the second controller via an industrial Ethernet link with no connection abnormality with the second controller, so that the second controller determines the working role of the second controller based on the comparison between the first role determination data and the second role determination data corresponding to the second controller.

[0093] The second role determination data obtaining unit 600 is configured to obtain second role determination data corresponding to the second controller.

[0094] The working role determining unit 700 is configured to compare the first role determination data with the second role determination data to determine the working role of the first controller.

[0095] Optionally, the optical fiber link connection determination unit 200 is specifically used to perform connection detection on at least one optical fiber link in sequence according to a preset optical fiber link selection order until an optical fiber link with no connection abnormality with the second controller is detected or the detection of each optical fiber link in at least one optical fiber link is completed.

[0096] Optionally, the industrial Ethernet link connection determination unit 500 is specifically used to perform connection detection on at least one industrial Ethernet link in sequence according to a preset Ethernet link selection order, until an industrial Ethernet link with no connection abnormality with the second controller is detected or the detection of each industrial Ethernet link in at least one industrial Ethernet link is completed.

[0097] Optionally, the device may further include: a heartbeat packet receiving unit and a link abnormality determining unit.

[0098] The heartbeat packet receiving unit is used to receive the heartbeat packets sent by the second controller from each optical fiber link and each industrial Ethernet link respectively.

[0099] The link abnormality determination unit is used to determine that the connection of any link among each optical fiber link and each industrial Ethernet link is abnormal if the heartbeat packet sent by the second controller is not received within the preset heartbeat packet transmission interval corresponding to the link.

[0100] Optionally, the device may further include: a first work role setting unit.

[0101] The first working role setting unit is configured to set the working role of the first controller to a master controller when it is determined that all optical fiber links and all industrial Ethernet links are abnormally connected.

[0102] Optionally, the first role determination data includes a first proportional control value, a first total fault score, a first current working role and a first start-up time, and the second role determination data includes a second proportional control value, a second total fault score, a second current working role and a second start-up time.

[0103] Optionally, the working role determination unit 700 includes: a proportional control value comparison subunit, a master controller setting subunit, a slave controller setting subunit, a fault total score comparison subunit, a current working role comparison subunit, a working role maintenance subunit, and a start time comparison subunit.

[0104] The proportional control value comparison subunit is used to compare the first proportional control value with the second proportional control value. If the first proportional control value is greater than the second proportional control value, the main controller setting subunit is triggered; if the first proportional control value is less than the second proportional control value, the slave controller setting subunit is triggered; when the first proportional control value is equal to the second proportional control value, the fault total score comparison subunit is triggered.

[0105] The main controller setting subunit is used to set the working role of the first controller to be the main controller.

[0106] The slave controller setting subunit is used to set the working role of the first controller to be a slave controller.

[0107] The fault total score comparison subunit is used to compare the first fault total score with the second fault total score. If the first proportional control value is greater than the second proportional control value, the master controller setting subunit is triggered. If the first fault total score is less than the second fault total score, the slave controller setting subunit is triggered. If the first fault total score is equal to the second fault total score, the current working role comparison subunit is triggered.

[0108] The current work role comparison subunit is used to determine whether the first current work role and the second current work role are the same. If they are not the same, the work role maintenance subunit is triggered; if they are the same, the start time comparison subunit is triggered.

[0109] The working role maintaining subunit is configured to maintain the working role of the first controller as the first current working role.

[0110] The startup time comparison subunit is used to compare the first startup time with the second startup time. If the first startup time is earlier than the second startup time, the main controller setting subunit is triggered; if the first startup time is later than the second startup time, the slave controller setting subunit is triggered.

[0111] The present disclosure provides a controller work role determination device, which is applied to a first controller. The first controller is connected to a second controller via at least one optical fiber link and at least one industrial Ethernet link, respectively. The first controller sends first role determination data corresponding to the first controller to the second controller via the optical fiber link or industrial Ethernet link without connection anomalies, and obtains second role determination data corresponding to the second controller. The first role determination data is compared with the second role determination data to determine the work roles of the first and second controllers. The present disclosure determines the work roles of the controllers by exchanging role determination data via the optical fiber link or industrial Ethernet link without connection anomalies, thereby improving the reliability of determining the work roles of the controllers and ensuring continuous control of the control system over the controlled object.

[0112] Regarding the apparatus in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0113] The working role determination device of the controller includes a processor and a memory. The above-mentioned first role determination data obtaining unit 100, optical fiber link connection determination unit 200, first role determination data sending unit 300, second role determination data sending unit 400, industrial Ethernet link connection determination unit 500, second role determination data obtaining unit 600 and working role determination unit 700 are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.

[0114] The processor includes a kernel, which retrieves the corresponding program unit from memory. One or more kernels can be configured. By adjusting kernel parameters, role determination data is exchanged over a fiber optic link or industrial Ethernet link with no connectivity anomalies, thereby determining the controller's operating role. This improves the reliability of controller role determination and ensures continuous control of the control system over the controlled object.

[0115] An embodiment of the present disclosure provides a computer-readable storage medium having a program stored thereon, which implements the method for determining the working role of the controller when the program is executed by a processor.

[0116] An embodiment of the present disclosure provides a processor, which is configured to run a program, wherein the method for determining a working role of a controller is executed when the program is run.

[0117] An embodiment of the present disclosure provides an electronic device comprising at least one processor, at least one memory device connected to the processor, and a bus; the processor and the memory device communicate with each other via the bus; and the processor is configured to invoke program instructions stored in the memory device to execute the controller's working role determination method. The electronic device herein may be a server, a PC, a PAD, a mobile phone, or the like.

[0118] The present disclosure also provides a computer program product, which, when executed on an electronic device, is adapted to execute the program of the method steps of determining the working role of the controller.

[0119] The present disclosure is described with reference to the flowcharts and / or block diagrams of the methods, apparatuses, electronic devices (systems), and computer program products according to the embodiments of the present disclosure. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable device to produce a machine, so that the instructions executed by the processor of the computer or other programmable device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0120] In a typical configuration, an electronic device includes one or more processors (CPUs), a memory, and a bus. The electronic device may also include an input / output interface, a network interface, and the like.

[0121] Memory may include non-permanent memory in a computer-readable medium, random access memory (RAM), and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory includes at least one memory chip. Memory is an example of a computer-readable medium.

[0122] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.

[0123] In the description of the present disclosure, it should be understood that if the terms "up", "down", "front", "back", "left" and "right" are used to indicate directions or positional relationships, they are based on the directions or positional relationships shown in the accompanying drawings. They are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the positions or elements referred to must have a specific direction, be constructed and operate in a specific direction. Therefore, they should not be understood as limitations of the present disclosure.

[0124] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. It should also be noted that the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, commodity, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, commodity, or device comprising the element.

[0125] Those skilled in the art will appreciate that embodiments of the present disclosure may be provided as methods, systems, or computer program products. Thus, the present disclosure may take the form of a fully hardware embodiment, a fully software embodiment, or an embodiment combining software and hardware. Furthermore, the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0126] The above are merely examples of the present disclosure and are not intended to limit the present disclosure. Various modifications and variations are possible for those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present disclosure are intended to be included within the scope of the claims of the present disclosure.

Claims

1. A method for determining a working role of a controller, characterized in that: Applied to a first controller, the first controller being connected to a second controller via at least one optical fiber link and the at least one industrial Ethernet link, the method comprising: Obtaining first role determination data corresponding to the first controller; the first role determination data includes a first proportional control value, a first total fault score value, a first current working role, and a first start time; Determining that there is no abnormal connection between the optical fiber link and the second controller; sending the first role determination data to the second controller via the optical fiber link having no abnormal connection with the second controller, so that the second controller compares the first role determination data with second role determination data corresponding to the second controller to determine the working role of the second controller; the second role determination data includes a second proportional control value, a second total fault score value, a second current working role, and a second startup time; In a case where it is determined that there is no optical fiber link with no abnormal connection to the second controller, determining that there is no industrial Ethernet link with no abnormal connection to the second controller; sending the first role determination data to the second controller via the industrial Ethernet link that has no connection abnormality with the second controller, so that the second controller compares the first role determination data with the second role determination data corresponding to the second controller to determine the working role of the second controller; obtaining the second role determination data corresponding to the second controller; The first role determination data is compared with the second role determination data to determine the working role of the first controller, including: comparing the first proportional control value with the second proportional control value, if the first proportional control value is greater than the second proportional control value, setting the working role of the first controller to be the master controller; if the first proportional control value is less than the second proportional control value, setting the working role of the first controller to be the slave controller; when the first proportional control value is equal to the second proportional control value, comparing the first fault total score value with the second fault total score value, if the first fault total score value is greater than the second fault total score value, setting the working role of the first controller to be Master controller, if the first total fault score is less than the second total fault score, set the working role of the first controller to the slave controller; when the first total fault score is equal to the second total fault score, determine whether the first current working role and the second current working role are the same. If they are not the same, maintain the working role of the first controller as the first current working role. If they are the same, compare the first startup time with the second startup time. If the first startup time is earlier than the second startup time, set the working role of the first controller to the master controller. If the first startup time is later than the second startup time, set the working role of the first controller to the slave controller.

2. The method according to claim 1, characterized in that The determining that there is no abnormal connection between the optical fiber link and the second controller includes: According to the preset optical fiber link selection order, the connection detection is performed on the at least one optical fiber link in sequence until the optical fiber link with no connection abnormality with the second controller is detected or the detection of each optical fiber link in the at least one optical fiber link is completed.

3. The method according to claim 1, characterized in that The determining that there is no abnormal connection between the industrial Ethernet link and the second controller includes: According to the preset Ethernet link selection order, the connection detection is performed on the at least one industrial Ethernet link in sequence until the industrial Ethernet link with no connection abnormality with the second controller is detected or the detection of each industrial Ethernet link in the at least one industrial Ethernet link is completed.

4. The method according to claim 1, wherein Also includes: Receiving heartbeat packets sent by the second controller from each of the optical fiber links and each of the industrial Ethernet links respectively; For any link among the optical fiber links and the industrial Ethernet links: if the heartbeat packet sent by the second controller is not received within the preset heartbeat packet transmission interval corresponding to the link, it is determined that the connection of the link is abnormal.

5. The method according to claim 1, wherein Also includes: When it is determined that all the optical fiber links and all the industrial Ethernet links are abnormally connected, the working role of the first controller is set to a master controller.

6. The method according to claim 1, characterized in that The optical fiber link and the industrial Ethernet link are links based on the Transmission Control Protocol.

7. The method according to claim 1, characterized in that The first controller includes a first optical fiber interface, a second optical fiber interface, a first Ethernet interface and a second Ethernet interface; the second controller includes a third optical fiber interface, a fourth optical fiber interface, a third Ethernet interface and a fourth Ethernet interface; the at least one optical fiber link includes: a first optical fiber link connecting the first optical fiber interface and the third optical fiber interface and a second optical fiber link connecting the second optical fiber interface and the fourth optical fiber interface; the at least one industrial Ethernet link includes: a first industrial Ethernet link connecting the first Ethernet interface and the third Ethernet interface and a second industrial Ethernet link connecting the second Ethernet interface and the fourth Ethernet interface.

8. A device for determining a working role of a controller, characterized in that: The device is applied to a first controller, the first controller being connected to a second controller via at least one optical fiber link and the at least one industrial Ethernet link, the device comprising: a first role determination data obtaining unit, an optical fiber link connection determining unit, a first role determination data sending unit, a second role determination data sending unit, an industrial Ethernet link connection determining unit, a second role determination data obtaining unit, and a work role determining unit. The first role determination data obtaining unit is configured to obtain first role determination data corresponding to the first controller; the first role determination data includes a first proportional control value, a first total fault score, a first current working role, and a first start time; The optical fiber link connection determining unit is configured to determine the optical fiber link having no connection abnormality with the second controller; The first role determination data sending unit is configured to send the first role determination data to the second controller via the optical fiber link that has no connection abnormality with the second controller, so that the second controller compares the first role determination data with second role determination data corresponding to the second controller to determine the working role of the second controller; the second role determination data includes a second proportional control value, a second total fault score value, a second current working role, and a second startup time; The industrial Ethernet link connection determination unit is configured to determine the industrial Ethernet link with no connection abnormality to the second controller when it is determined that there is no optical fiber link with no connection abnormality to the second controller; The second role determination data sending unit is configured to send the first role determination data to the second controller via the industrial Ethernet link that has no connection abnormality with the second controller, so that the second controller compares the first role determination data with the second role determination data corresponding to the second controller to determine the working role of the second controller; The second role determination data obtaining unit is configured to obtain the second role determination data corresponding to the second controller; The working role determination unit is configured to compare the first role determination data with the second role determination data to determine the working role of the first controller; The working role determination unit includes: a proportional control value comparison subunit, a master controller setting subunit, a slave controller setting subunit, a fault total score comparison subunit, a current working role comparison subunit, a working role maintenance subunit, and a start time comparison subunit; The proportional control value comparison subunit is configured to compare the first proportional control value with the second proportional control value, and trigger the master controller setting subunit if the first proportional control value is greater than the second proportional control value; and trigger the slave controller setting subunit if the first proportional control value is less than the second proportional control value; and trigger the total fault score comparison subunit if the first proportional control value is equal to the second proportional control value; The main controller setting subunit is used to set the working role of the first controller to be the main controller; The slave controller setting subunit is configured to set the working role of the first controller to be a slave controller; The fault total score comparison subunit is used to compare the first fault total score with the second fault total score. If the first fault total score is greater than the second fault total score, the master controller setting subunit is triggered; if the first fault total score is less than the second fault total score, the slave controller setting subunit is triggered; and if the first fault total score is equal to the second fault total score, the current working role comparison subunit is triggered; The current work role comparison subunit is configured to determine whether the first current work role and the second current work role are the same, and if they are not the same, trigger the work role maintenance subunit; if they are the same, trigger the start time comparison subunit; The working role maintaining subunit is configured to maintain the working role of the first controller as the first current working role; The startup time comparison subunit is used to compare the first startup time with the second startup time. If the first startup time is earlier than the second startup time, the main controller setting subunit is triggered; if the first startup time is later than the second startup time, the slave controller setting subunit is triggered.

Citation Information

Patent Citations

  • Master and slave state determining method of redundant controllers

    CN104570721A

  • Controller redundancy switching method and device, computer device and storage medium

    CN108319256A