Abnormal data restoration method and system based on Lagrange interpolation

The abnormal data is repaired through the Lagrangian interpolation method, which solves the problem of large interpolation error in the existing technology, realizes data continuity and consistency, and ensures the reliable operation of the power grid and equipment safety.

CN120256794AInactive Publication Date: 2025-07-04NANJING GUODIAN NANZI POWER GRID AUTOMATION CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510758228.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-09
Publication Date
2025-07-04
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing interpolation scheme has large interpolation errors when processing sparse data and cannot effectively approximate the actual data characteristics, affecting the accuracy and reliability of distribution network data.

Method used

An abnormal data repair method based on Lagrangian interpolation is used to detect abnormal points through uniform downsampling and differential methods, calculate smoothness, determine the range and center of the Lagrangian interpolation function, and replace the abnormal data with the Lagrangian interpolation function.

Benefits of technology

Obtain a more complete, smooth and accurate data set, eliminating data mutations and noise, improving data quality and stability, and supporting grid monitoring, protection and planning decisions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120256794A_ABST
    Figure CN120256794A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of power distribution network electric parameter calculation, and provides an abnormal data restoration method and system based on Lagrange interpolation, and the method comprises the steps: carrying out the uniform downsampling of original sampling data, and obtaining the extraction sampling data; searching and extracting an abnormal data position of the sampling data, and calculating the smoothness of data on two sides of the abnormal data; determining a Lagrange interpolation function range and a Lagrange interpolation function center based on the abnormal data position and the smooth data satisfying the smoothness at the two sides of the abnormal data position; and calculating the Lagrange interpolation of the abnormal data position by using the original sampling data of the smooth data region within the range of the Lagrange interpolation function, and replacing the abnormal data in the extracted sampling data with the Lagrange interpolation to complete data restoration. According to the method, a more complete, smooth and accurate data set can be obtained, the continuity and the consistency of the data are ensured by the repaired data, mutation and noise in the data are eliminated, and the quality and the stability of the data are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of calculating electrical parameters of a distribution network, and particularly to an abnormal data repair method and system based on Lagrange interpolation. Background Art

[0002] With the large-scale access of new energy, the probability of interference in the sampling data of distribution network terminal equipment further increases: infrastructure failures, including equipment failures and communication failures of distribution terminals, may lead to inaccurate collected data; due to the sensitivity of sampling equipment, external electromagnetic interference, AC noise, amplifier circuit parameters, and noise anti-interference capabilities, etc., interfere with the operation of sampling equipment, resulting in abnormal measurement data. These interference factors may affect the reliability and accuracy of new energy distribution network data, pose a threat to protection stability, degrade data quality, and damage the normal operation and management of the distribution network.

[0003] Interpolation is a commonly used method for repairing sampled numerical values, which approximates the curve of given data by using a polynomial function. The existing interpolation schemes have the following deficiencies. The error of the interpolation function is related to the distribution of data points. When the data points are unevenly distributed near the interpolation points, the interpolation error may be large; it may not work well when dealing with sparse data. When the number of data points is relatively small, the interpolation polynomial may not be able to effectively approximate the characteristics of the actual data, resulting in a decrease in the accuracy of the interpolation result. Summary of the Invention

[0004] The purpose of the present invention is to solve at least one technical problem in the background art, and provide an abnormal data repair method and system based on Lagrange interpolation.

[0005] To achieve the above purpose, the present invention provides an abnormal data repair method based on Lagrange interpolation, including: Obtaining decimated sampling data by uniformly decimating the original sampling data; Retrieving the positions of abnormal data in the decimated sampling data, and calculating the smoothness of the data on both sides of the abnormal data; Determining the range of the Lagrange interpolation function and the center of the Lagrange interpolation function based on the positions of the abnormal data and the smooth data on both sides that satisfy the smoothness; Calculating the Lagrange interpolation at the positions of the abnormal data by using the original sampling data in the smooth data region within the range of the Lagrange interpolation function, and replacing the abnormal data in the decimated sampling data with the Lagrange interpolation to complete data repair.

[0006] According to one aspect of the present invention, obtaining decimated sampling data by uniformly decimating the original sampling data is: Sampling the original sampling data at a sampling frequency f to obtain an original sampling sequence y0, y1, y2, y3, y4, …, y2N , at a sampling frequency f s = f / 2, uniformly downsample the original sampling sequence y0, y1, y2, y3, y4, …, y 2N to obtain the decimated sampling sequence y0, y2, y4, …, y 2N .

[0007] According to one aspect of the present invention, retrieving the positions of abnormal data in the decimated sampling data and calculating the smoothness of the data on both sides of the abnormal data is as follows: Use the second-order difference method to retrieve the abnormal points of the decimated sampling sequence, and use the first-order difference method to calculate the smoothness of the data on both sides of the abnormal points.

[0008] According to one aspect of the present invention, calculate the first-order difference sequence and the second-order difference sequence of the decimated sampling sequence y0, y2, y4, …, y 2N ; Among them, the first-order difference sequence Δy n = y 2(n+1) - y 2n (n = 0, 1, …, N - 1); The second-order difference sequence Δ 2 y n = Δy (n+1) - Δy n (n = 0, 1, …, N - 2); The judgment formula for abnormal points is: , where k e is the abnormal detection coefficient, which can take 0.02, I rms is the effective value of the decimated sampling sequence; The judgment formula for the smoothness of the data on both sides of the abnormal points is: , where k s is the smoothness detection coefficient, which can take 0.018, I rms is the effective value of the decimated sampling sequence.

[0009] According to one aspect of the present invention, determining the range of the Lagrange interpolation function and the center of the Lagrange interpolation function based on the abnormal data position and the smooth data on both sides satisfying the smoothness includes: Determine the smooth data region and the non-smooth data region on both sides of the abnormal point; Determine the range of the Lagrange interpolation function according to the smooth data region; Translate and adjust the range of the Lagrange interpolation function to make the center of the Lagrange interpolation function close to the abnormal point, and determine the center of the Lagrange interpolation function.

[0010] According to one aspect of the present invention, Lagrange interpolation of the abnormal data position is calculated using the original sampling data in the smooth data region within the range of the Lagrange interpolation function, and the abnormal data in the decimated sampling data is replaced with the Lagrange interpolation to complete data repair, including: Set the original sampling sequence y0, y1, y2, y3, y4, …, y 2N The corresponding serial numbers are x0, x1, x2, x3, x4, …, x 2N , and the decimated sampling sequence y0, y2, y4, …, y 2N The corresponding serial numbers x0, x2, x4, …, x 2N ; The Lagrange interpolation polynomial of the abnormal point with serial number x in the decimated sampling sequence is: , where i = 0, 1, 2, …, n; , where i = 0, 1, 2, …, n, i ≠ j; Where x ∈ {x0, x2, x4, …, x 2N}; n is the order of the interpolation polynomial, and n = 4 can be taken; x i , x j is the range of the Lagrange interpolation function; Using the calculated Lagrange interpolation L n (x) replaces the abnormal data with serial number x in the decimated sampling sequence to complete data repair, and the decimated sampling sequence after abnormal data replacement is the final data repair result.

[0011] To achieve the above object, the present invention also provides an abnormal data repair system based on Lagrange interpolation, including: A decimated sampling data acquisition module that obtains decimated sampling data by uniformly downsampling the original sampling data; An abnormal data and smoothness confirmation module that retrieves the position of abnormal data in the decimated sampling data and calculates the smoothness of the data on both sides of the abnormal data; A Lagrange interpolation function range and center determination module that determines the Lagrange interpolation function range and the center of the Lagrange interpolation function based on the position of the abnormal data and the smooth data on both sides that meet the smoothness; A data repair module that calculates the Lagrange interpolation of the abnormal data position using the original sampling data in the smooth data region within the range of the Lagrange interpolation function, and replaces the abnormal data in the decimated sampling data with the Lagrange interpolation to complete data repair.

[0012] To achieve the above object, the present invention further provides an electronic device, including a processor, a memory, and a computer program stored on the memory and executable on the processor. When the computer program is executed by the processor, the abnormal data repair method based on Lagrange interpolation as described above is implemented.

[0013] To achieve the above object, the present invention further provides a computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the abnormal data repair method based on Lagrange interpolation as described above is implemented.

[0014] According to the solution of the present invention, the present invention provides an abnormal data repair method based on scaled and translated Lagrange interpolation. The present invention can obtain a more complete, smooth, and accurate data set. The repaired data ensures the continuity and consistency of the data, eliminates mutations and noises in the data, and improves the quality and stability of the data. The repaired data has high accuracy and can better reflect the characteristics and trends of the original data. The data repaired by interpolation can improve the accuracy and reliability of data analysis and applications, provide accurate data support for power grid monitoring, protection, and planning decisions, and ensure the reliable operation of the power grid and the safety protection of equipment. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 Schematically showing a flowchart of an abnormal data repair method based on Lagrange interpolation according to an embodiment of the present invention; Figure 2 Schematically showing an abnormal data repair diagram under the condition of bilateral data smoothing near an abnormal point according to an embodiment of the present invention; Figure 3 、 Figure 4 、 Figure 5 、 Figure 6 and Figure 7 Is a flowchart of abnormal data repair under the condition of bilateral data smoothing near an abnormal point in Embodiment 1. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0016] Now the content of the present invention will be described with reference to exemplary embodiments. It should be understood that the described embodiments are only for enabling those of ordinary skill in the art to better understand and thus implement the content of the present invention, rather than implying any limitation to the scope of the present invention.

[0017] As used herein, the term "comprising" and its variants are to be construed as open-ended terms meaning "including but not limited to". The term "based on" is to be construed as "at least partially based on". The terms "one embodiment" and "an embodiment" are to be construed as "at least one embodiment".

[0018] Figure 1 Schematically showing a flowchart of an abnormal data repair method based on Lagrange interpolation according to an embodiment of the present invention. As Figure 1 shown, in this embodiment, the abnormal data repair method based on Lagrange interpolation includes: Obtaining decimated sampling data by uniformly decimating the original sampling data; Retrieving the positions of abnormal data in the decimated sampling data and calculating the smoothness of the data on both sides of the abnormal data; Determining the range of the Lagrange interpolation function and the center of the Lagrange interpolation function based on the positions of the abnormal data and the smooth data on both sides thereof that satisfy the smoothness; Calculating the Lagrange interpolation at the positions of the abnormal data by using the original sampling data in the smooth data region within the range of the Lagrange interpolation function, and replacing the abnormal data in the decimated sampling data with the Lagrange interpolation to complete data repair.

[0019] Furthermore, according to an embodiment of the present invention, obtaining decimated sampling data by uniformly decimating the original sampling data is: Sampling the original sampling data at a sampling frequency f to obtain an original sampling sequence y0, y1, y2, y3, y4, …, y 2N , and uniformly decimating the original sampling sequence y0, y1, y2, y3, y4, …, y s at a sampling frequency f 2N = f / 2 to obtain a decimated sampling sequence y0, y2, y4, …, y 2N .

[0020] Furthermore, according to an embodiment of the present invention, retrieving the positions of abnormal data in the decimated sampling data and calculating the smoothness of the data on both sides of the abnormal data is: Using the second-order difference method to retrieve the abnormal points in the decimated sampling sequence, and using the first-order difference method to calculate the smoothness of the data on both sides of the abnormal points.

[0021] Furthermore, according to an embodiment of the present invention, calculating the first-order difference sequence and the second-order difference sequence of the decimated sampling sequence y0, y2, y4, …, y 2N ; wherein, the first-order difference sequence Δy n = y 2(n+1) - y 2n (n = 0, 1, …, N - 1); The second-order difference sequence Δ 2 y n = Δy (n+1) - Δy n (n = 0, 1, …, N - 2); The judgment formula for abnormal points is: , where k e is the abnormal detection coefficient, which can take 0.02, I rms is the effective value of the extracted sampling sequence; The judgment formula for the smoothness of the data on both sides of the abnormal point is: , where k s is the smoothness detection coefficient, which can take 0.018, I rms is the effective value of the extracted sampling sequence.

[0022] Furthermore, according to an embodiment of the present invention, determining the Lagrange interpolation function range and the center of the Lagrange interpolation function based on the abnormal data position and the smooth data satisfying the smoothness on both sides thereof includes: Determining the smooth data region and the non-smooth data region on both sides of the abnormal point; Determining the Lagrange interpolation function range according to the smooth data region; Translating and adjusting the Lagrange interpolation function range to make the center of the Lagrange interpolation function close to the abnormal point, and determining the center of the Lagrange interpolation function.

[0023] In this embodiment, determining the Lagrange interpolation function range according to the smooth data region is to determine the Lagrange interpolation function range by means of dynamic scaling according to the smooth data region. Specifically: Setting a maximum range of the Lagrange interpolation function. When the smooth data region (range) of the data near the abnormal point is large and the smooth data region is larger than the maximum range of the Lagrange interpolation function, then take the maximum range of the Lagrange interpolation function; when the smooth data region of the data near the abnormal point is small and the smooth data region is smaller than the maximum range of the Lagrange interpolation function, then shrink the Lagrange interpolation function range to the range including all the smooth data regions.

[0024] In this embodiment, translating and adjusting the Lagrange interpolation function range to make the center of the Lagrange interpolation function close to the abnormal point and determining the center of the Lagrange interpolation function is: When the smooth data region of the data near the abnormal point is large and the Lagrange interpolation function range can be moved left and right, translate the Lagrange interpolation function range so that the point distance between the center point of the Lagrange interpolation function range and the abnormal point is the smallest, which is the optimal.

[0025] In this embodiment, as Figure 2 shown, one side of the abnormal point is the smooth data region and the other side is the non-smooth data region. At this time, determine the Lagrange interpolation function range and the center of the Lagrange interpolation function according to the smooth data region and the abnormal point.

[0026] Further, according to an embodiment of the present invention, the Lagrange interpolation of the abnormal data position is calculated using the original sampling data in the smooth data region within the range of the Lagrange interpolation function, and the abnormal data in the extracted sampling data is replaced with the Lagrange interpolation to complete data repair, including: Set the original sampling sequence y0, y1, y2, y3, y4, …, y 2N The corresponding sequence numbers are x0, x1, x2, x3, x4, …, x 2N , extract the sampling sequence y0, y2, y4, …, y 2N The corresponding sequence numbers x0, x2, x4, …, x 2N ; The Lagrange interpolation polynomial of the abnormal point with sequence number x in the extracted sampling sequence is: , where i = 0, 1, 2, …, n; , where i = 0, 1, 2, …, n, i ≠ j; where x ∈ {x0, x2, x4, …, x 2N}; n is the order of the interpolation polynomial, and n = 4 can be taken; x i , x j is the range of the Lagrange interpolation function; Replace the abnormal data with sequence number x in the extracted sampling sequence with the calculated Lagrange interpolation Ln(x) to complete data repair, and the extracted sampling sequence after abnormal data replacement is the final data repair result.

[0027] According to the above solution of the present invention, the present invention provides an abnormal data repair method based on scaled translational Lagrange interpolation. The present invention can obtain a more complete, smooth, and accurate data set. The repaired data ensures the continuity and consistency of the data, eliminates mutations and noises in the data, improves the quality and stability of the data. The repaired data has high accuracy and can better reflect the characteristics and trends of the original data. The data repaired by interpolation can improve the accuracy and reliability of data analysis and applications, provide accurate data support for power grid monitoring, protection, and planning decisions, and ensure the reliable operation of the power grid and the safety protection of equipment.

[0028] Further, to achieve the above object, the present invention also provides an abnormal data repair system based on scaled translational Lagrange interpolation, including: An extracted sampling data acquisition module that obtains extracted sampling data by uniformly downsampling the original sampling data; Abnormal data and smoothness confirmation module, which retrieves the positions of abnormal data in the sampled data and calculates the smoothness of the data on both sides of the abnormal data; Lagrange interpolation function range and center determination module, which determines the Lagrange interpolation function range and the Lagrange interpolation function center based on the abnormal data positions and the smooth data on both sides that meet the smoothness; Data repair module, which calculates the Lagrange interpolation at the abnormal data positions using the original sampled data in the smooth data region within the Lagrange interpolation function range, and replaces the abnormal data in the sampled data with the Lagrange interpolation to complete data repair.

[0029] Furthermore, according to an embodiment of the present invention, the sampled data obtained by uniformly downsampling the original sampled data is: The original sampled sequence y0, y1, y2, y3, y4, …, y is obtained by sampling the original sampled data at the sampling frequency f; 2N , and at the sampling frequency f s = f / 2, the original sampled sequence y0, y1, y2, y3, y4, …, y 2N is uniformly downsampled to obtain the sampled sequence y0, y2, y4, …, y 2N .

[0030] Furthermore, according to an embodiment of the present invention, the positions of abnormal data in the sampled data are retrieved, and the smoothness of the data on both sides of the abnormal data is calculated as follows: The second-order difference method is used to retrieve the abnormal points in the sampled sequence, and the first-order difference method is used to calculate the smoothness of the data on both sides of the abnormal points.

[0031] Furthermore, according to an embodiment of the present invention, the first-order difference sequence and the second-order difference sequence of the sampled sequence y0, y2, y4, …, y 2N are calculated; Among them, the first-order difference sequence Δy n = y 2(n+1) - y 2n (n = 0, 1, …, N - 1); The second-order difference sequence Δ 2 y n = Δy (n+1) - Δy n (n = 0, 1, …, N - 2); The judgment formula for abnormal points is: , where, k e is the abnormal detection coefficient, which can take 0.02, I rms is the effective value of the sampled sequence; The judgment formula for the smoothness of the data on both sides of the abnormal point is as follows: , where k s is the smoothness detection coefficient, and it can take 0.018. I rms is the effective value of the extracted sampling sequence.

[0032] Further, according to an embodiment of the present invention, determining the Lagrange interpolation function range and the center of the Lagrange interpolation function based on the abnormal data position and the smooth data satisfying the smoothness on both sides thereof includes: Determining the situation of the smooth data area and the non-smooth data area on both sides of the abnormal point; Determining the Lagrange interpolation function range according to the smooth data area; Translating and adjusting the Lagrange interpolation function range to make the center of the Lagrange interpolation function close to the abnormal point, and determining the center of the Lagrange interpolation function.

[0033] In this embodiment, determining the Lagrange interpolation function range according to the smooth data area means determining the Lagrange interpolation function range by dynamic scaling according to the smooth data area. Specifically: Set a maximum range of the Lagrange interpolation function. When the smooth data area (range) of the data near the abnormal point is large and the smooth data area is larger than the maximum range of the Lagrange interpolation function, then take the maximum range of the Lagrange interpolation function; when the smooth data area of the data near the abnormal point is small and the smooth data area is smaller than the maximum range of the Lagrange interpolation function, then shrink the Lagrange interpolation function range to the range that includes all the smooth data areas.

[0034] In this embodiment, translating and adjusting the Lagrange interpolation function range to make the center of the Lagrange interpolation function close to the abnormal point and determining the center of the Lagrange interpolation function is as follows: When the smooth data area of the data near the abnormal point is large and the Lagrange interpolation function range can be moved left and right, translate the Lagrange interpolation function range so that the point distance between the center point of the Lagrange interpolation function range and the abnormal point is the smallest, which is the optimal.

[0035] In this embodiment, as Figure 2 shown, one side of the abnormal point is the smooth data area and the other side is the non-smooth data area. At this time, determine the Lagrange interpolation function range and the center of the Lagrange interpolation function according to the smooth data area and the abnormal point.

[0036] Further, according to an embodiment of the present invention, calculating the Lagrange interpolation of the abnormal data position by using the original sampling data in the smooth data area within the Lagrange interpolation function range, and replacing the abnormal data in the extracted sampling data with the Lagrange interpolation to complete data repair, including: Set the original sampling sequence y0, y1, y2, y3, y4, …, y 2N The corresponding sequence numbers are x0, x1, x2, x3, x4, …, x 2N , extract the sampling sequence y0, y2, y4, …, y 2N The corresponding sequence numbers x0, x2, x4, …, x 2N ; The Lagrange interpolation polynomial of the abnormal point with sequence number x in the extracted sampling sequence is: , where i = 0, 1, 2, …, n; , where i = 0, 1, 2, …, n, i ≠ j; where x ∈ {x0, x2, x4, …, x 2N}; n is the order of the interpolation polynomial, and n = 4 can be taken; x i , x j is the range of the Lagrange interpolation function; Replace the abnormal data with sequence number x in the extracted sampling sequence with the calculated Lagrange interpolation Ln(x) to complete data repair, and the extracted sampling sequence after replacing the abnormal data is the final data repair result.

[0037] According to the above solution of the present invention, the present invention provides an abnormal data repair method based on scaled translation Lagrange interpolation. The present invention can obtain a more complete, smooth and accurate data set. The repaired data ensures the continuity and consistency of the data, eliminates mutations and noises in the data, improves the quality and stability of the data. The repaired data has high accuracy and can better reflect the characteristics and trends of the original data. The data repaired by interpolation can improve the accuracy and reliability of data analysis and applications, provide accurate data support for power grid monitoring, protection and planning decisions, and ensure the reliable operation of the power grid and the safety protection of equipment.

[0038] Furthermore, to achieve the above object, the present invention also provides an electronic device, including a processor, a memory, and a computer program stored on the memory and executable on the processor. When the computer program is executed by the processor, it implements the above-mentioned abnormal data repair method based on Lagrange interpolation.

[0039] Furthermore, to achieve the above object, the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by the processor, it implements the above-mentioned abnormal data repair method based on Lagrange interpolation.

[0040] To make the objectives, technical solutions and advantages of the present invention clearer and more understandable, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only the best embodiments of the present invention, which are only used to explain the present invention and do not limit the protection scope of the present invention. All other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0041] Embodiment 1

[0042] Figure 3 、 Figure 4 、 Figure 5 、 Figure 6 and Figure 7 is the data repair flow chart under the condition of bilateral data smoothing near the abnormal points (abnormal data) of Embodiment 1. Figure 3 is the original sampling data. The abnormal point detection and repair process includes the following specific steps: 1) The sampling frequency of the original sampling data is f. The original sampling data is uniformly downsampled at the sampling frequency fs = f / 2 to obtain Figure 4 the extracted sampling sequence shown; 2) Calculate the second-order difference sequence of the extracted sampling sequence, as shown in Figure 5 , and retrieve the position of the abnormal mutation point (abnormal point); 3) Calculate the first-order difference sequence of the extracted sequence, as shown in Figure 6 , and determine the smooth data interval and non-smooth data interval near the abnormal point; 4) According to the distribution of the smooth data interval, translate the range of the Lagrange interpolation function to adjust the center of the Lagrange interpolation function, so that the center of the Lagrange interpolation function is close to the abnormal point, as shown in the range of the Lagrange interpolation function in Figure 7 ; 5) Apply the sampling data in the data smoothing area to calculate the Lagrange interpolation of the abnormal point, and replace the abnormal data in the extracted sampling sequence with the calculated Lagrange interpolation to complete the data repair. The extracted sampling sequence after replacing the abnormal data is the final data repair result.

[0043] Those of ordinary skill in the art can realize that the modules and algorithm steps described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.

[0044] Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working processes of the devices and equipment described above can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.

[0045] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules is only a logical function division. In actual implementation, there may be other division methods. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the couplings or direct couplings or communication connections shown or discussed with each other can be through some interfaces. The indirect couplings or communication connections of the devices or modules can be in electrical, mechanical or other forms.

[0046] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they can be located in one place or distributed to multiple network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of the embodiments of the present invention.

[0047] In addition, in the embodiments of the present invention, each functional module can be integrated in a processing module, or each module can exist physically alone, or two or more modules can be integrated in one module.

[0048] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method for sending / receiving energy-saving signals in various embodiments of the present invention. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical discs that can store program codes.

[0049] The above description is only a preferred embodiment of the present application and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solutions formed by the specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the technical solutions formed by mutually replacing the above features with the technical features (but not limited to) having similar functions disclosed in the present application.

[0050] It should be understood that the magnitude of the sequence numbers of the steps in the inventive content and the embodiments of the present invention does not absolutely mean the order of execution. The order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.

Claims

1. An abnormal data repair method based on Lagrange interpolation, characterized in that, Including: Using uniform downsampling on the original sampled data to obtain decimated sampled data; Retrieving the positions of abnormal data in the decimated sampled data and calculating the smoothness of the data on both sides of the abnormal data; Determining the range of the Lagrange interpolation function and the center of the Lagrange interpolation function based on the position of the abnormal data and the smooth data on both sides that meet the smoothness; Calculating the Lagrange interpolation at the position of the abnormal data using the original sampled data in the smooth data region within the range of the Lagrange interpolation function, and replacing the abnormal data in the decimated sampled data with the Lagrange interpolation to complete data repair.

2. The abnormal data repair method based on Lagrange interpolation according to claim 1, wherein Using uniform downsampling on the original sampled data to obtain decimated sampled data is: The original sampling data is sampled at the sampling frequency f to obtain the original sampling sequence y0, y1, y2, y3, y4, …, y 2N , at the sampling frequency f s = f / 2, the original sampling sequence y0, y1, y2, y3, y4, …, y 2N is uniformly downsampled to obtain the decimated sampling sequence y0, y2, y4, …, y 2N .

3. The abnormal data repair method based on Lagrange interpolation according to claim 2, wherein The retrieving the positions of abnormal data in the decimated sampled data and calculating the smoothness of the data on both sides of the abnormal data is: Using the second-order difference method to retrieve the abnormal points in the decimated sampling sequence, and using the first-order difference method to calculate the smoothness of the data on both sides of the abnormal points.

4. The abnormal data repair method based on Lagrange interpolation according to claim 3, characterized in that, Calculate the first-order difference sequence and the second-order difference sequence of the extraction sampling sequence y0, y2, y4, …, y 2N ; where the first-order difference sequence Δy n = y 2(n+1) - y 2n (n = 0, 1, …, N - 1); Second-order difference sequence Δ 2 y n = Δy (n+1) - Δy n (n = 0, 1, …, N - 2); The judgment formula for abnormal points is: , where k e is the abnormal detection coefficient, which can take 0.02, I rms is the effective value of the extracted sampling sequence; The judgment formula for the smoothness of data on both sides of the abnormal point is: , where k s is the smoothness detection coefficient, and 0.018 can be taken. I rms is the effective value of the extracted sampling sequence.

5. The abnormal data repair method based on Lagrange interpolation according to claim 4, characterized in that The determining the range of the Lagrange interpolation function and the center of the Lagrange interpolation function based on the position of the abnormal data and the smooth data on both sides that meet the smoothness includes: Determining the smooth data region and the non-smooth data region on both sides of the abnormal point; Determining the range of the Lagrange interpolation function according to the smooth data region; Translating and adjusting the range of the Lagrange interpolation function to make the center of the Lagrange interpolation function close to the abnormal point, and determining the center of the Lagrange interpolation function.

6. The abnormal data repair method based on Lagrange interpolation according to claim 5, wherein Calculating the Lagrange interpolation at the position of the abnormal data using the original sampled data in the smooth data region within the range of the Lagrange interpolation function, and replacing the abnormal data in the decimated sampled data with the Lagrange interpolation to complete data repair includes: Set the original sampling sequence y0, y1, y2, y3, y4, …, y 2N The corresponding sequence numbers are x0, x1, x2, x3, x4, …, x 2N , extract the sampling sequence y0, y2, y4, …, y 2N The corresponding sequence numbers x0, x2, x4, …, x 2N ; The Lagrange interpolation polynomial of the abnormal point with sequence number x in the decimated sampling sequence is: , where i = 0, 1, 2, …, n; , where i = 0, 1, 2, …, n, i ≠ j; where x ∈ {x0, x2, x4, …, x 2N}; n is the order of the interpolation polynomial, and n = 4 can be taken; x i , x j is the range of the Lagrange interpolation function; Use the calculated Lagrange interpolation L n (x) to replace the abnormal data with the serial number x in the extracted sampling sequence to complete data repair. The extracted sampling sequence after replacing the abnormal data is the final data repair result.

7. An abnormal data repair system based on Lagrange interpolation, characterized in that, Including: A decimated sampled data acquisition module that uses uniform downsampling on the original sampled data to obtain decimated sampled data; An abnormal data and smoothness confirmation module that retrieves the positions of abnormal data in the decimated sampled data and calculates the smoothness of the data on both sides of the abnormal data; A Lagrange interpolation function range and center determination module that determines the range of the Lagrange interpolation function and the center of the Lagrange interpolation function based on the position of the abnormal data and the smooth data on both sides that meet the smoothness; A data repair module that calculates the Lagrange interpolation at the position of the abnormal data using the original sampled data in the smooth data region within the range of the Lagrange interpolation function, and replaces the abnormal data in the decimated sampled data with the Lagrange interpolation to complete data repair.

8. An electronic device, characterized in that, Including a processor, a memory, and a computer program stored on the memory and executable on the processor. When the computer program is executed by the processor, it implements the abnormal data repair method based on Lagrange interpolation as described in any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium. When the computer program is executed by the processor, it implements the abnormal data repair method based on Lagrange interpolation as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Sampled data abnormal value repairing method and device

    CN112000519A

  • Daily electric quantity abnormal value detection and correction system based on first-order difference and ARIMA method

    CN115081840A

  • Abnormal traffic detection method and device, server and storage medium

    CN117220960A