Service port automatic negotiation method of energy storage power station IEC104 protocol

Through the expansion of the IEC104 protocol, the automatic consultation port between the IEC104 sub -station and the main station is realized, and the problem of manual modification of the server port in the existing technology in the existing technology is solved, and the configuration efficiency and network reliability are improved.

CN119363678APending Publication Date: 2025-01-24SHANDONG ELECTRIC GRP DIGITAL TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411465502.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-21
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

In the prior art, changes to the IEC104 protocol service port need to be manually modified on both the IEC104 main station and sub-station, resulting in high time cost and easy configuration errors, affecting network security and performance.

Method used

By extending the IEC104 protocol and adding service port change request, change confirmation and change end frames, IEC104 substations can automatically negotiate service port changes with the IEC104 master station to achieve automatic port adaptation.

Benefits of technology

After the IEC104 sub -station port was changed, the IEC104 main station port was automatically adapted, simplified the configuration steps, reducing the complexity and error probability of operating, and improving the reliability and performance of the network.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119363678A_ABST
    Figure CN119363678A_ABST
Patent Text Reader

Abstract

The invention relates to an energy management system of an energy storage power station, in particular to an automatic negotiation method for a service port of an IEC104 protocol of the energy storage power station. According to the invention, the IEC104 protocol is expanded to support that the IEC104 master station replies that the port is available or conflicts after the IEC104 substation initiates the service port change request, and the IEC104 substation changes the port or finishes the change operation after receiving the reply of the IEC104 master station, so that the purpose of automatic adaptation of the IEC104 master station port after the IEC104 substation port is changed is achieved, and the service port change efficiency is improved. The problem that in the prior art, the modification cost of manual port distribution is large is solved. After the invention is adopted, the change of the IEC104 service port only needs to modify the configuration at the IEC104 substation end, and the IEC104 substation automatically synchronizes the port change to each master station, thereby not only simplifying the configuration steps, but also avoiding the configuration omission of the IEC104 master station.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of energy management system (EMS, hereinafter referred to as "EMS") of energy storage power station using IEC104 protocol for data acquisition, and specifically to a method for how EMS, as an IEC104 master station, automatically negotiates a service port with an IEC104 data acquisition device, and when there is a conflict between the default local port 2404 of the IEC104 substation device, changes the service port of the IEC104 protocol to other ports, and automatically synchronizes the configuration to the EMS. Background Art

[0002] When EMS collects or forwards data, the commonly used protocols include DL / T860, IEC104, Modbus-TCP, etc. Among them, the IEC104 protocol has the best flexibility and simple configuration. Therefore, in the actual engineering application of EMS, the IEC104 protocol is the most widely used for data collection and forwarding. At the same time, EMS may contain multiple IEC104 master stations, and the following text is based on this situation.

[0003] However, in the development of energy storage power stations, with the continuous growth of scale and the continuous improvement of the monitoring requirements of the entire station, the number of data acquisition devices and edge computing nodes continues to grow, and the requirements for data access and forwarding are also growing. In actual applications, the same system usually assumes the functions of data access and data forwarding at the same time. In this case, if the data forwarding adopts the IEC104 protocol, when forwarding to multiple IEC104 master stations, the default port is 2404. Without the use of specific technologies such as "port reuse" or "port sharing", different services cannot monitor the same port, but the use of "port reuse" or "port sharing" is highly dependent on the reliability of the system itself. If it is not handled carefully, it is easy to cause network security risks and network performance degradation. In combination with the above considerations, in actual engineering applications, manual allocation is usually used to determine the service port for the communication between the IEC104 substation and the IEC104 master station. However, in the face of the requirements for changing the communication port of the IEC104 protocol, it is impossible to change the IEC104 substation or IEC104 port. The requirements for automatic port adaptation have a high actual cost of change. Summary of the invention

[0004] The technical problem to be solved by the present invention is: to extend the IEC104 protocol to support that after the IEC104 substation initiates a service port change request, the IEC104 main station replies that the port is available or the port conflicts, and after receiving the reply from the IEC104 main station, the IEC104 substation changes the port or ends the change operation, so as to achieve the purpose of automatically adapting the IEC104 main station port after the IEC104 substation port is changed, so as to solve the problem of high cost of manual allocation of actual changes in the prior art.

[0005] In order to solve the technical problem, the technical solution adopted by the present invention is: a service port automatic negotiation method of the IEC104 protocol of an energy storage power station, comprising the following steps: S01. Expand the IEC104 protocol. Add service port change request frame, service port change confirmation frame and service port change end frame to the IEC104 substation. Add service port available frame, service port conflict frame and service port change end confirmation frame to the IEC104 master station. Expand the ASDU field of the IEC104 protocol frame, add service port change identifier to the type identifier, add service port change request, service port change response, service port change confirmation and service port change end to the transmission reason, fill the target service port to be changed in the information object address, and add fill values ​​for service port change request, change response, change confirmation and change end to the information element. S02, the user requests to change the service port, the IEC104 substation sends a service port change request frame to the IEC104 main station, after receiving the service port change request frame, the IEC104 main station determines the available status of the target port, and then replies with a service port change response frame to the IEC104 substation; S03. After receiving the service port change response frame replied by the IEC104 master station, the IEC104 slave station parses the available status of the target port in the IEC104 master station. If the target port in the IEC104 master station is in the available status, the port change action is continued and a service port change execution frame is sent to the IEC104 master station. Otherwise, the port change action is terminated and a service port change cancellation frame is sent to the IEC104 master station. S04, after receiving the service port change cancel frame sent by the IEC104 substation, the IEC104 master station executes the change cancel action and replies with a service port change cancel confirmation frame to the IEC104 substation; S05. After the IEC104 master station receives the service port change execution frame sent by the IEC104 substation, the IEC104 substation disconnects the communication with each IEC104 master station 104, and the IEC104 substation and the IEC104 master station execute the port change action; S06. The IEC104 master station sends a port change action execution success or failure frame to the IEC104 slave station. After receiving the frame, the IEC slave station sends a port change execution confirmation frame to the IEC104 master station.

[0006] Furthermore, the IEC104 master station is a TCP / IP client. When the IEC104 master station re-initiates a connection to the IEC104 substation with a new port, the prerequisite is that the new service port TCP / IP service in the IEC104 substation is available.

[0007] Furthermore, before the IEC104 substation sends a service port change confirmation frame, the substation is disconnected from all master station channels and restarts the IEC104 service with a new service port to ensure that the port monitoring is normal.

[0008] Furthermore, after receiving the service port change confirmation frame of the substation, the IEC104 master station attempts to establish a channel to the IEC104 substation with the new port, and sets the number of retries and the retry interval to ensure that the channel can be established normally.

[0009] Furthermore, after receiving the service port change request frame, the IEC104 master station parses the target port and checks the port occupancy of the local application. If the target port is occupied, it replies to the slave station that the target port is unavailable, otherwise, it replies that the target port is available.

[0010] Furthermore, if the IEC104 substation provides services for two or more IEC104 master stations at the same time, it is determined whether the port is available after all reply messages from the IEC104 master stations are received.

[0011] Furthermore, the process of determining whether a port is available is as follows: The IEC slave station waits for the reply frame. After receiving the port change request recovery frame of the IEC104 master station, it determines whether all the reply frames of the master station have arrived. If not, it continues to wait for the reply frame. If yes, it parses the reply frame of the IEC104 master station. According to the analysis result, it is determined that all IEC104 master stations reply that the target port is available. If not, it is determined that the port is unavailable, and a port change cancel frame is sent to the IEC104 master station; If yes, it is determined that the port is available, all IEC104 master station channels are disconnected, and then the TCP service is restarted with a new service port, and a port change execution frame is sent to the IEC104 master station.

[0012] Furthermore, the premise for implementing the method is that when the port has not been changed, the channel status between the IEC104 substation and the IEC104 main station is in a normal communication state.

[0013] Furthermore, in the normal communication state, the default port is first used to establish the IEC104 channel, and then the first general call, general call confirmation, general call data reply and general call end are performed. During the period when no general call frame of the IEC104 master station is received, the IEC104 substation detects a change in the telemetry or telesignaling value and actively uploads the changed data to the IEC104 master station.

[0014] Beneficial effects of the present invention: By adopting the technology of the present invention, after the service port of the substation end is modified in the IEC104 protocol, each main station end can automatically use the new service port to initiate a connection with the substation end.

[0015] Compared with manual change of IEC104 protocol service port, the advantages are as follows: 1) Before the technology of the present invention is adopted, the change of the IEC104 protocol service port needs to be modified at both the IEC104 master station and the IEC104 substation, and the time cost of the change is high. Especially when the IEC104 substation provides services for multiple IEC104 master stations at the same time, manual modifications in sequence are prone to errors. Any configuration error of an IEC104 master station will cause the IEC104 channel to fail to be established normally and the service cannot be provided normally. After adopting the technology of the present invention, the change of the IEC104 service port only needs to modify the configuration on the IEC104 substation end, and the IEC104 substation automatically synchronizes the port change to each master station, which not only simplifies the configuration steps, but also avoids the omission of the IEC104 master station configuration.

[0016] 2) Before the technology of the present invention is adopted, the steps of changing the IEC104 protocol service port rely on manual control. First, the channels between the IEC104 substation and each IEC104 main station are disconnected, then the IEC104 substation service port is modified and the service is restarted, and finally a TCP / IP connection establishment request is initiated in the IEC104 main station with the new service port, thereby rebuilding the IEC104 channel with the new service port. The above steps have a strict sequence. For inexperienced operators, it is very easy to confuse the operation sequence, resulting in the failure of the IEC104 channel to be successfully rebuilt with the new service port. After adopting the technology of the present invention, the order of each step in the IEC104 protocol service port change process is determined by the message, without manual participation, which reduces the experience requirements for operators and avoids the failure of service port change caused by misoperation. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 is a flow chart of the present invention; Figure 2 A flowchart for determining whether a port is available; Figure 3 Flowchart for attempting to recreate the channel for the IEC104 master; Figure 4 This is a schematic diagram of the IEC104 protocol frame format; Figure 5 This is a schematic diagram of the 8-bit group of the control field of the U frame; Figure 6 This is a schematic diagram of the 8-bit group of the control field of an I frame; Figure 7 This is a schematic diagram of the definition format of ASDU in an I frame; Figure 8 A schematic diagram of the type identification field change; Fig. 9 This is a schematic diagram of the change of the transmission reason field; Fig.10 This is a schematic diagram of the content of the general call remote signal response frame; Fig.11 This is a schematic diagram of the content of the general call telemetry response frame. DETAILED DESCRIPTION

[0018] The present invention will be further described below in conjunction with the accompanying drawings and specific implementations.

[0019] Example 1 This embodiment discloses a method for automatic negotiation of service ports of the IEC104 protocol of an energy storage power station. The method first expands the IEC104 protocol, and adds a service port change request frame, a service port change confirmation frame, and a service port change end frame to the IEC104 substation, and adds a service port available frame, a service port conflict frame, and a service port change end confirmation frame to the IEC104 main station. The ASDU field of the IEC104 protocol frame is expanded, and a service port change identifier is added to the type identifier, and a service port change request, service port change response, service port change confirmation, and service port change end are added to the transmission reason. The information object address is filled with the target service port to be changed, and the information element is added with a fill value for the service port change request, change response, change confirmation, and change end.

[0020] like Figure 4 As shown, it is a schematic diagram of the IEC104 protocol frame format, which includes an APCI part and an ASDU part, and the ASDU part is expanded.

[0021] This method is implemented in advance when the port has not been changed and the channel status between the IEC104 substation and the IEC104 master station is in normal communication status. Therefore, it is first necessary to use the default port to establish the IEC104 channel. The method is that the IEC104 master station initiates a TCP / IP connection request to the substation. After the TCP channel of the transport layer is established, the link start frame (U frame) of the IEC104 protocol is sent.

[0022] U frame does not have "ASDU definition" part, so the message length of U frame is the length of APCI part, that is, 6 bytes. The control field 8-bit group of U frame is defined as follows: Figure 5 shown.

[0023] After the IEC104 master station successfully establishes a channel with the substation, it immediately sends the first general call command (I frame) to request the substation to upload all the telemetry and telesignaling data of the entire station. After receiving the general call command from the IEC104 master station, the substation replies with a general call confirmation frame and uploads all the telemetry and telesignaling data of the entire station.

[0024] In the IEC104 protocol, the 8-bit group of the control field of the I frame is defined as follows: Figure 6 shown.

[0025] In the IEC104 protocol, the definition format of ASDU in the I frame is as follows Figure 7 As shown, refer to Figure 7 The I frame ASDU format definition shown in the figure shows that the byte lengths of each field of the total call frame sent by the IEC104 master station are: Type identifier: 1 byte; Variable structure qualifier: 1 byte; Transfer reason (LSB / MSB): 2 bytes; Public body address (LSB / MSB): 2 bytes; Information object: consists of two parts: information object address and information element. The information object address is represented by 3 bytes.

[0026] During the life of the IEC104 channel, the IEC104 master station periodically initiates a general call.

[0027] By default, the IEC104 master station sends a general call command every 15 minutes. After receiving the general call command, the slave station uploads all the telemetry and telesignaling data of the entire station again. If the slave station detects a change in telemetry or telesignaling value during the period when it does not receive the general call command from the master station, it will actively upload the changed data to the master station.

[0028] During the life of the IEC104 channel, during the interval between two IEC104 general calls, if the slave station has data changes, it will initiate an active upload.

[0029] The IEC104 substation will use I frames to send the detected changes in telemetry and telesignaling values ​​to the master station in real time, and the master station will use S frames to reply and confirm.

[0030] The IEC104 substation actively sends the position change telesignal, and the type identification is 1 or 3.

[0031] IEC104 actively sends SOE, and the type identifier is 0x1E or 0x1F.

[0032] In order to transmit the request and data information of the changed service port between the IEC104 master station and the slave station, some fields in the ASDU need to be expanded while keeping the basic APCI format unchanged.

[0033] Type identification: Add 0x60 (96 in decimal) type to identify the service port change.

[0034] The type identification field changes as follows Figure 8 As shown, the orange font part is newly added.

[0035] Variable structure qualifier: remains unchanged, always filled with 00.

[0036] The transmission reason needs to add the following value: 0x40 (decimal 64): Service port change request, the IEC104 slave station actively sends it to the IEC104 master station.

[0037] 0x41 (decimal 65): Service port change response, IEC104 master station replies to the slave station.

[0038] 0x42 (decimal 66): Service port change confirmation, sent by the IEC104 slave to the IEC104 master to perform the port change action.

[0039] 0x43 (decimal 67): The service port change is completed. The IEC104 master station replies to the slave station, indicating that the IEC104 master station port change action is completed.

[0040] The transfer reason field changes as follows Fig. 9 As shown, the orange font part is newly added.

[0041] Information object address (3 bytes): Fill in the target service port to be changed.

[0042] Information element (1 byte): When the service port change request is made (IEC104 slave -> IEC104 master), fill in 0x00.

[0043] When responding to a service port change (IEC104 master reply), fill in 0x00 (unavailable) or 0x01 (available).

[0044] When confirming the service port change (IEC104 slave -> IEC104 master), fill in 0x00 (cancel) or 0x01 (execute).

[0045] When the service port change is completed (IEC104 master station reply), fill in 0x00 (execution failure) or 0x01 (execution success).

[0046] After the IEC104 substation sends a service port change request message, it waits for the IEC104 master station's reply. At this time, if the IEC104 substation provides services to two or more IEC104 master stations at the same time, it can determine whether the port is available only after receiving all the IEC104 master station's reply messages.

[0047] After the IEC104 protocol is extended to support the automatic service port change function, its basic workflow is as follows: Figure 1 As shown: First, the user requests to change the service port, and the IEC104 substation sends a service port change request frame to the IEC104 main station. After receiving the service port change request frame, the IEC104 main station determines the available status of the target port, and then replies with a service port change response frame to the IEC104 substation. In this embodiment, after receiving the service port change request frame, the IEC104 main station parses and obtains the target port, checks the port occupancy of the local application, and if the target port is already occupied, replies to the substation that the target port is unavailable, otherwise, replies that the target port is available.

[0048] After receiving the service port change response frame replied by the IEC104 master station, the IEC104 slave station parses out the available status of the target port in the IEC104 master station. If the target port in the IEC104 master station is available, it continues to execute the port change action and sends a service port change execution frame to the IEC104 master station. Otherwise, the port change behavior is terminated and a service port change cancel frame is sent to the IEC104 master station.

[0049] After receiving the service port change cancel frame sent by the IEC104 slave station, the IEC104 master station executes the change cancel action and replies with a service port change cancel confirmation frame to the IEC104 slave station.

[0050] After the IEC104 master station receives the service port change execution frame sent by the IEC104 slave station, the IEC104 slave station disconnects the communication with each IEC104 master station 104, and the IEC104 slave station and the IEC104 master station execute the port change action.

[0051] The IEC104 master station sends a port change action execution success or failure frame to the IEC104 slave station. After receiving the frame, the IEC slave station sends a port change execution confirmation frame to the IEC104 master station.

[0052] In this embodiment, the IEC104 main station is a TCP / IP client. When the IEC104 main station re-initiates a connection to the IEC104 substation with a new port, the prerequisite is that the new service port TCP / IP service in the IEC104 substation is available, otherwise the connection 104 channel cannot be successfully established. This embodiment uses two methods to ensure: 1) Before the IEC104 slave station sends a service port change confirmation frame, the slave station is disconnected from all master station channels and restarts the IEC104 service with a new service port to ensure that the port monitoring is normal.

[0053] 2) After receiving the service port change confirmation frame from the slave station, the IEC104 master station tries to establish a channel to the IEC104 slave station with the new port, sets the number of retries and the retry interval to ensure that the channel can be established normally.

[0054] like Figure 2As shown, the process of determining whether a port is available is: The IEC slave station waits for the reply frame. After receiving the port change request recovery frame of the IEC104 master station, it determines whether all the reply frames of the master station have arrived. If not, it continues to wait for the reply frame. If yes, it parses the reply frame of the IEC104 master station. According to the analysis result, it is determined that all IEC104 master stations reply that the target port is available. If not, it is determined that the port is unavailable, and a port change cancel frame is sent to the IEC104 master station; If yes, it is determined that the port is available, all IEC104 master station channels are disconnected, and then the TCP service is restarted with a new service port, and a port change execution frame is sent to the IEC104 master station.

[0055] like Figure 3 As shown, the IEC104 master station attempts to rebuild the channel process as follows: Receive the IEC104 substation port change confirmation frame, parse the IEC104 substation port change confirmation frame, and then try to establish an IEC104 channel with the IEC104 master station with the new port, and determine whether the channel is successfully established. If successful, reply a port change end frame to the substation. If not, determine whether the number of reconstruction times has been exceeded. If exceeded, reply a port change end frame to the substation. If not exceeded, continue to try to establish an IEC104 channel with the master station.

[0056] Example 2 This embodiment discloses a method for automatically negotiating a service port of an energy storage power station IEC104 protocol, including the following steps: Step 1: Establish a connection and start the link (initiated by the IEC master) The IEC104 master station initiates a TCP / IP connection request to the slave station. After the TCP channel at the transport layer is established, the link start frame (U frame) of the IEC104 protocol is sent.

[0057] In the IEC104 protocol, the hexadecimal message of the link start frame (U frame) initiated by the master station is: 68 04 07 00 00 00 Step 2: Link confirmation (IEC104 slave station reply frame) After receiving the link start frame sent by the master station, the IEC104 slave station replies with a start confirmation frame (U frame) to the master station to confirm the establishment of the IEC104 link.

[0058] In the IEC104 protocol, the hexadecimal message of the link start confirmation frame (U frame) replied by the slave station is: 68 04 0B 00 00 00 Step 3: First general call (initiated by the IEC104 master station) After receiving the link confirmation frame from the slave station, the IEC104 master station sends the first general call command (I frame) to request the slave station to upload all the telemetry and telesignaling data of the entire station.

[0059] In the IEC104 protocol, the first general call (I frame) hexadecimal message sent by the master station is: 68 0E 00 00 00 00 64 01 06 00 01 00 00 00 00 00 The ASDU part is: 64 01 06 00 01 00 00 00 00 00 Step 4: General call confirmation (IEC104 slave station replies to the master station general call) In the IEC104 protocol, the hexadecimal message of the slave station replying to the master station's general call (I frame) is: 68 0E 00 00 01 00 64 01 07 00 01 00 00 00 00 00 The ASDU part is: 64 01 07 00 01 00 00 00 00 14 Step 5: General call data reply (IEC104 slave station responds to the general call) The IEC104 substation generates and sends general call messages of telemetry and telesignaling data to the master station. These messages include but are not limited to telemetry frames without quality description, single-point telesignaling frames and telecontrol terminal frames.

[0060] The hexadecimal message of the general call remote signal response frame (I frame) sent by the IEC104 substation is: 68 1A 02 00 02 00 01 04 14 00 01 00 03 00 00 00 Frame content details as follows Fig.10 shown.

[0061] The hexadecimal message of the general call telemetry response frame (I frame) sent by the IEC104 substation is: 68 13 06 00 02 00 09 82 14 00 01 00 01 07 00 A1 10 00 89 15 00 Frame content details as follows Fig.11 as shown. Step 6: General call ends (IEC104 slave station actively sends to master station) After the IEC104 slave station completes the transmission of the data frame in reply to the general call, it will send a general call end frame to the master station to notify the master station that the general call process is over.

[0062] The general call end frame sent by the IEC104 substation is as follows: 68 0E 08 00 02 00 64 01 0A 00 01 00 00 00 00 14 Step 7: Upload the changed data The IEC104 substation will use I frames to send the detected changes in telemetry and telesignaling values ​​to the master station in real time, and the master station will use S frames to reply and confirm.

[0063] The IEC104 substation actively sends the position change telesignal, the type identification is 1 or 3, and the message is as follows: 68 0E 16 00 06 00 01 01 03 00 01 00 03 00 00 00 The master station replies with a confirmation frame, the message is as follows: 68 04 01 00 18 00 IEC104 actively sends SOE, the type identifier is 0x1E or 0x1F, and the message is as follows: 68 15 1A 00 06 00 1E 01 03 00 01 00 08 00 00 AD 39 1C 10 7A 0B 05 The master station replies with a confirmation frame, the message is as follows: 68 04 01 00 1C 00 Step 8: Service port change request frame (initiated actively by the IEC104 slave station) When changing the default service port 2404 to 2405, the service port change request message is: 68 0E 18 00 06 00 70 00 40 00 01 00 65 09 00 00 After the IEC104 substation sends a service port change request message, it waits for the IEC104 master station's reply. At this time, if the IEC104 substation provides services to two or more master stations at the same time, it can determine whether the port is available only after receiving all the IEC104 master station's reply messages.

[0064] Step 9: Service port change response frame (IEC104 master station responds to slave station request) The target port available message replied by IEC104 master station: 68 0E 08 00 16 00 70 00 41 00 01 00 65 09 00 01 The target port unavailable message replied by the IEC104 master station: 68 0E 08 00 16 00 70 00 41 00 01 00 65 09 00 00 Step 10: Service port change confirmation frame (IEC104 slave station confirms port change) At the IEC104 slave station, if the target port is determined to be available, a service port change execution message is sent to the master station so that the new port of the IEC104 master station initiates a 104 channel establishment request. The message is: 68 0E 18 00 0A 00 70 00 42 00 01 00 65 09 00 01 If the target port is determined to be unavailable, a service port change cancellation message is sent to the master station to notify the IEC104 master station to cancel the service port change behavior. The message is: 68 0E 18 00 0A 00 70 00 42 00 01 00 65 09 00 00 Step 11: Service port change end frame (IEC104 master sends port change result) When the IEC104 master station receives the service port change cancellation message, it directly replies with a service port change end frame, the message is: 68 0E 0C 00 18 00 70 00 43 00 01 00 65 09 00 00 What is described above are only the basic principles and preferred embodiments of the present invention. Improvements and substitutions made by those skilled in the art based on the present invention belong to the protection scope of the present invention.

Claims

1. The automatic negotiation method of the service port of the IEC104 protocol of the energy storage power station is characterized by: The following steps are involved: S01. Expand the IEC104 protocol. The IEC104 substation adds a service port change request frame, a service port change confirmation frame, and a service port change end frame. The IEC104 master station adds a service port available frame, a service port conflict frame, and a service port change end confirmation frame. The ASDU field of the IEC104 protocol frame is expanded, the service port change identifier is added to the type identifier, the service port change request, service port change response, service port change confirmation, and service port change completion are added to the transmission reason, the information object address is filled with the target service port to be changed, and the information element is added with fill values ​​for the service port change request, change response, change confirmation, and change completion; S02, the user requests to change the service port, the IEC104 substation sends a service port change request frame to the IEC104 main station, after receiving the service port change request frame, the IEC104 main station determines the available status of the target port, and then replies with a service port change response frame to the IEC104 substation; S03. After receiving the service port change response frame replied by the IEC104 master station, the IEC104 slave station parses the available status of the target port in the IEC104 master station. If the target port in the IEC104 master station is in the available status, the port change action is continued and a service port change execution frame is sent to the IEC104 master station. Otherwise, the port change action is terminated and a service port change cancellation frame is sent to the IEC104 master station. S04, after receiving the service port change cancel frame sent by the IEC104 substation, the IEC104 master station executes the change cancel action and replies with a service port change cancel confirmation frame to the IEC104 substation; S05. After the IEC104 master station receives the service port change execution frame sent by the IEC104 substation, the IEC104 substation disconnects the communication with each IEC104 master station 104, and the IEC104 substation and the IEC104 master station execute the port change action; S06. The IEC104 master station sends a port change action execution success or failure frame to the IEC104 slave station. After receiving the frame, the IEC slave station sends a port change execution confirmation frame to the IEC104 master station.

2. The automatic negotiation method for service ports of the IEC104 protocol of the energy storage power station according to claim 1 is characterized in that: The IEC104 master station is a TCP / IP client. When the IEC104 master station re-initiates a connection to the IEC104 substation with a new port, the prerequisite is that the new service port TCP / IP service in the IEC104 substation is available.

3. The automatic negotiation method for service ports of the IEC104 protocol of the energy storage power station according to claim 2 is characterized in that: Before the IEC104 slave station sends a service port change confirmation frame, the slave station disconnects from all master station channels and restarts the IEC104 service with a new service port to ensure that the port monitoring is normal.

4. The automatic negotiation method for service ports of the IEC104 protocol of the energy storage power station according to claim 2 is characterized in that: After receiving the service port change confirmation frame from the slave station, the IEC104 master station tries to establish a channel to the IEC104 slave station with the new port, and sets the number of retries and the retry interval to ensure that the channel can be established normally.

5. The automatic negotiation method for service ports of the IEC104 protocol of the energy storage power station according to claim 1 is characterized in that: After receiving the service port change request frame, the IEC104 master station parses the target port and checks the port occupancy of the local application. If the target port is occupied, it replies to the slave station that the target port is unavailable. Otherwise, it replies that the target port is available.

6. The automatic negotiation method for service ports of the IEC104 protocol of the energy storage power station according to claim 1 is characterized in that: If the IEC104 slave station provides services for two or more IEC104 master stations at the same time, it will determine whether the port is available after receiving the reply messages from all IEC104 master stations.

7. The automatic negotiation method for service ports of the IEC104 protocol of the energy storage power station according to claim 6 is characterized in that: The process of determining whether a port is available is as follows: The IEC slave station waits for the reply frame. After receiving the port change request recovery frame of the IEC104 master station, it determines whether all the reply frames of the master station have arrived. If not, it continues to wait for the reply frame. If yes, it parses the reply frame of the IEC104 master station. According to the analysis result, it is determined that all IEC104 master stations reply that the target port is available. If not, it is determined that the port is unavailable, and a port change cancel frame is sent to the IEC104 master station; If yes, it is determined that the port is available, all IEC104 master station channels are disconnected, and then the TCP service is restarted with a new service port, and a port change execution frame is sent to the IEC104 master station.

8. The automatic negotiation method for service ports of the IEC104 protocol of the energy storage power station according to claim 1 is characterized in that: The premise for implementing this method is that when the port has not been changed, the channel status between the IEC104 substation and the IEC104 master station is in a normal communication state.

9. The automatic negotiation method for service ports of the IEC104 protocol of the energy storage power station according to claim 8, characterized in that: In the normal communication state, the default port is first used to establish the IEC104 channel, and then the first general call, general call confirmation, general call data reply and general call end are performed. During the period when no general call frame is received from the IEC104 master station, the IEC104 substation detects changes in telemetry or telesignaling values ​​and actively uploads the changed data to the IEC104 master station.