CN108153195B - Controller switching method, device, equipment and computer readable storage medium - Google Patents

Controller switching method, device, equipment and computer readable storage medium Download PDF

Info

Publication number
CN108153195B
CN108153195B CN201711420088.2A CN201711420088A CN108153195B CN 108153195 B CN108153195 B CN 108153195B CN 201711420088 A CN201711420088 A CN 201711420088A CN 108153195 B CN108153195 B CN 108153195B
Authority
CN
China
Prior art keywords
modules
online
effective
detecting
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711420088.2A
Other languages
Chinese (zh)
Other versions
CN108153195A (en
Inventor
宋振新
李蒙
周新辉
刘桐杰
康军凯
郑超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Hollysys Automation Co Ltd
Original Assignee
Hangzhou Hollysys Automation Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Hollysys Automation Co Ltd filed Critical Hangzhou Hollysys Automation Co Ltd
Priority to CN201711420088.2A priority Critical patent/CN108153195B/en
Publication of CN108153195A publication Critical patent/CN108153195A/en
Application granted granted Critical
Publication of CN108153195B publication Critical patent/CN108153195B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
    • G05B19/0423Input/output

Abstract

The invention discloses a controller switching method, a device, equipment and a computer readable storage medium, wherein the method comprises the following steps: detecting the number of online modules and the number of effective AI modules in a specified system; detecting the number of online modules and the number of effective AI modules in the appointed system after a first preset time interval, and indicating a main controller and a slave controller in the appointed system to switch with each other if the number of online modules detected at the current time is reduced by a preset sharp reduction ratio than the last time and/or the number of effective AI modules detected at the current time is reduced by the preset sharp reduction ratio than the last time; otherwise, returning to the step of detecting the number of the online modules and the number of the effective AI modules in the specified system after the first preset time interval. Therefore, the situation that the offline modules are out of control by the main controller to influence the safety of field operation when a large number of online input/output modules and/or AI modules are offline is avoided, and the safety of field operation is effectively ensured.

Description

Controller switching method, device, equipment and computer readable storage medium
Technical Field
The present invention relates to the field of controller switching technologies, and in particular, to a controller switching method, apparatus, device, and computer-readable storage medium.
Background
When a Distributed Control System (DCS) system including a DP master card, a DP slave station, and a controller operates, the controller needs to perform safe and effective control on all input/output modules (modules for short) on site, so that the communication state and online condition of each module need to be detected at regular time.
The controller has a function of COM bit diagnosis and is used for detecting the communication state and the online condition of all modules on site at regular time. When all modules on the site are in fault and off-line, the DP master station and the DP slave station of the controller are considered to fail in communication, the master controller and the slave controller are automatically switched at the moment, the switching reason is informed, and the master controller is reset to be descended to the slave controller, the slave controller is lifted to be the master controller and continues to operate. However, if most modules on the site have faults and are offline, the COM bit detection is still normal at the moment, the offline diagnosis conditions of all the modules are not met, and the controller does not perform master-slave switching but continues to operate. In this case, the current controller has lost control of these off-line modules, i.e., lost control of most parts of the field, which is meaningless to continue operation and may affect safe operation of the field.
In summary, how to provide a technical scheme for effectively ensuring the safety of field operation is a problem to be solved urgently by those skilled in the art.
Disclosure of Invention
The invention aims to provide a controller switching method, a controller switching device, controller switching equipment and a computer readable storage medium, which can effectively ensure the safety of field operation.
In order to achieve the above purpose, the invention provides the following technical scheme:
a controller switching method, comprising:
detecting the number of online modules and the number of effective AI modules in a specified system, wherein the number of online modules is the number of online input/output modules, the number of effective AI modules is the number of online AI modules, and the input/output modules comprise the AI modules;
detecting the number of online modules and the number of effective AI modules in the designated system after a first preset time interval, if the number of online modules detected at the current time is smaller than the number of online modules detected at the last time by a preset sharp reduction ratio, and/or the number of effective AI modules detected at the current time is smaller than the number of effective AI modules detected at the last time by a preset sharp reduction ratio, determining that a data flow fault occurs, and indicating that a master controller and a slave controller in the designated system are switched with each other; otherwise, returning to the step of detecting the number of the online modules and the number of the effective AI modules in the specified system after the first preset time interval.
Preferably, before detecting the number of online modules and the number of valid AI modules in the specified system, the method further includes:
and judging whether the number of the input and output modules which should be online in the specified system is larger than the preset total number, if so, executing the step of detecting the number of the online modules and the number of the effective AI modules in the specified system, and if not, returning to execute the step of judging whether the number of the input and output modules which should be online in the specified system is larger than the preset total number after a second preset time interval.
Preferably, before detecting the number of online modules in the specified system after the first preset time interval, the method further includes:
and judging whether the number of the online modules detected last time is larger than a first preset component, if so, executing the step of detecting the number of the online modules in the appointed system after a first preset time interval, and if not, refusing to execute the step of detecting the number of the online modules in the appointed system after the first preset time interval.
Preferably, before detecting the number of valid AI modules in the designated system after the first preset time interval, the method further includes:
and judging whether the number of the effective AI modules detected last time is larger than a second preset component, if so, executing the step of detecting the number of the effective AI modules in the appointed system after a first preset time interval, and if not, refusing to execute the step of detecting the number of the effective AI modules in the appointed system after the first preset time interval.
Preferably, after determining that the data stream failure occurs, the method further includes:
and counting whether the frequency of continuous data flow faults reaches a preset frequency, if so, executing a step of indicating the mutual switching of a main controller and a slave controller in the appointed system, and if not, returning to the step of detecting the number of online modules and the number of effective AI modules in the appointed system after a first preset time interval.
Preferably, the detecting the number of online modules and the number of valid AI modules in the designated system includes:
and updating the number of the state detection online modules and the number of the effective AI modules based on the channel values of the input and output modules and the AI modules.
Preferably, the detecting the number of online modules and the number of valid AI modules in the designated system includes:
and detecting the number of online modules and the number of effective AI modules based on the input/output modules and the heartbeat signals of the AI modules.
A controller switching device comprising:
a preliminary detection module to: detecting the number of online modules and the number of effective AI modules in a specified system, wherein the number of online modules is the number of online input/output modules, the number of effective AI modules is the number of online AI modules, and the input/output modules comprise the AI modules;
a controller switching module to: detecting the number of online modules and the number of effective AI modules in the designated system after a first preset time interval, if the number of online modules detected at the current time is smaller than the number of online modules detected at the last time by a preset sharp reduction ratio, and/or the number of effective AI modules detected at the current time is smaller than the number of effective AI modules detected at the last time by a preset sharp reduction ratio, determining that a data flow fault occurs, and indicating that a master controller and a slave controller in the designated system are switched with each other; otherwise, returning to the step of detecting the number of the online modules and the number of the effective AI modules in the specified system after the first preset time interval.
A controller switching device comprising:
a memory for storing a computer program;
a processor for implementing the steps of the controller switching method as described in any one of the above when executing the computer program.
A computer readable storage medium having stored thereon a computer program which, when executed by a processor, carries out the steps of the controller switching method according to any one of the preceding claims.
The invention provides a controller switching method, a device, equipment and a computer readable storage medium, wherein the method comprises the following steps: detecting the number of online modules and the number of effective AI modules in a specified system, wherein the number of online modules is the number of online input/output modules, the number of effective AI modules is the number of online AI modules, and the input/output modules comprise the AI modules; detecting the number of online modules and the number of effective AI modules in the designated system after a first preset time interval, if the number of online modules detected at the current time is smaller than the number of online modules detected at the last time by a preset sharp reduction ratio, and/or the number of effective AI modules detected at the current time is smaller than the number of effective AI modules detected at the last time by a preset sharp reduction ratio, determining that a data flow fault occurs, and indicating that a master controller and a slave controller in the designated system are switched with each other; otherwise, returning to the step of detecting the number of the online modules and the number of the effective AI modules in the specified system after the first preset time interval. In the technical scheme disclosed by the application, the online input/output module quantity and the AI module quantity in the designated system are detected at regular time, so that whether the online module quantity and/or the AI module quantity are sharply reduced relative to the corresponding quantity detected last time is judged, if yes, the main controller is considered to possibly have faults, the main controller is controlled to be mutually switched with the slave controller, and otherwise, relevant detection steps are continuously realized. Therefore, whether the controller needs to be switched is determined according to the offline conditions of the online input/output module and the AI module, and then the switching of the controller is completed when the online input/output module and/or the AI module is sharply reduced, so that the condition that the offline module is not controlled by the main controller to influence the safety of the field operation when the online input/output module and/or the AI module is largely offline is avoided, and the safety of the field operation is effectively ensured.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a controller switching method according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a first algorithm block for implementing module online status detection in a controller switching method according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a second algorithm block for implementing module online status detection in a controller switching method according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a controller switching device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, a flowchart of a controller switching method according to an embodiment of the present invention is shown, where the method includes:
s11: detecting the number of online modules and the number of effective AI modules in the specified system, wherein the number of online modules is the number of online input/output modules, the number of effective AI modules is the number of online AI modules, and the input/output modules comprise AI modules.
The execution subject of the controller switching method provided by the embodiment of the present invention may be a corresponding device or apparatus, and the device or apparatus may be integrated in the main controller, so that the execution subject of the controller switching method provided by the embodiment of the present invention may be the main controller.
The DCS comprises a controller, a DP master card and a DP slave station, wherein the DP master card is a Profibus DP master station which is integrated on board cards of the master controller and the slave controller respectively, the DP slave station is an input/output module (module for short) supporting a Profibus DP slave station protocol, and the DP slave station is in periodic communication with the DP master card and comprises an analog quantity input/output module, a digital quantity input/output module and the like; the AI module is an analog input module and is contained in the input and output module; the controller (comprising a master controller and a slave controller) is equipment which receives input data of the input/output module periodically through the DP master card, performs operation according to the input data and controls the output of the input/output module through the DP master card; the online modules are online input and output modules, the number of the online modules is the number of the online input and output modules, the effective AI modules are online AI modules, the number of the effective AI modules is the number of the online AI modules, and the online AI modules in the application can normally communicate with the DP master card so as to be monitored by the controller; and the designated system can be any DCS system designated according to actual needs.
S12: detecting the number of online modules and the number of effective AI modules in the designated system after a first preset time interval, if the number of online modules detected at the current time is smaller than the number of online modules detected at the last time by a preset sharp reduction ratio and/or the number of effective AI modules detected at the current time is smaller than the number of effective AI modules detected at the last time by the preset sharp reduction ratio, determining that a data flow fault occurs, and indicating that a master controller and a slave controller in the designated system are switched with each other; otherwise, returning to the step of detecting the number of the online modules and the number of the effective AI modules in the specified system after the first preset time interval.
The first preset time interval may be set according to actual needs, for example, 4 seconds, so that the timing detection of the number of online modules and the number of effective AI modules in the designated system is realized based on the first preset time interval, that is, the number of online modules and the number of effective AI modules in the designated system are detected once every other first preset time interval. The preset sharp reduction proportion can be set according to actual needs, the number of online modules detected at the current time is compared with the number of online modules detected at the last time, the number of effective AI modules detected at the current time is compared with the number of effective AI modules detected at the last time, if the comparison result shows that the number of online modules detected at the current time is smaller than the number of online modules detected at the last time by the preset sharp reduction proportion and/or the number of effective AI modules detected at the current time is smaller than the number of effective AI modules detected at the last time by the preset sharp reduction proportion, it is determined that a large amount of offline occurs to the input/output module and the effective AI modules within a short time, the communication failure of the DP master card and the DP slave station of the master controller is considered, and the master-slave state of the controller is automatically switched at. Otherwise, the main controller is considered to be in a normal working state, and the detection related steps are returned to be executed, so that the online state monitoring of each input/output module and each effective AI module is ensured. In addition, the switching between the master controller and the slave controller means that the master controller reduces the self state to the slave controller and executes the task to be completed by the slave controller after resetting, and the slave controller increases the self state to the task to be completed by the master controller to continue running.
It should be noted that an interface can be reserved for the outside, so that the outside can modify the preset sharp reduction ratio (FP) through the interface according to the actual field requirement.
In the technical scheme disclosed by the application, the online input/output module quantity and the AI module quantity in the designated system are detected at regular time, so that whether the online module quantity and/or the AI module quantity are sharply reduced relative to the corresponding quantity detected last time is judged, if yes, the main controller is considered to possibly have faults, the main controller is controlled to be mutually switched with the slave controller, and otherwise, relevant detection steps are continuously realized. Therefore, whether the controller needs to be switched is determined according to the offline conditions of the online input/output module and the AI module, and then the switching of the controller is completed when the online input/output module and/or the AI module is sharply reduced, so that the condition that the offline module is not controlled by the main controller to influence the safety of the field operation when the online input/output module and/or the AI module is largely offline is avoided, and the safety of the field operation is effectively ensured.
In addition, in order to effectively implement the above technical solution disclosed in the present application, the number value detected at this time may be saved after the online module number and the effective AI module number of the specified system are detected each time.
The controller switching method provided in the embodiment of the present invention may further include, before detecting the number of online modules and the number of effective AI modules in the designated system:
and judging whether the number of the input and output modules which should be online in the specified system is larger than the preset total number, if so, executing the step of detecting the number of the online modules and the number of the effective AI modules in the specified system, and if not, returning to execute the step of judging whether the number of the input and output modules which should be online in the specified system is larger than the preset total number after a second preset time interval.
The second preset time interval can be set according to actual needs, such as 4 seconds; the preset total number can be set according to the actual condition of the DCS system, such as 12. If the number of i/o modules that should be on-line in a given system is too small, it may happen that one i/o module and/or valid AI module goes off-line to reach the corresponding preset sharp decrease ratio, which is not reasonable, therefore, when the number of input/output modules to be online in a given system is too small, the detection and subsequent determination of the number of online modules and the number of valid AI modules are meaningless, therefore, when the number of input/output modules that should be online in a given system is not greater than the preset total number, if the number of the input/output modules to be online is considered to be too small, the relationship between the number of the input/output modules to be online and the preset total number is returned to be judged after a second preset time interval, otherwise, the detection and subsequent judgment steps of the online module and the effective AI module in the application are realized, so that the resource waste, the misjudgment and other conditions are avoided.
The controller switching method provided in the embodiment of the present invention may further include, before detecting the number of online modules in the designated system after a first preset time interval, the following:
and judging whether the number of the online modules detected last time is larger than a first preset component, if so, executing the step of detecting the number of the online modules in the appointed system after a first preset time interval, and if not, refusing to execute the step of detecting the number of the online modules in the appointed system after the first preset time interval.
The first preset component may be the same as the preset total number, or slightly smaller than the preset total number, and may be specifically set according to actual needs. If the number of online modules detected last time is too small, the offline of an input/output module during current detection may reach a corresponding preset sharp reduction ratio, which is unreasonable, so that the detection and subsequent judgment of the number of online modules in a specified system are meaningless when the number of online modules detected last time is too small, and therefore when the number of online modules detected last time is not more than a first preset component in the application, the number of online modules detected last time is considered to be too small, and the detection of the number of online modules is rejected; otherwise, the detection and the subsequent steps of the number of the online modules are realized, so that the situations of resource waste, misjudgment and the like are effectively avoided.
The controller switching method provided in the embodiment of the present invention may further include, before detecting the number of effective AI modules in the designated system after a first preset time interval, the following:
and judging whether the number of the effective AI modules detected last time is larger than a second preset component, if so, executing the step of detecting the number of the effective AI modules in the appointed system after a first preset time interval, and if not, refusing to execute the step of detecting the number of the effective AI modules in the appointed system after the first preset time interval.
The second preset component is generally smaller than the preset total number, for example, the preset total number is 12, and the second preset component may be 6, which may be specifically set according to actual needs. If the number of the effective AI modules detected last time is too small, the offline of one AI module possibly occurs during the current detection to reach the corresponding preset sharp reduction ratio, which is unreasonable, so that the detection and subsequent judgment of the number of the effective AI modules when the number of the effective AI modules detected last time in the specified system is too small are meaningless, and therefore, when the number of the effective AI modules detected last time is not more than a second preset component in the application, the number of the effective AI modules detected last time is considered to be too small, and the detection of the number of the effective AI modules is refused; otherwise, the detection and the subsequent steps of the number of the effective AI modules are realized, thereby effectively avoiding the occurrence of resource waste, misjudgment and the like.
The technical scheme disclosed by the application flexibly and effectively solves the problem that part of modules are applied in the scene of offline faults, so that the fault diagnosis function of the controller is more complete, the application of the scene of completely covering all modules offline and part modules offline on the site is realized, the operation of the controller on the modules on the site is safer and more reasonable, and the operation mechanism of the controller is safer and more reliable.
The controller switching method provided in the embodiment of the present invention, after determining that a data stream fault occurs, may further include:
and counting whether the frequency of continuous data flow faults reaches a preset frequency, if so, executing a step of indicating the mutual switching of a main controller and a slave controller in the appointed system, and if not, returning to the step of detecting the number of online modules and the number of effective AI modules in the appointed system after a first preset time interval.
The preset times can be set according to actual needs, such as 3. In the method, if the continuous data flow faults occur for a preset number of times, the main controller and the sub controller are controlled to switch with each other, otherwise, the steps of detecting the number of the online modules and the number of the effective AI modules and subsequent judgment are continuously realized. Therefore, the situation that the master controller and the slave controller are switched due to misjudgment caused by error in one detection can be avoided, the switching between the master controller and the slave controller is realized after the data stream fault is determined for multiple times, and the effectiveness and the accuracy of the switching of the controllers are further ensured.
The method for switching the controller provided by the embodiment of the invention is used for detecting the number of online modules and the number of effective AI modules in a specified system, and comprises the following steps:
and updating the number of the state detection online modules and the number of the effective AI modules based on the channel values of the input and output modules and the AI modules.
The method includes updating the state detection online module quantity and the effective AI module quantity based on channel values of an input/output module and an AI module, detecting whether data refreshing exists in channel values of the input/output module and the AI module preset quantity (which can be set according to actual needs, such as 2) within a certain preset time period (such as 4 seconds) before the current moment and before the current moment, considering the corresponding module to be online if the data refreshing exists, further counting the quantity of the online input/output module and the AI module to obtain the corresponding online module quantity and the effective AI module quantity, and considering the corresponding module to be offline if the data refreshing does not exist. Therefore, the accurate detection of the online state of the module is realized.
Specifically, the algorithm block for implementing the updating of the state detection online module number and the valid AI module number based on the channel values of the input/output module and the AI module may be as shown in fig. 2, and the definition of each pin in the algorithm block is as shown in table 1.
TABLE 1
Figure BDA0001522847960000091
The implementation principle of the algorithm block is as follows: obtaining the number of effective AI modules and the online states of all input and output modules through ARR _ MAR and ARR _ ON, and obtaining the online number of the modules through the online states of the input and output modules; the last effective AI module quantity and the online states of all the input and output modules are stored in the algorithm block, whether the master and slave switching of the controller is needed or not is judged according to the current detected effective AI module quantity and/or online module quantity and the preset sharp reduction proportion FP, and a result SWITCH is output.
The method for switching the controller provided by the embodiment of the invention is used for detecting the number of online modules and the number of effective AI modules in a specified system, and comprises the following steps:
and detecting the number of online modules and the number of effective AI modules based on the input/output modules and the heartbeat signals of the AI modules.
The method includes detecting the number of online modules and the number of effective AI modules based on the heartbeat signals of the input/output module and the AI modules, and detecting whether the heartbeat signals sent by the input/output module and the AI modules are received within a certain time period (e.g. 4 seconds) preset before the current time and before the current time, if so, determining that the corresponding modules are online, further counting the number of the online input/output modules and the AI modules to obtain the number of the corresponding online modules and the number of the effective AI modules, and if not, determining that the corresponding modules are offline. Therefore, the accurate detection of the online state of the module is realized.
Specifically, the algorithm block for detecting the number of online modules and the number of valid AI modules based on the heartbeat signals of the input/output module and the AI module may be as shown in fig. 3, and the definition of each pin in the algorithm block is as shown in table 2.
TABLE 2
Figure BDA0001522847960000101
The implementation principle of the algorithm block is as follows: obtaining heartbeat signals of all modules through K _ BEAT, and obtaining the online number of the modules through the heartbeat signals of the modules; and the heartbeat signals of all the modules at the last time are stored in the algorithm block, whether the master and slave switching of the controller needs to be carried out or not is judged according to the heartbeat signals of all the modules at the current time and the preset sharp reduction proportion FP, and a result SWITCH is output.
It should be noted that, in the present application, instructing the master controller and the slave controller to SWITCH to each other may be implemented by setting a switching flag corresponding to a data stream failure (the switching flag may be implemented by setting a SWITCH value in tables 1 and 2, that is, when the SWITCH value is TRUE, it indicates that the switching flag is set, otherwise, the switching flag is not set), specifically, when it is determined that the comparison result is that the number of the online modules detected last time is smaller than the number of the online modules detected last time by a preset sharp reduction ratio, and/or the number of the effective AI modules detected last time is smaller than the number of the effective AI modules detected last time by a preset sharp reduction ratio, the switching flag is set, and the master controller may read the switching flag once every preset time interval (e.g. 100 milliseconds), and reset to the slave controller when the switching flag is read for a preset number of times, and informs the slave controller of the switching reason, namely the occurrence of data stream failure; and the slave controller receives the notification and then is upgraded to the master controller, if the slave controller has data stream fault or COM bit fault at the moment, the master controller and the slave controller are not switched, the master-slave ping-pong switching phenomenon is prevented, and the master-slave switching can not be carried out again until the master controller is determined to have no fault and to be completely healthy.
An embodiment of the present invention further provides a controller switching device, as shown in fig. 4, which may include:
a preliminary detection module 11 configured to: detecting the number of online modules and the number of effective AI modules in a specified system, wherein the number of online modules is the number of online input/output modules, the number of effective AI modules is the number of online AI modules, and the input/output modules comprise the AI modules;
a controller switching module 12 for: detecting the number of online modules and the number of effective AI modules in the designated system after a first preset time interval, if the number of online modules detected at the current time is smaller than the number of online modules detected at the last time by a preset sharp reduction ratio, and/or the number of effective AI modules detected at the current time is smaller than the number of effective AI modules detected at the last time by a preset sharp reduction ratio, determining that a data flow fault occurs, and indicating that a master controller and a slave controller in the designated system are switched with each other; otherwise, returning to the step of detecting the number of the online modules and the number of the effective AI modules in the specified system after the first preset time interval.
The controller switching device provided by the embodiment of the invention can be realized by an algorithm block arranged in a controller, wherein the algorithm block is written by using a structured text language (ST language), and a function is packaged into a visual graphical interface with an input/output interface for realizing a certain program set with a specific function. Of course, other settings can be made according to actual needs, and are within the protection scope of the present invention.
The controller switching device provided by the embodiment of the present invention may further include:
a first determining module, configured to: before detecting the number of online modules and the number of effective AI modules in a specified system, judging whether the number of input/output modules which should be online in the specified system is larger than a preset total number, if so, indicating to execute the step of detecting the number of online modules and the number of effective AI modules in the specified system, and if not, returning to execute the step of judging whether the number of input/output modules which should be online in the specified system is larger than the preset total number after a second preset time interval.
The controller switching device provided by the embodiment of the present invention may further include:
a second determination module configured to: and judging whether the number of the online modules detected last time is greater than a first preset component or not before detecting the number of the online modules in the specified system after a first preset time interval, if so, indicating to execute the step of detecting the number of the online modules in the specified system after the first preset time interval, and if not, refusing to execute the step of detecting the number of the online modules in the specified system after the first preset time interval.
The controller switching device provided by the embodiment of the present invention may further include:
a third judging module, configured to: and judging whether the number of the effective AI modules detected last time is larger than a second preset component or not before detecting the number of the effective AI modules in the appointed system after the first preset time interval, if so, indicating to execute the step of detecting the number of the effective AI modules in the appointed system after the first preset time interval, and if not, refusing to execute the step of detecting the number of the effective AI modules in the appointed system after the first preset time interval.
The controller switching device provided by the embodiment of the present invention may further include:
a fourth determining module, configured to: and after determining that the data stream faults occur, counting whether the number of times of continuous data stream faults reaches a preset number, if so, indicating to execute the step of indicating the mutual switching of the main controller and the slave controller in the specified system, and if not, indicating to execute the step of detecting the number of online modules and the number of effective AI modules in the specified system after a first preset time interval.
In an embodiment of the present invention, the preliminary detection module and the controller switching module may both include:
a first detection unit to: and updating the number of the state detection online modules and the number of the effective AI modules based on the channel values of the input and output modules and the AI modules.
In an embodiment of the present invention, the preliminary detection module and the controller switching module may both include:
a second detection unit for: and detecting the number of online modules and the number of effective AI modules based on the input/output modules and the heartbeat signals of the AI modules.
An embodiment of the present invention further provides a controller switching device, which may include:
a memory for storing a computer program;
a processor for implementing the steps of the controller switching method as described in any one of the above when executing the computer program.
An embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the controller switching method according to any of the above embodiments may be implemented.
For a description of a relevant part of a controller switching device, a device and a computer readable storage medium provided in the embodiments of the present invention, reference is made to detailed descriptions of a corresponding part of a controller switching method provided in the embodiments of the present invention, and details are not repeated herein. In addition, parts of the technical solutions provided in the embodiments of the present invention that are consistent with the implementation principles of the corresponding technical solutions in the prior art are not described in detail, so as to avoid redundant description.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (8)

1. A controller switching method, comprising:
detecting the number of online modules and the number of effective AI modules in a specified system, wherein the number of online modules is the number of online input/output modules, the number of effective AI modules is the number of online AI modules, and the input/output modules comprise the AI modules;
detecting the number of online modules and the number of effective AI modules in the designated system after a first preset time interval, if the number of online modules detected at the current time is smaller than the number of online modules detected at the last time by a preset sharp reduction ratio, and/or the number of effective AI modules detected at the current time is smaller than the number of effective AI modules detected at the last time by a preset sharp reduction ratio, determining that a data flow fault occurs, and indicating that a master controller and a slave controller in the designated system are switched with each other; otherwise, returning to the step of detecting the number of the online modules and the number of the effective AI modules in the specified system after the first preset time interval;
before detecting the number of online modules and the number of effective AI modules in the specified system, the method further comprises the following steps:
judging whether the number of the input and output modules which should be online in the specified system is larger than the preset total number, if so, executing the step of detecting the number of the online modules and the number of the effective AI modules in the specified system, and if not, returning to execute the step of judging whether the number of the input and output modules which should be online in the specified system is larger than the preset total number after a second preset time interval;
after determining that the data stream fault occurs, the method further comprises the following steps:
and counting whether the frequency of continuous data flow faults reaches a preset frequency, if so, executing a step of indicating the mutual switching of a main controller and a slave controller in the appointed system, and if not, returning to the step of detecting the number of online modules and the number of effective AI modules in the appointed system after a first preset time interval.
2. The method of claim 1, wherein before detecting the number of online modules in the given system after a first predetermined time interval has elapsed, further comprising:
and judging whether the number of the online modules detected last time is larger than a first preset component, if so, executing the step of detecting the number of the online modules in the appointed system after a first preset time interval, and if not, refusing to execute the step of detecting the number of the online modules in the appointed system after the first preset time interval.
3. The method of claim 2, wherein before detecting the number of valid AI modules in the given system after a first predetermined time interval has elapsed, further comprising:
and judging whether the number of the effective AI modules detected last time is larger than a second preset component, if so, executing the step of detecting the number of the effective AI modules in the appointed system after a first preset time interval, and if not, refusing to execute the step of detecting the number of the effective AI modules in the appointed system after the first preset time interval.
4. The method of claim 1, wherein detecting the number of online modules and the number of valid AI modules in a given system comprises:
and updating the number of the state detection online modules and the number of the effective AI modules based on the channel values of the input and output modules and the AI modules.
5. The method of claim 1, wherein detecting the number of online modules and the number of valid AI modules in a given system comprises:
and detecting the number of online modules and the number of effective AI modules based on the input/output modules and the heartbeat signals of the AI modules.
6. A controller switching device, comprising:
a preliminary detection module to: detecting the number of online modules and the number of effective AI modules in a specified system, wherein the number of online modules is the number of online input/output modules, the number of effective AI modules is the number of online AI modules, and the input/output modules comprise the AI modules;
a controller switching module to: detecting the number of online modules and the number of effective AI modules in the designated system after a first preset time interval, if the number of online modules detected at the current time is smaller than the number of online modules detected at the last time by a preset sharp reduction ratio, and/or the number of effective AI modules detected at the current time is smaller than the number of effective AI modules detected at the last time by a preset sharp reduction ratio, determining that a data flow fault occurs, and indicating that a master controller and a slave controller in the designated system are switched with each other; otherwise, returning to the step of detecting the number of the online modules and the number of the effective AI modules in the specified system after the first preset time interval;
the device further comprises:
a first determining module, configured to: before detecting the number of online modules and the number of effective AI modules in a specified system, judging whether the number of input/output modules which are to be online in the specified system is larger than a preset total number, if so, executing the step of detecting the number of online modules and the number of effective AI modules in the specified system, and if not, returning to execute the step of judging whether the number of input/output modules which are to be online in the specified system is larger than the preset total number after a second preset time interval;
a fourth determining module, configured to: and after determining that the data stream faults occur, counting whether the number of times of continuously occurring data stream faults reaches a preset number, if so, executing a step of indicating the main controller and the slave controller in the specified system to switch mutually, and if not, returning to execute a step of detecting the number of online modules and the number of effective AI modules in the specified system after a first preset time interval.
7. A controller switching device, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the controller switching method according to any one of claims 1 to 5 when executing the computer program.
8. A computer-readable storage medium, having stored thereon a computer program which, when being executed by a processor, carries out the steps of the controller switching method according to any one of claims 1 to 5.
CN201711420088.2A 2017-12-25 2017-12-25 Controller switching method, device, equipment and computer readable storage medium Active CN108153195B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711420088.2A CN108153195B (en) 2017-12-25 2017-12-25 Controller switching method, device, equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711420088.2A CN108153195B (en) 2017-12-25 2017-12-25 Controller switching method, device, equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN108153195A CN108153195A (en) 2018-06-12
CN108153195B true CN108153195B (en) 2020-11-27

Family

ID=62465661

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711420088.2A Active CN108153195B (en) 2017-12-25 2017-12-25 Controller switching method, device, equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN108153195B (en)

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100429596C (en) * 2006-01-19 2008-10-29 吴胜华 Collecting and distributing large capacity field high-speed real-time redundance communicating method and system thereof
CN102361106B (en) * 2011-09-07 2013-06-12 航天科工深圳(集团)有限公司 Storage battery temperature adjusting system
CN103455005B (en) * 2013-09-06 2015-07-22 北京四方继保自动化股份有限公司 Controller redundancy and switching method
CN105278516B (en) * 2014-06-24 2017-12-12 南京理工大学 A kind of implementation method of the reliable fault-tolerant controller of dual redundant switching value PLC control system
CN104714406B (en) * 2014-12-31 2017-06-09 重庆川仪自动化股份有限公司 Input/output module redundancy switching method
CN104571041B (en) * 2014-12-31 2017-06-09 重庆川仪自动化股份有限公司 Based on 1:The method of data synchronization of 1 controller redundancy
CN205003224U (en) * 2015-09-02 2016-01-27 中国南方电网有限责任公司调峰调频发电公司天生桥水力发电总厂 500kV owner becomes dc magnetic biasing data and keeps watch on collection system on line

Also Published As

Publication number Publication date
CN108153195A (en) 2018-06-12

Similar Documents

Publication Publication Date Title
CN111694710A (en) Method, device and equipment for monitoring faults of substrate management controller and storage medium
CN111446015B (en) Nuclear power station reactor control rod group test method, device, equipment and medium
US10986556B2 (en) Circuit for monitoring a data processing system
CN109960599B (en) Chip system, watchdog self-checking method thereof and electrical equipment
CN108153195B (en) Controller switching method, device, equipment and computer readable storage medium
CN111221683A (en) Double-flash hot backup method, system, terminal and storage medium for data center switch
CN109358982B (en) Hard disk self-healing device and method and hard disk
CN111400136A (en) Server-dedicated GPU fault protection device, method, equipment and medium
AU2007308270A1 (en) Method for carrying out online program changes on an automation system
CN109753404B (en) Control system state monitoring circuit and method and control system central processing unit
US9829874B2 (en) Numerical control device
CN114116276A (en) BMC hang-up self-recovery method, system, terminal and storage medium
CN113993752B (en) Electronic control unit and computer-readable recording medium
CN112162887A (en) Storage device and machine frame shared component access method, device and storage medium thereof
CN111857689A (en) Framework, function configuration method of framework, terminal and storage medium
US20200183733A1 (en) Vehicle control device
CN113535441A (en) Embedded system fault diagnosis device and method
KR101376658B1 (en) Failure detecting apparatus of a-d converter for digital protection relay
CN109885450B (en) Active satellite-borne computer health state monitoring and optimizing method and system
CN116055315B (en) MVB communication configuration method, device, equipment and storage medium
RU2694008C1 (en) Method for dynamic reconfiguration of computing systems of modular architecture
CN110532132B (en) Safety control method, medium and equipment for hot standby server
JP5494039B2 (en) Memory diagnostic method and control device for power conversion device
JP2020197825A (en) Triple parallel processing apparatus and parallel processing method
CN115964234A (en) Clock anomaly detection method and device, storage medium and terminal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant