Summary of the invention
For solving the problems of the technologies described above, the invention provides a kind of ethernet redundancy switch that can carry out redundant data transmissions, and be used for the redundant network system that comprises this ethernet redundancy switch of industrial process control and realize the redundant method of switching.
The invention provides a kind of ethernet redundancy switch, comprise being used to realize the network data processing microprocessor operating, also comprise first port and second port that are connected and carry out mutual data communication respectively with redundant mutually Ethernet with it; Be connected with the network operation station and carry out mutual data communication with it, be provided with the 3rd port of physical address and IP address; The first Ethernet interface unit, the second Ethernet interface unit that are connected respectively with described first port, second port; The three-ethernet interface unit that is connected with microprocessor with described the 3rd port, and, the Logic Interface Unit that connects described first port, second port and described microprocessor, be used under microprocessor control, realize the Ethernet data exchange between described the 3rd port and described first port or second port.
Described ethernet redundancy switch also comprises failure diagnosis and alarm unit, is used to finish self diagnosis, supervision and the warning of fault.
Described Ethernet interface unit comprises: network transformer is used for the isolation network signal of telecommunication; The ethernet physical layer interface chip is used to finish signal of communication modulation, demodulation operation; MAC layer MAC chip is used for the processing to the MAC layer agreement; And, as the random access memory ram of MAC layer MAC chip data memory.
The redundant network system of described ethernet redundancy switch, comprise active station, control station and redundant each other first network and second network, described control station is connected described first network and second network by first port with identical ip addresses and physical address with second port, also comprise: be connected the ethernet redundancy switch between described active station and described first network and second network; The 3rd port of described ethernet redundancy switch connects described active station, realizes the data communication between described ethernet redundancy switch and the described active station; First port of described ethernet redundancy switch is connected described first network and second network respectively with second port, by described first network, second network, and the data communication between realization and the described control station.
The redundancy switch-over control method of described redundant network system, comprise that the ethernet redundancy switch receives the packet that active station sends by the 3rd port of self, judge whether described packet is the packet of in-local, if, then carrying out this machine handles, otherwise, described packet is sent to described first network and second network respectively by self first port and second port; Described control station receives same packet from described first network and second network respectively by self first port and second port, differentiate and whether received this packet, if do not receive, then processing said data bag, and the response data after will handling goes back by described first network, second network-feedback; Otherwise, abandon described packet; The ethernet redundancy switch receives the packet that described control station sends by self first port and second port, judges whether described packet once received, if do not receive, then sends described packet to described active station; Otherwise, abandon described packet; Described active station carries out destination address identification to described packet, handles the packet at its this machine, abandons non-machine data bag.
16 bit-identifies of the IP head of described packet are defined as identifier, in order to packet is identified and judge.
The historical record of the paid-in described package identification symbol of storage in the described control station, described historical record adopts the cycle index form.
The historical record of the paid-in described package identification symbol of storage in the described ethernet redundancy switch, described historical record adopts the cycle index form.
Ethernet redundancy switch provided by the invention, comprise microprocessor, Logic Interface Unit, connection Ethernet and first port that communicates with and second port, attended operation station and the 3rd port that communicates with, and three Ethernet interface unit that connect above-mentioned port respectively.Owing to adopted said structure, the ethernet redundancy switch has stronger realization interrupt function, redundancy control capability, fault self-diagnosis and warning function, and, the redundant network system that adopts above-mentioned redundant switch to constitute need not to adopt two network interface cards, this just makes redundancy switching method simplify more, this redundant network system can realize in real time simultaneously, redundant efficiently the switching, therefore, the industrial process control system of using this redundant network system has higher reliability and stronger fault-tolerant ability and real-time responding ability fast, thereby has guaranteed that The whole control system more reliablely and stablely moves.
Embodiment
Describe the present invention in detail below in conjunction with accompanying drawing.
Fig. 1 is the embodiment circuit block diagram of ethernet redundancy switch of the present invention.The ethernet redundancy switch that provides embodiment illustrated in fig. 1, comprise other peripheral secondary logical unit (SLU)s such as microprocessor 7, Logic Interface Unit 8, failure diagnosis and alarm unit 9, also comprise first port 2, second port 3, the 3rd port one, and the first Ethernet interface unit 5, second Ethernet interface unit 6 and the three-ethernet interface unit 4 that are connected with above-mentioned three ports respectively.The first Ethernet interface unit 5, the second Ethernet interface unit 6 that first port 2 of ethernet redundancy switch, second port 3 connect respectively are connected respectively with two redundant each other Ethernets (just first network and second network) and carry out mutual data communication with it by above-mentioned two Ethernet interface unit.The 3rd port one is provided with physical address and IP address, is connected with the network operation station and carries out mutual data communication with it; The 3rd port one also connects three-ethernet interface unit 4, is connected with microprocessor 7 by it.The Logic Interface Unit 9 that connects first port 5, second port 6 and the microprocessor 7 of ethernet redundancy switch is used for realizing the Ethernet data exchange between the 3rd port one and first port 2 or second port 3 under microprocessor 7 controls.Microprocessor 7 by data wire respectively with the Ethernet interface unit 1 of attended operation station network and Logic Interface Unit 8, failure diagnosis and 9 two-way connections of alarm module, microprocessor 7 is used to realize the network data processing operation, just, the processing that realizes data with communicate by letter, the execution of application program, the management of flow process, and the relaying of ethernet redundancy switch and Redundant Control.Failure diagnosis and alarm module 9 realize that the self diagnosis of fault, house dog WDT monitor and warning function.
As shown in Figure 1, in specific embodiments of the invention, the 3rd port one of ethernet redundancy switch, first port 2 and second port 3 all can adopt the RJ45 interface.Ethernet interface unit 4-6 is by network transformer, ethernet physical layer interface chip and MAC layer MAC chip, and random access memory ram is formed.Wherein, network transformer can adopt CLA-01AF type transformer to realize the isolation of the network signal of telecommunication, promptly realizes the isolation of power electricity, avoids interference; The ethernet physical layer interface chip is used to finish signal of communication modulation, demodulation operation, realizes that the chip of this function is a lot, can adopt chip DP83843 in the present embodiment; MAC layer MAC can select for use chip LAN91C110 to realize the processing of MAC layer agreement CSMA/CD; Random access memory ram is the data storage of MAC chip, can select HM6216255 for use at this.Logic Interface Unit adopts CPLD chip QL4090, is used for being responsible for first port of ethernet redundancy switch and the ethernet communication of second port; Microprocessor comprises microprocessor and corresponding decoding circuit, FLASH and RAM, microprocessor is selected HD6417615 for use in the present embodiment, decoding circuit adopts QL3012, FLASH to select for use 29LV800, RAM to select HM6216255 for use, the processing that microprocessor is used to realize data with communicate by letter, the execution of application program, the management of flow process, and the relaying of switch and Redundant Control.In the present embodiment, failure diagnosis and alarm unit can adopt diagnosis and the warning of form of software realization to network failure, and for example, the software that can pass through to be write in microprocessor is realized this function.It is to be noted, circuit theory diagrams shown in the present embodiment only are a kind of ways of realization of the present invention, in the practical application, can be not limited to execution mode shown in Figure 1 according to principle of the present invention, for example, Ethernet interface unit shown in Fig. 1 also can adopt the integrated chip of integrated physical layer interface chip, MAC layer process chip and data buffer zone RAM, and same, microprocessor and Logic Interface Unit also can have other ways of realization.
Fig. 2 is a redundant network system diagram of using ethernet redundancy switch shown in Figure 1.Redundant network system shown in Fig. 2 is a specific embodiment of the present invention.This redundant network system comprises active station, ethernet redundancy switch, control station and redundant each other first network and second network.Control station has two ports, i.e. first port and second port, and these two ports have identical ip addresses and physical address, and control station is connected first network and second network by first port with second port.The ethernet redundancy switch is connected between active station and first network and second network; The data communication between ethernet redundancy switch and the described active station is realized at the 3rd port attended operation station of ethernet redundancy switch; First port of ethernet redundancy switch is connected first network and second network with second port, by described first network, second network, and the data communication between realization and the described control station.
It realizes that the redundant procedure of switching is the above-mentioned redundant network system that is formed by connecting: carry out after the initial configuration, the ethernet redundancy switch receives the packet that active station sends by the 3rd port of self, judge whether described packet is the packet of in-local, if, then carrying out this machine handles, otherwise, described packet is sent to described first network and second network respectively by self first port and second port.
Described control station receives same packet from described first network and second network respectively by self first port and second port, differentiate and whether received this packet, if do not receive, then processing said data bag, and the response data after will handling goes back by described first network, second network-feedback; Otherwise, abandon described packet.
The ethernet redundancy switch receives the packet that described control station sends by self first port and second port, judges whether described packet once received, if do not receive, then sends described packet to described active station; Otherwise, abandon described packet; Described active station carries out destination address identification to described packet, handles the packet at its this machine, abandons non-machine data bag.
Ethernet redundancy switch provided by the invention has realized also that fault detects, warning, self diagnosis and tcp/ip communication function when realizing relay function (promptly the Frame that receives from active station transmits and transmits to active station from the frame that the network of redundancy receives to redundant network), first network and second network are carried out redundancy control capability.
Fig. 3 is the flow chart that ethernet redundancy switch of the present invention is realized redundant switching controls.Active station, ethernet redundancy switch, redundant first network and the data communication between second network and the control station have each other been realized by each step shown in the figure (step 31--step 47).
Step 31 is at first carried out initial configuration.This step is pointed out, after the ethernet redundancy switch powers on, at first needs to carry out the initial configuration of relevant parameter, just needs each parts of ethernet redundancy switch are carried out the initialization setting.Concrete parameter is provided with as follows: for the 3rd port of ethernet redundancy switch, need to specify its IP address and physical address, so that the TCP/IP communication is carried out at the biconditional operation station, for example receive configuration file and upload concrete communication such as warning message; For ethernet redundancy switch first port and second port, then do not establish any IP address and physical address; For each the Ethernet interface unit (the first Ethernet interface unit 5, the second Ethernet interface unit 6 and the first Ethernet interface unit 4) that connects ethernet redundancy switch first port, second port and the 3rd port, its receiving mode all is set to allow to receive the pattern of all data; And for first port and second port of redundant each other first network, control station that second network links to each other, be set to have identical IP address and physical address.
Just entered step 32 after the initial configuration.Step 32 shown in the figure is a determining step, is used for judging that the data that the ethernet redundancy switch receives are from active station or from control station.As everyone knows, the 3rd port attended operation station of ethernet redundancy switch, first port of ethernet redundancy switch, second port connect redundant each other first network and second network, and first port of control station is connected the first above-mentioned network and second network respectively with second port.Connect by above-mentioned hardware, set up between active station and the control station and write to each other, the relaying of ethernet redundancy switch, redundancy control capability can be realized the Redundant Control of communication network.Active station is divided into transmission and receives two kinds of situations with communicating by letter of control station, and just active station sends the data both of these case of data and the transmission of active station reception control station to control station.If in this step, the data that the ethernet redundancy switch is judged its reception are that active station is sent to control station, and just the data from active station received by himself the 3rd port of ethernet redundancy switch then turn to step 33; If the data that the ethernet redundancy switch receives are that control station is sent to active station, just the data of being received by first port and second port of ethernet redundancy switch from control station then turn to step 41.
In step 33, the ethernet redundancy switch judges further whether its data of receiving are the data that this machine is operated.When active station when control station sends data, active station sends data to the 3rd port of ethernet redundancy switch earlier, after the ethernet redundancy switch is received data, needs judge whether these data are the data that this machine is operated.If, then forward step 39 to, carry out this machine by the ethernet redundancy switch and handle, just enter step 40, end operation afterwards; Otherwise execution in step 34, the ethernet redundancy switch directly sends the data of receiving from switch first port and second port, and enters step 35.
Step 35 indication shown in Fig. 3, first port of control station and second port receive the same packet from first network and second network respectively simultaneously, and pass through 16 bit-identifies of the IP head of packet, compare with the packet that has received.In the reality, the packet that receives from active station by the 3rd port, 16 bit-identifies of its IP head identify each packet, packet sends in redundant each other first network and second network by first port and second port of ethernet redundancy switch, and transmission therein, first port of control station has identical IP address and physical address with second port, receives the same packet from first network and second network respectively.
Whether the step 36 shown in the figure is used for the judgment data bag and received.Although first port of ethernet redundancy switch and second port send packet mentioned above simultaneously, but because the influence of Network Transfer Media and environment, difference when first port of control station and second port receive packet on the life period, that is to say, control station newly receives packet and may be sent and be received by another port, for guaranteeing the validity of packet, just need to judge whether this packet once received earlier.In the present embodiment, 16 bit-identifies of the IP head that control station can be by the comparing data bag differentiate whether received this packet.The specific implementation method is, in control station, open up a block space, be used to store the historical record of 16 bit-identifies of the IP head of the packet of receiving each IP address, this historical record can be defined as the form of cycle index, like this, the space just can be recycled so that come storing history with the space, thereby improves the utilization ratio in space.Judge through this step,, then forward step 38 to, abandon this packet if this packet receives; Otherwise execution in step 37 receives this packet, and carries out respective handling; Write down and preserve 16 bit-identifies of the IP head of this packet simultaneously, and the response data after will handling is gone back by first port and the transmission of second port simultaneously.
If judge data that the ethernet redundancy switch received from control station through step 32, promptly send to active station by the control station data, then turn to step 41.When the data after control station will be handled send to active station, earlier send to first network, second network simultaneously by controller first port and second port, first port of ethernet redundancy switch and second port receive this packet from first network, second network respectively.In this step, the ethernet redundancy switch receives all data from first network and second network simultaneously, simultaneously, 16 bit-identifies to the IP head of the packet received compare differentiation, this method of discrimination is the same with what put down in writing in the step 36, also be in the ethernet redundancy switch, to open up a block space, be used to store the historical record of 16 bit-identifies of the IP head of the packet of receiving each IP address, this historical record can be defined as the form of cycle index, like this, the space can be recycled and takies limited space.
Enter step 42 and judge whether once to receive this packet.This judges it also is that 16 bit-identify fields by to the IP head of packet are carried out, if judge and once received this packet, changes step 46 over to, with this data packet discarding; Otherwise execution in step 43 is given active station with the data of receiving by the 3rd port of ethernet redundancy, enters step 44 then.
Step 44 shown in Figure 3 also is a determining step, the destination address of being judged this packet by active station is not this machine, just active station carries out destination address identification to the packet of being received that has the forwarding of ethernet redundancy switch, if the destination address indication is this machine of active station really, then execution in step 45, and promptly active station receives this packet and handles accordingly; Otherwise turn to step 47, abandoning this is not the packet that sends to this machine.
Fig. 4 is the fault information data form that the embodiment of the invention adopts.A kind of concrete definition form of the data format of the fault message that the redundant network of the present invention system that is the data format shown in Fig. 4 is adopted.
In the redundant network system running of reality, the connection status and the signal accepting state of first port of the microprocessor monitors ethernet redundancy switch of ethernet redundancy switch and second port and first network and second network, and read above-mentioned connection status and from the operating state of each node received signal of network (this state reflects that first port of ethernet redundancy switch and second port are whether in received signal on first network and second network constantly), and the state information that is read is kept in the interior data storehouse by each Ethernet port.Take place if any fault, the ethernet redundancy switch will regularly send warning to active station, and active station is resolved the fault that takes place in ethernet redundancy switch or the network according to the fault message that obtains from the ethernet redundancy switch.The form of this fault message just as shown in Figure 4.This fault message can comprise the information contents such as state information, node status information and data mode.In the present embodiment, fault message is defined as and comprises following message: data length, state length, state information, node state length, node status information.Wherein, data length is the length of removing the remaining data of data length self byte; Because the system scale difference is (as the interstitial content difference that connects, etc. situation), the byte number of node status information is transformable, so node state length is exactly a unfixed numerical value, therefore active station need be judged effective length according to this length, further judges the data length of whole fault message; State information is meant this ethernet redundancy switch state information, specifically be defined as in the present embodiment by summary status, fault message, line status, transmission malfunction and operational factor etc. and form, active station just can be known the connection status of first port and second port by the line state information byte in this state information; Node status information is meant the state information of receiving information of each MAC Address, and this node status information comprises following field in the present embodiment: the state that MAC Address, first network and second network are received information, IP address.
The transmission of fault message sends by the information among the UDP/IP, and the regular transmission of fault message is just carried out in ethernet redundancy switch Ethernet communication Once you begin back by the cycle of operating parameter setting, and does not wait for the preparation of active station one side.If set the IP address that sends object in the fault message, then used setting content to be sent to corresponding IP address device; If do not set, therefore the IP address at the automatic identifying operation of the frame station of accepting by the 3rd port and use it then, in this case, if do not receive certain IP frame or ARP frame from active station, just can not begin the transmission of fault message; In addition,, then discern the IP address of first frame that receives automatically, and use it as the IP address that sends object if the 3rd port of ethernet redundancy switch links to each other with a plurality of active stations.
The ethernet redundancy switch can be installed tcpip stack, FTP Server.Can carry out IP with the ethernet redundancy switch by active station one side Ethernet port (the 3rd port) like this communicates by letter; The collection of the setting of various information, initial configuration file and self-diagnosis information can be undertaken by FTP Server.
Certainly, the form of the fault message shown in Fig. 4 only is a kind of concrete form of fault message of the present invention, and in the case of without departing from the principles of the present invention, the form that can also define other is finished this function.Equally, in specific embodiments of the invention, fault detects, warning, self diagnosis and tcp/ip communication function also not only are confined to the setting adopted in the present embodiment, can be provided with corresponding effective value according to actual conditions, be made as when effective as the fault warning function, then start this function, as be made as invalid, the operational failure function of reporting to the police not then.
Ethernet redundancy switch provided by the invention, comprise microprocessor, Logic Interface Unit, connection Ethernet and first port that communicates with and second port, attended operation station and the 3rd port that communicates with, and three Ethernet interface unit that connect above-mentioned port respectively.Owing to adopted said structure, the ethernet redundancy switch has stronger realization interrupt function, redundancy control capability, fault self-diagnosis and warning function, and, the redundant network system that adopts above-mentioned redundant switch to constitute need not to adopt two network interface cards, this just makes redundancy switching method simplify more, this redundant network system can realize in real time simultaneously, redundant efficiently the switching, therefore, the industrial process control system of using this redundant network system has higher reliability and stronger fault-tolerant ability and real-time responding ability fast, thereby has guaranteed that The whole control system more reliablely and stablely moves.
It is pointed out that the present invention not only is confined to the embodiment shown in the above-mentioned described embodiment.For those skilled in the art, under the prerequisite that does not break away from the principle of the invention, can also make some improvements and modifications, these improvements and modifications also should be considered as protection scope of the present invention.