Data outlier detection method and storage medium

By introducing the concepts of core objects and core local anomaly factors, the LOF algorithm is improved, solving the problems of high time overhead and error in data outlier detection, and achieving more efficient and accurate outlier detection.

CN116150630BActive Publication Date: 2026-04-14NANJING UNIV OF POSTS & TELECOMM
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NANJING UNIV OF POSTS & TELECOMM
Filing Date
2022-12-30
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing LOF algorithms suffer from high time overhead and result errors in outlier detection, especially when the parameter k is not chosen properly, which can easily misclassify a large number of inliers as outliers or misclassify some outliers as inliers.

Method used

The concept of core objects, core reachability distance, and core local anomaly factor is introduced. By constructing a core object set, the core neighborhood, reachability distance, and local density of sample points are calculated. Finally, outlier values ​​are output according to the core local anomaly factor.

Benefits of technology

It improves the accuracy and speed of outlier detection, avoids the complexity of calculating local outlier factors for all sample points, reduces computation time and lowers errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116150630B_ABST
    Figure CN116150630B_ABST
Patent Text Reader

Abstract

The application discloses a data outlier detection method and a storage medium. The object radius epsilon and the minimum point value MinPts are determined. All core objects are obtained by screening according to the object radius epsilon and the minimum point value MinPts. The core object set is obtained by grouping all the core objects. The distance between the sample point and each core object in the core object set is obtained. The distances between the sample point and each core object in the core object set are sorted in ascending order, and the core objects corresponding to the first K distances are selected as the Kth core neighborhood. The Kth core reachable distance of the sample point in the Kth core neighborhood is calculated according to the reachable distance of the Kth core neighborhood. The core local reachable density of the sample point is calculated based on the Kth core reachable distance of the sample point in the Kth core neighborhood. The core local anomaly factor of the sample point is calculated based on the core local reachable density of the sample point. The core local anomaly factor is sorted, and the sample point meeting the set condition is taken as an outlier.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a method and storage medium for detecting outliers in data, belonging to the field of data preprocessing technology. Background Technology

[0002] In machine learning, anomaly detection and handling is a relatively small branch, a byproduct of machine learning. In general prediction problems, the model is usually a way of representing the overall sample data structure. This representation typically captures the general properties of the overall sample, while points that behave completely differently from the overall sample in these properties are called outliers. Outliers are generally unwelcome in prediction problems because prediction problems usually focus on the properties of the overall sample, while the generation mechanism of outliers is completely inconsistent with the overall sample. If the algorithm is sensitive to outliers, the generated model will not be able to represent the overall sample well, and the prediction will be inaccurate.

[0003] The main solutions to outlier detection can be categorized into the following types: statistical methods, proximity-based outlier detection, density-based outlier detection, and clustering-based outlier detection. Statistical methods are model-based, meaning they create a model for the data and evaluate the data based on how well the objects fit the model. Most statistical methods for outlier detection construct a probability distribution model and consider how likely an object is to conform to that model. Proximity-based outlier detection calculates the distance of each point to its surrounding points to determine if a point is outlier. If a data point is outlier, it must be far from most other data points. This method is more general and easier to use than statistical methods because determining a meaningful proximity metric for a dataset is easier than determining its statistical distribution. Density-based outlier detection is often problematic because most clustering algorithms are based on the distribution of data features. Often, if after clustering, some clusters have significantly fewer data samples than others, and the features such as the mean distribution of the data in these clusters differ greatly from other clusters, the data points in these clusters are likely outliers.

[0004] Existing density-based outlier detection algorithms (LOF) identify outliers by calculating the outlier degree of each sample point in the dataset. The parameter k determines the number of points that may be influenced by the input sample points, and it has a significant impact on the results. When the parameter k is not chosen correctly, the algorithm may treat a large number of inliers as outliers or treat some outliers as inliers, resulting in a large error. In addition, the LOF algorithm needs to calculate the pairwise distances between sample points, resulting in a time complexity of O(n^2). 2 ).

[0005] Patent No. CN 107562778 A, entitled "An Outlier Mining Method Based on Deviation Features," discloses an improved LOF outlier detection algorithm. This patent uses the F_LOF detection algorithm to divide the data space into a grid when detecting outliers in a dataset, and calculates the local outlier factor of sample points based on the centroids of the grid. Although this patent modifies the LOF algorithm, it still requires significant time overhead. Summary of the Invention

[0006] The technical problem to be solved by this invention is to overcome the defects of the prior art and provide a data outlier detection method. It introduces concepts such as core object, core reachability distance and core local anomaly factor, improves the LOF algorithm, and improves the detection accuracy and speed of the algorithm. It is of great significance for improving the accuracy and speed of data outlier detection.

[0007] To achieve the above objectives, the present invention provides a method for detecting outliers in data, comprising:

[0008] Step 1: Construct a dataset using the collected sample points;

[0009] Step 2: Determine the object radius ε and the minimum point value MinPts;

[0010] Step 3: Filter and obtain all core objects based on the object radius ε and the minimum point value MinPts;

[0011] Combine all the core objects into a collection to obtain the core object set;

[0012] Step 4: Obtain the distance between the sample points and each core object in the core object set;

[0013] Sort the sample points in ascending order of their distances to each core object in the core object set, and select the core objects corresponding to the top K distances as the Kth core neighborhood.

[0014] Step 5: Calculate the Kth core reachability distance of the sample point in the Kth core neighborhood based on the reachability distance of the Kth core neighborhood;

[0015] Based on the Kth core reachability distance of the sample point in the Kth core neighborhood, the core local reachability density of the sample point is calculated.

[0016] The core local reachability density of sample points is used to calculate the core local anomaly factor of sample points.

[0017] Step 6: Sort the core local anomaly factors and identify the sample points that meet the set conditions as outliers.

[0018] Prioritize step 2, which is achieved through the following steps:

[0019] Calculate the average distance between each sample point and its neighbors;

[0020] Based on the average distance, construct a graph showing the relationship between the average distance and the sample points;

[0021] In the graph showing the relationship between average distance and sample points, the average distance is plotted on the y-axis, and all sample points are plotted on the x-axis.

[0022] The average distance with a slope greater than a set threshold in the curve relating average distance and sample points is used as the object radius ε.

[0023] Multiply the number of dimensions of the dataset by a set constant to obtain the minimum point value MinPts.

[0024] Prioritize, step 3: Based on the object radius ε and the minimum point value MinPts, filter to obtain all core objects, which is achieved through the following steps:

[0025] If the number of sample points within the object radius ε of a sample point is greater than or equal to the minimum point value MinPts, then the sample point is determined to be a core object.

[0026] Prioritize step 5, which calculates the Kth core reachability distance of a sample point in the Kth core neighborhood based on the Kth core reachability distance, through the following steps:

[0027] Calculate the Kth core reachable distance of each sample point in the Kth core neighborhood:

[0028] core_reach_d k (O,P)=max(core_d k (O),d(O,P)),

[0029] core_reach_d k (O,P) represents the Kth core reachable distance from sample point O to sample point P, where core_d k (O) is the Kth core distance of sample point O, and d(O,P) is the distance from sample point O to sample point P.

[0030] First, compute the core local reachability density core_lrd at each point. k (P):

[0031]

[0032] In the formula, core_N k (P) represents the Kth core neighborhood of sample point P, |core_N k (P)| represents the number of core objects within the Kth core neighborhood of sample point P, and core_reach_dk (O,P) represents the Kth core reachable distance from sample point O to sample point P.

[0033] First, calculate the core local anomaly factor core_lof for each point. k (P):

[0034]

[0035] In the formula, core_N k (P) represents the Kth core neighborhood of sample point P, |core_N k (P)| represents the number of core objects within the Kth core neighborhood of sample point P, where core_lrd k (O) represents the Kth core local reachability density of sample point O, core_lrd k (P) represents the local reachability density of the Kth core of sample point P.

[0036] A data outlier detection system, comprising:

[0037] The data acquisition module is used to construct a dataset using the collected sample points;

[0038] The data calculation module is used to determine the object radius ε and the minimum point value MinPts;

[0039] Used to filter and obtain all core objects based on the object radius ε and the minimum point value MinPts;

[0040] Combine all the core objects into a collection to obtain the core object set;

[0041] Obtain the distance between the sample point and each core object in the core object set;

[0042] The data processing module is used to sort the distances between the sample points and each core object in the core object set in ascending order, and select the core objects corresponding to the first K distances as the Kth core neighborhood.

[0043] Based on the reachability distance of the Kth core neighborhood, the reachability distance of the sample point in the Kth core neighborhood is calculated.

[0044] Based on the Kth core reachability distance of the sample point in the Kth core neighborhood, the core local reachability density of the sample point is calculated.

[0045] The core local reachability density of sample points is used to calculate the core local anomaly factor of sample points.

[0046] The data output module is used to sort the core local anomaly factors and identify sample points that meet the set conditions as outliers.

[0047] An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of any of the methods described above.

[0048] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the methods described above.

[0049] The beneficial effects achieved by this invention are as follows:

[0050] To address the issues of high time consumption and error in outlier detection using the LOF algorithm, an improved LOF outlier detection method is proposed. This method introduces concepts such as core objects, core reachability distance, and core local anomaly factors. First, the set of core objects is calculated. Then, the K-th core neighborhood of each point is calculated, and the core reachability distance, core local reachability density, and core local factor are calculated for each point. Finally, the outliers are sorted according to their core local anomaly factors, and the outlier set is output. This invention avoids the complex method of calculating local anomaly factors for all sample points used in existing technologies, thus shortening the computation time and avoiding errors caused by improper selection of K. Attached Figure Description

[0051] Figure 1 This is a flowchart of the present invention;

[0052] Figure 2 This is a flowchart of the system of the present invention. Detailed Implementation

[0053] The following embodiments are only used to illustrate the technical solutions of the present invention more clearly, and should not be used to limit the scope of protection of the present invention.

[0054] Example 1

[0055] 1. The E-neighborhood refers to the region within a radius ε of a given object, which is called the E-neighborhood of that object;

[0056] 2. A core object (core point) is defined as an object whose number of sample points in its E neighborhood is greater than or equal to MinPts.

[0057] 3. The point-to-point distance d(P,O) refers to the distance from sample point P to sample point O;

[0058] 4. Kth core distance: The Kth core distance core_d of sample point P k (P) = d(P,O), satisfying:

[0059] There are at least K points O' in the set, excluding P, such that d(P,O')≤d(P,O), and at most K-1 points O' in the set, excluding P, such that d(P,O')<d(P,O). In simple terms, it means radiating outward from P as the center until the Kth core object is covered.

[0060] 5. The Kth core neighborhood refers to the Kth core distance neighborhood core_N of sample point P. k (P) refers to the set of all core objects within the Kth core distance of point P, including core objects at the Kth core distance. Therefore, we can obtain |core_N k (P)|≥K.

[0061] 6. The Kth core reachable distance refers to the Kth core reachable distance from sample point O to sample point P, which is core_reach_d. k (O,P)=max(core_d k (O),d(O,P)) is defined as the larger of the Kth core distance of point O and the distance from point O to point P.

[0062] 7. Core local reachability density refers to the Kth core local reachability density core_lrd of sample point P. k (P) represents the reciprocal of the average distance from the Kth core of point P to the Kth core of point P from all points in its neighborhood. It characterizes the density of point P; the higher the density of point P and its surrounding points, the higher the core_lrd. k The larger the (P) value, the lower the density of point P with its surrounding points, and the higher the core_lrd value. k The smaller the (P) value, the more important it is to add 1 to the average reachable distance of the Kth core in formula (1). This is because if there are more than or equal to K repeated core points, the average reachable distance of these points will be zero, and the local reachable density will become infinite, which will cause some trouble for the calculation.

[0063]

[0064] 8. Core Local Loop Factor: core_lof k (P) is defined using the core local relative density. The core local relative density of a sample point P is the ratio of the average core local reachability density of points within the core neighborhood of point P to the core local reachability density of the sample point P. core_lof k The larger the (P) value, the higher the probability of outliers.

[0065]

[0066] This invention provides a method for detecting outliers in data, comprising:

[0067] Step 1: Construct a dataset using the collected sample points;

[0068] The sample points include real-time data collected by relevant equipment on building lighting systems, power equipment systems, and low-voltage systems, such as electricity consumption, voltage, current, and power.

[0069] Step 2: Determine the object radius ε and the minimum point value MinPts;

[0070] Step 3: Filter and obtain all core objects based on the object radius ε and the minimum point value MinPts;

[0071] Combine all the core objects into a collection to obtain the core object set;

[0072] Step 4: Obtain the distance between the sample points and each core object in the core object set;

[0073] Sort the sample points in ascending order of their distances to each core object in the core object set, and select the core objects corresponding to the top K distances as the Kth core neighborhood.

[0074] Step 5: Calculate the Kth core reachability distance of the sample point in the Kth core neighborhood based on the reachability distance of the Kth core neighborhood;

[0075] Based on the Kth core reachability distance of the sample point in the Kth core neighborhood, the core local reachability density of the sample point is calculated.

[0076] The core local reachability density of sample points is used to calculate the core local anomaly factor of sample points.

[0077] Step 6: Sort the core local anomaly factors and take the sample points that meet the set conditions as outliers. In this embodiment, the sample point to which the largest core local anomaly factor belongs is taken as an outlier.

[0078] Prioritize step 2, which is achieved through the following steps:

[0079] Calculate the average distance between each sample point and its neighbors;

[0080] Based on the average distance, construct a graph showing the relationship between the average distance and the sample points;

[0081] In the graph showing the relationship between average distance and sample points, the average distance is plotted on the y-axis, and all sample points are plotted on the x-axis.

[0082] The average distance with a slope greater than a set threshold in the curve relating average distance and sample points is used as the object radius ε.

[0083] Multiply the number of dimensions of the dataset by a set constant to obtain the minimum point value MinPts.

[0084] Prioritize, step 3: Based on the object radius ε and the minimum point value MinPts, filter to obtain all core objects, which is achieved through the following steps:

[0085] If the number of sample points within the object radius ε of a sample point is greater than or equal to the minimum point value MinPts, then the sample point is determined to be a core object.

[0086] Prioritize step 5, which calculates the Kth core reachability distance of a sample point in the Kth core neighborhood based on the Kth core reachability distance, through the following steps:

[0087] Calculate the Kth core reachable distance of each sample point in the Kth core neighborhood:

[0088] core_reach_d k (O,P)=max(core_d k (O),d(O,P)),

[0089] core_reach_d k (O,P) represents the Kth core reachable distance from sample point O to sample point P, where core_d k (O) is the Kth core distance of sample point O, and d(O,P) is the distance from sample point O to sample point P.

[0090] First, compute the core local reachability density core_lrd at each point. k (P):

[0091]

[0092] In the formula, core_N k (P) represents the Kth core neighborhood of sample point P, |core_N k (P)| represents the number of core objects within the Kth core neighborhood of sample point P, and core_reach_d k (O,P) represents the Kth core reachable distance from sample point O to sample point P.

[0093] First, calculate the core local anomaly factor core_lof for each point. k (P):

[0094]

[0095] In the formula, core_N k (P) represents the Kth core neighborhood of sample point P, |core_N k(P)| represents the number of core objects within the Kth core neighborhood of sample point P, where core_lrd k (O) represents the Kth core local reachability density of sample point O, core_lrd k (P) represents the local reachability density of the Kth core of sample point P.

[0096] A data outlier detection system, comprising:

[0097] The data acquisition module is used to construct a dataset using the collected sample points;

[0098] The data calculation module is used to determine the object radius ε and the minimum point value MinPts;

[0099] Used to filter and obtain all core objects based on the object radius ε and the minimum point value MinPts;

[0100] Combine all the core objects into a collection to obtain the core object set;

[0101] Obtain the distance between the sample point and each core object in the core object set;

[0102] The data processing module is used to sort the distances between the sample points and each core object in the core object set in ascending order, and select the core objects corresponding to the first K distances as the Kth core neighborhood.

[0103] Based on the reachability distance of the Kth core neighborhood, the reachability distance of the sample point in the Kth core neighborhood is calculated.

[0104] Based on the Kth core reachability distance of the sample point in the Kth core neighborhood, the core local reachability density of the sample point is calculated.

[0105] The core local reachability density of sample points is used to calculate the core local anomaly factor of sample points.

[0106] The data output module is used to sort the core local anomaly factors and identify sample points that meet the set conditions as outliers.

[0107] An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of any of the methods described above.

[0108] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the methods described above.

[0109] This invention proposes a data outlier detection method. The method introduces concepts such as core objects, core reachability distance, and core local anomaly factors. First, it obtains the set of core objects. Then, it calculates the Kth core neighborhood of each point, and calculates the core reachability distance, core local reachability density, and core local factor for each point. Finally, it sorts the outliers according to their core local anomaly factors and outputs the set of outliers. This method avoids calculating the local anomaly factors of all sample points, shortening the computation time, and also avoids errors caused by improper selection of K.

[0110] Example 2

[0111] Step 1: Obtain data and build a dataset.

[0112] Step 2: Determine if there are any missing values ​​in the obtained data. If they are, proceed to Step 3; otherwise, proceed to Step 5.

[0113] Step 3: Determine if the number of missing data is greater than 10% of the total sample size. If yes, proceed to step 4. If not, delete the missing data and then proceed to step 5.

[0114] Step 4: Fill in the missing data with the average value of the data to obtain the complete data.

[0115] Step 5: Determine the object radius ε and the minimum point value MinPts:

[0116] First, the average distance between each sample point and its neighbors is calculated, and the points are sorted according to the magnitude of the average distance to obtain a graph showing the relationship between the average distance and the sample points. In this graph, the average distance is plotted on the y-axis, and all sample points are plotted on the x-axis. The average distance at the "elbow" of the graph (i.e., the point where the trend of the average distance changes significantly) is selected as the object radius ε.

[0117] Multiply the number of dimensions of the dataset by 2 to get the minimum point value MinPts.

[0118] Step 6: Filter and obtain all core objects based on the object radius ε and the minimum point value MinPts;

[0119] All core objects are grouped into a collection (i.e., a core object set);

[0120] Step 7: Calculate the distance between the sample point and each core object in the core object set;

[0121] Sort the sample points in ascending order of their distances to each core object in the core object set, and select the core objects corresponding to the top K distances as the Kth core neighborhood.

[0122] Step 8: According to the definition of the Kth core reachability distance, calculate the Kth core reachability distance of each sample point in the Kth core neighborhood, then calculate the core local reachability density of each point using formula (1), and finally calculate the core local anomaly factor of each point using formula (2).

[0123] Step 9: Sort the core local anomaly factors and take the sample point to which the largest core local anomaly factor belongs as the outlier.

[0124] This concludes the outlier detection process.

[0125] Example 3

[0126] Step 1: Obtain data and build a dataset.

[0127] Step 2: Check if there are any inconsistencies in standards or naming conventions in the data. If so, proceed to Step 3; otherwise, proceed to Step 4.

[0128] Step 3: Standardize the data. Here, we'll use subtraction to standardize the data, subtracting each original data point sequentially from an upper bound within the allowed range of the indicator.

[0129] Step 4: Determine the object radius ε and the minimum point value MinPts:

[0130] First, the average distance between each sample point and its neighbors is calculated, and the points are sorted according to the magnitude of the average distance to obtain a graph showing the relationship between the average distance and the sample points. In this graph, the average distance is plotted on the y-axis, and all sample points are plotted on the x-axis. The average distance at the "elbow" of the graph (i.e., the point where the trend of the average distance changes significantly) is selected as the object radius ε.

[0131] Multiply the number of dimensions of the dataset by 2 to get the minimum point value MinPts.

[0132] Step 5: Filter and obtain all core objects based on the object radius ε and the minimum point value MinPts;

[0133] All core objects are grouped into a collection (i.e., a core object set);

[0134] Step 6: Calculate the distance between the sample point and each core object in the core object set;

[0135] Sort the sample points in ascending order of their distances to each core object in the core object set, and select the core objects corresponding to the top K distances as the Kth core neighborhood.

[0136] Step 7: According to the definition of the Kth core reachability distance, calculate the Kth core reachability distance of each sample point in the Kth core neighborhood, then calculate the core local reachability density of each point using formula (1), and finally calculate the core local anomaly factor of each point using formula (2).

[0137] Step 8: Sort the core local anomaly factors and take the sample point to which the largest core local anomaly factor belongs as the outlier.

[0138] This concludes the outlier detection process.

[0139] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0140] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0141] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

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

Claims

1. A method for detecting outliers in data, characterized in that, include: Step 1: Construct a dataset using the collected sample points; The sample points include the electricity consumption, voltage, current, and power of the building's lighting system, power equipment system, and low-voltage system, collected in real time by the equipment. Step 2: Determine the object radius ε and the minimum point value MinPts; Step 3: Filter and obtain all core objects based on the object radius ε and the minimum point value MinPts; Combine all the core objects into a collection to obtain the core object set; Step 4: Obtain the distance between the sample points and each core object in the core object set; Sort the sample points in ascending order of their distances to each core object in the core object set, and select the core objects corresponding to the top K distances as the Kth core neighborhood. Step 5: Calculate the Kth core reachability distance of the sample point in the Kth core neighborhood based on the reachability distance of the Kth core neighborhood; Based on the Kth core reachability distance of the sample point in the Kth core neighborhood, the core local reachability density of the sample point is calculated. Based on the core local reachability density of sample points, calculate the core local anomaly factor of sample points; Step 6: Sort the core local anomaly factors and identify the sample points that meet the set conditions as outliers. Step 2 is achieved through the following steps: Calculate the average distance between each sample point and its neighbors; Based on the average distance, construct a graph showing the relationship between the average distance and the sample points; In the graph showing the relationship between average distance and sample points, the average distance is plotted on the y-axis, and all sample points are plotted on the x-axis. The average distance with a slope greater than a set threshold in the curve relating average distance and sample points is used as the object radius ε. Multiply the number of dimensions of the dataset by a set constant to obtain the minimum point value MinPts; Step 3: Based on the object radius ε and the minimum point value MinPts, filter to obtain all core objects, which is achieved through the following steps: If the number of sample points within the object radius ε of a sample point is greater than or equal to the minimum point value MinPts, then the sample point is determined to be a core object.

2. The data outlier detection method according to claim 1, characterized in that, Step 5: Calculate the Kth core reachability distance of the sample point in the Kth core neighborhood based on the reachability distance of the Kth core neighborhood. This is achieved through the following steps: Calculate the Kth core reachable distance of each sample point in the Kth core neighborhood: core_reach_d k (O,P)=max(core_d k (O), d(O,P) ), core_reach_d k (O,P) represents the Kth core reachable distance from sample point O to sample point P, where core_d k (O) is the Kth core distance of sample point O, and d(O,P) is the distance from sample point O to sample point P.

3. The data outlier detection method according to claim 1, characterized in that, Calculate the core local reachability density at each point : , In the formula, core_N k (P) represents the Kth core neighborhood of sample point P. Let core_reach_d be the number of core objects within the Kth core neighborhood of sample point P. k (O,P) represents the Kth core reachable distance from sample point O to sample point P.

4. The data outlier detection method according to claim 1, characterized in that, Calculate the core local anomaly factor at each point : , In the formula, core_N k (P) represents the Kth core neighborhood of sample point P. Let core_lrd be the number of core objects in the Kth core neighborhood of sample point P. k (O) represents the Kth core local reachability density of sample point O, core_lrd k (P) represents the local reachability density of the Kth core of sample point P.

5. A data outlier detection system, characterized in that, include: The data acquisition module is used to construct a dataset using the collected sample points; The sample points include the electricity consumption, voltage, current, and power of the building's lighting system, power equipment system, and low-voltage system, collected in real time by the equipment. The data calculation module is used to determine the object radius ε and the minimum point value MinPts; Used to filter and obtain all core objects based on the object radius ε and the minimum point value MinPts; Combine all the core objects into a collection to obtain the core object set; Obtain the distance between the sample point and each core object in the core object set; The data processing module is used to sort the distances between the sample points and each core object in the core object set in ascending order, and select the core objects corresponding to the first K distances as the Kth core neighborhood. Based on the reachability distance of the Kth core neighborhood, the reachability distance of the sample point in the Kth core neighborhood is calculated. Based on the Kth core reachability distance of the sample point in the Kth core neighborhood, the core local reachability density of the sample point is calculated. Based on the core local reachability density of sample points, calculate the core local anomaly factor of sample points; The data output module is used to sort the core local anomaly factors and identify sample points that meet the set conditions as outliers. The object radius ε and the minimum point value MinPts are determined through the following steps: Calculate the average distance between each sample point and its neighbors; Based on the average distance, construct a graph showing the relationship between the average distance and the sample points; In the graph showing the relationship between average distance and sample points, the average distance is plotted on the y-axis, and all sample points are plotted on the x-axis. The average distance with a slope greater than a set threshold in the curve relating average distance and sample points is used as the object radius ε. Multiply the number of dimensions of the dataset by a set constant to obtain the minimum point value MinPts; Based on the object radius ε and the minimum point value MinPts, all core objects are filtered out through the following steps: If the number of sample points within the object radius ε of a sample point is greater than or equal to the minimum point value MinPts, then the sample point is determined to be a core object.

6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the method according to any one of claims 1 to 4.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the steps of the method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Deviation feature-based outlier mining method

    CN107562778A

  • Abnormal electric quantity data identification method based on limit value learning

    CN111401460A