Automatic modeling method for virtual relay protection interface
By generating a virtual protection interface model based on a custom Excel file, using the interface database and modeling functions in MATLAB/Simulink, automatic modeling of the virtual relay protection interface is realized, solving the problems of low modeling efficiency and poor flexibility in the existing technology, improving the efficiency and accuracy of modeling, and supporting efficient protection requirements in complex power grid environments.
Patent Information
- Application Number
- CN202411911124.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-04-15
AI Technical Summary
In the prior art, the modeling efficiency of the virtual relay protection interface is low and prone to errors, and is not flexible enough when the interface signal is added or deleted, making it difficult to meet the efficient protection needs in complex power grid environments.
By generating a virtual protection interface model based on a custom Excel file, the interface database and modeling functions in MATLAB/Simulink are used to automatically model the virtual relay protection interface. This method includes establishing a virtual relay protection interface database, customizing modeling functions, reading Excel table information and calling modeling functions, and automatically completing interface subsystem modeling.
It improves the efficiency and accuracy of virtual relay protection interface modeling, reduces manual operation errors, enhances the flexibility and scalability of interface modeling, can better understand the interface characteristics of relay protection devices, and supports optimization and improvement of relay protection systems.
Smart Images

Figure CN119829548A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of power system relay protection, and in particular to an automatic modeling method for a virtual relay protection interface. Background Art
[0002] During operation, the relay protection device needs to accept the control of the protection parameters, protection settings and protection pressure plates issued by the human-machine interface, and send various protection operation status to the human-machine interface, including information on protection telemetry, protection telesignaling, protection events and protection alarm signals. It performs logical calculations by collecting the analog and switch quantities of the primary system in real time, and outputs analog and switch quantities to the primary system to control the primary system. At the same time, when disturbances and faults occur in the system, recordings are generated for viewing by the operating personnel.
[0003] Under the energy transformation and dual carbon goals, the traditional power system will gradually evolve into a high proportion of new energy power access, which will require a high proportion of power electronic equipment for the new power system, and the complexity of the power grid will be further improved. Relay protection devices are the safety guards of the power grid. The increase in the complexity of the power grid has brought new challenges to relay protection devices in terms of protection principles, data interaction forms, action behaviors, and operation and maintenance methods.
[0004] In recent years, with the development of digital technology, digitizing and virtualizing actual relay protection devices has become the main technical means to cope with challenges. Virtual relay protection technology plays an important role in system-level simulation testing of relay protection devices, development and verification of protection principles, and skill training of relevant technical personnel. Virtual relay protection involves multiple technologies such as protection principle logic modeling, virtual protection interface, virtual protection real-time operation, and virtual protection human-computer interaction.
[0005] When virtual relay protection realizes these functions, it must first model the interface in the model. The virtual protection interface is the way for virtual protection to interact with the outside world, including background input and output interface, analog input and output interface, switch input and output interface, and recording interface. When modeling the virtual protection model, it is necessary to model the interface of the virtual protection first. The modeling of the virtual relay protection interface is currently modeled manually item by item in Simulink.
[0006] Due to the large number of relay protection interfaces, the total number of interface signals for complex protection can reach thousands. The existing manual modeling method is inefficient and prone to errors. On the other hand, the virtual relay protection interface has sequence requirements, so it is very inflexible when adding and deleting signals. Summary of the invention
[0007] The purpose of the present invention is to avoid the shortcomings of the prior art and provide a method for automatically modeling a virtual relay protection interface. A virtual protection interface model is generated based on a custom Excel file with one click. When the interface signal changes, the parameters in the custom Excel file are modified to generate a virtual relay protection interface model.
[0008] The above-mentioned purpose of the present invention is achieved by the following technical means:
[0009] A virtual relay protection interface automatic modeling method is disclosed. A virtual relay protection interface database is established based on a standardized relay protection interface. A modeling function is customized according to the interface model to be established. In MATLAB / Simulink, variable information of the corresponding interface in the interface database is read and the modeling function is called to realize automatic modeling of the virtual relay protection interface.
[0010] Furthermore, the virtual relay protection interface database is established in the following manner:
[0011] Each virtual relay protection corresponds to an Excel file; each Excel file has at least one of the following worksheets: FromHMI, FromPKT, ToHMI, ToPKT, ToREC, corresponding to the variable information of the FromHMI, FromPKT, ToHMI, ToPKT, ToREC interfaces respectively;
[0012] The variable information of the interface includes at least the serial number, description, type, initial value and variable name.
[0013] Further, the FromHMI interface variable information includes control variables sent by the background to the virtual protection, including device parameters of type RP, protection settings of type RS, and protection pressure plates of type RE;
[0014] The FromPKT interface variable information includes conventional analog quantity, switch quantity input interface and SV, GOOSE input interface information of virtual protection, including conventional analog quantity input of type AI, conventional switch quantity input of type DI, GOOSE input of type GI and SV input of type SI;
[0015] The ToHMI interface variable information includes the status monitoring quantity sent by the virtual protection to the background, including protection events of type RT, alarm signals of type RW, protection telemetry of type RA, protection telesignaling of type RD, protection function status of type RS, and protection function blocking of type RB;
[0016] The ToPKT interface variable information includes conventional analog quantity, switch quantity output interface and SV, GOOSE output interface information of virtual protection, including conventional analog quantity output of type AO, conventional switch quantity output of type DO, GOOSE output of type GO and SV output of type SO;
[0017] The ToREC interface variable information includes virtual protection recording interface information, including recording type F, voltage channel type V, current channel type A, and switch channel type D. Preferably, the FromHMI interface worksheet variable information includes:
[0018]
[0019]
[0020] FromPKT interface variable information includes:
[0021]
[0022] ToHMI interface worksheet variable information includes:
[0023]
[0024]
[0025]
[0026] ToPKT interface worksheet variable information includes:
[0027]
[0028] ToREC interface worksheet variable information includes:
[0029]
[0030]
[0031] Furthermore, the interface model is established in MATLAB / Simulink, and each interface corresponds to a subsystem model, corresponding to the FromHMI, FromPKT, ToHMI, ToPKT, and ToREC subsystem modeling respectively; wherein,
[0032] The FromHMI and FromPKT subsystem modeling both include Constant modules and Goto modules. The two modules are connected by signal lines. The Constant module at least includes serial number, description, type, initial value, and simulation step information. The Constant module information and the corresponding interface variable information have corresponding serial number, description, type, and initial value. The simulation step of the Constant module is mTs. The Goto module needs to modify the module's GotoTag to the variable information of the corresponding interface, and the variable name Tagvisibility is Global.
[0033] The ToHMI, ToPKT and ToREC subsystem modeling all include From modules and Data Type Conversion modules. The two modules are connected by signal lines. The Data Type Conversion module at least includes serial number, description, type, and Output date tpye information. The Data Type Conversion module and the corresponding interface variable information have corresponding serial numbers, descriptions, and types. The Output date tpye of the Data Type Conversion module is double. The From module needs to modify the module's GotoTag to the variable name of the corresponding interface variable information.
[0034] Furthermore, the modeling function includes:
[0035] Module coordinate modeling function: defines the coordinate position of each module in the Simulink canvas;
[0036] Signal line connection modeling function: used for the connection between the Constant module and the Goto module, From module and Data TypeConversion module;
[0037] Excel table reading modeling function: used to read the variable information of the corresponding interface in the Excel table;
[0038] Subsystem modeling function: create FromHMI, FromPKT, ToHMI, ToPKT, ToREC subsystems and name them according to the interface names, and specify the coordinate positions of the subsystems in the canvas;
[0039] Constant module modeling function: according to the information in the first four columns of the FromHMI and FromPKT interface variable information, establish the corresponding number of Constant modules one by one, and modify the name, initial value, and simulation step parameters of the Constant module according to the naming requirements, and specify the coordinate position of the Constant module in the Simulink canvas;
[0040] Goto module modeling function: according to the information in the fifth column of the FromHMI and FromPKT interface variable information, create the corresponding number of Goto modules, modify the Gototag of the Goto module to the variable name, modify the Tag visibility of the Goto module to Global, and specify the coordinate position of the Goto module in the Simulink canvas;
[0041] From module modeling function: according to the information in the fifth column of the ToHMI, ToPKT and ToREC interface variable information, create the corresponding number of From modules, modify the Gototag of the From module to the variable name, and specify the coordinate position of the From module in the Simulink canvas;
[0042] DataTypeConversion module modeling function: According to the information in the first three columns of the ToHMI, ToPKT and ToREC interface variable information, establish the corresponding number of DataTypeConversion modules, and modify the name of the DataTypeConversion module according to the naming requirements, modify the Output date tpye of the DataTypeConversion module to double, and specify the coordinate position of the DataTypeConversion module in the Simulink canvas.
[0043] Furthermore, the automatic modeling process is as follows:
[0044] Create a new Simulink model;
[0045] Read Excel table information;
[0046] Determine whether there is a FromHMI interface in the Excel table. If so, call the Constant module, Goto module and signal connection modeling function to automatically complete the FromHMI interface subsystem modeling;
[0047] Determine whether there is a FromPKT interface in the Excel table. If so, call the Constant module, Goto module and signal connection modeling function to automatically complete the FromPKT interface subsystem modeling;
[0048] Determine whether there is a ToHMI interface in the Excel table. If so, call the DataTypeConversion module, From module and signal connection modeling function to automatically complete the ToHMI interface subsystem modeling;
[0049] Determine whether there is a ToPKT interface in the Excel table. If so, call the DataTypeConversion module, From module and signal connection modeling function to automatically complete the ToPKT interface subsystem modeling;
[0050] Determine whether there is a FromPKT interface in the Excel table. If so, call the DataTypeConversion module, From module and signal connection modeling function to automatically complete the FromPKT interface subsystem modeling.
[0051] Preferably, the newly-created Simulink model is created through MATLAB / Simulink, and can modify the variable information and parameter scripts of the corresponding interface to realize automatic modeling of the virtual relay protection interface.
[0052] Preferably, based on the automatic modeling method, an interface automatic modeling main program is established through M language, and a virtual relay protection interface model is automatically generated by one click through the main program.
[0053] Preferably,
[0054] The coordinate modeling function of the module:
[0055] RelativePosition=CanvasPointPosition(n,InitialPosition,DX,DY,i);
[0056] RelativePosition(1)=InitialPosition(1)+DX*(m-1);
[0057] RelativePosition(2)=InitialPosition(2)+DY*n;
[0058] in,
[0059] RelativePosition is the coordinate position,
[0060] CanvasPointPosition is the relative position in the canvas.
[0061] InitialPosition is the starting position,
[0062] RelativePosition(1) is the x coordinate of the current point on the canvas.
[0063] RelativePosition(2) is the y coordinate of the current point on the canvas.
[0064] n is the table row, m is the table column, DX is the horizontal spacing, and DY is the vertical spacing;
[0065] The signal line connection modeling function:
[0066] My_add_line(SubSystem_trance,From_trance,From_name,To_name);
[0067] Among them, My_add_line is the connection line, SubSystem is the subsystem path, From_trance is the first module path, From_name is the first module name, and To_name is the second module name;
[0068] The Excel table reads the modeling function:
[0069] [FromHMI_excel,ToHMI_excel,FromPKT_excel,ToPKT_excel,ToREC_excel]=ReadExcel(Excel_name);
[0070] in,
[0071] FromHMI_excel is the FromHMI interface worksheet, ToHMI_excel is the ToHMI interface worksheet, FromPKT_excel is the FromPKT interface worksheet, ToPKT_exce is the ToPKT interface worksheet, and ToREC_excel is the ToREC interface worksheet;
[0072] The subsystem modeling function:
[0073] add_subsystem(Model_name,Subsystem_trance,RelativePosition,Size);
[0074] in,
[0075] Model_name is the model name, Subsystem_trance is the subsystem name, RelativePosition is the subsystem position, and Size is the size of the subsystem;
[0076] The Constant module modeling function:
[0077] [Constant_trance,Constant_name]=
[0078] add_Constant(i,Excel,SubSystem_trance,RelativePosition,ShiftPosition,Size);
[0079] Among them, Constant_trance is the Constant module path, Constant_name is the Constant module name, add_Constant is the Constant modeling function, i is the total number of Constant modules to be added, Excel is the name of the Excel table based on which the Constant module is established, SubSystem_trance is the subsystem path, RelativePosition is the position of the module, ShiftPosition is the spacing between adjacent modules, and Size is the size of the module;
[0080] The Goto module modeling function:
[0081] [Goto_trance,Goto_name]=
[0082] add_Goto(i,Excel,SubSystem_trance,RelativePosition,ShiftPosition,Size);
[0083] Among them, Goto_trance is the path of the Goto module, and Goto_name is the name of the Goto module;
[0084] add_Goto is a function for adding a single Goto module, i is the total number of Goto modules to be added; Excel is the name of the Excel table based on which the Goto module is established, SubSystem_trance is the subsystem path, RelativePosition is the position of the module, ShiftPosition is the spacing between adjacent modules, and Size is the size of the module;
[0085] The From module modeling function:
[0086] [From_trance,From_name]=
[0087] add_From(i,Excel,SubSystem_trance,RelativePosition,ShiftPosition,Size);
[0088] Among them, From_trance is the path of the From module, From_name is the name of the From module, dd_From is the function of adding a single From module, i is the total number of From modules that need to be added, Excel is the name of the Excel table based on which the From module is established, SubSystem_trance is the subsystem path, elativePosition is the position of the module, and ShiftPosition is the spacing between adjacent modules.
[0089] Size is the size of the module;
[0090] The DataTypeConversion module modeling function:
[0091] [DataTypeConversion_trance,DataTypeConversion_name]=
[0092] add_DataTypeConversion(i,Excel,SubSystem_trance,RelativePosition,Shift Position,Size);
[0093] in,
[0094] DataTypeConversion_trance is the DataTypeConversion module path, DataTypeConversion_name is the DataTypeConversion module name, add_DataTypeConversion is the function of adding a single DataTypeConversion module, i is the total number of DataTypeConversion modules to be added, Excel is the name of the Excel table based on which the DataTypeConversion module is established, SubSystem_trance is the subsystem path, RelativePosition is the position of the module, ShiftPosition is the spacing between adjacent modules, and Size is the size of the module.
[0095] The beneficial effects of adopting the above technical solution are:
[0096] 1). Generate a virtual protection interface model based on a custom Excel file with one click. When the interface signal changes, modify the parameters in the Excel file to quickly generate a virtual relay protection interface model; improve the efficiency and accuracy of virtual relay protection interface modeling, and reduce manual operation errors; quickly build different types of relay protection device interface models; improve the design flexibility and scalability of the relay protection system; the automatically generated interface model can better understand the interface characteristics of the relay protection device, and provide a basis for the optimization and improvement of the relay protection system. After the interface modeling is completed, it will be used for the input and output of specific relay protection logic modeling, and complete the relay protection together with the specific relay protection logic. Virtual relay protection will be used in relay protection system-level testing, relay protection professional training, power system fault warning and other aspects.
[0097] 2). Different types of interfaces reflect the interface variable information characteristics in the table. Based on the variable information of each interface in the Excel file, a virtual protection interface model is generated with one click. When the corresponding interface signal changes, only the variable information of the corresponding variable name in the Excel file needs to be modified to regenerate the virtual relay protection interface model, which improves the efficiency and accuracy of virtual relay protection interface modeling and reduces manual operation errors.
[0098] 3). Based on the standardized relay protection interface, a virtual relay protection interface database is digitally established to provide data support for automatic modeling of the virtual relay protection interface and ensure the accuracy and reliability of the model.
[0099] 4). The characteristic information of different types of interfaces are all presented in a digital way with variable information in a unified format, which is intuitive, easy to understand and convenient for database management.
[0100] 5). By modifying the Constant module and Goto module parameters, the FromHMI or FromPKT subsystem modeling can be completed; by modifying the From module and Data Type Conversion module parameters, the ToHMI or ToPKT or ToREC subsystem modeling can be completed; the efficiency and accuracy of virtual relay protection interface modeling are improved.
[0101] 6). When modeling the corresponding interface, call the corresponding modeling function to automatically and quickly complete the modeling of the corresponding interface subsystem.
[0102] 7). Read the variable information of the corresponding interface in the interface database, call the modeling function of the corresponding interface, and automatically complete the modeling of the corresponding interface subsystem. BRIEF DESCRIPTION OF THE DRAWINGS
[0103] Figure 1 It is a flow chart of automatic modeling of virtual relay protection interface;
[0104] Figure 2 It is a schematic diagram of subsystem models of different interfaces;
[0105] Figure 3 This is the FromHM interface modeling schematic;
[0106] Figure 4 This is a schematic diagram of the FroPKT interface modeling;
[0107] Figure 5 It is a schematic diagram of ToHMI interface modeling;
[0108] Figure 6 This is a schematic diagram of ToPKT interface modeling;
[0109] Figure 7 This is a schematic diagram of the ToREC interface modeling;
[0110] Figure 8 It is a schematic diagram of the modeling of FromHMI and FroPKT interface variables;
[0111] Fig. 9 It is a schematic diagram of modeling variables of ToHMI, ToPKT and ToREC interfaces;
[0112] Fig.10 This is a diagram of the Constant module parameter settings;
[0113] Fig.11 This is a diagram of Goto module parameter settings;
[0114] Fig.12 This is a diagram of the From module parameter settings;
[0115] Fig.13 This is a diagram of the parameter settings for the Data Type Conversion module. DETAILED DESCRIPTION
[0116] The following is a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0117] Example 1. Figure 1-13A virtual relay protection interface automatic modeling method is presented. A virtual relay protection interface database is established based on a standardized relay protection interface. A modeling function is customized according to the interface model to be established. In MATLAB / Simulink, variable information of the corresponding interface in the interface database is read and the modeling function is called to realize automatic modeling of the virtual relay protection interface.
[0118] Generally, Excel data is obtained from the ICD file of the 61850 station control layer protocol device, ICD: IEDCapability Description, IED is a capability description file that describes the functions and engineering capabilities of a specific IED. The same model of IED has the same ICD template file.
[0119] The present invention generates a virtual protection interface model based on a customized Excel file with one click. When an interface signal changes, the parameters in the Excel file are modified to quickly generate a virtual relay protection interface model. The efficiency and accuracy of virtual relay protection interface modeling are improved, and errors in manual operations are reduced. Interface models of different types of relay protection devices are quickly constructed. The design flexibility and scalability of the relay protection system are improved. The automatically generated interface model can better understand the interface characteristics of the relay protection device, and provide a basis for the optimization and improvement of the relay protection system.
[0120] After the interface modeling is completed, it will be used for the input and output of specific relay protection logic modeling, and complete the relay protection together with the specific relay protection logic. The virtual relay protection will be used in relay protection system-level testing, relay protection professional training, power system fault warning and other aspects.
[0121] Example 2. This example shows the data presentation of different interfaces in an Excel table. The virtual relay protection interface database is established in the following way:
[0122] Each virtual relay protection corresponds to an Excel file; each Excel file has at least one of the following worksheets: FromHMI, FromPKT, ToHMI, ToPKT, ToREC, corresponding to the variable information of the FromHMI, FromPKT, ToHMI, ToPKT, ToREC interfaces respectively;
[0123] The variable information of the interface includes at least the serial number, description, type, initial value and variable name.
[0124] In the present invention, different types of interfaces reflect interface variable information features in a table, and a virtual protection interface model is generated with one click based on the variable information of each interface in the Excel file. When the corresponding interface signal changes, it is only necessary to modify the variable information of the corresponding variable name in the Excel file or add new interface data to regenerate the virtual relay protection interface model, thereby improving the efficiency and accuracy of virtual relay protection interface modeling and reducing errors in manual operations.
[0125] Example 3. This example shows the variable information content of different interfaces.
[0126] The FromHMI interface variable information includes control variables sent by the background to the virtual protection, including device parameters of type RP, protection settings of type RS, and protection pressure plates of type RE;
[0127] The FromPKT interface variable information includes conventional analog quantity, switch quantity input interface and SV, GOOSE input interface information of virtual protection, including conventional analog quantity input of type AI, conventional switch quantity input of type DI, GOOSE input of type GI and SV input of type SI;
[0128] The ToHMI interface variable information includes the status monitoring quantity sent by the virtual protection to the background, including protection events of type RT, alarm signals of type RW, protection telemetry of type RA, protection telesignaling of type RD, protection function status of type RS, and protection function blocking of type RB;
[0129] The ToPKT interface variable information includes conventional analog quantity, switch quantity output interface and SV, GOOSE output interface information of virtual protection, including conventional analog quantity output of type AO, conventional switch quantity output of type DO, GOOSE output of type GO and SV output of type SO;
[0130] The ToREC interface variable information includes virtual protection recording interface information, including a recording type of type F, a voltage channel of type V, a current channel of type A, and a switch channel of type D.
[0131] The present invention, based on the standardized relay protection interface, digitally establishes a virtual relay protection interface database, provides data support for automatic modeling of the virtual relay protection interface, and ensures the accuracy and reliability of the model.
[0132] Example 4. This example illustrates the specific variable information content of different interfaces, as shown in the following Excel table,
[0133] For example, the FromHMI interface worksheet variable information includes:
[0134]
[0135]
[0136] For example, the FromPKT interface variable information includes:
[0137]
[0138] For example, the ToHMI interface worksheet variable information includes:
[0139]
[0140]
[0141] For example, the ToPKT interface worksheet variable information includes:
[0142]
[0143]
[0144] For example, the ToREC interface worksheet variable information includes:
[0145] Serial number describe type Initial Value Variable Name 001 Recording type F 0 RDRE_RcdType 002 Protection CT1 current A A 0 MMXU1_A_phsA 003 Protection CT1 current B A 0 MMXU1_A_phsB 004 Protection CT1 current C A 0 MMXU1_A_phsC 005 Protect CT1 zero sequence current A 0 MSQI1_ImbZroA 006 Protection CT2 current A A 0 MMXU2_A_phsA 007 Protection CT2 current B A 0 MMXU2_A_phsB 008 Protection CT2 current C A 0 MMXU2_A_phsC 009 Protect CT2 zero sequence current A 0 MSQI2_ImbZroA 010 Protection Startup D 0 PTRC1_Str 011 Differential protection action D 0 PDIF1_Op 012 Overcurrent stage I action D 0 PTOC1_Op 013 Overcurrent stage II action D 0 PTOC2_Op 014 Tripping circuit breaker D 0 PTRC3_Op 015 Tripping circuit breaker D 0 PTRC4_Op 016 Protection Action D 0 PTRC5_Op .
[0146] In the present invention, the characteristic information of different types of interfaces are all presented in a digital manner as variable information in a unified format, which is intuitive, easy to understand, and convenient for database management.
[0147] Example 5. This example shows how to model different interfaces as subsystems, such as Figure 3-13 As shown,
[0148] The interface model is established in MATLAB / Simulink. The interface model is modeled according to a subsystem corresponding to each interface, corresponding to the FromHMI, FromPKT, ToHMI, ToPKT, and ToREC subsystem modeling respectively; wherein,
[0149] For example, Figure 5-6As shown, the modeling of FromHMI and FromPKT subsystems both include Constant module and Goto module. The two modules are connected by signal lines. The Constant module at least includes serial number, description, type, initial value, and simulation step information. The Constant module information and the corresponding interface variable information have corresponding serial number, description, type, and initial value. The simulation step of the Constant module is mTs. The Goto module needs to modify the GotoTag of the module to the variable information of the corresponding interface, and the variable name Tag visibility is Global.
[0150] For example, Figure 7-8 As shown, the modeling of ToHMI, ToPKT and ToREC subsystems all include From modules and Data Type Conversion modules. The two modules are connected by signal lines. The Data Type Conversion module at least includes serial number, description, type, and Output date tpye information. The Data Type Conversion module and the corresponding interface variable information have corresponding serial numbers, descriptions, and types. The Output date tpye of the Data Type Conversion module is double. The From module needs to modify the module's GotoTag to the variable name of the corresponding interface variable information.
[0151] The present invention can complete FromHMI or FromPKT subsystem modeling by modifying the Constant module and Goto module parameters;
[0152] By modifying the From module and Data Type Conversion module parameters, the ToHMI or ToPKT or ToREC subsystem modeling can be completed;
[0153] Improved the efficiency and accuracy of virtual relay protection interface modeling.
[0154] Embodiment 6. This embodiment shows how to establish each modeling function, and the modeling function includes:
[0155] Module coordinate modeling function: defines the coordinate position of each module in the Simulink canvas;
[0156] Signal line connection modeling function: used for the connection between the Constant module and the Goto module, From module and Data TypeConversion module;
[0157] Excel table reading modeling function: used to read the variable information of the corresponding interface in the Excel table;
[0158] Subsystem modeling function: create FromHMI, FromPKT, ToHMI, ToPKT, ToREC subsystems and name them according to the interface names, and specify the coordinate positions of the subsystems in the canvas;
[0159] Constant module modeling function: according to the information in the first four columns of the FromHMI and FromPKT interface variable information, establish the corresponding number of Constant modules one by one, and modify the name, initial value, and simulation step parameters of the Constant module according to the naming requirements, and specify the coordinate position of the Constant module in the Simulink canvas;
[0160] Goto module modeling function: according to the information in the fifth column of the FromHMI and FromPKT interface variable information, create the corresponding number of Goto modules, modify the Gototag of the Goto module to the variable name, modify the Tag visibility of the Goto module to Global, and specify the coordinate position of the Goto module in the Simulink canvas;
[0161] From module modeling function: according to the information in the fifth column of the ToHMI, ToPKT and ToREC interface variable information, create the corresponding number of From modules, modify the Gototag of the From module to the variable name, and specify the coordinate position of the From module in the Simulink canvas;
[0162] DataTypeConversion module modeling function: According to the information in the first three columns of the ToHMI, ToPKT and ToREC interface variable information, establish the corresponding number of DataTypeConversion modules, and modify the name of the DataTypeConversion module according to the naming requirements, modify the Output date tpye of the DataTypeConversion module to double, and specify the coordinate position of the DataTypeConversion module in the Simulink canvas.
[0163] The present invention, when modeling a corresponding interface, calls a corresponding modeling function to automatically and quickly complete the modeling of the corresponding interface subsystem.
[0164] Example 7. This example shows the automatic modeling process, such as Figure 1-13 As shown, the automatic modeling process is as follows:
[0165] Create a new Simulink model;
[0166] Read Excel table information;
[0167] Determine whether there is a FromHMI interface in the Excel table. If so, call the Constant module, Goto module and signal connection modeling function to automatically complete the FromHMI interface subsystem modeling;
[0168] Determine whether there is a FromPKT interface in the Excel table. If so, call the Constant module, Goto module and signal connection modeling function to automatically complete the FromPKT interface subsystem modeling;
[0169] Determine whether there is a ToHMI interface in the Excel table. If so, call the DataTypeConversion module, From module and signal connection modeling function to automatically complete the ToHMI interface subsystem modeling;
[0170] Determine whether there is a ToPKT interface in the Excel table. If so, call the DataTypeConversion module, From module and signal connection modeling function to automatically complete the ToPKT interface subsystem modeling;
[0171] Determine whether there is a FromPKT interface in the Excel table. If so, call the DataTypeConversion module, From module and signal connection modeling function to automatically complete the FromPKT interface subsystem modeling.
[0172] The present invention reads variable information of a corresponding interface in an interface database, calls a modeling function of the corresponding interface, and automatically completes modeling of a corresponding interface subsystem.
[0173] After the interface modeling is completed, it will be used for the input and output of specific relay protection logic modeling, and will complete the virtual relay protection together with the specific relay protection logic. The virtual relay protection will be used in relay protection system-level testing, relay protection professional training, power system fault warning and other aspects.
[0174] Example 8. The new Simulink model is created through MATLAB / Simulink, which can modify the variable information and parameter scripts of the corresponding interface to achieve automatic modeling of the virtual relay protection interface.
[0175] Example 9. Based on the automatic modeling method, an interface automatic modeling main program is established through M language, and a virtual relay protection interface model is automatically generated by the main program with one click.
[0176] Embodiment 10. This embodiment shows the expressions of various modeling functions,
[0177] The coordinate modeling function of the module:
[0178] RelativePosition=CanvasPointPosition(n,InitialPosition,DX,DY,i);
[0179] RelativePosition(1)=InitialPosition(1)+DX*(m-1);
[0180] RelativePosition(2)=InitialPosition(2)+DY*n;
[0181] in,
[0182] RelativePosition is the coordinate position,
[0183] CanvasPointPosition is the relative position in the canvas.
[0184] InitialPosition is the starting position,
[0185] RelativePosition(1) is the x coordinate of the current point on the canvas.
[0186] RelativePosition(2) is the y coordinate of the current point on the canvas.
[0187] n is the table row, m is the table column, DX is the horizontal spacing, and DY is the vertical spacing;
[0188] The signal line connection modeling function:
[0189] My_add_line(SubSystem_trance,From_trance,From_name,To_name);
[0190] Among them, My_add_line is the connection line, SubSystem is the subsystem path, From_trance is the first module path, From_name is the first module name, and To_name is the second module name;
[0191] The Excel table reads the modeling function:
[0192] [FromHMI_excel,ToHMI_excel,FromPKT_excel,ToPKT_excel,ToREC_excel]=ReadExcel(Excel_name);
[0193] in,
[0194] FromHMI_excel is the FromHMI interface worksheet, ToHMI_excel is the ToHMI interface worksheet, FromPKT_excel is the FromPKT interface worksheet, ToPKT_exce is the ToPKT interface worksheet, and ToREC_excel is the ToREC interface worksheet;
[0195] The subsystem modeling function:
[0196] add_subsystem(Model_name,Subsystem_trance,RelativePosition,Size);
[0197] in,
[0198] Model_name is the model name, Subsystem_trance is the subsystem name, RelativePosition is the subsystem position, and Size is the size of the subsystem;
[0199] The Constant module modeling function:
[0200] [Constant_trance,Constant_name]=
[0201] add_Constant(i,Excel,SubSystem_trance,RelativePosition,ShiftPosition,Size);
[0202] Among them, Constant_trance is the Constant module path, Constant_name is the Constant module name, add_Constant is the Constant modeling function, i is the total number of Constant modules to be added, Excel is the name of the Excel table based on which the Constant module is established, SubSystem_trance is the subsystem path, RelativePosition is the position of the module, ShiftPosition is the spacing between adjacent modules, and Size is the size of the module;
[0203] The Goto module modeling function:
[0204] [Goto_trance,Goto_name]=
[0205] add_Goto(i,Excel,SubSystem_trance,RelativePosition,ShiftPosition,Size);
[0206] Among them, Goto_trance is the path of the Goto module, and Goto_name is the name of the Goto module;
[0207] add_Goto is a function for adding a single Goto module, i is the total number of Goto modules to be added; Excel is the name of the Excel table based on which the Goto module is established, SubSystem_trance is the subsystem path, RelativePosition is the position of the module, ShiftPosition is the spacing between adjacent modules, and Size is the size of the module;
[0208] The From module modeling function:
[0209] [From_trance,From_name]=
[0210] add_From(i,Excel,SubSystem_trance,RelativePosition,ShiftPosition,Size);
[0211] Among them, From_trance is the path of the From module, From_name is the name of the From module, dd_From is the function of adding a single From module, i is the total number of From modules that need to be added, Excel is the name of the Excel table based on which the From module is established, SubSystem_trance is the subsystem path, elativePosition is the position of the module, and ShiftPosition is the spacing between adjacent modules.
[0212] Size is the size of the module;
[0213] The DataTypeConversion module modeling function:
[0214] [DataTypeConversion_trance,DataTypeConversion_name]=
[0215] add_DataTypeConversion(i,Excel,SubSystem_trance,RelativePosition,Shift Position,Size);
[0216] in,
[0217] DataTypeConversion_trance is the DataTypeConversion module path, DataTypeConversion_name is the DataTypeConversion module name, add_DataTypeConversion is the function of adding a single DataTypeConversion module, i is the total number of DataTypeConversion modules to be added, Excel is the name of the Excel table based on which the DataTypeConversion module is established, SubSystem_trance is the subsystem path, RelativePosition is the position of the module, ShiftPosition is the spacing between adjacent modules, and Size is the size of the module.
[0218] The above modeling functions are as follows if they are established in M language:
[0219] 1). Module coordinate modeling function:
[0220]
[0221] 2). Signal line connection modeling function:
[0222]
[0223] 3).Excel table reading function:
[0224]
[0225]
[0226] 4). Subsystem modeling function:
[0227]
[0228] 5). Constant module modeling function:
[0229]
[0230]
[0231] 6). Goto module modeling function:
[0232]
[0233]
[0234] 7).From module modeling function:
[0235]
[0236] 8).DataTypeConversion module modeling function:
[0237]
[0238]
[0239] The above disclosure is only the preferred embodiment of the present invention, which certainly cannot be used to limit the scope of rights of the present invention. Therefore, equivalent changes made according to the scope of the patent application of the present invention are still within the scope covered by the present invention.
Claims
1. A method for automatic modeling of a virtual relay protection interface, characterized in that: A virtual relay protection interface database is established based on the standardized relay protection interface. The modeling function is customized according to the interface model to be established. In MATLAB / Simulink, the variable information of the corresponding interface in the interface database is read and the modeling function is called to realize automatic modeling of the virtual relay protection interface.
2. The method for automatic modeling of a virtual relay protection interface according to claim 1, characterized in that: The virtual relay protection interface database is established in the following way: Each virtual relay protection corresponds to an Excel file; each Excel file has at least one of the following worksheets: FromHMI, FromPKT, ToHMI, ToPKT, ToREC, corresponding to the variable information of the FromHMI, FromPKT, ToHMI, ToPKT, ToREC interfaces respectively; The variable information of the interface includes at least the serial number, description, type, initial value and variable name.
3. The method for automatic modeling of a virtual relay protection interface according to claim 2, characterized in that: The FromHMI interface variable information includes control variables sent by the background to the virtual protection, including device parameters of type RP, protection settings of type RS, and protection pressure plates of type RE; The FromPKT interface variable information includes conventional analog quantity, switch quantity input interface and SV, GOOSE input interface information of virtual protection, including conventional analog quantity input of type AI, conventional switch quantity input of type DI, GOOSE input of type GI and SV input of type SI; The ToHMI interface variable information includes the status monitoring quantity sent by the virtual protection to the background, including protection events of type RT, alarm signals of type RW, protection telemetry of type RA, protection telesignaling of type RD, protection function status of type RS, and protection function blocking of type RB; The ToPKT interface variable information includes conventional analog quantity, switch quantity output interface and SV, GOOSE output interface information of virtual protection, including conventional analog quantity output of type AO, conventional switch quantity output of type DO, GOOSE output of type GO and SV output of type SO; The ToREC interface variable information includes virtual protection recording interface information, including a recording type of type F, a voltage channel of type V, a current channel of type A, and a switch channel of type D.
4. The method for automatic modeling of a virtual relay protection interface according to claim 3, characterized in that: FromHMI interface worksheet variable information includes: FromPKT interface variable information includes: ToHMI interface worksheet variable information includes: ToPKT interface worksheet variable information includes: ToREC interface worksheet variable information includes:
5. The method for automatic modeling of a virtual relay protection interface according to claim 2, characterized in that: The interface model is established in MATLAB / Simulink. The interface model is modeled according to a subsystem corresponding to each interface, corresponding to the FromHMI, FromPKT, ToHMI, ToPKT, and ToREC subsystem modeling respectively; wherein, The FromHMI and FromPKT subsystem modeling both include Constant modules and Goto modules. The two modules are connected by signal lines. The Constant module at least includes serial number, description, type, initial value, and simulation step information. The Constant module information and the corresponding interface variable information have corresponding serial number, description, type, and initial value. The simulation step of the Constant module is mTs. The Goto module needs to modify the module's GotoTag to the variable information of the corresponding interface, and the variable name Tag visibility is Global. The ToHMI, ToPKT and ToREC subsystem modeling all include From modules and Data Type Conversion modules. The two modules are connected by signal lines. The Data Type Conversion module at least includes serial number, description, type, and Outputdate tpye information. The Data Type Conversion module and the corresponding interface variable information have corresponding serial numbers, descriptions, and types. The Output date tpye of the Data Type Conversion module is double. The From module needs to modify the module's GotoTag to the variable name of the corresponding interface variable information.
6. The method for automatic modeling of a virtual relay protection interface according to claim 5, characterized in that: The modeling function includes: Module coordinate modeling function: defines the coordinate position of each module in the Simulink canvas; Signal line connection modeling function: used for the connection between the Constant module and the Goto module, From module and Data TypeConversion module; Excel table reading modeling function: used to read the variable information of the corresponding interface in the Excel table; Subsystem modeling function: create FromHMI, FromPKT, ToHMI, ToPKT, ToREC subsystems and name them according to the interface names, and specify the coordinate positions of the subsystems in the canvas; Constant module modeling function: according to the information in the first four columns of the FromHMI and FromPKT interface variable information, establish the corresponding number of Constant modules one by one, and modify the name, initial value, and simulation step parameters of the Constant module according to the naming requirements, and specify the coordinate position of the Constant module in the Simulink canvas; Goto module modeling function: according to the information in the fifth column of the FromHMI and FromPKT interface variable information, create the corresponding number of Goto modules, modify the Gototag of the Goto module to the variable name, modify the Tag visibility of the Goto module to Global, and specify the coordinate position of the Goto module in the Simulink canvas; From module modeling function: according to the information in the fifth column of the ToHMI, ToPKT and ToREC interface variable information, create the corresponding number of From modules, modify the Gototag of the From module to the variable name, and specify the coordinate position of the From module in the Simulink canvas; DataTypeConversion module modeling function: According to the information in the first three columns of the ToHMI, ToPKT and ToREC interface variable information, establish the corresponding number of DataTypeConversion modules, and modify the name of the DataTypeConversion module according to the naming requirements, modify the Output date tpye of the DataTypeConversion module to double, and specify the coordinate position of the DataTypeConversion module in the Simulink canvas.
7. The method for automatic modeling of a virtual relay protection interface according to claim 6, characterized in that: The automatic modeling process is as follows: Create a new Simulink model; Read Excel table information; Determine whether there is a FromHMI interface in the Excel table. If so, call the Constant module, Goto module and signal connection modeling function to automatically complete the FromHMI interface subsystem modeling; Determine whether there is a FromPKT interface in the Excel table. If so, call the Constant module, Goto module and signal connection modeling function to automatically complete the FromPKT interface subsystem modeling; Determine whether there is a ToHMI interface in the Excel table. If so, call the DataTypeConversion module, From module and signal connection modeling function to automatically complete the ToHMI interface subsystem modeling; Determine whether there is a ToPKT interface in the Excel table. If so, call the DataTypeConversion module, From module and signal connection modeling function to automatically complete the ToPKT interface subsystem modeling; Determine whether there is a FromPKT interface in the Excel table. If so, call the DataTypeConversion module, From module and signal connection modeling function to automatically complete the FromPKT interface subsystem modeling.
8. The method for automatic modeling of a virtual relay protection interface according to any one of claims 1 to 7, characterized in that: The newly-created Simulink model is created through MATLAB / Simulink, and can modify the variable information and parameter scripts of the corresponding interface to realize automatic modeling of the virtual relay protection interface.
9. The method for automatic modeling of a virtual relay protection interface according to any one of claims 1 to 7, characterized in that: Based on the automatic modeling method, an interface automatic modeling main program is established through M language, and a virtual relay protection interface model is automatically generated by one click through the main program.
10. The method for automatic modeling of a virtual relay protection interface according to claim 6, characterized in that: The coordinate modeling function of the module: RelativePosition=CanvasPointPosition(n,InitialPosition,DX,DY,i); RelativePosition(1)=InitialPosition(1)+DX*(m-1); RelativePosition(2)=InitialPosition(2)+DY*n; in, RelativePosition is the coordinate position, CanvasPointPosition is the relative position in the canvas. InitialPosition is the starting position, RelativePosition(1) is the x coordinate of the current point on the canvas. RelativePosition(2) is the y coordinate of the current point on the canvas. n is the table row, m is the table column, DX is the horizontal spacing, and DY is the vertical spacing; The signal line connection modeling function: My_add_line(SubSystem_trance,From_trance,From_name,To_name); Among them, My_add_line is the connection line, SubSystem is the subsystem path, and From_trance is The first module path, From_name is the first module name, To_name is the second module name; The Excel table reads the modeling function: [FromHMI_excel,ToHMI_excel,FromPKT_excel,ToPKT_excel,ToREC_excel]=ReadExcel(Excel_name); in, FromHMI_excel is the FromHMI interface worksheet, ToHMI_excel is the ToHMI interface worksheet, FromPKT_excel is the FromPKT interface worksheet, ToPKT_exce is the ToPKT interface worksheet, and ToREC_excel is the ToREC interface worksheet; The subsystem modeling function: add_subsystem(Model_name,Subsystem_trance,RelativePosition,Size); in, Model_name is the model name, Subsystem_trance is the subsystem name, RelativePosition is the subsystem position, Size is the size of the subsystem; The Constant module modeling function: [Constant_trance,Constant_name]= add_Constant(i,Excel,SubSystem_trance,RelativePosition,ShiftPosition,Size); Among them, Constant_trance is the Constant module path, Constant_name is the Constant module name, add_Constant is the Constant modeling function, i is the total number of Constant modules to be added, Excel is the name of the Excel table based on which the Constant module is established, SubSystem_trance is the subsystem path, RelativePosition is the position of the module, ShiftPosition is the spacing between adjacent modules, and Size is the size of the module; The Goto module modeling function: [Goto_trance,Goto_name]= add_Goto(i,Excel,SubSystem_trance,RelativePosition,ShiftPosition,Size); Among them, Goto_trance is the path of the Goto module, and Goto_name is the name of the Goto module; add_Goto is a function for adding a single Goto module, i is the total number of Goto modules to be added; Excel is the name of the Excel table based on which the Goto module is established, SubSystem_trance is the subsystem path, RelativePosition is the position of the module, ShiftPosition is the spacing between adjacent modules, and Size is the size of the module; The From module modeling function: [From_trance,From_name] = add_From(i,Excel,SubSystem_trance,RelativePosition,ShiftPosition,Size); Among them, From_trance is the path of the From module, From_name is the name of the From module, dd_From is the function of adding a single From module, i is the total number of From modules that need to be added, Excel is the name of the Excel table based on which the From module is established, SubSystem_trance is the subsystem path, elativePosition is the position of the module, and ShiftPosition is the spacing between adjacent modules. Size is the size of the module; The DataTypeConversion module modeling function: [DataTypeConversion_trance,DataTypeConversion_name]=add_DataTypeConversion(i,Excel,SubSystem_trance,RelativePosition,Shift Position,Size); in, DataTypeConversion_trance is the DataTypeConversion module path, DataTypeConversion_name is the DataTypeConversion module name, add_DataTypeConversion is the function of adding a single DataTypeConversion module, i is the total number of DataTypeConversion modules to be added, Excel is the name of the Excel table based on which the DataTypeConversion module is established, SubSystem_trance is the subsystem path, RelativePosition is the position of the module, ShiftPosition is the spacing between adjacent modules, and Size is the size of the module.