Data communication method and device based on IEC104 protocol

By introducing a multi-threaded framework into the communication framework of the IEC104 protocol, the data interaction between the power station and the main station is handled, and the problem that the existing technology cannot meet the needs of increasing functions is solved, real-time, security and reliability of data interaction are achieved. .

CN119449870APending Publication Date: 2025-02-14BEIJING GUODIAN ZHISHEN CONTROL TONGDY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411539613.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

The existing communication framework and methods based on the IEC104 regulations cannot meet the increasing functional needs, resulting in the data interaction between the power station and the main station not real-time, safe and reliable enough.

Method used

Adopt a multi-threaded framework, including TCP connection threads, first threads, second threads and third threads. These threads process different types of command data frames and upload messages to ensure real-time data interaction between the power station and the main station. , security and reliability.

Benefits of technology

Through the multi-threaded framework design, the real-time, security and reliability of data interaction between the power station and the main station have been improved, which can adapt to the increasing communication needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119449870A_ABST
    Figure CN119449870A_ABST
Patent Text Reader

Abstract

The invention provides a data communication method and device based on an IEC104 protocol, and relates to the technical field of electric power automation. The method is applied to a power station serving as a slave station, and comprises the following steps: establishing communication connection with a master station by utilizing a TCP (Transmission Control Protocol) connection thread; when a command data frame sent by a master station is received, a first thread corresponding to the type of the command data frame is selected to process the command data frame, and a response message obtained after processing is sent to a second thread used for sending a message to the master station. The type of the first thread comprises a master station request response thread and a master station lower control command processing thread, and the type of the command data frame comprises a calling data frame and a lower control data frame; when the uploading demand exists, a third thread used for uploading information to the master station is used for constructing an uploading message, and the uploading message is sent to the second thread; and sending the response message and / or the uploading message to the master station through the second thread.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of electric power automation technology, and specifically relates to a data communication method based on IEC104 protocol, a data communication device based on IEC104 protocol, a computer device and a machine-readable storage medium. Background Art

[0002] IEC 60870-5-104 is one of the commonly used communication protocol standards in the field of power automation. It is often used for data communication between the computer monitoring system of the power system substation or RTU (remote terminal unit) and the master station system. The communication model adopts a client-server model, in which the master station acts as a client and the remote station acts as a server. The master station can send control commands to the remote station and receive real-time data from the remote station. The underlying network communication between the master station and the remote station adopts the TCP / IP protocol, and the application layer protocol adopts the IEC60870-5-104 transmission protocol (IEC104 protocol for short), which is suitable for modern computer network environments. At present, there are more and more communication needs between the master station and the power station, and it is urgent to propose a communication framework and method based on the IEC104 protocol that can meet these communication needs. Summary of the invention

[0003] The purpose of the embodiments of the present application is to provide a data communication method based on the IEC104 protocol, a data communication device based on the IEC104 protocol, a computer device and a machine-readable storage medium, so as to overcome the defect in the prior art that the communication framework and method based on the IEC104 protocol cannot meet the gradually increasing functional requirements.

[0004] To achieve the above object, a first aspect of the present application provides a data communication method based on the IEC104 protocol, which is applied to a power station as a slave station, and the method comprises: Use the TCP connection thread to establish a communication connection with the main station; When receiving a command data frame sent by the master station, selecting a first thread corresponding to the type of the command data frame to process the command data frame, and sending a response message obtained after the processing to a second thread used to send messages to the master station, the types of the first thread include a master station request response thread and a master station down-control command processing thread, and the types of the command data frame include a summoning data frame and a down-control data frame; When there is a need to send information, construct a message to send using a third thread for sending information to the master station, and send the message to the second thread; The received response message and / or the sent message is sent to the main station through the second thread.

[0005] In a specific embodiment of the present application, the type of the calling data frame includes at least one of a point table calling data frame, a total calling data frame and an electricity calling data frame.

[0006] In a specific embodiment of the present application, when the command data frame is a point table summon data frame, when receiving the command data frame sent by the master station, selecting a first thread corresponding to the type of the command data frame to process the command data frame, and sending a response message obtained after processing to a second thread for sending a message to the master station, including: receiving a point table calling data frame sent by the master station for calling a point table version number, wherein the update of the point table version number represents a change in the point table information; The master station requests the response thread to construct a response message including the latest point table version number information, and sends the response message to the second thread, so that the second thread sends the received response message including the latest point table version number information to the master station, so that the master station can determine whether the received point table version number is consistent with the locally stored point table version number. If so, the local point table version number is used, otherwise, a point table summoning data frame for summoning the point table is sent to the slave station; If a point table summoning data frame for summoning a point table sent by the master station is received, the master station request response thread is selected to construct a response message including point table information, and the response message is sent to the second thread, so that the second thread sends the received response message including point table information to the master station; The initial point table version number and the initial point table information are sent to the master station after the first connection with the master station is established.

[0007] In a specific embodiment of the present application, the point type in the point table information includes at least one of remote signaling, remote measurement, remote control and remote adjustment.

[0008] In a specific embodiment of the present application, the type of information sent includes at least one of regularly sent information and changed point position information in the point table.

[0009] In a specific embodiment of the present application, when the type of information to be sent is the change point information in the point table, the use of the third thread for sending information to the master station to construct a send message, and sending the send message to the second thread includes: In response to the automatic point control command of the host computer or the manual triggering of the automatic point, based on the point table modification data during equipment maintenance, the information body of the point position whose information in the point table has changed is obtained through the third thread; An automatic point-to-point frame including the information body is constructed through a third thread, and the automatic point-to-point frame is sent to the second thread, so that the second thread sends the received automatic point-to-point frame to the master station, so that the master station can determine whether there is a non-matching item. If so, an error response frame is sent to the slave station, otherwise the local point table is updated using the information body in the automatic point-to-point frame, and the non-matching item is a point information item whose category does not match the information body in the automatic point-to-point frame and the point table information body locally stored by the master station.

[0010] In a specific embodiment of the present application, the ASDU type identifier of the error response frame is the same as the ASDU type identifier of the automatic point-to-point frame.

[0011] In a specific embodiment of the present application, the type of the down-control data frame includes at least one of a plan curve down-control frame, a remote control value modification command frame, and a remote signaling value modification command frame.

[0012] In a specific embodiment of the present application, when the down-control data frame is a plan curve down-control frame, when receiving a command data frame sent by the master station, selecting a first thread corresponding to the type of the command data frame to process the command data frame, and sending a response message obtained after processing to a second thread for sending a message to the master station, including: Receive a plan curve down control frame sent by the master station, construct a mirror message of the plan curve down control frame through the master station down control command processing thread, and send the mirror message to the second thread, so that the second thread sends the received mirror message to the master station; Among them, the data information in the control frame under the plan curve includes the information body of each plan point on the plan curve, the time information planned by the plan curve, or the data information in the control frame under the plan curve includes the information body of the inflection point on the plan curve, the information body of the first plan point on the plan curve, the information body of the last plan point on the plan curve and the time information planned by the plan curve.

[0013] In a specific embodiment of the present application, the type of the summoning data frame also includes a historical plan curve summoning data frame. When the summoning data frame is a historical plan curve summoning data frame, when receiving a command data frame sent by the master station, selecting a first thread corresponding to the type of the command data frame to process the command data frame, and sending a response message obtained after processing to a second thread for sending a message to the master station, including: Receive the historical plan curve call data frame sent by the main station, construct a response message including the historical plan curve information stored locally through the main station request response thread, and send the response message including the historical plan curve information stored locally to the second thread, so that the second thread sends the received response message to the main station, so that the main station verifies the information of the historical plan curve in the response message; Among them, the information of the historical plan curve includes the information body of each plan point on the historical plan curve, the time information planned by the historical plan curve, or the information of the historical plan curve includes the information body of the inflection point on the historical plan curve, the information body of the first plan point on the historical plan curve, the information body of the last plan point on the historical plan curve and the time information planned by the historical plan curve.

[0014] A second aspect of the present application provides a data communication device based on the IEC104 protocol, comprising: A connection establishment module is used to establish a communication connection with the main station using a TCP connection thread; A command data frame processing module, configured to, upon receiving a command data frame sent by the master station, select a first thread corresponding to the type of the command data frame to process the command data frame, and send a response message obtained after the processing to a second thread used to send messages to the master station, wherein the types of the first thread include a master station request response thread and a master station down-control command processing thread, and the types of the command data frame include a summon data frame and a down-control data frame; The data transmission processing module is used to construct a transmission message by using the third thread for transmitting information to the master station when there is a transmission demand, and send the transmission message to the second thread; A message sending module is used to send the received response message and / or the sent message to the main station through the second thread.

[0015] A third aspect of the present application provides a computer device, comprising: a memory configured to store instructions; and The processor is configured to call the instructions from the memory and implement the data communication method based on the IEC104 protocol described in the first aspect of the present application when executing the instructions.

[0016] A fourth aspect of the present application provides a machine-readable storage medium having instructions stored thereon, the instructions being used to enable a machine to execute the data communication method based on the IEC104 protocol described in the first aspect of the present application.

[0017] The above technical solution proposes a multi-threaded framework, wherein the multi-threads include a TCP connection thread, a first thread, a second thread, and a third thread. Through the multi-threaded framework design, the real-time, security, and reliability of data interaction between the power station and the master station are ensured to meet the gradually increasing communication needs between the master and slave stations.

[0018] Other features and advantages of the embodiments of the present application will be described in detail in the subsequent specific implementation section. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The accompanying drawings are used to provide a further understanding of the embodiments of the present application and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present application, but do not constitute a limitation on the embodiments of the present application. In the accompanying drawings: Figure 1 A program flow chart of a multi-threaded communication framework based on the IEC104 protocol according to an embodiment of the present application is schematically shown; Figure 2 A flowchart of a data communication method based on the IEC104 protocol according to an embodiment of the present application is schematically shown; Figure 3 A flowchart schematically shows a data communication method for unilateral point table interaction between a master station and a slave station according to an embodiment of the present application; Figure 4 A flowchart schematically shows a method for automatic point-to-point data communication between a master station and a slave station according to an embodiment of the present application; Figure 5 A schematic diagram of automatic point alignment of a point table according to an embodiment of the present application is shown schematically; Figure 6 A block diagram schematically shows a composition of a data communication device based on IEC104 reduction according to an embodiment of the present application; Figure 7 The structural block diagram of a computer device according to an embodiment of the present application is schematically shown. DETAILED DESCRIPTION

[0020] The specific implementation of the embodiment of the present application is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the embodiment of the present application, and is not used to limit the embodiment of the present application.

[0021] If there are descriptions involving "first", "second", etc. in the embodiments of the present application, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by this application.

[0022] Currently, the communication methods between power stations (slave stations) and centralized control centers or dispatch centers (master stations) mainly use two communication protocols: IEC101 and IEC104. The IEC101 protocol is a serial communication method, usually for data transmission through a serial port, while the IEC104 protocol uses a network communication method based on TCP / IP, which means that it can communicate across different computer networks. The IEC104 protocol is the network version of the 101 protocol. The IEC101 protocol can only send one link frame at a time, while the IEC104 protocol can send multiple link frames continuously. Its transmission efficiency is significantly higher than that of the IEC101 protocol, and it has the conflict detection and error retransmission mechanism of TCP / IP, which has higher reliability and stability than the IEC101 protocol, and the restrictions on communication delay are more relaxed.

[0023] At present, with the emergence of new types of equipment in power plants or the transformation of old equipment, and the increasing demand for power plant monitoring and control by centralized control or dispatching centers, new challenges have been raised to the data processing rate of the communication framework based on the IEC104 protocol.

[0024] To meet the above requirements, an embodiment of the present application provides a data communication method based on IEC104 reduction, which is applied to a slave station. The method includes: Use the TCP connection thread to establish a communication connection with the main station; When receiving a command data frame sent by the master station, a first thread corresponding to the type of the command data frame is selected to process the command data frame, and a response message obtained after the processing is sent to a second thread used to send messages to the master station, wherein the types of the first thread include a master station request response thread and a master station down-control command processing thread, and the types of the command data frame include a summoning data frame and a down-control data frame; When there is a need to send information, a third thread for sending information to the master station is used to construct a message to send information, and the constructed message is sent to the second thread; The received response message and / or the sent message is sent to the main station through the second thread.

[0025] It should be understood that in this application, the master station request response thread refers to the thread that responds to the master station's request, and the master station control command processing thread refers to the thread that processes the master station's control command to the slave station. It is known that the master station usually needs to summon various monitoring data, power data, etc. from the slave station, and the summoning data frame refers to the data frame issued to summon various monitoring data, power data, etc. The master station also usually controls the slave station, and the control data frame refers to the data frame issued to send these control instructions.

[0026] Figure 1 The program flow chart of the multi-threaded communication framework based on the IEC104 protocol in this application is schematically shown. Figure 1As shown, the communication model of the IEC104 protocol adopts a client-server model. In this application, the client refers to a centralized control center or a dispatching center as a master station. Figure 1 exemplarily shows client A and client B, and the server refers to a power station as a slave station. Figure 1 In the example, the sending thread refers to the third thread, and the "thread for sending data to the master station uniformly" refers to the second thread.

[0027] As an example, a multi-threaded communication framework can be implemented in the following way: Adopts cross-platform C++ framework ACE (Adaptive Communication Environment) for concurrent communication; Use POSIX Threads (pthread), which is a commonly used cross-platform thread library in C / C++ and supports shared memory between multiple threads and processes; Adopt std::thread in the C++11 standard library. The C++11 standard library introduces thread support and defines a set of thread header files and class libraries; Use boost::thread from Boost C++ Libraries: boost::thread is an open source cross-platform C++ multithreading library that supports thread creation, waiting, association, detachment, mutexes, conditional variables, recursive locks, etc. Adopt OpenMP, which is a parallel programming model based on shared memory. In the application, the code is parallelized through instructions. The compiler that supports multi-threading can automatically convert the code to use multi-threading. Adopt TBB (Intel Threading Building Blocks), TBB (Intel ThreadingBuilding Blocks) is a C++ multi-core parallel programming framework, including classes and function libraries for parallel execution and management of threads and data, suitable for task-level parallelism and providing load balancing, as well as synchronization mechanisms to prevent data races and deadlocks.

[0028] As an example, a communication connection with a master station is established by using a TCP connection thread, specifically including: Open the local address (IP+port) in a loop, wait to receive the connection from the master station, determine whether the master station IP is legal, if not, close the connection, if legal, receive the master station message, if receive the command data frame from the master station, respond immediately and determine whether the command data frame is correct, if the command data frame is wrong, close the connection, if the command data frame is correct, construct a message according to the type of the command data frame, and send the constructed message to the master station request response thread or the master station control command processing thread.

[0029] In the above embodiment, at least the following beneficial effects are achieved: when the slave station communicates with the master station based on the IEC104 protocol, the slave station introduces a multi-threaded framework, wherein the multi-threads include a TCP connection thread, a first thread, a second thread, and a third thread. Through the multi-threaded framework design, the real-time, security, and reliability of data interaction between the power station and the master station are met.

[0030] The data communication method based on the IEC104 protocol provided in the embodiment of the present application can be applied to power stations such as hydropower stations and photovoltaic power stations. In this case, the power station is the executor of the data communication method based on the IEC104 protocol provided in the embodiment of the present application.

[0031] Figure 2 The flowchart of a data communication method based on the IEC104 protocol according to an embodiment of the present application is schematically shown. Figure 2 As shown, the data communication method based on the IEC104 protocol may include the following steps 102 to 108. It is understandable that the above-mentioned data communication method based on the IEC104 protocol may include all the steps from step 102 to step 108, or may only include some of the steps. It is understandable that the various steps in a data communication method based on the IEC104 protocol may be arbitrarily combined without conflict. As an optional embodiment of the present application, a data communication method based on the IEC104 protocol may be a scheme that only includes step 102, step 104 and step 108. In another optional embodiment, a data communication method based on the IEC104 protocol may be a scheme that only includes step 102, step 106 and step 108.

[0032] Step 102: Establish a communication connection with the main station using the TCP connection thread.

[0033] Step 104, in response to the command data frame sent by the master station, select a first thread corresponding to the type of the command data frame to process the command data frame, and send the response message obtained after processing to the second thread used to send messages to the master station, the types of the first threads include the master station request response thread and the master station down-control command processing thread, and the types of the command data frames include summoning data frames and down-control data frames.

[0034] Step 106: Use the third thread for sending information to the master station to construct a sending message, and send the constructed sending message to the second thread.

[0035] Step 108: Send the received response message and the sent message to the master station through the second thread.

[0036] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0037] As an optional embodiment of the above embodiment, the calling data frame includes a point table calling data frame, a total calling data frame, an electricity calling data frame, and the like.

[0038] As an optional embodiment of the above embodiment, the type of information sent includes timed sending information and changed point position information in the point table.

[0039] As an optional embodiment of the above embodiment, the types of the down-control data frame include a plan curve down-control frame, a remote control value modification command frame, a remote signaling value modification command frame, and the like.

[0040] What needs to be understood is: 1. In a common embodiment, the slave station processes the total call data frame or the power call data frame using a single thread. According to the multi-threading defined in this application, each single thread processing step can be processed by one or more threads of corresponding functions in the multi-threading, which will not be repeated in this application.

[0041] 2. In a common embodiment, the slave station processes the power call data frame using a single thread. According to the multi-threading defined in this application, each single thread processing step can be processed by one or more threads of corresponding functions in the multi-threading, which will not be repeated in this application.

[0042] 3. In a common embodiment, the slave station usually uses a single thread to send the scheduled information to the master station. According to the multi-threading defined in this application, each single thread processing step can be processed by one or more threads with corresponding functions in the multi-threading. For example: the connection with the master station is checked by the third thread. If the confirmation is timely enough, the points are checked in turn to see if they have changed. If they have changed, a data packet is constructed and forwarded to the second thread.

[0043] 4. In a common embodiment, the slave station uses single-threaded processing for processing the remote control value modification command frame or the remote signal value modification command frame. According to the multi-threading defined in this application, each single-threaded processing step can be processed by one or more threads of corresponding functions in the multi-threading, which will not be repeated in this application.

[0044] In the prior art, the centralized control center or dispatching center needs to use mobile storage devices to obtain the information of the power station table, which is cumbersome to operate and not convenient or intelligent enough.

[0045] To overcome the above problems, Figure 1 In the communication framework shown, the unilateral point table function is obtained by extending IEC104, so that the power station and the master station can transmit the point table information based on the unilateral point table function. The unilateral point table function refers to the data interaction function initiated by the master station, and the slave station responds and sends the point table information. Specifically, when the received command data frame is a point table call data frame, step 104, in response to the command data frame sent by the master station, selects the first thread corresponding to the type of the command data frame to process the command data frame, and sends the response message obtained after processing to the second thread used to send messages to the master station, which specifically includes the following steps: Receiving a point table calling data frame sent by the master station for calling a point table version number, the update of the point table version number represents a change in the point table information, that is, whether the point table information in the local database has changed; The master station requests the response thread to construct a response message including the latest point table version number information, and sends the response message to the second thread, so that the second thread sends the received response message including the latest point table version number information to the master station, so that the master station can determine whether the received point table version number is consistent with the locally stored point table version number. If so, the local point table version number is used, otherwise, a point table summoning data frame for summoning the point table is sent to the slave station; If a point table summoning data frame for summoning a point table is received from the master station, a response message including point table information is constructed through the master station requesting a response thread, and the response message is sent to the second thread, so that the second thread sends the received response message including point table information to the master station; The initial point table version number and the initial point table information are sent to the master station after establishing a connection with the master station.

[0046] It can be seen that the unilateral point table function occurs after the slave station establishes a connection with the master station and before the master station sends a startup frame. The unilateral point table function can be implemented by extending the ASDU type identifier. The unilateral point table ASDU information body can be expressed in JSON text format.

[0047] As in the above embodiment, the single-side point table function enables the centralized control center or the dispatching center to quickly obtain the power station table information.

[0048] As an example, the types of points in the point table information include telesignaling, telemetering, remote control and remote adjustment. The information bodies of different types of points are different. As shown in Table 1, the content transmitted by the telesignaling information body includes AD (point absolute address), ID (point name), DE (point Chinese description), S0 (state is 0 Chinese description), S1 (state is 1 Chinese description), SOE (whether it is an SOE point, 0 means no, 1 means yes). The content transmitted by the telemetering information body includes AD (point absolute address), ID (point name), DE (point Chinese description), SC (proportional coefficient), L0 (local database exceeds the lower limit alarm value) and H1 (local database exceeds the upper limit alarm value). The content transmitted by the remote control information body includes AD (point absolute address), ID (point name), DE (point Chinese description). The content transmitted by the remote adjustment information body includes AD (point absolute address), ID (point name), DE (point Chinese description).

[0049] Table 1

[0050] As an example, after the slave station receives the point table summoning data frame sent by the master station for summoning the point table, it uses the master station request response thread to construct a "summoning command received" message and sends the message to the second thread, which sends the message to the master station. The slave station then uses the master station request response thread and the second thread to send the corresponding point type information to the master station frame by frame, and after sending the point table information, it sends a unilateral point table summoning end frame to the master station.

[0051] As an example, after receiving the point table information, the master station saves the point table information for subsequent analysis and import.

[0052] As an example, after the master station sends a point table calling data frame for calling the point table, if a timeout occurs when receiving a "call command received" message, an error log is recorded and the connection is closed. The timeout period can be set to 5 seconds.

[0053] Figure 3 The flowchart schematically shows a data communication method for unilateral point table interaction between a master station and a slave station. Figure 3 As shown, in an optional embodiment of the present application, the data communication method for unilateral point table interaction between the master station and the slave station may include steps A1 to A5. It can be understood that the data communication method for unilateral point table interaction between the master station and the slave station may include all steps from step A1 to step A5, or may only include some of the steps.

[0054] Step A1: The slave station establishes a communication connection with the master station using a TCP connection thread.

[0055] Step A2: The master station sends a point table calling data frame for calling the point table version number to the slave station.

[0056] Step A3, if the slave station uses the TCP connection thread to determine that the point table summon data frame is correct, the received current point table summon data frame is sent to the master station request response thread, the master station request response thread constructs a data packet including the latest point table version number information, and forwards the data packet to the second thread. At this time, if the master station confirms slowly, the master station request response thread sleeps and waits for its own message queue. After receiving the data packet, the second thread sends a message message assembled with the content of the data packet to the master station.

[0057] Step A4, the master station determines whether the latest point table version number sent by the slave station is consistent with the point table version number stored locally. If they are consistent, the local point table is used to directly start the normal transmission process, that is, a startup frame is sent to the master station. If they are inconsistent, a point table call data frame for calling the point table is sent to the slave station.

[0058] Step A5, after the slave station receives the point table summoning data frame sent by the master station for summoning the point table, it constructs a received summoning command message through the master station request response thread, sends the received summoning command message to the second thread, forwards the received summoning command message to the master station through the second thread, and then sends the point information in the point table to the master station frame by frame through the master station request response thread and the second thread. After sending all the point information, it sends a unilateral point table summoning end frame to enable the master station to start the normal transmission process with the slave station, that is, the master station sends a start frame to the slave station.

[0059] In the prior art, when the power station equipment is overhauled, it is necessary to calibrate the point table and modify some of the point table information, which leads to inconsistency between the point table information of the master station and the slave station. It is necessary to frequently calibrate the point table information of both parties, which is inefficient and very easy to cause inconsistency between the point table information of the master station and the slave station.

[0060] To overcome the above problems, Figure 1 In the communication framework shown, the automatic point-to-point function is obtained by extending IEC104, so that the power station and the master station can synchronize the point table information based on the automatic point-to-point function. The automatic point-to-point function refers to the point table change information interaction function initiated by the slave station and responded by the master station. Specifically, step 106, using the third thread for sending information to the master station to construct a sending message, and sending the constructed sending message to the second thread, specifically includes the following steps: In response to the automatic point control command of the host computer or the manual triggering of the automatic point, based on the point table modification data during equipment maintenance, the information body of the point position whose information in the point table has changed is obtained through the third thread; Constructing an automatic point-to-point frame including the information body through the third thread, and sending the automatic point-to-point frame to the second thread, so that the second thread sends the received automatic point-to-point frame to the master station, so that the master station determines whether there is a non-matching item, and if so, sends an error response frame to the slave station, otherwise, updates the local point table using the information body in the automatic point-to-point frame; Among them, the non-matching items are point information items whose categories do not match those in the information body in the automatic point-to-point frame and the point table information body locally stored in the master station.

[0061] It should be understood that for each point type, the point information item category in the information body corresponding to the point type in the automatic point frame is consistent with the point information item category in the information body of the point type required by the unilateral point table function. Unmatched point information items refer to unmatched point information item categories. In order to avoid interfering with the communication messages of the four remote controls (remote communication, telemetry, remote control, and remote adjustment), the processing priority of the automatic point frame in each thread is lower than that of the communication messages of the four remote controls (remote communication, telemetry, remote control, and remote adjustment).

[0062] In the above embodiment, the consistency of the point table information between the master station and the slave station is ensured by the extended automatic point alignment function, thereby overcoming the defects of low efficiency and easy error in manually collating the point table information of both parties.

[0063] As an optional embodiment, the ASDU type identifier of the error response frame is the same as the ASDU type identifier of the automatic point-to-point frame.

[0064] As an example, the automatic alignment control command is triggered by turning on the switch point of the host computer, or the automatic alignment flag is manually set to trigger the automatic alignment. After the automatic alignment is completed, the switch point of the host computer is turned off.

[0065] As an example, after the slave sends an automatic point-to-point frame to the master, if a timeout occurs when receiving a response frame from the master to the automatic point-to-point frame, the slave records an error log and terminates the current automatic point-to-point process. For example, the timeout period can be set to 5 seconds.

[0066] As an example, after the automatic point-to-point is completed, the master station and the slave station respectively record the automatic point-to-point process and content, and record them in detail in the automatic point-to-point report file.

[0067] Figure 4 The flowchart of the method for automatic point-to-point data communication between the master station and the slave station is schematically shown. Figure 4 As shown, in an optional embodiment of the present application, the data communication method for automatic point-to-point between the master station and the slave station may include steps B1 to B5. It can be understood that the data communication method for unilateral point table interaction between the master station and the slave station may include all steps from step B1 to step B5, or may only include some of the steps.

[0068] Step B1, the slave station establishes a communication connection with the master station using a TCP connection thread.

[0069] Step B2, in response to the automatic point control command of the host computer or the manual triggering of the automatic point, based on the point table modification data during equipment maintenance, the slave station obtains the information body of the point where the information in the point table has changed through the third thread.

[0070] Step B3: The slave station constructs an automatic point-to-point frame including the above information body by using the third thread, and sends the automatic point-to-point frame to the second thread.

[0071] Step B4: The second thread of the slave station sends the received automatic point-to-point frame to the master station.

[0072] Step B5, the master station determines whether there is a non-matching item. If so, it sends an error response frame to the slave station, otherwise it uses the information body in the automatic point-to-point frame to update the local point table. The non-matching item is the point information item whose category does not match the information body in the automatic point-to-point frame and the point table information body stored locally by the master station.

[0073] As an example, Figure 5 The schematic diagram of the point table automatic point position is shown schematically. Figure 5 As shown, an automatic alignment position is added to the point table. The automatic alignment position 1 represents the need for alignment, and the automatic alignment position 0 represents the need for alignment. At this time, the slave station updates the point table online according to the point table modification data during equipment maintenance, sets the automatic alignment position of the point that needs alignment to 1, and then turns on the automatic alignment, that is, after receiving the command to turn on the automatic alignment, the slave station sends the point types of telesignaling, telemetering, remote control, and remote adjustment in the order of the alignment position 1, and each automatic alignment frame sends the information of a point in the point table that needs alignment to the master station.

[0074] The planning curve is a power generation plan compiled by the grid operation department using a variety of algorithms based on factors such as load forecasts and unit operating parameters. Existing power stations mainly use special receiving devices to obtain the planning curves issued by the dispatching center, which requires manual operation and has a low degree of intelligence.

[0075] To overcome the above problems, Figure 1 Under the communication framework shown, the plan curve transmission function is obtained by extending IEC104 to realize the transmission of the plan curve. The automatic point-to-point function refers to the plan curve interaction function initiated by the master station and responded by the slave station. Specifically, step 104, in response to the command data frame sent by the master station, selects a first thread corresponding to the type of the command data frame to process the command data frame, and sends the response message obtained after processing to the second thread used to send messages to the master station, which specifically includes the following steps: Receive the plan curve down control frame sent by the master station, construct a mirror message of the plan curve down control frame through the master station down control command processing thread, and send the mirror message to the second thread, so that the second thread sends the received mirror message to the master station; Among them, the data information in the control frame under the plan curve includes the information body of each plan point on the plan curve, the time information planned by the plan curve, or the data information in the control frame under the plan curve includes the information body of the inflection point on the plan curve, the information body of the first plan point on the plan curve, the information body of the last plan point on the plan curve and the time information planned by the plan curve.

[0076] In this application, the time information planned by the plan curve refers to the specific time corresponding to the plan curve. For example, the plan curve plans the planned power generation of the power station from 00:00:00 on January 11, 2024 to 24:00:00 on January 11, 2024. At this time, the time information planned by the plan curve is: January 11, 2024. The time information planned by the plan curve can be represented by a time tag carried during transmission. For example, the time tag can be in the CP56Time2a structure format, in which the year, month, and day fields are valid, and other fields can be set to zero. The processing priority of the communication messages related to the plan curve on each thread is lower than the communication messages of the four remote controls (telesignaling, telemetry, remote control, and remote adjustment) to ensure that the normal communication of the four remote controls is not interfered with.

[0077] As in the above embodiment, the automatic transmission of the plan curve between the dispatch center and the power station is realized through the plan curve transmission function, without manual operation, reducing labor costs and improving work efficiency. Moreover, after receiving the plan curve, the slave station can directly download it to the DCS distributed control system of the power station to ensure the safety and accuracy of power generation in the power station. In addition, when the inflection point transmission strategy is adopted, because the inflection point transmission only transmits the changed plan point information, not all the plan points on the plan curve are transmitted, the transmission efficiency is improved.

[0078] As an example, based on the inflection point transmission strategy, the slave station interpolates the slopes of the two points sent before and after, resolves the middle point, and thus obtains a complete plan curve.

[0079] As an example, the data type in the control frame under the planning curve may be a normalized type, a scaled type, a short floating point type, etc. The specific type may be determined by a configuration file.

[0080] As an example, the plan curve can be 96 or 288 plan points, which are sent 24 hours a day, starting from 0 o'clock, with one plan point every 5 minutes, then there are 288 plan points, and one point every 15 minutes, then there are 96 plan points. Each plan point of the plan curve has a fixed address, and the address of the plan point information body can be continuous or discontinuous. The plan curve can be sent for one day or multiple days, and the specific time is determined by the time stamp of the control frame under each plan curve.

[0081] As an improvement of the above embodiment, in order to realize the verification of the plan curve saved by the master station by the slave station, the type of the summoning data frame also includes a historical plan curve summoning data frame. When the summoning data frame is a historical plan curve summoning data frame, step 104, in response to the command data frame sent by the master station, selects a first thread corresponding to the type of the command data frame to process the command data frame, and sends the response message obtained after the processing to the second thread used to send the message to the master station, which specifically includes the following steps: Receive the historical plan curve call data frame sent by the main station, construct a response message including the information of the historical plan curve stored locally through the main station request response thread, and send the response message including the historical plan curve information stored locally to the second thread, so that the second thread sends the received response message to the main station, so that the main station can verify the historical plan curve information in the response message; Among them, the historical plan curve information includes the information body of each plan point on the historical plan curve, the time information planned by the historical plan curve, or the historical plan curve information includes the information body of the inflection point on the historical plan curve, the information body of the first plan point on the historical plan curve, the information body of the last plan point on the historical plan curve and the time information planned by the historical plan curve.

[0082] In the above improved embodiment, the master station ensures the consistency check of the plan curve between the master station and the slave station by calling the historical plan curve.

[0083] In a specific application, such as Figure 1 The communication framework based on the IEC104 protocol shown in the figure not only has high device compatibility, but also realizes multi-thread high concurrency, meets the increasingly rich communication needs between the master station and the slave station, and the data transmission rate can reach 10Mbps, the bit error rate is 0, and it has high efficiency, high reliability and high security of communication. At the same time, based on the above communication framework, the unilateral point table function, automatic point function and plan curve transmission function are expanded, and the automatic transmission of the point table and plan curve is realized, which saves labor costs and facilitates the connection between the master station and the slave station.

[0084] Corresponding to the data communication method based on IEC104 reduction in the above embodiment, Figure 6The block diagram of the composition of the data communication device based on IEC104 reduction according to the embodiment of the present application is schematically shown. For the convenience of explanation, only the part related to the embodiment of the present application is shown.

[0085] like Figure 6 As shown, the data communication device 400 based on IEC104 reduction includes: The connection establishment module 410 is used to establish a communication connection with the master station using a TCP connection thread; The command data frame processing module 420 is used to select a first thread corresponding to the type of the command data frame to process the command data frame when receiving the command data frame sent by the master station, and send the response message obtained after the processing to a second thread used to send messages to the master station, the types of the first thread include the master station request response thread and the master station down control command processing thread, and the types of the command data frame include the summoning data frame and the down control data frame; The data transmission processing module 430 is used to construct a transmission message by using the third thread for transmitting information to the master station when there is a transmission demand, and send the transmission message to the second thread; The message sending module 440 is used to send the received response message and / or the sent message to the main station through the second thread.

[0086] As an embodiment of the present application, the data communication device 400 based on IEC104 reduction can be implemented as follows: Figure 1 The illustrated embodiments and other related method embodiments.

[0087] The process of each module of the data communication device 400 based on IEC104 reduction providing in the embodiment of the present application realizing its respective functions can be specifically referred to in the aforementioned Figure 1 The description of the illustrated embodiment and other related method embodiments will not be repeated here.

[0088] It should be noted that the information interaction, execution process and other contents between the above modules are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0089] Figure 7 A schematic diagram of a computer device according to an embodiment of the present application is shown. In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 7As shown. The computer device includes a processor A01, a network interface A02, a display screen A04, an input device A05 and a memory (not shown in the figure) connected through a system bus. Among them, the processor A01 of the computer device is used to provide computing and control capabilities. The memory of the computer device includes an internal memory A03 and a non-volatile storage medium A06. The non-volatile storage medium A06 stores an operating system B01 and a computer program B02. The internal memory A03 provides an environment for the operation of the operating system B01 and the computer program B02 in the non-volatile storage medium A06. The network interface A02 of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor A01, a data communication method based on IEC104 reduction is implemented. The display screen A04 of the computer device can be a liquid crystal display or an electronic ink display, and the input device A05 of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.

[0090] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0091] In one embodiment, the data communication device 400 based on IEC104 reduction provided by the present application can be implemented in the form of a computer program. The computer program can be used in Figure 3 The computer device shown in the figure is run. The memory of the computer device can store various program modules constituting the data communication device 400 based on IEC104 reduction. The computer program composed of various program modules enables the processor to execute the steps of the data communication method based on IEC104 reduction in various embodiments of the present application described in this specification.

[0092] In one embodiment, the present application further provides a machine-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the data communication method based on IEC104 reduction in the above embodiment is implemented.

[0093] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0094] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program codes.

[0095] It should also be noted that the terms "include", "comprising" or any other variation thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprising a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0096] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A data communication method based on IEC104 protocol, characterized in that: Applied to a power station as a slave station, the method comprises: Use the TCP connection thread to establish a communication connection with the main station; When receiving a command data frame sent by the master station, selecting a first thread corresponding to the type of the command data frame to process the command data frame, and sending a response message obtained after the processing to a second thread used to send messages to the master station, the types of the first thread include a master station request response thread and a master station down-control command processing thread, and the types of the command data frame include a summoning data frame and a down-control data frame; When there is a need to send information, construct a sending message by using a third thread for sending information to the master station, and send the sending message to the second thread; The received response message and / or the sent message is sent to the main station through the second thread.

2. The method according to claim 1, characterized in that The type of the calling data frame includes at least one of a point table calling data frame, a total calling data frame and an electric degree calling data frame.

3. The method according to claim 2, characterized in that When the command data frame is a point table summon data frame, upon receiving the command data frame sent by the master station, selecting a first thread corresponding to the type of the command data frame to process the command data frame, and sending a response message obtained after the processing to a second thread used to send a message to the master station, including: receiving a point table calling data frame sent by the master station for calling a point table version number, wherein the update of the point table version number represents a change in the point table information; The master station requests the response thread to construct a response message including the latest point table version number information, and sends the response message to the second thread, so that the second thread sends the received response message including the latest point table version number information to the master station, so that the master station can determine whether the received point table version number is consistent with the locally stored point table version number. If so, the local point table version number is used, otherwise, a point table summoning data frame for summoning the point table is sent to the slave station; If a point table summoning data frame for summoning a point table sent by the master station is received, the master station request response thread is selected to construct a response message including point table information, and the response message is sent to the second thread, so that the second thread sends the received response message including point table information to the master station; The initial point table version number and the initial point table information are sent to the master station after the first connection with the master station is established.

4. The method according to claim 3, characterized in that: The point type in the point table information includes at least one of remote signaling, remote measurement, remote control and remote adjustment.

5. The method according to claim 3, characterized in that: The type of information sent includes at least one of regularly sent information and changed point position information in the point table.

6. The method according to claim 5, characterized in that When the type of information to be sent is the change point information in the point table, constructing a sending message by using a third thread for sending information to the master station, and sending the sending message to the second thread includes: In response to the automatic point control command of the host computer or the manual triggering of the automatic point, based on the point table modification data during equipment maintenance, the information body of the point position whose information in the point table has changed is obtained through the third thread; An automatic point-to-point frame including the information body is constructed through a third thread, and the automatic point-to-point frame is sent to the second thread, so that the second thread sends the received automatic point-to-point frame to the master station, so that the master station can determine whether there is a non-matching item. If so, an error response frame is sent to the slave station, otherwise the local point table is updated using the information body in the automatic point-to-point frame, and the non-matching item is a point information item whose category does not match the information body in the automatic point-to-point frame and the point table information body locally stored by the master station.

7. The method according to claim 6, characterized in that The ASDU type identifier of the error response frame is the same as the ASDU type identifier of the automatic point-to-point frame.

8. The method according to claim 1, characterized in that: The type of the down-control data frame includes at least one of a plan curve down-control frame, a remote control value modification command frame and a remote signaling value modification command frame.

9. The method according to claim 8, characterized in that When the lower control data frame is a plan curve lower control frame, when receiving a command data frame sent by the master station, selecting a first thread corresponding to the type of the command data frame to process the command data frame, and sending a response message obtained after the processing to a second thread used to send a message to the master station, including: Receive a plan curve down control frame sent by the master station, construct a mirror message of the plan curve down control frame through the master station down control command processing thread, and send the mirror message to the second thread, so that the second thread sends the received mirror message to the master station; Among them, the data information in the control frame under the plan curve includes the information body of each plan point on the plan curve, the time information planned by the plan curve, or the data information in the control frame under the plan curve includes the information body of the inflection point on the plan curve, the information body of the first plan point on the plan curve, the information body of the last plan point on the plan curve and the time information planned by the plan curve.

10. The method according to claim 9, characterized in that The type of the summoning data frame also includes a historical plan curve summoning data frame. When the summoning data frame is a historical plan curve summoning data frame, when receiving a command data frame sent by the master station, selecting a first thread corresponding to the type of the command data frame to process the command data frame, and sending a response message obtained after the processing to a second thread used to send a message to the master station, including: Receive the historical plan curve call data frame sent by the main station, construct a response message including the historical plan curve information stored locally through the main station request response thread, and send the response message including the historical plan curve information stored locally to the second thread, so that the second thread sends the received response message to the main station, so that the main station verifies the information of the historical plan curve in the response message; Among them, the information of the historical plan curve includes the information body of each plan point on the historical plan curve, the time information planned by the historical plan curve, or the information of the historical plan curve includes the information body of the inflection point on the historical plan curve, the information body of the first plan point on the historical plan curve, the information body of the last plan point on the historical plan curve and the time information planned by the historical plan curve.

11. A data communication device based on IEC104 protocol, characterized in that: include: A connection establishment module is used to establish a communication connection with the main station using a TCP connection thread; A command data frame processing module, configured to, upon receiving a command data frame sent by the master station, select a first thread corresponding to the type of the command data frame to process the command data frame, and send a response message obtained after the processing to a second thread used to send messages to the master station, wherein the types of the first thread include a master station request response thread and a master station down-control command processing thread, and the types of the command data frame include a summon data frame and a down-control data frame; The data transmission processing module is used to construct a transmission message by using the third thread for transmitting information to the master station when there is a transmission demand, and send the transmission message to the second thread; A message sending module is used to send the received response message and / or the sent message to the main station through the second thread.

12. A computer device, characterized in that: include: a memory configured to store instructions; as well as A processor is configured to call the instructions from the memory and implement the data communication method based on the IEC104 protocol according to any one of claims 1 to 10 when executing the instructions.

13. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores instructions, and the instructions are used to enable a machine to execute the data communication method based on the IEC104 protocol according to any one of claims 1 to 10.