Power distribution network short-time grounding reason identification method based on adaptive weighted K nearest neighbor

By using the adaptive weighted K-nearest neighbor method, the triggering cause of short-term grounding events in the distribution network is determined by utilizing the similarity distance between standard sample waveforms and current waveforms. This solves the problem of low identification accuracy under high-quality small samples and achieves higher identification accuracy and model stability.

CN121978469BActive Publication Date: 2026-07-07STATE GRID BEIJING ELECTRIC POWER CO +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
STATE GRID BEIJING ELECTRIC POWER CO
Filing Date
2026-04-08
Publication Date
2026-07-07

AI Technical Summary

Technical Problem

When existing technologies rely on deep learning methods to identify the triggering causes of transient grounding events in distribution networks, they face the problem of high-quality, small sample sizes, resulting in low identification accuracy.

Method used

An adaptive weighted K-nearest neighbor method is adopted. By pre-setting standard sample waveforms and actual triggering causes, the number of target nearest neighbors is determined, the similarity distance of current waveforms is calculated, target nearest neighbor waveforms are screened out, and the triggering cause of the current grounding event is determined based on the triggering causes of these waveforms.

Benefits of technology

It improves the accuracy of trigger cause identification, solves the problem of low identification accuracy caused by reliance on human experience, and enhances the robustness and generalization ability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121978469B_ABST
    Figure CN121978469B_ABST
Patent Text Reader

Abstract

The application discloses a power distribution network short-time grounding reason identification method based on adaptive weighted K-nearest neighbor. The method comprises the following steps: determining a target neighbor number based on a plurality of standard sample waveforms and actual trigger reasons of the plurality of standard sample waveforms; collecting original transient recording data corresponding to a current power distribution network short-time grounding event; extracting current waveforms based on the original transient recording data; calculating similarity distances between the current waveforms and the plurality of standard sample waveforms to obtain similarity distances corresponding to the plurality of standard sample waveforms respectively; screening a plurality of target neighbor waveforms matched with the target neighbor number based on the similarity distances corresponding to the plurality of standard sample waveforms respectively; and determining a trigger reason corresponding to the current power distribution network short-time grounding event based on trigger reasons corresponding to the plurality of target neighbor waveforms respectively. The application solves the technical problem that the current short-time grounding reason identification mostly depends on artificial experience, thereby reducing the identification accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of distribution network detection technology, and more specifically, to a method for identifying the cause of short-time grounding in distribution networks based on adaptive weighted K-nearest neighbors. Background Technology

[0002] Identifying the triggering causes of transient grounding events in distribution networks primarily relies on artificial intelligence methods, especially deep learning techniques. However, the application of deep learning methods in identifying the triggering causes of transient grounding signals in distribution networks faces significant technical challenges and limitations. These challenges mainly stem from the dilemma of "high-quality, small sample size." While field waveform recording terminals can capture massive amounts of transient event data, the number of truly high-quality samples with "clear causes and accurate labels" is extremely limited due to the transient nature of the events and the high cost of on-site verification. This directly results in deep learning models being unable to fully learn diverse features during training, thus affecting the model's generalization performance and identification accuracy.

[0003] There is currently no effective solution to the above problems. Summary of the Invention

[0004] This invention provides a method for identifying the cause of short-time grounding in distribution networks based on adaptive weighted K-nearest neighbors, which at least solves the technical problem that the current identification of the cause of short-time grounding mostly relies on human experience, resulting in low identification accuracy.

[0005] According to one aspect of the present invention, a method for identifying the cause of a short-time grounding event in a distribution network based on adaptive weighted K-nearest neighbors is provided, comprising: determining the number of target nearest neighbors based on a plurality of preset standard sample waveforms and the actual triggering causes of each of the plurality of standard sample waveforms, wherein the plurality of standard sample waveforms are waveforms generated by a short-time grounding signal in the distribution network; acquiring the original transient waveform recording data corresponding to the current short-time grounding event in the distribution network; extracting the current waveform based on the original transient waveform recording data; calculating the similarity distance between the current waveform and the plurality of standard sample waveforms respectively, thereby obtaining the similarity distance corresponding to each of the plurality of standard sample waveforms; filtering out a plurality of target nearest neighbor waveforms that match the number of target nearest neighbors based on the similarity distances corresponding to each of the plurality of standard sample waveforms; and determining the triggering cause corresponding to the current short-time grounding event in the distribution network based on the triggering causes corresponding to each of the plurality of target nearest neighbor waveforms.

[0006] Optionally, the target number of neighbors is determined based on a number of preset standard sample waveforms and the actual triggering causes of each of the preset standard sample waveforms, including: obtaining a number of candidate neighbors; calculating the prediction accuracy of the triggering cause corresponding to each of the number of candidate neighbors based on the number of preset standard sample waveforms and the actual triggering causes of each of the preset standard sample waveforms; and selecting the number of candidate neighbors whose prediction accuracy of the triggering cause exceeds a preset threshold as the target number of neighbors.

[0007] Optionally, based on a preset set of multiple standard sample waveforms and their respective actual triggering causes, the prediction accuracy of the triggering cause corresponding to the number of target candidate nearest neighbors is calculated. The number of target candidate nearest neighbors is any one of the multiple candidate nearest neighbor numbers. This includes: dividing the multiple standard sample waveforms into a preset number of waveform subsets; determining a test waveform subset and a training waveform subset based on the multiple waveform subsets; calculating the similarity distance between the multiple standard sample waveforms in the test waveform subset and the standard sample waveforms in the training waveform subset; selecting a number of standard sample waveforms matching the number of target candidate nearest neighbors from the multiple similarity distances corresponding to the multiple standard sample waveforms in the test waveform subset, as the sample nearest neighbor waveforms corresponding to the multiple standard sample waveforms in the test waveform subset; determining the predicted triggering cause corresponding to each of the multiple standard sample waveforms in the test waveform subset based on the triggering cause corresponding to the sample nearest neighbor waveforms corresponding to the multiple standard sample waveforms in the test waveform subset; and determining the prediction accuracy of the triggering cause corresponding to the number of target candidate nearest neighbors based on the predicted triggering cause corresponding to each of the multiple standard sample waveforms in the test waveform subset and the actual triggering cause corresponding to each of the multiple standard sample waveforms in the test waveform subset.

[0008] Optionally, based on the original transient waveform data, the current waveform is extracted, including: parsing the time series data of the three-phase current from the original transient waveform data; and based on the time series data of the three-phase current, adding up multiple preset sampling points one by one to determine the current waveform.

[0009] Optionally, the triggering cause corresponding to the current short-time grounding event in the distribution network is determined based on the triggering causes corresponding to each of the multiple target neighbor waveforms, including: determining the decision weights corresponding to each of the multiple target neighbor waveforms based on their similarity distance values; determining multiple candidate triggering causes based on their actual triggering causes; determining the total decision weight corresponding to each of the multiple candidate triggering causes based on their decision weights; determining the confidence scores corresponding to the multiple candidate triggering causes based on their total decision weights; and selecting the candidate triggering cause whose confidence score meets a preset condition as the triggering cause corresponding to the current short-time grounding event in the distribution network.

[0010] Optionally, based on the total decision weights corresponding to each of the multiple candidate triggering reasons, the confidence scores corresponding to the multiple candidate triggering reasons are determined, including: according to a preset formula, based on the total decision weights corresponding to each of the multiple candidate triggering reasons, the confidence scores corresponding to the multiple candidate triggering reasons are determined, wherein the preset formula is as follows: in, Candidate trigger reasons The corresponding confidence score, Candidate trigger reasons The corresponding total decision weight.

[0011] According to another aspect of the present invention, a distribution network short-time grounding cause identification device based on adaptive weighted K-nearest neighbors is also provided, comprising: a first determining module, configured to determine the number of target nearest neighbors based on a preset plurality of standard sample waveforms and the actual triggering causes of each of the plurality of standard sample waveforms, wherein the plurality of standard sample waveforms are waveforms generated by a distribution network short-time grounding signal; an acquisition module, configured to acquire the original transient waveform data corresponding to the current distribution network short-time grounding event; an extraction module, configured to extract the current waveform based on the original transient waveform data; a calculation module, configured to calculate the similarity distance between the current waveform and the plurality of standard sample waveforms respectively, to obtain the similarity distance corresponding to each of the plurality of standard sample waveforms; a filtering module, configured to filter out a plurality of target nearest neighbor waveforms that match the number of target nearest neighbors based on the similarity distance corresponding to each of the plurality of standard sample waveforms; and a second determining module, configured to determine the triggering cause corresponding to the current distribution network short-time grounding event based on the triggering causes corresponding to each of the plurality of target nearest neighbor waveforms.

[0012] According to another aspect of the present invention, a non-volatile storage medium is also provided, the non-volatile storage medium including a stored program, wherein, when the program is running, the device where the non-volatile storage medium is located is controlled to execute any of the above-described methods for identifying the cause of short-time grounding in a distribution network based on adaptive weighted K-nearest neighbors.

[0013] According to another aspect of the present invention, a computer device is also provided, the computer device including a processor, the processor being configured to run a program, wherein the program, when running, executes any of the above-described methods for identifying the cause of short-term grounding in a distribution network based on adaptive weighted K-nearest neighbors.

[0014] According to another aspect of the present invention, a computer program product is also provided, including a computer program that, when executed by a processor, implements any of the above-described methods for identifying the cause of short-term grounding in a distribution network based on adaptive weighted K-nearest neighbors.

[0015] In this embodiment of the invention, an adaptive weighted K-nearest neighbor-based method for identifying the cause of short-term grounding in distribution networks is adopted. This method determines the number of target nearest neighbors based on multiple preset standard sample waveforms and their respective actual triggering causes. The multiple standard sample waveforms are waveforms generated by short-term grounding signals in the distribution network. The method involves: acquiring raw transient waveform data corresponding to the current short-term grounding event; extracting the current waveform based on the raw transient waveform data; calculating the similarity distance between the current waveform and the multiple standard sample waveforms; selecting multiple target nearest neighbor waveforms that match the number of target nearest neighbors based on the similarity distances; and determining the triggering cause of the current short-term grounding event based on the triggering causes of the multiple target nearest neighbor waveforms. This achieves the goal of determining the nearest neighbor waveform and thus the triggering cause based on the number of nearest neighbors, thereby improving the accuracy of triggering cause identification and solving the technical problem that current short-term grounding cause identification largely relies on human experience, leading to low identification accuracy. Attached Figure Description

[0016] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:

[0017] Figure 1 A hardware block diagram of a computer terminal for implementing a method for identifying short-time grounding causes in a distribution network based on adaptive weighted K-nearest neighbors is shown.

[0018] Figure 2 This is a flowchart illustrating the method for identifying the cause of short-time grounding in a distribution network based on adaptive weighted K-nearest neighbors, according to an embodiment of the present invention.

[0019] Figure 3 This is a schematic diagram of a method for identifying the cause of short-time grounding in a distribution network based on adaptive weighted K-nearest neighbors, provided by an optional embodiment of the present invention.

[0020] Figure 4 This is a structural block diagram of a distribution network short-time grounding cause identification device based on adaptive weighted K-nearest neighbor according to an embodiment of the present invention. Detailed Implementation

[0021] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0022] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0023] According to an embodiment of the present invention, a method embodiment for identifying the cause of short-time grounding in a distribution network based on adaptive weighted K-nearest neighbors is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0024] The method embodiment provided in Embodiment 1 of this application can be executed on a mobile terminal, computer terminal, or similar computing device. Figure 1 A hardware block diagram of a computer terminal for implementing an adaptive weighted K-nearest neighbor-based method for identifying short-time grounding causes in distribution networks is shown. Figure 1 As shown, the computer terminal 10 may include one or more processors (shown as 102a, 102b, ..., 102n in the figure) (the processor may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0025] It should be noted that the aforementioned one or more processors and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10. As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).

[0026] The memory 104 can be used to store software programs and modules for application software, such as the program instructions / data storage device corresponding to the adaptive weighted K-nearest neighbor-based distribution network short-time grounding cause identification method in this embodiment of the invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby implementing the aforementioned application program for the adaptive weighted K-nearest neighbor-based distribution network short-time grounding cause identification method. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0027] The display can be, for example, a touchscreen liquid crystal display (LCD) that allows the user to interact with the user interface of the computer terminal 10.

[0028] Figure 2 This is a flowchart illustrating the method for identifying the cause of short-time grounding in a distribution network based on adaptive weighted K-nearest neighbors, as provided in an embodiment of the present invention. Figure 2 As shown, the method includes the following steps:

[0029] Step S202: Based on multiple preset standard sample waveforms and their respective actual triggering causes, determine the number of target neighbors, wherein the multiple standard sample waveforms are waveforms generated by short-time grounding signals in the distribution network.

[0030] In this step, determining the number of target nearest neighbors (i.e., the K value) can employ a data-driven optimization strategy to determine the optimal number of neighbors K for the K-nearest neighbor classification algorithm. If the K value is too small, the model is prone to mistaking noise for signals, leading to overfitting and poor stability; if the K value is too large, it will smooth out the details of the decision boundary, resulting in underfitting and decreased accuracy. Traditional methods often rely on human experience to set the K value, which is highly subjective and difficult to guarantee optimality.

[0031] This embodiment can collect waveform data of short-term grounding signals caused by different triggering reasons from historical data to construct a high-quality standard sample library. Each standard sample waveform should have a clear label of the actual triggering reason, which is necessary information for training and evaluation. A series of candidate K values ​​can be set to cover the possible optimal range. The standard sample waveform dataset is randomly divided into multiple subsets of similar size, each subset can be used as a validation set, and the rest as a training set. For each candidate K value, the following process is repeated: Use K-1 subsets as the training set to train the KNN model. Use the remaining subsets as the validation set to calculate the prediction accuracy. Record the average accuracy of each K value in K-fold cross-validation. Compare the average accuracy of all candidate K values ​​to identify the K value that provides the highest classification accuracy. The K value that provides the highest classification accuracy is determined as the target nearest neighbor.

[0032] Determining the number of target neighbors helps ensure that the KNN model can make accurate classification judgments when faced with short-term grounding signals caused by various triggering reasons.

[0033] Step S204: Collect the original transient waveform data corresponding to the current short-time grounding event in the distribution network.

[0034] In this step, the monitoring system can be run in real time to detect electrical parameters in the power grid, such as current and voltage. Fault detection algorithms within the monitoring system, such as zero-crossing detection and amplitude detection, are used to promptly identify short-term grounding events in the distribution network. When the monitoring system detects a short-term grounding event, it automatically triggers the waveform recording equipment to begin recording data. The waveform recording equipment collects time-series data of electrical quantities such as current and voltage over a certain period before and after the fault, typically including multiple cycles before and after the fault, to obtain raw transient waveform data.

[0035] By following the steps above, it can be ensured that when a short-term grounding event occurs in the distribution network, the corresponding transient waveform data can be collected quickly and accurately, and processed and stored in the early stage, providing high-quality data support for subsequent fault diagnosis and analysis.

[0036] Step S206: Extract the current waveform based on the original transient waveform recording data.

[0037] In this step, based on the original transient waveform data, a current waveform corresponding to the zero-sequence current that reflects the grounding characteristics can be constructed by adding the data point by point, which serves as the core channel data for subsequent analysis.

[0038] Zero-sequence current is a key electrical quantity characterizing single-phase grounding events in distribution networks. It can effectively filter out symmetrical load current interference and highlight fault characteristics. Therefore, the original three-phase current data can be converted into a single zero-sequence current waveform, providing high-quality input for subsequent processing.

[0039] Specifically, the zero-sequence current waveform is extracted from the three-phase current data. This can be achieved by vector superposition of the three-phase currents and taking the residual component. The zero-sequence current waveform can more clearly reflect the characteristics of a single-phase ground fault. In addition to the zero-sequence current, other useful features, such as current change rate, frequency characteristics, and peak value, can be constructed to enhance the accuracy of subsequent analysis.

[0040] The above steps effectively extract current waveforms suitable for fault analysis from raw transient waveform data, laying the foundation for further signal processing and machine learning algorithm applications. This waveform data can help improve the accuracy and efficiency of fault detection and location.

[0041] Step S208: Calculate the similarity distance between the current waveform and multiple standard sample waveforms to obtain the similarity distances corresponding to each of the multiple standard sample waveforms.

[0042] In this step, the current waveform to be compared and the standard sample waveform are standardized. This includes ensuring that the sampling points of the two waveforms are aligned on the time axis, i.e., their start and end times are consistent. The amplitude of the current waveform is converted to the same range, typically 0 to 1, to eliminate the impact of amplitude differences on similarity calculation. A suitable metric is selected to calculate the similarity distance, such as Dynamic Time Warping (DTW), Euclidean distance, Manhattan distance, correlation coefficient, etc. Different metrics are suitable for different types of waveform data and fault scenarios. DTW is particularly suitable for handling local scaling or offset of waveforms on the time axis, while Euclidean distance is suitable for waveforms with basically the same shape but possible slight amplitude variations. For each standard sample waveform in the standard sample library, the selected similarity metric is applied to calculate the similarity distance between the current waveform to be analyzed and that standard sample waveform. The calculated similarity distance value is associated with and stored with the corresponding standard sample waveform ID, forming a list or data structure containing the similarity distances of all standard sample waveforms.

[0043] By following the steps described above, the similarity distance between the current waveform to be analyzed and multiple standard sample waveforms can be calculated, and analysis and decision-making can be made based on these distance values. This process not only helps in the subsequent identification of the triggering cause.

[0044] Step S210: Based on the similarity distances of the waveforms of multiple standard samples, select multiple target nearest neighbor waveforms that match the number of target nearest neighbors.

[0045] In this step, the waveforms are sorted in ascending order based on their similarity distance values; smaller distance values ​​indicate greater similarity. The top K (number of target neighbors) waveforms with the smallest similarity distance are selected from the sorted list; these are the "target neighbor waveforms." The selected target neighbor waveforms, their similarity distances, and their corresponding trigger reason labels are then grouped into a set. Each waveform in the set must include its original similarity distance value and trigger reason label; these will be used in the subsequent weighted voting process.

[0046] To cope with possible abnormal situations, such as the loss or poor quality of some neighboring waveform data, some spare neighboring waveforms (usually waveforms near the K value) can be selected.

[0047] By following the steps above, we can ensure that the KNN classification algorithm can make decisions based on the most relevant and similar sample waveforms, thereby improving the accuracy of identifying the triggering cause of instantaneous grounding signals in the distribution network.

[0048] Step S212: Based on the triggering causes corresponding to the short-term grounding event in the current distribution network, determine the triggering cause based on the triggering causes corresponding to the multiple target neighbor waveforms.

[0049] In this step, the triggering cause for each waveform is extracted from the information associated with each target's nearest neighbor waveforms. These causes are typically obtained through the analysis and annotation of historical events. A weight can be assigned to each target's nearest neighbor waveform based on similarity distance; the smaller the distance, the greater the weight. For each possible triggering cause, its total weighted votes are calculated, which is the sum of the weights of all nearest neighbor waveforms corresponding to that triggering cause. The triggering cause with the highest total weighted votes can be identified and used as the triggering cause for the current short-term grounding event. Alternatively, a confidence score can be calculated for all possible triggering causes, and the one with the highest confidence score can be selected as the final triggering cause. The determined triggering causes and their confidence scores can be output for reference by maintenance personnel or automated systems.

[0050] By following the steps described above, a more accurate triggering cause can be determined based on the current event waveform and the triggering causes of multiple target neighboring waveforms, thereby improving the efficiency and accuracy of distribution network fault diagnosis. This method is particularly suitable for handling data in the "high-quality, small-sample" dilemma, enhancing the robustness and generalization ability of the model through a collective decision-making mechanism.

[0051] Through the above steps, the purpose of determining the nearest waveform based on the number of nearest neighbors and thus determining the triggering cause can be achieved, thereby improving the technical effect of triggering cause identification and solving the technical problem that the identification of short-term grounding causes mostly relies on human experience, resulting in low identification accuracy.

[0052] As an optional embodiment, the target number of neighbors is determined based on a number of preset standard sample waveforms and the actual triggering causes of each of the preset standard sample waveforms, including: obtaining a number of candidate neighbors; calculating the prediction accuracy of the triggering cause corresponding to each of the number of candidate neighbors based on the number of preset standard sample waveforms and the actual triggering causes of each of the preset standard sample waveforms; and selecting the number of candidate neighbors whose prediction accuracy of the triggering cause exceeds a preset threshold as the target number of neighbors.

[0053] Optionally, multiple candidate nearest neighbor numbers are obtained, and the prediction accuracy of the triggering cause is calculated based on multiple preset standard sample waveforms and their respective actual triggering causes. The candidate number exceeding a preset threshold is then selected as the target nearest neighbor number. This method ensures that the selected nearest neighbor number not only provides sufficient information for accurate classification but also avoids overfitting or underfitting problems.

[0054] First, set a reasonable range for the number of candidate nearest neighbors, for example, starting from 3 and increasing by 2 each time until a large number is reached, such as 21, 25, or higher, but usually not exceeding half the size of the sample library. Create a set containing these numbers, dividing the pre-defined dataset of multiple standard sample waveforms into training and validation sets, typically using K-fold cross-validation to ensure robustness and generalization ability. Ensure that a portion of the data is used for final model performance validation; this portion should remain independent and avoid being used for model training or parameter selection. For each number of candidate nearest neighbors: based on the training set, use the KNN algorithm to determine the k nearest neighbor waveforms for each validation set sample. Apply an adaptive weighting strategy for voting to determine the predicted triggering cause for each validation set sample, compare the predicted triggering cause with the actual triggering cause for each sample, count the number of correctly predicted samples, and calculate the accuracy, which is the number of correctly predicted samples divided by the total number of samples.

[0055] A threshold for the accuracy of trigger cause prediction can be preset, such as 85% or 90%, depending on the specific application scenario and accuracy requirements. Compare the accuracy corresponding to each candidate nearest neighbor number with the preset threshold. Select the candidate with the smallest number of nearest neighbors whose accuracy exceeds the preset threshold as the target nearest neighbor number. This typically means minimizing the number of nearest neighbors while meeting certain accuracy standards to improve decision-making efficiency and reduce model complexity, and is suitable for small sample scenarios. Alternatively, the K value with the highest accuracy can be directly selected as the target nearest neighbor number.

[0056] By following the steps described above, the number of target nearest neighbors in the KNN algorithm can be accurately determined. This not only enables prediction based on the most similar samples but also maintains high prediction accuracy and model stability, effectively addressing the challenge of "high-quality small samples." This method, through data-driven optimization, avoids the subjectivity of relying on empirical settings, improving the objectivity and generalization ability of the model.

[0057] As an optional embodiment, based on a preset number of standard sample waveforms and their respective actual triggering causes, the prediction accuracy of the triggering cause corresponding to the number of target candidate nearest neighbors is calculated. The number of target candidate nearest neighbors is any one of the multiple candidate nearest neighbor numbers. This includes: dividing the multiple standard sample waveforms into a preset number of waveform subsets; determining a test waveform subset and a training waveform subset based on the multiple waveform subsets; calculating the similarity distance between the multiple standard sample waveforms in the test waveform subset and the standard sample waveforms in the training waveform subset; selecting a number of standard sample waveforms matching the number of target candidate nearest neighbors from the multiple similarity distances corresponding to the multiple standard sample waveforms in the test waveform subset, as the sample nearest neighbor waveforms corresponding to each of the multiple standard sample waveforms in the test waveform subset; determining the predicted triggering cause corresponding to each of the multiple standard sample waveforms in the test waveform subset based on the triggering cause corresponding to the sample nearest neighbor waveforms corresponding to each of the multiple standard sample waveforms in the test waveform subset; and determining the prediction accuracy of the triggering cause corresponding to the number of target candidate nearest neighbors based on the predicted triggering cause corresponding to each of the multiple standard sample waveforms in the test waveform subset and the actual triggering cause corresponding to each of the multiple standard sample waveforms in the test waveform subset.

[0058] Optionally, the standard sample waveform dataset is divided into a predetermined number of subsets, such as 10 subsets. Each subset contains 10% of the dataset's samples. One subset is selected as the test waveform subset each time, and the remaining subsets are combined as the training waveform subset. For each standard sample waveform in the selected test waveform subset: the similarity distance with each sample waveform in the training waveform subset can be calculated using methods such as Dynamic Time Warping (DTW), Euclidean distance, and correlation coefficient. Based on the calculated similarity distance, a number of neighboring waveforms matching the target candidate nearest neighbors are selected for each sample waveform in the test waveform subset. For example, if the target candidate nearest neighbors are 5, the 5 closest sample waveforms are selected as nearest neighbors. For each sample waveform in the test waveform subset: a weighted vote is performed based on the actual triggering cause of its sample neighbor waveforms, with waveforms having a smaller similarity distance receiving a larger weight. The result of the weighted vote is the predicted triggering cause. The predicted triggering cause of each sample waveform is then compared with its actual triggering cause. For all sample waveforms in the test waveform subset, count the number of correctly predicted samples, and then calculate the accuracy, which is the number of correctly predicted samples divided by the total number of samples in the test waveform subset. Repeat the above process for each K value in the candidate nearest neighbor set to obtain the prediction accuracy for different K values. Compare the prediction accuracies obtained for all K values, and select the K value whose accuracy exceeds a preset threshold as the target nearest neighbor count. If multiple K values ​​exceed the threshold, the smallest K value is usually selected to maintain model simplicity.

[0059] As an optional embodiment, the current waveform is extracted based on the original transient waveform data, including: parsing the time series data of the three-phase current from the original transient waveform data; and adding multiple preset sampling points one by one based on the time series data of the three-phase current to determine the current waveform.

[0060] Optionally, raw waveform data can be read from a transient waveform recording device or system. This data typically contains three-phase currents (phases A, B, and C) and other possible electrical parameters. Discrete-time series data of the three-phase currents (A, B, and C) are extracted, ensuring that the current data for each phase is strictly aligned in time, i.e., the sampling frequency and sampling time are consistent. Zero-sequence current is the phasor sum of the three-phase currents, and theoretically should be zero under normal operating conditions for a balanced three-phase system. However, in the event of an asymmetrical fault such as a single-phase ground fault, the zero-sequence current will increase significantly. The time series data of the three-phase currents (A, B, and C) are added point by point: Let the synthesized zero-sequence current time series be... I 0={ i 0,1 , i 0,2 ,..., i 0,T}, its t-th sampling point i0,t The calculation formula is: ,in, .

[0061] Through the above steps, current waveforms are extracted based on the original transient waveform data, providing high-quality feature input for fault analysis of instantaneous grounding events in distribution networks.

[0062] As an optional embodiment, the triggering cause corresponding to the current short-time grounding event in the distribution network is determined based on the triggering causes corresponding to each of the multiple target neighbor waveforms. This includes: determining the decision weights corresponding to each of the multiple target neighbor waveforms based on their similarity distance values; determining multiple candidate triggering causes based on their actual triggering causes; determining the total decision weight corresponding to each of the multiple candidate triggering causes based on their decision weights; determining the confidence scores corresponding to the multiple candidate triggering causes based on their total decision weights; and selecting the candidate triggering cause whose confidence score meets a preset condition as the triggering cause corresponding to the current short-time grounding event in the distribution network.

[0063] Optionally, determining decision weights based on the similarity distance values ​​of multiple target neighbor waveforms, and then using these weights and the actual triggering causes of the current distribution network short-term grounding event to determine the triggering cause, fully utilizes the characteristics of each neighbor waveform while suppressing the influence of noise and uncertainties through weighted averaging, thus improving the accuracy of triggering cause prediction. A decision weight can be calculated for each target neighbor waveform. The weight should be inversely proportional to the similarity distance; the smaller the distance, the larger the weight. All different actual triggering causes are extracted from the target neighbor waveforms. These triggering causes constitute a set of candidate triggering causes. For each candidate triggering cause, the sum of the decision weights of all related neighbor waveforms is calculated. This step can be achieved by traversing the target neighbor waveform set and accumulating the weights of each waveform with the same triggering cause. The confidence score of each candidate triggering cause is the ratio of the total decision weight of that triggering cause to the sum of the total decision weights of all candidate triggering causes. This intuitively reflects the credibility of a particular triggering cause relative to other possibilities.

[0064] A preset judgment condition, such as a confidence score threshold, is established. Only candidate triggering causes with scores exceeding this threshold are considered potential triggering causes. Triggering causes that meet the confidence score condition are selected from the candidate triggering causes as the triggering cause of the current event. If multiple triggering causes meet the condition, their scores can be compared, and the one with the highest score is selected. The selected triggering cause and its confidence score are output, providing decision-making support for maintenance personnel or automated control systems.

[0065] This method effectively combines sample similarity with the frequency of triggering causes. Through comprehensive analysis and weighted decision-making, it can provide robust and accurate instantaneous grounding event triggering cause identification services in a "high-quality, small-sample" environment. This is of significant importance for early warning and fault prevention, and can significantly improve the operational stability of the distribution network and the quality of power supply services.

[0066] As an optional embodiment, the confidence score corresponding to the multiple candidate triggering reasons is determined based on the total decision weight corresponding to each of the multiple candidate triggering reasons, including: determining the confidence score corresponding to the multiple candidate triggering reasons according to a preset formula based on the total decision weight corresponding to each of the multiple candidate triggering reasons, wherein the preset formula is as follows: in, Candidate trigger reasons The corresponding confidence score, Candidate trigger reasons The corresponding total decision weight.

[0067] Figure 3 This is a schematic diagram of a method for identifying the cause of short-time grounding in a distribution network based on adaptive weighted K-nearest neighbors, provided by an optional embodiment of the present invention. Figure 3 As shown, it includes:

[0068] S1: Using a data-driven optimization strategy, determine the optimal number of neighbors K for the K-nearest neighbor classification algorithm, i.e., the target number of neighbors. The specific steps are as follows:

[0069] Step 11: Define the range of candidate K values. First, within a reasonable range that conforms to engineering practice, define a set containing the number of multiple candidate nearest neighbors. K cand Considering that in classification tasks, the K value is usually chosen to avoid a tie, in this embodiment, the candidate K value set can be set as follows: K cand ={3,5,7,9,11,..., k p},in k p This is the preset upper limit.

[0070] Step 12: Perform K-fold cross-validation evaluation. To robustly evaluate the generalization performance of each candidate K value without requiring an additional test set, the K-fold cross-validation method can be used. Specifically, it includes the following steps:

[0071] (1) Dataset partitioning: partitioning the historical high-quality sample database DB Randomly and uniformly divided into F A set of mutually exclusive subsets of similar size. DB 1 DB 2 ,...,DB F In this embodiment, preferably, F =10.

[0072] (2) Iterative verification: Evaluation is performed using nested loops. The outer loop iterates through the set of candidate K values. K cand Each candidate value in k i The inner loop performs verification F times, and on the... f Second-rate( f =1,..., F In the verification, the first f Subset DB f As a validation set, the rest F -1 subsets are combined into the training set.

[0073] (3) Model performance calculation: For each sample in the validation set, perform K-nearest neighbor classification on the training set (the number of nearest neighbors is set to 1). k i The predicted causes were obtained. All predicted causes were compared with the actual causes to calculate the accuracy of this validation. acc i,f .

[0074] (4) Calculate the average accuracy: after completing the inner loop F After the first verification, candidate values ​​are calculated. k i Average classification accuracy on this dataset ACC ( k i The calculation formula is as follows: .

[0075] Step 13: Determine the optimal K value. After cross-validation evaluation of all candidate K values, calculate the average accuracy of the resulting set of K values. ACC(k 1 ),ACC(k 2 ),...,ACC(k p ) The parameters are compared. The candidate value that maximizes the average accuracy is selected as the optimal hyperparameter for this data environment. K opt : , K opt This is the number of the target's nearest neighbors.

[0076] S2: Collect the waveform data reported by the transient waveform recording terminal after a transient grounding event in the distribution network, and construct a zero-sequence current that reflects the grounding characteristics by adding them point by point. The specific steps are as follows:

[0077] Step 21: Acquire transient waveform data. Obtain the original waveform data corresponding to a certain instantaneous grounding event from the transient waveform recording terminal of the distribution network. Extract the discrete time series of the three-phase currents A, B, and C from these data, denoted as follows: I a ={ i a,1 , i a,2 ,..., i a,T}, I b ={ i b,1 , i b,2 ,..., i b,T}and Ic ={ i c,1 , i c,2 ,..., i c,T The length of each of the three time series is T, and the sampling points with the same index in each series are strictly aligned in time.

[0078] Step 22: Extract zero-sequence current characteristics. By adding the time series of the three-phase currents A, B, and C point by point, a zero-sequence current waveform that can sensitively reflect the characteristics of a single-phase grounding is synthesized. I 0. Let the synthesized zero-sequence current time series be... I 0={ i 0,1 , i 0,2 ,..., i 0,T}, its any number t sampling points i 0,t The calculation formula is: ,in, The synthesized zero-sequence current waveform I 0 will be used as the core feature waveform for subsequent standardization and similarity quantification analysis.

[0079] S3: Calculate the similarity distance between the zero-sequence current waveform and the waveforms of each sample in the sample library. The specific steps are as follows:

[0080] Step 31: Zero-sequence current waveform standardization. The zero-sequence current waveform constructed for S2...I 0. Perform data standardization processing. This process involves three steps: time window truncation, sampling rate normalization, and numerical normalization, to transform the raw zero-sequence current into a standard analytical waveform with uniform length, standardized sampling rate, and normalized amplitude. W norm This is for use in subsequent comparative analysis.

[0081] Step 32: Calculate the similarity distance. An elastic time series matching algorithm is applied to calculate the standard analysis waveform. W norm With high-quality sample libraries DB Each sample waveform DB j (j= 1,2,..., M) similarity distance value between d j The algorithm can intelligently find the optimal alignment path between two waveforms, thereby obtaining a waveform that is unaffected by local scaling or offset of the time axis and can reflect the degree of similarity to the actual shape.

[0082] Step 33: Generate the distance result set. For all samples in the sample database... M After repeating the above calculation for each sample, each distance value... d j Its corresponding sample index j Bind to a tuple ( d j , j ), and store them in a result set. R For use in subsequent decision-making steps: .

[0083] S4: Adaptive weighted voting classification based on the optimal K value determines the final triggering cause of the instantaneous grounding signal based on the similarity distance. The specific steps are as follows:

[0084] Step 41: Filtering K opt The nearest neighbor samples are selected. From all comparison results, the set of samples most similar to the waveform to be identified is selected. Specifically, this includes the following steps:

[0085] (1) The result set generated in step 33 R Elements, based on similarity distance value d j Perform an ascending sort to obtain a new ordered list. R sorted The sample with the smallest distance is ranked first.

[0086] (2) Utilize the optimal hyperparameters determined in S1 for the current sample database data environment K opt From an ordered list R sorted Starting from the initial position, extract the previous... K opt These elements constitute the final nearest neighbor sample set. S k This set S k It will serve as the sole input for subsequent weighted voting decisions.

[0087] Step 42: Calculate the adaptive decision weights for each nearest neighbor sample. Based on the principle that samples with higher similarity and closer distances have greater decision weights, calculate the nearest neighbor sample set. S k The adaptive decision weights for each sample in the dataset.

[0088] In this embodiment, an inverse proportional function is preferably used as the weight calculation model. For the nearest neighbor sample set... S k Any sample in the sample (whose similarity distance is 1) d j The index is j Its adaptive decision weights w j The calculation formula is as follows: ,in, w j Represents the set of nearest neighbor samples S k The Middle j Adaptive decision weights for each sample ε This represents a very small positive number, its purpose being to prevent the distance from being too large. d j When the denominator is zero, a calculation error occurs, thus enhancing the numerical stability of the algorithm.

[0089] Step 43: Perform adaptive weighted voting and determine the final cause. Using the adaptive weights calculated in Step 42, perform weighted voting on the triggering causes represented by nearest neighbor samples to determine the triggering cause of the short-time grounding signal and its confidence level. Specifically, this includes the following steps:

[0090] (1) Identify and aggregate candidate cause categories. Traverse the nearest neighbor sample set selected in step 41. S k All of them K opt For each sample, extract the corresponding cause label. (j) All unique tags are grouped together to form a list containing...q A set of candidate causes L candidate , which can be expressed as: , where l k represents a unique trigger cause category.

[0091] (2) Calculate the confidence scores of various candidate causes.

[0092] First, calculate the total weighted votes of various candidate causes. Traverse the set of candidate causes L candidate for each cause l k (where k = 1, 2,..., q ). In each loop, traverse the set of neighboring samples S k again, find all samples with the cause label l k and accumulate the corresponding decision weights w j calculated in step 42. The total weighted votes l k of this cause V(l k ) are calculated by the formula: .

[0093] where the meaning of the subscript of ∑ is to traverse all sample indices that satisfy the two conditions of "in the set of neighboring samples S k " and "the cause label is l k " and accumulate their corresponding weights j j . w j

[0094] Secondly, calculate the sum of the total weighted votes of all candidate causes V total: .

[0095] Finally, calculate the confidence score l k of each candidate cause P(l k ) : .

[0096] (3) List all candidate causes and their corresponding confidence scores P(l k) Sort the candidates in descending order and select the one with the highest confidence score as the final triggering cause of the instantaneous grounding signal, and output its confidence score as well.

[0097] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.

[0098] Through the above description of the embodiments, those skilled in the art can clearly understand that the method for identifying the cause of short-time grounding in distribution networks based on adaptive weighted K-nearest neighbors according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0099] According to an embodiment of the present invention, a distribution network short-time grounding cause identification device based on adaptive weighted K-nearest neighbors is also provided for implementing the above-described method for identifying the cause of distribution network short-time grounding based on adaptive weighted K-nearest neighbors. Figure 4 is a structural block diagram of the distribution network short-time grounding cause identification device based on adaptive weighted K-nearest neighbors provided according to an embodiment of the present invention. Figure 4 As shown, the distribution network short-time grounding cause identification device based on adaptive weighted K-nearest neighbor includes: a first determination module 402, an acquisition module 404, an extraction module 406, a calculation module 408, a filtering module 410, and a second determination module 412. The following is a description of the distribution network short-time grounding cause identification device based on adaptive weighted K-nearest neighbor.

[0100] The first determining module 402 is used to determine the number of target neighbors based on a number of preset standard sample waveforms and the actual triggering causes of each of the multiple standard sample waveforms, wherein the multiple standard sample waveforms are waveforms generated by short-time grounding signals in the distribution network.

[0101] The acquisition module 404 is connected to the first determination module 402 and is used to acquire the original transient waveform data corresponding to the current short-time grounding event in the power distribution network.

[0102] Extraction module 406, connected to acquisition module 404, is used to extract current waveform based on raw transient waveform data.

[0103] The calculation module 408, connected to the extraction module 406, is used to calculate the similarity distance between the current waveform and multiple standard sample waveforms, and to obtain the similarity distance corresponding to each of the multiple standard sample waveforms.

[0104] The filtering module 410, connected to the calculation module 408, is used to filter out multiple target nearest neighbor waveforms that match the number of target nearest neighbors based on the similarity distances corresponding to the waveforms of multiple standard samples.

[0105] The second determining module 412, connected to the filtering module 410, is used to determine the triggering cause of the current short-time grounding event in the distribution network based on the triggering causes corresponding to the respective triggering causes of multiple target neighbor waveforms.

[0106] It should be noted that the first determining module 402, the acquisition module 404, the extraction module 406, the calculation module 408, the filtering module 410, and the second determining module 412 mentioned above correspond to steps S202 to S212 in the embodiments. Multiple modules and their corresponding steps implement the same instances and application scenarios, but are not limited to the content disclosed in the above embodiments. It should also be noted that the above modules, as part of the device, can run on the computer terminal 10 provided in the embodiments.

[0107] Embodiments of the present invention may provide a computer device. Optionally, in this embodiment, the computer device may be located in at least one of a plurality of network devices in a computer network. The computer device includes a memory and a processor.

[0108] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the adaptive weighted K-nearest neighbor-based distribution network short-time grounding cause identification method and device in this embodiment of the invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby realizing the aforementioned adaptive weighted K-nearest neighbor-based distribution network short-time grounding cause identification method. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to a computer terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0109] The processor can invoke information and application programs stored in the memory via the transmission device to perform the following steps: determining the number of target neighbors based on multiple preset standard sample waveforms and their respective actual triggering causes, wherein the multiple standard sample waveforms are waveforms generated by short-time grounding signals in the distribution network; acquiring the original transient waveform data corresponding to the current short-time grounding event in the distribution network; extracting the current waveform based on the original transient waveform data; calculating the similarity distance between the current waveform and the multiple standard sample waveforms to obtain the similarity distance corresponding to each of the multiple standard sample waveforms; filtering out multiple target neighbor waveforms that match the number of target neighbors based on the similarity distances corresponding to each of the multiple standard sample waveforms; and determining the triggering cause corresponding to the current short-time grounding event in the distribution network based on the triggering causes corresponding to each of the multiple target neighbor waveforms.

[0110] Optionally, the processor may also execute program code for the following steps: determining the target number of nearest neighbors based on a number of preset standard sample waveforms and the actual triggering causes of each of the preset standard sample waveforms, including: obtaining a number of candidate nearest neighbors; calculating the prediction accuracy of the triggering cause corresponding to each of the number of candidate nearest neighbors based on the number of preset standard sample waveforms and the actual triggering causes of each of the preset standard sample waveforms; and selecting the number of candidate nearest neighbors whose prediction accuracy of the triggering cause exceeds a preset threshold as the target number of nearest neighbors.

[0111] Optionally, the processor may also execute program code for the following steps: Based on a preset set of multiple standard sample waveforms and their respective actual triggering causes, calculate the triggering cause prediction accuracy corresponding to the target candidate nearest neighbor number, wherein the target candidate nearest neighbor number is any one of the multiple candidate nearest neighbor numbers, including: dividing the multiple standard sample waveforms into a preset number of waveform subsets; determining a test waveform subset and a training waveform subset based on the multiple waveform subsets; calculating the similarity distance between the multiple standard sample waveforms in the test waveform subset and the standard sample waveforms in the training waveform subset; selecting a number of standard sample waveforms matching the target candidate nearest neighbor number from the multiple similarity distances corresponding to the multiple standard sample waveforms in the test waveform subset, as the sample nearest neighbor waveforms corresponding to the multiple standard sample waveforms in the test waveform subset; determining the predicted triggering cause corresponding to each of the multiple standard sample waveforms in the test waveform subset based on the triggering cause corresponding to the sample nearest neighbor waveforms corresponding to the multiple standard sample waveforms in the test waveform subset; and determining the triggering cause prediction accuracy corresponding to the target candidate nearest neighbor number based on the predicted triggering cause corresponding to each of the multiple standard sample waveforms in the test waveform subset and the actual triggering cause corresponding to each of the multiple standard sample waveforms in the test waveform subset.

[0112] Optionally, the processor may also execute program code for the following steps: extracting current waveforms based on the original transient waveform data, including: parsing the time series data of the three-phase current from the original transient waveform data; and adding multiple preset sampling points one by one based on the time series data of the three-phase current to determine the current waveform.

[0113] Optionally, the processor may also execute program code for the following steps: determining the triggering cause of the current distribution network short-time grounding event based on the triggering causes corresponding to each of the multiple target neighbor waveforms, including: determining the decision weights corresponding to each of the multiple target neighbor waveforms based on the similarity distance values ​​corresponding to each of the multiple target neighbor waveforms; determining multiple candidate triggering causes based on the actual triggering causes corresponding to each of the multiple target neighbor waveforms; determining the total decision weight corresponding to each of the multiple candidate triggering causes based on the decision weights corresponding to each of the multiple target neighbor waveforms; determining the confidence scores corresponding to the multiple candidate triggering causes based on the total decision weights corresponding to each of the multiple candidate triggering causes; and selecting the candidate triggering cause whose confidence score meets the preset conditions as the triggering cause corresponding to the current distribution network short-time grounding event.

[0114] Optionally, the processor may also execute program code that performs the following steps: determining the confidence score corresponding to multiple candidate triggering causes based on the total decision weights corresponding to each of the multiple candidate triggering causes, including: determining the confidence score corresponding to multiple candidate triggering causes based on the total decision weights corresponding to each of the multiple candidate triggering causes according to a preset formula, wherein the preset formula is as follows: in, Candidate trigger reasons The corresponding confidence score, Candidate trigger reasons The corresponding total decision weight.

[0115] This invention provides a method for identifying the cause of a short-term grounding event in a distribution network based on adaptive weighted K-nearest neighbors. The method determines the number of target nearest neighbors based on multiple preset standard sample waveforms and their respective actual triggering causes. The standard sample waveforms are waveforms generated by short-term grounding signals in the distribution network. The method involves: acquiring raw transient waveform data corresponding to the current short-term grounding event; extracting the current waveform based on the raw transient waveform data; calculating the similarity distance between the current waveform and the multiple standard sample waveforms; selecting multiple target nearest neighbor waveforms that match the number of target nearest neighbors based on the similarity distances; and determining the triggering cause of the current short-term grounding event based on the triggering causes of the target nearest neighbor waveforms. This achieves the goal of determining the nearest neighbor waveform and thus the triggering cause based on the number of nearest neighbors, thereby improving the accuracy of triggering cause identification and solving the problem that current short-term grounding cause identification largely relies on human experience, resulting in low accuracy.

[0116] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a non-volatile storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0117] Embodiments of the present invention also provide a non-volatile storage medium. Optionally, in this embodiment, the aforementioned non-volatile storage medium can be used to store the program code executed by the adaptive weighted K-nearest neighbor-based distribution network short-time grounding cause identification method provided in the above embodiments.

[0118] Optionally, in this embodiment, the non-volatile storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.

[0119] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: determining the number of target nearest neighbors based on a preset set of multiple standard sample waveforms and their respective actual triggering causes, wherein the multiple standard sample waveforms are waveforms generated by short-time grounding signals in the distribution network; acquiring the original transient waveform data corresponding to the current short-time grounding event in the distribution network; extracting the current waveform based on the original transient waveform data; calculating the similarity distance between the current waveform and the multiple standard sample waveforms respectively, obtaining the similarity distance corresponding to each of the multiple standard sample waveforms; filtering out multiple target nearest neighbor waveforms that match the number of target nearest neighbors based on the similarity distances corresponding to each of the multiple standard sample waveforms; and determining the triggering cause corresponding to the current short-time grounding event in the distribution network based on the triggering causes corresponding to each of the multiple target nearest neighbor waveforms.

[0120] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: determining the target nearest neighbor number based on a preset set of multiple standard sample waveforms and their respective actual triggering causes, including: acquiring multiple candidate nearest neighbor numbers; calculating the triggering cause prediction accuracy corresponding to each of the multiple candidate nearest neighbor numbers based on the preset set of multiple standard sample waveforms and their respective actual triggering causes; and selecting the candidate nearest neighbor number whose triggering cause prediction accuracy exceeds a preset threshold as the target nearest neighbor number.

[0121] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: calculating the prediction accuracy of the triggering cause corresponding to the number of target candidate nearest neighbors based on a preset number of standard sample waveforms and the actual triggering causes of each of the multiple standard sample waveforms, wherein the number of target candidate nearest neighbors is any one of the multiple candidate nearest neighbor numbers, including: dividing the multiple standard sample waveforms into a preset number of waveform subsets; determining a test waveform subset and a training waveform subset based on the multiple waveform subsets; calculating the similarity distance between the multiple standard sample waveforms in the test waveform subset and the standard sample waveforms in the training waveform subset; and based on the test waveform subset... From the multiple similarity distances corresponding to the multiple standard sample waveforms in the test waveform subset, a number of standard sample waveforms matching the number of target candidate nearest neighbors are selected as the sample nearest neighbor waveforms corresponding to the multiple standard sample waveforms in the test waveform subset. Based on the triggering reasons corresponding to the sample nearest neighbor waveforms corresponding to the multiple standard sample waveforms in the test waveform subset, the predicted triggering reasons corresponding to the multiple standard sample waveforms in the test waveform subset are determined. Based on the predicted triggering reasons and the actual triggering reasons corresponding to the multiple standard sample waveforms in the test waveform subset, the prediction accuracy of the triggering reasons corresponding to the number of target candidate nearest neighbors is determined.

[0122] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: extracting current waveforms based on the original transient waveform data, including: parsing the time series data of the three-phase current from the original transient waveform data; and adding multiple preset sampling points one by one based on the time series data of the three-phase current to determine the current waveform.

[0123] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: determining the triggering cause corresponding to the current distribution network short-time grounding event based on the triggering causes corresponding to each of the multiple target nearest neighbor waveforms, including: determining the decision weight corresponding to each of the multiple target nearest neighbor waveforms based on the similarity distance value corresponding to each of the multiple target nearest neighbor waveforms; determining multiple candidate triggering causes based on the actual triggering causes corresponding to each of the multiple target nearest neighbor waveforms; determining the total decision weight corresponding to each of the multiple candidate triggering causes based on the decision weight corresponding to each of the multiple target nearest neighbor waveforms; determining the confidence score corresponding to each of the multiple candidate triggering causes based on the total decision weight corresponding to each of the multiple candidate triggering causes; and selecting the candidate triggering cause whose confidence score meets the preset condition as the triggering cause corresponding to the current distribution network short-time grounding event.

[0124] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: determining the confidence score corresponding to multiple candidate triggering causes based on the total decision weights corresponding to each of the multiple candidate triggering causes, including: determining the confidence score corresponding to multiple candidate triggering causes based on the total decision weights corresponding to each of the multiple candidate triggering causes according to a preset formula, wherein the preset formula is as follows: in, Candidate trigger reasons The corresponding confidence score, Candidate trigger reasons The corresponding total decision weight.

[0125] Embodiments of the present invention also provide a computer program product, including a computer program. Optionally, in this embodiment, when the computer program is executed by a processor, it can perform the following: determining the number of target nearest neighbors based on a preset set of multiple standard sample waveforms and the actual triggering causes of each of the multiple standard sample waveforms, wherein the multiple standard sample waveforms are waveforms generated by short-time grounding signals in the distribution network; collecting the original transient waveform data corresponding to the current short-time grounding event in the distribution network; extracting the current waveform based on the original transient waveform data; calculating the similarity distance between the current waveform and the multiple standard sample waveforms respectively, obtaining the similarity distance corresponding to each of the multiple standard sample waveforms; filtering out multiple target nearest neighbor waveforms that match the number of target nearest neighbors based on the similarity distances corresponding to each of the multiple standard sample waveforms; and determining the triggering cause corresponding to the current short-time grounding event in the distribution network based on the triggering causes corresponding to each of the multiple target nearest neighbor waveforms.

[0126] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0127] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0128] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.

[0129] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0130] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0131] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a non-volatile storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0132] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A method for identifying the cause of short-time grounding in a distribution network based on adaptive weighted K-nearest neighbors, characterized in that, include: Based on multiple preset standard sample waveforms and their respective actual triggering causes, the number of target neighbors is determined, wherein the multiple standard sample waveforms are waveforms generated by short-time grounding signals in the distribution network; Collect raw transient waveform data corresponding to the current short-time grounding event in the power distribution network; Based on the original transient waveform data, the current waveform is extracted; Calculate the similarity distance between the current waveform and the plurality of standard sample waveforms to obtain the similarity distance corresponding to each of the plurality of standard sample waveforms; Based on the similarity distances corresponding to the multiple standard sample waveforms, multiple target nearest neighbor waveforms that match the number of target nearest neighbors are selected. Based on the triggering causes corresponding to the multiple target neighbor waveforms, the triggering cause corresponding to the current short-time grounding event in the distribution network is determined; The determination of the target nearest neighbor number based on a plurality of preset standard sample waveforms and the actual triggering causes of each of the plurality of standard sample waveforms includes: Obtain the number of multiple candidate nearest neighbors; Based on multiple preset standard sample waveforms and their respective actual triggering causes, the prediction accuracy of the triggering cause corresponding to the number of candidate nearest neighbors is calculated. The number of candidate neighbors whose trigger cause prediction accuracy exceeds a preset threshold is selected as the target number of neighbors; Based on multiple preset standard sample waveforms and their respective actual triggering causes, the prediction accuracy of the triggering cause corresponding to the number of target candidate nearest neighbors is calculated, wherein the number of target candidate nearest neighbors is any one of the multiple candidate nearest neighbor numbers, including: The multiple standard sample waveforms are divided into a preset number of waveform subsets; Based on the multiple waveform subsets, the test waveform subset and the training waveform subset are determined; Calculate the similarity distance between multiple standard sample waveforms in the test waveform subset and the standard sample waveforms in the training waveform subset; Based on the multiple similarity distances corresponding to the multiple standard sample waveforms in the test waveform subset, a number of standard sample waveforms matching the number of target candidate nearest neighbors are selected as the sample nearest neighbor waveforms corresponding to the multiple standard sample waveforms in the test waveform subset. Based on the triggering reasons corresponding to the sample nearest neighbor waveforms of each of the multiple standard sample waveforms in the test waveform subset, the predicted triggering reasons corresponding to each of the multiple standard sample waveforms in the test waveform subset are determined. Based on the predicted triggering causes corresponding to each of the multiple standard sample waveforms in the test waveform subset and the actual triggering causes corresponding to each of the multiple standard sample waveforms in the test waveform subset, the prediction accuracy of the triggering cause corresponding to the number of target candidate nearest neighbors is determined.

2. The method according to claim 1, characterized in that, The extraction of the current waveform based on the original transient waveform data includes: The time series data of the three-phase current were extracted from the original transient waveform data; Based on the time series data of the three-phase current, multiple preset sampling points are added point by point to determine the current waveform.

3. The method according to claim 1, characterized in that, The determination of the triggering cause corresponding to the current short-time grounding event in the distribution network based on the triggering causes corresponding to the multiple target nearest neighbor waveforms includes: Based on the similarity distance values ​​corresponding to the multiple target nearest neighbor waveforms, the decision weights corresponding to the multiple target nearest neighbor waveforms are determined. Based on the actual triggering reasons corresponding to the multiple target nearest neighbor waveforms, multiple candidate triggering reasons are determined; Based on the decision weights corresponding to the multiple target nearest neighbor waveforms, the total decision weights corresponding to the multiple candidate triggering causes are determined. Based on the total decision weight corresponding to each of the multiple candidate triggering reasons, the confidence score corresponding to each of the multiple candidate triggering reasons is determined; Candidate triggering causes whose confidence scores meet preset conditions are selected as the triggering causes corresponding to the current short-term grounding event in the distribution network.

4. The method according to claim 3, characterized in that, The step of determining the confidence score corresponding to each of the multiple candidate triggering reasons based on the total decision weights corresponding to each of the multiple candidate triggering reasons includes: Based on a preset formula and the total decision weight corresponding to each of the multiple candidate triggering reasons, a confidence score is determined for each of the multiple candidate triggering reasons. The preset formula is as follows: ; in, Candidate trigger reasons The corresponding confidence score, Candidate trigger reasons The corresponding total decision weight.

5. A distribution network short-time grounding cause identification device based on adaptive weighted K-nearest neighbor, characterized in that, include: The first determining module is used to determine the number of target neighbors based on a preset set of multiple standard sample waveforms and the actual triggering causes of each of the multiple standard sample waveforms, wherein the multiple standard sample waveforms are waveforms generated by short-time grounding signals in the distribution network; The acquisition module is used to acquire the raw transient waveform data corresponding to the current short-time grounding event in the power distribution network. The extraction module is used to extract the current waveform based on the original transient waveform recording data; The calculation module is used to calculate the similarity distance between the current waveform and the plurality of standard sample waveforms, and to obtain the similarity distance corresponding to each of the plurality of standard sample waveforms. The filtering module is used to filter out multiple target nearest neighbor waveforms that match the number of target nearest neighbors based on the similarity distances corresponding to the multiple standard sample waveforms. The second determining module is used to determine the triggering cause corresponding to the current short-time grounding event of the distribution network based on the triggering causes corresponding to the multiple target neighbor waveforms. The first determining module is further configured to acquire multiple candidate neighbor numbers; calculate the trigger cause prediction accuracy corresponding to each of the multiple candidate neighbor numbers based on multiple preset standard sample waveforms and the actual triggering causes of the multiple standard sample waveforms; and select the number of candidate neighbors whose trigger cause prediction accuracy exceeds a preset threshold as the target neighbor number. The aforementioned device is further configured to calculate the prediction accuracy of the triggering cause corresponding to the number of target candidate nearest neighbors based on a preset number of standard sample waveforms and the actual triggering causes of each of the preset number of standard sample waveforms, wherein the number of target candidate nearest neighbors is any one of the multiple candidate nearest neighbor numbers, including: dividing the multiple standard sample waveforms into a preset number of waveform subsets; determining a test waveform subset and a training waveform subset based on the multiple waveform subsets; calculating the similarity distance between the multiple standard sample waveforms in the test waveform subset and the standard sample waveforms in the training waveform subset, respectively; and calculating the similarity distance between the multiple standard sample waveforms in the test waveform subset and the actual triggering causes of each of the multiple standard sample waveforms, respectively. A number of standard sample waveforms matching the number of target candidate nearest neighbors are selected from multiple similarity distances and used as the sample nearest neighbor waveforms corresponding to each of the multiple standard sample waveforms in the test waveform subset. Based on the triggering reasons corresponding to the sample nearest neighbor waveforms corresponding to each of the multiple standard sample waveforms in the test waveform subset, the predicted triggering reasons corresponding to each of the multiple standard sample waveforms in the test waveform subset are determined. Based on the predicted triggering reasons corresponding to each of the multiple standard sample waveforms in the test waveform subset and the actual triggering reasons corresponding to each of the multiple standard sample waveforms in the test waveform subset, the prediction accuracy of the triggering reasons corresponding to the number of target candidate nearest neighbors is determined.

6. A non-volatile storage medium, characterized in that, The non-volatile storage medium includes a stored program, wherein, when the program is executed, it controls the device containing the non-volatile storage medium to execute the short-time grounding cause identification method for distribution networks based on adaptive weighted K-nearest neighbors as described in any one of claims 1 to 4.

7. A computer device, characterized in that, include: Memory and processor The memory stores computer programs; The processor is configured to execute a computer program stored in the memory, wherein when the computer program is executed, the processor performs the method for identifying the cause of short-term grounding in a distribution network based on adaptive weighted K-nearest neighbors as described in any one of claims 1 to 4.

8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the method for identifying the cause of short-term grounding in a distribution network based on adaptive weighted K-nearest neighbors as described in any one of claims 1 to 4.