Portable electric power communication protocol detector and detection method thereof
Technical field
The present invention relates to a kind of instrument that communication of power system and process thereof are detected in real time, relate to the detection method of this detector simultaneously, belong to communication of power system detection technique field.
Background technology
The current power system adopts generally that automated system monitors, control and traffic control, as EMS EMS, comprehensive automation system of transformer substation SCADA etc.The information source of these systems with control all dependency network and communicate by letter; and along with enforcement and large tracts of land based on the digital transformer substation of IEC61850 communication system are promoted; traditional cable connected mode of passing through is transmitted signals such as the control connection locking of observing and controlling metering current voltage, circuit breaker and isolation switch, relaying protection breaker tripping and closing, startup, locking, has also changed into by network communication mode and having realized.Therefore, the correct transmission of the network service of power automatic system is just particularly important.
By in recent years the statistical analysis of power automatic system operational defect being found, because of the network service defective causes the power automatic system operation exception in rising trend.This be because: at present each subsystem in the power automatic system often adopts the different product of a plurality of producers, and each producer exists inconsistent to the understanding of communication protocol, and for some purpose stipulations are made amendment and the phenomenon that expands also very general; Each producer is uneven on the fulfillment capability of communication protocol, causes in the phenomenon of engineering site update routine more ordinaryly, makes product lack the reliability of enough strict test process to guarantee to communicate by letter.Known to the inventor, the KEMA consulting firm of Holland is conformance to standard property testing authoritative institution in the world, but it is laboratory tests, can't test at engineering site, also not possess the system robust property testing, simultaneously, its test case and engineering site are also not quite identical, and product also have engineering site revise may, therefore, the test result of KEMA is not enough to guarantee the reliability of communicating by letter.
The existing communication failure of power automatic system in actual motion is more; these communication failures are mainly reflected in the following aspects: the action event record is imperfect during the background monitoring accident; the protection measure and control device causes from resetting because of communication issue; communication unit or background monitoring dysfunction or deadlock; the data (message) that scheduling and unattended centralized control center automated system are received are not lost entirely even all; the unusual transition of telemetry; the displacement of remote signalling data exception, measure and control device anti-misoperation connection locking fault and computer network suffer virus attack or the like.Owing to lack effective technical means, the attendant often can only carry out qualitative analysis to these communication failures at present, therefore is unfavorable for the safe operation of complex automatic system.
Find by retrieval, the Chinese patent of application number 200610098252.8 " communication protocol record analysis apparatus and analytical method thereof " discloses a kind of split type communication protocol record analysis apparatus, the main technical schemes of this device is a distributed frame, form by the communications records instrument that is distributed in each communication node and an analysis management machine, connect with independent Ethernet between communications records instrument and the analysis management machine; In the stipulations recorder, the output of serial ports access module, Ethernet access module, CAN net access module, LONWORK module, GPS module is connected with the input of CPU module respectively, the input of the unusual output module of output terminating set of CPU module, big capacity storage module, keyboard display module is connected with the CPU module; The input of the output termination protocol analysis device of stipulations tape deck is analyzed the content of record for the protocol analysis supervisor.The analytical method key step of this device is: 1) the communications records module of communications records instrument according to the communicate configuration file to the message of the communication port of each needs record through catching, and preserved the original communication message of a communication port in per 10 minutes, produce a log file; 2) notice uplink communication module behind log file of the every generation of the communications records module of communications records instrument, the uplink communication module uploads to the analysis management machine with the downlink communication module communication of active and analysis management machine with this log file; 3) the downlink communication module of analysis management machine behind log file of complete reception according to the communicate configuration file to the log file storage and uniform of classifying, do not analyze log file this moment, but wait for that user's selection analyzes again; 4) when the user selects to analyze the communication message of certain time period of certain communication port, the analysis management machine utilizes the communicate configuration file to obtain corresponding communication parameter information and stipulations information when carrying out message analysis, automatically call corresponding protocol analysis module and come the analytic record file, produce analysis result, and analysis result is shown through format; 5) analytical method of protocol analysis module is, form according to message in the stipulations reads original message from log file, according to stipulations original message is analyzed in proper order according to byte and combination of bytes then, according to stipulations the relation between message and the message is analyzed again.
There are following problem in above-mentioned communication protocol record analysis apparatus and analytical method:
1) described each access module of the recorder of this device is connected with the CPU module with memory is parallel, and well-known, CPU is the work in series mode, can cause message dropping when a plurality of access module transmit message to the CPU module at a high speed simultaneously.The message that while CPU module sends a plurality of access module sends memory to and carries out the message storage, and the data throughout of memory can cause the message dropping when storing again much smaller than the speed of access module.In case message dropping, the message of record storage is just imperfect, waits and has access to when these incomplete messages are analyzed and will make mistakes after being out of order, even can not find the reason that message produces fault at all, thereby can't further search and get rid of corresponding electric network fault, and then cause bigger accident.
2) certain module described in this device (as CAN net access module, LONWORK module etc.) has only general noun, there are not relevant circuit diagram and realization mechanism, do not know what concrete structure is, those skilled in the art can't make according to patent document.
3) this device is split type fixture, need arrange many in each power transmission and transformation station complex automatic system kind, and cost is huge, and inconvenience is moved and carried.
4) this device is to write down and store each message earlier, analyze the message failure cause Deng having access to the stored historical message accounting again after being out of order, can not analyze message by real-time online, be difficult to find in time fast to cause the network service fault of accident potential and find out failure cause, thereby in fact the real-time grid troubleshooting of faults that exists fault to cause because of the network service of hiding done nothing with avoiding enlarging.
5) the described analytical method of analysis management machine of this device is described smudgy Chu, this analytical method " is analyzed according to byte and combination of bytes message according to stipulations; according to stipulations the relation between message and the message is analyzed " in proper order again, very not comprehensive, there are not relation, byte branch between byte and byte or the combination of bytes or the like; There are not environmentally hazardous analysis, the analysis of stipulations accordance etc.Its most contents is the result of its object analyzed and analysis, and those skilled in the art are difficult to according to this analytical method the message of record be realized effectively analyzing.
Summary of the invention
The technical problem to be solved in the present invention is: propose a kind of real portable electric power communication protocol detector and the detection method thereof that can carry out complete collection and analysis to all communication datas in the existing power automatic system; Utilize this detector and detection method thereof should carry out complete collection and the reason of definite each the message fault of analysis and the place of message fault to all messages of power automatic system, thereby the personnel that maintain easily in time get rid of and corresponding electric network fault of message fault and potential safety hazard, and then improve the security and stability of power automatic system operation.
In order to solve the problems of the technologies described above, one of technical scheme that the present invention proposes is: a kind of portable electric power communication protocol detector, comprise the harvester and the analytical equipment that are placed in the portable cabinet, described harvester contains message detectaphone and the parallel serial processor of changeing, and described analytical equipment contains CPU, analytical system, the loader that is connected with CPU respectively and display; The input of described message detectaphone inserts the power communication link, the parallel input that is connected in parallel commentaries on classics serial processor of its output; The output of described parallel commentaries on classics serial processor is connected in series in CPU, described message detectaphone is connected CPU respectively with the parallel control end that changes serial processor, described analytical system contain be useful on from parallelly change acquisition module that serial processor reads the message of described power communication link, be used for to described message carry out network analysis nework analysis module, be used for the application layer of the message behind network analysis is carried out the protocol analysis module of protocol analysis and is used to dispatch and manage the dispatching management module of described module.
Practice shows, because to the detection of electric power communication protocol is to finish the intercepting of whole powerline network data, and must operate under the promiscuous mode so intercept network interface, promptly intercepts network interface and will accept all data flow by it, no matter be any form, what address.If the mode that adopts traditional CPU directly to receive data designs, because CPU is bigger in the network data amount to the restriction of Interrupt Process, particularly in the processes of a large amount of transmission of parcel, system entails produces packet loss, and the accurate mark of packet markers.And detector of the present invention adopts the parallel serial processor of changeing to be connected with the output port of each message detectaphone is parallel unexpectedly, makes that message input CPU is cushioned before; Even therefore each communication link message flow of intercepting is very big, can there be the possibility of losing in each message yet before arriving CPU.Simultaneously, again because the message of detector of the present invention is to carry out storage again behind the real-time protocol analysis through the protocol analysis module earlier, therefore, even lost part message when memory rate is slow can not influence yet and find and analyze the message fault.
In order to solve the problems of the technologies described above, two of the technical scheme that the present invention proposes is: a kind of detection method of portable electric power communication protocol detector may further comprise the steps:
1) starts described detector, dispose the related appointment of parameter of power communication link to be detected by described loader and form CONFIG.SYS with specific stipulations;
2) described analytical system is carried out initialization, and promptly described CPU at first loads dispatching management module, nework analysis module and acquisition module, and described dispatching management module reloads the protocol analysis module according to described CONFIG.SYS;
3) described message detectaphone is by intercepting the message of power communication link, and this message is passed in parallel to the parallel serial processor of changeing, described parallel commentaries on classics serial processor was stabbed the message joining day that parallel receive comes, and the message after will stabbing the joining day carries out buffer memory;
4) described acquisition module changes the message that serial processor reads buffer memory from parallel, and this message is sent into nework analysis module;
5) described nework analysis module carries out net grammar and the semantic analysis application layer until this message according to osi model protocal layers syntax and semantics to the message of sending into nework analysis module, and the message of application layer sent into the protocol analysis module, and net grammar and semantic analysis result are sent to display interface;
6) described protocol analysis module is carried out the analysis of stipulations syntax and semantics according to the syntax and semantics of stipulations to the message of described application layer, and stipulations syntax and semantics analysis result is sent to display interface.
Portable electric power communication protocol detector of the present invention can online in real time detect a plurality of power communication links to be detected according to above-mentioned detection method, after finding the message fault, can find communication failure reason and place the very first time, provide possibility in time getting rid of communication failure, thereby can avoid the further expansion of accident, reduce the communication failure influence that normal operation brings to electrical network.
To sum up, portable electric power communication protocol detector of the present invention and detection method thereof, not only changed the situation of existing communication protocol record analysis apparatus and the post analysis of record earlier that analytical method adopted thereof, thereby can online in real time be analyzed by the message of each power communication link, and in time catch the message fault; And thoroughly solved the problem of losing message that existing communication protocol record analysis apparatus exists, thereby real the realization carried out the complete and effective analysis to the message of power communication link.
The improvement of one of technique scheme is: the single-chip microcomputer that described parallel commentaries on classics serial processor is FPGA processor or a plurality of collaborative works.
One of further improvement of one of technique scheme is: described message detectaphone is one of switch ports themselves image signal message detectaphone, network signal message detectaphone, rs 232 serial interface signal message detectaphone and MODEM carrier signal message detectaphone, one of the input access switch communication link of described message detectaphone, network communication link, serial ports power communication link and carrier wave power communication link.
Two of the further improvement of one of technique scheme is: described message detectaphone is switch ports themselves image signal message detectaphone, network signal message detectaphone, rs 232 serial interface signal message detectaphone and MODEM carrier signal message detectaphone, and the input separately of these four message detectaphones is access switch communication link, network communication link, serial ports power communication link and carrier wave power communication link respectively.
The further improvement of one of technique scheme is: also comprise memory, described analytical system also contains and is useful on the logging modle that message that acquisition module is read is sent to memory stores by analysis after the network analysis.Like this, after the network analysis message is preserved by analysis,, can be played the effect of drawing inferences about other cases from one instance in emergency review and refutation process so that valuable on-the-spot operation information is provided at message.
Further improving again of one of technique scheme is: described analytical system also contains and is useful on the statistical analysis module that analysis result that nework analysis module and protocol analysis module are produced carries out the secondary statistical analysis.Like this, can make analysis result visualize more, and can observe intuitively and could find existing problems after need and forming value sequence in monitored for prolonged periods of time.
Further improving again of one of technique scheme is: described FPGA processor mainly contains the chip that model is ALTERA EP3C25Q240, and this chip connects CPU by the Ethernet interface of gigabit; Described serial ports message detectaphone is the three-in-one serial ports message detectaphone that RS485, RS422 and three kinds of communication interfaces of RS232 are provided respectively; Described MODEM carrier signal message detectaphone contains and is useful on two road MODEM carrier wave receiving interfaces of intercepting one road MODEM carrier wave power communication link, and its two road receiving interface respectively and receive on a pair of sending and receiving line of MODEM carrier wave power communication link; Described CPU is that model is the flush bonding processor of MPC837.
The continuation of one of technique scheme improves: described loader adopts keyboard, mouse or touch screen loader, and described display is general CRT or LCD, and described memory is general SSD hard disk; The interface total bandwidth of described message detectaphone is 400Mbps; The dish speed of writing of described memory is 640Mbps-800Mbps.
One of improvement of two of technique scheme is:
----the described the 1st) the related appointment of the specific stipulations in the step is the corresponding syntactic model file of specific stipulations and the semantic model file of selection and power communication link to be detected;
----the described the 2nd) the protocol analysis module in the step is to form the syntax and semantics environment of specific stipulations and these specific stipulations are carried out the general module that syntax and semantics is analyzed by syntactic model file and semantic model file; The syntactic model file and the semantic model file that load the protocol analysis module and be according to appointment in the CONFIG.SYS carry out initialization, promptly generate protocol layer, syntax analyzer, session channel manager, semantic analyzer at specific stipulations, subsequently protocol layer is organized as protocol stack,, be each session channel manager configuration semantic analyzer then then for each protocol layer is equipped with corresponding syntax analyzer and session channel manager;
----the described the 6th) the stipulations syntax and semantics analysis in the step is, upwards use syntax analyzer to carry out syntactic analysis at each protocol layer to the message of described application layer successively from the bottom of described protocol stack, and the parse tree that obtains passed to session manager, by session manager the semantic analyzer that parse tree is distributed to session manager reception and transmission two ends is carried out semantic analysis, syntax analyzer and semantic analyzer will remain the last layer transmission to described protocol stack of the message of application layer and semantic analysis result respectively, carry out said process once more by last layer, up to the top that arrives protocol stack, obtain the analysis result of described application layer message.
Two of two improvement of technique scheme is:
----the described the 1st) appointment of the association in the step is the corresponding protocol analysis module of specific stipulations of selection and power communication link to be detected;
----the described the 2nd) step in loading protocol analysis module be according to appointment in the CONFIG.SYS with the corresponding protocol analysis module of specific stipulations; Described protocol analysis module is to form the syntax and semantics environment of specific stipulations and the non-general module that specific stipulations is carried out grammer and semantic analysis by programming;
----the described the 6th) the stipulations syntax and semantics analysis in the step is, described application layer message forms the unit message structure according to the bit position of byte, bit bit combination, byte or the combination of bytes of byte, the unit message structure is combined into compound message structure again then, again the relation between the described message structure is carried out syntactic analysis and formed the syntactic analysis result, from the syntactic analysis result, extract with the value of context environmental association message structure then and carry out semantic analysis and form semantic analysis result, obtain the analysis result of described application layer message.
Two further improvement of technique scheme is:
----the described the 2nd) the load networks analysis module in the step is, generation is at protocol layer, syntax analyzer, session channel manager, the semantic analyzer of osi model, subsequently protocol layer is organized as protocol stack according to the OSI seven layer model,, be each session channel manager configuration semantic analyzer then then for each protocol layer is equipped with corresponding syntax analyzer and session channel manager;
----the described the 5th) net grammar and the semantic analysis in the step is, upwards use syntax analyzer that the message of sending into nework analysis module is carried out syntactic analysis at each protocol layer successively from the bottom of described protocol stack, and the parse tree that obtains passed to session manager, by session manager the semantic analyzer that parse tree is distributed to session manager reception and transmission two ends is carried out semantic analysis, syntax analyzer and semantic analyzer are respectively with the last layer transmission to described protocol stack of remaining message and semantic analysis result, carry out said process once more by last layer, up to the application layer that arrives protocol stack, the application layer message is sent into described protocol analysis module carry out protocol analysis, obtain analysis result simultaneously the message of sending into nework analysis module.
Two further improvement of technique scheme is: when the described the 2nd) analytical system is carried out initialization in the step, also load statistical analysis module; Also include the 7th) step, described nework analysis module and protocol analysis module are given statistical analysis module with analysis result and are carried out statistical analysis, described statistical analysis is that the value with the part message structure in the analysis result extracts the formation chart, the value that will extract behind at least two frame messages is carried out computing and relatively and form statistics, and statistics is sent to display interface.Like this, the user could find existing problems after can observe intuitively and need and form value sequence in monitored for prolonged periods of time.
Two further improve and be of technique scheme: described syntactic analysis model file and semantic analysis model file are pre-if on-the-spotly import in the described protocol analysis module by loader.
Two further improve again and be of technique scheme: when the described the 2nd) analytical system is carried out initialization in the step, also load logging modle; In the described step 4), described logging modle is sent to memory stores after the network analysis by analysis with the message that acquisition module reads.
Technique scheme two perfectly be: described dispatching management module is provided with message detectaphone and the parallel running parameter that changes serial processor according to described CONFIG.SYS.
Description of drawings
Below in conjunction with accompanying drawing portable electric power communication protocol detector of the present invention is described further.
Fig. 1 is the structured flowchart of embodiment of the invention portable electric power communication protocol detector.
Fig. 2 is the structured flowchart of control system among Fig. 1.
Fig. 3 is one of circuit theory diagrams of FPGA processor among Fig. 1.
Fig. 4 be FPGA processor among Fig. 1 circuit theory diagrams two.
Fig. 5 is the circuit theory diagrams of switch ports themselves image signal message detectaphone among Fig. 1.
Fig. 6 is the circuit theory diagrams of network signal message detectaphone among Fig. 1.
Fig. 7 is the circuit theory diagrams of rs 232 serial interface signal message detectaphone among Fig. 1.
Fig. 8 is one of circuit theory diagrams of MODEM carrier signal message detectaphone among Fig. 1.
Fig. 9 be MODEM carrier signal message detectaphone among Fig. 1 circuit theory diagrams two.
Figure 10 is the flow chart of the detection method of embodiment of the invention portable electric power communication protocol detector.
Embodiment
Embodiment one
The portable electric power communication protocol detector of present embodiment comprises the harvester 1 and the analytical equipment 2 that are placed in the hand-held cabinet as depicted in figs. 1 and 2.Harvester 1 contains message detectaphone and the parallel serial processor of changeing; Wherein, the message detectaphone is made of switch ports themselves image signal message detectaphone 4, network signal message detectaphone 5, rs 232 serial interface signal message detectaphone 6 and 7 four message detectaphones of MODEM carrier signal message detectaphone, and the parallel serial processor of changeing is made of FPGA processor 3.Analytical equipment contains CPU8, analytical system 11, the loader 9 that is connected with CPU8 respectively and display 10; Wherein, CPU8 adopts flush bonding processor (model is MPC8377), and loader 9 adopts keyboard, mouse or touch screen loader etc., and display 10 adopts general CRT or LCD.The input separately of above-mentioned four message detectaphones is access switch communication link 13, network communication link 14, serial ports power communication link 15 and carrier wave power communication link 16 respectively, the parallel input that is connected in FPGA processor 3 of the output separately of these four message detectaphones.The output of FPGA processor 3 is connected in series in CPU8 by the gigabit network interface, and the control end separately of above-mentioned four message detectaphones and FPGA processor 3 is connected CPU8 respectively.
Because the parallel respectively input that is connected in FPGA processor 3 of the output of above-mentioned four message detectaphones, the output speed of four message detectaphones generally is 10,000,000 or 100,000,000, the gigabit network interface output speed of FPGA processor 3 is far above the speed from four message detectaphone inputs, the message of four message detectaphones transmission is exported through behind the buffer memory at the FPGA processor in addition, and all messages that therefore can guarantee four message detectaphones and gathered can complete transmission be given CPU8 and can not lost.
As shown in Figure 2, analytical system 11 contains: be used for from FPGA processor 3 read the message of power communication link acquisition module 17, be used for to the message of gathering carry out network analysis nework analysis module 18, be used for the application layer of the message behind network analysis is carried out the protocol analysis module 19 of protocol analysis and is used for being responsible for the scheduling of each intermodule and the dispatching management module 20 of management.
The portable electric power communication protocol detector of present embodiment also comprises the memory 21 that connects CPU8, and memory 21 adopts SSD hard disk (solid state disk solid state hard disc).Analytical system 11 also contains the logging modle 22 that is useful on message that acquisition module 17 is read and is sent to memory stores by analysis after the network analysis, the statistical analysis module 23 that is used for the analysis result of nework analysis module 18 and protocol analysis module 19 is carried out statistical analysis.
As shown in Figure 3 and Figure 4, FPGA processor 3 mainly contains the chip U1 that model is ALTERAEP3C25Q240, the data that switch ports themselves image signal message detectaphone 4, network signal message detectaphone 5, rs 232 serial interface signal message detectaphone 6 and 7 four message detectaphones of MODEM carrier signal message detectaphone collected in this chip U1 are after portion handles within it, Ethernet interface by gigabit is transferred to CPU8, and the gigabit network interface of its chips U1 is that it has formed the soft nuclear of gigabit MAC in inside.The soft nuclear of this gigabit MAC is connected to earlier on the gigabit PHY of chip U6 (model is VSC8601) by its RGMI I interface (93 pin are to 120 pin) again, on PHY, realize the conversion of ethernet physical layer, realize being connected on the physical link with CPU8 is continuous by the A port (as shown in Figure 5) of the first network isolation transformer T1 and the first doubly-linked RJ45 interface J1 then.
Switch ports themselves image signal message detectaphone 4 as shown in Figure 5, the mirror port of external switch (switch communication link 14) is connected on the 100MPHY of chip U5 (model KS8721BL) through the second network isolation transformer T2 by the B port of the first doubly-linked RJ45 socket J1, gives FPGA processor 3 with the data that receive with the RMII oral instructions of standard and handle after realizing the ethernet physical layer conversion on the chip U5.FPGA processor 3 BANK3 of portion is within it gone up 100M MAC of realization, docks with the PHY of chip U5 (as shown in Figure 5) by RMII mouth (the 63-80 pin of chip U1) then.
Network message detectaphone such as Fig. 6 show, the A of the second doubly-linked RJ45 socket J2, B port are respectively as input, the delivery outlet of external network (network communication link 15) signal, A, B two-port have realized physically direct-connected in inside, in the time of can guaranteeing to intercept not the proper communication to external network damage.The transmitting-receiving two paths of signals of external network is sent to respectively on the 100M PHY of two chip U3 and U4 (model KS8721BL) by the 3rd, the 4th network isolation transformer T3, T4 respectively, after two chip U3 and the conversion of U4 realization ethernet physical layer, be defeated by FPGA processor 3 by the RMII oral instructions again and handle.FPGA processor 3 BANK1 and the BANK2 of portion is within it gone up two 100M MAC of realization, and achieves a butt joint with two PHY chip U3 and U4 (showing as Fig. 6) by RMII mouth (chip U1 gets 4-22 pin and 38-57 pin) respectively.
Show as Fig. 7, serial ports message detectaphone 6 is three-in-one serial ports message detectaphones, RS485, RS422 and RS232 are provided respectively three kinds of communication interfaces, its major function is to realize that level transforms and drives between several serial digital interfaces, and the signal that will the receive serial ports power communication link 13 UART signal that changes into unified Transistor-Transistor Logic level is given FPGA processor 3 and handled.When the serial ports power communication link 13 of intercepting when needs was the RS485 communication mode, the A (RX+) of the RS485 interface of outside serial equipment, B (RX-) were respectively also to 6,7 two pins of chip U8, U9, U10 or U14 (model ADM485AR).Chip U8, U9, U10 or U14 finish the RS485 level outputs to the data that receive by pin on it 1 FPGA processor 3 to Transistor-Transistor Logic level conversion back serial data receiving terminal (on 145,139,214,226 pins of chip U1); Under the RS485 listen mode, serial ports message detectaphone 6 can be intercepted 4 road RS485 serial ports simultaneously.When the serial ports power communication link 13 of intercepting when needs is the RS422 communication mode, remove to intercept one tunnel external object RS422 link with two-way RS485 mouth.One road RS485 is connected on Y (TX+) that external object RS422 sends link, two lines of Z (TX-), and another road RS485 is connected on A (RX+) that RS422 receives link, two lines of B (RX-).When the serial ports power communication link 13 of intercepting when needs was the RS232 communication mode, 6 of serial ports message detectaphones received two lines of transmitting-receiving of intercepting one tunnel external object RS232 link with two-way RS232.The receiving terminal of external object RS232 link or transmitting terminal and receive chip U11 or 16 pins of U12, U13, U15 (model SP3223EEY) on, chip U11 or U12, U13, U15 finish the RS232 level after the Transistor-Transistor Logic level conversion, data that receive are outputed to the serial data receiving terminal (on 144,142,216,230 pins of chip U1) of FPGA processor 3 by 15 pins on it.
MODEM carrier signal message detectaphone 7 is as Fig. 8 and shown in Figure 9, and MODEM carrier signal message detectaphone 7 provides two road MODEM carrier wave receiving interfaces, can be used to intercept the target link (carrier wave power communication link 16) of one road MODEM communication.The two-way receiving interface of MODEM carrier signal message detectaphone 7 respectively and receive on a pair of sending and receiving line of this target link.The carrier wave analog signal outputs on modem chip U16, the U17 (model MC145503) by the 5th, the 6th isolating transformer T5, BT5 coupling carries out demodulation, after going here and there by chip U18, U19 (model 74HC299) then and changing, parallel data is delivered on single-chip microcomputer U20, the U21 (model STC89c51Rc) again and is decoded, and decoded data send FPGA processor 3 by 11 pin separately on single-chip microcomputer U20, the U21 again in Transistor-Transistor Logic level serial signal mode and carry out data processing.
The portable electric power communication protocol detector of present embodiment adopts FPGA processor 3 directly to realize data record and buffer memory at the MAC layer, and carry out exchanges data by netting twine and CPU8, three important band merits are wherein arranged, the one, intercept the total bandwidth of interface, the 2nd, the dish speed of writing of hard disk, the 3rd, netting twine bandwidth.Realize complete effective detection, intercept the total bandwidth of interface and should write dish speed that the netting twine bandwidth should be write dish speed sum greater than intercepting network interface total bandwidth and hard disk, and leaves remaining less than hard disk.The band merit of present embodiment detector design is: the interface bandwidth of each message detectaphone is 100Mbps (during network storm), then the interface total bandwidth=4 * 100Mbps=400Mbps of four message detectaphones; The dish speed of writing of now general SSD hard disk is 80MB/s-100MB/s, i.e. 640Mbps-800Mbps; The netting twine bandwidth is the gigabit bandwidth.This shows that the design bandwidth of present embodiment detector can satisfy when detecting the not demand of obliterated data.
Obviously, the scheme that the portable electric power communication protocol detector of above-mentioned present embodiment can simplify and change has: 1) switch ports themselves image signal message detectaphone 4, network signal message detectaphone 5, rs 232 serial interface signal message detectaphone 6 and 7 four message detectaphones of MODEM carrier signal message detectaphone also can only keep one of them, two or three, perhaps increase the message detectaphone of other communication modes again; 2) physical circuit of FPGA processor 3 and four message detectaphones constitutes the circuit structure that does not limit to present embodiment; 3) output of FPGA processor 3 also can be connected in series by pci bus or other connected modes and CPU8; 4) memory 21 and logging modle 22 also can be saved, and the detector of present embodiment only carries out real-time check and analysis and record not; 5) FPGA processor 3 also can be replaced by single-chip microcomputer or other parallel serial processor of changeing of a plurality of collaborative works.
The detection method of the portable electric power communication protocol detector of present embodiment as shown in figure 10, may further comprise the steps:
1) start detection instrument, the parameter by loader 9 configuration power communication link to be detected with specific stipulations are carried out related appointment and formation CONFIG.SYS,
It is the corresponding syntactic model file of specific stipulations and the semantic model file of selection and power communication link to be detected that----particular association is specified,
----syntactic analysis model file and semantic analysis model file pass through pre-if the on-the-spot loader 9 that passes through imports in the detectors,
----dispatching management module 20 is provided with according to the running parameter of CONFIG.SYS to switch ports themselves image signal message detectaphone 4, network signal message detectaphone 5, rs 232 serial interface signal message detectaphone 6 and 7 four message detectaphones of MODEM carrier signal message detectaphone and FPGA processor 3;
2) analytical system is carried out initialization, and promptly CPU8 at first loads dispatching management module 20, nework analysis module 18 and acquisition module 17, logging modle 22 and statistical analysis module 23, and dispatching management module 20 reloads protocol analysis module 19 according to CONFIG.SYS,
----protocol analysis module 19 is to form the syntax and semantics environment of specific stipulations and these specific stipulations are carried out the general module that syntax and semantics is analyzed by syntactic model file and semantic model file, be that analytical system inside has only a protocol analysis module, different stipulations identify by syntactic model file and semantic model file
----load networks analysis module 18 is, generation is at protocol layer, syntax analyzer, session channel manager, the semantic analyzer of OSI (Open SystemInterconnection Open System Interconnection) model, subsequently protocol layer is organized as protocol stack,, be each session channel manager configuration semantic analyzer then then for each protocol layer is equipped with corresponding syntax analyzer and session channel manager
----loads protocol analysis module 19 is that syntactic model file and semantic model file according to appointment in the CONFIG.SYS carries out initialization, promptly generate protocol layer, syntax analyzer, session channel manager, semantic analyzer at specific stipulations, subsequently protocol layer is organized as protocol stack,, be each session channel manager configuration semantic analyzer then then for each protocol layer is equipped with corresponding syntax analyzer and session channel manager;
3) switch ports themselves image signal message detectaphone 4, network signal message detectaphone 5, rs 232 serial interface signal message detectaphone 6 and 7 four message detectaphones of MODEM carrier signal message detectaphone are intercepted the message of power communication link by the power communication link, wherein rs 232 serial interface signal message detectaphone 6 and MODEM carrier signal message detectaphone 7 (non-Ethernet power communication link packet detectaphone) at first produce a frame Ethernet UDP message, then with the message of intercepting application layer as the UDP message, next the Ethernet message that will directly intercept of four message detectaphones is passed in parallel to FPGA processor 3, the message joining day that 3 pairs of parallel receives of FPGA processor come stabs, and the message after will stabbing the joining day carries out buffer memory, and the message that four message detectaphones transmit carries out buffer memory respectively;
4) acquisition module 17 reads the message of buffer memory from FPGA processor 3, and this message sent into nework analysis module 18, acquisition module 17 is sent this message into recording module 22 after this message is finished analysis, logging modle 22 is sent to this message memory 21 storages again;
5) nework analysis module 18 carries out net grammar and the semantic analysis application layer until this message according to osi model protocal layers syntax and semantics to the message of sending into nework analysis module, and the message of application layer is sent into the protocol analysis module,
----net grammar and semantic analysis are, upwards use syntax analyzer that the message of sending into nework analysis module 18 is carried out syntactic analysis at each protocol layer successively from the bottom of protocol stack, and the parse tree that obtains passed to session manager, by session manager the semantic analyzer that parse tree is distributed to session manager reception and transmission two ends is carried out semantic analysis, syntax analyzer and semantic analyzer will remain the last layer transmission to protocol stack of the message of application layer and semantic analysis result respectively, carry out said process once more by last layer, up to the application layer that arrives protocol stack, when the top of protocol stack or end of message) obtain network analysis result to the message of sending into nework analysis module 18
----sent the application layer message into protocol analysis module 19 and carried out protocol analysis, the network analysis result sent into statistical analysis module 23 add up and show;
6) protocol analysis module 19 is carried out the analysis of stipulations syntax and semantics according to the syntax and semantics of stipulations to the message of application layer,
The analysis of----stipulations syntax and semantics is, upwards use syntax analyzer to carry out syntactic analysis at each protocol layer to the message of application layer successively from the bottom of protocol stack, and the parse tree that obtains passed to session manager, by session manager the semantic analyzer that parse tree is distributed to session manager reception and transmission two ends is carried out semantic analysis, syntax analyzer and semantic analyzer will remain the last layer transmission to described protocol stack of the message of application layer and semantic analysis result respectively, carry out said process once more by last layer, when top that arrives protocol stack or end of message, obtain the protocol analysis result of application layer message, and the protocol analysis result is sent to statistical analysis module adds up and show
7) nework analysis module 18 and protocol analysis module 19 will analysis result be separately given statistical analysis module 23 and carried out statistical analysis, the value that is about to the part message structure in the analysis result extracts makes chart, the value that will extract behind at least two frame messages is carried out computing and relatively and form statistics, again statistics is sent to display interface.
Embodiment two
The portable electric power communication protocol detector of present embodiment and embodiment one are basic identical, and different is that FPGA processor 3 is replaced by the single-chip microcomputer of a plurality of collaborative works.
The detection method of present embodiment and embodiment one are slightly different, and different is except that same steps as:
1, the 1st) appointment of the particular association in the step is the corresponding protocol analysis module 19 of specific stipulations of selection and power communication link to be detected;
2, the 2nd) the protocol analysis module 19 in the step is to form the syntax and semantics environment of specific stipulations and the non-general module that specific stipulations is carried out grammer and semantic analysis by programming, be that analytical system inside has a plurality of protocol analysis modules, different stipulations are identified by different protocol analysis modules
3, the 2nd) step in loading protocol analysis module 19 be according to appointment in the CONFIG.SYS with the corresponding protocol analysis module of specific stipulations;
4, the 6th) the stipulations syntax and semantics analysis in the step is, the message of application layer forms the unit message structure according to the bit position of byte, bit bit combination, byte or the combination of bytes of byte, the unit message structure is combined into compound message structure again then, again relation between each message structure is carried out syntactic analysis and formed the syntactic analysis result, from the syntactic analysis result, extract with the value of context environmental association message structure then and carry out semantic analysis and form semantic analysis result, obtain the analysis result of application layer message.
The detection method of the various embodiments described above portable electric power communication protocol detector had both gone for the online in real time analysis, also went for the analysis behind the off-line.When carrying out online in real time when analyzing,, therefore can find the very first time and fastly find out message failure cause and place by protocol analysis because the message that transmits from FPGA processor 3 directly analyzes; Simultaneously because message is to carry out storage again behind the real-time protocol analysis through protocol analysis module 19 earlier, therefore, even when memory rate is slow and the lost part message can not influence yet and find and analyze the message fault.
In a word, according to the various embodiments described above portable electric power communication protocol detector and detection method thereof, can have no to omit the detection on ground to the message of existing various power communication links, thereby can really detect all issuable message fault and reason and places effectively, and then provide safeguard in time getting rid of the electric power facility fault.
Portable electric power communication protocol detector of the present invention and detection method thereof are not limited to the described concrete technical scheme of the foregoing description, such as 1) the stipulations syntax and semantics analysis of protocol analysis module also can be that all possible message combination of stipulations and all possible context environmental are enumerated, message compared with message combination of being enumerated and context environmental carry out the syntax and semantics analysis then; 2) also can will analyze again after the message storage; 3) message of non-Ethernet power communication link packet detectaphone (rs 232 serial interface signal message detectaphone 6 and MODEM carrier signal message detectaphone 7) can be not networked yet; Or the like.All employings are equal to the technical scheme of replacing formation and are the protection range that the present invention requires.