A power distribution terminal protocol mapping error rapid positioning method

CN123020693APending Publication Date: 2026-10-30WUHAN HUAYUAN ELECTRICAL EQUIP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611495830.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-24
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0004]然而配电终端通信易受网络传输时延的影响,测点时序普遍存在非规律性时间偏移,该逐点时序比对法易出现正常时序被误判为异常的问题,最终导致粗粒度定位准确率大幅下降,难以满足现场高效排查的应用要求

Benefits of technology

(1)、通过采用基于滑动窗口改进的动态时间规整算法实现链路级差错粗粒度定位,可有效适配配电终端公网传输场景下的时延抖动与时钟偏移问题,能够通过源端、映射前、映射后、目标四节点特征序列的两两比对,准确判定差错所属的映射前环节、映射执行环节或映射后环节,快速缩小故障排查范围,避免对全量报文进行逐条字段校验,大幅提升差错定位效率,缩短运维排查周期,有效保障配电规约映射链路的稳定运行。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123020693A_ABST
    Figure CN123020693A_ABST
Patent Text Reader

Abstract

The application discloses a power distribution terminal protocol mapping error quick positioning method and relates to the technical field of power distribution terminal detection. The method comprises the following steps: collecting source end entry messages, pre-mapping messages, post-mapping messages and target exit messages in the protocol mapping process; performing time alignment on the four groups of messages and constructing four-tuples; constructing an original message data set based on the four-tuples; extracting time scale measuring point data elements from the original message data set; comparing the data elements in the time scale measuring point data elements two by two to determine whether the error is located in a pre-mapping link, a post-mapping link or a mapping execution link, and obtaining a coarse-grained positioning result; when the coarse-grained positioning result is located in the mapping execution link, performing piece-by-piece matching and checking on the pre-mapping data elements and the post-mapping data elements in the time scale measuring point data elements to obtain a fine-grained positioning result; and summarizing and analyzing the coarse-grained positioning result and the fine-grained positioning result to obtain a protocol mapping error positioning result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power distribution terminal detection technology, specifically a method for rapid location of protocol mapping errors in power distribution terminals. Background Technology

[0002] With the large-scale construction of the distribution Internet of Things (IoT), the number of distribution terminals connected continues to grow, and multiple communication protocols coexist. The mapping and conversion between heterogeneous protocols has become a core aspect of distribution data interaction. During the protocol mapping process, mapping errors such as mismatched measurement points and numerical distortions can easily occur. If these errors cannot be quickly located, it will lead to distorted distribution monitoring data and abnormal execution of remote control and signaling commands, severely impacting the normal operation of distribution network dispatching, status monitoring, and other services. Therefore, rapid error location in the distribution terminal protocol mapping link has become a necessary technical means to ensure the stable operation of the distribution communication system.

[0003] Currently, the common method for locating protocol mapping errors is point-by-point timing comparison. This method first synchronously collects message and timing data at four nodes: the source entry point, before mapping, after mapping, and the target exit point of the protocol mapping. After completing time alignment and measurement point parsing, a fixed time window is divided, and the timing data of the measurement points at each node are compared point by point within the fixed time window. Based on the comparison results, it is determined whether the anomaly occurred before mapping, during mapping execution, or after mapping.

[0004] However, the communication of power distribution terminals is susceptible to network transmission delays, and the timing of measurement points generally exhibits irregular time offsets. This point-by-point timing comparison method is prone to misjudging normal timing as abnormal, ultimately leading to a significant decrease in the accuracy of coarse-grained positioning, making it difficult to meet the application requirements of efficient on-site troubleshooting. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this invention provides a method for rapid location of distribution terminal protocol mapping errors, thereby resolving the problems existing in the background technology.

[0006] To achieve the above objectives, the present invention provides a method for rapid location of distribution terminal protocol mapping errors, comprising the following steps: Step S1: During the protocol mapping process, collect source ingress packets, pre-mapping packets, post-mapping packets, and target egress packets; perform time alignment on the source ingress packets, pre-mapping packets, post-mapping packets, and target egress packets, and construct quadruples; construct the original packet dataset based on the quadruples; Step S2: Perform reduction parsing on the original message dataset to extract time-stamped measurement point data elements; the time-stamped measurement point data elements include source data elements, pre-mapping data elements, post-mapping data elements, and target data elements; Step S3: The improved dynamic time warping algorithm with strip window constraint is used to compare the data elements in the time-stamped measurement point data element pairwise to determine whether the error is located in the pre-mapping stage, post-mapping stage, or mapping execution stage, so as to obtain the coarse-grained positioning result. Step S4: When the coarse-grained positioning result is in the mapping execution stage, the data elements before and after mapping are matched and verified one by one to obtain the fine-grained positioning result; the coarse-grained positioning result and the fine-grained positioning result are summarized and analyzed to obtain the reduction mapping error positioning result. By constructing a complete error localization process that includes data acquisition and alignment, measurement point analysis and preprocessing, link-level coarse localization, and field-level fine localization, and by adopting an improved dynamic time warping algorithm with strip window constraints to replace the traditional point-by-point comparison, it can effectively adapt to time series offset scenarios and reduce the false judgment rate. Through coarse localization, the investigation scope is quickly narrowed down, and fine localization accurately locks the abnormal fields, balancing localization efficiency and accuracy. It can accurately determine the link to which the error belongs and output details, significantly improving the operation and maintenance troubleshooting efficiency of specification mapping faults.

[0007] Preferably, during the protocol mapping process, source ingress packets, pre-mapping packets, post-mapping packets, and target egress packets are collected; the source ingress packets, pre-mapping packets, post-mapping packets, and target egress packets are time-aligned, and a four-tuple is constructed including: Data capture probes are deployed at the input, pre-mapping buffer, post-mapping buffer, and output of the protocol conversion device in the power distribution terminal, and the source entry message, pre-mapping message, post-mapping message, and target exit message are collected synchronously through protocol proxy. And add a hardware timestamp to each collected message; For the four types of messages collected, based on the preset matching time window, the source ingress messages, pre-mapping messages, post-mapping messages and target egress messages that flow through the same protocol conversion link are grouped according to their sequential correspondence to form an initial quadruple; Using the time stamp of a unified clock source as a reference, the hardware timestamps of each message in the initial quadruple are normalized to eliminate the clock offset of each acquisition node and obtain the time-aligned quadruple. By defining the specific method of message acquisition and time alignment, and eliminating multi-node clock deviations through hardware timestamps and clock normalization, the timing accuracy of the four sets of messages is ensured, providing a reliable timing reference for subsequent comparison calculations.

[0008] Preferably, the original message dataset constructed based on quadruples includes: The format of the four messages in each time-aligned quadruple is standardized to convert messages of different protocol types into a unified internal data structure. Perform integrity checks on the unified messages and remove invalid records; For quadruples that pass the integrity check, mark the missing fields. If the missing field is a non-critical field, fill it with the default value; if the missing field is a critical field, discard the quadruple and log it. Redundant records with adjacent timestamps but identical message content are deduplicated, retaining only the first record; The quadruplets, after integrity verification, missing data handling, and deduplication, are arranged in chronological order and stored as a structured file to form the original message dataset. By limiting the construction process of the original message dataset, and by performing integrity checks, missing data handling, and redundancy removal to eliminate dirty data, the quality of the dataset is effectively improved, and invalid data is prevented from interfering with the accuracy of subsequent error location.

[0009] Preferably, the original message dataset is reduced and parsed to extract time-stamped measurement point data elements, including: Iterate through each quadruple in the original message dataset and read the original data items of each message in turn; The extracted raw data items are validated for legality, and invalid data items with abnormal quality indicators or values ​​exceeding the preset reasonable range are removed. For the time series sampling gaps caused by the removal of invalid data items, linear interpolation is used to generate corresponding complete data items at the corresponding time, so as to maintain the continuity and integrity of the time series of each measurement point on a unified time axis. For the original data items that pass the legality verification, their original time scales are uniformly converted into a unified time format based on Coordinated Universal Time, and dimensional conversion and normalization are performed for each measurement point to obtain standardized data items. The standardized data items corresponding to the four messages in the same quadruple are classified and aggregated according to the link node to which they belong, and the source data element, the data element before mapping, the data element after mapping, and the target data element are generated accordingly. Time-stamped measurement point data elements are constructed based on the four sets of data sources. Each time-scaled measurement point data element is a multi-dimensional time-scaled sequence containing all telemetry and teleindication measurement points; By defining the extraction method of time-stamped measurement point data elements, and by unifying data standards through legality verification, interpolation completion, and normalization, the continuity of time sequence is ensured, providing standardized multidimensional input for subsequent similarity calculation.

[0010] Preferably, reading the raw data items of each message includes: Identify the protocol type of each message and load the corresponding protocol parsing template based on the identified protocol type; Based on the protocol parsing template, the message is parsed field by field to extract the original data items; By limiting the reading method of the original data items and matching the corresponding parsing template by identifying the protocol type, the method can be adapted to a variety of heterogeneous communication protocols, thereby improving its versatility for different power distribution terminal scenarios.

[0011] Preferably, an improved dynamic time warping algorithm with strip window constraints is used to perform pairwise comparisons of the data elements in the time-stamped measurement point data elements to determine whether the error is located in the pre-mapping stage, post-mapping stage, or mapping execution stage, resulting in coarse-grained localization results including: Kernel principal component analysis was performed on the source data element, the data element before mapping, the data element after mapping, and the target data element in the time-stamped measurement point data element to reduce the dimensionality and obtain the multi-principal component fusion feature sequence corresponding to each data element; Using the multi-principal component fusion feature sequence corresponding to the source data element as the reference sequence and the multi-principal component fusion feature sequence corresponding to the data element before mapping as the target sequence, the dynamic time warping distance between the two is calculated using the improved dynamic time warping algorithm with strip window constraint, and is denoted as the first distance. Using the multi-principal component fusion feature sequence corresponding to the data element before mapping as the reference sequence and the multi-principal component fusion feature sequence corresponding to the data element after mapping as the target sequence, the dynamic time warping distance between the two is calculated using the improved dynamic time warping algorithm with strip window constraint, and is denoted as the second distance. Using the multi-principal component fusion feature sequence corresponding to the mapped data element as the reference sequence and the multi-principal component fusion feature sequence corresponding to the target data element as the target sequence, the dynamic time warping distance between the two is calculated using the improved dynamic time warping algorithm with strip window constraint, and is denoted as the third distance. The first distance, the second distance, and the third distance are compared with preset first thresholds, second thresholds, and third thresholds, respectively. If the first distance is greater than the first threshold, the error is determined to be located in the pre-mapping stage. At this time, the second distance is calibrated and corrected, and the ratio of the second distance to the first distance is calculated as the corrected distance. If the corrected distance is greater than the second threshold, the error is determined to be located in the mapping execution stage. If the corrected distance does not exceed the limit, it is determined that the increase in the second distance value is caused by the upstream timing offset, and there is no error in the mapping execution stage. If the third distance is greater than the third threshold, the error is determined to be located in the post-mapping stage. If all distances do not exceed the corresponding threshold, there is no error. One or more error stages can be located simultaneously. The results of comprehensive error assessment yield coarse-grained localization results; By defining the specific logic of coarse-grained localization, and after dimensionality reduction by kernel principal components, pairwise comparisons and threshold determinations of the three sequences can be performed to independently locate one or more error links, thus clarifying the complete rules for link-level error determination.

[0012] Preferably, the dimensionality reduction of the kernel principal component analysis includes: A unified projection vector set for kernel principal component analysis is obtained by pre-training based on historical time-scaled measurement point data under normal operating conditions; The time-scaled measurement point sequence of each data element is standardized so that the mean of each dimension is 0 and the standard deviation is 1. The Gaussian radial basis kernel function is selected as the kernel function. The standardized time-scaled measurement point sequence is projected onto the k-dimensional feature space through the unified projection vector set to obtain the corresponding multi-principal component fusion feature sequence. By limiting the implementation method of dimensionality reduction using kernel principal component analysis, a unified set of projection vectors and Gaussian radial basis kernel function are adopted to ensure that data from different nodes are comparable after dimensionality reduction, while preserving nonlinear characteristics and balancing efficiency and sensitivity.

[0013] Preferably, the improved dynamic time warping algorithm for the strip window constraint includes: Set the width parameter W of the strip window to represent the maximum allowed time offset; Construct cost matrices for the baseline sequence and the target sequence, where the element in the i-th row and j-th column of the cost matrix is ​​the square of the Euclidean distance between the i-th point of the baseline sequence and the j-th point of the target sequence; When calculating the cumulative cost matrix, only the elements that satisfy the constraint |ji|≤W are calculated, and the cumulative cost corresponding to the elements that do not satisfy the constraint is set to infinity, where i is the index of the baseline sequence and j is the index of the target sequence. The cumulative cost matrix is ​​recursively calculated as follows: the cumulative cost at the current position is equal to the cost at the current position plus the minimum cumulative cost among the three adjacent positions above, to the left, and to the upper left. The dynamic time warp distance is taken as the value of the last element of the cumulative cost matrix; By limiting the core logic of the dynamic time warping algorithm with a strip window constraint, the path search range is restricted by the strip constraint, which reduces the computational complexity and avoids over-matching caused by unrestricted time distortion, thereby improving computational efficiency and judgment accuracy.

[0014] Preferably, when the coarse-grained positioning result is in the mapping execution stage, the data elements before and after mapping are matched and verified one by one to obtain the fine-grained positioning result, including: Extract the time window to which the error belongs from the coarse-grained positioning results, and extract the data element fragments before and after mapping corresponding to the time window in the time-stamped measurement point data elements. Based on the established message correspondence and unified time axis alignment rules of the quadruples, the standardized data items in the data element fragments before mapping and after mapping are matched one by one, using the measurement point identifier and sampling time as indexes, to form matching pairs. Retrieve the pre-stored standard specification baseline mapping table, perform mapping relationship consistency verification on each matching pair, and determine whether the matching pairs with mismatched identifiers are correctable structural mismatches; after correctable temporary redirection mapping, the measurement point is identified and then the numerical values ​​are verified; those that are not correctable are directly marked as erroneous matching pairs. For all matching pairs that conform to the mapping relationship, calculate the numerical deviation between the data items before and after mapping in each matching pair; The numerical deviation is compared with a preset deviation tolerance threshold. If the numerical deviation exceeds the deviation tolerance threshold, it is determined that there is a persistent error in the mapping execution process; otherwise, it is an occasional error. The error matching pairs are arranged in chronological order to generate an error time distribution sequence; By combining the numerical deviation, error time distribution sequence, error ratio, and mismatch type of the error matching pair, a fine-grained localization result is generated. The fine-grained localization result includes at least the error type, the time period of error occurrence, and the severity of error. The error type includes structural mismatch, numerical distortion, and a combination of both, and distinguishes between persistent errors and occasional errors. By defining specific methods for fine-grained localization, and verifying each abnormal window individually to reduce computational load, while distinguishing between persistent and sporadic errors, more detailed decision-making basis is provided for operation and maintenance troubleshooting.

[0015] Preferably, the coarse-grained and fine-grained localization results are summarized and analyzed to obtain the reduction mapping error localization results, including: When the coarse-grained localization result contains only a single error link, if it is determined that the error is located in the link before or after mapping, the coarse-grained localization result of the corresponding link is output, along with the abnormal time window, the corresponding distance value, and the abnormality level as a confidence reference. If the error is determined to be located in the mapping execution stage, the error type, error time distribution sequence and error ratio in the fine-grained positioning result will be output as the final positioning conclusion. The position index of the specific error matching pair in the data elements before and after mapping will be marked. At the same time, the list of mismatched measurement points, mismatch correction status, numerical deviation value after correction and composite fault identifier will be output. When the coarse-grained localization result contains two or more error links, the localization results of each error link are output sequentially according to the link flow order of the pre-mapping link, the mapping execution link, and the post-mapping link; wherein the pre-mapping and post-mapping links output corresponding coarse-grained details, the mapping execution link outputs corresponding fine-grained details, and each link error is marked as an independent judgment result, which can be investigated separately; The positioning results of all time-scaled measurement point data elements are summarized, and the error frequency and severity distribution of each link are statistically analyzed to generate a reduction mapping error positioning report. The reduction mapping error positioning report includes at least the error link, error type, error period, list of affected measurement points, and confidence assessment, wherein the confidence assessment is determined based on the values ​​of the first distance, the second distance, or the third distance. By defining the rules for outputting and summarizing location results, differentiated outputs are used for single or multiple error stages. Combined with confidence assessment, structured reports are generated, making it easier for maintenance personnel to quickly identify troubleshooting priorities.

[0016] This invention provides a method for rapid localization of distribution terminal protocol mapping errors, which involves machine learning technology and has the following beneficial effects: (1) By adopting a dynamic time warping algorithm based on a sliding window to achieve coarse-grained location of link-level errors, it can effectively adapt to the time delay jitter and clock offset problems in the public network transmission scenario of power distribution terminals. It can accurately determine the link to which the error belongs, whether it is the pre-mapping link, the mapping execution link, or the post-mapping link, by comparing the feature sequences of the four nodes of the source, before mapping, after mapping, and target. This can quickly narrow down the scope of fault investigation, avoid checking each field of the full message, greatly improve the efficiency of error location, shorten the operation and maintenance investigation cycle, and effectively ensure the stable operation of the power distribution protocol mapping link.

[0017] (2) By introducing a strip window constraint into the dynamic time warping algorithm, the efficiency and accuracy of similarity calculation can be balanced. On the one hand, the strip window restricts the search range of the optimal warping path to the strip area on both sides of the diagonal, avoiding the high computational overhead caused by full matrix traversal, reducing the computing power requirement, and better adapting to the business constraints of limited computing power and low latency in the online real-time detection scenario of the reduction conversion device; on the other hand, by limiting the maximum allowable time offset, the over-matching problem caused by unlimited time distortion can be avoided, which fits the actual fluctuation range of the timing deviation of the power distribution terminal, effectively reducing misjudgment and missed judgment, and improving the reliability of error location results.

[0018] (3) By using kernel principal component analysis to reduce dimensionality before dynamic time warping calculation, the multi-dimensional time-scaled measurement point sequence is projected onto the k-dimensional feature space to obtain the multi-principal component fusion feature sequence. This solves the problem that multi-measurement point data cannot be directly compared for sequence similarity. At the same time, it eliminates the differences in dimensions and amplitudes between different measurement points. While significantly reducing the calculation dimension of the subsequent dynamic time warping algorithm, it fully retains the principal component information that best represents the mapping anomaly. This improves the calculation efficiency and ensures the sensitivity of anomaly detection, adapting to the scenario characteristics of multi-measurement point and multi-dimensional distribution specification data.

[0019] (4) Distinguish the differences in data structure among the three stages, and enable fine-grained matching only for the mapping execution stage with complete verification conditions. This ensures the accuracy of error identification while avoiding unnecessary computational power consumption, fully clarifies the technical boundaries of the solution, and improves the logical completeness.

[0020] (5) By using a temporary redirection and continuation detection mechanism that can correct mismatches, the traditional solution breaks through the limitation of terminating detection upon detecting a mismatch. It outputs three types of fault conclusions at once: structural mismatch, numerical distortion, and a combination of both. This avoids the redundant operation of maintenance personnel manually correcting the mapping table and then initiating a second detection. After testing, the detection rate of combined mismatch and numerical distortion faults increased from 0% in the traditional solution to 98%. Compared with the traditional troubleshooting process of manually checking the mapping table → correcting the configuration → retesting, the efficiency of single fault location is improved by more than 60%. Attached Figure Description

[0021] Figure 1 This is a flowchart of a method for rapid location of protocol mapping errors in power distribution terminals proposed in this invention.

[0022] Figure 2 The hierarchical diagram of time-stamped measurement point data elements is obtained through a method for rapid localization of distribution terminal protocol mapping errors proposed in this invention.

[0023] Figure 3 This invention presents a hierarchical diagram of the protocol mapping error localization results obtained from a method for rapid localization of protocol mapping errors in power distribution terminals. Detailed Implementation

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

[0025] Please see Figure 1 This invention provides a technical solution: a method for rapid location of distribution terminal protocol mapping errors. Specifically, the method for rapid location of distribution terminal protocol mapping errors is provided below; please refer to [link to relevant documentation]. Figure 1 The method includes the following steps: Step S1: During the protocol mapping process, collect source ingress packets, pre-mapping packets, post-mapping packets, and target egress packets; perform time alignment on the source ingress packets, pre-mapping packets, post-mapping packets, and target egress packets, and construct quadruples; construct the original packet dataset based on the quadruples.

[0026] Please see Figure 2This step first requires deploying data capture probes at key nodes of the protocol conversion device in the power distribution terminal. Specifically, probes are set up at the input, pre-mapping buffer, post-mapping buffer, and output of the protocol conversion device. Source ingress packets, pre-mapping packets, post-mapping packets, and target egress packets are collected synchronously via protocol proxy. The pre-mapping buffer is the packet buffer node after protocol parsing is completed and before the mapping logic is executed; the post-mapping buffer is the packet buffer node after the mapping logic is executed and before the target protocol is encapsulated. To ensure the accuracy of subsequent time alignment, a hardware timestamp is appended to each packet upon capture. This hardware timestamp is generated by the local clock of each probe node and records the nanosecond-level time value of the packet arrival time.

[0027] Because the local clocks of different probes may have inherent deviations, and crystal oscillator drift can lead to cumulative errors, it is necessary to perform time alignment and grouping on the four types of collected messages. This is done using a preset matching time window. Based on this, the source ingress packets, pre-mapping packets, post-mapping packets, and target egress packets that flow through the same protocol conversion link are grouped according to their sequential correspondence to form an initial quadruple.

[0028] When grouping, matching identifiers are configured according to the message structure characteristics of the communication protocol: For IEC101 and IEC104 protocols, a triplet consisting of the application layer frame sequence number, station common address, and measurement point address is used as the matching identifier; for fragmented transmission scenarios such as station calls and sudden remote signaling, multiple frames of data from the same measurement point are time-aggregated within the matching time window based on the measurement point address and station common address, and then participate in quadruple pairing after aggregation into a complete measurement point sequence; for the Modbus protocol, the frame sequence number matching field is cancelled, and a combination of slave address, function code, register start address, and register length is used as the matching identifier. Based on the correspondence between request and response, master station request messages and slave station response messages are bound and paired within the matching time window to complete message matching in polling scenarios; for scenarios without a unique corresponding identifier, such as all-station calls and broadcast messages, the matching identifier is determined by the hardware normalized timestamp difference being less than the matching time window. The rules complete batch group matching, achieving accurate one-to-one correspondence of messages within the matching time window, avoiding pairing misalignment in scenarios with concurrent out-of-order messages, fragmented messages, and mixed access of multiple protocols.

[0029] It should be noted that the matching time window The setting is based on statistical analysis of protocol conversion device processing delay and network transmission jitter. Specifically, in a typical power distribution terminal site, 10,000 sets of message flow records under normal operating conditions were continuously collected. The average end-to-end delay from the source ingress message to the target egress message was 120 milliseconds, and the maximum jitter was 80 milliseconds. To ensure that more than 95% of the messages fall within the same window, the matching time window is set to... 200ms, this value can be dynamically adjusted according to the actual measurement results at different sites. This matching time window is a group alignment parameter at the message flow level, used to achieve one-to-one pairing of four messages. It belongs to a different processing level from the time parameter of the subsequent measurement point level time sequence comparison. The difference in magnitude between the two is determined by the difference between message transmission delay and measurement point sampling period.

[0030] Subsequently, using the global unified clock as a reference, the hardware timestamps of each message in the initial four-tuple are normalized to eliminate clock skew at each acquisition node. Let the global unified clock be at time... The timescale is At a certain probe node local time The recorded hardware timestamp is Then the clock offset of the probe node relative to the global unified clock. This can be obtained through periodic synchronization. The synchronization method uses the IEEE 1588PTP protocol with a synchronization period of 1 second. In a laboratory environment, after 1000 synchronization tests, the maximum clock offset deviation did not exceed 0.5 microseconds, meeting the nanosecond-level time alignment requirements. (Normalized timestamp) Calculate using the following formula: ; in, Clock skew, where a positive number indicates the local clock is ahead of the global clock, and a negative number indicates lag. Based on the normalized timestamp. After normalization, the timestamps of the four messages in the initial quadruple are all unified to the same time base, thus obtaining a time-aligned quadruple.

[0031] Next, the original message dataset is constructed based on the time-aligned quadruples. First, the format of the four messages in each quadruple is standardized, that is, messages of different protocol types are converted into a unified internal data structure. This internal data structure contains at least common attributes such as message type, timestamp, length, and payload fields.

[0032] After standardizing the format, each message undergoes integrity verification, and invalid records caused by network packet loss or probe failure are removed, such as messages with zero length or incorrect checksums. According to statistics from the distribution network operation, approximately 0.3% of messages fail verification due to network jitter, and these records are all removed.

[0033] For quadruplets that pass the integrity check, check for any missing fields. If the missing field is a non-critical field, such as the message priority identifier, fill it with the default value. If the missing field is a critical field, such as the measurement point value, timestamp, measurement point address, or frame type identifier, discard the quadruplet and log it, because the absence of critical fields directly affects the accuracy of subsequent location. In classic operating condition tests, the proportion of missing critical fields is usually less than 0.1%, and discarding them does not affect the overall analysis.

[0034] Considering the potential for duplicate messages in real-world communication, such as duplicate captures of the same frame due to link mirroring or duplicate records caused by hardware jitter, it is necessary to deduplicat redundant records with identical content and timestamp differences less than a preset retransmission threshold of 10ms, retaining only the first record. This avoids duplicate data interfering with statistical analysis. The 10ms retransmission threshold is determined based on the time jitter statistics of the acquisition link and the accuracy of the hardware timestamp, effectively filtering out millisecond-level duplicate messages without mistakenly deleting business messages with normal timing. In typical scenarios, duplicate messages account for approximately 2% to 5%, and deduplication effectively reduces data redundancy.

[0035] Finally, the quadruplets, after integrity verification, missing data handling, and deduplication, are arranged in chronological order and stored as a structured file, such as CSV or Parquet format, forming the original message dataset. This original message dataset serves as input for subsequent steps, and its quality directly determines the reliability of reduction mapping error localization. In practical engineering applications, it is also necessary to ensure that probe deployment does not affect the performance of the original communication link, and that the synchronization accuracy of the globally unified clock is better than 1 millisecond to guarantee the effectiveness of time alignment. The above data acquisition and alignment scheme can provide a high-precision time series reference and a reliable data source for subsequent error localization, effectively reducing misjudgments caused by data misalignment and supporting rapid localization of reduction mapping errors. The settings of the above parameters are all based on field measurement data or laboratory test results and can be adaptively adjusted according to specific application scenarios.

[0036] Step S2: Perform reduction parsing on the original message dataset to extract time-stamped measurement point data elements; the time-stamped measurement point data elements include source data elements, pre-mapping data elements, post-mapping data elements, and target data elements.

[0037] This step directly uses the original message dataset output from step S1, which has already undergone message-level missing field processing and redundancy removal. Based on this, further validity checks and standardization are performed on the original data items in each message, ultimately constructing time-stamped measurement point data elements containing information on four link nodes, which serve as input for subsequent steps.

[0038] First, it is necessary to traverse each quadruple in the original message dataset and read the original data items of each message sequentially. The reading operation includes two sub-steps: first, identifying the protocol type of each message; and second, loading the corresponding protocol parsing template based on the identified protocol type. The protocol type can be determined by a fixed identifier field in the message header. For example, the start character of the IEC101 protocol is 0x68, a specific byte in the APCI field of the IEC104 protocol is used for differentiation, and the Modbus protocol is identified by the function code and address field. For each protocol, a parsing template is pre-configured. The parsing template adopts a unified and general layered architecture, and its core includes four attribute fields: frame header identification field, field offset, data type identifier, and unit conversion coefficient. Adding a new distribution protocol type only requires configuring the corresponding template parameters, without reconstructing the parsing logic, and has good scalability. At the same time, the parsing template defines the position, length, data type, and physical meaning of each field in the message. By parsing the message field by field according to the parsing template, the original measurement point values, time scales, quality indicators, and other information can be extracted to form the original data items.

[0039] The extracted raw data items need to undergo legality verification to remove invalid data items with abnormal quality indicators and unreliable values ​​due to acquisition link failures, as well as data items with values ​​exceeding the preset reasonable range. Only data with inherent quality anomalies caused by the acquisition link is removed here; data with quality anomalies caused by the mapping process is not removed. Abnormal quality indicators include situations where flags such as invalid bits, overflow bits, and communication interruption bits are set. Values ​​exceeding the reasonable range refer to situations such as telemetry values ​​exceeding the upper or lower limit of the sensor's range, or illegal coding in the remote signaling status. The preset reasonable range is set based on equipment nameplate parameters and historical operating data statistics. For example, for a voltage measurement point of a certain type of distribution terminal with a rated value of 10 kV and a normal fluctuation range of ±20%, the reasonable range is set to 8 kV to 12 kV. According to statistics from typical distribution network operation scenarios, approximately 5 million raw data items were processed, of which approximately 0.05% were removed due to quality anomalies, and approximately 0.02% were removed due to exceeding limits.

[0040] For short time-series sampling gaps resulting from the removal of invalid data items, linear interpolation is used to generate corresponding complete data items that meet the conditions, in order to maintain the continuity and integrity of the time series of each measurement point on a unified time axis as much as possible. Let the two valid data items before and after the gap be respectively... and ,in and Sampling time, and Given the corresponding measurement point values, the gap time is... Complete the value at the location Calculate using the following formula: ; in, The sampling time for the gap; and These are the most recent valid sampling times before and after the gap; and These represent the measurement point values ​​at the corresponding time points. This formula assumes that the changes in measurement points are approximately linear over a short period, making it suitable for distribution terminal scenarios with short sampling intervals and gradual changes. Since linear interpolation may smooth out actual changes in the event of abrupt changes in measurement points, it is only applicable when the gap width does not exceed two sampling periods. If the gap width exceeds two sampling periods, or if there are no valid data items supporting the gap on either side, interpolation is abandoned, and the measurement point is marked as unusable during that time period and not included in subsequent comparison calculations. The sampling times along a unified time axis are kept complete without rejection to avoid introducing false data. For remote signaling discrete data items, linear interpolation is not performed; if the gap width does not exceed one sampling period, the state value from the previous time point is used; otherwise, it is directly marked as unusable. This limitation is determined based on the rate of change of measurement points at the second-level sampling frequency of the distribution terminal; excessively large gaps will lead to severe distortion of the interpolation results.

[0041] After the original data items pass the validity check and completion, time standardization, dimensional conversion, and normalization are performed to obtain standardized data items. Time standardization converts the original time scales of each message into a unified Coordinated Universal Time (UTC) format. This operation only standardizes the data format of the time scale; the time base uses the globally unified clock calibrated in step S1, without repeating clock offset alignment. Dimensional conversion converts the original code values ​​into physical quantity values, and normalization scales the physical quantity values ​​to a unified numerical range. Telemetry measurements are mapped to the [0,1] interval using the min-max normalization method. Telemetry signals are discrete state values, and state numerical mapping is used to map the three states of separation, combination, and anomaly to 0, 0.5, and 1, respectively, so that their numerical range is consistent with the normalized telemetry measurements. They can directly participate in kernel principal component analysis and dynamic time warping distance calculation without the need for separate comparison logic. The quality marker field undergoes one-hot encoding, converting each type of quality marker, such as invalid bits, overflow bits, and communication interruption bits, into discrete 0-1 features. These features, along with the measured point values, constitute the feature dimensions of the standardized data item. The one-hot encoded quality marker features and the measured point value features are input into a kernel principal component analysis model. The model automatically assigns feature weights based on the variance contribution of each dimension, eliminating the need for manual weight presets. The quality marker features do not participate in numerical normalization; they are only used as state dimensions in subsequent comparisons. After this processing, standardized data items are obtained.

[0042] Next, the standardized data items corresponding to the four messages in the same quadruple are aggregated according to their respective link nodes. Specifically, the source ingress message corresponds to the source data element, the pre-mapping buffer message corresponds to the pre-mapping data element, the post-mapping buffer message corresponds to the post-mapping data element, and the target egress message corresponds to the target data element. The standardized data items of all quadruples are grouped according to the measurement point identifier, and the standardized data items of the same node and the same measurement point are concatenated in ascending time order to form a continuous time series sequence for that measurement point. Time-stamped measurement point data elements are constructed based on these four groups of data sources. Each time-stamped measurement point data element is a multi-dimensional time-stamped sequence containing all telemetry and teleindication measurement points and corresponding quality indicators, with all sampling times arranged in ascending time order. This multi-dimensional time-stamped sequence serves as the standard input for S3 kernel principal component analysis, and after mapping with a unified projection vector set, a multi-principal component fusion feature sequence with consistent dimensions and direct comparability is obtained.

[0043] This completes the construction of the time-stamped measurement point data element, which will serve as the input to the improved dynamic time warping algorithm for the strip window constraint in step S3. In practical engineering applications, it is necessary to maintain compatibility between different protocol parsing templates. When a new protocol type is added, the template library needs to be updated promptly. Linear interpolation is only suitable for short-term gaps; for long-term breakpoints, other strategies should be adopted, such as marking them as missing and notifying maintenance personnel.

[0044] Step S3: The improved dynamic time warping algorithm with strip window constraint is used to compare the data elements in the time-stamped measurement point data elements pairwise to determine whether the error is located in the pre-mapping stage, post-mapping stage, or mapping execution stage, so as to obtain the coarse-grained positioning result.

[0045] Please see Figure 3 This step first performs kernel principal component analysis (KPC) dimensionality reduction on the source data elements, pre-mapping data elements, post-mapping data elements, and target data elements in the time-stamped measurement point data elements. The four sets of data elements are mapped using the same pre-trained unified projection vector set, ensuring completely consistent dimensionality reduction rules and identical output principal component orders. Finally, each multi-dimensional time-stamped measurement point sequence is converted into a k-order multi-principal component fusion feature sequence, where k is the principal component order satisfying a cumulative contribution rate ≥ 85%. This process reduces the computational dimensionality of the subsequent dynamic time warping algorithm, eliminates the influence of differences in the dimensions and amplitudes of different measurement points, and ensures the temporal comparability of the feature sequences of the four nodes. Then, the multi-principal component fusion feature sequences of the source and pre-mapping, pre-mapping and post-mapping, and post-mapping and target nodes are compared sequentially along the link direction, calculating three distances. Finally, the three distances are compared with three preset thresholds, and the error location is determined based on the comparison results.

[0046] The specific process of dimensionality reduction using kernel principal component analysis (KPI) is as follows: Input features include continuous telemetry values ​​and discrete quality indicator coding features. The Gaussian radial basis function (RBF) kernel is compatible with mixed features and can transform discrete state differences into distance metrics in a high-dimensional space through kernel mapping, eliminating the need for additional normalization of discrete features. A unified projection vector set for KPI is pre-trained based on historical time-stamped measurement point data under normal operating conditions. The training set consists of multiple time series data points under different loads and time periods under normal operating conditions, with a total sample size of no less than 5000 sampling times, covering light load, full load, short-term network jitter, and typical daily peak-valley switching scenarios. The time series data of the source, before mapping, after mapping, and target nodes are collected synchronously. Measurement point vectors from all sampling times are used as training samples. The training set contains normal operating time series data for the source, before mapping, after mapping, and target nodes. The unified projection vector set uses the same mapping rule for the data of the four nodes, ensuring the comparability of the multi-principal component fusion feature sequences after dimensionality reduction at different nodes, satisfying the prerequisite for subsequent pairwise comparisons. During training, to meet the input requirements of the kernel principal component analysis algorithm, based on the normalization process in step S2, the time-scaled measurement point sequence of each data element is further standardized with zero mean, so that the mean of each dimension is 0 and the standard deviation is 1, in order to eliminate the influence of differences in the dimensions and amplitudes of different measurement points on the dimensionality reduction results. Let the standardized data matrix be... The number of rows is the number of sampling times. The number of columns is the dimension of the measurement points. Each line Indicates the first Each sampling time A vector of measurement points. The Gaussian radial basis function is chosen as the kernel function, and its expression is: ; in, It is the kernel function value of the two measurement point vectors; and These are the standardized measurement point vectors at the two sampling times; The kernel width parameter is determined by a grid search method based on the average distance between different measurement points in historical data, so as to minimize the condition number of the kernel matrix. It is the square of the Euclidean distance. For all Each sample calculates the kernel function value between each pair of samples, forming a... kernel matrix , its first Line 1 Column elements are For the kernel matrix By performing centralization processing, a centralized kernel matrix is ​​obtained. : ; in, for A matrix of all 1s.

[0047] For the centralized kernel matrix Perform eigenvalue decomposition to obtain eigenvalues. and its corresponding eigenvectors Calculate the contribution rate of each order of eigenvalues, and select the set of eigenvectors corresponding to the first k order eigenvalues ​​with a cumulative contribution rate ≥ 85% as the unified projection vector set.

[0048] According to the well-known principles of multivariate time series dimensionality reduction, the cumulative contribution rate of principal components must be no less than 85% to ensure that the core variation information of the original data is completely preserved after dimensionality reduction. In power distribution scenarios, single-point mismatch and single-point numerical distortion are local weak anomalies with a low variance proportion. Using only a single principal component can easily dilute the anomaly features. Using multi-principal component fusion to represent the time series can effectively retain such weak anomaly features and improve fault detection capabilities. In a comparative test of 1,000 sets of fault time series samples in a city's power distribution network demonstration area, the multi-principal component fusion scheme with a cumulative contribution rate of 85% improved the coarse location detection rate of measurement point mismatch anomalies from 42% to 97% using the single principal component scheme.

[0049] For a new standardized data matrix First, calculate the kernel matrix between the new matrix and the training samples. Then, a centralized kernel matrix is ​​obtained through centralization processing. Finally, the multi-principal component fusion feature sequence of the data element is calculated using the following formula. : ; in, The output is a multi-principal component fusion feature sequence matrix with dimension . , Number of sampling times The order of the selected principal components; The centered kernel matrix of the new data and training samples has dimensions of . , This represents the number of training samples; For the front The projection matrix formed by the eigenvectors of order n has dimensions n. ; For the front A diagonal matrix composed of eigenvalues ​​of order n, with dimension n. , This is its inverse square root matrix, used for eigenvalue normalization. Through the above projection operation, we obtain a matrix with dimension... The multi-principal component fusion feature sequence is constructed, with each row corresponding to a k-dimensional feature vector at a sampling time. Principal components of each order are arranged from highest to lowest contribution rate. This unified projection vector set remains unchanged throughout the fault diagnosis process to ensure the comparability of data from different batches. After dimensionality reduction, each data element corresponds to a multi-principal component fusion feature sequence, which retains the principal component information that differs most from the normal pattern in the original multi-measurement data.

[0050] As an alternative implementation for compromising low computing power, only the eigenvectors corresponding to the first-order largest eigenvalue can be selected to form a one-dimensional projection vector. This is suitable for scenarios with extremely low terminal computing power and relaxed requirements for detection rate. When only the first-order principal component is selected, The above matrix formula Degenerate into a scalar calculation formula for the original single principal component .

[0051] An improved dynamic time warping algorithm with a strip window constraint is used to calculate the similarity between the multi-principal component fusion feature sequences corresponding to two data elements. For any two data elements, let their dimensionality-reduced multi-principal component fusion feature sequences be the baseline sequences. and target sequence ,in and These represent the lengths of the two sequences. The difference in the number of valid data points involved in the computation is caused by missing local data or interpolation failures marked as unavailable.

[0052] For any two data elements corresponding to the k-th order multi-principal component fusion feature sequence, let the k-dimensional feature vector of the i-th sampling point of the benchmark sequence be... The k-dimensional feature vector of the j-th sampling point of the target sequence is Then the element at position (i,j) of the cost matrix is ​​the squared Euclidean distance between the two k-dimensional vectors: ; in, It is the element in the i-th row and j-th column of the cost matrix, representing the degree of local difference between the i-th point of the baseline sequence and the j-th point of the target sequence; It is the feature vector of the i-th sampling point of the benchmark multi-principal component fusion feature sequence. ; It is the feature vector of the j-th sampling point of the target multi-principal component fusion feature sequence. This calculation method is a multidimensional extension of the one-dimensional sequence Euclidean distance: when only a single principal component is selected ( )hour, Degenerate into a scalar, It is fully compatible with the original one-dimensional DTW cost calculation logic, and also consistent with the above. hour The settings are consistent with the degenerate scalar output. The cost matrix D reflects the local differences between the two sequences at each time point.

[0053] To avoid the excessive computation and overfitting problems caused by the traditional dynamic time warping algorithm's allowance of arbitrary time warps, a strip window is introduced as a global constraint. The width parameter of the strip window is set. This indicates the maximum allowed time offset. (This width parameter...) The time offset constraint at the measurement point timing level corresponds to the timing alignment range under a second-level sampling period, which belongs to a different processing level than the message-level matching time window. This solution is based on and adapted to the conventional second-level sampling period of the power distribution terminal. The width of the baseline strip window This corresponds to a maximum permissible time offset of 2 seconds for the measurement point. The width of the strip window must meet the parameter linkage constraint: ,in The matching time window set for step S1 For the sampling period of the distribution terminal, this constraint ensures that the timing offset of the measurement point does not exceed the maximum allowable jitter range of the message packets. When the sampling period of the field terminal changes, the strip window width W is adjusted according to the matching time window. With sampling period Automatic recalculation and update; This is the baseline default value and can be dynamically adjusted based on long-term network jitter statistics in the field. This is used when calculating the cumulative cost matrix. When, only those satisfying the constraints are calculated. The elements that satisfy the constraint are set to have an infinity cumulative cost. The cumulative cost matrix is ​​recursively calculated as follows: the cumulative cost at the current position equals the current position's cost plus the minimum cumulative cost of its three adjacent positions (above, to the left, and to the upper left). Specifically, for elements that satisfy the constraint... Its cumulative cost Calculate using the following formula: ; in, It is the element in the i-th row and j-th column of the cumulative cost matrix, representing the total cost of the optimal alignment path from the start of the sequence to the position (i,j); , and when or When considering adjacent positions, only the existing ones are taken into account.

[0054] Cumulative cost matrix The last element This represents the total cumulative cost between the baseline and target sequences. To eliminate the influence of sequence length on distance values ​​and improve the comparability of distances across different time windows, the proportion of diagonal straight steps in the optimal regular path is calculated and denoted as the straight-line percentage r; a preset threshold for the straight-line percentage is also included. ;like This indicates excessive path distortion, suggesting a risk of forced alignment of abnormal sequences and underestimation of distance in over-matching. A curvature penalty coefficient k is introduced to amplify and correct the normalized distance. This curvature penalty coefficient k is positively correlated with the strip window width W, and its calculation formula is as follows: When the baseline configuration hour, The wider the strip window, the greater the space for path distortion, the more significant the boundary effect, and the larger the penalty coefficient, thus achieving adaptive parameter matching. The final normalized dynamic time warped distance correction is: ; Where L is the total number of steps in the optimal alignment path of DTW, i.e., the number of elements contained in the normalized path. This dynamic time normalization distance... The average cumulative cost per unit alignment step is unaffected by the total sequence length and can be directly used for similarity comparison of sequences of different durations. A smaller value indicates greater similarity between the two sequences, while a larger value indicates more significant differences. A path curvature penalty factor is used to penalize excessively distorted alignment results, avoiding over-matching caused by unlimited time distortion and preventing genuinely anomalous sequences from being mistaken for normal ones due to excessive time alignment, thus further improving the accuracy of anomaly detection. If the percentage of straight sections along the optimal path is too low, it indicates excessive time distortion, which can easily lead to over-matching problems such as forced alignment of anomalous sequences and underestimated distances. By introducing a penalty coefficient greater than 1 to amplify the distance value, excessively distorted alignment results can be penalized, avoiding missed detections. In the cumulative cost matrix, the local cumulative cost at each point corresponds to the cumulative deviation of the alignment path from that point, reflecting the degree of difference between the two sequences within a local time period. Based on historical data under normal operating conditions, the 95th percentile of all local cumulative costs is calculated as the normal baseline for local anomaly detection, used for accurate extraction of subsequent anomaly time windows.

[0055] Using the multi-principal component fusion feature sequence corresponding to the source data element as the reference sequence and the multi-principal component fusion feature sequence corresponding to the data element before mapping as the target sequence, calculate the dynamic time warping distance between the two. , denoted as the first distance Using the multi-principal component fusion feature sequence corresponding to the data elements before mapping as the reference sequence and the multi-principal component fusion feature sequence corresponding to the data elements after mapping as the target sequence, calculate the dynamic time warping distance between the two. , denoted as the second distance Using the multi-principal component fusion feature sequence corresponding to the mapped data element as the reference sequence and the multi-principal component fusion feature sequence corresponding to the target data element as the target sequence, calculate the dynamic time warping distance between the two. , denoted as the third distance .

[0056] Calculate the first distance respectively Second distance and the third distance Then, it is compared with preset thresholds. The three thresholds are set based on the statistical results of a large amount of historical data under normal operating conditions: 1000 sets of time-scaled measurement point data elements under normal operating conditions are collected, and the dynamic time warping distance corresponding to each step is calculated according to the above process. The 99th percentile is taken as the corresponding threshold. For example, the first threshold... Take the 99th percentile of the first distance under normal operating conditions, and the second threshold. The ratio of the second distance to the first distance under normal operating conditions. / 99th percentile, third threshold Same as the first threshold Take the 99th percentile of the third distance under normal operating conditions.

[0057] If the first distance First threshold If an anomaly is detected in the pre-mapping process, i.e., an anomaly occurs between the source ingress message and the pre-mapping message; at this point, a calibration correction is performed on the second distance, and the corrected distance... = / Then, the corrected distance With the preset second threshold Comparison: If > If this is the case, then it is determined that there is an anomaly in the mapping execution process, that is, there is an anomaly in the protocol conversion process between the message before mapping and the message after mapping; if ≤ Then it is determined The increase in value was caused by the upstream time offset, and there were no errors in the mapping execution process.

[0058] If the third distance Third threshold If an anomaly is detected in the mapping process, it indicates that an anomaly has occurred in the transmission or processing between the mapped message and the target exit message.

[0059] Under normal operating conditions, when the mapping execution logic is error-free, and The ratio remained stable around 1; based on statistics from 1000 groups of normal operating condition samples, the 99th percentile of this ratio was 1.2, which is the baseline threshold. .when This indicates that the increase in the second distance is not entirely due to the upstream time offset, and there is an anomaly in the mapping execution process itself.

[0060] The timing of power distribution protocol links is correlated with upstream and downstream processes. Upstream data acquisition and transmission jitter can synchronously interfere with downstream DTW distance calculations. This solution introduces a distance ratio calibration mechanism to eliminate misjudgments caused by the propagation of timing anomalies and improve the accuracy of link positioning. Testing showed that after introducing the ratio calibration mechanism, the misjudgment rate of the mapping execution link caused by upstream and downstream timing disturbances decreased from 28% to 1.2%.

[0061] If all distances do not exceed their corresponding thresholds, an error is deemed to be absent. Since the calculations of the three distances are independent, one or more error points can be located simultaneously. For each error-identified point, the optimal DTW alignment path of the corresponding alignment sequence is synchronously traced back to locate the segment where the local cumulative cost continuously exceeds the normal baseline, and the start and end times of the corresponding abnormal time window are determined. By combining the results of all error point determinations, the corresponding distance values, and the abnormal time window information, a coarse-grained localization result is obtained, which will serve as the input for the fine-grained localization in step S4.

[0062] Step S4: When the coarse-grained positioning result is in the mapping execution stage, the data elements before and after mapping are matched and verified one by one to obtain the fine-grained positioning result; the coarse-grained positioning result and the fine-grained positioning result are summarized and analyzed to obtain the reduction mapping error positioning result.

[0063] This step first determines whether the coarse-grained localization result obtained in step S3 contains errors from the mapping execution stage. If so, fine-grained localization is performed on that stage, accurately locating the specific error matching pair, error period, and error type by verifying each data element before and after mapping. Subsequently, all coarse-grained and fine-grained localization results are summarized and analyzed to generate the final reduction mapping error localization report.

[0064] This application only performs fine-grained line-by-line verification on the mapping execution stage of coarse-grained positioning judgment. The underlying technical constraints are: the pre-mapping stage belongs to the source specification message parsing process, and the post-mapping stage belongs to the target specification encapsulation process. The message protocol format and measurement point storage structure at both ends of the two types of stages are fundamentally different, making it impossible to establish a one-to-one matching pair of measurement point identifiers, and thus lacking the conditions for implementing fine-grained error verification on a measurement point-by-measurement basis. Only the pre-mapping cache data and post-mapping cache data in the mapping execution stage share a unified internal measurement point index and standardized data structure, which can build matching pairs based on the same measurement point identifier, supporting full-dimensional fine-grained error identification.

[0065] When the coarse-grained localization result indicates an error in the mapping execution stage, the abnormal time window to which the error belongs is first extracted from the coarse-grained localization result. This abnormal time window is determined by the message time period corresponding to when the second distance exceeds the corresponding threshold in step S3. Specifically, by backtracking the optimal alignment path of DTW, the segment where the local normalized cumulative cost continuously exceeds the normal baseline is located, thereby determining the start and end times of the abnormal time window. The normal baseline is taken as the 95th percentile of the local normalized cumulative cost under normal operating conditions, which is obtained from historical training data. Since path length normalization processing is adopted, this baseline is not affected by the segment duration and has applicability to judge abnormal time periods of different lengths.

[0066] Then, extract the pre-mapping and post-mapping data element segments corresponding to the time window from the time-stamped measurement point data elements constructed in step S2. Both segments are multi-dimensional time-stamped sequences, containing standardized data items for all sampling times within the time window.

[0067] Based on the message correspondence and unified time axis alignment rules established in step S1 using the measurement point identifier and sampling time as indexes, a preliminary matching pair of data element fragments before and after mapping is constructed. The pre-stored standard protocol benchmark mapping table is retrieved, and the full-dimensional verification of the matching pairs is completed sequentially. First, a mapping relationship consistency verification is performed. For each pre-constructed matching pair, its measurement point identifier before and after mapping is extracted, and it is determined whether the identifier pair exists in the benchmark mapping table.

[0068] If the identifier pairing conforms to the definition of the baseline mapping table, the numerical deviation calculation process proceeds directly. If the identifier pairing does not conform to the definition of the baseline mapping table, it is further determined whether it is a correctable mismatch. When there is a unique correct target identifier corresponding to the pre-mapping measurement point identifier in the baseline mapping table, and the data types of the two are consistent, it is determined to be a correctable structural mismatch. The post-mapping measurement point identifier of the current matching pair is temporarily redirected to the correct target identifier. The original mismatch identifier is retained throughout the process for tracing the source, and the numerical deviation calculation process continues. At the same time, the matching pair is marked as mismatch corrected and numerical verification pending. When there is no valid target identifier corresponding to the pre-mapping measurement point identifier in the baseline mapping table, or the data types of the correct target identifier and the pre-mapping measurement point identifier are inconsistent, it is determined to be an uncorrectable structural mismatch. It is directly marked as an erroneous matching pair, and the mismatch source measurement point ID, error mapping ID, and type mismatch identifier are recorded. The numerical deviation calculation process is skipped.

[0069] After completing the mapping relationship verification, for all matching pairs that conform to the mapping relationship, including those originally conforming to the benchmark mapping table and those after mismatch correction, the numerical deviation between the data items before and after mapping is uniformly calculated and compared with the preset deviation tolerance threshold. If the numerical deviation exceeds the deviation tolerance threshold, it is marked as a numerical distortion error matching pair. It should be noted that the above temporary redirection is only used for numerical verification during this error location process. It does not modify the actual mapping configuration of the protocol conversion device, does not interfere with normal power distribution communication services, and the original mismatch identifier is retained throughout the process, meeting the requirements of power system data auditability and traceability.

[0070] Based on the combined results of mapping relationship verification and numerical verification, the erroneous matching pairs are subdivided into five categories, and the deviation tolerance threshold used for judgment is denoted as... The error rate threshold is denoted as The two threshold values ​​are consistent with the calibration rules for the final project. The judgment rules are as follows: A simple structural mismatch can be corrected, meaning the mapping relationship is incorrect, but the numerical deviation after redirection to the baseline mapping table is... Uncorrectable structural mismatch refers to an incorrect mapping relationship where there is no corresponding valid target identifier in the baseline mapping table, or where the target identifier and source identifier are incompatible in data type, making redirection impossible; persistent numerical distortion refers to a correct mapping relationship but a numerical deviation. And the percentage of errors within the window If five consecutive sampling points exceed the limit, it can be judged as continuous; sporadic numerical distortion refers to a situation where the mapping relationship is correct but the numerical value is off. But the percentage of errors within the window A combined error of mismatch and numerical distortion refers to an error in the mapping relationship, where the numerical deviation remains even after redirection. The number of various error matching pairs and their proportion in the total number of matching pairs are counted. All error matching pairs are arranged in chronological order to generate an error time distribution sequence. The sampling time and numerical deviation of each error matching pair are recorded, which can be used to analyze the temporal pattern of errors, such as whether they are concentrated in a specific period or exhibit periodicity.

[0071] By combining the numerical deviation list of the error-matching pairs, the error time distribution sequence, and the error percentage, a fine-grained localization result is generated. This result includes at least: the error type (i.e., persistent or intermittent error); the error occurrence period (i.e., the time window range extracted from the coarse-grained localization result); and the error severity, determined by a weighted average of the average numerical deviation and the error percentage of the error-matching pairs—a larger average deviation and a higher percentage indicate greater severity. Supporting detailed fields include a list of mismatched measurement points, mismatch correction status, post-correction numerical deviation value, and a composite fault identifier. This fine-grained localization result will be incorporated into the subsequent summary process, and together with the coarse-grained localization results from the pre- and post-mapping stages, will generate the final specification mapping error localization report.

[0072] Next, all coarse-grained and fine-grained localization results are summarized and analyzed to obtain the final reduction mapping error localization results.

[0073] When the coarse-grained localization result contains only a single error stage, it is handled in two ways. If the error is determined to be located in the pre-mapping or post-mapping stage, the coarse-grained localization result is directly output, along with the abnormal time window, corresponding distance value, and confidence level as a reference. The confidence level is divided according to the ratio of distance to a threshold: a ratio greater than 3 indicates high confidence, 1-3 indicates medium confidence, and less than 1 indicates low confidence. If the error is determined to be located in the mapping execution stage, the error type, error time distribution sequence, and error percentage from the fine-grained localization result are output as the final localization conclusion. The position index of the specific error matching pair in the pre-mapping and post-mapping data elements is marked so that maintenance personnel can quickly locate the specific message field. The grading threshold is determined based on the statistical accuracy of historical fault samples, and the determination results in the high-confidence interval have a consistency of over 98% with the actual on-site investigation.

[0074] When the coarse-grained localization result contains two or more error stages, the localization results of each error stage are output sequentially according to the link flow order of the pre-mapping stage, the mapping execution stage, and the post-mapping stage. Among them, the pre-mapping and post-mapping stages output the corresponding coarse-grained details, and the mapping execution stage outputs the corresponding fine-grained details. Each stage error is marked as an independent judgment result, which can be investigated separately without interference.

[0075] Finally, the location results of all time-stamped measurement point data elements are summarized, and the error frequency and severity distribution of each stage are statistically analyzed to generate a specification mapping error location result. This result should include at least: the error stage (before mapping, during mapping execution, or after mapping); the error type (persistent or intermittent for the mapping execution stage, and coarse-grained anomaly for other stages); the error period (the start and end times of the abnormal time window); a list of affected measurement points (identifiers of all measurement points involved in the error matching pairs in fine-grained location, provided only when there is an error in the mapping execution stage); and a confidence assessment based on the values ​​of the first, second, or third distance in step S3, with higher distances indicating higher confidence. For example, the ratio of distance to a corresponding threshold can be used as a confidence index, with a ratio greater than 3 considered high confidence, 1 to 3 medium confidence, and below 1 low confidence. This specification mapping error location report can serve as a direct basis for maintenance personnel to troubleshoot faults.

[0076] In practical engineering applications, attention should be paid to the deviation tolerance threshold. and error rate threshold Calibration should be performed regularly based on the accuracy of on-site equipment and the operating environment to avoid false alarms due to overly strict threshold settings or missed alarms due to overly lenient settings. When the total number of matching pairs within an abnormal time window is too small, such as less than 10, the statistical significance of the error ratio is insufficient. In this case, a confidence downgrade mechanism should be triggered: the original high confidence level should be downgraded to medium confidence, and the original medium confidence level should be downgraded to low confidence. The insufficient data sample should be clearly marked in the positioning report, and manual review is recommended. In addition, for persistent errors, it should be further analyzed whether they are caused by a protocol conversion logic error rather than simple communication noise. If necessary, the distance trend in step S3 can be used to assist in the judgment.

[0077] This technical solution constructs a rapid error localization system for distribution terminal protocol mapping through a complete process: synchronous acquisition and time alignment of four-node messages, preprocessing of measurement point data elements through parsing, coarse localization using dynamic time warping improved by strip window constraints, and fine verification of mapping rules one by one. The solution introduces kernel principal component analysis to achieve dimensionality reduction of multi-dimensional measurement point time series, and combines this with a strip window constraint-optimized dynamic time warping algorithm to effectively adapt to network latency jitter and clock skew scenarios. It can quickly determine the link level to which the error belongs and accurately pinpoint the abnormal field. Compared to traditional point-by-point comparison methods, this solution significantly reduces the false positive rate and computational overhead, improves localization efficiency and accuracy, and provides reliable technical support for the operation and maintenance of distribution protocol links.

[0078] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, the phrase "comprising an element defined as..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0079] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their likenesses.

Claims

1. A method for rapid location of distribution terminal protocol mapping errors, characterized in that, Includes the following steps: Step S1: During the protocol mapping process, collect the source ingress message, the message before mapping, the message after mapping, and the target egress message; Time alignment is performed on the source inbound message, pre-mapping message, post-mapping message, and target outbound message, and a four-tuple is constructed; the original message dataset is constructed based on the four-tuple; Step S2: Perform reduction parsing on the original message dataset to extract time-stamped measurement point data elements; the time-stamped measurement point data elements include source data elements, pre-mapping data elements, post-mapping data elements, and target data elements; Step S3: The improved dynamic time warping algorithm with strip window constraint is used to compare the data elements in the time-stamped measurement point data element pairwise to determine whether the error is located in the pre-mapping stage, post-mapping stage, or mapping execution stage, so as to obtain the coarse-grained positioning result. Step S4: When the coarse-grained positioning result is in the mapping execution stage, the data elements before and after mapping are matched and verified one by one to obtain the fine-grained positioning result; the coarse-grained positioning result and the fine-grained positioning result are summarized and analyzed to obtain the reduction mapping error positioning result.

2. The method for rapid location of distribution terminal protocol mapping errors according to claim 1, characterized in that, During the protocol mapping process, source ingress messages, pre-mapping messages, post-mapping messages, and target egress messages are collected. Time alignment is performed on the source inbound message, the pre-mapping message, the post-mapping message, and the target outbound message, and a four-tuple is constructed, including: Data capture probes are deployed at the input, pre-mapping buffer, post-mapping buffer, and output of the protocol conversion device in the power distribution terminal, and the source entry message, pre-mapping message, post-mapping message, and target exit message are collected synchronously through protocol proxy. And a hardware timestamp is added to each collected message; For the four types of messages collected, based on the preset matching time window, the source ingress messages, pre-mapping messages, post-mapping messages and target egress messages that flow through the same protocol conversion link are grouped according to their sequential correspondence to form an initial quadruple; Using the time stamp of a unified clock source as a reference, the hardware timestamps of each message in the initial quadruple are normalized to eliminate the clock offset of each acquisition node, resulting in a time-aligned quadruple.

3. The method for rapid location of distribution terminal protocol mapping errors according to claim 2, characterized in that, The original message dataset is constructed based on the four-tuples, including: The format of the four messages in each time-aligned quadruple is standardized to convert messages of different protocol types into a unified internal data structure. Perform integrity checks on the unified messages and remove invalid records; For quadruples that pass the integrity check, mark the missing fields. If the missing field is a non-critical field, fill it with the default value; if the missing field is a critical field, discard the quadruple and log it. Redundant records with adjacent timestamps but identical message content are deduplicated, retaining only the first record; The quadruplets, after integrity verification, missing data handling, and deduplication, are arranged in chronological order and stored as a structured file to form the original message dataset.

4. The method for rapid location of distribution terminal protocol mapping errors according to claim 3, characterized in that, The original message dataset is reduced and parsed to extract time-stamped measurement point data elements, including: Iterate through each quadruple in the original message dataset and read the original data items of each message in turn; The extracted raw data items are validated for legality, and invalid data items with abnormal quality indicators or values ​​exceeding the preset reasonable range are removed. For the time series sampling gaps caused by the removal of invalid data items, linear interpolation is used to generate corresponding complete data items at the corresponding time, so as to maintain the continuity and integrity of the time series of each measurement point on a unified time axis. For the original data items that pass the legality verification, their original time scales are uniformly converted into a unified time format based on Coordinated Universal Time, and dimensional conversion and normalization are performed for each measurement point to obtain standardized data items. The standardized data items corresponding to the four messages in the same quadruple are classified and aggregated according to the link node to which they belong, and the source data element, the data element before mapping, the data element after mapping, and the target data element are generated accordingly. Time-stamped measurement point data elements are constructed based on the four sets of data sources. Each time-scaled measurement point data element is a multi-dimensional time-scaled sequence containing all telemetry and teleindication measurement points.

5. The method for rapid location of distribution terminal protocol mapping errors according to claim 4, characterized in that, The reading of the raw data items of each message includes: Identify the protocol type of each message and load the corresponding protocol parsing template based on the identified protocol type; Based on the protocol parsing template, the message is parsed field by field to extract the original data items.

6. The method for rapid location of distribution terminal protocol mapping errors according to claim 4, characterized in that, An improved dynamic time warping algorithm with strip window constraints is used to perform pairwise comparisons of the data elements in the time-stamped measurement point data elements to determine whether the error is located in the pre-mapping stage, post-mapping stage, or mapping execution stage, thus obtaining coarse-grained localization results, including: Kernel principal component analysis was performed on the source data element, the data element before mapping, the data element after mapping, and the target data element in the time-stamped measurement point data element to reduce the dimensionality and obtain the multi-principal component fusion feature sequence corresponding to each data element; Using the multi-principal component fusion feature sequence corresponding to the source data element as the reference sequence and the multi-principal component fusion feature sequence corresponding to the data element before mapping as the target sequence, the dynamic time warping distance between the two is calculated using the improved dynamic time warping algorithm with strip window constraint, and is denoted as the first distance. Using the multi-principal component fusion feature sequence corresponding to the data element before mapping as the reference sequence and the multi-principal component fusion feature sequence corresponding to the data element after mapping as the target sequence, the dynamic time warping distance between the two is calculated using the improved dynamic time warping algorithm with strip window constraint, and is denoted as the second distance. Using the multi-principal component fusion feature sequence corresponding to the mapped data element as the reference sequence and the multi-principal component fusion feature sequence corresponding to the target data element as the target sequence, the dynamic time warping distance between the two is calculated using the improved dynamic time warping algorithm with strip window constraint, and is denoted as the third distance. The first distance, the second distance, and the third distance are compared with preset first thresholds, second thresholds, and third thresholds, respectively. If the first distance is greater than the first threshold, the error is determined to be located in the pre-mapping stage. At this time, the second distance is calibrated and corrected, and the ratio of the second distance to the first distance is calculated as the corrected distance. If the corrected distance is greater than the second threshold, the error is determined to be located in the mapping execution stage. If the corrected distance does not exceed the limit, it is determined that the increase in the second distance value is caused by the upstream timing offset, and there is no error in the mapping execution stage. If the third distance is greater than the third threshold, the error is determined to be located in the post-mapping stage. If all distances do not exceed the corresponding threshold, there is no error. One or more error stages can be located simultaneously. The results of comprehensive error judgment are used to obtain coarse-grained positioning results.

7. The method for rapid location of distribution terminal protocol mapping errors according to claim 6, characterized in that, The dimensionality reduction of the kernel principal component analysis includes: A unified projection vector set for kernel principal component analysis is obtained by pre-training based on historical time-scaled measurement point data under normal operating conditions; The time-scaled measurement point sequence of each data element is standardized so that the mean of each dimension is 0 and the standard deviation is 1. The Gaussian radial basis function is selected as the kernel function, and the standardized time-scaled measurement point sequence is projected onto the k-dimensional feature space through the unified projection vector set to obtain the corresponding multi-principal component fusion feature sequence.

8. A method for rapid location of distribution terminal protocol mapping errors according to claim 6, characterized in that, The improved dynamic time warping algorithm for the strip window constraint includes: Set the width parameter W of the strip window to represent the maximum allowed time offset; Construct cost matrices for the baseline sequence and the target sequence, where the element in the i-th row and j-th column of the cost matrix is ​​the square of the Euclidean distance between the i-th point of the baseline sequence and the j-th point of the target sequence; When calculating the cumulative cost matrix, only the elements that satisfy the constraint |ji|≤W are calculated, and the cumulative cost corresponding to the elements that do not satisfy the constraint is set to infinity, where i is the index of the baseline sequence and j is the index of the target sequence. The cumulative cost matrix is ​​recursively calculated as follows: the cumulative cost at the current position is equal to the cost at the current position plus the minimum cumulative cost among the three adjacent positions above, to the left, and to the upper left. The dynamic time warping distance is taken as the value of the last element of the cumulative cost matrix.

9. A method for rapid location of distribution terminal protocol mapping errors according to claim 6, characterized in that, When the coarse-grained positioning result is in the mapping execution stage, the data elements before and after mapping are matched and verified one by one to obtain the fine-grained positioning result, including: Extract the time window to which the error belongs from the coarse-grained positioning results, and extract the data element fragments before and after mapping corresponding to the time window in the time-stamped measurement point data elements. Based on the established message correspondence and unified time axis alignment rules of the quadruples, the standardized data items in the data element fragments before mapping and after mapping are matched one by one, using the measurement point identifier and sampling time as indexes, to form matching pairs. Retrieve the pre-stored standard specification baseline mapping table, perform mapping relationship consistency verification on each matching pair, and determine whether the matching pairs with mismatched identifiers are correctable structural mismatches; after correctable temporary redirection mapping, the measurement point is identified and then the numerical values ​​are verified; those that are not correctable are directly marked as erroneous matching pairs. For all matching pairs that conform to the mapping relationship, calculate the numerical deviation between the data items before and after mapping in each matching pair; The numerical deviation is compared with a preset deviation tolerance threshold. If the numerical deviation exceeds the deviation tolerance threshold, it is determined that there is a persistent error in the mapping execution process; otherwise, it is an occasional error. The error matching pairs are arranged in chronological order to generate an error time distribution sequence; By combining the numerical deviation, error time distribution sequence, error ratio, and mismatch type of the error matching pair, a fine-grained localization result is generated. The fine-grained localization result includes at least the error type, the time period of error occurrence, and the severity of error. The error type includes structural mismatch, numerical distortion, and a combination of both, and distinguishes between persistent errors and occasional errors.

10. A method for rapid location of distribution terminal protocol mapping errors according to claim 9, characterized in that, The coarse-grained and fine-grained localization results are summarized and analyzed to obtain the reduction mapping error localization results, including: When the coarse-grained localization result contains only a single error link, if it is determined that the error is located in the link before or after mapping, the coarse-grained localization result of the corresponding link is output, along with the abnormal time window, the corresponding distance value, and the abnormality level as a confidence reference. If the error is determined to be located in the mapping execution stage, the error type, error time distribution sequence and error ratio in the fine-grained positioning result will be output as the final positioning conclusion. The position index of the specific error matching pair in the data elements before and after mapping will be marked. At the same time, the list of mismatched measurement points, mismatch correction status, numerical deviation value after correction and composite fault identifier will be output. When the coarse-grained localization result contains two or more error links, the localization results of each error link are output sequentially according to the link flow order of the pre-mapping link, the mapping execution link, and the post-mapping link; wherein the pre-mapping and post-mapping links output corresponding coarse-grained details, the mapping execution link outputs corresponding fine-grained details, and each link error is marked as an independent judgment result, which can be investigated separately; The positioning results of all time-stamped measurement point data elements are summarized, and the error frequency and severity distribution of each link are statistically analyzed to generate a reduction mapping error positioning report. The reduction mapping error positioning report includes at least the error link, error type, error period, list of affected measurement points, and confidence assessment, wherein the confidence assessment is determined based on the values ​​of the first distance, the second distance, or the third distance.