Power distribution area measurement terminal optimization configuration method, system and device, and machine readable storage medium

CN122797346APending Publication Date: 2026-09-22GUANGDONG UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611265098.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-20
Publication Date
2026-09-22

AI Technical Summary

Technical Problem

但是,如果在全部线路节点配置量测终端,将产生较高的设备购置、安装施工、通信接入、数据存储和运行维护成本;如果量测终端数量过少或者安装位置不合理,则可能无法获得足够的扰动特征,导致扰动源定位准确率不能满足实际要求

Benefits of technology

[0036]本申请提供的配电台区量测终端优化配置方法及系统、设备、机器可读存储介质,通过配电台区仿真模型在量测终端安装前生成两类扰动样本及真实拓扑区段标签,基于电压暂降源与谐波主导源拓扑区段定位准确率约束优化量测终端候选配置方案,解决现有技术中电压暂降源定位和谐波主导源定位任务分别配置、配置方案与双扰动源定位能力缺少直接量化关系、量测终端安装前缺少全部候选节点扰动数据、单一优化算法容易局部收敛以及装置数据接入和结果输出过程不明确的问题,保证双扰动源拓扑区段定位能力的同时,减少量测终端数量、综合配置成本。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122797346A_ABST
    Figure CN122797346A_ABST
Patent Text Reader

Abstract

This application discloses a method, system, equipment, and machine-readable storage medium for optimizing the configuration of measurement terminals in a distribution transformer substation, belonging to the field of smart grid technology. The method includes: constructing a simulation model of the distribution transformer substation and generating voltage sag samples, harmonic samples, and section labels; training the location of dual-disturbance-source topology sections based on the voltage sag and harmonic samples to obtain a voltage sag source topology section location model and a harmonic-dominant source topology section location model; iteratively updating the optimal configuration scheme of the distribution transformer substation measurement terminals with the goal of minimizing the overall configuration cost of the measurement terminals, and with the accuracy of voltage sag source topology section location and harmonic-dominant source topology section location as constraints, to obtain the optimal configuration scheme. This application ensures the ability to locate dual-disturbance-source topology sections while reducing the number of measurement terminals and the overall configuration cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of smart grid technology, and in particular to a method, system, device, and machine-readable storage medium for optimizing the configuration of distribution substation measurement terminals. Background Technology

[0002] With the large-scale integration of distributed power sources, energy storage, electric vehicle charging facilities, frequency converters, and other power electronic loads into the power distribution system, power quality problems such as voltage sags and harmonic distortion are becoming increasingly prominent. Voltage sags are characterized by their sudden occurrence, short duration, and propagation characteristics that are significantly affected by fault location, network topology, and operating mode. Harmonics are mainly generated by nonlinear loads and power electronic equipment, and their amplitude, phase, and propagation range are also affected by network topology, line impedance, load conditions, and background harmonic sources.

[0003] To identify the locations of voltage sag sources and harmonic sources, measurement terminals capable of acquiring voltage, current, phase, transient waveforms, and harmonic characteristics need to be configured at different nodes in the distribution transformer area. However, configuring measurement terminals at all line nodes will result in high costs for equipment purchase, installation, communication access, data storage, and operation and maintenance. If the number of measurement terminals is too small or their installation locations are unreasonable, sufficient disturbance characteristics may not be obtained, leading to a failure to meet the actual requirements for disturbance source location accuracy.

[0004] Existing technologies have proposed various methods for configuring measurement points or power quality monitoring points. These methods mainly determine monitoring points based on monitoring coverage, system observability, measurement matrix performance, or comprehensive evaluation functions. Typically, voltage sag monitoring point configuration and harmonic measurement point configuration are carried out separately. The evaluation indicators, data characteristics, and configuration criteria used for these two types of configuration tasks are different. If a set of measurement terminals can meet the requirements for voltage sag monitoring or location, it does not mean that the set of terminals can simultaneously meet the requirements for locating the dominant harmonic source. Therefore, it is impossible to feed back the accuracy of both types of location to the measurement terminal configuration scheme. Summary of the Invention

[0005] This application aims to provide a method, system, device, and machine-readable storage medium for optimizing the configuration of measurement terminals in a distribution area, which solves the problem that the existing technology separately configures voltage sag monitoring points and harmonic measurement points, and does not fully disclose the observable node characteristics in voltage sag samples and harmonic samples by separately screening them using the same measurement terminal configuration vector.

[0006] To achieve the above objectives, the technical solution of this application is as follows: A method for optimizing the configuration of measurement terminals in a distribution radio area, comprising: Construct a simulation model of the power distribution area and generate voltage sag samples, harmonic samples, and section labels; Based on voltage sag samples and harmonic samples, dual-disturbance source topology segment localization training is performed to obtain voltage sag source topology segment localization model and harmonic dominant source topology segment localization model; With the goal of minimizing the overall configuration cost of the distribution radio station measurement terminal, and taking the accuracy of locating voltage sag source topology sections and harmonic dominant source topology sections as constraints, the optimal configuration scheme of the distribution radio station measurement terminal is obtained through iterative updates.

[0007] Optionally, the optimal configuration scheme for the distribution transformer area measurement terminals is obtained through iterative updates, with the goal of minimizing the overall configuration cost of the measurement terminals and the constraints of achieving the accuracy rates for locating voltage sag source topology segments and harmonic dominant source topology segments. This specifically includes: With the objective function of minimizing the overall configuration cost of measurement terminals in the distribution area, and with the positioning accuracy of voltage sag source topology segments, the positioning accuracy of harmonic dominant source topology segments, and the set of prohibited configuration nodes as constraints, an optimal configuration model for measurement terminals is established. Initialize the genetic-particle swarm shared population to obtain an initial set of candidate configuration schemes for measurement terminals; Input the current candidate configuration schemes of the measurement terminal into the voltage sag source topology segment location model and the harmonic dominant source topology segment location model respectively, and obtain the voltage sag source topology segment location accuracy and harmonic dominant source topology segment location accuracy of the current candidate configuration schemes of the measurement terminal. For each candidate configuration scheme of measurement terminals generated in each iteration, the comprehensive configuration cost and constraints are calculated through the measurement terminal optimization configuration model. Based on the multi-level feasibility priority rule, the individual historical measurement terminal optimal configuration scheme of each particle and the group historical measurement terminal optimal configuration scheme of the population are updated. The multi-level feasibility priority rule does not require setting the comprehensive configuration cost and the perturbation source topology segment positioning accuracy as an artificially weighted objective function, thereby avoiding the problem of difficulty in determining the weights between different dimensional indicators. For each particle's individual history measurement terminal optimal configuration scheme and the population's population history measurement terminal optimal configuration scheme, binary particle swarm guided update and genetic selection, crossover and adaptive mutation are performed; By integrating the particle swarm optimization capability and the genetic algorithm node recombination capability, the constraint repair and elite retention operations of the candidate configuration scheme of the measurement terminal are performed to obtain the set of candidate configuration schemes of the measurement terminal for the next iteration. When the iteration termination condition is met, the update of candidate configuration schemes for the measurement terminal is stopped, and the optimal configuration scheme for the measurement terminal is determined.

[0008] Optionally, the optimized configuration model for the measurement terminal is represented as follows:

[0009] In the formula, This represents the current candidate configuration scheme for the measurement terminal, i.e., the measurement terminal configuration vector. The corresponding overall configuration cost; Indicates the first Configuration cost of each candidate intermediate node; Indicates the number of candidate intermediate nodes; Indicates the first Candidate intermediate nodes Configure the measurement terminal. Indicates the first Candidate intermediate nodes No measurement terminal is configured; The constraints, namely the accuracy of locating voltage sag source topology segments, the accuracy of locating harmonic dominant source topology segments, and the set of prohibited nodes, are expressed as follows:

[0010] In the formula, This indicates a preset threshold for the accuracy of locating voltage sag source topology segments; This indicates a preset threshold for the accuracy of locating the dominant harmonic source topology segment. Represents the measurement terminal configuration vector The corresponding voltage sag source topology segment location accuracy; Represents the measurement terminal configuration vector The corresponding harmonic dominant source topology segment location accuracy; This indicates that the configuration of the node set is prohibited.

[0011] Optionally, the accuracy rates for locating voltage sag source topology segments and harmonic dominant source topology segments of the current candidate configuration scheme for the measurement terminal are expressed as follows:

[0012] In the formula, Indicates the number of elements in the set; This indicates an indicator function that takes the value 1 if the condition within the parentheses is true, and 0 otherwise. Represents the measurement terminal configuration vector The corresponding number Predicted segment labels for each voltage sag sample; Represents the measurement terminal configuration vector The corresponding number Predicted segment labels for each harmonic sample; Indicates the first The true segment label of a voltage sag sample; Indicates the first The true segment label of each harmonic sample; This represents a sample of voltage sag configuration calculations; This represents the harmonic configuration calculation sample.

[0013] Optionally, the optimal configuration scheme of the individual history measurement terminal for each particle and the optimal configuration scheme of the population history measurement terminal are performed using binary particle swarm optimization, as shown below:

[0014] In the formula, Indicates the first The generation The nth particle, i.e., the th particle The first candidate configuration scheme for the measurement terminal Dimensional speed; Indicates the first The generation The nth particle, i.e., the th particle The first candidate configuration scheme for the measurement terminal Dimensional speed; Indicates the first Replace inertial weights; and These represent the individual learning coefficient and the group learning coefficient, respectively. , and This represents a random number whose value ranges from 0 to 1. Indicates the first The generation The historical optimal configuration of each particle dimensional vector; Indicates the first The generation The first candidate configuration scheme for the measurement terminal dimensional vector; The first historical optimal configuration of the group represents the... dimensional vector; Represents the sigmoid transformation function; The binary candidate configuration scheme generated by the particle swarm update represents the first... dimensional vector; The optimal configuration scheme for the individual history measurement terminal of each particle and the optimal configuration scheme for the population history measurement terminal are subjected to genetic selection, crossover, and adaptive mutation, including: The parent generation is selected using a feasibility-first tournament method, and genetic candidate configurations are generated through uniform crossover, as shown below:

[0015] In the formula, This represents a candidate configuration scheme for measurement terminals generated by genetic crossover. and This represents the two parent configuration vectors obtained through tournament selection; Indicates a crossover random number; This represents the probability of selecting the parent configuration vector; Calculate the normalized Hamming distance between each pair of all candidate configurations and use it as an indicator of population diversity, as follows:

[0016] In the formula, Indicates the first Normalized Hamming diversity of generational populations; Indicates the first The generation The first candidate configuration scheme for the measurement terminal dimensional vector; index In this formula, the candidate configuration scheme number is represented; Indicates population size; To reduce ineffective random perturbations when population diversity is high, the bit-flipping mutation probability is adaptively adjusted based on normalized Hamming diversity, and mutation is performed on the configuration vector after crossover, as shown below:

[0017] In the formula, Indicates the first Adaptive mutation probability; and These represent the lower and upper bounds of the mutation probability, respectively; The candidate configuration scheme after genetic crossover and mutation is represented by the first... dimensional vector; Represents a mutated random number; The fusion of particle swarm optimization and genetic algorithm node recombination capabilities includes: To enhance the directional guidance of the optimal position in the particle swarm when population diversity is high, and to enhance the role of genetic crossover and mutation in generating new node combinations when population diversity is low, the fusion ratio of candidate particle swarm schemes is determined based on the current Hamming diversity of the population, as shown below:

[0018] In the formula, Indicates the first The fusion ratio of candidate particle swarm optimization schemes; and These represent the lower and upper bounds of the fusion probability, respectively. For each configuration scheme, according to the fusion ratio, one is selected as a fusion candidate configuration scheme from the particle swarm candidate configuration scheme and the genetic mutation candidate configuration scheme, as shown below:

[0019] In the formula, The first candidate configuration scheme to be merged dimensional vector; This represents a fusion of random numbers. When population diversity is high... To increase the density of measurement terminals, the hybrid candidate configuration scheme inherits more particle swarm optimization results, thereby improving the convergence speed to low-cost feasible regions; when population diversity is low, To reduce the number of mixed candidate configuration schemes for measurement terminals, more genetic crossover and mutation results are inherited to increase new node combinations.

[0020] Optionally, the step of training the dual-disturbance-source topology segment localization based on voltage sag samples and harmonic samples to obtain the voltage sag source topology segment localization model and the harmonic-dominant source topology segment localization model specifically includes: Construct the equivalent topology of the candidate intermediate nodes based on the equivalent connection state between two candidate intermediate nodes under the current operation mode of the distribution radio area; The installation status of the measurement terminal of each candidate intermediate node is encoded into the same set of binary measurement terminal configuration vectors, and a training configuration vector set is constructed. The configuration vector of the measurement terminal is processed by configuration masking to construct the input tensor of the positioning model; Graph convolutional networks are used to extract topological spatial feature vectors from the input tensors of the localization model. Long Short-Term Memory (LSTM) networks are used to extract temporal variation features of topological spatial feature vectors. The temporal variation features are mapped to the disturbance category to calculate the predicted probability that the disturbance source belongs to each topological segment; The model parameters of the voltage sag source topology segment location model and the harmonic dominant source topology segment location model are solidified based on the voltage sag sample and harmonic sample.

[0021] During the location phase of the candidate configuration scheme for the measurement terminal, only the configuration vector, configuration mask, and corresponding node measurement feature matrix are changed. The model parameters of the voltage sag source topology segment location model and the harmonic dominant source topology segment location model are no longer updated, and there is no need to retrain the location model.

[0022] Optionally, the step of mapping temporal variation features to disturbance categories to calculate the predicted probability that the disturbance source belongs to each topological segment is expressed as follows:

[0023] In the formula, Indicates the first The unnormalized score vector output by the topological segment classification layer for each perturbation sample; and These represent the weight matrix and bias vector of the topological segment classification layer, respectively; Indicates the first The disturbance source of the sample belongs to the first The predicted probability of each topological segment; This represents the segment number in the Softmax normalized summation activation function; Indicates the first Predicted segment labels for each perturbation sample; Indicates the type of disturbance. This indicates a voltage sag. Indicates harmonics; Indicates the number of topological segments; Indicates the type of disturbance The corresponding number of time locations; Indicates the type of disturbance The corresponding number One sample in The state of being hidden at any given time location throughout the entire period; Indicates the first The perturbation sample at the ... The unnormalized score vector output by the topological segment classification layer; Indicates the first The perturbation sample at the ... The unnormalized score vector output by the topological segment classification layer.

[0024] Optionally, the construction of the distribution substation simulation model and the generation of voltage sag samples, harmonic samples, and section labels specifically include: Establish a complete distribution network topology; Based on the complete topology of the distribution radio area, obtain the set of candidate intermediate nodes for the distribution radio area and determine the set of configurable nodes. Calculate the configuration cost of candidate intermediate nodes; A simulation model of the distribution substation is constructed based on the complete topology of the distribution substation, line parameters, node load parameters, candidate intermediate node set, node installability information and node configuration cost parameters. A voltage sag scenario is set and a voltage sag sample is constructed. A harmonic scenario is set and a harmonic sample is constructed. Based on the distribution area simulation model, voltage sag source topology segments and harmonic source topology segments are divided, and corresponding real segment labels are generated.

[0025] Optionally, set up voltage sag scenarios and construct voltage sag samples, including: The voltage sag depth, voltage sag duration, and voltage sag phase jump variable are calculated and expressed as follows:

[0026] In the formula, Indicates the sample number of the disturbance source; Indicates the first In the voltage sag scenario, the first Candidate intermediate nodes The voltage sag depth at the location; Indicates the first In the voltage sag scenario, the first The minimum effective voltage value during the voltage sag of each candidate intermediate node; Indicates the first In the voltage sag scenario, the first The effective value of the reference voltage before the voltage dips of each candidate intermediate node occur; Indicates the first The duration of a voltage sag in a voltage sag scenario; and They represent the first The start and end times of a voltage sag scenario; Indicates the first In the voltage sag scenario, the first Voltage sag phase jump variables of candidate intermediate nodes; and They represent the first In the voltage sag scenario, the first Phase during voltage sag and reference phase before sag for each candidate intermediate node; This indicates that the phase difference is mapped to a preset phase range; The candidate intermediate node voltage sampling features, candidate intermediate node current sampling features, voltage sag depth, voltage sag duration, and voltage sag phase jump variable are combined into a node-level voltage sag feature vector, as shown below:

[0027] In the formula, Indicates the sampling time location number; Indicates the first In the voltage sag scenario, the first Voltage sag feature vectors of candidate intermediate nodes; and They represent the first In the voltage sag scenario, the first Voltage and current sampling characteristics of candidate intermediate nodes; superscript Indicates vector transpose; The voltage sag feature vectors of each candidate intermediate node and each sampling time position are organized into voltage sag samples in the order of time-node-feature, as follows:

[0028] In the formula, Indicates the first One voltage sag sample; Indicates the number of voltage sag sampling time locations; Indicates the characteristic dimension of voltage sag nodes; Represents the real number field; The setting of harmonic scenarios and construction of harmonic samples includes: The comprehensive harmonic injection index of each harmonic source is calculated based on the phasor of each harmonic current within the preset harmonic order set. The harmonic source with the largest comprehensive harmonic injection index is selected as the dominant harmonic source, as shown below:

[0029] In the formula, Indicates the harmonic source number; Indicates the first Comprehensive harmonic injection index of individual harmonic sources; This represents the preset set of harmonic orders for analysis; Indicates the first The weights corresponding to the subharmonics; Indicates the first The first harmonic source injected the first Second harmonic current phasor; Indicates the number of the dominant harmonic source; This represents the variable that maximizes the objective function; The extracted harmonic voltage amplitude, harmonic current amplitude, harmonic voltage phase, harmonic current phase, voltage and current harmonic phase difference, total harmonic distortion rate, and single harmonic content are combined into a nodal-level harmonic feature vector, as shown below:

[0030] In the formula, This indicates the sampling time and location number. In a harmonic scenario, the harmonic analysis window is used as one sampling point. Indicates the number of the continuous harmonic analysis window; Indicates the first In the harmonic scene, the first Harmonic eigenvectors of candidate intermediate nodes; and They represent the first In the harmonic scene, the first The harmonic voltage amplitude vector and harmonic current amplitude vector corresponding to the preset analysis harmonic order of each candidate intermediate node; and They represent the first In the harmonic scene, the first Harmonic voltage phase vector and harmonic current phase vector of each candidate intermediate node; Indicates the first In the harmonic scene, the first The phase difference vector between the same harmonic voltage and harmonic current of each candidate intermediate node; and They represent the first In the harmonic scene, the first The voltage and current single harmonic content vectors of the candidate intermediate nodes; and They represent the first In the harmonic scene, the first Total harmonic distortion of voltage and total harmonic distortion of current of candidate intermediate nodes; The harmonic feature vectors of all candidate intermediate nodes and continuous harmonic analysis windows are organized into harmonic samples in the order of time-node-feature, as follows:

[0031] In the formula, Indicates the first One harmonic sample; Indicates the number of continuous harmonic analysis windows; This represents the characteristic dimension of the harmonic node.

[0032] A distribution area measurement terminal optimization configuration system includes: The communication unit receives external data in real time; wherein, the external data includes: distribution area topology, line parameters, load parameters, basic operation data, candidate intermediate node information, node installability information, and node configuration cost parameters; Storage unit, used to cache external data and intermediate data calculated during the optimization process; The computing unit reads the external data.

[0033] Optionally, the computing unit includes: The sample construction module builds a simulation model of the distribution area and generates voltage sag samples, harmonic samples, and section labels. The dual-disturbance source topology segment localization module trains the dual-disturbance source topology segment localization based on voltage sag samples and harmonic samples, and obtains the voltage sag source topology segment localization model and the harmonic dominant source topology segment localization model. The optimal configuration scheme generation module for measurement terminals aims to minimize the overall configuration cost of measurement terminals in the distribution station area, while taking the accuracy of voltage sag source topology segment location and harmonic dominant source topology segment location as constraints. It iteratively updates to obtain the optimal configuration scheme for measurement terminals in the distribution station area.

[0034] An electronic device includes a processor and a machine-readable storage medium storing machine-executable instructions that can be executed by the processor. The processor executes the machine-executable instructions to implement the optimized configuration method for distribution radio area measurement terminals as described above.

[0035] A machine-readable storage medium storing machine-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the above-described method for optimizing the configuration of a distribution radio area measurement terminal.

[0036] The method, system, equipment, and machine-readable storage medium for optimizing the configuration of measurement terminals in distribution transformer areas provided in this application generate two types of disturbance samples and real topology segment labels before the installation of the measurement terminals using a distribution transformer area simulation model. Based on the accuracy constraints of locating voltage sag sources and dominant harmonic sources in the topology segments, the method optimizes the candidate configuration schemes for the measurement terminals. This solves the problems in the prior art, such as the separate configuration of voltage sag source and dominant harmonic source locating tasks, the lack of a direct quantitative relationship between the configuration scheme and the dual disturbance source locating capability, the lack of disturbance data for all candidate nodes before the installation of the measurement terminals, the tendency of a single optimization algorithm to converge locally, and the unclear process of device data access and result output. This method ensures the dual disturbance source topology segment locating capability while reducing the number of measurement terminals and the overall configuration cost.

[0037] To make the above-mentioned features and advantages of the application more apparent and understandable, specific embodiments are provided below, and detailed descriptions are given in conjunction with the accompanying drawings. Attached Figure Description

[0038] Figure 1 A flowchart illustrating the optimized configuration method for the distribution radio area measurement terminal provided in this application.

[0039] Figure 2 A block diagram of the optimized configuration system for the distribution radio area measurement terminal provided in this application. Detailed Implementation

[0040] To make the objectives and technical solutions of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the described embodiments of this application without creative effort are within the scope of protection of this application.

[0041] In a specific embodiment of this application, please refer to Figure 1 , Figure 1The flowchart is for the optimized configuration method of the distribution radio area measurement terminal provided in this application. The optimized configuration method of the distribution radio area measurement terminal provided in this application includes: steps S1 to S3.

[0042] Step S1: Construct a simulation model of the distribution area and generate voltage sag samples, harmonic samples, and section labels; Step S2: Based on the voltage sag samples and harmonic samples, perform dual-disturbance source topology segment localization training to obtain the voltage sag source topology segment localization model and the harmonic dominant source topology segment localization model; Step S3: With the goal of minimizing the overall configuration cost of the distribution radio station measurement terminal, and with the requirements of achieving the positioning accuracy of the voltage sag source topology segment and the positioning accuracy of the harmonic dominant source topology segment, the optimal configuration scheme of the distribution radio station measurement terminal is obtained through iterative updates.

[0043] It should be noted that the optimized configuration of the measurement terminal in this application is only performed within the intermediate nodes of the distribution transformer area, and is not configured at the first node of the distribution transformer such as the low-voltage side outlet, nor at the end node of the distribution transformer such as the end of the line user; the first node and the end node of the distribution transformer area are still retained in the complete topology of the distribution transformer area and the simulation model of the distribution transformer area, and are used for normal operation state calculation and disturbance propagation simulation.

[0044] As an example, the measurement terminal is a waveform recording type power quality measurement terminal.

[0045] The method for optimizing the configuration of measurement terminals in distribution transformer areas provided in this application generates two types of disturbance samples and real topology segment labels before the installation of measurement terminals by using a distribution transformer area simulation model. Based on the accuracy constraints of locating voltage sag sources and dominant harmonic sources in the topology segments, the method optimizes the candidate configuration schemes of measurement terminals. This solves the problems in the prior art, such as the separate configuration of voltage sag source and dominant harmonic source location tasks, the lack of a direct quantitative relationship between the configuration scheme and the dual disturbance source location capability, the lack of disturbance data for all candidate nodes before the installation of measurement terminals, the tendency of a single optimization algorithm to converge locally, and the unclear process of device data access and result output. This method ensures the dual disturbance source topology segment location capability while reducing the number of measurement terminals and the overall configuration cost.

[0046] In step S1, please refer to Figure 1 In step S1, a simulation model of the distribution area is constructed, generating voltage sag samples, harmonic samples, real section labels, and node configuration cost parameters.

[0047] As an example, step S1 obtains the complete topology of the distribution transformer area, candidate intermediate nodes, a set of configurable nodes, and the configuration cost of candidate intermediate nodes. A simulation model of the distribution transformer area is established, and the simulation model generates voltage sag samples, harmonic samples, and corresponding labels for the actual disturbance source topology segments. The generated voltage sag samples and harmonic samples are used for training and verification of the subsequent voltage sag source topology segment location model and the harmonic dominant source topology segment location model, as well as for calculating the location accuracy under different measurement terminal configuration schemes. This does not imply that measurement terminals need to be actually configured at all candidate intermediate nodes.

[0048] As an example, step S1 specifically includes: Step S11: Establish the complete topology of the distribution radio area; Step S12: Obtain the set of candidate intermediate nodes for the distribution radio area based on the complete topology of the distribution radio area, and determine the set of configurable nodes; Step S13: Calculate the configuration cost of candidate intermediate nodes; Step S14: Based on the complete topology of the distribution substation, line parameters, node load parameters, candidate intermediate node set, node installability information and node configuration cost parameters, construct a simulation model of the distribution substation, set up a voltage sag scenario and construct voltage sag samples, set up a harmonic scenario and construct harmonic samples. Step S15: Based on the distribution area simulation model, divide the voltage sag source topology segment and harmonic source topology segment, and generate the corresponding real segment labels.

[0049] Specifically, in step S11, to uniformly represent the node and line connection relationships in the distribution transformer area, the distribution transformer area is equivalent to a graph structure composed of a set of topological nodes and a set of line branches. This graph structure serves as the basis for constructing the distribution transformer area simulation model, dividing the topological segments, and constructing the equivalent topology of candidate intermediate nodes. The graph structure is represented as follows:

[0050] In the formula, This represents the complete topology of the distribution radio area; This represents the complete set of topology nodes in the distribution radio area. This represents the set of line branches between nodes.

[0051] Furthermore, to determine the lines actually participating in power flow calculation and disturbance propagation under the current operating mode of the distribution substation based on the line switch status, the line branches in the active state are grouped into an effective branch set, represented as follows:

[0052] In the formula, Indicates the connection node and nodes Branch lines; Indicates the connection node and nodes The switch status of the line branch is 1, which indicates that it is in operation, and 0 indicates that it is out of operation. This represents the set of valid branches under the current operating mode of the distribution radio area.

[0053] Specifically, in step S12, to limit the configurable location of the waveform-type power quality measurement terminal, the effective branch set is... The branch nodes, segment nodes, connecting nodes, and important branch intersection nodes of the central line are identified as candidate intermediate nodes, and a set of candidate intermediate nodes is formed according to a fixed numbering order, as shown below:

[0054] In the formula, Represents the set of candidate intermediate nodes; Indicates the first One candidate intermediate node; Indicates the first One candidate intermediate node; This indicates the number of candidate intermediate nodes.

[0055] Furthermore, to exclude candidate intermediate nodes that do not meet the actual installation conditions of the measurement terminal, a set of prohibited configuration nodes is determined based on the node installation information. The set of configurable nodes is then formed by subtracting the prohibited configuration nodes from the candidate intermediate node set, as shown below:

[0056] In the formula, This indicates that the set of nodes cannot be configured. Represents a configurable set of nodes; the symbol " "" indicates set difference operation. Node installation information includes: installation space, auxiliary power supply, communication access, construction safety, and operating environment.

[0057] Specifically, in step S13, in order to uniformly calculate the configuration resources occupied by the measurement terminals configured at different candidate intermediate nodes, the costs of equipment purchase, installation and construction, communication access, and operation and maintenance within the preset planning period are converted to the same accounting period, and the configuration cost of each candidate intermediate node is formed, as shown below:

[0058] In the formula, Indicates the first Configuration cost of each candidate intermediate node; Indicates the cost of purchasing equipment; This indicates the cost of installation and construction. Indicates the cost of communication access; Indicates operating and maintenance costs; Represents the configuration cost vector for all candidate intermediate nodes; superscript This represents the vector transpose. The node configuration cost parameters consist of equipment purchase cost, installation and construction cost, communication access cost, and operation and maintenance cost.

[0059] Specifically, in step S14, a distribution substation simulation model is constructed based on the complete topology of the distribution substation, line parameters, node load parameters, candidate intermediate node set, node installability information, and node configuration cost parameters. To verify whether the established distribution substation simulation model can reflect the normal operating state, a basic operation check is performed on the distribution substation simulation model. Based on the topology, line impedance, transformer parameters, load parameters, and basic operation data, the complex voltage of each node, the complex current of the branch, and the injected power of the node are calculated. The node complex voltage, branch complex current, and power balance are checked to see if they meet the preset operating boundaries, as shown below:

[0060] In the formula, Indicates the first Complex voltage at each node; Indicates the first The injected current at each node; Represents the first node in the admittance matrix. Line 1 Column elements; Indicates the first The complex power of a node is the node-injected power; the symbol " " indicates complex conjugation; and These represent the lower and upper limits of the allowable complex voltage at the nodes, respectively. Indicates the branch of the line Complex current; This indicates the upper limit of the allowable complex current for this branch.

[0061] When the basic operation verification fails to meet the preset conditions, the topology connections, line parameters, transformer parameters, or load parameters are checked and corrected, and the normal operation state calculation is re-executed. Only the distribution substation simulation model that has passed the basic operation verification is used for subsequent voltage sag sample and harmonic sample generation.

[0062] Furthermore, voltage sag scenarios are set up. Single-phase grounding, two-phase short circuit, two-phase grounding, or three-phase short circuit disturbances are introduced at different topological locations in the distribution transformer area simulation model. By changing the sag source location, fault type, fault transition resistance, fault occurrence time, fault clearing time, load operating level, distributed power source operating status, and network switching status, voltage sag scenarios covering different disturbance source locations and operating conditions are generated. The time window of the voltage sag samples covers before the voltage sag occurs, during the voltage sag duration, and after the voltage sag recovers.

[0063] To quantify the voltage sag extent, voltage sag duration, and phase change observed at different candidate intermediate nodes, the voltage sag depth, voltage sag duration, and voltage sag phase jump variables are calculated and expressed as follows:

[0064] In the formula, Indicates the sample number of the disturbance source; Indicates the first In the voltage sag scenario, the first Candidate intermediate nodes The voltage sag depth at the location; Indicates the first In the voltage sag scenario, the first The minimum effective voltage value during the voltage sag of each candidate intermediate node; Indicates the first In the voltage sag scenario, the first The effective value of the reference voltage before the voltage dips of each candidate intermediate node occur; Indicates the first The duration of a voltage sag in a voltage sag scenario; and They represent the first The start and end times of a voltage sag scenario; Indicates the first In the voltage sag scenario, the first Voltage sag phase jump variables of candidate intermediate nodes; and They represent the first In the voltage sag scenario, the first Phase during voltage sag and reference phase before sag for each candidate intermediate node; This indicates that the phase difference is mapped to a preset phase range.

[0065] To form a localization model input that can simultaneously represent instantaneous node measurements, voltage sag amplitude characteristics, and voltage sag process characteristics, the candidate intermediate node voltage sampling characteristics, candidate intermediate node current sampling characteristics, voltage sag depth, voltage sag duration, and voltage sag phase jump variables are combined into a node-level voltage sag feature vector, as follows:

[0066] In the formula, Indicates the sampling time location number; Indicates the first In the voltage sag scenario, the first Voltage sag feature vectors of candidate intermediate nodes; and They represent the first In the voltage sag scenario, the first Voltage and current sampling characteristics of candidate intermediate nodes.

[0067] To maintain uniform node, time, and feature dimensions across all voltage sag samples, the voltage sag feature vectors of each candidate intermediate node and each sampling time position are combined. The voltage sag samples are organized in the order of "time-node-feature" and are represented as follows:

[0068] In the formula, Indicates the first One voltage sag sample; Indicates the number of voltage sag sampling time locations; Indicates the characteristic dimension of voltage sag nodes; Represents the real number field.

[0069] Furthermore, harmonic scenarios are set up by setting up harmonic current sources or equivalent nonlinear loads at different topological locations in the distribution area simulation model. By changing the location of the harmonic source, harmonic order, injection amplitude, harmonic initial phase, background harmonic source location, number of background harmonic sources, load operating level, and network switching status, harmonic scenarios covering different harmonic source locations and operating conditions are generated.

[0070] The voltage and current of candidate intermediate nodes in a multi-harmonic scenario are sampled to obtain discrete voltage and current sampling sequences. To extract the harmonic amplitude and phase of a specified order from the discrete voltage and current sampling sequences, a discrete Fourier transform is performed on each harmonic analysis window, and the corresponding harmonic amplitude and phase are calculated from the complex harmonic components, as shown below:

[0071] In the formula, Indicates the first First complex harmonic components; This represents the number of sampling points within a harmonic analysis window. Indicates the sampling point number within the harmonic analysis window; Indicates the first A discrete sample value; Represents the imaginary unit; Indicates the first Second harmonic amplitude; Indicates the amplitude conversion factor; Indicates the first Subharmonic phase; This indicates the phase angle operation of complex numbers.

[0072] To quantify the overall distortion of all complex harmonic components relative to the fundamental component and the content of single harmonics in the voltage and current waveforms, the total harmonic distortion rate of voltage, the total harmonic distortion rate of current, the single harmonic content of voltage, and the single harmonic content of current are calculated and expressed as follows:

[0073] In the formula, and These represent the total harmonic distortion (THD) of voltage and the total harmonic distortion (THD) of current, respectively. and They represent the first The amplitude of the second harmonic voltage and the amplitude of the harmonic current; and These represent the amplitude of the fundamental voltage and the amplitude of the fundamental current, respectively. Indicates the highest harmonic order analyzed; and They represent the first The single harmonic content of the voltage and the single harmonic content of the current.

[0074] When multiple harmonic sources are set in the same harmonic scenario, in order to generate a unique dominant harmonic source, the comprehensive harmonic injection index of each harmonic source is calculated based on the phasor of each harmonic current in the preset set of harmonic orders. The harmonic source with the largest comprehensive harmonic injection index is selected as the dominant harmonic source, as shown below:

[0075] In the formula, Indicates the harmonic source number; Indicates the first Comprehensive harmonic injection index of individual harmonic sources; This represents the preset set of harmonic orders for analysis; Indicates the first The weights corresponding to the subharmonics; Indicates the first The first harmonic source injected the first Second harmonic current phasor; Indicates the number of the dominant harmonic source; This represents the variable that maximizes the objective function.

[0076] When the difference between the comprehensive harmonic injection indices of two or more harmonic sources is less than a preset distinction threshold, the corresponding harmonic scenario is excluded from the single dominant source location sample set, or a unique dominant source label is generated according to preset label determination rules. The aforementioned comprehensive harmonic injection indices are used for constructing the dominant harmonic source label in this application and do not represent the harmonic source responsibility indicators specified in power quality standards.

[0077] To comprehensively represent the harmonic amplitude, harmonic phase, and distortion characteristics of each candidate intermediate node within the continuous harmonic analysis window, the extracted harmonic voltage amplitude, harmonic current amplitude, harmonic voltage phase, harmonic current phase, voltage and current harmonic phase difference, total harmonic distortion rate, and single harmonic content are combined into a node-level harmonic feature vector, as shown below:

[0078] In the formula, This indicates the sampling time and location number. In a harmonic scenario, the harmonic analysis window is used as one sampling point. Indicates the number of the continuous harmonic analysis window; Indicates the first In the harmonic scene, the first Harmonic eigenvectors of candidate intermediate nodes; and They represent the first In the harmonic scene, the first The harmonic voltage amplitude vector and harmonic current amplitude vector corresponding to the preset analysis harmonic order of each candidate intermediate node; and They represent the first In the harmonic scene, the first Harmonic voltage phase vector and harmonic current phase vector of each candidate intermediate node; Indicates the first In the harmonic scene, the first The phase difference vector between the same harmonic voltage and harmonic current of each candidate intermediate node; and They represent the first In the harmonic scene, the first The voltage and current single harmonic content vectors of the candidate intermediate nodes; and They represent the first In the harmonic scene, the first Total harmonic distortion of voltage and total harmonic distortion of current of candidate intermediate nodes.

[0079] To form a harmonic dominant source topology segment localization model suitable for graph convolutional networks and long short-term memory (LSTM) networks, the input includes the harmonic feature vectors of all candidate intermediate nodes and continuous harmonic analysis windows. The harmonic samples are organized in the order of "time-node-feature" and are represented as follows:

[0080] In the formula, Indicates the first One harmonic sample; Indicates the number of continuous harmonic analysis windows; This represents the dimension of the harmonic node features. When using a Long Short-Term Memory (LSTM) network to extract harmonic temporal features, At least 2.

[0081] Specifically, in step S15, to transform the disturbance source localization problem into a topology segment multi-classification problem, the continuous lines between adjacent branch nodes, segment nodes, tie nodes, or line ends are divided into a disturbance source topology segment in the distribution substation simulation model, and a set of topology segments is formed in a fixed order, as shown below:

[0082] In the formula, Represents the set of topological segments of the disturbance source; Indicates the first One topological segment; Indicates the number of topological segments.

[0083] Furthermore, to generate supervised training labels based on the actual disturbance source locations set during simulation, a mapping from the actual disturbance source locations to the topology segment numbers is established, and the first... A voltage sag sample and the Harmonic samples The section labels are represented as follows:

[0084]

[0085] In the formula, A function representing the mapping from the location of the disturbance source to the topology segment number; Indicates the first The actual location of the voltage sag source in a voltage sag scenario; Indicates the first The location of the actual dominant harmonic source in each harmonic scenario; and They represent the first A voltage sag sample and the Harmonic samples The actual segment labels.

[0086] As an example, after step S15, the following also includes: Step S16: Preprocess the acquired parameters and divide the sample set.

[0087] Specifically, to eliminate differences in units and numerical ranges among different features, training sample statistics are used to standardize various node features, and the same standardized parameters are applied to validation samples and configuration calculation samples, as shown below:

[0088] In the formula, Indicates the first before standardization Item features; Represents the standardized first Item features; and Respectively represent the first The mean and standard deviation of each feature in the training samples; This indicates a positive number that prevents the denominator from being zero.

[0089] Furthermore, to complete the parameter training, training stop condition determination, and candidate configuration scheme positioning accuracy calculation for subsequent positioning, the voltage sag samples and harmonic samples are respectively divided into training sample sets, validation sample sets, and configuration calculation sample sets, as shown below:

[0090] In the formula, Indicates the type of disturbance. This indicates a voltage sag. Indicates harmonics; , and These represent the sets of training sample IDs, validation sample IDs, and configuration calculation sample IDs corresponding to the perturbation type, respectively.

[0091] Furthermore, voltage sag samples and harmonic samples are all divided into complete disturbance simulation scenarios as the smallest unit. Different candidate intermediate node data, different sampling segments, or different harmonic analysis windows generated by the same disturbance event must be included in the same dataset. Different segments of the same disturbance event must not be included in the training sample set, validation sample set, and configuration calculation sample set respectively.

[0092] After completing the above processing, the complete topology of the distribution transformer area, the set of candidate intermediate nodes, the set of configurable nodes, the set of prohibited configurable nodes, the node configuration cost, voltage sag samples, harmonic samples, labels of real disturbance source topology segments, and training, verification, and configuration calculation sample sets are stored. Specifically, the voltage sag samples, harmonic samples, labels of real disturbance source topology segments, and the complete topology of the distribution transformer area are used for training, verification, and accuracy calculation of the voltage sag source topology segment location model and the harmonic dominant source topology segment location model under different measurement terminal configuration schemes in step S2; the set of candidate intermediate nodes, the set of configurable nodes, the set of prohibited configurable nodes, and the node configuration cost are used to obtain the optimal configuration scheme for the distribution transformer area measurement terminals in step S3.

[0093] In step S2, please refer to Figure 1 In step S2, the dual-disturbance source topology segment localization training is performed based on voltage sag samples and harmonic samples to obtain the voltage sag source topology segment localization model and the harmonic dominant source topology segment localization model.

[0094] As an example, step S2 sets up independent voltage sag source topology segment location models and harmonic dominant source topology segment location models. The two location models share the equivalent topology relationship of candidate intermediate nodes and configuration mask processing rules, but are trained and verified using node features, samples, and real disturbance source topology segment labels under the corresponding disturbance type, to obtain fixed model parameters under the corresponding disturbance type.

[0095] Specifically, dual-disturbance-source topology segment localization refers to performing topology segment localization for voltage sag samples and harmonic samples separately, rather than simultaneously locating two physical disturbance sources in the same disturbance event. After the two localization sub-models complete offline training, their corresponding model parameters are fixed; when the current measurement terminal configuration changes, only the configuration mask and node measurement feature matrix are modified. The localization model is not retrained for each candidate configuration.

[0096] As an example, step S2 specifically includes: Step S21: Construct the equivalent topology of the candidate intermediate nodes based on the equivalent connection state between the two candidate intermediate nodes under the current distribution radio area operation mode; Step S22: Encode the measurement terminal installation status of each candidate intermediate node into the same set of binary measurement terminal configuration vectors. And construct a set of training configuration vectors ; Step S23: Configure vectors for the measurement terminal Perform configuration mask processing to construct the localization model input tensor; Step S24: Extract the topological spatial feature vector of the localization model input tensor using a graph convolutional network; Step S25: Extract the temporal variation features of the topological space feature vector using a long short-term memory network; Step S26: Map the temporal variation features to the disturbance category and calculate the predicted probability that the disturbance source belongs to each topological segment; Step S27: Train the voltage sag source topology segment location model and the harmonic dominant source topology segment location model based on the voltage sag samples and harmonic samples, and solidify the model parameters of the trained voltage sag source topology segment location model and harmonic dominant source topology segment location model.

[0097] Specifically, in step S21, in order for the graph convolutional network to utilize the actual electrical connection relationship between candidate intermediate nodes, when there is an effective electrical path between two candidate intermediate nodes under the current operating mode of the distribution substation, and there are no other candidate intermediate nodes within that path, an equivalent connection is established between the two candidate intermediate nodes, as shown below:

[0098] In the formula, Represents the equivalent adjacency matrix of candidate intermediate nodes; Indicates the first Candidate intermediate nodes and the Candidate intermediate nodes The equivalent connection state between them; This represents a valid electrical path connecting two candidate intermediate nodes. This represents the set of internal nodes in the path excluding the two endpoints; This represents the empty set.

[0099] For radial networks, the effective electrical path is the unique connected path between two nodes; for closed-loop or reconfigurable networks, it is the actual connected path under the current switching state. In other embodiments, the line equivalent impedance, line length, or electrical distance can be converted into connection weights in the adjacency matrix.

[0100] Furthermore, to preserve the node's own features and reduce the impact of different node degrees on feature aggregation during graph convolution, a self-connection is added to the equivalent adjacency matrix of the candidate intermediate nodes and symmetric normalization is performed, as shown below:

[0101] In the formula, This represents the adjacency matrix after adding self-connections; express An identity matrix of order 1; Degree matrix; The degree matrix represents the first degree. One diagonal element; Denotes the adjacency matrix after adding self-connection. Line 1 Column elements; This represents the normalized adjacency matrix used in graph convolution.

[0102] Furthermore, the equivalent adjacency matrix of the candidate intermediate nodes and the normalized adjacency matrix The equivalent topology of the candidate intermediate nodes is constructed. When the operation mode of the distribution substation changes, resulting in a change in the actual electrical connection relationship between the candidate intermediate nodes, the equivalent adjacency matrix of the candidate intermediate nodes is reconstructed. and normalized adjacency matrix .

[0103] Specifically, in step S22, the measurement terminal configures a vector. In the process of optimizing the configuration of measurement terminals, it is used to indicate the candidate installation location of measurement terminals. In the process of locating the topology segment of dual disturbance sources, it is used to filter the original node measurement features that can be obtained under the current measurement terminal configuration scheme.

[0104] Furthermore, in order to use the same set of binary variables to simultaneously represent the observable state of the candidate installation locations of the measurement terminals and the original node measurement features of the positioning model, any measurement terminal configuration scheme is encoded into a fixed-length binary configuration vector, as follows:

[0105]

[0106] In the formula, This represents a measurement terminal configuration vector, serving as a measurement terminal configuration scheme. Indicates the first Candidate intermediate nodes Configure the measurement terminal. Indicates the first Candidate intermediate nodes Measurement terminals are not configured. This belongs to the set of nodes where configuration is prohibited. The configuration variable corresponding to the node is fixed at 0.

[0107] Specifically, the same measurement terminal configuration vector represents the measurement terminal configuration position in step S3 and serves as a node feature configuration mask in step S2. The above two functions correspond to the same set of binary variables, and no independent configuration variables and feature filtering variables are set separately.

[0108] Furthermore, to enable the voltage sag source topology segment location model and the harmonic dominant source topology segment location model to adapt to different numbers of measurement terminals and different combinations of candidate intermediate nodes, multiple training configuration vectors are constructed during the offline training phase of the voltage sag source topology segment location model and the harmonic dominant source topology segment location model, and are layered according to the number of measurement terminals, as shown below:

[0109] In the formula, Represents the set of training configuration vectors; Indicates the first One training configuration vector; Indicates the first One training configuration vector; Indicates the number of training configuration vectors; Indicates the first The number of configuration terminals corresponding to each training configuration vector; Indicates being classified as the first The training configuration vector of the th training configuration vector There are 10 candidate intermediate nodes.

[0110] Among them, the training configuration vector set This includes at least the full configuration vectors of all configurable nodes with measurement terminals configured. Within each layer of measurement terminal quantity, multiple different node combinations are randomly selected or chosen according to preset combination rules, ensuring that each configurable node is trained within the configuration vector set. Each vector contains both configured and unconfigured training states. The training configuration vector set... It is not required to traverse all possible combinations of binary nodes.

[0111] Specifically, in step S23, the vector is configured on the measurement terminal. To apply the original node measurement features, a configuration diagonal matrix is ​​first constructed from the configuration vector. This matrix is ​​then used to mask the original node measurement features of unconfigured measurement terminals. Finally, the configuration state is used as an additional node measurement feature and concatenated with the original node measurement features to obtain the node measurement feature matrix, as shown below:

[0112]

[0113] In the formula, This indicates the configuration of a diagonal matrix; This indicates that a diagonal matrix is ​​constructed using the elements of the input vector; Indicates the first The perturbation sample at the ... Original node measurement feature matrix at each time location; This represents the node measurement feature matrix after configuration masking; the concatenated measurement terminal configuration vector. The nodes are used as a series of node measurement features according to their order.

[0114] when When, retain the original node measurement features of the corresponding candidate intermediate node; when When this occurs, the node's measurement characteristics are set to zero. Additional node measurement characteristics are used to distinguish between zero values ​​resulting from the lack of a configured measurement terminal and the node's actual measurement value being zero.

[0115] To maintain a unified time, node, and feature dimension for the input node measurement features of the voltage sag source topology segment location model and the harmonic dominant source topology segment location model, the node measurement feature matrix after configuration masking of all time locations is used. The input tensors for the localization model are combined in chronological order, as follows:

[0116] In the formula, This represents the localization model input tensor after the configuration mask has been applied; Indicates the type of disturbance The corresponding number of time locations; Indicates the type of disturbance The corresponding node feature dimension.

[0117] Specifically, in step S24, in order to fuse the topological connectivity and node measurement features between candidate intermediate nodes at each sampling time point or within the harmonic analysis window, the node measurement feature matrix after configuration masking is configured. As the initial input to the graph convolutional network, the measurement feature matrix of neighboring nodes is aggregated through a normalized adjacency matrix. , means as follows:

[0118]

[0119] In the formula, Indicates the first The node hidden feature matrix of each graph convolutional layer; Indicates the first +1 hidden feature matrix of nodes in graph convolutional layers; This represents the node measurement feature matrix of the first graph convolutional layer. The node hidden feature matrix; This represents the weight matrix of the corresponding convolutional layer in the graph; This represents the corresponding bias vector; This indicates the non-linear activation function used in the graph convolutional layer; This indicates the number of the convolutional layer in the graph.

[0120] To avoid unconfigured nodes directly participating in graph-level feature aggregation, a weighted average readout using a configured mask is applied to the output of the last graph convolution layer to form the topological spatial feature vector corresponding to each time position, as shown below:

[0121] In the formula, Indicates the first Topological spatial feature vectors at each time location; Indicates the number of convolutional layers in the graph; This indicates the first convolutional layer in the last layer of the graph. The hidden feature matrix rows corresponding to each candidate intermediate node.

[0122] Specifically, in step S25, to extract the time dependency between the continuous waveforms before and after the voltage sag and the continuous harmonic analysis window, the topological spatial feature vectors at each time position are input into the Long Short-Term Memory network in chronological order, and the temporal hidden state is updated through the forget gate, input gate, memory state, and output gate, as shown below:

[0123] In the formula, , and They represent the first The perturbation sample at the ... Forget gate, input gate, and output gate at each time position; Indicates the first The perturbation sample at the ... Candidate memory states at each time location; Indicates memory state; Indicates a hidden state; , , and These represent the input weight matrices corresponding to each gate structure; , , and This represents the cyclic weight matrix corresponding to each gate structure; , , and This represents the corresponding bias vector; This represents element-wise multiplication; This represents the hyperbolic tangent function.

[0124] Specifically, in step S26, to map the temporal variation features extracted by the Long Short-Term Memory network to the perturbation category, the hidden state at the last time position is input into the fully connected classification layer, and the predicted probability of the perturbation source belonging to each topological segment is calculated using the Softmax activation function, as shown below:

[0125] In the formula, Indicates the first The unnormalized score vector output by the topological segment classification layer for each perturbation sample; and These represent the weight matrix and bias vector of the topological segment classification layer, respectively; Indicates the first The disturbance source of the sample belongs to the first The predicted probability of each topological segment; This represents the segment number in the Softmax normalized summation activation function; Indicates the first Predicted segment labels for each perturbation sample; Indicates the type of disturbance. This indicates a voltage sag. Indicates harmonics; Indicates the number of topological segments; Indicates the type of disturbance The corresponding number of time locations; Indicates the type of disturbance The corresponding number One sample in The state of being hidden at any given time location throughout the entire period; Indicates the first The perturbation sample at the ... The unnormalized score vector output by the topological segment classification layer; Indicates the first The perturbation sample at the ... The unnormalized score vector output by the topological segment classification layer.

[0126] Specifically, in step S27, in order for the voltage sag source topology segment localization model and the harmonic dominant source topology segment localization model to learn the mapping relationship between node measurement features, topological spatial relationships, and disturbance temporal change processes and the real topology segments, respectively, the multi-class cross-entropy loss with regularization term is calculated using the one-hot labels of the real topology segments, and the parameters of the graph convolutional layer, LSTM layer, and classification layer are updated based on this loss, as shown below:

[0127] In the formula, Indicates the type of disturbance The training loss of the corresponding voltage sag source topology segment location model or harmonic dominant source topology segment location model; Indicates the type of disturbance Corresponding number of training samples; Indicates the first The disturbance source of the sample belongs to the first One-hot encoding of a real topological segment label; Indicates the type of disturbance Corresponding to the The loss weights for topological segments are the same when all categories of samples are balanced; Indicates the type of disturbance Corresponding regularization coefficient; Indicates the type of disturbance All trainable parameters of the corresponding localization model; This represents the L2 norm.

[0128] During the localization training process, from the training configuration vector set One or more training configuration vectors are extracted and used as configuration masks on the training voltage sag samples and training harmonic samples of the corresponding perturbation type. After each training round, the validation loss or validation localization accuracy is calculated using validation samples. Training stops when the maximum number of training rounds is reached, or when the validation loss no longer decreases within a preset number of rounds, and the fixed model parameters for the corresponding perturbation type with the best validation performance are saved.

[0129] After the positioning training is completed, the voltage sag source topology segment positioning model and the harmonic dominant source topology segment positioning model are directly called in the measurement terminal configuration optimization stage of step S3. The model parameters of the trained voltage sag source topology segment positioning model and the harmonic dominant source topology segment positioning model are solidified and written into the positioning model parameter library, as shown below:

[0130] In the formula, This represents the parameters of the solidified voltage sag source topology segment location model; This indicates the parameters of the solidified harmonic dominant source topology segment location model; superscript " "" indicates the model parameters saved after training is completed.

[0131] During the localization phase of the candidate configuration scheme for the measurement terminal, only the configuration vector, configuration mask, and corresponding node measurement feature matrix are changed. The model parameters of the voltage sag source topology segment location model and the harmonic dominant source topology segment location model will no longer be updated, and there is no need to retrain the location model.

[0132] In step S3, please refer to Figure 1In step S3, the objective function is to minimize the total configuration cost of the distribution radio station measurement terminal, while the accuracy of locating voltage sag source topology segments and the accuracy of locating harmonic dominant source topology segments are taken as constraints. The optimal configuration scheme of the distribution radio station measurement terminal is obtained through iterative updates.

[0133] As an example, step S3 is based on the set of candidate intermediate nodes. 1. Prohibit the configuration of node sets The candidate configuration schemes for measurement terminals are generated based on the configuration costs of the candidate intermediate nodes. The candidate configuration schemes for measurement terminals are then input into the optimized configuration model for measurement terminals. The voltage sag source topology segment location model and the harmonic dominant source topology segment location model solidified in step S2 are then called to calculate the voltage sag source topology segment location accuracy and harmonic dominant source topology segment location accuracy corresponding to each candidate configuration scheme for measurement terminals.

[0134] Furthermore, the measurement terminal optimization configuration model employs a collaborative binary genetic-particle swarm optimization hybrid algorithm to update candidate configuration schemes for measurement terminals. The candidate configuration vectors for measurement terminals simultaneously serve as binary chromosomes in the genetic algorithm, particle positions in the binary particle swarm optimization algorithm, and configuration masks in step S2. Particle swarm optimization is used to guide candidate configuration schemes for measurement terminals to move towards existing better configuration regions based on the individual's historical best position and the group's historical best position. Genetic crossover and adaptive mutation are used to recombine candidate intermediate nodes and maintain population diversity.

[0135] Specifically, step S3 includes steps S31 to S37.

[0136] Step S31: Taking the lowest overall configuration cost of the distribution area measurement terminal as the objective function, and using the accuracy of voltage sag source topology segment location, the accuracy of harmonic dominant source topology segment location, and the set of prohibited configuration nodes as the criteria. As a constraint, an optimal configuration model for measurement terminals is established; Step S32: Initialize the genetic-particle swarm shared population to obtain an initial set of candidate configuration schemes for measurement terminals; Step S33: Input the current candidate configuration scheme of the measurement terminal into the voltage sag source topology segment location model and the harmonic dominant source topology segment location model respectively to obtain the voltage sag source topology segment location accuracy and harmonic dominant source topology segment location accuracy of the current candidate configuration scheme of the measurement terminal. Step S34: For each candidate configuration scheme of measurement terminals generated in each iteration, calculate the comprehensive configuration cost and constraints through the measurement terminal optimization configuration model, and update the individual historical measurement terminal optimal configuration scheme of each particle and the population historical measurement terminal optimal configuration scheme based on the multi-level feasibility priority rule. Step S35: Perform binary particle swarm guided update and genetic selection, crossover and adaptive mutation on the optimal configuration scheme of the individual history measurement terminal for each particle and the optimal configuration scheme of the population history measurement terminal for the population. Step S36: Integrate the particle swarm optimization directional search capability and the genetic algorithm node recombination capability, perform constraint repair and elite retention operations for the candidate configuration schemes of the measurement terminal, and obtain the set of candidate configuration schemes for the measurement terminal in the next iteration; Step S37: When the iteration termination condition is met, stop updating the candidate configuration scheme of the measurement terminal and determine the optimal configuration scheme of the measurement terminal.

[0137] Specifically, in step S31, in order to reduce the overall configuration cost of the measurement terminal while meeting the requirements of node installability and the accuracy of positioning of the two types of disturbance sources, the overall cost of all configured candidate intermediate nodes in the configuration scheme is accumulated and used as the optimization objective, as shown below:

[0138] In the formula, This represents the current candidate configuration scheme for the measurement terminal, i.e., the measurement terminal configuration vector. The corresponding overall configuration cost.

[0139] Furthermore, to ensure that the configuration scheme simultaneously meets the requirements for voltage sag source topology segment location accuracy, harmonic dominant source topology segment location accuracy, and node installability, an optimized configuration model for binary measurement terminals under dual location accuracy constraints is established, as follows:

[0140] In the formula, This indicates a preset threshold for the accuracy of locating voltage sag source topology segments; This indicates a preset threshold for the accuracy of locating the dominant harmonic source topology segment. Represents the measurement terminal configuration vector The corresponding voltage sag source topology segment location accuracy; Represents the measurement terminal configuration vector The accuracy of locating the corresponding harmonic dominant source topology segment.

[0141] Furthermore, to uniformly represent the degree to which infeasible candidate configuration schemes that do not meet the constraints deviate from the positioning accuracy thresholds of the topology segments of the two types of disturbance sources, the insufficiency of the positioning accuracy for the two types of disturbance sources is calculated separately and accumulated to form the degree of violation of the positioning accuracy constraints of the dual-disturbance-source topology segments, as shown below:

[0142] In the formula, Represents the measurement terminal configuration vector The degree to which the dual positioning accuracy constraint is violated; This indicates taking the maximum value of each item within the parentheses.

[0143] when When, it indicates the configuration vector of the measurement terminal. Simultaneously satisfying the positioning accuracy constraints of topological segments from two types of disturbance sources; when When, it indicates the configuration vector of the measurement terminal. At least one type of positioning accuracy did not reach the preset threshold.

[0144] Specifically, in step S32, to form the initial search space of the genetic-particle swarm optimization algorithm, an initial population is generated that includes the full configuration scheme, the hierarchical random scheme with different numbers of terminals, and the distributed configuration scheme with different topological branches. Each candidate configuration scheme is simultaneously set with a binary position vector, a continuous velocity vector, and the individual's historical best position, as shown below:

[0145] In the formula, Indicates the first Population of candidate configuration schemes for measurement terminals; Represents iterative algebra; Indicates the first The generation One candidate configuration scheme for measurement terminal; The population size refers to the number of candidate configuration schemes for measurement terminals in a population.

[0146] Each candidate configuration scheme for the measurement terminal corresponds to a setting of particle velocity. Individual historical optimal configuration and the group's historical optimal configuration This belongs to the set of nodes that are prohibited from being configured. The configuration variables are all set to 0 in the initial population. The all-zero configuration scheme does not proceed to step S33 to calculate the positioning accuracy of the voltage sag source topology segment and the positioning accuracy of the harmonic dominant source topology segment, or at least one configurable node is retained through configuration repair.

[0147] Specifically, in step S33, the current candidate configuration scheme of the measurement terminal is obtained, and the accuracy of locating the voltage sag source topology segment and the accuracy of locating the harmonic dominant source topology segment under the current candidate configuration scheme of the measurement terminal are calculated based on the voltage sag configuration calculation sample and the harmonic configuration calculation sample.

[0148] As an example, after obtaining the current candidate configuration schemes for the measurement terminal, the first step is to check whether they meet the constraints of the prohibited configuration node set. For candidate configuration schemes that do not meet the constraints of the prohibited configuration node set, the configuration variables of the corresponding prohibited configuration nodes are reset to 0, or they are directly identified as infeasible schemes. Candidate configuration schemes for the measurement terminal that meet the node installability requirements are applied to the voltage sag configuration calculation sample and harmonic configuration calculation sample, respectively, and the two fixed positioning models are called to complete the forward calculation.

[0149] Furthermore, the candidate configuration schemes of the current measurement terminal are obtained, and the proportion of samples in the voltage sag configuration calculation sample and harmonic configuration calculation sample that are consistent with the predicted disturbance segment and the actual disturbance segment is statistically analyzed. The dual disturbance source topology segment localization capability corresponding to the candidate configuration scheme of the current measurement terminal is calculated, as follows:

[0150] In the formula, This represents the current candidate configuration scheme for the measurement terminal, i.e., the measurement terminal configuration vector. The corresponding voltage sag source topology segment location accuracy; Represents the measurement terminal configuration vector The corresponding harmonic dominant source topology segment location accuracy; Indicates the number of elements in the set; This indicates an indicator function that takes the value 1 if the condition within the parentheses is true, and 0 otherwise. Represents the measurement terminal configuration vector The corresponding number Predicted segment labels for each voltage sag sample; Represents the measurement terminal configuration vector The corresponding number Predicted segment labels for each harmonic sample; This represents a sample of voltage sag configuration calculations; This represents the harmonic configuration calculation sample. The current candidate configuration scheme of the measurement terminal is used as a configuration mask to apply to the configuration calculation sample, simulating the observable data of the distribution area under the candidate configuration scheme of the measurement terminal; the predicted disturbance segment of each configuration calculation sample is obtained by using the fixed-parameter positioning model, and compared with the actual disturbance segment of the configuration calculation sample to obtain the prediction accuracy corresponding to the candidate configuration scheme, which is fed back to the subsequent genetic-particle swarm hybrid algorithm for iterative optimization.

[0151] Furthermore, after calculating the dual-perturbation source localization accuracy of the current candidate configuration scheme of the measurement terminal, the current candidate configuration scheme of the measurement terminal, the localization accuracy of the voltage sag source topology segment, the localization accuracy of the harmonic dominant source topology segment, and the predicted segment labels of each configuration calculation sample are written into the optimization result record library. The localization accuracy of the voltage sag source topology segment and the localization accuracy of the harmonic dominant source topology segment are then input into the subsequent genetic-particle swarm hybrid algorithm iterative optimization step.

[0152] As an example, before formally implementing the iteration of the candidate configuration scheme for measurement terminals, the following steps are also included: inputting the full configuration scheme with all configurable nodes configured with measurement terminals into the positioning model as the initial candidate configuration scheme for measurement terminals; calculating and recording the comprehensive configuration cost, the positioning accuracy of the voltage sag source topology segment, and the positioning accuracy of the harmonic dominant source topology segment of the initial candidate configuration scheme for measurement terminals; using these to characterize the positioning capability of the positioning model with the current parameters under the condition of measurement of all configurable nodes; and using this as the initial reference scheme for the genetic-particle swarm hybrid algorithm, but not as the sole basis for determining whether other candidate configuration schemes for measurement terminals are feasible.

[0153] The subsequent steps continue to search for candidate configuration schemes of measurement terminals with different numbers of terminals and different combinations of nodes according to the preset iterative process; when the termination condition is reached and no candidate configuration scheme of measurement terminals that simultaneously meets the two types of positioning accuracy constraints is obtained, the result of no feasible scheme is output.

[0154] Specifically, in step S34, candidate configuration schemes for measurement terminals in the current population are sequentially or in batches input into two fixed positioning models to obtain the positioning accuracy of the topological segments of the two types of disturbance sources. The corresponding comprehensive configuration cost and constraint violation degree are then calculated in the optimized configuration model for the measurement terminals. To avoid repeatedly generating the same configuration vector in different iterations and then calling the dual-disturbance-source positioning model again, a candidate configuration scheme calculation cache is established using the binary code or hash value of the configuration vector as an index, as shown below:

[0155] In the formula, Indicates the first The generation A cache index of candidate configuration schemes for each measurement terminal; This represents a hash encoding operation.

[0156] Furthermore, when the same configuration vector already exists in the cache, the corresponding comprehensive configuration cost, voltage sag source topology segment location accuracy, harmonic dominant source topology segment location accuracy, and constraint violation degree are directly read, without repeatedly calling the two fixed location models; when the same configuration vector does not exist in the cache, the two fixed location models are called to complete the calculation, and the results are written to the cache.

[0157] Furthermore, the optimal configuration scheme of the individual historical measurement terminal for each particle and the optimal configuration scheme of the population's collective historical measurement terminal are compared according to a multi-level feasibility priority rule. The preferred candidate configuration scheme of the measurement terminal is selected as the elite scheme, and the optimal configuration scheme of the individual historical measurement terminal for each particle and the optimal configuration scheme of the population's collective historical measurement terminal are updated. The multi-level feasibility priority rule includes: when one candidate configuration scheme of the measurement terminal satisfies all constraints while another candidate configuration scheme of the measurement terminal satisfies all constraints, the feasible candidate configuration scheme of the measurement terminal satisfies all constraints takes priority; when both are feasible in satisfying all constraints, the feasible candidate configuration scheme of the measurement terminal with lower overall configuration cost takes priority; when both are infeasible in satisfying all constraints, the candidate configuration scheme of the measurement terminal with less constraint violation takes priority; when the overall configuration cost of two feasible candidates satisfying all constraints is the same, the candidate configuration scheme of the measurement terminal with fewer configuration terminals takes priority; when all the aforementioned indicators are the same, the candidate configuration scheme of the measurement terminal with higher value among the two types of positioning accuracy takes priority.

[0158] The multi-layer feasibility priority rule does not require setting the comprehensive configuration cost and the positioning accuracy of the disturbance source topology segment as an artificially weighted objective function, thereby avoiding the problem of difficulty in determining the weights between indicators of different dimensions.

[0159] Specifically, in step S35, to guide node combination updates using the historical optimal positions of the candidate configuration schemes of the measurement terminals and the current optimal positions of the population, binary particle swarm optimization updates are performed on the individual historical optimal configuration scheme of the measurement terminals for each particle and the population's collective historical optimal configuration scheme of the measurement terminals. This includes: calculating the continuous velocity corresponding to each dimension of the configuration variable for each particle based on the inertia term, individual learning term, and population learning term, and converting the continuous velocity into binary value probabilities using an S-shaped transformation function, as shown below:

[0160] In the formula, Indicates the first The generation The nth particle, i.e., the th particle The first candidate configuration scheme for the measurement terminal Dimensional speed; Indicates the first The generation The nth particle, i.e., the th particle The first candidate configuration scheme for the measurement terminal Dimensional speed; Indicates the first Replace inertial weights; and These represent the individual learning coefficient and the group learning coefficient, respectively. , and This represents a random number whose value ranges from 0 to 1. Indicates the first The generation The historical optimal configuration of each particle dimensional vector; Indicates the first The generation The first candidate configuration scheme for the measurement terminal dimensional vector; The first historical optimal configuration of the group represents the... dimensional vector; Represents the sigmoid transformation function; The binary candidate configuration scheme generated by the particle swarm update represents the first... Dimensional vector.

[0161] As an example, genetic selection, crossover, and adaptive mutation are performed on the optimal configuration of the individual history measurement terminal for each particle and the optimal configuration of the population's history measurement terminal, including: To recombine node positions from different candidate configurations, a feasibility-first tournament method is used to select the parent generation, and a genetic candidate configuration is generated through uniform crossover, as shown below:

[0162] In the formula, This represents a candidate configuration scheme for measurement terminals generated by genetic crossover. and This represents the two parent configuration vectors obtained through tournament selection; Indicates a crossover random number; This represents the probability of selecting the parent configuration vector; To determine the degree of difference between different node combinations in the current population, the normalized Hamming distance between each pair of all candidate configuration schemes is calculated and used as an indicator of population diversity, as follows:

[0163] In the formula, Indicates the first Normalized Hamming diversity of generational populations; Indicates the first The generation The first candidate configuration scheme for the measurement terminal dimensional vector; index In this formula, the candidate configuration scheme number is represented; Indicates population size; To increase the probability of generating new node combinations when population diversity is low and reduce ineffective random perturbations when population diversity is high, the bit-flipping mutation probability is adaptively adjusted based on normalized Hamming diversity, and mutation is performed on the configuration vector after crossover, as shown below:

[0164] In the formula, Indicates the first Adaptive mutation probability; and These represent the lower and upper bounds of the mutation probability, respectively; The candidate configuration scheme after genetic crossover and mutation is represented by the first... dimensional vector; This represents a mutated random number.

[0165] Specifically, in step S36, to enhance the directional guidance of the optimal position of the particle swarm when the population diversity is high, and to enhance the role of genetic crossover and mutation in generating new node combinations when the population diversity is low, the fusion ratio of the candidate particle swarm schemes is determined based on the current Hamming diversity of the population, as shown below:

[0166] In the formula, Indicates the first The fusion ratio of candidate particle swarm optimization schemes; and These represent the lower and upper bounds of the fusion probability, respectively.

[0167] Furthermore, to form a hybrid candidate configuration scheme that simultaneously possesses particle swarm optimization (PSO) directed search capability and genetic algorithm node recombination capability, for each configuration scheme, one is selected from the PSO candidate configuration scheme and the genetic mutation candidate configuration scheme as a fusion candidate configuration scheme according to the aforementioned fusion ratio, as shown below:

[0168] In the formula, The first candidate configuration scheme to be merged dimensional vector; This indicates a fused random number.

[0169] When population diversity is high To increase the density of measurement terminals, the hybrid candidate configuration scheme inherits more particle swarm optimization results, thereby improving the convergence speed to low-cost feasible regions; when population diversity is low, To reduce the number of mixed candidate configuration schemes for measurement terminals, more genetic crossover and mutation results are inherited to increase new node combinations.

[0170] As an example, node installability fixes are performed on candidate configuration schemes generated by particle swarm optimization, genetic update, and fusion update, including: To prevent configuration nodes from being configured, the configuration variable corresponding to the node being configured will be set to 0. When the candidate configuration scheme for the measurement terminal is an all-zero vector, the configuration will be determined from the set of configurable nodes. Select at least one candidate intermediate node and set the corresponding configuration variable to 1; When a maximum number of measurement terminals is set in an actual project, to avoid the candidate configuration schemes exceeding the device or communication resource limits, a constraint on the number of configuration terminals is added, as shown below:

[0171] In the formula, Indicates the maximum number of measurement terminals that can be configured; When the number of candidate configuration schemes for measurement terminals exceeds the maximum number of measurement terminals, the configured candidate intermediate nodes are first sorted from high to low according to their comprehensive configuration cost, and the corresponding configuration vectors are then attempted to be set from 1 to 0. After deleting a candidate node, the two positioning models are invoked or the candidate configuration scheme calculation cache is read to obtain the positioning accuracy of the topology segment of the two types of disturbance sources for the candidate configuration scheme of the measurement terminal after the node is deleted. If the deletion operation does not increase the degree of constraint violation of the two types of positioning accuracy, the deletion result is retained; if the deletion operation increases the degree of constraint violation, the configuration state of the node is restored and the next candidate node is tried until the number of configured terminals meets the constraint of the maximum number of measurement terminals. The candidate configuration scheme after the repair is then participated in the feasibility priority comparison.

[0172] As an example, to avoid losing already obtained low-cost feasible solutions during random updates, several elite solutions determined according to multi-level feasibility priority rules in the previous generation are combined with particle swarm candidate configuration solutions, genetic mutation candidate configuration solutions, and fusion candidate configuration solutions to form the next generation candidate configuration solution set, as shown below:

[0173] In the formula, Indicates the first Candidate set; , and These represent the sets of candidate schemes for particle swarm optimization, genetics, and fusion, respectively. Represents the collection of solutions from the previous generation of elites; symbol " " indicates the set union operation.

[0174] Finally, a selection is made from the candidate set based on a multi-level feasibility priority rule. The candidate configuration schemes form the next generation population, i.e., the next iteration of the measurement terminal candidate configuration scheme set, and update the individual historical best configuration scheme of each particle and the population historical best configuration scheme.

[0175] Specifically, in step S37, when the iteration termination condition is met, the update of the candidate configuration scheme for the measurement terminal is stopped, including: When the preset maximum number of iterations is reached and the lowest cost feasible solution no longer changes within a consecutive preset number of iterations, or when the historical optimal configuration of the group remains unchanged within a consecutive preset number of iterations, the update of the candidate configuration scheme for the measurement terminal stops.

[0176] Determine the optimal configuration scheme for the measurement terminal, including: The feasible measurement terminal configuration schemes are formed by assuming a constraint violation rate of 0. The scheme with the lowest overall configuration cost is selected as the optimal configuration scheme for the measurement terminal, as shown below:

[0177] In the formula, This represents a set of feasible measurement terminal configuration schemes; This represents the optimal configuration scheme for measurement terminals. It selects the scheme that simultaneously satisfies the node installability constraint and the positioning accuracy constraint of the dual-disturbance source topology segment from all candidate configuration schemes generated during the iterative optimization process. While ensuring the positioning capability of the dual-disturbance source topology segment, it reduces the number of measurement terminals, overall configuration cost, communication access points, and the burden of waveform data transmission and storage.

[0178] Furthermore, when the set of feasible measurement terminal configuration schemes is empty, the scheme with the smallest constraint violation is selected from all candidate configuration schemes that have been calculated as the reference measurement terminal configuration scheme, as shown below:

[0179] In the formula, This represents the reference measurement terminal configuration scheme with the lowest degree of constraint violation. This represents the set of all candidate configuration schemes for measurement terminals that have completed the calculation of the positioning accuracy of the dual-disturbance source topology segment during the optimization process.

[0180] Furthermore, when multiple reference measurement terminal configuration schemes exist with the same degree of constraint violation, the scheme with the lower overall configuration cost is selected. The reference measurement terminal configuration scheme is only used to adjust the candidate intermediate node range, the positioning accuracy threshold of the dual-disturbance source topology segment, the coverage range of the disturbance sample, or the positioning model parameters; it is not considered the optimal configuration scheme for measurement terminals to meet the positioning accuracy requirements of the dual-disturbance source topology segment.

[0181] As an example, after step S3, the method also includes: determining the optimal configuration scheme for the measurement terminal. Determine the candidate intermediate node set for the actual recommended installation of measurement terminals, form a recommended configuration node set with nodes whose configuration status is 1, and count the number of configured terminals, as shown below:

[0182] In the formula, This represents the set of candidate intermediate nodes for the recommended configuration of waveform recording type power quality measurement terminals; Indicates the optimal configuration scheme for the measurement terminal. The corresponding number of measurement terminals. Optimal configuration of measurement terminals. As an example, there is a set of feasible measurement terminal configuration schemes. At that time, the output optimization configuration results include: the optimal configuration scheme of the measurement terminal. Recommended configuration of intermediate candidate nodes and their topology locations, and the number of terminals. Overall configuration cost Accuracy of locating voltage sag source topology sections Accuracy of locating the dominant harmonic source topology segment 1. Prohibit the configuration of node sets And indicators of the feasibility of the plan.

[0183] Specifically, the optimized configuration results simultaneously record the distribution area model version, disturbance sample version, positioning model parameter version, positioning accuracy threshold, hybrid optimization algorithm parameters, calculation start time, calculation end time, and result verification value, so as to trace and verify the measurement terminal configuration scheme.

[0184] As an example, there is no set of feasible measurement terminal configuration schemes. When the optimized configuration is output, it includes: a flag indicating no feasible solution, and outputs the reference measurement terminal configuration scheme with the least constraint violation, the disturbance type that did not reach the preset threshold, the topology segment positioning accuracy of the corresponding disturbance type, and the difference between the topology segment positioning accuracy and the preset threshold. The reference measurement terminal configuration scheme is not used as the final basis for measurement terminal installation; it is only used to prompt the user to adjust the candidate intermediate node range, node installation conditions, topology segment positioning accuracy thresholds for the two types of disturbance sources, the coverage area of ​​the distribution station simulation sample, and the parameters of the dual-disturbance source positioning model.

[0185] This application also provides an optimized configuration system for distribution radio area measurement terminals. Please refer to [link / reference]. Figure 2 , Figure 2 The module diagram of the distribution radio area measurement terminal optimization configuration system provided in this application includes: Communication unit 1 receives external data in real time; wherein, the external data includes: distribution area topology, line parameters, load parameters, basic operation data, candidate intermediate node information, node installability information, and node configuration cost parameters; Storage unit 2 caches external data and intermediate data calculated during the optimization process; The calculation unit 3 reads the external data, executes the above-mentioned method for optimizing the configuration of a distribution radio area measurement terminal, and outputs the optimal configuration scheme for the measurement terminal.

[0186] The distribution substation measurement terminal optimization configuration system provided in this application can be deployed in the distribution room, prefabricated substation, or integrated terminal cabinet of the distribution substation, and carried by the substation-side edge computing server, industrial computer, or integrated terminal with computing capabilities. Alternatively, it can be centrally deployed in the server of the power supply company's distribution automation master station, power quality monitoring master station, or distribution IoT platform to perform measurement terminal optimization configuration for one or more distribution substations respectively. The distribution substation measurement terminal optimization configuration system is different from the waveform recording type power quality measurement terminal actually installed at the candidate intermediate node. The waveform recording type power quality measurement terminal is used to collect voltage, current, phase, transient waveform, and harmonic data on site. This distribution substation measurement terminal optimization configuration system is used to complete the construction of distribution substation simulation samples, training of dual disturbance source localization models, calculation of candidate configuration schemes, and output of final configuration results before the actual installation of the measurement terminals.

[0187] As an example, the communication unit 1 is connected to the power grid metering system, power grid marketing system, power grid intelligent monitoring system, transformer substation basic ledger and parameter database, and field communication gateway to receive external data. When fiber optic communication is available, external data is transmitted to the communication unit 1 via the power communication private network and fiber optic Ethernet; when fiber optic communication is unavailable, industrial Ethernet, 4G, or 5G wireless private network can be used for transmission; for field devices that only support RS-485 serial communication, the communication gateway first performs protocol conversion, and then the data is accessed through the industrial Ethernet or wireless communication network to the distribution transformer substation measurement terminal optimization configuration system provided in this application. External data can be transmitted using HTTPS interface calls, SFTP file transfer, read-only database access, IEC61850 communication service, Modbus TCP communication, or offline data file import. After receiving the data, the communication unit 1 performs communication protocol parsing, data format conversion, device number mapping, parameter integrity verification, and time base unification, and encapsulates the processed data into a unified data object within the device.

[0188] The storage unit 2 is connected to the communication unit 1 via an internal high-speed data bus, industrial Ethernet, or message queue. The storage unit 2 forms a base information library for the transformer substation, a topology and line parameter library for the substation, a candidate intermediate node library, a node installability information library, a node configuration cost library, a voltage sag sample library, a harmonic sample library, a disturbance source topology segment label library, a training configuration vector library, a positioning model parameter library, a candidate scheme calculation cache library, and an optimization result record library. The optimization result record library stores candidate configuration schemes for each measurement terminal, the corresponding positioning accuracy rates for the two types of disturbance source topology segments, and the predicted topology segments for each configuration calculation sample under the corresponding scheme, avoiding repeated calls to two positioning models to calculate the positioning accuracy of disturbance source topology segments.

[0189] It should be noted that the voltage sag samples, harmonic samples, and labels of the actual disturbance source topology segments are not directly provided by external data, but are generated by the distribution substation simulation model in calculation unit 3; the historical measurement data in the external data is only used to verify the normal operation status of the distribution substation and the basic parameters of the distribution substation simulation model.

[0190] As an example, the computing unit 3 includes: Sample construction module 31 constructs a simulation model of the distribution area and generates voltage sag samples, harmonic samples, and section labels; The dual-disturbance source topology segment localization module 32 performs dual-disturbance source topology segment localization training based on voltage sag samples and harmonic samples to obtain voltage sag source topology segment localization model and harmonic dominant source topology segment localization model. The optimal configuration scheme generation module 33 for the measurement terminal aims to minimize the overall configuration cost of the measurement terminal in the distribution station area, while taking the accuracy of locating the voltage sag source topology segment and the accuracy of locating the harmonic dominant source topology segment as constraints, and iteratively updates to obtain the optimal configuration scheme for the measurement terminal in the distribution station area.

[0191] The computing unit 3 is connected to the storage unit 2 through a database query interface, a shared memory interface, or a file read interface. The computing unit 3 reads external data from the storage unit 2, constructs a distribution transformer area simulation model, generates voltage sag samples, harmonic samples, and segment labels, and performs dual-disturbance source topology segment localization training based on the voltage sag and harmonic dominant source topology segment localization models. With the goal of minimizing the overall configuration cost of the distribution transformer area measurement terminal, and with the accuracy of voltage sag source topology segment localization and harmonic dominant source topology segment localization meeting certain standards as constraints, the optimal configuration scheme for the distribution transformer area measurement terminal is iteratively updated, and the optimized configuration result is written back to the storage unit 2.

[0192] The computing unit 3 is connected to the result output unit 4 via an internal data bus or a local network interface. The result output unit 4 outputs the optimization configuration results through a local display, a web-based human-machine interface, a main station communication interface, or in the form of JSON, XML, CSV, spreadsheets, or PDF files. In a centralized deployment mode, the optimization configuration results can also be transmitted to the distribution automation main station, power quality management platform, or operation and maintenance management system via a dedicated power communication network.

[0193] This application also provides an electronic device, including: a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the above-described method for optimizing the configuration of a distribution radio area measurement terminal.

[0194] The present invention also provides a machine-readable storage medium storing machine-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the above-described method for optimizing the configuration of distribution radio area measurement terminals.

[0195] The method, system, equipment, and machine-readable storage medium for optimizing the configuration of measurement terminals in distribution transformer areas provided in this application generate two types of disturbance samples and real topology segment labels before the installation of the measurement terminals using a distribution transformer area simulation model. Based on the accuracy constraints of locating voltage sag sources and dominant harmonic sources in the topology segments, the method optimizes the candidate configuration schemes for the measurement terminals. This solves the problems in the prior art, such as the separate configuration of voltage sag source and dominant harmonic source locating tasks, the lack of a direct quantitative relationship between the configuration scheme and the dual disturbance source locating capability, the lack of disturbance data for all candidate nodes before the installation of the measurement terminals, the tendency of a single optimization algorithm to converge locally, and the unclear process of device data access and result output. This method ensures the dual disturbance source topology segment locating capability while reducing the number of measurement terminals and the overall configuration cost.

[0196] Although this application has been disclosed above with reference to embodiments, it is not intended to limit this application. Anyone skilled in the art may make some modifications and refinements without departing from the spirit and scope of this application. Therefore, the scope of protection of this application shall be determined by the appended claims.

Claims

1. A method for optimizing the configuration of measurement terminals in a distribution radio area, characterized in that, include, Construct a simulation model of the power distribution area and generate voltage sag samples, harmonic samples, and section labels; Based on voltage sag samples and harmonic samples, dual-disturbance source topology segment localization training is performed to obtain voltage sag source topology segment localization model and harmonic dominant source topology segment localization model; With the goal of minimizing the overall configuration cost of the distribution radio station measurement terminal, and taking the accuracy of locating voltage sag source topology sections and harmonic dominant source topology sections as constraints, the optimal configuration scheme of the distribution radio station measurement terminal is obtained through iterative updates.

2. The method for optimizing the configuration of distribution radio area measurement terminals as described in claim 1, characterized in that, The optimal configuration scheme for distribution transformer area measurement terminals is obtained through iterative updates, with the goal of minimizing the overall configuration cost of the measurement terminals and the constraints of achieving accurate positioning of voltage sag source topology sections and harmonic dominant source topology sections. Specifically, this includes: With the objective function of minimizing the overall configuration cost of measurement terminals in the distribution area, and with the positioning accuracy of voltage sag source topology segments, the positioning accuracy of harmonic dominant source topology segments, and the set of prohibited configuration nodes as constraints, an optimal configuration model for measurement terminals is established. Initialize the genetic-particle swarm shared population to obtain an initial set of candidate configuration schemes for measurement terminals; Input the current candidate configuration schemes of the measurement terminal into the voltage sag source topology segment location model and the harmonic dominant source topology segment location model respectively, and obtain the voltage sag source topology segment location accuracy and harmonic dominant source topology segment location accuracy of the current candidate configuration schemes of the measurement terminal. For each candidate configuration scheme of measurement terminals generated in each iteration, the comprehensive configuration cost and constraints are calculated through the measurement terminal optimization configuration model. Based on the multi-level feasibility priority rule, the individual historical measurement terminal optimal configuration scheme of each particle and the population's group historical measurement terminal optimal configuration scheme are updated. For each particle's individual history measurement terminal optimal configuration scheme and the population's population history measurement terminal optimal configuration scheme, binary particle swarm guided update and genetic selection, crossover and adaptive mutation are performed; By integrating the particle swarm optimization capability and the genetic algorithm node recombination capability, the constraint repair and elite retention operations of the candidate configuration schemes for measurement terminals are performed to obtain the set of candidate configuration schemes for measurement terminals in the next iteration. When the iteration termination condition is met, the update of candidate configuration schemes for the measurement terminal is stopped, and the optimal configuration scheme for the measurement terminal is determined.

3. The method for optimizing the configuration of measurement terminals in a distribution radio area as described in claim 2, characterized in that, The optimized configuration model for the measurement terminal is represented as follows: In the formula, Represents the measurement terminal configuration vector The corresponding overall configuration cost; Indicates the first Configuration cost of each candidate intermediate node; Indicates the number of candidate intermediate nodes; Indicates the first Candidate intermediate nodes Configure the measurement terminal. Indicates the first Candidate intermediate nodes No measurement terminal is configured; The constraints, namely the accuracy of locating voltage sag source topology segments, the accuracy of locating harmonic dominant source topology segments, and the set of prohibited nodes, are expressed as follows: In the formula, This indicates a preset threshold for the accuracy of locating voltage sag source topology segments; This indicates a preset threshold for the accuracy of locating the dominant harmonic source topology segment. Represents the measurement terminal configuration vector The corresponding voltage sag source topology segment location accuracy; Represents the measurement terminal configuration vector The corresponding harmonic dominant source topology segment location accuracy; This indicates that the configuration of the node set is prohibited.

4. The method for optimizing the configuration of measurement terminals in a distribution radio area as described in claim 3, characterized in that, The accuracy rates for locating voltage sag source topology segments and harmonic dominant source topology segments of the current candidate configuration scheme for the measurement terminal are expressed as follows: In the formula, Indicates the number of elements in the set; This indicates an indicator function that takes the value 1 if the condition within the parentheses is true, and 0 otherwise. Represents the measurement terminal configuration vector The corresponding number Predicted segment labels for each voltage sag sample; Represents the measurement terminal configuration vector The corresponding number Predicted segment labels for each harmonic sample; Indicates the first The true segment label of a voltage sag sample; Indicates the first The true segment label of each harmonic sample; This represents a sample of voltage sag configuration calculations; This represents the harmonic configuration calculation sample.

5. The method for optimizing the configuration of measurement terminals in a distribution radio area as described in claim 4, characterized in that, The optimal configuration scheme for the individual history measurement terminal of each particle and the optimal configuration scheme for the population history measurement terminal are executed using binary particle swarm optimization, as shown below: In the formula, Indicates the first The generation The nth particle, i.e., the th particle The first candidate configuration scheme for the measurement terminal Dimensional speed; Indicates the first The generation The nth particle, i.e., the th particle The first candidate configuration scheme for the measurement terminal Dimensional speed; Indicates the first Replace inertial weights; and These represent the individual learning coefficient and the group learning coefficient, respectively. , and This represents a random number whose value ranges from 0 to 1. Indicates the first The generation The historical optimal configuration of each particle dimensional vector; Indicates the first The generation The first candidate configuration scheme for the measurement terminal dimensional vector; The first historical optimal configuration of the group represents the... dimensional vector; Represents the sigmoid transformation function; The binary candidate configuration scheme generated by the particle swarm update represents the first... dimensional vector; The optimal configuration scheme for the individual history measurement terminal of each particle and the optimal configuration scheme for the population history measurement terminal are subjected to genetic selection, crossover, and adaptive mutation, including: The parent generation is selected using a feasibility-first tournament method, and genetic candidate configurations are generated through uniform crossover, as shown below: In the formula, This represents a candidate configuration scheme for measurement terminals generated by genetic crossover. and This represents the two parent configuration vectors obtained through tournament selection; Indicates a crossover random number; This represents the probability of selecting the parent configuration vector; Calculate the normalized Hamming distance between each pair of all candidate configurations and use it as an indicator of population diversity, as follows: In the formula, Indicates the first Normalized Hamming diversity of generational populations; Indicates the first The generation The first candidate configuration scheme for the measurement terminal dimensional vector; index In this formula, the candidate configuration scheme number is represented; Indicates population size; To reduce ineffective random perturbations when population diversity is high, the bit-flipping mutation probability is adaptively adjusted based on normalized Hamming diversity, and mutation is performed on the configuration vector after crossover, as shown below: In the formula, Indicates the first Adaptive mutation probability; and These represent the lower and upper bounds of the mutation probability, respectively; The candidate configuration scheme after genetic crossover and mutation is represented by the first... dimensional vector; Represents a mutated random number; The fusion of particle swarm optimization and genetic algorithm node recombination capabilities includes: The fusion ratio of candidate particle swarm optimization schemes is determined based on the current Hamming diversity of the population, as shown below: In the formula, Indicates the first The fusion ratio of candidate particle swarm optimization schemes; and These represent the lower and upper bounds of the fusion probability, respectively. For each configuration scheme, according to the fusion ratio, one is selected as a fusion candidate configuration scheme from the particle swarm candidate configuration scheme and the genetic mutation candidate configuration scheme, as shown below: In the formula, The first candidate configuration scheme to be merged dimensional vector; This indicates a fused random number.

6. The method for optimizing the configuration of measurement terminals in a distribution radio area as described in claim 1, characterized in that, The step of training the dual-disturbance-source topology segment localization based on voltage sag samples and harmonic samples to obtain voltage sag source topology segment localization models and harmonic-dominant source topology segment localization models specifically includes: Construct the equivalent topology of the candidate intermediate nodes based on the equivalent connection state between the two candidate intermediate nodes under the current operation mode of the distribution radio area; The installation status of the measurement terminal of each candidate intermediate node is encoded into the same set of binary measurement terminal configuration vectors, and a training configuration vector set is constructed. The configuration vector of the measurement terminal is processed by configuration masking to construct the input tensor of the positioning model; Graph convolutional networks are used to extract topological spatial feature vectors from the input tensors of the localization model. Long Short-Term Memory (LSTM) networks are used to extract temporal variation features of topological spatial feature vectors. The temporal variation features are mapped to the disturbance category to calculate the predicted probability that the disturbance source belongs to each topological segment; The model parameters of the voltage sag source topology segment location model and the harmonic dominant source topology segment location model are solidified based on the voltage sag sample and harmonic sample.

7. The method for optimizing the configuration of measurement terminals in a distribution radio area as described in claim 6, characterized in that, The step of mapping temporal variation features to disturbance categories to calculate the predicted probability that the disturbance source belongs to each topological segment is expressed as follows: In the formula, Indicates the first The unnormalized score vector output by the topological segment classification layer for each perturbation sample; and These represent the weight matrix and bias vector of the topological segment classification layer, respectively; Indicates the first The disturbance source of the sample belongs to the first The predicted probability of each topological segment; This represents the segment number in the Softmax normalized summation activation function; Indicates the first Predicted segment labels for each perturbation sample; Indicates the type of disturbance. This indicates a voltage sag. Indicates harmonics; Indicates the number of topological segments; Indicates the type of disturbance The corresponding number of time locations; Indicates the type of disturbance The corresponding number One sample in The state of being hidden at any given time location throughout the entire period; Indicates the first The perturbation sample at the ... The unnormalized score vector output by the topological segment classification layer; Indicates the first The perturbation sample at the th The unnormalized score vector output by the topological segment classification layer.

8. The method for optimizing the configuration of measurement terminals in a distribution radio area as described in claim 1, characterized in that, The construction of the distribution substation simulation model, generating voltage sag samples, harmonic samples, and section labels, specifically includes: Establish a complete distribution network topology; Based on the complete topology of the distribution radio area, obtain the set of candidate intermediate nodes for the distribution radio area and determine the set of configurable nodes. Calculate the configuration cost of candidate intermediate nodes; A simulation model of the distribution substation is constructed based on the complete topology of the distribution substation, line parameters, node load parameters, candidate intermediate node set, node installability information and node configuration cost parameters. A voltage sag scenario is set and a voltage sag sample is constructed. A harmonic scenario is set and a harmonic sample is constructed. Based on the distribution area simulation model, voltage sag source topology segments and harmonic source topology segments are divided, and corresponding real segment labels are generated.

9. The method for optimizing the configuration of measurement terminals in a distribution radio area as described in claim 8, characterized in that, Set up voltage sag scenarios and construct voltage sag samples, including: The voltage sag depth, voltage sag duration, and voltage sag phase jump variable are calculated and expressed as follows: In the formula, Indicates the sample number of the disturbance source; Indicates the first In the voltage sag scenario, the first Candidate intermediate nodes The voltage sag depth at the location; Indicates the first In the voltage sag scenario, the first The minimum effective voltage value during the voltage sag of each candidate intermediate node; Indicates the first In the voltage sag scenario, the first The effective value of the reference voltage before the voltage dips of each candidate intermediate node occur; Indicates the first The duration of a voltage sag in a voltage sag scenario; and They represent the first The start and end times of a voltage sag scenario; Indicates the first In the voltage sag scenario, the first Voltage sag phase jump variables of candidate intermediate nodes; and They represent the first In the voltage sag scenario, the first Phase during voltage sag and reference phase before sag for each candidate intermediate node; This indicates that the phase difference is mapped to a preset phase range; The candidate intermediate node voltage sampling features, candidate intermediate node current sampling features, voltage sag depth, voltage sag duration, and voltage sag phase jump variable are combined into a node-level voltage sag feature vector, as shown below: In the formula, Indicates the sampling time location number; Indicates the first In the voltage sag scenario, the first Voltage sag feature vectors of candidate intermediate nodes; and They represent the first In the voltage sag scenario, the first Voltage and current sampling characteristics of candidate intermediate nodes; superscript Indicates vector transpose; The voltage sag feature vectors of each candidate intermediate node and each sampling time position are organized into voltage sag samples in the order of time-node-feature, as follows: In the formula, Indicates the first One voltage sag sample; Indicates the number of voltage sag sampling time locations; Indicates the characteristic dimension of voltage sag nodes; Represents the real number field; The setting of harmonic scenarios and construction of harmonic samples includes: The comprehensive harmonic injection index of each harmonic source is calculated based on the phasor of each harmonic current within the preset harmonic order set. The harmonic source with the largest comprehensive harmonic injection index is selected as the dominant harmonic source, as shown below: In the formula, Indicates the harmonic source number; Indicates the first Comprehensive harmonic injection index of individual harmonic sources; This represents the preset set of harmonic orders for analysis; Indicates the first The weights corresponding to the subharmonics; Indicates the first The first harmonic source injected the first Second harmonic current phasor; Indicates the number of the dominant harmonic source; This represents the variable that maximizes the objective function; The extracted harmonic voltage amplitude, harmonic current amplitude, harmonic voltage phase, harmonic current phase, voltage and current harmonic phase difference, total harmonic distortion rate, and single harmonic content are combined into a nodal-level harmonic feature vector, as shown below: In the formula, This indicates the sampling time and location number. In a harmonic scenario, the harmonic analysis window is used as one sampling point. Indicates the number of the continuous harmonic analysis window; Indicates the first In the harmonic scene, the first Harmonic eigenvectors of candidate intermediate nodes; and They represent the first In the first harmonic scenario The harmonic voltage amplitude vector and harmonic current amplitude vector corresponding to the preset analysis harmonic order of each candidate intermediate node; and They represent the first In the harmonic scene, the first Harmonic voltage phase vector and harmonic current phase vector of each candidate intermediate node; Indicates the first In the harmonic scene, the first The phase difference vector between the same harmonic voltage and harmonic current of each candidate intermediate node; and They represent the first In the harmonic scene, the first The voltage and current single harmonic content vectors of the candidate intermediate nodes; and They represent the first In the harmonic scene, the first Total harmonic distortion of voltage and total harmonic distortion of current of candidate intermediate nodes; The harmonic feature vectors of all candidate intermediate nodes and continuous harmonic analysis windows are organized into harmonic samples in the order of time-node-feature, as follows: In the formula, Indicates the first One harmonic sample; Indicates the number of continuous harmonic analysis windows; This represents the characteristic dimension of the harmonic node.

10. A distribution area measurement terminal optimization configuration system, characterized in that, include: The communication unit receives external data in real time; wherein, the external data includes: distribution area topology, line parameters, load parameters, basic operation data, candidate intermediate node information, node installability information, and node configuration cost parameters; Storage unit, used to cache external data and intermediate data calculated during the optimization process; The computing unit reads the external data.

11. The distribution radio area measurement terminal optimization configuration system as described in claim 10, characterized in that, The computing unit includes: The sample construction module builds a simulation model of the distribution area and generates voltage sag samples, harmonic samples, and section labels. The dual-disturbance source topology segment localization module trains the dual-disturbance source topology segment localization based on voltage sag samples and harmonic samples, and obtains the voltage sag source topology segment localization model and the harmonic dominant source topology segment localization model. The optimal configuration scheme generation module for measurement terminals aims to minimize the overall configuration cost of measurement terminals in the distribution station area, while taking the accuracy of voltage sag source topology segment location and harmonic dominant source topology segment location as constraints. It iteratively updates to obtain the optimal configuration scheme for measurement terminals in the distribution station area.

12. An electronic device, characterized in that, include: A processor and a machine-readable storage medium storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the distribution radio area measurement terminal optimization configuration method according to any one of claims 1-9.

13. A machine-readable storage medium, characterized in that, The machine-readable storage medium stores machine-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the distribution radio area measurement terminal optimization configuration method according to any one of claims 1-9.