Embodiment
For the purpose, technical scheme and the advantage that make the embodiment of the invention clearer, below in conjunction with the accompanying drawing in the embodiment of the invention, technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that is obtained under the creative work prerequisite.
The structural representation of the communication interface that Fig. 1 provides for the embodiment of the invention one.As shown in Figure 1, the communication interface of present embodiment can comprise port one 0, commutation circuit 11 and at least two interface circuits 12.Commutation circuit 11 is coupled to each interface circuit 12 in port one 0 and at least two interface circuits 12.
Commutation circuit 11 is used for an interface circuit 12 of at least two interface circuits 12 is connected to port one 0 in the present embodiment.Commutation circuit 11 and further also being used to detects whether successfully communicating by letter between a described interface circuit 12 and the port one 0, when detecting communicating by letter when unsuccessful between a described interface circuit 12 and the port one 0, initiate to switch will at least two another interface circuit 12 in the interface circuits 12 be connected on the port one 0.
When the communication interface of present embodiment uses, be connected with upper layer network equipment by port one 0, and can automatically switch according to commutation circuit 11 and to be connected between at least two interface circuits 12 and the port one 0, and can switch to and the corresponding interface circuit 12 of upper layer network interface that equipment adopts.
The communication interface of present embodiment, by adopting commutation circuit that an interface circuit at least two interface circuits is connected on the port, commutation circuit and being further used for detects the whether success of communicating by letter between an interface circuit and the port, when detecting communicating by letter when unsuccessful between an interface circuit and the port, initiate to switch will at least two another interface circuit in the interface circuits be connected on the described port.Adopt the technical scheme of present embodiment, can realize the automatic switchover that is connected between two interface circuits and the port by adopting commutation circuit; Be convenient to the maintenance and management of communication interface.
The structural representation of the communication interface that Fig. 2 provides for the embodiment of the invention two.As shown in Figure 2, the interface circuit of present embodiment is on above-mentioned basis embodiment illustrated in fig. 1, and wherein commutation circuit 11 specifically can comprise switch unit 111 and control unit 112.
Wherein control unit 112 is connected with at least two interface circuits 12 respectively, and this control unit 112 is used for the state according at least two interface circuits 12 1 interface circuits 12, judges whether successfully communicating by letter between an interface circuit 12 and the port one 0.That is to say, when between this interface circuit 12 and the port one 0 communicate by letter successfully the time, this interface circuit 12 just is in normal communications status.Otherwise be in its unaccessed state.Therefore, just can be according to the state of this interface circuit 12, judge the whether success of communicating by letter between this interface circuit 12 and the port one 0.Control unit 112 is further used for controlling switch unit 111 and switching when detecting communicating by letter unsuccessful time the between this interface circuit 12 and the port one 0.
Switch unit 111 is connected with control unit 112, switch unit 111 is used to accept the control of control unit 112, with being connected between another interface circuit 12 of switching at least two interface circuits 12 being connected between this interface circuit 12 and the port one 0 and the port one 0.
Alternatively, the switch unit in the present embodiment 111 can adopt relay or other electric switching devices.For example this switch unit 111 can comprise the relay of at least one dpdt double-pole double-throw (DPDT).
Alternatively, in the present embodiment, at least two interface circuits 12 are underlay network device and the upper layer network equipment relative interface circuit that intercoms mutually.For example interface circuit 12 can be for the serial interface circuit of serial communication correspondence such as RS232 interface circuit or as the RS485 interface circuit, because RS232 interface circuit and the transmitting terminal of RS485 interface circuit and each pin of receiving terminal can not be re-used, the RS232/485 interface circuit that can also integrate for RS232 interface circuit and RS485 interface circuit; Receiving terminal and the transmitting terminal of four pins as RS485 wherein arranged in the RS232/485 interface circuit, can get receiving terminal, transmitting terminal and the earth terminal of three pins in addition as RS232.Perhaps interface circuit 12 can also be the network interface circuit by the netting twine communication such as FE interface circuit or the like.
Alternatively, in the present embodiment, control unit 112 is specifically as follows the equipment with measuring ability, particularly, can have central processing unit (Central Processing Unit for one; Hereinafter to be referred as CPU) equipment, as computer or the like, can abbreviate CPU equipment as.
Alternatively, the port in the foregoing description can adopt port of the prior art, for example the RJ45 port.
Adopt the technical scheme of present embodiment, can realize the automatic switchover that is connected between two interface circuits and the port by adopting commutation circuit; Be convenient to the maintenance and management of communication interface.
Description below in conjunction with above-mentioned communication interface, introduce the communication interface that is connected between RS232/485 interface circuit that two kinds of can automatically switch RS232 interface circuit and RS485 interface circuits integrate and FE interface circuit and the RJ45 port, this for example only for ease of describing, be not used in qualification the present invention.
The structural representation of RJ45 port as shown in Figure 3, the RJ45 port comprises 8 pins.Serial signal and FE signal that 8 pins of RJ45 port are corresponding respectively in detail can be with reference to following tables 1.
Table 1
The pin sequence number of RJ45 port |
Serial signal |
The FE signal |
1 |
TX+ | T+ | |
2 |
TX- |
T- |
3 |
RXD | R+ | |
4 |
RX+ |
|
5 |
RX- |
|
6 |
GND |
R- |
7 |
TXD |
|
8 |
|
|
TX+ represents the signal of RS485 interface circuit transmitting terminal positive pole in the above-mentioned table 1; TX-represents the signal of RS485 interface circuit transmitting terminal negative pole.RX+ represents the signal of RS485 interface circuit receiving terminal positive pole; RX-represents the signal of RS485 interface circuit receiving terminal negative pole.RXD represents the signal of RS232 interface circuit receiving terminal; TXD represents the signal of RS232 interface circuit transmitting terminal.GND represents the signal of RS232 interface circuit earth terminal.T+ represents the signal of the transmitting terminal positive pole of FE interface circuit; T-represents the signal of the transmitting terminal negative pole of FE interface circuit.R+ represents the signal of FE interface circuit receiving terminal positive pole; R-represents the signal of FE interface circuit receiving terminal negative pole.
The circuit diagram of the communication interface that Fig. 4 provides for the embodiment of the invention three.As shown in Figure 4, present embodiment is on the basis of the foregoing description two, switch unit comprises the relay K 1 and the K2 of two dpdt double-pole double-throw (DPDT), control unit adopts a CPU equipment to represent, at least two interface circuits of present embodiment comprise RS232/485 interface circuit that a serial interface circuit such as RS232 interface circuit and RS485 interface circuit integrate and network interface circuit such as FE interface circuit.Port in the present embodiment adopts the RJ45 port.
As shown in Figure 4, the pin one of RJ45 port is (as Fig. 4, can abbreviate RJ45-1 as) and pin two (as Fig. 4, can be called for short RJ45-2) each links to each other with an output pin of the relay K 1 of dpdt double-pole double-throw (DPDT), two the corresponding input pins of an output pin that link to each other with the pin one of RJ45 port on the relay K 1 of dpdt double-pole double-throw (DPDT), respectively with the RS232/485 interface circuit in the pin of the anodal TX+ holding wire of transmitting terminal and the pin of the anodal T+ holding wire of the transmitting terminal in the FE interface circuit be electrically connected.Two the corresponding input pins of another output pin that link to each other with the pin two of RJ45 port on the relay K 1 of dpdt double-pole double-throw (DPDT), respectively with the RS485 interface circuit in the pin of the anodal TX-holding wire of transmitting terminal and the pin of the anodal T-holding wire of the transmitting terminal in the FE interface circuit be electrically connected.Thereby realize that the pin one of controlling the RJ45 port by the relay K 1 of dpdt double-pole double-throw (DPDT) is to be connected with the RS232/485 interface circuit with pin two, still be connected with the FE interface circuit.
The pin 3 of RJ45 port is (as Fig. 4, can be called for short RJ45-3) and pin 6 (as Fig. 4, can be called for short RJ45-6) each links to each other with an output pin of the relay K 2 of dpdt double-pole double-throw (DPDT), two the corresponding input pins of an output pin that link to each other with the pin 3 of RJ45 port on the relay K 2 of dpdt double-pole double-throw (DPDT), respectively with the RS232 interface circuit in the pin of receiving terminal RXD holding wire and the pin of the anodal R+ holding wire of the receiving terminal in the FE interface circuit be electrically connected.Two the corresponding input pins of another output pin that link to each other with the pin 6 of RJ45 port on the relay K 2 of dpdt double-pole double-throw (DPDT), respectively with the RS232 interface circuit in the pin of earth terminal GND holding wire and the pin of the receiving terminal negative pole R-holding wire in the FE interface circuit be electrically connected.Thereby realize that the pin 3 of controlling the RJ45 ports by the relay K 2 of dpdt double-pole double-throw (DPDT) is to be connected with the RS232/485 interface circuit with pin 6, still be connected with the FE interface circuit.
Wherein the pin 4 of RJ45 port (as Fig. 4, can be called for short RJ45-4) directly is electrically connected with the pin of receiving terminal positive pole RX+ holding wire in the RS485 interface circuit; The pin 5 of RJ45 port (as Fig. 4, can be called for short RJ45-5) directly is electrically connected with the pin of receiving terminal negative pole RX-holding wire in the RS485 interface circuit.The pin 7 of RJ45 port (as Fig. 4, can be called for short RJ45-7) directly is electrically connected with the pin of transmitting terminal TXD holding wire in the RS232 interface circuit; Wherein the pin 8 of RJ45 port (as Fig. 4, can be called for short RJ45-8) is unsettled need not.
The concrete use of the communication interface of present embodiment is as follows: the relay K 1 of two dpdt double-pole double-throw (DPDT) and a kind of default connected mode of K2 at first can be set, the CPU equipment that serves as control unit is connected with the FE interface circuit with the RS232/485 interface circuit respectively, the state of CPU Equipment Inspection RS232/485 interface circuit and FE interface circuit, when detecting RS232/485 interface circuit and FE interface circuit one of them and RJ45 port and communicate to connect, CPU equipment is not carried out any operation.When CPU Equipment Inspection any one and RJ45 port in RS232/485 interface circuit and FE interface circuit all do not communicate to connect, CPU equipment is to the relay K 1 of dpdt double-pole double-throw (DPDT) and K2 output switch-over control signal Switch, is connected with different input pin respectively with the relay K 1 of control dpdt double-pole double-throw (DPDT) and K2.In the present embodiment since the RS232/485 interface circuit be that RS232 interface circuit and RS484 interface circuit integrate formation.CPU equipment is equivalent to detect RS232 interface circuit, RS484 interface circuit and the FE interface circuit state of totally three interface circuits.
For example: when two input pins of the relay K 1 of CPU Equipment Control dpdt double-pole double-throw (DPDT) respectively with the RS485 interface circuit in pin and the RS485 interface circuit of the anodal TX+ holding wire of transmitting terminal in the pin of transmitting terminal negative pole TX-holding wire link to each other, two input pins of the relay K 2 of control dpdt double-pole double-throw (DPDT) respectively with the RS232 interface circuit in pin and the RS232 interface circuit of receiving terminal RXD holding wire in the pin of earth terminal GND holding wire when linking to each other, think that the upper layer network equipment that is connected with the RJ45 port by RS232/RS485 interface and this communication interface communication, can also can adopt the RS484 interface by the RS232 interface particularly.It is adaptive to carry out corresponding protocol then on employing software on the CPU equipment, if detect the communication success, then handover success is preserved the relay K 1 and the current output state of K2 of dpdt double-pole double-throw (DPDT).Otherwise proceed to switch.
When two input pins of the relay K 1 of CPU Equipment Control dpdt double-pole double-throw (DPDT) respectively with the FE interface circuit in the pin of the anodal T+ holding wire of transmitting terminal and the pin of the transmitting terminal negative pole T-holding wire in the FE interface circuit be electrically connected, two input pins of the relay K 2 of control dpdt double-pole double-throw (DPDT) respectively with the FE interface circuit in the pin of the anodal R+ holding wire of receiving terminal and the pin of the receiving terminal negative pole R-holding wire in the FE interface circuit when being electrically connected, think that the upper layer network equipment that is connected with the RJ45 port passes through FE interface and this communication interface communication.It is adaptive to carry out corresponding protocol then on employing software on the CPU equipment, if detect the communication success, then handover success is preserved the relay K 1 and the current output state of K2 of dpdt double-pole double-throw (DPDT).Otherwise proceed to switch.
The communication interface of present embodiment can automatically switch in use with the adaptive interface circuit that is connected with the RJ45 port, is convenient to the maintenance and management of communication interface.Can on the panel of reduced size, realize more multi-functional demand, bring convenience for enhancing product performance.
The circuit diagram of the communication interface that Fig. 5 provides for the embodiment of the invention four.As shown in Figure 5, present embodiment is on the basis of the foregoing description two, switch unit comprises the relay K 1 of a dpdt double-pole double-throw (DPDT), control unit adopts a CPU equipment to represent, at least two interface circuits of present embodiment comprise RS232/485 interface circuit that a serial interface circuit such as RS232 interface circuit and RS485 interface circuit integrate and network interface circuit such as FE interface circuit.Port in the present embodiment adopts the RJ45 port.The abbreviation of each pin of RJ45 can be with reference to the foregoing description three in the present embodiment.
As shown in Figure 5, in the present embodiment pin two of RJ45 port respectively with the RS485 interface circuit in the pin of transmitting terminal negative pole TX-holding wire and the pin of the transmitting terminal negative pole T-holding wire in the FE interface circuit be electrically connected; The pin 3 of RJ45 port respectively with the RS232 interface circuit in the pin of receiving terminal RXD holding wire and the pin of the anodal R+ holding wire of the receiving terminal in the FE interface circuit be electrically connected; The pin of the anodal RX+ holding wire of the receiving terminal in the pin 4 of RJ45 port and the RS485 interface circuit is electrically connected; The pin of the receiving terminal negative pole RX-holding wire in the pin 5 of RJ45 port and the RS485 interface circuit is electrically connected; The pin of the transmitting terminal TXD holding wire in the pin 7 of RJ45 port and the RS232 interface circuit is electrically connected; The pin 8 of RJ45 port is unsettled, temporarily need not.
As shown in Figure 5, the pin one of RJ45 port links to each other with an output pin of the relay K of dpdt double-pole double-throw (DPDT) 1, two the corresponding input pins of output pin that link to each other with the pin one of RJ45 port on the relay K 1 of dpdt double-pole double-throw (DPDT), respectively with the RS485 interface circuit in the pin of the anodal TX+ holding wire of transmitting terminal and the pin of the anodal T+ holding wire of the transmitting terminal in the FE interface circuit be electrically connected.The pin 6 of RJ45 port links to each other with another output pin of the relay K 1 of dpdt double-pole double-throw (DPDT), two the corresponding input pins of output pin that link to each other with the pin 6 of RJ45 port on the relay K 1 of dpdt double-pole double-throw (DPDT), respectively with the RS232 interface circuit in the pin of earth terminal GND holding wire and the pin of the receiving terminal negative pole R-holding wire in the FE interface circuit be electrically connected.Thereby realize that the pin one of controlling the RJ45 port by the relay K 1 of dpdt double-pole double-throw (DPDT) is to be connected with the RS232/485 interface circuit with pin 6, still be connected with the FE interface circuit.
The concrete use of the communication interface of present embodiment is as follows: a kind of default connected mode that the relay K 1 of dpdt double-pole double-throw (DPDT) at first can be set, the CPU equipment that serves as control unit is connected with the FE interface circuit with the RS232/485 interface circuit respectively, the state of CPU Equipment Inspection RS232/485 interface circuit and FE interface circuit, when detecting RS232/485 interface circuit and FE interface circuit one of them and RJ45 port and communicate to connect, CPU equipment is not carried out any operation.When CPU Equipment Inspection any one and RJ45 port in RS232/485 interface circuit and FE interface circuit all do not communicate to connect, CPU equipment is to the relay K 1 output switch-over control signal Switch of dpdt double-pole double-throw (DPDT), with the relay K 1 of control dpdt double-pole double-throw (DPDT) and different input pin connections.In the present embodiment since the RS232/485 interface circuit be that RS232 interface circuit and RS484 interface circuit integrate formation.CPU equipment is equivalent to detect RS232 interface circuit, RS484 interface circuit and the FE interface circuit state of totally three interface circuits.
For example: when two input pins of the relay K 1 of CPU Equipment Control dpdt double-pole double-throw (DPDT) respectively with the RS485 interface circuit in pin and the RS232/485 interface circuit of the anodal TX+ holding wire of transmitting terminal in the pin of GND holding wire when linking to each other, the pin one of promptly having realized the RJ45 port links to each other with the anodal TX+ holding wire of the transmitting terminal in the RS485 interface circuit, and the pin 6 of RJ45 port links to each other with earth terminal GND holding wire in the RS232/485 interface circuit.Think that the upper layer network equipment that is connected with the RJ45 port is by RS232/RS485 interface and this communication interface communication this moment.It is adaptive to carry out corresponding protocol then on employing software on the CPU equipment, if detect the communication success, then handover success is preserved the relay K 1 current output state of dpdt double-pole double-throw (DPDT).Otherwise proceed to switch.
When two input pins of the relay K 1 of CPU Equipment Control dpdt double-pole double-throw (DPDT) respectively with the FE interface circuit in the pin of the anodal T+ holding wire of transmitting terminal and the pin of the R-holding wire in the FE interface circuit when being electrically connected, the pin of the anodal T+ holding wire of transmitting terminal in the pin one of promptly having realized the RJ45 port and the FE interface circuit links to each other, and the pin of the receiving terminal negative pole R-holding wire in the pin two of RJ45 port and the FE interface circuit links to each other.At this moment, owing to disconnect the anodal TX+ of the transmitting terminal of RS485 interface circuit, the transmission of RS485 interface circuit forbids that therefore transmission is in high-impedance state.The RJ45 port serves as the FE communication interface and sends the influence that differential signal just is not subjected to the differential signal of RS485 interface circuit; Owing to disconnect the earth terminal GND of RS232 interface circuit, the RJ45 port serves as the FE communication interface and receives the restriction that differential signal also can not be subjected to the serial ports incoming level.Therefore the transmitting-receiving of network interface also can normally move.Can think that the upper layer network equipment that is connected with the RJ45 port is by FE interface and this communication interface communication this moment.It is adaptive to carry out corresponding protocol then on employing software on the CPU equipment, if detect the communication success, then handover success is preserved the relay K 1 current output state of dpdt double-pole double-throw (DPDT).Otherwise proceed to switch.
The communication interface of present embodiment can automatically switch in use with the adaptive interface circuit that is connected with the RJ45 port, is convenient to the maintenance and management of communication interface.Can on the panel of reduced size, realize more multi-functional demand, bring convenience for enhancing product performance.Can there be how different implementations in the connection of port, and those skilled in the art can carry out accommodation to annexation according to the port type and the circuit types of reality, and do not break away from essence of the present invention.
Need to prove that the relay of the dpdt double-pole double-throw (DPDT) in the foregoing description can adopt other electric switching devices to replace.
The structural representation of in communication interface, realizing connecting the commutation circuit of switching that Fig. 6 provides for the embodiment of the invention six.As shown in Figure 6, the commutation circuit that realizes connecting switching in communication interface of present embodiment comprises switch unit 20 and control unit 21.
Wherein control unit 21 is connected with at least two interface circuits respectively, be used for state according to an interface circuit of at least two interface circuits, judge the whether success of communicating by letter between this interface circuit and the port, when detecting communicating by letter unsuccessful time the between this interface circuit and the port, control switch unit 20 switches.Switch unit 20 is used for this interface circuit is connected to port, when accepting the control of control unit 21, with being connected between another interface circuit of switching at least two interface circuits being connected between this interface circuit and the port and the port.
Switch unit 20 in the commutation circuit that realizes the connection switching in communication interface of present embodiment can comprise the relay of at least one dpdt double-pole double-throw (DPDT), perhaps also can adopt other electric switching devices to replace the relay of dpdt double-pole double-throw (DPDT).
Commutation circuit 11 in the communication interface in the commutation circuit of realize to connect switching in communication interface of present embodiment and the foregoing description two is identical, can not repeat them here with reference to the relevant record of the foregoing description two in detail.
The commutation circuit that in communication interface, realizes connecting switching of present embodiment, control unit is used for the state according to an interface circuit of at least two interface circuits, judge the whether success of communicating by letter between an interface circuit and the port, when detecting communicating by letter unsuccessful time the between an interface circuit and the port, the control switch unit switches.Switch unit is used for an interface circuit is connected to port, when accepting the control of control unit, with being connected between another interface circuit of switching at least two interface circuits being connected between an interface circuit and the port and the port.Adopt the technical scheme of present embodiment, can realize the automatic switchover that is connected between two interface circuits and the port by adopting commutation circuit; Be convenient to the maintenance and management of communication interface.
The flow chart of the changing method of the communication interface that Fig. 7 provides for the embodiment of the invention seven.As shown in Figure 7, the changing method of the communication interface of present embodiment comprises:
Step 100, commutation circuit detect the whether success of communicating by letter between current interface circuit and the port at least two interface circuits;
Step 101, when communicating by letter between current interface circuit and the port is unsuccessful, with being connected between another interface circuit of switching at least two interface circuits being connected between current interface circuit and the port and the port.
When between current interface circuit and the port communicate by letter successfully the time, commutation circuit is not carried out any operation, keeps communicating by letter between current interface circuit and the port.
The changing method of realizing communication interface in the present embodiment is identical with the use of above-mentioned communication interface, can not repeat them here with reference to the record of above-mentioned relevant communication interface embodiment in detail.
The changing method of the communication interface of present embodiment detects the whether success of communicating by letter between current interface circuit and the port at least two interface circuits by commutation circuit; When communicating by letter between current interface circuit and the port was unsuccessful, commutation circuit was with being connected between another interface circuit of switching at least two interface circuits being connected between current interface circuit and the port and the port.Adopt the technical scheme of present embodiment, can realize the automatic switchover that is connected between two interface circuits and the port by adopting commutation circuit; Be convenient to the maintenance and management of communication interface.
The flow chart of the changing method of the communication interface that Fig. 8 provides for the embodiment of the invention eight.As shown in Figure 8, the changing method of the communication interface of present embodiment comprises:
Control unit in step 200, the commutation circuit detects the whether success of communicating by letter between current interface circuit and the port; When detect deserve between front port circuit and the port communicate by letter successfully the time execution in step 201; Otherwise when detecting the execution in step 202 when unsuccessful of communicating by letter of deserving between front port circuit and the port;
Particularly, control unit can be according to the state of current interface circuit, judges the whether success of communicating by letter between current interface circuit and the port.
Control unit in step 201, the commutation circuit is not carried out any operation, keeps current state;
The control unit of step 202, commutation circuit transmits control signal to the switch unit of commutation circuit; Execution in step 203;
Step 203; Switch unit receives the control signal of control unit, will switch to being connected between another interface circuit and the port being connected between current interface circuit and the port.
Switch unit in the foregoing description comprises the relay of at least one electric switching device such as at least one dpdt double-pole double-throw (DPDT), being connected between another interface circuit that is used for being connected between current interface circuit and the port switched at least two interface circuits and the port.At least two interface circuits comprise serial interface circuit such as RS232/485 interface circuit and network interface circuit such as FE interface circuit.
The changing method of realizing communication interface in the present embodiment is identical with the use of above-mentioned communication interface, can not repeat them here with reference to the record of above-mentioned relevant communication interface embodiment in detail.
The changing method of the communication interface of present embodiment can automatically switch in use with the adaptive interface circuit that is connected with port, is convenient to the maintenance and management of communication interface.
It should be noted that at last: above embodiment only in order to technical scheme of the present invention to be described, is not intended to limit; Although with reference to previous embodiment the present invention is had been described in detail, those of ordinary skill in the art is to be understood that: it still can be made amendment to the technical scheme that aforementioned each embodiment put down in writing, and perhaps part technical characterictic wherein is equal to replacement; And these modifications or replacement do not make the essence of appropriate technical solution break away from the spirit and scope of various embodiments of the present invention technical scheme.