Equipment for protecting optical fibre longitudinal difference and synchronized communication method thereof
Technical field
The present invention relates to the communication technology, particularly relate to the technology of a kind of equipment for protecting optical fibre longitudinal difference and synchronized communication method thereof.
Background technology
Relaying protection is the important leverage that power system safety and stability runs; and the development of Fibre Optical Communication Technology makes optical fiber obtain applying more and more widely in relaying protection, be that the Current Differential Protection of medium is just more and more paid close attention to because there being the incomparable various advantages of other protection forms and applying with optical fiber.
The optical-fiber longitudinal difference protection of electric power system is by being in two protective devices of diverse location by optical fiber communication interaction data; and realize sampling synchronously to realize longitudinal difference protection; synchronous communication must be adopted between two protective devices, and both sides can extract information lock in time easily in a stream.
As shown in Figure 2; existing fiber longitudinal differential protecting equipment is all by CPU(central processing unit), synchronous serial chip, FPGA(programmable gate array) form; signal madulation module and signal receiving module is built-in with in FPGA; the output of signal madulation module and the input of signal receiving module are connected to optical fiber transport channel through interface conversion circuit; utilize synchronous serial chip to realize transmitting-receiving and the encoding and decoding of data, utilize FPGA to carry out signal madulation to serial data and demodulation makes its applicable Optical Fiber Transmission.The mode that the synchronous serial chip that existing fiber longitudinal differential protecting equipment adopts adds FPGA has the high defect of hardware cost, and synchronous serial chip is encoded to data according to HDLC agreement, need when encoding to utilize opening flag and closing the location that flag realizes frame head and postamble of HDLC agreement, the form opening flag and pass flag due to it is " 01111110 ", for ensureing to open flag, close the uniqueness of flag, therefore when data encoding except, close in other data outside flag and often run into 5 continuous print " 1 " just automatic insertion one " 0 ", when data decode except, close in other data outside flag and often run into 5 continuous " 1 " just automatic deletion one " 0 ", but because the data of transmission are real-time change, make the number inserting " 0 " in a data frame also in change, and then make to adopt the data frame length of this coding method to be also uncertain, make the time needed for the transmission of every frame data also different, therefore first must carry out frame head identification when data frame transfer realize synchronous, and then data are read in time delay, its software processes more complicated, Software for Design is cumbersome.
Summary of the invention
For the defect existed in above-mentioned prior art, it is low that technical problem to be solved by this invention is to provide a kind of hardware cost, the simple equipment for protecting optical fibre longitudinal difference of Software for Design and synchronized communication method thereof.
In order to solve the problems of the technologies described above, a kind of equipment for protecting optical fibre longitudinal difference provided by the present invention, comprise CPU and FPGA, described CPU is provided with parallel communications mouth, the signal madulation module for serial signal being modulated to fiber-optic signal is built-in with in described FPGA, and for fiber-optic signal being demodulated into the signal receiving module of serial signal, the output of described signal madulation module and the input of signal receiving module are respectively connected to optical fiber transport channel through interface conversion circuit, it is characterized in that: in described FPGA, be also built-in with transmission fifo module, receive fifo module, Frame coding module, Frame decoder module, parallel serial conversion module, serioparallel exchange module,
The input of described transmission fifo module and the output of reception fifo module are connected respectively to the parallel communications mouth of CPU;
The output of described transmission fifo module successively connection data frame coding module, parallel serial conversion module to the input of signal madulation module;
The output of described signal receiving module connects serioparallel exchange module, Frame decoder module successively to the input receiving fifo module.
The synchronized communication method of equipment for protecting optical fibre longitudinal difference provided by the present invention, is characterized in that, in advance the length of packet is set to fixed length, and by the format setting of packet is:
Frame head+Frame+check code+bell idles;
Wherein, frame head is 10 " 0 ", inserts one " 1 " as boundary mark will between frame head and Frame, and insert one " 1 " after each byte in Frame as boundary mark will, check code is CRC(cyclic redundancy) check code, bell idles is complete " 1 ";
When sending data, data to be sent are first sent into and are sent in fifo module by CPU, send one again and send order to transmission fifo module, send after fifo module receives transmission order and send the data to Frame coding module, Frame coding module carries out coding packing according to the data packet length preset and form to the data received, and by the Packet Generation after coding to parallel serial conversion module, parallel serial conversion module sends to signal madulation module after the packet received is converted to serial signal, signal madulation module is sent to optical fiber transport channel by interface conversion circuit after serial signal is modulated to fiber-optic signal,
When receiving data, fiber-optic signal in optical fiber transport channel is sent to signal receiving module by interface conversion circuit, signal receiving module sends to serioparallel exchange module after fiber-optic signal is demodulated into serial signal, serioparallel exchange module sends Frame decoder module after serial signal is converted to parallel data bag, Frame decoder module according to preset data packet length and form to the decoding data received, decoded data are sent into and are received in fifo module, after receiving fifo module reception data, by sending interrupt mode notice CPU, have no progeny during CPU receives from receiving fifo module and read data.
Equipment for protecting optical fibre longitudinal difference provided by the invention and synchronized communication method thereof, the combination using single FPGA to instead of original synchronous serial interface chip to add FPGA, hardware cost can be saved, and have employed 10 " 0 " as frame head, have employed 1 " 1 " as the boundary mark will between byte, and fill complete " 1 " in room between check code to packet afterbody as bell idles, therefore what the data content no matter sent is, total energy ensures the uniqueness of frame head, and specifically should be used for saying for one, its data volume sent is certain, therefore the length of whole Frame and transmission time are also fixing, receiving terminal applies for the read operation of CPU again after whole data frame receipt can being completed, Software for Design can be simplified.
Accompanying drawing explanation
Fig. 1 is the structured flowchart of the equipment for protecting optical fibre longitudinal difference of the embodiment of the present invention;
Fig. 2 is the structured flowchart of existing fiber longitudinal differential protecting equipment.
Embodiment
Illustrate below in conjunction with accompanying drawing and be described in further detail embodiments of the invention, but the present embodiment is not limited to the present invention, every employing analog structure of the present invention and similar change thereof, all should list protection scope of the present invention in.
As shown in Figure 1, a kind of equipment for protecting optical fibre longitudinal difference that the embodiment of the present invention provides, comprise CPU(central processing unit) and FPGA(programmable gate array), described CPU is provided with parallel communications mouth, the signal madulation module for serial signal being modulated to fiber-optic signal is built-in with in described FPGA, and for fiber-optic signal being demodulated into the signal receiving module of serial signal, the output of described signal madulation module and the input of signal receiving module are respectively connected to optical fiber transport channel through interface conversion circuit, it is characterized in that: be also built-in with in described FPGA and send FIFO(first in first out) module, receive FIFO(first in first out) module, Frame coding module, Frame decoder module, parallel serial conversion module, serioparallel exchange module,
The input of described transmission fifo module and the output of reception fifo module are connected respectively to the parallel communications mouth of CPU;
The output of described transmission fifo module successively connection data frame coding module, parallel serial conversion module to the input of signal madulation module;
The output of described signal receiving module connects serioparallel exchange module, Frame decoder module successively to the input receiving fifo module.
The synchronized communication method of the equipment for protecting optical fibre longitudinal difference that the embodiment of the present invention provides, is characterized in that, in advance the length of packet is set to fixed length, and by the format setting of packet is:
Frame head+Frame+check code+bell idles;
Wherein, frame head is 10 " 0 ", inserts one " 1 " as boundary mark will between frame head and Frame, and insert one " 1 " after each byte in Frame as boundary mark will, check code is CRC(cyclic redundancy) check code, bell idles is complete " 1 ";
When sending data, data to be sent are first sent into and are sent in fifo module by CPU, send one again and send order to transmission fifo module, send after fifo module receives transmission order and send the data to Frame coding module, Frame coding module carries out coding packing according to the data packet length preset and form to the data received, and by the Packet Generation after coding to parallel serial conversion module, parallel serial conversion module sends to signal madulation module after the packet received is converted to serial signal, signal madulation module is sent to optical fiber transport channel by interface conversion circuit after serial signal is modulated to fiber-optic signal,
When receiving data, fiber-optic signal in optical fiber transport channel is sent to signal receiving module by interface conversion circuit, signal receiving module sends to serioparallel exchange module after fiber-optic signal is demodulated into serial signal, serioparallel exchange module sends Frame decoder module after serial signal is converted to parallel data bag, Frame decoder module according to preset data packet length and form to the decoding data received, decoded data are sent into and are received in fifo module, after receiving fifo module reception data, by sending interrupt mode notice CPU, have no progeny during CPU receives from receiving fifo module and read data.