一种主从设备切换控制方法技术领域本发明涉及一种设备之间工作的切换控制方法,特别是涉及一种冗余系统中主从设备切换控制方法。 It relates to a control method of a master-work switching between the switching apparatus from an apparatus control TECHNICAL FIELD The present invention particularly relates to a redundant system from the master device switches the control method. 背景技术在工业自动化领域,为了改进系统的可靠性, 一般会对系统的连续运作起关键作用的功能部件进行冗余配置,其冗余配置的备用部件会与主运作部件采用相同的配置,以降低风险,增加系统的可靠性。 BACKGROUND features in the field of industrial automation, in order to improve system reliability, continuous operation of the system will generally play a key role in the redundant configuration, and the main operation will spare component member which redundant configuration using the same configuration to reduce risks and increase system reliability. 冗余配置的作用是当主运作部件出现故障或需要更换主运作部件或需要对主运作部件的内部运作系统做更新升级之前,通过采用备用部件接管内部信息,并且将备用系统作为新的运作系统运作,使得该系统无中断的继续运行。 Role of redundant configuration is when the main operational component failure or to change the main operating member or required before the internal operating system of the main operating member to make an upgrade to take over internal information through the use of spare parts, and the standby system as a new operational system operation so that the system continues to run without interruption. 通常,在构建冗余系统时,需要对冗余切换进行控制,这样,处于工作状态的主设备意外发生故障时,通过冗余切换控制方法,启动备用设备运作,以保证控制任务的连续性。 Typically, when constructing a redundant system, the need for redundant switching control, so that, when the master device is operating unexpectedly fails, the redundant switching control method, the standby apparatus starts operation, to ensure continuity of the control task. 目前,已知的冗余切换控制方法中, 一般都会在主从设备之间建立实时通信机制,主设备定时反复发送自身的运行状态给备用设备,当备用设备检测到主设备出现故障而自身工作正常时,即进行主从设备切换,而上述自身运行状态信息仅包含了主设备的硬件工作信息及主设备的系统运行信息。 Currently, the known redundant switching control method, generally between the master and slave devices to establish real-time communication mechanism, the timing of the master device repeatedly sends its own operating state to the standby device, when the backup device to the master device detects a failure in the work itself when normal, i.e. for switching from the master device, and said state information of its own operating system run contains only information about the hardware operation of the main device and the main device information. 例如公开号为CN1815908A的中国发明专利"通信设备主从切换方法及通信设备"中就提到这样一种通信设备主从切换方法,其包括以下步骤:a、作为主设备的第一设备通过CPU看门狗监测工作状态;作为从设备的第二设备通过CPU看门狗监测工作状态;主设备和从设备输出自身主从标志信号到对方;b、第一设备和第二设备根据对方主从状态决定自身工作状态。 Publication No. CN1815908A, for example, the Chinese patent "master-slave switching method of a communication device and a communication equipment" mentions a method for switching from the main communication device, comprising the steps of: a, as a first master device by the CPU the watchdog monitoring state; state as a watchdog monitoring device by the CPU from the second device; master device and the slave device outputs its own flag signal from the master to each other; b, the first and second devices according to a master-slave counterpart state to determine their own working condition. 上述通信设备主从切换方法仅提到主从设备检测自身标志信号从而决定自身工作状态,即是否需要进行主从切换,而对于主从设备与外接客户设备之间的是否正常通讯是不作考虑的,并且对于自身标志信号在所述公开号为CN1815908A的专利后文中仅提到为主或从设备工作异常或接收到切换指令,至于如何判断主或从设备工作异常在全文中都没有述及。 Switching the communication from the apparatus main mentioned method only from the master device detects the flag signal to determine their own operating state, i.e. the need for switching from the master, but for normal communication between the master device and the external client device is not considered to and a flag signal for itself in the Publication No. CN1815908A patent is hereinafter referred to only master or slave device is not working or the switching instruction is received, or as to how to determine the main exceptions are not addressed slave device throughout the text. 再如公开号为CN1275000A的中国发明专利"用于冗余切换控制的设备和方法"中也提到了一种具有运作系统和备用系统的冗余结构的冗余切换控制方法,该方法包 "Apparatus and method for redundant switching control" Another example of Publication No. CN1275000A Chinese patent also mentioned redundant switching control method having a redundant configuration of operational and standby systems, the method
括:两个控制装置, 一个作为控制受控装置的运作系统运作,所述两个控制装置通过信号线连接到对方装置,该信号线传送指示自己的控制装置的正常/异常状态、安装/未安装状态、切换使能/禁止状态或运作/不运作状态中的一种状态信号,通过这一信号线的另一控制装置的所述信号,识别彼此的状态,来执行运作系统和备用系统之间的切换。 Comprising: two control means, one operating as the operational system controlling the controlled device, the control means is connected to two other devices via a signal line, which transmits a signal line indicative of normal / abnormal state of the own control unit, installation / non mounted state, switching enabled / disabled state or operating / non-operating state one state signal, said signal by means of the further control signal line, to identify each other's presence, to perform operational system and standby systems switching between. 上述冗余切换控制方法方法中,决定是否需要执行切换操作的主要依据还是判断两个控制装置的状态信号,这些状态信号仅只是表示自身的运作状况,而对于控制装置和受控装置之间是否正常通讯也是不作考虑的,更没有研究和提及如何判断和识别控制装置和受控装置之间的通讯是否正常,而对于冗余系统主从设备切换控制方法中控制装置和受控装置之间是否正常通讯是考虑是否需要切换的最终因素,也是最重要因素;同时,上述状态信号是通过连接在两个控制装置之间的信号线传送的,如果信号线出现故障的话,两个控制装置之间的状态信号传递就会出现问题,这样就会出现两种结果:第一就是备用控制装置接收不到主控制装置的状态信号后不做响应,第二,备用控制装置接收不到主控制装置的状态信号后自动启动切换,这样就很容易造成误切 Redundant switching control method of the above-described method, the main basis decide whether to perform the switching operation of the state determination signal two or control means, which is only the state signal indicative of its own operating condition, and the control means between the controlled device and whether normal communication is not taken into account, and no mention of research and how to determine the communication between the control means and the identification and the controlled device is normal, and for a redundant system between the master device and the controlled device from a control device to switch control method whether the final factor to consider is the normal communication whether switching, the most important factor; the same time the state signal is transmitted through the connection means between the two control signal lines, two signal lines if the control means fails, then the status signal is transmitted between the problem occurs, so there will be two results: the first is the backup control device can not receive the status signal in response to the main control unit is not, the second, backup control means does not receive the main control unit after the automatic start switch status signal, so that it is easy to cause a miscut 。 . 发明内容本发明所要解决的技术问题是针对上述现有技术提供一种主从设备切换时不仅考虑主从设备自身运行状态是否正常及主从设备与外接的客户设备之间是否正常通讯, 还考虑主从设备之间连接的信号线出现故障时能有效避免误切换的主从设备切换控制方法。 The present invention solves the main technical problem is to provide a view of the above prior art from the device to switch from master to consider not only whether the device itself is operating smoothly and between master and slave devices and external client communications device is normal, but also consider can effectively prevent erroneous switching of the primary master failure occurs between the signal line from the device from the device handover control method. 本发明进一步要解决的技术问题是,在上述主从设备切换控制方法过程中,提供一种如何检测主从设备自身运行状态的方法及如何判断和识别主从设备与外接的客户设备之间是否正常通讯的方法。 The present invention further technical problem to be solved, in the above-described master and slave devices during the handover control method, there is provided a method of how to detect the master device itself whether and how to determine the operating state of the master and slave device identification and the external client device the normal method of communication. 本发明解决上述第一个技术问题所采用的技术方案为:该主从设备切换控制方法,至少包括有一正在运行的主服务器对象, 一客户对象, 一与主服务器对象具有相同配置的备用服务器对象, 一连接在主服务器对象与客户对象间的主工作信道及一连接在备用服务器对象与客户对象间的备用工作信道;主服务器对象通过可监听通讯连接方式与备用服务器对象连接;其特征在于:所述的主从设备切换控制方法包含以下步骤-步骤一:在备用服务器对象与主服务器对象之间建立实时通信机制,主服务器对象会按照定义好的时间间隔反复发送主运行状态给备用服务器对象;步骤二:当备用服务器对象与主服务器对象之间通信正常,主服务器对象定时检测主运行状态,当主运行状态出现故障、备用服务器对象正常,则主服务器对象主动发送切换控制命令给备用 Technical Solution said first technical problem of the present invention is to solve is: the master and slave devices handover control method, comprising at least a main server object a running a client object, a primary server object with the backup server object with the same configuration a connected to the main working channel between the primary server object and a client object and a connection between the backup server object and the client object's standby operating channel; master server object via can monitor the communication connection to the backup server objects; characterized in that: said main switching device comprising the steps of a control method from - a step of: establishing a mechanism for real-time communication between the master server and standby server target object, and the server object is transmitted repeatedly at the interval of the main operating state to the backup server object in accordance with the time defined ; step 2: when the standby server object between the object and the master server can communicate with the master server the master timing detection target operating state, the operating state when the primary fails, the backup server object is normal, the master server object sends control commands to switch the standby 服务器对象,备用服务器对象启动运行备用工作信道,客户 Server object, the server object starts running the standby channel standby operation, the client
对象通过备用工作信道与备用服务器对象通信;当主运行状态正常,客户对象继续通过主工作信道与主服务器对象通信;步骤三:当备用服务器对象与主服务器对象之间通信出现故障;备用服务器对象通过备用工作信道监听主工作信道状态,当主工作信道状态出现故障、主服务器对象与客户对象间的通信中断而备用服务器对象正常,则备用服务器根据接收到的主工作信道状态中的故障信号启动运行备用工作信道,客户对象通过备用工作信道与备用服务器对象通信;当主工作信道状态正常,客户对象继续通过主工作信道与主服务器对象通信c上述主运行状态包括主服务器对象的运行状态和主工作信道的运行状态。 Objects through alternate working channel of the object to communicate with the backup server; when the main operating normally, the client object continues through the master channel and the primary server object communication; Step three: when a communication failure between the standby server object with the primary server object; standby server object via standby operation channel-sounding master channel state, when the main working channel state fails, the communication between the master server object and the client object interrupts the standby server object is normal, the standby server backup based on the fault signal of the main working channel state received in the start operation working channel, the client object through the standby working channel of the object to communicate with the backup server; when the main working channel is normal, the client object continues through the master channel and the primary server object communication c of the main operating condition includes operating status of the primary server object and master channel Operating status. 即当主备服务器对象之间正常通信时,只要主服务器对象的运行状态和主工作信道运行状态中任何一个状态出现故障而备用服务器对象正常,则系统进行主从设备切换;而当主备服务器对象之间的通信出现故障,备用工作信道监听主工作信道状态,只有当主工作信道状态出现故障以后,才启动主从切换,而不是因为备用服务器对象接收不到主运行状态信息,就判断主服务器对象故障从而启动进行主从切换,这样能有效避免将正常运行的主服务器对象切换成备用服务器对象的误切换。 That is, when the normal communication between the primary and the server object, as long as the operating state of the master object and a main working channel operating state to any state fails and the standby server object normally, the system proceeds master switches from the apparatus; and when the standby server objects of the communication failure between the standby working channel listening master channel state, only when the future master channel state fails, it starts the master-slave switching, not because the standby server object can not receive the master operation state information, determines that the primary server object failure thereby starting switch over the primary, which can effectively prevent the normal operation of the primary server to the backup server switching target object erroneous switching. 上述可监听通讯连接方式为网络通讯或串行通讯方式。 The above-described embodiment can monitor the communication link to the communication network or serial communication. 本发明解决上述第二个技术问题所采用的技术方案为:主/从服务器对象运行状态的检测方法包含以下步骤-步骤(-):主服务器对象定时检测与之连接的外部设备是否脱机,如果在定时间隔里检测到所有的外部设备都脱机,则表示主服务器对象故障;步骤(二):主服务器对象与外部设备连接正常,备用服务器^t象定时检测主服务器对象的通信量,如果在定时间隔里未检测到主服务器对象的通信量,则表示主服务器对象故障。 The present invention is to solve the above second technical problem is a technical solution: a master / slave operation state detection server object comprising the following steps - steps (-): Object master timing detection whether an external apparatus connected thereto off, If the detected external devices are all in the off timing interval, the master server object indicates failure; step (2): the master server object connected to an external device is normal, the standby server traffic ^ t as the master timing detection object, If the timing interval is not detected in the primary traffic server object, the server object represents the main fault. 主/从服务器对象与外接的客户对象之间工作信道状态检测的方法包含以下步骤:步骤(-):为每个客户对象及服务器对象设置四个参数-帧差错率:接收到的无效字节数占接收到的总字节数的百分比;通信差错极值:帧差错率的最大极限值;数据流率:每秒接收的字节数乘8的数目;通信统计时间间隔;步骤(二):在一个通信统计时间间隔里: 当数据流率为0时,则表示工作信道状态出现故障;当数据流率不为0时,如果帧差错率小于通信差错极值,表示工作信道状态良好; 如果帧差错率大于通信差错极值,则表示工作信道状态出现故障。 Master / slave method of working channel state between the external client and the server object's object detection comprising the following steps: (-): setting four parameters for each client object and server object - frame error: invalid byte received percentage of the total number of bytes received; communication error extremum: the maximum frame error rate limit; a data flow rate: the number of bytes received per second by the number of 8; communication statistics interval; step (ii) : in a time interval communication statistics: when the data flow rate of 0, representing the operating state of the failed channel; flow rate when the data is not 0, if the frame error rate is less than a communication error extremum indicating good working channel state; If the frame error rate is greater than a communication error extremum, then the working channel failure state. 为了保证冗余机制的完善,作为进一步改进,本发明所述的主服务器对象至少具 In order to ensure complete redundancy mechanism As a further improvement, the master server object of the present invention has at least a
有二个工作信道端口,当主服务器对象与客户对象间的主工作信道出现故障,主服务器对象将所有外接设备的主工作信道端口切换到另一工作信道端口,主服务器对象的其他备用工作信道端口接收轮流测试。 There are two working channel port, when the main working channel between the primary server object and the client object fails, the master server objects master channel for all external devices ports into the other working channel port, other alternate working channel in the primary server object port receiving rotation test. 同样,所述的备用服务器对象也具有至少二个工作信道端口,当备用服务器对象与客户对象间的备用工作信道出现故障,备用服务器对象将所有外接设备的备用工作信道端口切换到另一工作信道端口,备用服务器对象的备用工作信道端口接收轮流测试。 Also, the backup server object also has at least two working channel port, when the secondary working channel between a standby server object and the client object fails, the secondary server object appears to alternate working channels of all external devices ports into the other working channel port, alternate working channel port receives standby server object turns test. 当然,客户对象也可以具有多个工作信道端口,当客户对象与主服务器对象间的主工作信道出现故障,客户对象将主工作信道端口切换到备用工作信道端口。 Of course, the client object may have a plurality of ports operating channels, when the main working channel between the client object and server object master failure, the master-client object is switched to the standby channel port working channel port. 上述信道端口切换方法包含以下步骤:'步骤l:为每个工作信道设定一个安全访问定时器;步骤2:判断工作信道安全访问定时器是否超时,如没有超时,计算工作信道状态;如已经超时,延迟一端时间后,继续判断工作信道安全访问定时器是否超时;步骤3:如果当前工作信道状态出现故障,判断另一个工作信道端口上次工作是否正确关闭,如果另一个工作信道端口上次工作是正确关闭,则激活另一个工作信道端步骤4:如果另一个工作信道端口上次工作是非正常关闭,则重复步骤l、步骤2、步骤3。 Said channel port switching method comprising the following steps: "Step L: set a security access timer for each working channel; Step 2: determining the working channel security access timer expires, if not timed out, calculations channel state; as already timeout delay end time, determines whether to continue working channel security access timer expires; step 3: If the current state of the working channel fails, the other working channel port is determined whether the work was last shut down properly, the other working channel port if the last work is correctly closed, the other end of the working channel activate step 4: If another working channel of the port normally closed last non-working, repeat step L, step 2, step 3. 步骤5:如果所有工作信道端口均非正常关闭,则表示工作信道状态出现故障。 Step 5: If all the working channel ports are closed abnormally, representing the operating state of the failed channel. 与现有技术相比,本发明的优点在于:第一,冗余系统中是否需要主从设备切换的判断依据是不管主备服务器对象之间的通信是否正常,只要主工作信道运行状态出现故障而备用服务器对象正常,即进行主从设备切换,而不是仅仅考虑备用服务器对象检测道主服务器对象的运行状态出现故障后才进行主从设备切换,能较好避免误切换;第二,在判断主服务器对象自身运行状态时设置一定时器,超过定时器间隔未检测主服务器对象的通信量或与外设脱机,就判定主服务器对象故障;第三,为主备工作信道建立帧差错率、通信差错极值、数据流率、通信统计时间间隔四个参数,可以安全稳定的判断工作信道是否工作正常。 Compared with the prior art, advantages of the present invention is that: first, the need to determine whether the redundant system switches from the master device based on whether a communication between the server object regardless of normal standby, as long as the operating state of the main working channel failure normal and the standby server object, that is after a fault occurs from master switching device, rather than considering only object detecting operation when the standby channel is the primary server object from a master switching device, the switching can better avoid false; second, it is determined primary server state object itself running a timer, the timer interval is not detected over the primary traffic server and peripheral objects or offline, it is determined that primary server object failure; third, the main channel establishment preparatory work frame error rate , extremum communication error, the flow rate data, the communication time interval of four statistical parameters, determined safe and stable working channel is working properly. 本发明提供主从设备切换控制方法相较现有技术是一个更安全,更完善的冗余切换控制机制。 The present invention provides a method for controlling the switching master and slave devices compared to the prior art is a safer, better redundant switching control mechanism. 附图说明图l为本发明实施例中冗余系统的结构框图;图2为本发明实施例中主服务器对象切换控制方法流程图;图3为本发明实施例中备用服务器对象的切换控制方法流程图;图4为本发明实施例中主/备用服务器对象运行状态的检测方法流程图;图5为本发明实施例中主/备工作信道状态检测的方法流程图;图6本发明实施例中信道端口切换方法流程图。 BRIEF DESCRIPTION OF THE redundant system block diagram of embodiment of the present invention, FIG. L; flowchart illustrating a master server object handover control method embodiment of the present invention, FIG. 2; FIG. 3 handover control method of the server object alternate embodiment of the present invention flowchart; FIG. 4 is a flowchart of the detection method according to a master / standby server object operating state of the invention; FIG. 5 embodiment master / slave working channel status detecting flowchart of a method of the present invention; Figure 6 embodiment of the present invention flowchart of a method of channel switching port. 具体实施方式以下结合附图实施例对本发明作进一步详细描述。 Example DRAWINGS The invention will be further described in detail below in connection with specific embodiments. 图l所示的冗余系统中,包括有正在运行的主服务器对象l,客户对象2,与主服务器对象具有相同配置的备用服务器对象3,连接主服务器对象与客户对象的主工作信道,连接备用服务器对象与客户对象的备用工作信道;主服务器对象通过可监听通讯连接方式与备用服务器对象连接;该可监听通讯连接方式可以为网络通讯方式也可以为串行通讯方式。 Figure l shown in a redundant system, including the master server objects running l, client object 2, the master server object has the same configuration as the standby server object 3, the channel connecting the master server the master-client object with the object, the connection alternate working channel object and the client object standby server; a host server connected to the target object through the standby server can monitor communication connections; can monitor the communication connection may be a communication network may be a serial communication. 主服务器对象与备用服务器对象通过信号线相连,并且备用服务器对象与主服务器对象之间通过该信号线建立实时通信机制,主服务器对象会按照定义好的时间间隔反复发送主服务器对象的自身运行状态和主工作信道的运行状态给备用服务器对象; 主服务器对象与备用服务器对象的切换控制方法是主备服务器对象同时进行逻辑判断。 Master server object via a signal line connected to the alternate server object, the server object and between the standby master server object creation mechanism for real-time communication through the signal line, the master server the master server repeatedly transmits the objects according to the object itself intervals defined operating state and operating state of the main working channel to the standby server object; master server object and the server object standby switching control method is the primary and the server object while logical judgment. 对于主服务器对象来说,主服务器对象定时判断主工作信道状态是否正常12,如果主工作信道状态是正常的,其不启动切换13,如果主工作信道状态不正常,其判断备用服务器对象的运行状态是否正常14,如果备用服务器对象运行状态不正常或者备用服务器对象判断与主服务器对象之间的通信不正常,则都判断为备用服务器对象不正常,这时,也不启动切换13;如果备用服务器对象是正常的,则主服务器对象主动向备用服务器对象发送切换命令15,启动切换16,如图2所示。 The main server objects, the master object is a timing is determined whether master channel status is normal 12, if the master channel state is normal, it does not start switch 13, if the master channel state is not normal, it is judged running standby server object 14 status is normal, the communication between the server object if the standby operating state or the standby server object is not correctly determined the primary server object is not normal, it is determined that the standby server objects are not normal, this time, start switch 13 is not; If the standby server object is normal, the master server object sends a handover command to the backup server object 15, start switch 16, as shown in FIG. 对于备用服务器来说,首先判断主服务器对象的运行状态是否正常ll,如果判断出主服务器对象的运行状态正常,则不进行主从切换B,如果判断出主服务器对象的运行状态不正常,或者备用服务器对象判断与主服务器对象之间的通信不正常,则备用服务器对象启动备用工作信道对主工作信道进行监听17,通过判断主工作信道的运行状态12,当主工作信道的运行状态也正常,则不进行主从切换13;如主工作信道的运行状态出现故障、备用服务器对象正常,则立即启动切换16,如图3所示。 For the backup server, the first server determines whether the operating state of the master object normal ll, if it is determined that primary server object is operating normally, the master is switched from B, if it is determined that the operating state is not the primary server object is not performed normally, or standby server object communication between the determination and the main server object is not normal, the standby server object start-up working channel of the master channel monitor 17, by determining whether the main working channel running state 12, when the main working channel operating state is normal, the operating state of the main working channel fails, the backup server object is normal, the switch 16 immediately starts, as shown in FIG. 3; the main switch 13 is not performed. 如图4,上述判断主服务器对象的自身运行状态ll始于启动一个固定时间间隔的定时器lll,判断定时器是否超时112,如定时器超时,返回到lll,如定时器没有超时, 判断主主服务器对象与之连接的外部设备是否脱机113,如主服务器对象与之连接的外部设备脱机,则给出主服务器对象故障信号114;如主服务器对象与之连接的外部设备脱机没有脱机,继续判断主服务器对象与客户对象之间是否有通信量115,如通信量为零,则给出主服务器对象故障信号114,如通信量不为零,则给出主服务器对象工作正常信号116。 4, the above-described self-running state determination ll master server object starts a timer lll starts a fixed time interval, determining whether the timer expires 112, as the timer times out, returns to lll, such as timer does not expire, determining the main an external apparatus main server object connected thereto whether offline 113, an external device such as the main server offline objects connected thereto, the fault signal is given master server object 114; off external apparatus such as the main server object is not connected thereto off, continue to determine whether the amount of communication between the master server 115 and the client object objects, such as traffic volume is zero, the primary failure signal is given server object 114, such as traffic volume is not zero, it is given master server object work signal 116. 本发明为每个客户对象及服务器对象设置四个参数:帧差错率,定义为接收到的无效字节数占接收到的总字节数的百分比;通信差错极值,定义为帧差错率的最大极 Each client object and the server object to the present invention provided four parameters: the frame error rate, defined as the number of valid bytes received as a percentage of total number of bytes received; communication error extreme value, is defined as a frame error rate maximum pole
限值;数据流率,定义为每秒接收的字节数乘8的数目;通信统计时间间隔,定义为一固定时间间隔的定时器。 Value; data flow rate, defined as the number of bytes received per second multiplied by the number of 8; communication statistics interval is defined as a fixed time interval of the timer. 上述判断主工作信道的运行状态12同样始于启动一个通信统计时间间隔的定时器121,判断定时器是否超时122,如定时器超时,返回到121,如定时器没有超时,判断数据流率是否为零123,如数据流率为零,则给出工作信道状态出现故障信号124,如数据流率不为零,继续判断帧差错率是否小于通信差错极值125,如果帧差错率大于通信差错极值,则给出工作信道状态出现故障信号124,如果帧差错率小于通信差错极值,则给出工作信道状态正常信号126,详见图5。 Analyzing operating state of the master channel 12 likewise starts the timer 121 starts a communication of statistical time interval, determines whether the timer expires 122, as the timer times out, returns to 121, such as the timer does not expire, determining whether the data flow rate 123 is zero, as a data flow rate is zero, the given state of the failed working channel signal 124, as a data flow rate is not zero, continues to determine whether the frame error rate is less than 125 extremum communication error, the communication error is greater than if the frame error rate extremum, is given faulty working channel state signal 124, if the frame error rate is smaller than the extremum communication error, is given the normal working channel state signal 126, see Figure 5. 为了保证冗余机制的完善,本发明所述的主服务器对象至少具有二个工作信道端口,当主服务器对象与客户对象间的主工作信道出现故障,主服务器对象将所有外接设备的主工作信道端口切换到另一工作信道端口,主服务器对象的其他备用工作信道端口接收轮流测试。 In order to ensure complete redundancy, the master server object of the present invention have at least two working channel port, when the main working channel between the primary server object and the client object failure, the master server object to master all external devices Channel port switch to another port of the working channel, the working channels other backup master port receives rotation test subject. 同样,所述的备用服务器对象也具有至少二个工作信道端口,当备用服务器对象与客户对象间的备用工作信道出现故障,备用服务器对象将所有外接设备的备用工作信道端口切换到另一工作信道端口,备用服务器对象的备用工作信道端口接收轮流测试。 Also, the backup server object also has at least two working channel port, when the secondary working channel between a standby server object and the client object fails, the secondary server object appears to alternate working channels of all external devices ports into the other working channel port, alternate working channel port receives standby server object turns test. 当然,客户对象也可以具有多个工作信道端口,当客户对象与主服务器对象间的主工作信道出现故障,客户对象将主工作信道端口切换到备用工作信道端口。 Of course, the client object may have a plurality of ports operating channels, when the main working channel between the client object and server object master failure, the master-client object is switched to the standby channel port working channel port. 在本实施例中,主服务器对象具有四个工作信道端口,备用服务器对象也具有四个工作信道端口,客户对象具有两个工作信道端口。 In the present embodiment, the master server object has four working channel port, standby server objects also have four working channel port, the client object has two working channel port. 如图6,为了保证主备工作信道的安全畅通,本发明为每个工作信道设有一个安全访问定时器;信道端口切换方法同样始于启动一个安全访问定时器131,判断定时器是否超时132,如已超时,延迟10毫秒133,然后后返回到131,如没有超时,计算工作信道状态134;判断当前工作信道状态是否出现故障135,如没有出现故障,给出当前工作信道状态正常信号136;如出现故障,判断下一个工作信道端口上次是否正常关闭137,如上次非正常关闭,判断是否还存在下一个工作信道端口138,如有,则延迟IO 毫秒133,然后后返回到131;如上次正常关闭,则激活下一个工作信道端口139,并给出当前工作信道状态正常信号136,如所有工作信道端口均非正常关闭,则给出当前工作信道状态故障信号140。 6, in order to ensure safe and smooth working channel of the standby, the present invention is provided for each working channel security access a timer; port channel switching method also begins with starting a secure access to the timer 131, it is determined whether the timer times out 132 , such as timed delay 10 milliseconds 133, then after returning to 131, such as not timed out, calculations channel state 134; Analyzing working channel status is faulty 135, if there is no failure, given the current working channel is normal signal 136 ; such failure, it is determined that a working channel port of the last is closed normal 137, such as the last non-normally closed, it is determined whether or not there is a next working channel port 138, and if so, the delay IO ms 133, and after returning to 131; as previously shut down properly, then activates the next working channel port 139, and gives the normal working channel state signal 136, such as working channels for all ports are closed abnormally, is given fault current working channel state signal 140.