CN-121985044-A - Power communication message processing and link management system based on IEC102 protocol
Abstract
The invention discloses an IEC102 protocol-based power communication message processing and link management system, which belongs to the technical field of power communication and comprises a timer management module, a message framing module, a message transceiving module and a link state management module, wherein the timer management module is used for configuring and driving timing tasks of a first timing period, a second timing period and a third timing period which are independent of each other and have different periods, the message framing module is used for executing the timing task of the first timing period, submitting a link layer frame to a transmitting buffer area for an application layer message, the message transceiving module is used for executing the timing task of the second timing period, transmitting the framed message in the transmitting buffer area and monitoring and receiving a response message of a master station at an opposite end, and the link state management module is used for executing the timing task of the third timing period, analyzing a link layer control command and performing state transition to update a current link layer response state. The invention solves the problems of low system processing efficiency and poor instantaneity caused by the coupling of message framing, receiving and transmitting and link state management functions.
Inventors
- LIU BO
- ZHU JIEYUAN
- ZHAO HAIDONG
- WANG LILI
- LI TIANCHAO
Assignees
- 南京国电南自电网自动化有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20260122
Claims (10)
- 1. An IEC102 protocol-based power communication message processing and link management system, comprising: The timer management module is used for configuring and driving the timing tasks of a first timing period, a second timing period and a third timing period which are independent from each other and have different periods; The message framing module is coupled to the timer management module and the link state management module and is used for executing a timing task of a first timing period, carrying out link layer group framing according to an IEC102 protocol on an application layer message according to a current link layer response state provided by the link state management module, and submitting the framed message to a sending buffer area; the message transceiver module is coupled to the timer management module and the sending buffer area and is used for executing a timing task of a second timing period, sending the framed message in the sending buffer area in an asynchronous non-blocking IO mode, and simultaneously monitoring and receiving a response message of the opposite-end master station; The link state management module is coupled to the timer management module and the message receiving and transmitting module and is used for executing a timing task of a third timing period, analyzing a link layer control command in a response message of the opposite-end master station received by the message receiving and transmitting module, and driving a link connection state machine to perform state transition based on the link layer control command so as to update the current link layer response state; Wherein the first, second and third timing periods are configured to decouple the message framing module, the message transceiving module and the link state management module in time and process in parallel.
- 2. The IEC102 protocol based power communication message processing and link management system of claim 1 further comprising a log record module coupled to the timer management module, the message framing module, the message transceiving module and the link state management module for executing a timing task of a fourth timing period driven by the timer management module, collecting timing task execution data of the timer management module, the message framing module, the message transceiving module and the link state management module, and generating a trace back log with timing relationship.
- 3. The IEC102 protocol based power communication message processing and link management system of claim 2 wherein performing a link layer framing of the application layer message according to the current link layer response state provided by the link state management module and submitting the framed message to the transmit buffer comprises: judging whether the link layer is in a state allowing transmission of an application layer message according to the current link layer response state; if the link layer is in a state allowing transmission, acquiring an application layer message to be transmitted from an application layer; before the first timing period is finished, adding a link layer frame header, an address field, a control field, a frame length and a frame check sequence to the application layer message to be sent according to an IEC102 protocol link layer frame format to generate a message after framing; And submitting the framed message to a sending buffer area.
- 4. The IEC102 protocol based power communication message handling and link management system of claim 3 wherein transmitting the framed message in the transmit buffer in an asynchronous non-blocking IO manner comprises: Setting Socket connected by transmission layer as non-blocking mode; and before the second timing period is finished, acquiring the framed message from the sending buffer zone and carrying out asynchronous sending.
- 5. The IEC102 protocol based power communication message processing and link management system of claim 4 wherein monitoring and receiving the response message from the peer master station comprises: monitoring a read event of a Socket through an I/O multiplexing mechanism while asynchronously sending the framed message, and reading a response message throttling of a master station at the opposite end in a non-blocking mode; carrying out link layer frame boundary identification and recombination on the response message text stream to form a link layer response frame; performing a frame check sequence verification and a length compliance check on the link layer response frame; if the frame check sequence verification and the length compliance check pass, stripping the link layer encapsulation, extracting an application layer response message and storing the application layer response message into a receiving buffer queue, and generating a corresponding link layer confirmation response according to IEC102 protocol link rules; If the verification of the frame check sequence and the length compliance check fail, discarding the link layer response frame, and recording an abnormal log containing the error type, the frame fragment content and the time stamp through the log recording module.
- 6. The IEC102 protocol based power communication message processing and link management system of claim 5 wherein parsing the link layer control command in the response message received by the message transceiver module from the peer master station comprises: extracting a control domain from the link layer response frame; Analyzing the function code and the parameter in the control domain, and identifying the type and the content of the link layer control command issued by the opposite-end master station.
- 7. The IEC102 protocol based power communication message handling and link management system of claim 6 wherein the link connection state machine states comprise at least a link inactive state, a link active state, a data transmission enabled state and a transmission disabled state, wherein driving the link connection state machine to perform state transitions based on the link layer control commands generates and updates a current link layer response state of the system comprising: according to the type of the link layer control command, matching a predefined state transition rule; Before the third timing period is finished, the link connection state machine is changed from the current state to the target state according to the predefined state transition rule, and the output of the target state is updated to the current link layer response state of the system.
- 8. The IEC102 protocol based power communication message handling and link management system of claim 7 wherein the predefined state transition rules comprise: When the link connection state machine is in a link inactive state and receives a link activating command, the link connection state machine is transferred to a link active state; When the data transmission permission command is received in the link activation state, the data transmission permission state is transferred; When the data transmission permission state is in and a transmission prohibition command or a link reset command is received, the data transmission permission state is shifted to the transmission prohibition state; when the data transmission is in the transmission prohibition state and the permission data transmission command is received, the data transmission permission state is shifted; when in either state and a link disconnection command is received or a communication timeout occurs, a transition is made to a link inactive state.
- 9. The IEC102 protocol based power communication message handling and link management system of claim 8 wherein the first timing period has a duration less than the second timing period and the third timing period has a duration greater than the second timing period.
- 10. The IEC102 protocol based power communication message handling and link management system of claim 9 wherein the fourth timing period is longer than the third timing period.
Description
Power communication message processing and link management system based on IEC102 protocol Technical Field The invention relates to an IEC102 protocol-based power communication message processing and link management system, and belongs to the technical field of power communication. Background The IEC102 protocol is used as an electric power communication standard made by the International electrotechnical Commission, is widely applied to an electric energy metering data transmission system, and adopts a master-slave architecture to realize data interaction between a master station and a slave station. The core functions of the system comprise the transmission of the electric energy accumulation amount, event information and terminal equipment information, and service data is carried through three frame structures. The existing system is mostly realized based on an OSI seven-layer model, a data link layer controls a domain to manage a transmission sequence, and an application layer encapsulates power special data such as telemetry, remote signaling and the like through an application service data unit. In a typical scene such as substation automation and an electric energy collection system, a master station acquires real-time historical electric quantity data through mechanisms such as periodic calling and burst transmission, and the data integrity is guaranteed by means of a sliding window protocol. However, the existing architecture has the function coupling characteristic, and the framing, transceiving and link state management modules are highly integrated, for example, control domain bit flipping logic is bound with application service data unit serial number management, and the link resetting flow and the data retransmission mechanism are cross-dependent, so that the expansibility of the system is limited, and the system is difficult to adapt to new requirements such as new energy metering, electric energy quality monitoring and the like. The existing power communication system based on IEC102 protocol causes two core problems due to functional coupling, namely resource competition and processing delay caused by strong coupling of framing, transceiving and link state management modules. When the master station sends a summoning command, the control domain bit needs to be overturned along with the frame count, and the substation needs to synchronously track the state to decide retransmission or continuous transmission, so that the tight interaction of the cross modules is easy to cause data accumulation in a serial link or a high-delay network. In a low-speed scene, the problem of incomplete frame splitting frequently occurs, and when the retransmission times exceed standard suggestions, a link reset program is triggered easily, so that the system load is aggravated. The coupling of link state management with data transmission limits the timely response of bursty data. When the user data of the substation is to be transmitted, a corresponding mark is required to be set, but if the user data is not processed in time, the master station can cause the drift of the data time stamp, and under the Ethernet environment, the network delay can cause time synchronization deviation to influence the accuracy of the electric energy data. In addition, the problem of instantaneity is aggravated due to insufficient function expansibility, the protocol native does not support the expansion data types such as current, voltage and the like, the high-level function requirements such as load analysis, electricity monitoring and the like cannot be met, and a dynamic clock synchronization mechanism is lacked, so that the system-level time reference is difficult to unify, and the real-time data processing capability is further weakened. The defects are expressed as continuous message verification failure, sporadic LRC errors and retransmission storms in the electric power centralized meter reading system, and are based on the lack of full-link monitoring capability caused by uncoupling of the functional modules, so that independent optimization and collaborative management of framing, transceiving and link states are needed to be realized through architecture reconstruction. Disclosure of Invention The invention aims to provide an IEC102 protocol-based power communication message processing and link management system, which decouples message framing, transceiving and link state management in time and realizes parallel processing by introducing a multi-period timing driving framework so as to solve the problems of low system processing efficiency and poor instantaneity caused by coupling of message framing, transceiving and link state management functions in the existing IEC102 protocol-based power communication. In order to solve the technical problems, the invention is realized by adopting the following technical scheme. The invention provides a power communication message processing and link management system based on IEC10