A method for implementing a GOOSE function of an energy storage converter based on hard coding and decoding
By using a hardware encoding/decoding approach, employing text file modeling and a hardware platform, the decoupling of GOOSE and MMS was achieved. This solves the problems of high development cost, low efficiency, and insufficient network storm suppression capability of GOOSE in existing technologies, ensuring the safe and stable operation of energy storage power stations.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-27
- Publication Date
- 2026-04-07
AI Technical Summary
When implementing the GOOSE function, existing energy storage converters do not fully decouple GOOSE and MMS, resulting in high development costs, low execution efficiency, complex file parsing, inconvenient software maintenance, and a lack of network storm suppression capabilities, which affects grid security.
A hardware-based encoding and decoding approach is adopted, which models GOOSE publish and subscribe through text files, uses ASN.1 encoding and decoding rules for hardware encoding and decoding, and combines ARM and FPGA hardware platforms to achieve network storm suppression and packet filtering. The GOOSE function is completely decoupled from MMS.
It reduces development costs, improves execution efficiency, achieves independence and stability of the GOOSE function, effectively suppresses network storms, and ensures the safe operation of energy storage power stations.
Smart Images

Figure CN120075330B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of energy storage control systems, in particular to an energy storage converter GOOSE function implementation method based on hard coding and decoding. BACKGROUND
[0002] The power conversion system (PCS) is also called power conversion system, which is matched with the energy storage battery stack and connected between the battery stack and the power grid. It is mainly composed of a converter and its control system. The energy management system (EMS) as the brain of the energy storage system operation is responsible for coordinating and managing the BMS, PCS and fire control and environment control system of the energy storage system, realizing system monitoring, power control and energy management, and ensuring the efficient and stable operation of the energy storage system. The PCS controller receives the control instructions of the EMS through communication, controls the converter to charge or discharge the energy storage battery according to the power instruction, can convert the direct current of the energy storage battery into alternating current, and deliver it to the power grid or use it for alternating current load, or can rectify the alternating current of the power grid into direct current to charge the energy storage battery, so as to realize the adjustment of active power and reactive power of the power grid.
[0003] As a key component of the electrochemical energy storage system, the performance and stability of PCS have a crucial influence on the operation of the energy storage power station. The national standard GB / T34120-2023 "Technical requirements for energy storage converter of electrochemical energy storage system" has comprehensive and detailed requirements for it. At present, the grid side, power side and new energy independent sharing energy storage power station all require that the PCS must support DL / T860 (DL / T860 is a power communication protocol developed by China State Grid Corporation, which is a subset based on IEC61850 protocol), that is, it is necessary to fully support the GOOSE protocol to receive the fast control instructions issued by the EMS coordination controller, and the related performance indicators are mostly higher than the national standard requirements, which puts high requirements on PCS manufacturers. At present, PCS manufacturers, especially new PCS manufacturers, have the following problems when developing GOOSE functions:
[0004] Firstly, GOOSE and MMS are not completely decoupled, both of which use a commercial software package and use the same ASN.1 coding and decoding library, which increases the development cost of PCS, and the execution efficiency of GOOSE publishing and subscribing is difficult to guarantee, and the performance index is not satisfactory;
[0005] Secondly, GOOSE and MMS models are built in the same CID file, the file parsing is complex, and after parsing, the GOOSE related information needs to be extracted for use. If either GOOSE or MMS modifies the model file, the software developers of the other party need to be notified for synchronization, which is not convenient to operate and is prone to errors;
[0006] Thirdly, where the data published by the GOOSE publishing function is taken from and how the subscribed data is stored by the GOOSE subscribing function are commonly associated in the CID file in a complex manner or by manually modifying the code, and different projects use different codes, which is extremely inconvenient for software maintenance;
[0007] Finally, the PCS does not add a network storm suppression function, and when a network storm of GOOSE and other multicast messages occurs in the control layer network, the network storm suppression function cannot effectively resist massive message intrusion and effective message filtering, and the PCS usually abnormally crashes, which seriously affects the safe operation of the energy storage power station and even the power grid. SUMMARY
[0008] The purpose of the present application is to provide a hard-coded based energy storage converter GOOSE function implementation method, which completely decouples GOOSE and MMS, uses a simple text file to realize GOOSE modeling, GOOSE function and specific application are independent, software maintenance is extremely convenient, can realize control network network storm suppression and GOOSE message effective filtering, has the advantages of low cost, high operation efficiency, software modular design, good performance and stability and the like.
[0009] To achieve the above purpose, the present application provides the following scheme:
[0010] A hard-coded based energy storage converter GOOSE function implementation method, comprising the following steps:
[0011] Based on a text file, GOOSE publishing and GOOSE subscribing modeling are performed to obtain a GOOSE publishing model file and a GOOSE subscribing model file;
[0012] The GOOSE publishing model file and the GOOSE subscribing model file are parsed to obtain relevant configuration parameters of GOOSE publishing and GOOSE subscribing, respectively;
[0013] Based on the relevant configuration parameters of GOOSE publishing and GOOSE subscribing, GOOSE publishing and GOOSE subscribing functions are realized; wherein the GOOSE publishing function is realized, comprising:
[0014] Based on the relevant configuration parameters of GOOSE publishing, hard coding of a GOOSE message is performed using an ASN.1 encoding rule;
[0015] The GOOSE publishing task is initiated. If the GOOSE publishing data is modified by the upper-layer application, the GOOSE message is updated and the change message transmission is initiated. If the GOOSE publishing data has not changed, the message is retransmitted according to the retransmission mechanism. The upper-layer application modifies the GOOSE publishing data in real time and updates it to the publishing data cache array. The GOOSE publishing function monitors whether the GOOSE publishing data has changed in real time. The two are independent of each other.
[0016] Implementing GOOSE subscription functionality includes:
[0017] Based on the relevant configuration parameters of GOOSE subscription, perform hardware decoding of GOOSE messages based on ASN.1 decoding rules, and initialize GOOSE subscription parameters;
[0018] Start the GOOSE subscription task. The GOOSE subscription function stores the GOOSE subscription data into the subscription data cache array. The upper layer application obtains the latest GOOSE subscription data in the subscription data cache array in real time. The two are independent of each other.
[0019] The upper-layer application is mounted on a hardware platform composed of ARM and FPGA. The hardware platform has a dual packet filtering mechanism with FPGA-based network storm suppression function and MAC Hash filtering algorithm based on ARM network driver layer.
[0020] Furthermore, the step of parsing the GOOSE publishing model file to obtain the relevant configuration parameters for GOOSE publishing specifically includes:
[0021] Construct a mapping relationship between the GOOSE publishing model file and the published data. The GOOSE publishing model file contains the destination MAC, source MAC, VLAN identifier, APPID, gocbRef, datSet, goID, confRev, MaxTime, MinTime, numDatSetEntries, and dataEntryMap of the data entries involved in the GOOSE message. numDatSetEntries represents the number of data entries published in this GOOSE. dataEntryMap defines the data type and data source of each data entry according to the order in which the data is sent. Configure the published data type and data source through the GOOSE publishing model file.
[0022] Furthermore, the step of parsing the GOOSE subscription model file to obtain the relevant configuration parameters for the GOOSE subscription specifically includes:
[0023] Construct a mapping relationship between the GOOSE subscription model file and the subscription data. The GOOSE subscription model file contains the destination MAC, VLAN identifier, APPID, gocbRef, datSet, goID, confRev, twnWire, numDatSetEntries, and subscription data entries dataEntryMap involved in the GOOSE message. Among them, twnWire contains information on whether it is a dual-network subscription, numDatSetEntries indicates the number of data entries subscribed to in this GOOSE, and dataEntryMap defines the data type and data source of each subscription data according to the order of subscription data. The data type of the subscription data is consistent with the data type of the sent data. Configure the data type and data source of the subscription through the GOOSE subscription model file.
[0024] Furthermore, the relevant configuration parameters published by GOOSE are hard-coded using the ASN.1 encoding rule, specifically including:
[0025] (1.1) Parse the GOOSE publishing model file, obtain the relevant configuration parameters, and define a structure variable to store the encoded values for subsequent steps;
[0026] (1.2) Calculate the length of the APDU data entry part of the GOOSE message based on the number and type of data entries, complete the TLV encoding of the data entry header allData, and store the encoded value into the structure variable;
[0027] (1.3) Complete the TLV hard encoding of the GOOSE control block part of the GOOSE message APDU, including numDatSetEntries, ndsCom, confRev, test, sqNum, StNum, t, goID, datSet, timeAllowedtoLive, gocbRef and goosePDU, and store the encoded values into the structure variable.
[0028] (1.4) Initialize the structure variables of the GOOSE header fields such as MAC, ethType, APPID and length;
[0029] (1.5) Based on the latest released data (GooseOutValBool, GooseOutValInt32, GooseOutValFloat and GooseOutValInt16), complete the TLV encoding of each data in the APDU data entry part of the GOOSE message, store the encoded value into the structure variable, allocate a buffer based on the structure variable and fill each field of the message using the memcpy basic function, and finally generate a complete GOOSE message;
[0030] Steps (1.1)-(1.5) are the device startup call parts, which only need to be called once when the device is powered on.
[0031] Furthermore, regarding the initiation of the GOOSE publishing task, if the GOOSE publishing data is modified by the upper-layer application, the GOOSE message is updated and the change message transmission is initiated; if the GOOSE publishing data has not changed, the message is retransmitted according to the retransmission mechanism, specifically including:
[0032] (1.6) Determine whether the values of the published data (GooseOutValBool, GooseOutValInt32, GooseOutValFloat and GooseOutValInt16) of the upper layer application have changed. If they have changed, update the timeAllowedtoLive, t, stNum, sqNum and data values of the GOOSE message and send the change message immediately.
[0033] (1.7) If the value of the published data does not change, determine whether the GOOSE retransmission time has arrived. If the retransmission time has arrived, update the timeAllowedtoLive and sqNum of the message and send the message.
[0034] (1.8) If the retransmission time has not arrived, determine whether the system maintenance status has changed. If the maintenance status has changed, update the test in the message; otherwise, continue to execute step (1.6).
[0035] Furthermore, the configuration parameters related to GOOSE subscription, which involve hard decoding of GOOSE messages based on ASN.1 decoding rules and initialization of GOOSE subscription parameters, specifically include:
[0036] (2.1) Parse the GOOSE subscription model file, obtain the relevant configuration parameters, and define a structure variable to store the decoded values for subsequent steps;
[0037] (2.2) Initialize the message header (dstMac, ethType, and APPID, etc.), the GOOSE control block part of the GOOSE message APDU (including goosePDU, gocbRef, timeAllowedtoLive, datSet, goID, t, StNum, sqNum, test, confRev, ndsCom, and numDatSetEntries, etc.) and the data entry part of the GOOSE message APDU (including data, entry header allData, and various data entry types) based on the subscription configuration parameters, and obtain the TLV decoding value;
[0038] (2.3) Send dstMac, ethType and APPID to the FPGA for GOOSE subscription message filtering and network storm suppression, configure dstMac to the ARM Hash filter register for GOOSE subscription message MAC filtering, and start the dual message filtering mechanism built by ARM and FPGA.
[0039] Steps (2.1)-(2.3) are the device startup call parts, which only need to be called once when the device is powered on.
[0040] Furthermore, the process of initiating the GOOSE subscription task involves the GOOSE subscription function storing the GOOSE subscription data in a subscription data cache array. The upper-layer application then retrieves the latest GOOSE subscription data from the subscription data cache array in real time. Specifically, this includes:
[0041] (2.4) The FPGA implements GOOSE packet filtering and network storm suppression based on dstMAc, ethType and APPID;
[0042] (2.5) The ARM performs network driver layer hash filtering on the GOOSE messages sent from the FPGA based on dstMac to achieve two-level filtering. Messages that pass the filtering are sent to the upper layer application of the ARM.
[0043] (2.6) The ARM upper-layer application verifies the GOOSE subscription message APDU GOOSE control block based on structure variables (including goosePDU, gocbRef, timeAllowedtoLive, datSet, goID, t, StNum, sqNum, test, confRev, ndsCom and numDatSetEntries, etc.);
[0044] (2.7) The ARM upper-layer application continues to verify the APDU data entries (including allData and each data entry type) through the message verified by the APDU GOOSE control block;
[0045] (2.8) ARM updates the subscription data that has passed the data entry verification to the subscription data cache array for use by upper layer applications. All messages that have not passed the verification will be discarded.
[0046] Furthermore, steps (2.4)-(2.5) specifically include:
[0047] Verify the dstMac, ethType, and APPID of the message. Only messages that are exactly the same are considered subscription messages; otherwise, they are discarded.
[0048] If the message is determined to be a subscription message and the previous network storm has not yet recovered, then it is determined whether there are M consecutive GOOSE messages with the same dstMac, ethType, and APPID parameters with a reception time interval > T2. If so, the network storm has recovered and the message is received; otherwise, the message is discarded.
[0049] If a message is a subscription message and there are N consecutive GOOSE messages with the same dstMac, ethType, and APPID parameters, with a reception time interval of ≤T1, then a network storm is considered to have occurred, and the message is discarded directly; where T2>T1.
[0050] When the FPGA determines that no network storm has occurred and the packet is a subscription packet, it will send the packet to the ARM network driver layer. The ARM driver layer will perform a second filtering using the MAC Hash algorithm. Packets that pass the filtering will be sent to the upper-layer application of the ARM, while packets that fail will be discarded directly.
[0051] Furthermore, the hardware platform composed of ARM and FPGA includes a multi-core processor, which includes at least ARM core one, ARM core two and FPGA core;
[0052] The ARM core 1 runs on a bare core. The GOOSE publish and GOOSE subscription functions of the energy storage converter are deployed on the ARM core 1. The ARM core 2 runs on the Linux operating system and completes the external communication, logic processing and data storage of the energy storage converter.
[0053] The FPGA core is responsible for GOOSE message filtering and network storm suppression, and is also used for energy storage converter control and protection functions.
[0054] According to specific embodiments provided by the present invention, the method for implementing the GOOSE function of an energy storage converter based on hard encoding and decoding disclosed by the present invention has the following technical effects:
[0055] First, GOOSE publishing and subscription modeling is performed based on text files. This process, based on CID files, can be manually edited or automatically generated by software tools. Compared to the complex MMS CID files, this model file is simpler and more direct to parse, easier to operate, and easier to maintain. Second, parsing the GOOSE model file implements ASN.1 hardware encoding and decoding of GOOSE messages. This invention completely decouples GOOSE and MMS and uses hardware encoding and decoding to implement ASN.1 encoding and decoding of GOOSE messages. Compared to commercial software, this method has lower development costs, higher software execution efficiency, and excellent and stable performance indicators. Third, the GOOSE function and the upper-layer application are completely independent. The upper-layer application updates the data to be sent to the publish data cache and reads the data from the subscription data cache in real time. The GOOSE function sends out the publish data in real time and updates the subscribed data to the subscription data cache in real time. Finally, this invention uses a high-performance ARM and high-capacity FPGA hardware platform, featuring FPGA-based network storm suppression and MAC based on the ARM network driver layer. The hash filtering algorithm provides double protection against control network anomalies, fundamentally preventing PCS from crashing under abnormal network conditions and effectively ensuring the safe operation of energy storage power stations.
[0056] In summary, this invention provides a simple method for implementing GOOSE functionality, completely decoupled from the complex MMS protocol. It uses a simple, independent text file for modeling and implements GOOSE message encoding and decoding using simple C language. The GOOSE function is independent of specific applications and can achieve network storm suppression and effective filtering of GOOSE messages in the control network. For PCS manufacturers, especially newly established ones, it has advantages such as low cost, high operating efficiency, modular software design, good performance, and stability. Attached Figure Description
[0057] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0058] Figure 1 This is a flowchart illustrating the method for implementing the GOOSE function of an energy storage converter based on hard encoding and decoding according to an embodiment of the present invention.
[0059] Figure 2 This is a diagram illustrating the GOOSE release modeling and release data mapping relationship in an embodiment of the present invention.
[0060] Figure 3 This is a diagram illustrating the GOOSE subscription modeling and subscription data mapping relationship in an embodiment of the present invention.
[0061] Figure 4 This is the encoding specification for the TAG (Translation Object) identifier of the PDU (Power Item Descriptor) in the GOOSE message according to an embodiment of the present invention.
[0062] Figure 5 This is a diagram defining the data structure type for GOOSE message APDU encoding and decoding in an embodiment of the present invention.
[0063] Figure 6 GOOSE releases a hard-coded flowchart for an embodiment of the present invention;
[0064] Figure 7 This is a flowchart of the GOOSE subscription decoding process according to an embodiment of the present invention;
[0065] Figure 8 This is a schematic diagram of the hardware platform structure according to an embodiment of the present invention;
[0066] Figure 9 This is a flowchart illustrating the hardware filtering process for GOOSE subscription messages in an embodiment of the present invention. Detailed Implementation
[0067] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0068] The purpose of this invention is to provide a method for implementing the GOOSE function of an energy storage converter based on hardware encoding and decoding. Firstly, it completely decouples GOOSE and MMS, and uses hardware encoding and decoding to implement the ASN.1 encoding and decoding function of GOOSE messages. Compared with commercial software development, this method has lower development costs, higher software execution efficiency, and superior and stable performance indicators. Secondly, this invention uses a simple text file to implement GOOSE modeling. Compared with the complex MMS CID file, this model file is simpler and more direct to parse, easier to operate, and easier to maintain. Thirdly, this invention completely separates the GOOSE function from specific application services. Through the GOOSE model file, it is possible to flexibly associate GOOSE with data entries, GOOSE with data entries, and business applications. That is, both PCS receiving data (instructions from EMS) and PCS sending data (uploading EMS operating status) can be configured arbitrarily. In different engineering applications, the GOOSE function can be implemented by modifying only the model file without modifying the software. The entire mapping process is simple and efficient, and software maintenance is extremely convenient. Finally, this invention uses a high-performance ARM and high-capacity FPGA hardware platform, which has FPGA-based network storm suppression function and MAC based on the ARM network driver layer. The hash filtering algorithm provides double protection against control network anomalies, fundamentally preventing PCS from crashing under abnormal network conditions and effectively ensuring the safe operation of energy storage power stations.
[0069] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0070] like Figure 1 As shown, the method for implementing the GOOSE function of an energy storage converter based on hard encoding and decoding provided by the present invention includes the following steps:
[0071] (1) Model GOOSE publishing and GOOSE subscription based on text files to obtain GOOSE publishing model files and GOOSE subscription model files; this process can be manually edited or automatically generated by software tools based on CID files.
[0072] (2) Parse the GOOSE publish model file and the GOOSE subscription model file to obtain the relevant configuration parameters for GOOSE publish and GOOSE subscription respectively;
[0073] (3) Implement GOOSE publishing and GOOSE subscription functions based on the relevant configuration parameters of GOOSE publishing and GOOSE subscription:
[0074] (3.1) Implement GOOSE publishing functionality, including:
[0075] Based on the relevant configuration parameters released by GOOSE, the GOOSE messages are hard-coded using the ASN.1 encoding rules;
[0076] The GOOSE publishing task is initiated. If the GOOSE publishing data is modified by the upper-layer application, the GOOSE message is updated and the change message transmission is initiated. If the GOOSE publishing data has not changed, the message is retransmitted according to the retransmission mechanism. The upper-layer application modifies the GOOSE publishing data in real time and updates it to the publishing data cache array. The GOOSE publishing function monitors whether the GOOSE publishing data has changed in real time. The two are independent of each other.
[0077] (3.2) Implement the GOOSE subscription function, including:
[0078] Based on the relevant configuration parameters of GOOSE subscription, perform hardware decoding of GOOSE messages based on ASN.1 decoding rules, and initialize GOOSE subscription parameters;
[0079] Start the GOOSE subscription task. The GOOSE subscription function stores the GOOSE subscription data into the subscription data cache array. The upper layer application obtains the latest GOOSE subscription data in the subscription data cache array in real time. The two are independent of each other.
[0080] The upper-layer application is mounted on a hardware platform composed of ARM and FPGA. The hardware platform has a dual packet filtering mechanism with FPGA-based network storm suppression function and MAC Hash filtering algorithm based on ARM network driver layer.
[0081] First, the GOOSE publishing and subscription of this invention adopts simple text file modeling, which completely decouples it from the CID model of the MMS service. Furthermore, the GOOSE function and specific applications are associated with simple data, making model configuration and operation convenient and model parsing simple. The software is based on modular design, and the GOOSE function, MMS service, and upper-layer applications are independent of each other, resulting in high system maintainability.
[0082] Specifically, in step (2), parsing the GOOSE publishing model file and obtaining the relevant configuration parameters for GOOSE publishing includes:
[0083] like Figure 2As shown, a mapping relationship between the GOOSE publishing model file and the published data is constructed. The GOOSE publishing model file contains the destination MAC, source MAC, VLAN identifier, APPID, gocbRef, datSet, goID, confRev, MaxTime, MinTime, numDatSetEntries, and dataEntryMap of the data entries involved in the GOOSE publishing message. numDatSetEntries represents the number of data entries published by this GOOSE. dataEntryMap defines the type of each data entry and its source according to the order in which the data is sent. This invention defines commonly used data types such as single-point status, two-point status, quality, time, signed integer (16-bit and 32-bit), unsigned integer (16-bit and 32-bit), and floating-point (other types can be extended if needed), and defines the data arrays corresponding to each data type. The data types and data sources to be published can be flexibly configured through the GOOSE publishing model file. Upper-layer applications can update array buffer data such as GooseOutValBool, GooseOutValInt32, GooseOutValFloat, and GooseOutValInt16 at any time according to actual conditions. GOOSE publishes tasks to determine whether these data have changed. When they have changed, the task is issued immediately. GOOSE publishes tasks completely independently from upper-layer applications.
[0084] Specifically, in step (2), parsing the GOOSE subscription model file and obtaining the relevant configuration parameters of the GOOSE subscription includes:
[0085] Construct a mapping relationship between the GOOSE subscription model file and the subscription data. The GOOSE subscription model file contains the destination MAC, VLAN identifier, APPID, gocbRef, datSet, goID, confRev, twnWire (whether it is a dual-network subscription), numDatSetEntries, and dataEntryMap of subscription data entries involved in the GOOSE message. numDatSetEntries represents the number of data entries contained in this GOOSE. dataEntryMap defines the type of each subscription data and where the data is placed according to the order of subscription data. The data type is consistent with the GOOSE publication. The GOOSE subscription model file allows for flexible configuration of the data type and data source of the subscription. Upper-layer applications can obtain array data such as GooseInValBool, GooseInValInt32, GooseInValFloat, and GooseInValInt16 in real time and respond accordingly. When the GOOSE subscription task receives a changed GOOSE message, it immediately updates the data in arrays such as GooseInValBool, GooseInValInt32, GooseInValFloat, and GooseInValInt16 for use by upper-layer applications. The GOOSE subscription task and the upper-layer application are completely independent.
[0086] If you need to configure multiple GOOSE publishers or GOOSE subscriptions, simply configure multiple GOOSEs in the GOOSE publisher or GOOSE subscription text model file; the data mapping method remains unchanged.
[0087] Secondly, this invention uses hardware encoding and decoding to implement ASN.1 encoding and decoding for GOOSE publishing and GOOSE subscription, instead of using expensive commercial encoding and decoding libraries. It also completely decouples the encoding and decoding of the MMS service, resulting in low product development costs. The GOOSE function is developed on bare metal, which is more efficient than the operating system-based approach. The GOOSE communication performance is also better. The software is based on a modular design, and the GOOSE function and MMS service are independent of each other, resulting in high system maintainability.
[0088] GOOSE follows the ASN.1 basic encoding standard, which uses a triplet format of TAG (also called TYPE), LENGTH, and VALUE, abbreviated as TLV. All fields (T, L, or V) are a series of 8-bit byte arrays. If needed, the value V can be reconstructed into a TLV triplet. The transmission syntax is based on 8-bit byte arrays and is oriented towards "Big Endian (high byte first)". The length field L defines the length of V in the TLV triplet.
[0089] Hardware encoding / decoding refers to the development of software functionality on the bare CPU through simple manual encoding, rather than relying on an operating system or third-party function libraries. Because the GOOSE message structure is relatively simple, and because GOOSE functionality development is often based on the bare CPU for real-time requirements, these factors provide the prerequisites for implementing GOOSE functionality through hardware encoding / decoding. The steps of GOOSE hardware encoding / decoding are briefly described below.
[0090] First, determine the T value of each part of the GOOSE message APDU. Figure 4 This invention patent uses a hardware encoding and decoding method to implement the TAG encoding values of each content identifier in the GOOSE message APDU. The corresponding TAG values can be used directly during the GOOSE encoding and decoding process, which is convenient and fast.
[0091] Secondly, define dedicated data structure types for GOOSE messages and each data item of APDU, see details below. Figure 5 As shown. TLV_LongHdr, TLV_MiddleHdr, and TLV_Hdr are used for TLV encoding / decoding of goosePDU or allData data with LENGTH≤127, 127<LENGTH≤255, and 255<LENGTH; TLV_String is used for TLV encoding / decoding of goID; TLV_ObjRefString is used for TLV encoding / decoding of gocbRef; TLV_U8 is used for TLV encoding / decoding of test, ndsCom, and numDataSetEntries; TLV_U16 is used for TLV encoding / decoding of numDataSetEntries with more than 127 entries; TLV_U32 is used for TLV encoding / decoding of timeAllowedtoLive, stNum, sqNum, and confRev; TLV_Time is used for TLV encoding / decoding of t; TGOOSE_PDU is used for encoding / decoding of GOOSE message APDU; and TGOOSE_Payload is used for encoding / decoding of GOOSE message Ethernet PDU. This invention can automatically adopt the corresponding structure definition to realize the hardware encoding and decoding function of the message according to the length of the encoded object.
[0092] Third, define the above structure variables. Define as many such variables as there are GOOSE publishes and GOOSE subscribers. Based on the configuration parameters of the GOOSE publish and subscribe model files, initialize the TLV values of the structure variables, which will then be used for encoding GOOSE publish messages and decoding GOOSE subscribe messages.
[0093] Figure 6 and Figure 7These are flowcharts for the hard encoding and decoding of GOOSE publish and GOOSE subscribe messages. The ASN.1 encoding and decoding of GOOSE messages can be implemented using simple C language. The encoding and decoding process is simple, easy to implement, efficient, and has low commercial cost.
[0094] like Figure 6 As shown, the GOOSE hard-coding process consists of two parts: the device power-on call part and the timer interrupt cycle call part. The device power-on call part, i.e., step (3.1), involves hard-coding the GOOSE message using the ASN.1 encoding rules based on the relevant configuration parameters published by GOOSE. This can be divided into five steps, specifically including:
[0095] (1.1) Parse the GOOSE publishing model file, obtain the relevant configuration parameters, and define a structure variable to store the encoded values for subsequent steps;
[0096] (1.2) Calculate the length of the APDU data entry part of the GOOSE message based on the number and type of data entries, complete the TLV encoding of the data entry header allData, and store the encoded value into the structure variable;
[0097] (1.3) Complete the TLV hard encoding of the GOOSE control block part of the GOOSE message APDU, including numDatSetEntries, ndsCom, confRev, test, sqNum, StNum, t, goID, datSet, timeAllowedtoLive, gocbRef and goosePDU, and store the encoded values into the structure variable.
[0098] (1.4) Initialize the structure variables of the GOOSE header fields such as MAC, ethType, APPID and length;
[0099] (1.5) Based on the latest released data (GooseOutValBool, GooseOutValInt32, GooseOutValFloat and GooseOutValInt16), complete the TLV encoding of each data in the APDU data entry part of the GOOSE message, store the encoded value into the structure variable, allocate a buffer based on the structure variable and fill each field of the message using the memcpy basic function, and finally generate a complete GOOSE message;
[0100] Steps (1.1)-(1.5) are the device startup call parts, which only need to be called once when the device is powered on.
[0101] In the periodic interrupt call part, namely step (3.1), the GOOSE publishing task is started. If the GOOSE publishing data is modified by the upper-layer application, the GOOSE message is updated and the change message transmission is started. If the GOOSE publishing data has not changed, the message is retransmitted according to the retransmission mechanism, specifically including:
[0102] (1.6) Determine whether the values of the published data (GooseOutValBool, GooseOutValInt32, GooseOutValFloat and GooseOutValInt16) of the upper layer application have changed. If they have changed, update the timeAllowedtoLive, t, stNum, sqNum and data values of the GOOSE message and send the change message immediately.
[0103] (1.7) If the value of the published data does not change, determine whether the GOOSE retransmission time has arrived. If the retransmission time has arrived, update the timeAllowedtoLive and sqNum of the message and send the message.
[0104] (1.8) If the retransmission time has not arrived, determine whether the system maintenance status has changed. If the maintenance status has changed, update the test in the message; otherwise, continue to execute step (1.6).
[0105] like Figure 7 As shown, the GOOSE subscription hard decoding process consists of two parts: the device boot-up call part and the network interrupt call part. The device boot-up call part, i.e., step (3.2), involves hard decoding of the GOOSE message based on the relevant configuration parameters of the GOOSE subscription and the ASN.1 decoding rules, and initializing the GOOSE subscription parameters. Specifically, this includes:
[0106] (2.1) Parse the GOOSE subscription model file, obtain the relevant configuration parameters, and define a structure variable to store the decoding values for subsequent steps; the structure variable contains two parts: the initialization of the GOOSE message header and the initialization of the GOOSE message APDU (including the APDU control block part and the APDU data entry part);
[0107] (2.2) Initialize the message header (dstMac, ethType, and APPID, etc.), the GOOSE control block part of the GOOSE message APDU (including goosePDU, gocbRef, timeAllowedtoLive, datSet, goID, t, StNum, sqNum, test, confRev, ndsCom, and numDatSetEntries, etc.), and the GOOSE message APDU data entry part (including data, entry header allData, and various data entry types) based on the subscription configuration parameters, and obtain the TLV decoding value; where, the complete GOOSE message consists of two parts: the GOOSE message header and the GOOSE message APDU. The parameters of the GOOSE message header (dstMac, ethType, and APPID, etc.) do not need to be encoded and decoded by ASN.1, while the parameters of the GOOSE message APDU part (including the APDU GOOSE control block part and the APDU data entry part) need to be encoded and decoded by ASN.1;
[0108] (2.3) Send dstMac, ethType and APPID to the FPGA for GOOSE subscription message filtering and network storm suppression, configure dstMac to the ARM Hash filter register for GOOSE subscription message MAC filtering, and start the dual message filtering mechanism built by ARM and FPGA.
[0109] Steps (2.1)-(2.3) are the device startup call parts, which only need to be called once when the device is powered on.
[0110] In the network interruption call section, specifically step (3.2), the GOOSE subscription task is initiated. The GOOSE subscription function stores the GOOSE subscription data in a subscription data cache array. The upper-layer application retrieves the latest GOOSE subscription data from the subscription data cache array in real time, specifically including:
[0111] (2.4) The FPGA implements GOOSE packet filtering and network storm suppression based on dstMAc, ethType and APPID;
[0112] (2.5) The ARM performs network driver layer hash filtering on the GOOSE messages sent from the FPGA based on dstMac to achieve two-level filtering. Messages that pass the filtering are sent to the upper layer application of the ARM.
[0113] (2.6) The ARM upper-layer application verifies the GOOSE subscription message APDU GOOSE control block based on structure variables (including goosePDU, gocbRef, timeAllowedtoLive, datSet, goID, t, StNum, sqNum, test, confRev, ndsCom and numDatSetEntries, etc.);
[0114] (2.7) The ARM upper-layer application continues to verify the APDU data entries (including allData and each data entry type) through the message verified by the APDU GOOSE control block;
[0115] (2.8) ARM updates the subscription data that has passed the data entry verification to the subscription data cache array for use by upper layer applications. All messages that have not passed the verification will be discarded.
[0116] Furthermore, by employing FPGA-based hardware network storm suppression and ARM-based MACHash filtering algorithms, dual protection measures against control network anomalies are implemented. This fundamentally prevents PCS from crashing under abnormal network conditions, effectively ensuring the safe operation of the energy storage power station. See details below. Figure 9 Steps (2.4)-(2.5) are the hardware filtering steps for GOOSE subscription messages, specifically including:
[0117] Verify the dstMac, ethType, and APPID of the message. Only messages that are exactly the same are considered subscription messages; otherwise, they are discarded.
[0118] If the message is determined to be a subscription message and the previous network storm has not yet recovered, then it is determined whether there are M consecutive GOOSE messages with the same dstMac, ethType, and APPID parameters with a reception time interval > T2. If so, the network storm has recovered and the message is received; otherwise, the message is discarded.
[0119] If a message is a subscription message and there are N consecutive GOOSE messages with the same dstMac, ethType, and APPID parameters, with a reception time interval of ≤T1, then a network storm is considered to have occurred, and the message is discarded directly; where T2>T1.
[0120] When the FPGA determines that no network storm has occurred and the packet is a subscription packet, it will send the packet to the ARM network driver layer. The ARM driver layer will perform a second filtering using the MAC Hash algorithm. Packets that pass the filtering will be sent to the upper-layer application of the ARM, while packets that fail will be discarded directly.
[0121] In this embodiment of the invention, N is 5, M is 4, T1 is 2ms, and T2 is 4ms by default. The parameters can be manually modified according to the communication status.
[0122] like Figure 8 As shown, the hardware platform composed of ARM and FPGA includes a multi-core processor, which includes at least ARM core one, ARM core two and FPGA core;
[0123] The ARM core 1 runs on a bare core. The GOOSE publishing and GOOSE subscription application functions of the energy storage converter are deployed on the ARM core 1, which can ensure the high efficiency and high real-time performance of the GOOSE function. The ARM core 2 runs on the Linux operating system and completes external communication, logic processing and data storage, which do not have high real-time requirements for the energy storage converter.
[0124] The FPGA core is responsible for GOOSE message filtering and network storm suppression, and is also used for energy storage converter control and protection functions.
[0125] In summary, the method for implementing GOOSE functionality in energy storage converters based on hard encoding and decoding provided by this invention has the following technical advantages: First, this invention uses independent GOOSE publish and GOOSE subscribe model files, and the modeling of GOOSE publish and subscribe related parameters can be achieved using only the simplest text files, compared to the complex MMS. The CID file and GOOSE model file are simple and direct to parse, easy to operate and maintain. Secondly, this invention completely decouples GOOSE and MMS, making them independent of each other. GOOSE function development does not depend on any operating system; it directly uses hardware encoding and decoding on the bare board. ASN.1 encoding and decoding functions can be implemented using simple C language statements, with functionality comparable to commercial software, low development cost, high software efficiency, and excellent and stable performance. Thirdly, this invention completely separates GOOSE publishing and subscription functions from specific applications. Through the GOOSE model file, GOOSE publishing data entries, GOOSE subscription data entries, and business applications can be flexibly associated. That is, PCS receiving data (instructions from EMS) and PCS sending data (uploading EMS running status) can be freely configured. In different engineering applications, GOOSE functions can be implemented by modifying only the model file without modifying the software. The entire mapping process is simple and efficient, and software maintenance is extremely convenient. Finally, this invention uses a high-performance ARM and high-capacity FPGA hardware platform, featuring FPGA-based network storm suppression and MAC based on the ARM network driver layer. The dual message filtering mechanism of the Hash filtering algorithm can effectively suppress network storms in the control layer network multicast messages and filter GOOSE messages, fundamentally preventing PCS from crashing abnormally in abnormal network environments and strongly ensuring the safe operation of energy storage power stations.
[0126] In summary, this invention provides a simple method for implementing GOOSE functionality, completely decoupled from the complex MMS protocol. It uses a simple, independent text file for modeling and implements GOOSE message encoding and decoding using simple C language. The GOOSE function is independent of specific applications and can achieve network storm suppression and effective filtering of GOOSE messages in the control network. For PCS manufacturers, especially newly established ones, it has advantages such as low cost, high operating efficiency, modular software design, good performance, and stability.
[0127] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. Furthermore, those skilled in the art will recognize that, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A method for implementing the GOOSE function of an energy storage converter based on hard encoding and decoding, characterized in that, Includes the following steps: Based on text files, GOOSE publish and GOOSE subscription modeling is performed to obtain GOOSE publish model files and GOOSE subscription model files; Parse the GOOSE publish model file and the GOOSE subscription model file to obtain the relevant configuration parameters for GOOSE publish and GOOSE subscription respectively; Based on the configuration parameters for GOOSE publishing and subscription, implement the GOOSE publishing and subscription functions; among them, implementing the GOOSE publishing function includes: Based on the relevant configuration parameters released by GOOSE, the GOOSE messages are hard-coded using the ASN.1 encoding rules; The GOOSE publishing task is initiated. If the GOOSE publishing data is modified by the upper-layer application, the GOOSE message is updated and the change message transmission is initiated. If the GOOSE publishing data has not changed, the message is retransmitted according to the retransmission mechanism. The upper-layer application modifies the GOOSE publishing data in real time and updates it to the publishing data cache array. The GOOSE publishing function monitors whether the GOOSE publishing data has changed in real time. The two are independent of each other. Implementing GOOSE subscription functionality includes: Based on the relevant configuration parameters of GOOSE subscription, use the ASN.1 decoding rules to perform hardware decoding of GOOSE messages and initialize GOOSE subscription parameters; Start the GOOSE subscription task. The GOOSE subscription function stores the GOOSE subscription data into the subscription data cache array. The upper layer application obtains the latest GOOSE subscription data in the subscription data cache array in real time. The two are independent of each other. The upper-layer application is mounted on a hardware platform composed of ARM and FPGA. The hardware platform has a dual packet filtering mechanism with FPGA-based network storm suppression function and MAC Hash filtering algorithm based on ARM network driver layer.
2. The method for implementing the GOOSE function of an energy storage converter based on hard encoding and decoding according to claim 1, characterized in that, The process of parsing the GOOSE publishing model file to obtain the relevant configuration parameters for GOOSE publishing specifically includes: Construct a mapping relationship between the GOOSE publishing model file and the published data. The GOOSE publishing model file contains the destination MAC, source MAC, VLAN identifier, APPID, gocbRef, datSet, goID, confRev, MaxTime, MinTime, numDatSetEntries, and dataEntryMap of the data entries involved in the GOOSE message. numDatSetEntries represents the number of data entries published in this GOOSE. dataEntryMap defines the data type and data source of each data entry according to the order in which the data is sent. Configure the published data type and data source through the GOOSE publishing model file.
3. The method for implementing the GOOSE function of an energy storage converter based on hard encoding and decoding according to claim 1, characterized in that, The process of parsing the GOOSE subscription model file to obtain relevant configuration parameters for the GOOSE subscription specifically includes: Construct a mapping relationship between the GOOSE subscription model file and the subscription data. The GOOSE subscription model file contains the destination MAC, VLAN identifier, APPID, gocbRef, datSet, goID, confRev, twnWire, numDatSetEntries, and subscription data entries dataEntryMap involved in the GOOSE message. Among them, twnWire contains information on whether it is a dual-network subscription, numDatSetEntries indicates the number of data entries subscribed to in this GOOSE, and dataEntryMap defines the data type and data source of each subscription data according to the order of subscription data. The data type of the subscription data is consistent with the data type of the sent data. Configure the data type and data source of the subscription through the GOOSE subscription model file.
4. The method for implementing the GOOSE function of an energy storage converter based on hard encoding and decoding according to claim 2, characterized in that, The relevant configuration parameters based on GOOSE are hard-coded using ASN.1 encoding rules for GOOSE messages, specifically including: (1.1) Parse the GOOSE publishing model file, obtain the relevant configuration parameters, and define a structure variable to store the encoded values for subsequent steps; (1.2) Calculate the length of the GOOSE message APDU data entry based on the number and type of data entries, complete the TLV encoding of the data entry header allData, and store the encoded value into a structure variable; (1.3) Complete the TLV hard encoding of the GOOSE control block of the GOOSE message APDU, including numDatSetEntries, ndsCom, confRev, test, sqNum, stNum, t, goID, datSet, timeAllowedtoLive, gocbRef and goosePDU, and store the encoded values into the structure variable; (1.4) Complete the initialization of the structure variables for the MAC, ethType, APPID and length field of the GOOSE message header; (1.5) Based on the latest published data, complete the TLV encoding of each data item of the GOOSE message APDU data entry, store the encoded value into the structure variable, open a buffer based on the structure variable and fill each field of the message through the memcpy basic function, and finally generate a complete GOOSE message. Steps (1.1)-(1.5) are the device startup call parts, which only need to be called once when the device is powered on.
5. The method for implementing the GOOSE function of an energy storage converter based on hard encoding and decoding according to claim 4, characterized in that, The process of initiating the GOOSE publishing task involves updating the GOOSE message and initiating the transmission of a changeover message if the GOOSE publishing data is modified by the upper-layer application. If the GOOSE publishing data remains unchanged, the message is retransmitted according to the retransmission mechanism, specifically including: (1.6) Determine whether the values of GooseOutValBool, GooseOutValInt32, GooseOutValFloat and GooseOutValInt16 of the published data of the upper layer application have changed. If they have changed, update the timeAllowedtoLive, t, stNum, sqNum and data values of the GOOSE message, and immediately send a change message. (1.7) If the value of the published data does not change, determine whether the GOOSE retransmission time has arrived. If the retransmission time has arrived, update the timeAllowedtoLive and sqNum of the message and send the message. (1.8) If the retransmission time has not arrived, determine whether the system maintenance status has changed. If the maintenance status has changed, update the test in the message; otherwise, continue to execute step (1.6).
6. The method for implementing the GOOSE function of an energy storage converter based on hard encoding and decoding according to claim 3, characterized in that, The configuration parameters based on GOOSE subscription, using ASN.1 decoding rules for hardware decoding of GOOSE messages, and initializing GOOSE subscription parameters specifically include: (2.1) Parse the GOOSE subscription model file, obtain the relevant configuration parameters, and define a structure variable to store the decoded values for subsequent steps; (2.2) Initialize the message header of the structure variable, the GOOSE control block of the GOOSE message APDU and the data entry of the GOOSE message APDU based on the subscription configuration parameters, and obtain the TLV decoding value; (2.3) Distribute dstMac, ethType and APPID to the FPGA for GOOSE subscription message filtering and network storm suppression, configure dstMac to the ARM Hash filter register for MAC filtering of GOOSE subscription messages, and start the dual message filtering mechanism built by ARM and FPGA. Steps (2.1)-(2.3) are the device startup call parts, which only need to be called once when the device is powered on.
7. The method for implementing the GOOSE function of an energy storage converter based on hard encoding and decoding according to claim 6, characterized in that, The process of initiating the GOOSE subscription task involves the GOOSE subscription function storing the GOOSE subscription data in a subscription data cache array. The upper-layer application then retrieves the latest GOOSE subscription data from the subscription data cache array in real time. Specifically, this includes: (2.4) The FPGA implements GOOSE packet filtering and network storm suppression based on dstMAc, ethType and APPID; (2.5) The ARM performs network driver layer hash filtering on the GOOSE messages sent from the FPGA based on dstMac to achieve two-level filtering. Messages that pass the filtering are sent to the upper layer application of the ARM. (2.6) The ARM upper-layer application verifies the GOOSE control block of the GOOSE subscription message APDU based on the structure variable; (2.7) The ARM upper-layer application continues to verify the APDU data entries of the message that has passed the GOOSE control block verification of the APDU; (2.8) ARM updates the subscription data that has passed the data entry verification to the subscription data cache array for use by upper layer applications. All messages that have not passed the verification will be discarded.
8. The method for implementing the GOOSE function of an energy storage converter based on hard encoding and decoding according to claim 7, characterized in that, Steps (2.4)-(2.5) specifically include: Verify the dstMac, ethType, and APPID of the message. Only messages that are exactly the same are considered subscription messages; otherwise, they are discarded. If the message is determined to be a subscription message and the previous network storm has not yet recovered, then it is determined whether there are M consecutive GOOSE messages with the same dstMac, ethType, and APPID parameters with a reception time interval > T2. If so, the network storm has recovered and the message is received; otherwise, the message is discarded. If a message is a subscription message and there are N consecutive GOOSE messages with the same dstMac, ethType, and APPID parameters, with a reception time interval of ≤T1, then a network storm is considered to have occurred, and the message is discarded directly; where T2>T1. When the FPGA determines that no network storm has occurred and the packet is a subscription packet, it will send the packet to the ARM network driver layer. The ARM network driver layer will perform a second filtering using the MAC Hash algorithm. Packets that pass the filtering will be sent to the upper-layer application of the ARM, while packets that fail will be discarded directly.
9. The method for implementing the GOOSE function of an energy storage converter based on hard encoding and decoding according to claim 1, characterized in that, The hardware platform consisting of ARM and FPGA includes a multi-core processor, which includes at least ARM core one, ARM core two and FPGA core; The ARM core 1 runs on a bare core. The GOOSE publishing and GOOSE subscription application functions of the energy storage converter are deployed on the ARM core 1. The ARM core 2 runs on the Linux operating system and completes the external communication, logic processing and data storage of the energy storage converter. The FPGA core is responsible for GOOSE message filtering and network storm suppression, and is also used for energy storage converter control and protection functions.
Citation Information
Patent Citations
Network storm resisting method for process layer equipment
CN105207817A
Energy storage system communication method and energy storage system
CN114785833A