CN112583765B - GOOSE and SV communication system and message analysis method thereof - Google Patents

GOOSE and SV communication system and message analysis method thereof Download PDF

Info

Publication number
CN112583765B
CN112583765B CN201910933582.1A CN201910933582A CN112583765B CN 112583765 B CN112583765 B CN 112583765B CN 201910933582 A CN201910933582 A CN 201910933582A CN 112583765 B CN112583765 B CN 112583765B
Authority
CN
China
Prior art keywords
state
message
data
field
parsing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910933582.1A
Other languages
Chinese (zh)
Other versions
CN112583765A (en
Inventor
刘志明
刘亚永
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Etechwin Electric Co Ltd
Original Assignee
Beijing Etechwin Electric Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Etechwin Electric Co Ltd filed Critical Beijing Etechwin Electric Co Ltd
Priority to CN201910933582.1A priority Critical patent/CN112583765B/en
Publication of CN112583765A publication Critical patent/CN112583765A/en
Application granted granted Critical
Publication of CN112583765B publication Critical patent/CN112583765B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/06Notations for structuring of protocol data, e.g. abstract syntax notation one [ASN.1]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/26Special purpose or proprietary protocols or architectures

Abstract

A GOOSE and SV communication system and a message parsing method thereof are provided. The GOOSE and SV communication system includes a packet generation device and a packet analysis device, and the packet analysis device includes: the network interface unit is used for receiving message data from the message generation device and sending an operation instruction to the message generation device; a parsing unit to abstract a process of field-by-field parsing a plurality of fields of the packet data into a Finite State Machine (FSM) by using a Hardware Description Language (HDL), and determine whether to generate an operation instruction based on a state flag of each state of the FSM, wherein each state of the FSM is related to parsing of a corresponding field of the plurality of fields of the packet data, and the state flag of each state is related to a result of parsing of the corresponding field.

Description

GOOSE and SV communication system and message analysis method thereof
Technical Field
The present disclosure relates generally to the field of power communication technologies, and in particular, to a GOOSE and SV communication system and a message parsing method thereof.
Background
In the prior art, a Generic Object Oriented Substation Event (GOOSE) frame protocol and a Sampled Value (SV) frame protocol may be used to transmit important real-time signals between Intelligent End Devices (IEDs) in an intelligent substation. For the quick analysis of SV/GOOSE messages sent by IEDs, extracting key decision information becomes the key of quick response of the intelligent substation.
The traditional research is mainly based on a CPU, and SV/GOOSE frame protocol analysis is realized by adopting a C/C + + and other sequential execution languages, but whether the messages are subscribed or not can be judged after the analysis is finished, so that the real-time property of SV/GOOSE message processing is reduced, and particularly when SV/GOOSE messages sent by a plurality of IEDs need to be analyzed.
The other technical route adopts the steps of decoding SV/GOOSE messages, generating a check code by utilizing ASN.1 (abstract syntax notation format) of an Application Protocol Data Unit (APDU) in the messages, comparing the check code with the check code of the corresponding part of the SV/GOOSE messages sent last time, directly referencing APDU data extracted from the decoded information last time if the check codes of the two are the same, and not needing to repeat decoding; and if the two are not consistent, decoding APDU part data of the SV/GOOSE message, and then extracting the APDU data. Although the method judges before decoding the SV/GOOSE message and reduces the burden of system decoding, aiming at the situation that the SV/GOOSE message is inconsistent, because the method generates the check code and then analyzes the SV/GOOSE message, an effective check code can be generated only when all data of the SV/GOOSE message are received, and the real-time property of SV/GOOSE message analysis is actually poor.
Therefore, a GOOSE and SV communication system and method capable of effectively improving the real-time performance and reliability of SV/GOOSE message parsing are needed.
Disclosure of Invention
In order to solve at least the above problems in the prior art, the present application provides a GOOSE and SV communication system and method implemented by using a programmable logic device.
According to an aspect of the present invention, a GOOSE and SV communication system is provided, where the GOOSE and SV communication system includes a packet generating device and a packet parsing device, and the packet parsing device includes: the network interface unit is used for receiving message data from the message generation device and sending an operation instruction to the message generation device; a parsing unit configured to abstract a process of field-by-field parsing of a plurality of fields of the packet data to a Finite State Machine (FSM) by using a Hardware Description Language (HDL), and determine whether to generate an operation instruction based on a state flag of each state of the FSM, wherein each state of the FSM is related to parsing of a corresponding field of the plurality of fields of the packet data, and the state flag of each state is related to a result of parsing of the corresponding field.
The message parsing apparatus may further include: the message generating device comprises a storage unit and a message generating unit, wherein the storage unit is used for storing characteristic information parameters related to the message generating device, and the characteristic information parameters comprise at least one of the following parameters: MAC destination address, MAC source address, VLAN, application identifier APPID and APDU related parameter of message generating device.
The FSM may include the following states:
a1: a start state for preparing parsing for the message data and transitioning to an a2 state after receiving the message data;
a2: the MAC destination address field detection state is used for determining whether the MAC destination address analyzed from the MAC destination address field in the received message data is consistent with the address of the message processing device or not, and setting a state mark aiming at the MAC destination address as a first value and transferring to the a3 state under the condition that the analyzed MAC destination address is consistent with the address of the message processing device, otherwise, setting the state mark aiming at the MAC destination address as a second value and transferring to the a3 state;
a3: the MAC source address field detection state is used for determining whether the MAC source address analyzed from the MAC source address field in the received message data is consistent with the MAC source address stored in the storage unit or not, and setting a state mark aiming at the MAC source address to be a first value and transferring to an a4 state under the condition that the analyzed MAC source address is consistent with the MAC source address stored in the storage unit, otherwise, setting the state mark aiming at the MAC source address to be a second value and transferring to the a4 state;
a4: a tag information detection state, configured to detect whether a VLAN option exists after an MAC source address field in received message data, and enter an a5 state after the detection is completed;
a5: the Ethernet type field detection state is used for determining the Ethernet type of the received message data from the Ethernet type field of the received message data, and setting a state flag for the Ethernet type to be a first value and transferring to an a6 state if the Ethernet type is a predetermined type, otherwise, setting the state flag for the Ethernet type to be a second value and transferring to the a6 state;
a6: the APPID field detection state is used for identifying a specific message from an APPID field of received message data, and setting a state flag aiming at the APPID to be a first value and transferring to an a7 state when the specific message is identified, otherwise, setting the state flag aiming at the APPID to be a second value and transferring to the a7 state;
a7: an analysis state, configured to perform data analysis on APDU related data in the received message data, and enter an a8 state after the analysis is completed;
a8: and a waiting state for returning to the a1 state after waiting for a preset fixed time.
The parsing unit may be configured to: determining the state mark of each state of the FSM and analyzing the data of a predetermined part in an Application Protocol Data Unit (APDU) in the received message data to obtain message state data; and when all the state flags of the FSM are preset values which indicate that preset conditions for all the states are met, analyzing the data of the rest part in the APDU to generate the operation instruction based on the indication result of the message state data.
The message status data may include at least one of the following: the method comprises the steps of simulating the analog quantity of the transformer substation, switching quantity of the transformer substation, message displacement information, message frame loss information, message misordering information and message repetition information.
According to another aspect of the present invention, there is provided a message parsing method for a GOOSE and SV communication system, where the message parsing method includes: receiving message data; a Finite State Machine (FSM) for abstracting a process of field-by-field parsing a plurality of fields of the message data by using a Hardware Description Language (HDL), and determining whether to generate an operation instruction based on a state flag of each state of the FSM, wherein each state of the FSM is related to parsing of a corresponding field of the plurality of fields of the message data, and the state flag of each state is related to a parsing result of the corresponding field; and transmitting the generated operation instruction.
Characteristic information parameters related to a message generating device sending message data may be pre-stored in the GOOSE and SV communication system, wherein the characteristic information parameters may include at least one of the following parameters: MAC destination address, MAC source address, VLAN, application identifier APPID and APDU related parameter of message generating device.
The FSM may include the following states:
a1: an initial state for preparing for parsing of the message data and transitioning to an a2 state after receiving the message data;
a2: the MAC destination address field detection state is used for determining whether the MAC destination address analyzed from the MAC destination address field in the received message data is consistent with the address of the message processing device or not, and setting a state mark aiming at the MAC destination address as a first value and transferring to the a3 state under the condition that the analyzed MAC destination address is consistent with the address of the message processing device, otherwise, setting the state mark aiming at the MAC destination address as a second value and transferring to the a3 state;
a3: the MAC source address field detection state is used for determining whether the MAC source address analyzed from the MAC source address field in the received message data is consistent with the MAC source address stored in the storage unit or not, and setting a state mark aiming at the MAC source address to be a first value and transferring to an a4 state under the condition that the analyzed MAC source address is consistent with the MAC source address stored in the storage unit, otherwise, setting the state mark aiming at the MAC source address to be a second value and transferring to the a4 state;
a4: a tag information detection state, configured to detect whether a VLAN option exists after an MAC source address field in received message data, and enter an a5 state after the detection is completed;
a5: the Ethernet type field detection state is used for determining the Ethernet type of the received message data from the Ethernet type field of the received message data, and setting a state flag for the Ethernet type to be a first value and transferring to an a6 state if the Ethernet type is a predetermined type, otherwise, setting the state flag for the Ethernet type to be a second value and transferring to the a6 state;
a6: the APPID field detection state is used for identifying a specific message from an APPID field of received message data, and setting a state flag aiming at the APPID to be a first value and transferring to an a7 state when the specific message is identified, otherwise, setting the state flag aiming at the APPID to be a second value and transferring to the a7 state;
a7: an analysis state, configured to perform data analysis on APDU related data in the received message data, and enter an a8 state after the analysis is completed;
a8: and a waiting state for returning to the a1 state after waiting for a preset fixed time.
The step of determining whether to generate the operation instruction may include: determining a state flag of each state of the FSM and parsing a predetermined portion of data in an application protocol data unit, APDU, in the received message data to obtain message state data, and when all the state flags of the FSM are predetermined values indicating that predetermined conditions for the respective states are satisfied, parsing the remaining portion of data in the APDU based on an indication result of the message state data to generate the operation instruction.
The message status data may include at least one of the following: the method comprises the steps of analog quantity of a transformer substation, switching quantity of the transformer substation, message displacement information, message frame loss information, message missequence information and message repetition information.
According to another aspect of the present invention, there is provided a computer-readable storage medium storing a computer program, wherein the computer program comprises instructions for executing the message parsing method as described above.
According to another aspect of the present invention, there is provided a computer device comprising a readable medium storing a computer program, wherein the computer program comprises instructions for executing the message parsing method as described above.
Advantageous effects
By applying the GOOSE and SV communication system and method, a Hardware Description Language (HDL) can be used for abstracting a field-by-field analysis process of SV/GOOSE message data into a Finite State Machine (FSM), so that the real-time performance and the reliability of the message analysis process are improved.
Additional aspects and/or advantages of the present general inventive concept will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the general inventive concept.
Drawings
The above and/or other aspects of the exemplary embodiments will be described below with reference to the accompanying drawings, in which:
fig. 1 is a schematic block diagram illustrating a GOOSE and SV communication system according to an exemplary embodiment of the present invention.
Fig. 2 and 3 are block diagrams illustrating examples of GOOSE and SV communication systems according to exemplary embodiments of the present invention.
Fig. 4 is a state diagram illustrating a Finite State Machine (FSM) according to an exemplary embodiment of the present invention.
Fig. 5 is a diagram showing an ethernet frame structure including message data.
Fig. 6 is a diagram illustrating a composition of an application protocol data unit GOOSE-PDU in GOOSE message data.
Fig. 7 is a diagram showing a configuration of an application protocol data unit sav-Pdu in SV packet data.
Fig. 8 and 9 are diagrams illustrating asn.1 coding rules.
Fig. 10 is a diagram showing the composition of the Tag field in the asn.1 coding rule.
FIG. 11 shows the meaning of the original type bit of the Tag field shown in FIG. 10.
Fig. 12 is a flowchart illustrating a message parsing method according to an exemplary embodiment of the present invention.
The present invention will hereinafter be described in detail in conjunction with the appended drawings, wherein like elements are designated by like reference numerals throughout.
Detailed Description
The following description is provided with reference to the accompanying drawings to assist in a comprehensive understanding of exemplary embodiments of the invention as defined by the claims and their equivalents. The description includes various specific details to aid understanding, but these details are to be regarded as illustrative only. Thus, one of ordinary skill in the art will recognize that: various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Moreover, descriptions of well-known functions and constructions may be omitted for clarity and conciseness.
Fig. 1 is a schematic block diagram illustrating a GOOSE and SV communication system 100 in accordance with an exemplary embodiment of the present invention.
Referring to fig. 1, a GOOSE and SV communication system 100 according to an exemplary embodiment of the present invention includes a message generating apparatus 110 and a message parsing apparatus 120.
In an exemplary embodiment of the present invention, the message generating device 110 may be an Intelligent Electronic Device (IED) installed in a device in the power grid (e.g., an intelligent substation in the power grid), and generates message data by collecting relevant data and information of the device. The message parsing device 120 may be a device (e.g., a board or a software function) that receives the message data and parses the message data. Both the message parsing device 120 and the message generating device 110 may be implemented in the same equipment (e.g., the same substation), or both the message generating device 110 and the message parsing device 120 may be implemented in the IED, so that transmission and parsing of real-time message data may be implemented between the equipment or the IED in the power grid.
In an exemplary embodiment of the present invention, the message data may be message data using SV frame protocol or GOOSE frame protocol, that is, SV message data or GOOSE message data.
Further, in the exemplary embodiment of the present invention, the message parsing device 120 may be a ZYNQ-based parsing device (e.g., a message parsing device using Xilinx ZYNQ-7000 SoC), merely as an example. However, it should be understood that the present application is not limited thereto, and the message parsing device 120 may also be implemented by other devices that can use the SV/GOOSE frame protocol.
Hereinafter, for convenience of description, the message parsing apparatus 120 will be described by using a ZYNQ-based parsing apparatus as an example.
The configuration of the message parsing apparatus 120 will be described in detail below with reference to fig. 2 and 3.
Fig. 2 and 3 are block diagrams illustrating an example of a GOOSE and SV communication system 100 in accordance with an exemplary embodiment of the present invention.
As shown in fig. 2, in the GOOSE and SV communication system 100, the message parsing apparatus 120 may include a network interface unit 121 and a parsing unit 122.
The network interface unit 121 may receive message data from the message generating device 110.
The parsing unit 122 may abstract a process of field-by-field parsing a plurality of fields of received message data into a Finite State Machine (FSM) by using a Hardware Description Language (HDL), and determine whether to generate an operation instruction (e.g., an interrupt instruction) based on a state flag of each state of the FSM. In an exemplary embodiment of the invention, each state of the FSM is associated with a resolution of a corresponding field of a plurality of fields of the message data, and a state flag of the each state is associated with a resolution result of the corresponding field.
More specifically, in the exemplary embodiment of the present invention, the parsing unit 122 may determine a state flag of each state of the FSM and parse a predetermined portion of data in the APDU-related data in the received message data to obtain the message state data, and then may parse the remaining portion of data in the APDU-related data to generate the operation instruction based on an indication result of the message state data when all the state flags of the FSM are predetermined values indicating that predetermined conditions for respective states are satisfied.
Furthermore, although not shown in the drawings, the message parsing device 120 according to the exemplary embodiment of the present invention may further include a storage unit (not shown) to store one or more characteristic information parameters related to various message generation devices, for example, MAC destination addresses, MAC source addresses, virtual Local Area Networks (VLANs), application identifiers (APPIDs) of the message generation devices, and APDU-related parameters (for example, parameters such as the length and value of go-ID, the length and value of dat-Set, the length of all Data, and confRev in GOOSE-PDU (i.e., APDU for GOOSE frame protocol)), so that the parsing unit 122 may perform a parsing operation using these parameters. The parsing operation of the parsing unit 122 will be described in more detail later based on fig. 4 and 5.
When the parsing unit 122 generates an operation instruction, the network interface unit 121 may also transmit the operation instruction to the message generation apparatus 110 as feedback to the received message data. In an exemplary embodiment of the present invention, the operation instruction may also be transmitted in the form of message data.
In an exemplary embodiment of the present invention, the parsing unit 122 may be implemented using a ZYNQ-based device.
Further, in the example of fig. 2, the communication between the message generating device 110 and the message parsing device 120 may be performed using ordinary electrical interface network cable communication. However, when the communication between the message generating device 110 and the message analyzing device 120 is performed using the optical fiber communication method, as shown in fig. 3, a photoelectric conversion device 130 may also be provided between the message generating device 110 and the message analyzing device 120.
Fig. 4 is a state diagram illustrating a Finite State Machine (FSM) according to an exemplary embodiment of the present invention. Fig. 5 is a diagram showing an ethernet frame structure including message data.
In an exemplary embodiment of the present invention, the message data may be transmitted using ethernet data frames, and therefore, before starting the description of the FSM, the various fields in the ethernet data frame structure including the message data according to an exemplary embodiment of the present invention will be explained in detail with reference to fig. 5.
As shown in fig. 5, the 1 st field of the frame structure is a frame header field, has a length of 8 bytes, and includes a preamble of 7 bytes and a frame delimiter of 1 byte.
The 2 nd field of the frame structure is a MAC address field, including a MAC destination address field (6 bytes in length) and a MAC source address field (6 bytes in length).
The 3 rd field of the frame structure is a VLAN field, and the length is 4 bytes, which is an option.
The 4 th field of the frame structure is an ethernet type field, has a length of 2 bytes, and has a fixed value of 0 × 88 _b8for GOOSE packet data and 0 × 88 _bafor SV packet data.
The 5 th field of the frame structure is an APDU header and comprises an APPID field, a length field, a reserved bit 1 field and a reserved bit 2 field. The APPID field is used to identify a specific packet, and has a length of 2 bytes. The length field is 2 bytes in length and indicates the message length from the beginning of the APPID to the front of the frame check sequence. The reserved bit 1 field and the reserved bit 2 field are both 2 bytes in length.
The 6 th field of the frame structure is an APDU field (GOOSE-PDU or sav-PDU (i.e. APDU for SV frame protocol)) having a length of less than 1492 bytes.
The 7 th field of the frame structure is a frame check sequence field with the length of 4 bytes.
Referring back to fig. 4, parsing unit 122 may abstract the process of field-by-field parsing of multiple fields of received message data into an FSM having the following states using the HDL:
a1: a start state for preparing parsing for the message data and transitioning to the a2 state after receiving the message data.
a2: the MAC destination address field detects a status for determining whether a MAC destination address parsed from the MAC destination address field in the received packet data coincides with an address of the packet parsing device 120, and sets a status flag for the MAC destination address to a first value (e.g., a value "1") and transfers to the a3 state if the parsed MAC destination address coincides with the address of the packet parsing device 120, and otherwise sets the status flag for the MAC destination address to a second value (e.g., a value "0") and transfers to the a3 state.
a3: the MAC source address field detects a status for determining whether a MAC source address parsed from the MAC source address field in the received message data coincides with a MAC source address stored in a storage unit (not shown) to determine a signal source, and sets a status flag for the MAC source address to a first value (for example, a value "1") and transfers to an a4 state if the parsed MAC source address coincides with the MAC source address stored in the storage unit (not shown), and otherwise sets the status flag for the MAC source address to a second value (for example, a value "0") and transfers to the a4 state.
a4: tag (Tag) information detection state for detecting whether VLAN option exists after MAC source address field and entering a5 state after detection is completed.
Specifically, in the exemplary embodiment of the present invention, as shown in fig. 5, a VLAN field of 4 bytes following the MAC source address field is generally optional, and the VLAN field includes two parts: a TPID field and a TCI field, wherein the value of the TPID field is a fixed value of 0x81_00. Whether a VLAN option exists can be judged by detecting the value of a TPID field, if the field after the MAC source address is consistent with the value of the TPID field, the VLAN option exists is determined, but the decoding of a receiving end by information which is carried by VLAN selection and is related to priority and a virtual local area network has no significance, so that 4 bytes can be skipped over and the state of a5 is entered; if the value of the field after the MAC source address is inconsistent with the value of the TPID field, the VLAN option is determined to be absent, and the state a5 can be directly entered.
a5: the ethertype field detects a status for determining an ethertype of the received message data from the ethertype field of the received message data, and sets a status flag for the ethertype to a first value (e.g., a value of "1") and transitions to the a6 state if the ethertype is a predetermined type, or sets a status flag for the ethertype to a second value (e.g., a value of "0") and transitions to the a6 state otherwise.
Specifically, in the exemplary embodiment of the present invention, if the value indicating the ethernet type of two bytes is identical to 0x88_b8, it may be determined that the received message data is GOOSE message data; if the value indicating the Ethernet type is consistent with 0x88_BA, the received message data can be determined to be SV message data; if the value indicating the Ethernet type is other values, the received message data can be determined to be an invalid message.
Thus, in an exemplary embodiment of the present invention, when GOOSE and SV communication system 100 uses GOOSE framing protocol, the status flag for the ethernet type may be set to a first value (e.g., value "1") upon receipt of GOOSE message data, and otherwise to a second value (e.g., value "0").
Furthermore, according to another embodiment of the present invention, when the GOOSE and SV communication system 100 uses the SV frame protocol, the status flag for the ethernet type may be set to a first value (e.g., value "1") upon receiving SV packet data, and otherwise to a second value (e.g., value "0").
a6: the APPID field detects a status for identifying a specific packet from the APPID field of the received packet data, and sets a status flag for the APPID to a first value (e.g., value "1") and transfers to the a7 state when the specific packet is identified, and otherwise sets a status flag for the APPID to a second value (e.g., value "0") and transfers to the a7 state.
Specifically, the APPID identifier may be used to identify specific packet data, and may pre-allocate a value range to the APPID to identify different types of packets. For example, when the IEC61850 protocol is used, the APPID value range that can be allocated for GOOSE message data is 0x0000 to 0x3FFF, the APPID value range that can be allocated for SV message data is 0x4000 to 0x7FFF, and the APPID value of each SV/GOOSE control block can be unique all over the station. In this case, if the value of the APPID is consistent with the preconfigured value in the system configuration file, the specific message data can be identified.
a7: and the analysis state is used for carrying out data analysis on the APDU related data in the received message data, and entering an a8 state after the analysis is completed.
More specifically, in the parsing state, the length of all bytes from APPID to APDU end shown in fig. 5 (i.e. the length of five fields of "APPID + length + reserved bit 1+ reserved bit 2+ APDU") may be parsed first, then reserved bit 1 and reserved bit 2 (both values are typically 0 × 00 \u00) shown in fig. 5 may be parsed, and finally the APDU portion encoded with asn.1 in the message data may be parsed.
a8: and a waiting state for returning to the a1 state after waiting for a preset fixed time.
For example only, in the parsing of the APDU, when the parsing unit 122 is a ZYNQ-based parsing device, the parsing unit 122 may include a PL (programmable logic module) parsing module (not shown) and a PS (software processing module) parsing module (not shown). A PL parsing module (not shown) may be used to determine the state flag for each state of the FSM and parse a predetermined portion of the data in the APDU to obtain message state data. A PS module (not shown) may parse the data of the remaining part in the APDU based on the indication result of the message status data to generate the operation instruction when all the status flags of the FSM are predetermined values (e.g., the first values illustrated with reference to fig. 4) indicating that predetermined conditions for respective states are satisfied. That is, the processes of the a1 to a6 and a8 states of the FSMs may be implemented in a PL parsing module (not shown), and the parsing process of the a7 state of the FSM may be implemented by both a PS parsing module (not shown) and a PL parsing module (not shown).
In an exemplary embodiment of the present invention, the message status data may include at least one of the following data collected by the message generating device 110: for example, the analog quantity of the substation, the switching quantity of the substation, message displacement information, message frame loss information, message misordering information, and message repetition information. In an exemplary embodiment of the present invention, the SV message may contain an analog quantity, and the GOOSE message may contain a switching quantity. In addition, the message displacement information can indicate whether event change occurs in the substation, which is the embodiment of the real-time property of the message data. The message frame loss information, the message error sequence information and the message repetition information can indicate whether errors occur in the message data, which is the embodiment of the reliability of the message data.
The detailed operation of the PL parsing module (not shown) and the PS parsing module (not shown) is described below in conjunction with fig. 6 and 7.
Fig. 6 is a diagram illustrating a composition of GOOSE-PDU, which is an application protocol data unit in GOOSE message data. The GOOSE-PDU of fig. 6 is defined by the asn.1 syntax rules, and its specific field meanings are as follows:
the first field is the Tag (Tag) value of GOOSE-PDU, length 1 byte;
the second field is the Length (Length) value of GOOSE-PDU, and there are two options: namely, a 1-byte format and a long format of 2 bytes or more;
the third field is the content (Value) Value of GOOSE-PDU, which is composed of the following 12 fields: GOOSE control block reference (gocbRef), time allowed Live (time allowed Live), GOOSE dataset reference (Dat Set), GOOSE packet identifier (go ID), event timestamp (t), state sequence number (stNum), sequence number (SqNum), overhaul identifier (test), configuration version number (confRev), configuration requirement (ndsCom), dataset entry (num Dat Entries), and Data (all Data).
In an exemplary embodiment of the present invention, when the GOOSE and SV communication system 100 uses the GOOSE frame protocol, in the parsing state of a7, the PL parsing module (not shown) may parse a portion of the GOOSE-PDU except for the Data (all Data) field to obtain the message status Data, and the PS parsing module (not shown) may determine to parse the Data of the Data (all Data) field in the GOOSE-PDU to generate a corresponding operation command when all status flags of the FSM are predetermined values (e.g., the first values illustrated with reference to fig. 4) indicating that predetermined conditions for respective states are satisfied and the message status Data indicate that the received message Data is different from the message Data of the previous frame (i.e., shift) and no error occurs, and otherwise, generate no operation command.
More specifically, for GOOSE packet data, GOOSE displacement packets, i.e. event changes, can be analyzed through StNum and SqNum, which is an embodiment of real-time GOOSE packets. In addition, whether the GOOSE message data is lost, has error sequence, has repetition or not can be analyzed through StNum and SqNum, and the specific principle is as follows: stNum is a state sequence number for recording total number of shifts of the GOOSE data, and the value of StNum is added with 1 every time the value of a member of the GOOSE data set changes. Sqnum is a sequence number and is used for recording the number of frames of the message sent under the steady state condition, the value of Sqnum is added with 1 when the message generating device sends a GOOSE message of one frame, when GOOSE data is displaced, the value returns to 0, and the counting is started again from the beginning. Therefore, the information of GOOSE data displacement, frame loss, error sequence, repetition and the like can be judged through StNum and SqNum.
Fig. 7 is a diagram showing a configuration of an application protocol data unit sav-Pdu in SV packet data. The sav-Pdu of fig. 7 is defined by asn.1 syntax rules, and the specific field meanings are as follows:
the first field 0x60 is the Tag (Tag) value of sav-Pdu, 1 byte in length;
the second field is the Length (Length) value of sav-Pdu, and there are two choices for the value: a 1-byte format and a long format of 2 bytes or more;
the noasd indicates the number of ASDUs (i.e., application service data units) included in the sav-Pdu.
Furthermore, for each ASDU for SV packet data, it contains the following information:
svID, representing a sample value identifier;
smpCnt, representing a sampling counter;
confRev, representing a configuration version number;
smpSynch, boolean quantity, which represents whether the sampling value is synchronous with the clock signal;
sequence of Data, data sequences such as device current, voltage values collected by an IED (intelligent electronic device).
In an exemplary embodiment of the present invention, when the GOOSE and SV communication system 100 uses the SV frame protocol, in the parsing state of a7, a PL parsing module (not shown) may parse a portion of the sav-Pdu except for a field indicating an analog quantity (i.e., the ASDU1 portion) to obtain message state data, and a PS parsing module (not shown) may determine to parse data of the field indicating the analog quantity in the sav-Pdu to generate a corresponding operation instruction when all state flags of the FSM are predetermined values (e.g., first values illustrated with reference to fig. 4) indicating that predetermined conditions for respective states are satisfied and the message state data indicate that an error does not occur, and otherwise, not generate an operation instruction.
Also, for SV message data. The smpCnt parameter can be adopted to judge the message state data of SV message data, such as frame loss, error sequence, repetition and the like.
The GOOSE-PDU shown in fig. 6 and the structure of the sav-PDU shown in fig. 7 are known to those skilled in the art, and thus will not be further described for brevity.
Fig. 8 and 9 are diagrams illustrating asn.1 coding rules. Fig. 10 is a diagram showing the composition of the Tag field in the asn.1 coding rule. FIG. 11 shows the meaning of the original type bit of the Tag field shown in FIG. 10.
Referring to fig. 8 to 11, the encoding rule of asn.1 encoding follows the format of Tag (Tag), length (Length), value (Value), abbreviated TLV.
As shown in fig. 8. Each field of the TLVs is a series of octets in which the V (i.e., value) fields can nest the TLVs for a combined structure, e.g., a three-level nesting of TLVs as shown in fig. 9.
The Tag field is eight bits, each bit is specifically represented as shown in fig. 10, and bits 4 to 0 are original type bits, the meaning of which is shown in fig. 11.
For the Length field, asn.1 defines two Length coding modes, i.e., short coding and long coding, according to the actual Length of coding. The most significant bit of the first byte in the Length field is 0, representing a short code, and 1 representing a long code. For short encodings, the lower 7 bits of the first byte in the Length field represent the immediate of the payload Length; for long codes, the immediate of the payload Length starts with the second byte in the Length field. The short code and the long code are explained in detail below.
<1> short code
In short codes, the payload frame length must be less than 128 bytes. For example, when encoding a payload with a payload frame length of 65 (0 x 41), the length of the encoded byte is only required to be set to 0x41, and the most significant bit can be used to determine that the encoded byte is a short code and the length is 65 bytes.
<2> Long code
In long codes, additional abstract data is defined to encode the payload length, suitable for payload frames with a payload length greater than or equal to 128 bytes. In this case, the length immediate stores the number of bytes required for the payload length, which must be encoded in big-endian format. For example, a payload frame with a payload length of 976 (0 x03D 0) bytes is encoded, and since the length of the payload frame is greater than 127, only a long encoding form can be adopted, and the actual length needs two bytes to represent, the length encoding byte bit is 0x82; the length values 0x03, 0xD0 are then stored in big-endian format, the resulting full length code being 0x8203D0.
Fig. 12 is a flowchart illustrating a message parsing method according to an exemplary embodiment of the present invention.
Referring to fig. 12, in step 1201, message data may be received by the network interface unit 121 of the message parsing device 120 from the message generation device 110. In an exemplary embodiment of the present invention, the characteristic information parameters associated with the message generating device 110 may be pre-stored in the message parsing device 120. The characteristic information parameter may include at least one of the following parameters: MAC destination address, MAC source address, VLAN, APPID, and APDU related parameters of the message generating device 110.
Then, in step 1203, a process of field-by-field parsing the plurality of fields of the packet data may be abstracted into a Finite State Machine (FSM) by using a Hardware Description Language (HDL), and it may be determined whether to generate an operation instruction based on a state flag of each state of the FSM. In an exemplary embodiment of the invention, each state of the FSM is associated with a resolution of a corresponding field of a plurality of fields of the message data, and a state flag of the each state is associated with a resolution result of the corresponding field.
More specifically, referring to fig. 4, the parsing unit 122 may determine a state flag of each state of the FSM and parse a predetermined portion of data in an APDU in the received message data to obtain message state data, and when all the state flags of the FSM are predetermined values (e.g., first values illustrated with reference to fig. 4) indicating that predetermined conditions for the respective states are satisfied, parse the remaining portion of data in the APDU based on an indication result of the message state data to generate the operation instruction. In an exemplary embodiment of the present invention, the message status data may include at least one of the following data collected by the message generating device 110: the method comprises the steps of simulating the analog quantity of the transformer substation, switching quantity of the transformer substation, message displacement information, message frame loss information, message misordering information and message repetition information.
The operation of the parsing unit 122 for parsing based on the FSM has been described above in connection with fig. 4 to 7, and thus, will not be described in detail herein for brevity.
In step S1205, the generated operation instruction (e.g., interrupt instruction) may be sent to the message generation apparatus 110 by the network interface unit 121 of the message parsing apparatus 120.
By applying the GOOSE and SV communication system and method, a Hardware Description Language (HDL) can be utilized to abstract a field-by-field analysis process of SV/GOOSE message data into a Finite State Machine (FSM), so that the real-time performance and the reliability of the message analysis process are improved.
The above-described methods and/or operations may be recorded, stored, or fixed in one or more computer-readable storage media that include program instructions to be executed by a computer to cause a processor to execute or perform the program instructions. The media may also include program instructions, data files, data structures, etc. alone or in combination with the program instructions. Examples of the computer readable storage medium include magnetic media (e.g., hard disks, floppy disks, and magnetic tape), optical media (e.g., CD ROM disks and DVDs), magneto-optical media (e.g., optical disks), and hardware devices (e.g., read Only Memories (ROMs), random Access Memories (RAMs), flash memories, etc.) specially configured to store and execute program instructions. Examples of program instructions include both machine code, such as produced by a compiler, and files containing higher level code that may be executed by the computer using an interpreter. The described hardware devices may be configured to act as one or more software elements to perform the operations and methods described above, and vice versa. Furthermore, the computer readable storage medium can be distributed over network coupled computer systems and the computer readable code or program instructions can be stored and executed in a distributed fashion.
While the present invention has been particularly shown and described with reference to exemplary embodiments thereof, it will be understood by those of ordinary skill in the art that various changes in form and details may be made therein without departing from the spirit and scope of the present invention as defined by the following claims.

Claims (10)

1. A kind of GOOSE and SV communication system, said GOOSE and SV communication system includes message generating device and message analytic device, characterized by that, the said message analytic device includes:
the network interface unit is used for receiving message data from the message generation device and sending an operation instruction to the message generation device;
a parsing unit for abstracting a process of field-by-field parsing a plurality of fields of the message data into a Finite State Machine (FSM) by using a Hardware Description Language (HDL), and determining whether to generate an operation instruction based on a state flag of each state of the FSM,
wherein each state of the FSM is associated with a resolution of a corresponding field of a plurality of fields of the message data and a state label of each state is associated with a resolution result of the corresponding field,
wherein the parsing unit is configured to:
determining a state flag for each state of the FSM and parsing a predetermined portion of data in an Application Protocol Data Unit (APDU) in the received message data to obtain message state data, an
When all the state flags of the FSM are preset values which indicate that preset conditions for all the states are met, analyzing the data of the rest part in the APDU based on the indication result of the message state data to generate the operation instruction.
2. The GOOSE and SV communication system according to claim 1, wherein the message parsing means further comprises:
a storage unit for storing characteristic information parameters related to the message generating device,
wherein the characteristic information parameter comprises at least one of the following parameters: the message generating device comprises an MAC destination address, an MAC source address, a virtual local area network VLAN, an application identifier APPID and an application protocol data unit APDU related parameter.
3. A GOOSE and SV communication system according to claim 2, wherein said FSM comprises the following states:
a1: an initial state for preparing for parsing of the message data and transitioning to an a2 state after receiving the message data;
a2: the MAC destination address field detection state is used for determining whether the MAC destination address analyzed from the MAC destination address field in the received message data is consistent with the address of the message processing device or not, and setting a state mark aiming at the MAC destination address as a first value and transferring to the a3 state under the condition that the analyzed MAC destination address is consistent with the address of the message processing device, otherwise, setting the state mark aiming at the MAC destination address as a second value and transferring to the a3 state;
a3: the MAC source address field detection state is used for determining whether the MAC source address analyzed from the MAC source address field in the received message data is consistent with the MAC source address stored in the storage unit or not, and setting a state mark aiming at the MAC source address to be a first value and transferring to an a4 state under the condition that the analyzed MAC source address is consistent with the MAC source address stored in the storage unit, otherwise, setting the state mark aiming at the MAC source address to be a second value and transferring to the a4 state;
a4: a tag information detection state, configured to detect whether a VLAN option exists after an MAC source address field in received message data, and enter an a5 state after the detection is completed;
a5: the Ethernet type field detection state is used for determining the Ethernet type of the received message data from the Ethernet type field of the received message data, and setting a state flag for the Ethernet type to be a first value and transferring to an a6 state if the Ethernet type is a predetermined type, otherwise, setting the state flag for the Ethernet type to be a second value and transferring to the a6 state;
a6: the APPID field detection state is used for identifying a specific message from the APPID field of the received message data, setting a state mark aiming at the APPID to be a first value and transferring to an a7 state when the specific message is identified, and otherwise, setting the state mark aiming at the APPID to be a second value and transferring to the a7 state;
a7: the analysis state is used for carrying out data analysis on APDU related data in the received message data and entering an a8 state after the analysis is finished;
a8: and a waiting state for returning to the a1 state after waiting for a preset fixed time.
4. A GOOSE and SV communication system according to claim 1, wherein said message status data includes at least one of:
the method comprises the steps of analog quantity of a transformer substation, switching quantity of the transformer substation, message displacement information, message frame loss information, message missequence information and message repetition information.
5. A message analysis method of a GOOSE and SV communication system is characterized by comprising the following steps:
receiving message data;
a Finite State Machine (FSM) for abstracting a process of field-by-field parsing a plurality of fields of the packet data by using a Hardware Description Language (HDL), and determining whether to generate an operation instruction based on a state flag of each state of the FSM, wherein each state of the FSM is related to parsing of a corresponding field of the plurality of fields of the packet data, and the state flag of each state is related to a result of parsing of the corresponding field; and
the generated operation instruction is transmitted to the host computer,
wherein the step of determining whether to generate an operation instruction comprises:
determining a state flag for each state of the FSM and parsing a predetermined portion of data in an Application Protocol Data Unit (APDU) in the received message data to obtain message state data, an
When all the state flags of the FSM are preset values which indicate that preset conditions for all the states are met, analyzing the data of the rest part in the APDU based on the indication result of the message state data to generate the operation instruction.
6. The message parsing method of claim 5, wherein characteristic information parameters associated with message generating devices sending message data are pre-stored in said GOOSE and SV communication system,
wherein the characteristic information parameter comprises at least one of the following parameters: the message generating device comprises an MAC destination address, an MAC source address, a virtual local area network VLAN, an application identifier APPID and an application protocol data unit APDU related parameter.
7. The message parsing method of claim 6, wherein the FSM comprises the following states:
a1: an initial state for preparing for parsing of the message data and transitioning to an a2 state after receiving the message data;
a2: the MAC destination address field detection state is used for determining whether the MAC destination address analyzed from the MAC destination address field in the received message data is consistent with the address of the message processing device or not, and setting a state mark aiming at the MAC destination address as a first value and transferring to the a3 state under the condition that the analyzed MAC destination address is consistent with the address of the message processing device, otherwise, setting the state mark aiming at the MAC destination address as a second value and transferring to the a3 state;
a3: the MAC source address field detection state is used for determining whether the MAC source address analyzed from the MAC source address field in the received message data is consistent with the MAC source address stored in the storage unit or not, and setting a state mark aiming at the MAC source address to be a first value and transferring to an a4 state under the condition that the analyzed MAC source address is consistent with the MAC source address stored in the storage unit, otherwise, setting the state mark aiming at the MAC source address to be a second value and transferring to the a4 state;
a4: a tag information detection state, configured to detect whether a VLAN option exists after an MAC source address field in received message data, and enter an a5 state after the detection is completed;
a5: the Ethernet type field detection state is used for determining the Ethernet type of the received message data from the Ethernet type field of the received message data, and setting a state flag for the Ethernet type to be a first value and transferring to an a6 state if the Ethernet type is a predetermined type, otherwise, setting the state flag for the Ethernet type to be a second value and transferring to the a6 state;
a6: the APPID field detection state is used for identifying a specific message from the APPID field of the received message data, setting a state mark aiming at the APPID to be a first value and transferring to an a7 state when the specific message is identified, and otherwise, setting the state mark aiming at the APPID to be a second value and transferring to the a7 state;
a7: the analysis state is used for carrying out data analysis on APDU related data in the received message data and entering an a8 state after the analysis is finished;
a8: and a waiting state for returning to the a1 state after waiting for a preset fixed time.
8. The message parsing method of claim 5, wherein the message state data comprises at least one of the following data:
the method comprises the steps of simulating the analog quantity of the transformer substation, switching quantity of the transformer substation, message displacement information, message frame loss information, message misordering information and message repetition information.
9. A computer-readable storage medium storing a computer program, characterized in that the computer program comprises instructions for performing the method according to any of claims 5-8.
10. A computer device comprising a readable medium having a computer program stored thereon, wherein the computer program comprises instructions for performing the method of any one of claims 5-8.
CN201910933582.1A 2019-09-29 2019-09-29 GOOSE and SV communication system and message analysis method thereof Active CN112583765B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910933582.1A CN112583765B (en) 2019-09-29 2019-09-29 GOOSE and SV communication system and message analysis method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910933582.1A CN112583765B (en) 2019-09-29 2019-09-29 GOOSE and SV communication system and message analysis method thereof

Publications (2)

Publication Number Publication Date
CN112583765A CN112583765A (en) 2021-03-30
CN112583765B true CN112583765B (en) 2022-10-14

Family

ID=75111091

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910933582.1A Active CN112583765B (en) 2019-09-29 2019-09-29 GOOSE and SV communication system and message analysis method thereof

Country Status (1)

Country Link
CN (1) CN112583765B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113114706B (en) * 2021-06-15 2021-09-24 南方电网数字电网研究院有限公司 Multichannel Ethernet message processing method based on power chip
CN113572266B (en) * 2021-09-26 2022-01-25 广东电网有限责任公司中山供电局 Mother-to-difference position indicating device and mother-to-difference position indicating system
CN114257660B (en) * 2021-11-04 2024-05-07 南方电网数字电网研究院有限公司 SV and GOOSE message processing method, device, equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6081212A (en) * 1997-02-26 2000-06-27 Nec Corporation Decoder using a finite state machine in decoding an abstract syntax notation-message and an encoder for carrying out encoding operation at a high speed
CN103326471A (en) * 2013-07-11 2013-09-25 国家电网公司 Real-time analyzing method of SV (Sampling Value) message of intelligent substation
CN106161139A (en) * 2016-06-27 2016-11-23 哈尔滨工业大学 A kind of intelligent substation SV message simulation generates and detection method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6081212A (en) * 1997-02-26 2000-06-27 Nec Corporation Decoder using a finite state machine in decoding an abstract syntax notation-message and an encoder for carrying out encoding operation at a high speed
CN103326471A (en) * 2013-07-11 2013-09-25 国家电网公司 Real-time analyzing method of SV (Sampling Value) message of intelligent substation
CN106161139A (en) * 2016-06-27 2016-11-23 哈尔滨工业大学 A kind of intelligent substation SV message simulation generates and detection method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
基于FPGA的GOOSE报文解析模块设计与实现;王鑫等;《电力系统保护与控制》;20151216(第24期);第101-107页 *
面向通用对象的变电站事件(GOOSE)实时解析和预警系统;张帆等;《电力系统保护与控制》;20091201(第23期);第92-95页 *

Also Published As

Publication number Publication date
CN112583765A (en) 2021-03-30

Similar Documents

Publication Publication Date Title
CN112583765B (en) GOOSE and SV communication system and message analysis method thereof
CN112511416A (en) Rule-based data communication protocol conversion system, decoding method and encoding method
US6564265B2 (en) Apparatus for encoding and decoding data according to a protocol specification
CN111010253B (en) HIMAC frame splitting system and method based on HINOC protocol
US9064032B2 (en) Blended match mode DFA scanning
CN112822276B (en) Substation control layer communication method and system, electronic equipment and storage medium
WO2006014766A2 (en) Method and apparatus for converting network management protocol to markup language
Lopes et al. Geese: A traffic generator for performance and security evaluation of IEC 61850 networks
CN111294235A (en) Data processing method, device, gateway and readable storage medium
CN111917753B (en) Modbus TCP message analysis method based on bit field
CN105847179B (en) The method and device that Data Concurrent reports in a kind of DPI system
CN105577480A (en) Monitoring method and device of network connection performances
CN112073326B (en) Intelligent substation process layer network data flow control method
CN108009092B (en) Design method of vehicle-mounted network management general test case protocol
CN108460044B (en) Data processing method and device
Muscholl et al. Analyzing Message Sequence Charts.
WO2023051050A1 (en) Network monitoring method and apparatus, and computer storage medium
WO2009076813A1 (en) Method and device for decoding charge record
CN111929520B (en) Fault recording triggering method and device for power system
FI115350B (en) Method and apparatus for using a data structure for data compression
CN114979307A (en) Communication protocol analysis method, intelligent terminal and storage medium
KR100358156B1 (en) Converting Method of Managing Operation from service management system to Switching Command in a Integrated Network
CN110912741A (en) Intelligent label generation method and device based on reverse analysis
CN111143380A (en) IEC61968 standard-based operation management and control method
CN110829606A (en) Energy router and operation method and control device thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant