Method, system, device and medium for identifying LMU area topology based on Transformer model
Through an automated method based on the Transformer model, the problem that the power grid information system cannot dynamically identify the LMU substation topology structure is solved, efficient and accurate topology identification is achieved, labor costs are reduced, and it is applicable to various LMU substation topologies, simplifying the line loss management process.
Patent Information
- Application Number
- CN202510907446.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-02
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2045-07-02
AI Technical Summary
In the existing technology, the power grid related information system cannot dynamically identify and update the LMU substation topology, resulting in low accuracy and reliability. The traditional manual troubleshooting method is time-consuming and labor-intensive, while the characteristic signal injection method is costly and difficult to promote.
A Transformer model-based method is adopted to automatically identify the LMU substation topology by randomly generating the LMU substation topology, generating the power data matrix, and using the Transformer encoder and location classifier.
It realizes automatic and accurate identification of LMU substation topology, saves labor costs, is applicable to various types of LMU substation topologies and power consumption conditions, and the calculation process is simple and reliable.
Smart Images

Figure CN120408329B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power metering and line loss management, and in particular to a method, system, device and medium for identifying the topological structure of an LMU substation based on a Transformer model. Background Art
[0002] As an important indicator to measure the input-output ratio of power grid construction and the level of operation and management, line loss management is a key task for improving the quality and efficiency of the power industry.
[0003] As line loss management efforts deepen, a new approach has emerged: installing Line Monitoring Units (LMUs) at key line branch nodes. This approach breaks down regional line loss management into branch line loss management. LMUs measure the power consumption of a line branch, similar to a regional meter. LMU power consumption is combined with the power consumption of each household meter within the branch to determine branch line loss, also known as segmented line loss.
[0004] As can be seen from the above logic for calculating segmented line losses, effectively identifying the meters under the LMU is crucial for segmented line loss management. Although power grid-related information systems manually record meter information for branch lines within a substation, they lack dynamic identification and updating capabilities, resulting in generally low accuracy and reliability. Traditionally, identification of branch meter information relies primarily on manual on-site inspections. While this method offers high accuracy (but only for non-underground lines), it is time-consuming and labor-intensive, significantly reducing verification efficiency. Currently, a method can also be used to physically distinguish data at the field data collection equipment level through signature signal injection, utilizing carrier communication and voltage zero-crossing time-division comparison. While this method offers high accuracy, it requires upgrading and retrofitting all data collection terminals and meters, resulting in high investment costs, a long retrofit cycle, and high equipment reliability requirements, making it difficult to fully implement. Summary of the Invention
[0005] In view of the above existing problems, the present invention is proposed.
[0006] Therefore, the present invention provides a method for identifying the LMU substation topology based on the Transformer model, which can solve the problem that the power grid related information system cannot achieve dynamic identification and update, and generally has low accuracy and reliability.
[0007] To solve the above technical problems, the present invention provides the following technical solutions: a method for identifying the LMU area topology structure based on the Transformer model, comprising:
[0008] Randomly generate the LMU substation topology; for each substation, generate the power data of each meter according to its topology, and perform data preprocessing on a substation basis;
[0009] The current data is multiplied by the power factor as the new current data, and the time points of voltage, current, active power and electricity are selected according to the rules;
[0010] The power data and meter type of each meter in the substation are organized to generate a data matrix and label matrix. A Transformer-based encoder is used to connect a position-based classifier to the encoder output.
[0011] As a preferred solution of the method for identifying the LMU substation topology structure based on the Transformer model described in the present invention, the power data includes voltage, current, active power, power factor, and total forward active power data.
[0012] As a preferred solution of the method for identifying the LMU substation topology structure based on the Transformer model described in the present invention, the data preprocessing includes calculating the hourly electricity consumption of each meter every day, 24 electricity data for each meter every day, and sorting the electricity meters in the substation by type and average electricity consumption.
[0013] As a preferred solution of the method for identifying the LMU substation topology structure based on the Transformer model described in the present invention, the generation of the LMU substation topology structure includes randomly generating a multi-branch weighted tree structure, using the current multi-branch tree to represent the topology structure of the substation, the non-leaf node represents the LMU, the leaf node represents the user table, and the weight represents the resistance value of the line between the two nodes.
[0014] As a preferred solution of the method for identifying the LMU substation topology structure based on the Transformer model described in the present invention, the random generation includes defining the tree level value between [3, 9], the number of non-leaf nodes as [3, 30], the resistance value from each node to the upper node as in the interval [0.01, 0.07] ohms, and defining the value range of the leaf node tree.
[0015] As a preferred solution of the method for identifying the LMU substation topology structure based on the Transformer model described in the present invention, the rule-based selection includes the following rules for selecting voltage, current, power, and electricity data: selecting the voltage values at the 127 time points with the largest average current of all meters under the substation; selecting the current values at the 128 time points with the largest average current value; selecting the active power values at the 128 time points with the largest average active power; and selecting the electricity data corresponding to the 128 time points with the largest average electricity.
[0016] As a preferred solution of the method for identifying the LMU area topology structure based on the Transformer model described in the present invention, the format of the data matrix is:
[0017] ,
[0018] in, , is the number of electricity meters in the substation. The three-phase meter is considered as 3 meters, and each meter is represented as a 512-dimensional vector; Indicates the Whether the block meter is an LMU meter. If the meter is an LMU meter, the value is 1, otherwise it is 0; Indicates the The voltage data of the electric meter is collected at 127 moments in time. The voltage values of the corresponding dimensions of all meters are collected at the same time. Indicates the The current data of the block meters, a total of 128 moments of current data, the collection time of the current values of the corresponding dimensions of all meters is consistent; Indicates the Active power data of 128 meters in total. The collection time of active power of corresponding dimensions of all meters is consistent. Indicates the The electricity data of the electric meters is collected for a total of 128 time periods. The collection time period of the electricity values of the corresponding dimensions of all meters is the same.
[0019] As a preferred solution of the system for identifying the LMU substation topology structure based on the Transformer model described in the present invention, the system includes a data acquisition module, a data processing module, and an algorithm module; the data acquisition module is used to collect data information; the data processing module is used to perform data preprocessing operations; and the algorithm module is used to carry out algorithm operation.
[0020] A computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of a method for identifying an LMU area topology structure based on a Transformer model are implemented.
[0021] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of a method for identifying an LMU area topology structure based on a Transformer model.
[0022] The beneficial effects of the present invention are as follows: 1. Based on a neural network model, the present invention provides a method for automatically predicting the topological structure of an LMU substation, which saves a lot of manpower costs and provides technical support for the promotion of line loss management by installing LMUs.
[0023] 2. The present invention performs model training based on simulation data. The simulation data is randomly generated and has the characteristics of data diversity, which is applicable to various types of LMU substation topologies and power consumption conditions.
[0024] 3. The calculation process of the method described in the present invention is simple and reliable. It only requires the data obtained from the simulation to be sorted and input into the model for offline training and online use. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0026] Figure 1 A flowchart of a method for identifying LMU area topology structure based on a Transformer model provided in one embodiment of the present invention.
[0027] Figure 2 A schematic diagram of the LMU area topology structure of a method for identifying the LMU area topology structure based on a Transformer model provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0028] To make the above-mentioned objects, features, and advantages of the present invention more clearly understood, the following detailed description of the specific embodiments of the present invention is given in conjunction with the accompanying drawings. It is obvious that the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in this field without creative work should fall within the scope of protection of the present invention.
[0029] Example 1, with reference to Figure 1-Figure 2 , which is the first embodiment of the present invention, provides a method for identifying the LMU area topology based on the Transformer model, including:
[0030] S1: Generate simulation data: Randomly generate LMU substation topology; for each substation, generate power data for each meter based on its topology, including voltage, current, active power, power factor, and total forward active power data;
[0031] S2: Data preprocessing: Calculate hourly electricity consumption (abbreviated as electricity) for each meter per day, based on the substation area. Each meter has 24 electricity data points per day. Sort the meters in the substation area by type and average electricity consumption; multiply the current data by the power factor to generate the new current data; select the time points for voltage, current, active power, and electricity consumption according to the rules; organize the electricity data and meter type for each meter in the substation area into a 512-dimensional vector, generating a data matrix and label matrix.
[0032] S3: Model design: Transformer-based encoder with a position-based classifier on the encoder output.
[0033] In S1, simulation data generation includes the following two steps:
[0034] S11: Generate topological structure, such as Figure 2 , randomly generates a multi-branch weighted tree structure, using this multi-branch tree to represent the topology of the substation area. Non-leaf nodes (light blue nodes in the figure) represent LMUs, leaf nodes (red nodes in the figure) represent user tables, and weights (the values on the line between two nodes in the figure) represent the resistance of the line between the two nodes. Randomness is reflected in:
[0035] (1) The tree level is between [3, 9];
[0036] (2) The number of non-leaf nodes is [3, 30]. In practice, the number of LMUs installed in a substation generally does not exceed 30.
[0037] (3) The resistance value from each node to the upper node is in the range [0.001, 0.07] ohms;
[0038] Defining the value range of the leaf node tree includes setting the leaf node tree value of the non-leaf node to [0, 10].
[0039] In S2, data processing includes the following steps:
[0040] S21: Electricity meter sorting. Electricity meter sorting follows the following rules:
[0041] (1) The three-phase meter is split into three meters according to the phase;
[0042] (2) All LMU tables are placed before non-LMU tables;
[0043] (3) LMU table, sorted in descending order by average power;
[0044] (4) Non-LMU table, sorted in descending order by average power;
[0045] (5) Use the sorting result to number the LMU table, starting from 1.
[0046] S22: Voltage, current, power, and electricity data selection. The basic rules are as follows:
[0047] (1) Select the voltage values of the 127 time points where the average current of all meters in the substation is the largest;
[0048] (2) Select the current values of the 128 time points with the largest average current values;
[0049] (3) Select the active power values of the 128 time points with the largest average active power;
[0050] (4) Select the power data corresponding to the 128 time periods with the largest average power consumption.
[0051] S23: Arrange the data matrix, which will be used as the input of the neural network. The data matrix format is:
[0052] ,
[0053] in, , is the number of electricity meters in the substation. Here, three-phase meters are considered to be 3 meters. Each meter is represented as a 512-dimensional vector. The meaning of each dimension is:
[0054] Indicates the Whether the block meter is an LMU meter. If the meter is an LMU meter, the value is 1; otherwise, the value is 0.
[0055] Indicates the The voltage data of the electric meter is collected at 127 moments in time. The voltage values of the corresponding dimensions of all meters are collected at the same time.
[0056] Indicates the The current data of the block meters, a total of 128 moments of current data, where the collection time of the current values of the corresponding dimensions of all meters is consistent.
[0057] Indicates the Active power data of 128 meters, totaling 128 moments of active power data. The collection time of active power of corresponding dimensions in all meters is consistent.
[0058] Indicates the The electricity data of the electric meters is collected for 128 time periods. The collection time period of the electricity values of the corresponding dimensions of all tables is the same.
[0059] S24: Arrange the label matrix, its format is:
[0060] ,
[0061] in , each column is a one-hot vector, indicating the LMU information to which a table belongs. When , it means that the table belongs to LMU table numbered 2, where the LMU number is the number specified in Article (5) of S21.
[0062] In S3, a Transformer-based encoder is connected to the output of the encoder with a position-based classifier.
[0063] Model structure description:
[0064] (1) The model only uses the Transformer encoder and does not use the decoder.
[0065] (2) Model input is The matrix corresponds to the matrix X in S23; the output is The matrix has the same shape as Y in S24.
[0066] (3) Each vector input to the model needs to be positionally encoded as the input to the Transformer Encoder; the dimension of the positional encoding is the same as the dimension of the input vector, both of which are 512 dimensions.
[0067] (4) The output of Transformer Encoder is The matrix has the same shape as the input.
[0068] (5) Each vector output by the Transformer Encoder passes through the same fully connected neural network FC, where the input of FC is a vector of length 512 and the output is a vector of length 90.
[0069] This embodiment uses a neural network model as the basis to predict the LMU substation topology structure. It is innovative in terms of scope of application and data quality compatibility. It can accurately identify the substation topology, play an important role in the segmented line loss management process, and save a lot of manpower costs.
[0070] Example 2, reference Figure 2 , which is an embodiment of the present invention, provides a method for identifying the topological structure of LMU stations based on the Transformer model. In order to verify the beneficial effects of the present invention, scientific demonstration is carried out through experiments.
[0071] S11: Generate topological structure, such as Figure 2, randomly generates a multi-branch weighted tree structure, using this multi-branch tree to represent the topology of the substation area. Non-leaf nodes (light blue nodes in the figure) represent LMUs, leaf nodes (red nodes in the figure) represent user tables, and weights (the values on the line between two nodes in the figure) represent the resistance of the line between the two nodes. Randomness is reflected in:
[0072] (1) The tree level is between [3, 9];
[0073] (2) The number of non-leaf nodes is [3, 30]. In practice, the number of LMUs installed in a substation generally does not exceed 30.
[0074] (3) The resistance value from each node to the upper node is in the range [0.001, 0.07] ohms;
[0075] The range of leaf node tree values is defined to include setting the number of leaf nodes included in the nodes that do not include non-leaf nodes to [10, 30].
[0076] S12: Generate power data. Each row in the table represents simulation data at a time point:
[0077] (1) Input LMU area topology (multi-branch tree);
[0078] (2) Initialize the leaf node current attribute to 0; initialize the root node voltage attribute to u; where
[0079] ,
[0080] (3) Each leaf node is randomly assigned a current value i, where i takes the following values:
[0081] ,
[0082] (4) Traverse the topology from bottom to top and add the current of the child node to the parent node.
[0083] (5) Traverse the topology from top to bottom and calculate the voltage drop on each branch. Calculate the voltage value of each non-root node through the root node voltage and the voltage drop of each branch;
[0084] (6) Calculate the active power of each node based on the voltage and current of each node;
[0085] (7) The power of each node is multiplied by a time constant (here 1 minute) to obtain the power consumption of this simulation;
[0086] (8) Repeat steps 1 to 7 several times, each time representing the simulation data at a time point;
[0087] (9) Accumulate and calculate the sequence of power data (data generated in step 7) obtained from multiple simulation results to obtain the total active power sequence.
[0088] In S2, data processing includes the following steps:
[0089] S21: Electricity meter sorting. Electricity meter sorting follows the following rules:
[0090] (1) The three-phase meter is split into three meters according to the phase;
[0091] (2) All LMU tables are placed before non-LMU tables;
[0092] (3) LMU table, sorted in descending order by average power;
[0093] (4) Non-LMU table, sorted in descending order by average power;
[0094] (5) Use the sorting result to number the LMU table, starting from 1.
[0095] S22: Voltage, current, power, and electricity data selection. The basic rules are as follows:
[0096] (1) Select the voltage values of the 127 time points where the average current of all meters in the substation is the largest;
[0097] (2) Select the current values of the 128 time points with the largest average current values;
[0098] (3) Select the active power values of the 128 time points with the largest average active power;
[0099] (4) Select the power data corresponding to the 128 time periods with the largest average power consumption.
[0100] S23: Arrange the data matrix, which will be used as the input of the neural network. The data matrix format is:
[0101] ,
[0102] in, , is the number of electricity meters in the substation. Here, three-phase meters are considered to be 3 meters. Each meter is represented as a 512-dimensional vector. The meaning of each dimension is:
[0103] Indicates the Whether the block meter is an LMU meter. If the meter is an LMU meter, the value is 1; otherwise, the value is 0.
[0104] Indicates the The voltage data of the electric meter is collected at 127 moments in time. The voltage values of the corresponding dimensions of all meters are collected at the same time.
[0105] Indicates the The current data of the block meters, a total of 128 moments of current data, where the collection time of the current values of the corresponding dimensions of all meters is consistent.
[0106] Indicates the Active power data of 128 meters, totaling 128 moments of active power data. The collection time of active power of corresponding dimensions in all meters is consistent.
[0107] Indicates the The electricity data of the electric meters is collected for 128 time periods. The collection time period of the electricity values of the corresponding dimensions of all tables is the same.
[0108] S24: Arrange the label matrix, its format is:
[0109] ,
[0110] in , each column is a one-hot vector, indicating the LMU information to which a table belongs. When , it means that the table belongs to LMU table numbered 2, where the LMU number is the number specified in Article (5) of S21.
[0111] In S3, a Transformer-based encoder is connected to the output of the encoder with a position-based classifier.
[0112] Model structure description:
[0113] (1) The model only uses the Transformer encoder and does not use the decoder.
[0114] (2) Model input is The matrix corresponds to the matrix X in S23; the output is The matrix has the same shape as Y in S24.
[0115] (3) Each vector input to the model needs to be positionally encoded as the input to the Transformer Encoder; the dimension of the positional encoding is the same as the dimension of the input vector, both of which are 512 dimensions.
[0116] (4) The output of Transformer Encoder is The matrix has the same shape as the input.
[0117] (5) Each vector output by the Transformer Encoder passes through the same fully connected neural network FC, where the input of FC is a vector of length 512 and the output is a vector of length 90.
[0118] This application trains the neural network model based on simulation data, solving the problem of insufficient data for large models.
[0119] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
[0120] Example 3 is the third embodiment of the present invention. This embodiment provides a system for identifying the topological structure of an LMU area based on a Transformer model, including: a data acquisition module, a data processing module, and an algorithm module.
[0121] The data acquisition module is used to collect data information; the data processing module is used to perform data preprocessing operations; and the algorithm module is used to carry out algorithm operation.
[0122] If the functions of this embodiment are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, mobile hard drives, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical disks.
[0123] The logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing the logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (e.g., a computer-based system, a system including a processor, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device). For purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by, or in conjunction with, an instruction execution system, apparatus, or device.
[0124] More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection with one or more wires (electronic devices), a portable computer disk cartridge (magnetic devices), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, and then editing, interpreting, or processing in another suitable manner as necessary, and then storing it in a computer memory.
[0125] It should be understood that various components of the present invention may be implemented using hardware, software, firmware, or a combination thereof. In the above-described embodiments, multiple steps or methods may be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, it may be implemented using a combination of any of the following technologies known in the art: discrete logic circuits having logic gate circuits for implementing logic functions on data signals, application-specific integrated circuits having suitable combinational logic gate circuits, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
Claims
1. A method for identifying LMU area topology based on a Transformer model, characterized by: include, Randomly generate LMU area topology; For each substation, generate the power data of each meter according to its topological structure, and perform data preprocessing by substation; The current data is multiplied by the power factor as the new current data, and the time points of voltage, current, active power and electricity are selected according to the rules; The power data and meter type of each meter in the substation are sorted to generate a data matrix and label matrix. A Transformer-based encoder is used to connect a position-based classifier to the encoder output. Generating the LMU area topology structure includes randomly generating a multi-branch weighted tree structure, using the current multi-branch tree to represent the topology structure of the area, wherein non-leaf nodes represent LMUs, leaf nodes represent user tables, and weights represent resistance values of lines between two nodes; The random generation includes defining the tree level to be between [3, 9], the number of non-leaf nodes to be between [3, 30], the resistance value from each node to the upper node to be between [0.01, 0.07] ohms, and defining the leaf node tree value range; The selection according to the rules includes the following: the voltage, current, power and electricity data selection rules are: selecting the voltage values of the 127 time points with the largest average current of all meters in the substation area; Select the current values at the 128 time points with the largest average current values; select the active power values at the 128 time points with the largest average active power values; select the power data corresponding to the 128 time points with the largest average power values; The format of the data matrix is: Where X∈R 512×m , m is the number of electricity meters in the substation, the three-phase meter is regarded as 3 meters, and each meter is represented as a 512-dimensional vector; a k,1 Indicates whether the kth meter is an LMU meter. If the meter is an LMU meter, the value is 1, otherwise it is 0; u k,1 ,…,u k,127 It represents the voltage data of the kth meter, a total of 127 voltage data moments, and the collection time of the voltage values of the corresponding dimensions of all meters is consistent; i k,1 ,…,i k,128 It represents the current data of the kth meter, a total of 128 moments of current data, and the collection time of the current values of the corresponding dimensions of all meters is consistent; p k,1 ,…,p k,128 It represents the active power data of the kth electric meter, with a total of 128 moments of active power data. The collection time of the active power of the corresponding dimensions of all meters is consistent; q k,1 ,…,q k,128 This represents the electricity data of the kth meter, covering a total of 128 time periods. The electricity values of the corresponding dimensions of all meters are collected in the same time period.
2. The method for identifying LMU area topology based on the Transformer model according to claim 1, characterized in that: The power data includes voltage, current, active power, power factor, and total forward active power data.
3. The method for identifying LMU area topology based on the Transformer model according to claim 2, characterized in that: The data preprocessing includes calculating the hourly electricity consumption of each meter, 24 electricity data for each meter per day, and sorting the electricity meters in the substation by type and average electricity consumption.
4. A system for identifying LMU area topology based on a Transformer model, applying the method for identifying LMU area topology based on a Transformer model according to any one of claims 1 to 3, characterized in that: include: Data acquisition module, data processing module, algorithm module; The data acquisition module is used to collect data information; The data processing module is used to perform data preprocessing operations; The algorithm module is used to carry out operation of the algorithm.
5. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method for identifying the LMU area topology structure based on the Transformer model according to any one of claims 1 to 3 are implemented.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for identifying the LMU area topology structure based on the Transformer model according to any one of claims 1 to 3 are implemented.
Citation Information
Patent Citations
RNN-based power grid topological structure identification method
CN117335391A
Zone area topology identification method and system based on Kirchhoff's law
CN119416177A