Summary of the invention
For the various problems of existing existence, the invention provides a kind of repeater and information transferring method thereof, achieve the communication success rate and the object of the long-time stability that communicate that improve power information acquisition terminal.
This repeater provided by the invention, comprises power information acquisition terminal, communication module, Date Conversion Unit and the remote unit be arranged on this power information acquisition terminal; The former communication module be arranged on this power information acquisition terminal is arranged on remote unit; Date Conversion Unit for this communication module virtual is arranged on power information acquisition terminal; Wired connection is passed through between Date Conversion Unit and remote unit.
Described Date Conversion Unit comprises hardware ID also primary circuit, processor one, serial ports and RS485 change-over circuit, No. two serial ports and RS485 change-over circuit, a power circuit; Hardware ID also one end of primary circuit is connected with a remote communication module interface of described terminal, and its other end is connected with processor one; A serial ports is connected with a remote communication module data-interface of described terminal with one end of RS485 change-over circuit, and its other end is connected with described remote unit by RJ45 network interface; No. two serial ports are connected with the serial ports of processor one with one end of RS485 change-over circuit, and its other end is connected with described remote unit by RJ45 network interface; Control on Communication pin and the status pin of processor one and a remote communication module interface of described terminal are connected; The input of a power circuit is connected with a remote communication module interface of described terminal, its output is respectively processor one, serial ports and RS485 change-over circuit and No. two serial ports and RS485 change-over circuit and powers, and its output is also connected with described remote unit by RJ45 network interface.
Described remote unit comprises hardware ID identification circuit, processor two, No. three serial ports and RS485 change-over circuit, No. four serial ports and RS485 change-over circuit, No. two power circuits; One end of hardware ID identification circuit is connected with processor two, and its other end is connected by No. two remote communication module interface and commmunication module hardware ID pins; No. three serial ports are connected with the communication data serial ports of described communication module with one end of RS485 change-over circuit, and its other end is connected with described Date Conversion Unit by RJ45 network interface; No. four serial ports are connected with the serial ports of processor two with one end of RS485 change-over circuit, and its other end is connected with described Date Conversion Unit by RJ45 network interface; Processor two is connected by the Control on Communication pin of No. two remote communication module interfaces and described communication module and status pin; No. two power circuits are connected with a described power circuit by RJ45 network interface, its output is respectively processor two, No. three serial ports and RS485 change-over circuit, No. four serial ports and RS485 change-over circuit are powered, and its output is also powered to communication module by No. two remote communication module interfaces.
Described hardware ID reduction circuit forms primarily of analog switching circuit group, often organize analog switching circuit and comprise two simulant electronic switches and a resistance, a remote communication module interface of one end and described terminal of often organizing analog switching circuit is connected, and the other end controls pin with the IO of processor one and is connected.
Described hardware ID identification circuit comprises some resistance; Each pin in the hardware ID of communication module is connected with processor two respectively by a resistance, and hardware ID described in each is also respectively via access processor two after AD sampling.
A described power circuit comprises power boost circuit, and the input of power boost circuit is connected with a remote communication module interface of described terminal, and the output after its boosting is connected with described remote unit by RJ45 network interface.
Described No. two power circuits comprise power voltage step down circuit, 5V power circuit, 4V power circuit, 4V and 5V power supply switch circuit; The input of power voltage step down circuit is connected with the output of the power boost circuit of described Date Conversion Unit by RJ45 network interface, and the output of power voltage step down circuit is connected with 5V power circuit; The output of 5V power circuit is connected with the input of 4V power circuit, and another output of this 5V power circuit is connected with the input of 4V and 5V power supply switch circuit; The output of 4V power circuit is connected with the input of 4V and 5V power supply switch circuit; Another input of 4V with 5V power supply switch circuit is connected with described processor two, and its output is connected with described communication module power supply interface.
An information transferring method for repeater, the method comprises the steps:
Step 1, the connection of communication data information transmission path: a remote communication module interface of power information acquisition terminal is connected with RS485 change-over circuit with a serial ports of Date Conversion Unit, this serial ports and RS485 change-over circuit are connected with RS485 change-over circuit with No. three serial ports of remote unit via RJ45 network interface again, and these No. three serial ports are connected via the communication data serial ports of No. two remote communication module interface and commmunication modules with RS485 change-over circuit again;
The connection in Control on Communication and status information transmission path: the Control on Communication pin of power information acquisition terminal is connected with processor one with status pin, the serial ports of processor one is connected with 485 change-over circuits with No. two serial ports, these No. two serial ports and RS485 change-over circuit are connected with RS485 change-over circuit with No. four serial ports of remote unit via RJ45 network interface again, No. four serial ports are connected with the serial ports of RS485 change-over circuit with processor two, and processor two is connected with status pin via the Control on Communication pin of No. two remote communication module interface and commmunication modules again;
Step 2, Date Conversion Unit powers on, and waits for that remote unit sends data; Remote unit powers on, and waits for that Date Conversion Unit sends data;
Step 3, the Control on Communication pin of Date Conversion Unit Real-Time Monitoring power information acquisition terminal and status pin level state; The Control on Communication pin of remote unit Real-Time Monitoring communication module and status pin level state and communication module hardware ID information;
Step 4, when the level state that Date Conversion Unit monitors local communication control pin and/or status pin changes, local communication is controlled the level state information framing of pin and status pin by Date Conversion Unit immediately, and this information frame is sent to remote unit via the transmission path of step 1, then response time-out time is set and waits for that the other side confirms response;
Remote unit monitors local communication and controls the level state of pin and/or status pin and/or communication module hardware ID information when changing, local communication is controlled level state and the present communications module hardware id information framing of pin and status pin by remote unit immediately, and this information frame is sent to Date Conversion Unit via the transmission path of step 1, then response time-out time is set and waits for that the other side confirms response;
Step 5, after Date Conversion Unit receives the information frame of remote unit transmission, the level state of reduction communication module hardware ID and Control on Communication pin and status pin first immediately, and send acknowledgement frame immediately to remote unit;
After remote unit receives the information frame of Date Conversion Unit transmission, the level state of reduction Control on Communication pin and status pin first immediately, and send acknowledgement frame immediately to Date Conversion Unit;
Step 6, when power information acquisition terminal sends communication data to communication module, described communication data is sent to No. three serial ports on remote unit and RS485 change-over circuit via the transmission path of step 1 by a serial ports and RS485 change-over circuit immediately, and communication data reduces and is forwarded to communication module by No. three serial ports and RS485 change-over circuit;
When communication module sends communication data to power information acquisition terminal, described communication data is sent to a serial ports on Date Conversion Unit and RS485 change-over circuit via the transmission path of step 1 by No. three serial ports and RS485 change-over circuit immediately, and communication data reduces and is forwarded to power information acquisition terminal by a serial ports and RS485 change-over circuit;
Realize the transparent transmission of the communication data of a Date Conversion Unit and remote unit, Control on Communication and state information and communication module hardware ID information thus.
If described remote unit or described Date Conversion Unit do not confirm response in time-out time, then repeat step 4.
Compared with existing scheme, tool of the present invention has the following advantages:
1, communication module and terminal have been carried out split-type design mode by the present invention, communication module can be arranged on the good place of signal and not by the limitation of terminal installation site, ensure that the reliability and stability of communication.In addition, present invention employs low power dissipation design, only normally can work from terminal power taking without the need to external power supply, conveniently install and use.
2, the present invention realizes the transparent transmission of communication data and communications control signal, and result of use and method and communication module are arranged in terminal completely the same.Do not change the topological structure of the existing various kinds of equipment such as system, terminal, table meter implemented, original configuration and attribute, the transparent forwarding of data-signal and control signal can be realized.
3, adopt efficient DC-DC switch technology, the present invention is without the need to changing original terminal software and hardware, and the effective communication repeating distance extending terminal and communication module, communication distance can reach 300 meters.
4, present invention achieves the plug and play of communication module, state shows in real time; Adopt wired mode to connect (such as being connected by netting twine), use 485 communication protocols, reliable and stable.
Embodiment
As shown in Figure 1, the present invention includes Date Conversion Unit and remote unit.Communication module on original power information acquisition terminal is arranged on remote unit; This remote unit is also provided with antenna, and communication module is connected with antenna, can carry out radio communication.Date Conversion Unit for this communication module virtual is arranged on original power information acquisition terminal, passes through wired connection between Date Conversion Unit and remote unit.
As shown in Figure 2, Date Conversion Unit of the present invention comprises hardware ID also primary circuit, processor one, serial ports and RS485 change-over circuit, No. two serial ports and RS485 change-over circuit, a power circuit.Hardware ID also one end of primary circuit is connected with a remote communication module interface of terminal, and its other end is connected with processor one.A serial ports is connected with a remote communication module interface of terminal with one end of RS485 change-over circuit, and its other end is connected with remote unit by RJ45 network interface.No. two serial ports are connected with the serial ports of processor one with one end of RS485 change-over circuit, and its other end is connected with remote unit by RJ45 network interface.Control on Communication pin and the status pin of processor one and a remote communication module interface of terminal are connected, for monitoring and transmit control signal and the status signal of communication module.The input of a power circuit is connected with terminal remote communication module interface, its output is respectively processor one, serial ports and RS485 change-over circuit and No. two serial ports and RS485 change-over circuit and powers, and its output is also connected with remote unit by RJ45 network interface.
Remote unit comprises hardware ID identification circuit, processor two, No. three serial ports and RS485 change-over circuit, No. four serial ports and RS485 change-over circuit, No. two power circuits.One end of hardware ID identification circuit is connected with processor two, and its other end is connected by No. two remote communication module interface and commmunication module hardware ID pins.No. three serial ports are connected with the communication data serial ports of No. two remote communication module interfaces with one end of RS485 change-over circuit, and its other end is connected with Date Conversion Unit by RJ45 network interface.No. four serial ports are connected with the serial ports of processor two with one end of RS485 change-over circuit, and its other end is connected with Date Conversion Unit by RJ45 network interface.Processor two is connected with status pin, for monitoring and transmit control signal and the status signal of communication module by the Control on Communication pin of No. two remote communication module interface and commmunication modules.No. two power circuits are connected with a power circuit by RJ45 network interface, its output is respectively processor two, No. three serial ports and RS485 change-over circuit, No. four serial ports and RS485 change-over circuit are powered, and its output is also powered to communication module by No. two remote communication module interfaces.
A power circuit comprises power boost circuit and power voltage step down circuit, the input of power boost circuit is connected with a remote communication module interface of described terminal, output after its boosting is connected with described remote unit by RJ45 network interface, and the output after this boosting is also connected with the input of power voltage step down circuit; Power voltage step down circuit comprises two parts circuit, and the input of a part of power voltage step down circuit is connected with a remote communication module interface, and its output is connected with processor two; The input of another part voltage step-down circuit is connected with the output of power boost circuit, and its output and a serial ports turn RS485 circuit and No. two serial ports and turn RS485 circuit and be connected.
Communication module of the present invention can adopt GPRS/CDMA communication module.
The standard followed due to terminal is inconsistent, some producers communication module supply power is 4V, some producers communication module power supply is 5V, and the present invention is identified and handoff technique automatically by communication module power supply, can 5V and the 4V power-supply system of communication module power supply automatically be identified and be switched, compatibility is carried out to each producer, each standard.Automatic identification and handoff technique can briefly be expressed as: Date Conversion Unit identifies automatically to communication module power supply, and recognition result is transferred to remote unit, and remote unit carries out power supply automatic switchover according to the recognition result of Date Conversion Unit.
As shown in Figure 3, communication module supply voltage of the present invention identification and commutation circuit form primarily of the power supply sampling identifying processing circuit of Date Conversion Unit and power supply switch circuit two parts of remote unit.Power supply sampling identifying processing circuit comprises power supply sample circuit, processor one; Power supply switch circuit comprises processor two and No. two power circuits.
No. two power circuits comprise power voltage step down circuit, 5V power circuit, 4V power circuit, 4V and 5V power supply switch circuit; The input of power voltage step down circuit is connected with the output of the power boost circuit of Date Conversion Unit by RJ45 network interface, and the output of power voltage step down circuit is connected with the input of 5V power circuit; The output of 5V power circuit is connected with the input of 4V power circuit, and another output of this 5V power circuit is connected with the input of 4V and 5V power supply switch circuit; The output of 4V power circuit is connected with the input of 4V and 5V power supply switch circuit; Another input of 4V with 5V power supply switch circuit is connected with processor two, and its output is connected as shown in Figure 4 with communication module power supply interface, and Date Conversion Unit communication module power supply sample circuit comprises resistance R4 and resistance R5.The power supply port of the communication module of terminal is connected with the AD sampled I O mouth of processor one by resistance R4; This I/O port passes through parallel resistance R5 to ground simultaneously.The resistance of resistance R4 is 1 megohm, and the resistance of resistance R5 is 2 megohms.
As shown in Figure 5, remote unit power supply switch circuit comprises processor two and 4V and 5V power supply switch circuit.
During work, power supply sample circuit is sampled to communication module power supply, signal after sampling is input to processor one and processes, recognition result is reached No. two serial ports and RS485 change-over circuit by processor one, these No. two serial ports and RS485 change-over circuit reach No. four serial ports and the RS485 change-over circuit of remote unit by RJ45 network interface, and No. four serial ports and RS485 change-over circuit reach the serial ports of processor two again.The power-supply system recognition result that processor two sends according to processor one, out-put supply switch-over control signal, to 4V and 5V power supply switch circuit, switches to the power-supply system being applicable to this communication module.
The concrete implementation step of communication module supply voltage identification is as follows:
Step 1, remote unit powers on, and its control software design carries out battery of initialization operation, and prepare running environment, juxtaposition communication module supply power is that 4V power-supply system is powered.Date Conversion Unit powers on, and its control software design carries out battery of initialization operation, and prepare running environment, the service voltage recognition result of juxtaposition power information acquisition terminal is 4V.
Step 2, the power supply of Date Conversion Unit to terminal supply communication module carries out continuous AD sampling, and by sampled result and the comparison of threshold threshold values, is judged to be 4V power-supply system lower than this value, otherwise is 5V power-supply system.
Step 3, Date Conversion Unit will be sent to remote unit with communication module power-supply system recognition result.
Step 4, remote unit receives the communication module power supply recognition result that Date Conversion Unit sends, if be 5V power-supply system, then immediately the power supply of communication module switched to 5V power-supply system, otherwise remains unchanged.
Between power information collector terminal and communication module, data are two-way burst transfer, in the course of the work simultaneously, Control on Communication pin and/or status pin can change (such as switch to low level by high level, otherwise or) or communication hardware id information change (change communication module or hot plug communication module).Therefore the transmitted in both directions of support communication data required in this invention, also must support the level state of Control on Communication pin and status pin and the transmitted in both directions of communication module hardware ID information simultaneously, ensure the accurate of communication data, Control on Communication pin and status pin level state and communication module hardware ID information transmission.
As shown in Figure 6, communication module of the present invention controls and status signal real time bidirectional transmission circuit turns RS485 circuit primarily of the processor one of Date Conversion Unit and No. two serial ports, and the processor two of remote unit and No. four serial ports turn RS485 circuit and form.
As shown in Figure 7, processor one of the present invention and No. two serial ports turn RS485 circuit primarily of processor, RS485 chip, triode and some resistance and electric capacity composition.
As shown in Figure 8, processor two of the present invention and No. four serial ports turn RS485 circuit primarily of processor, RS485 chip, three isolation optocouplers and some resistance and electric capacity composition.
Control on Communication pin and/or status pin level state and/or communication module hardware ID information change are the trigger conditions that the present invention carries out Control on Communication and state information transparent transmission.When Control on Communication pin and/or status pin level state and/or communication module hardware ID information change, then these control by corresponding Date Conversion Unit or remote unit and state information or communication module hardware ID information form Frame and transmits in Control on Communication and status information transmission path.
The connection in Control on Communication and status information transmission path: the Control on Communication pin of power information acquisition terminal is connected with processor one with status pin, the serial ports of processor one is connected with 485 change-over circuits with No. two serial ports after light-coupled isolation, these No. two serial ports and RS485 change-over circuit are connected with RS485 change-over circuit with No. four serial ports of remote unit via RJ45 network interface again, these No. four serial ports are connected with the serial ports of the processor two of remote unit with RS485 change-over circuit again, processor two is connected with status pin via the Control on Communication pin of No. two remote communication module interface and commmunication modules again.
The processor one of Date Conversion Unit and the processor two of remote unit all supported data initiatively send and the passive answer-mode of data, support both-way communication, can all control at terminal communication module interface place and status signal and communication module hardware ID information be processed and be transmitted.
As shown in Figure 9, power information acquisition terminal is sent to control and/or the status signal of communication module, Date Conversion Unit and remote unit communication step as follows:
Step 1, Date Conversion Unit powers on, and its control software design carries out battery of initialization operation, prepares running environment, waits for that remote unit sends data.
Step 2, the level state of Date Conversion Unit real-time monitoring terminal Control on Communication pin and status pin.
Step 3, when the level state of Date Conversion Unit monitoring terminal Control on Communication pin and/or status pin changes, Date Conversion Unit can immediately by these pin level state information framings, and this information frame is sent to remote unit via above-mentioned Control on Communication and status information transmission path, and response time-out time is set, wait for that the other side confirms response.
Step 4, after remote unit receives the information frame of Date Conversion Unit transmission, the level state of true reduction control and status signal pin is to communication module first immediately, and sends acknowledgement frame immediately to Date Conversion Unit.
If remote unit does not confirm response in the time-out time of step 3, then repeat step 3.
As shown in Figure 10, communication module is sent to control and/or the status signal of power information acquisition terminal, remote unit and Date Conversion Unit communication steps as follows:
Step 1, remote unit powers on, and its control software design carries out battery of initialization operation, prepares running environment, waits for that Date Conversion Unit sends data.
Step 2, remote unit Real-Time Monitoring local communication controls level state and the communication module hardware ID information of pin and status pin.
Step 3, when remote unit monitors the level state of local communication control pin and/or status pin or communication module hardware ID information changes, local communication is controlled level state and the present communications module hardware id information framing of pin and status pin by remote unit immediately, and this information frame is sent to Date Conversion Unit via Control on Communication and status information transmission path, and arrange response time-out time wait for the other side confirm response.
Step 4, after Date Conversion Unit receives the information frame of remote unit transmission, the level state of reduction communication module hardware ID and Control on Communication pin and status pin is to power information acquisition terminal first immediately, and sends acknowledgement frame immediately to remote unit.
If Date Conversion Unit does not confirm response in the time-out time of step 3, then repeat step 3.
The transparent real time bidirectional of the Control on Communication and status signal that realize Date Conversion Unit and remote unit thus transmits.
Because the messaging parameter between the power information acquisition terminal of each producer and communication module is indefinite, for alleviating repeater controlling software design difficulty and complexity, for transmission and the reduction of communication data, repeater realizes with hardware circuit completely.Data communication is carried out by serial ports between power information acquisition terminal and communication module, for the benefit of data long-distance transmissions, the present invention has carried out the conversion process of serial ports and RS485 level to communication data, its communication process is not by the control (see communication data interface section in Fig. 2) of each processor on Date Conversion Unit and remote unit, complete data transparent transmission, ensures real time communication.
The connection in communication data transfer path: the communication data interface of power information acquisition terminal is connected with RS485 change-over circuit with a serial ports via after the light-coupled isolation of Date Conversion Unit by serial ports, this serial ports and RS485 change-over circuit are connected with RS485 change-over circuit with No. three serial ports of remote unit via RJ45 network interface again, and these No. three serial ports are connected with the communication data interface of communication module with RS485 change-over circuit again.
As shown in figure 11, the transmission circuit of communication data of the present invention forms primarily of a serial ports of Date Conversion Unit and No. three serial ports of RS485 change-over circuit and remote unit and RS485 change-over circuit.
As shown in figure 12, the present invention's serial ports and RS485 change-over circuit form primarily of two RS485 chips, two optocouplers, two lists or doors and some resistance, electric capacity.
As shown in figure 13, the present invention's No. three serial ports and RS485 change-over circuit form primarily of two RS485 chips, 4 triodes and some resistance and electric capacity.
The communication data transfer step of power information acquisition terminal and communication module is as follows:
When power information acquisition terminal sends communication data to communication module, communication data is sent to No. three serial ports on remote unit and RS485 change-over circuit via above-mentioned communication data information transmission path by a serial ports and RS485 change-over circuit immediately, and communication data reduces and is forwarded to communication module by No. three serial ports and RS485 change-over circuit.
When communication module sends communication data to power information acquisition terminal, communication data is sent to a serial ports on Date Conversion Unit and RS485 change-over circuit via communication data information transmission path by No. three serial ports and RS485 change-over circuit immediately, and communication data reduces and is forwarded to power information acquisition terminal by a serial ports and RS485 change-over circuit.
The transparent real time bidirectional realizing the communication data of Date Conversion Unit and remote unit thus transmits.