A smart community data analysis method and system based on big data

By combining the change significance and distribution difference of clusters in each dimension to calculate distribution characteristic values ​​and divide large clusters and small clusters, the problem of insufficient accuracy of the CBLOF algorithm in anomaly detection is solved and the identification ability of abnormal data points is improved.

CN118378193BActive Publication Date: 2024-08-27SHANDONG ZHENGTU INFORMATION POLYTRON TECH INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410796180.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-20
Publication Date
2024-08-27
Estimated Expiration
2044-06-20

AI Technical Summary

Technical Problem

The CBLOF algorithm only considers the size of the cluster in anomaly detection and ignores the distribution characteristics of different clusters, resulting in limited accuracy and discrimination ability of anomaly detection.

Method used

By combining the significance of changes in the cluster in each dimension and the distribution difference between the cluster and its neighboring clusters in each dimension, the distribution characteristic value of the cluster is calculated, and large clusters and small clusters are divided to more accurately identify clusters that may contain abnormal data points.

Benefits of technology

Improves the accuracy of anomaly detection and enhances the ability to identify abnormal data points.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118378193B
    Figure CN118378193B
Patent Text Reader

Abstract

The present invention belongs to the field of data analysis technology, and specifically relates to a smart community data analysis method and system based on big data, the method comprising: performing anomaly detection on data points through a CBLOF algorithm to obtain all abnormal data points, the process comprising: calculating the significance of changes in each cluster in each dimension according to the data distribution range of all data points contained in each cluster in each dimension, calculating the degree of distribution difference between each cluster and its neighboring clusters in each dimension according to the difference in data distribution of all data points contained in each cluster and its neighboring clusters in each dimension, weighting the degree of distribution difference between each cluster and its neighboring clusters in each dimension according to the significance of changes in each cluster and its neighboring clusters in each dimension, obtaining the distribution characteristic value of each cluster in each dimension, and dividing all clusters into large clusters and small clusters according to the size of the cluster and the distribution characteristic value of the cluster in each dimension. The present invention improves the accuracy of anomaly detection of smart community data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data analysis technology. More specifically, the present invention relates to a smart community data analysis method and system based on big data. Background Art

[0002] Smart communities are an important part of smart city construction. Smart communities integrate various sensing devices and data technologies, generating massive amounts of data, including resident data, property management data, security monitoring data, environmental data, traffic data, etc. By analyzing these data, we can gain an in-depth understanding of the community's operating conditions, provide a scientific basis for community managers, optimize community resource allocation, and improve community governance efficiency and quality.

[0003] Among the related technologies, for example, the patent document with authorization announcement number CN113010578B discloses a community data analysis method, device, community intelligent interaction platform and storage medium. By conducting sequence analysis on the activities of residents in each community, the basic behavior patterns of residents in different communities are obtained. Based on the personal information data of residents, the socio-economic attributes of residents associated with various behavior patterns are mined. This helps to improve the quality and efficiency of grassroots community governance, clarify the smart methods and coordination mechanisms of community governance, and promote the construction and improvement of a community co-construction, co-governance and sharing system.

[0004] When analyzing and mining data, it is necessary to detect anomalies in the data, because the anomalies in the data are often an important basis for tracing the root cause of the problem and finding corresponding repair measures; the CBLOF (Cluster-based Local Outlier Factor) algorithm is an anomaly detection algorithm based on clustering results. Due to its low computational complexity, it is often used for massive data. However, the algorithm only considers the size of the cluster and ignores the distribution characteristics of different clusters, which affects the accuracy of anomaly detection and has limited ability to distinguish abnormal data. Summary of the invention

[0005] In order to solve the technical problem that the above CBLOF algorithm only considers the size of the cluster but ignores the distribution characteristics of different clusters, which affects the accuracy of anomaly detection and has limited ability to distinguish abnormal data, the present invention provides solutions in the following aspects.

[0006] In a first aspect, the present invention provides a data analysis method for a smart community based on big data, comprising: using sensing devices to collect data points of a smart community at every moment, wherein the data points contain multiple dimensions; performing anomaly detection on the data points to obtain all abnormal data points; in the process of anomaly detection, specific steps of dividing large clusters and small clusters include: screening the clusters to be determined according to the size of the clusters; in response to the distribution characteristic values ​​of the clusters to be determined in each dimension being not greater than a preset first threshold value, and the target quantity being not greater than a first value, marking the clusters to be determined as large clusters, otherwise, marking the clusters to be determined as small clusters; the first value is equal to the ratio of the quantity of all dimensions to a preset second value. The target number is the number of dimensions whose distribution characteristic values ​​are greater than a second preset threshold value; the method for obtaining the distribution characteristic values ​​comprises: calculating the change significance of each cluster in each dimension according to the data distribution range of all data points contained in each cluster in each dimension, wherein the change significance is positively correlated with the data distribution range; calculating the distribution difference degree between each cluster and its neighboring clusters in each dimension according to the difference in data distribution of all data points contained in each cluster and its neighboring clusters in each dimension; and weighting the distribution difference degree between each cluster and its neighboring clusters in each dimension according to the change significance of each cluster and its neighboring clusters in each dimension to obtain the distribution characteristic value of each cluster in each dimension.

[0007] By combining the significance of changes in each cluster in each dimension and the degree of distribution difference between each cluster and its neighboring clusters in each dimension, the distribution characteristic values ​​of each cluster in each dimension are obtained. The size of the cluster and the distribution characteristic values ​​of the cluster in each dimension can fully reflect the differences between clusters. Then, the size of the cluster and the distribution characteristic values ​​of the cluster in each dimension are combined to divide large clusters and small clusters, which can more accurately identify clusters that may contain abnormal data points, thereby improving the accuracy of anomaly detection.

[0008] In one embodiment, the method of selecting the clusters to be determined according to the size of the clusters includes: sorting the clusters from large to small according to the size of the clusters; obtaining the first B3 clusters after sorting, requiring that the ratio of the cumulative value of the size of the first B3-1 clusters to the number of all data points is less than a parameter , and the ratio of the cumulative size of the first B1 clusters to the number of all data points is not less than the parameter ; The remaining clusters except the first B3 clusters are recorded as small clusters; the first B4 clusters are obtained from the first B3 clusters, and the ratio of the cumulative value of the size of the first B4-1 clusters to the cumulative value of the size of the first B3 clusters is required to be less than the parameter , and the ratio of the cumulative value of the sizes of the first B4 clusters to the cumulative value of the sizes of the first B3 clusters is not less than the parameter ; The first B4 clusters are regarded as large clusters, and the B4+1th to B3th clusters are regarded as clusters to be determined.

[0009] According to the cluster size and two preset parameters, all clusters are divided into large clusters, small clusters and clusters to be determined. By making a more detailed division, the accuracy of identifying clusters that may contain abnormal data points is improved.

[0010] In one embodiment, the distribution characteristic values ​​of each cluster in each dimension satisfy the expression: ; In the formula, represents the distribution characteristic value of the c1th cluster in the dth dimension, represents the distribution difference between the c1th cluster and the c2th cluster in the dth dimension, where the c2th cluster is the neighboring cluster of the c1th cluster. Indicates the significance of the change of the c1th cluster in the dth dimension, It represents the significance of the change of the c2th cluster in the dth dimension, and exp() represents an exponential function with a natural constant as the base.

[0011] By combining the significance of changes in each cluster in each dimension and the degree of distribution difference between each cluster and its neighboring clusters in each dimension, the distribution characteristic value of each cluster in each dimension is obtained, which can more accurately reflect the degree of abnormality of each cluster in distribution, thereby improving the accuracy of identifying clusters that may contain abnormal data points.

[0012] In one embodiment, the change significance of each cluster in each dimension satisfies the expression: ; In the formula, , They represent the 10th and 90th percentiles of all data points contained in the c1th cluster in the data of the dth dimension, respectively. , They represent the first quartile and the third quartile of all data points contained in the c1th cluster in all data of the dth dimension, respectively. , Represent the first weight and the second weight respectively.

[0013] In one embodiment, the change significance of each cluster in each dimension satisfies the expression: ; In the formula, , They represent the maximum and minimum values ​​of all data points contained in the c1th cluster in the data of the dth dimension respectively.

[0014] By analyzing the distribution of the data contained in each cluster, the distribution characteristic values ​​of each cluster in each dimension are determined, and then the large clusters and small clusters are distinguished based on the significance of the changes in each cluster in each dimension, thereby improving the accuracy of identifying clusters that may contain abnormal data points.

[0015] In one embodiment, the distribution difference between each cluster and its neighboring clusters in each dimension satisfies the expression: ; In the formula, Indicates the number of types of data in the dth dimension, The data of all data points contained in the c1th cluster in the dth dimension are The frequency, The data of all data points contained in the c2th cluster in the dth dimension are frequency.

[0016] In one embodiment, the distribution difference between each cluster and its neighboring clusters in each dimension satisfies the expression: ; In the formula, Indicates the number of types of data in the dth dimension, The data of all data points contained in the c1th cluster in the dth dimension are The frequency, The data of all data points contained in the c2th cluster in the dth dimension are The frequency, Represents the base 10 logarithmic function.

[0017] By analyzing the differences in the distribution of data contained in each cluster and its neighboring clusters, the degree of distribution difference between each cluster and its neighboring clusters in each dimension is determined, which fully reflects the differences in data distribution characteristics between clusters and improves the accuracy of identifying clusters that may contain abnormal data points.

[0018] In one embodiment, the method for acquiring adjacent clusters includes: if the distance between the centers of two clusters is less than a preset distance, the two clusters are adjacent clusters to each other.

[0019] In one embodiment, the method of performing anomaly detection on data points using the CBLOF algorithm to obtain all abnormal data points also includes: clustering all data points to obtain multiple clusters: calculating anomaly scores of data points based on the positional relationship between the data points and large clusters and small clusters; and determining abnormal data points based on the anomaly scores of the data points.

[0020] In a second aspect, the present invention provides a smart community data analysis system based on big data, which adopts the following technical solutions:

[0021] A smart community data analysis system based on big data includes: a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the above-mentioned smart community data analysis method based on big data is implemented.

[0022] By adopting the above technical solution, the above-mentioned smart community data analysis method based on big data is generated into a computer program and stored in a memory to be loaded and executed by a processor, so that a terminal device is made according to the memory and the processor for easy use.

[0023] The beneficial effects of the present invention are:

[0024] By combining the significance of changes in each cluster in each dimension and the degree of distribution difference between each cluster and its neighboring clusters in each dimension, the distribution characteristic values ​​of each cluster in each dimension are obtained. The size of the cluster and the distribution characteristic values ​​of the cluster in each dimension can fully reflect the differences between clusters. Then, the size of the cluster and the distribution characteristic values ​​of the cluster in each dimension are combined to divide large clusters and small clusters, which can more accurately identify clusters that may contain abnormal data points, thereby improving the accuracy of anomaly detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The above and other purposes, features and advantages of the exemplary embodiments of the present invention will become readily understood by reading the detailed description below through the accompanying drawings. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:

[0026] Figure 1 is a flow chart schematically illustrating a method for analyzing smart community data based on big data in the present invention;

[0027] Figure 2 It schematically shows the distribution of all data points;

[0028] Figure 3 Schematically shows the outlier scores of all data points calculated by the conventional CBLOF algorithm;

[0029] Figure 4 Schematically shows all abnormal data points obtained by the conventional CBLOF algorithm;

[0030] Figure 5 is a flow chart schematically illustrating step S2 in the present invention;

[0031] Figure 6 Schematically shows the outlier scores of all data points calculated by the improved CBLOF algorithm;

[0032] Figure 7 Schematically shows all abnormal data points obtained by the improved CBLOF algorithm. DETAILED DESCRIPTION

[0033] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0034] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0035] The embodiment of the present invention discloses a smart community data analysis method based on big data, referring to Figure 1 , comprising steps S1 to S3:

[0036] S1. Use sensing devices to collect data points of the smart community at every moment.

[0037] It should be noted that smart communities are an important part of smart city construction. Smart communities integrate various sensing devices and data technologies, generating massive amounts of data, including resident data, property management data, security monitoring data, environmental data, traffic data, etc.; by analyzing these data, we can have an in-depth understanding of the operation of the community, provide a scientific basis for community managers, optimize community resource allocation, and improve community governance efficiency and quality; for example, by analyzing the traffic data of smart communities, we can optimize traffic flow and reduce traffic congestion through intelligent traffic management systems; by analyzing the environmental data of smart communities, we can monitor air quality in real time through environmental monitoring systems, and remind residents to take corresponding protective measures.

[0038] Specifically, sensing devices are used to collect data points of the smart community at every moment. The data points contain multiple dimensions, and the data points have corresponding values ​​in each dimension. The sensing devices include but are not limited to sensors, smart devices, monitoring systems, etc.; the data include but are not limited to resident data, property management data, security monitoring data, environmental data, traffic data, community activities and service data, energy consumption data, etc.

[0039] Among them, the resident data includes dimensions such as family size, living conditions (renting or buying a house), and move-in time; the property management data includes dimensions such as property fees, maintenance records, usage of public facilities, and security patrol records; the security monitoring data includes dimensions such as surveillance videos, access control records, and fire alarm data; the environmental data includes dimensions such as air quality, noise level, temperature, and humidity; the traffic data includes dimensions such as parking space usage, traffic congestion, and public transportation conditions; the community activities and service data include dimensions such as community activity organization, resident participation, and usage of community services; the energy consumption data includes dimensions such as electricity, water resources, and natural gas usage and cost records.

[0040] Among them, environmental data, energy consumption data, etc. are collected through sensors, including air quality data through air quality sensors, and temperature and humidity data through temperature and humidity sensors; energy consumption data are collected through smart devices, including electricity consumption data through electricity meters, water consumption data through water meters, etc.; security monitoring data is collected through a monitoring system.

[0041] The data sampling interval can be set according to the actual application scenario and requirements. For example, the sampling interval of environmental data can be set to 5 minutes.

[0042] It should be noted that the data are normalized data, and the normalization method includes but is not limited to maximum and minimum value normalization and linear normalization.

[0043] Exemplarily, environmental data covers dimensions such as air quality, noise level, temperature, and humidity. At a certain sampling moment, the collected air quality data is 67, the normalized data is 0.1675, the noise level data is 55 decibels, the normalized data is 0.55, the temperature data is 29.8°C, the normalized data is 0.596, and the humidity data is 52%, the normalized data is 0.52. The data points at the sampling moment are (0.1675, 0.55, 0.596, 0.52).

[0044] S2. Perform anomaly detection on all data points using the improved CBLOF algorithm to obtain abnormal data points.

[0045] It should be noted that when analyzing and mining data, it is necessary to detect anomalies in the data. This is because the abnormal data in the data is often an important basis for tracing the root cause of the problem and finding corresponding repair measures. The CBLOF algorithm is an anomaly detection algorithm based on clustering results. Due to its low computational complexity, it is often used for massive data. Therefore, this embodiment uses the CBLOF algorithm to detect anomalies in the data of the smart community.

[0046] The conventional CBLOF algorithm for anomaly detection includes four steps:

[0047] The first step is to cluster all data points to obtain multiple clusters: all data points are clustered by K-means algorithm, and all data points are divided into K clusters; wherein K represents the number of all clusters, and K is equal to a preset number; in other embodiments, K can also be adaptively obtained by the elbow method or the silhouette coefficient method.

[0048] Among them, the specific value of the preset number can be set according to the actual application scenario and requirements, and the preset number is an integer not less than 2. The present invention sets the preset number to 10.

[0049] Among them, the K-means clustering algorithm, the elbow method and the silhouette coefficient method are all well-known technologies and will not be described in detail here.

[0050] The second step is to sort all clusters according to their sizes: Sort the clusters from large to small according to their sizes, and obtain the first B1 clusters after sorting. The ratio of the cumulative size of the first B1-1 clusters to the number of all data points is required to be less than the parameter , and the ratio of the cumulative size of the first B1 clusters to the number of all data points is not less than the parameter ; The first B1 clusters are regarded as large clusters, and the remaining clusters are regarded as small clusters; the cluster size refers to the number of data points contained in the cluster.

[0051] Among them, the parameters The specific value can be set according to the actual application scenario and requirements, and the parameter The value range of is [0.7, 0.99]. Set to 0.9.

[0052] For example, the parameters is equal to 0.9, and the number of all data points is equal to 300. After clustering all the data points, the sizes of the 10 clusters obtained are 19, 60, 33, 15, 15, 45, 51, 40, 3, and 19, respectively. After sorting, they are 60, 51, 45, 40, 33, 19, 19, 15, 15, and 3. The cumulative value of the size of the first 7 clusters is 267, and the ratio of it to the number of all data points is less than 0.9, and the cumulative value of the size of the first 8 clusters is 282, and the ratio of it to the number of all data points is not less than 0.9. Therefore, B1 is equal to 8. Therefore, the first B1=8 clusters are regarded as large clusters, and the remaining clusters are regarded as small clusters.

[0053] The third step is to calculate the outlier score of the data point based on the positional relationship between the data point and the large clusters and small clusters: if a data point belongs to a large cluster, the distance of the data point is the distance from the data point to the center of the cluster to which it belongs, and the outlier score of the data point is equal to the distance of the data point multiplied by the number of data points contained in the cluster to which the data point belongs; if a data point belongs to a small cluster, the distance of the data point is the distance from the data point to the center of the nearest large cluster, and the outlier score of the data point is equal to the distance of the data point multiplied by the number of data points contained in the cluster to which the data point belongs.

[0054] The fourth step is to determine the abnormal data points according to the abnormal value scores of the data points: sort all the data points from large to small according to the size of the abnormal value scores, and take the last M data points as abnormal data points, where M represents the number of abnormal data points, and M is equal to the integer result of the product of the preset first ratio and the number of all data points.

[0055] The specific value of the preset first ratio can be set according to actual application scenarios and requirements, and the value range of the preset first ratio is [0.01, 0.2]. The present invention sets the preset first ratio to 0.1.

[0056] For example, the distribution of all data points is as follows Figure 2 As shown, the horizontal axis is the first dimension and the vertical axis is the second dimension; Figure 2 All the data points shown in the figure are detected by the conventional CBLOF algorithm, and the calculated outlier scores of all the data points are as follows: Figure 3 , where the horizontal axis is the serial number of the data point, and the vertical axis is the abnormal value score of the data point. According to the abnormal value score of the data point, the abnormal data point is obtained, such as Figure 4 As shown, the horizontal axis is the first dimension, the vertical axis is the first dimension, the dot-shaped data points are normal data points, and the triangular-shaped data points are abnormal data points.

[0057] It should be noted that the conventional CBLOF algorithm only divides large clusters and small clusters according to the size of the clusters. This division method ignores the differences between different clusters in the feature dimensions. Different clusters may have different distribution characteristics in each feature dimension. Therefore, if only the size of the cluster is considered, the differences between clusters cannot be fully reflected, which in turn affects the accuracy of anomaly detection.

[0058] Therefore, this embodiment considers improving the conventional CBLOF algorithm, combining the significance of changes in each cluster in each dimension and the degree of distribution difference between each cluster and its neighboring clusters in each dimension to obtain the distribution characteristic value of each cluster in each dimension, and then comprehensively considers the size of the cluster and the distribution characteristic value of the cluster in each dimension to divide large clusters and small clusters, thereby improving the accuracy of anomaly detection.

[0059] Therefore, this embodiment improves the second step of the conventional CBLOF algorithm. The flowchart of the specific steps is shown in FIG. Figure 5 , including steps S201 to S204:

[0060] S201. Calculate the change significance of each cluster in each dimension according to the data distribution range of all data points contained in each cluster in each dimension.

[0061] It should be noted that when the difference in data contained within a cluster is large, the cluster is more likely to contain more abnormal data points, and such a cluster should be divided into small clusters. Therefore, this embodiment calculates the significance of changes in each cluster in each dimension based on the data distribution range of all data points contained in each cluster in each dimension.

[0062] In one embodiment, the change significance satisfies the expression:

[0063]

[0064] In the formula, Indicates the significance of the change of the c1th cluster in the dth dimension, , They represent the 10th and 90th percentiles of all data points contained in the c1th cluster in the data of the dth dimension, respectively. , They represent the first quartile and the third quartile of all data points contained in the c1th cluster in all data of the dth dimension, respectively. , Represent the first weight and the second weight respectively.

[0065] The sum of the first weight and the second weight is equal to 1, that is, , wherein the specific values ​​of the first weight and the second value can be set according to the actual application scenario and requirements, and the value range of the first weight is [0,0.45]. The present invention sets the first weight to 0.4, and the second weight is 0.6.

[0066] The quartile is a type of quantile in statistics, that is, all data are arranged from small to large and divided into four equal parts, and the data at the three dividing points are quartiles; among them, the first quartile is equal to the 25th% of the data after all data are arranged from small to large, and the third quartile is equal to the 75th% of the data after all data are arranged from small to large.

[0067] The 10th percentile Equal to the 10% of the data after all the data are arranged from small to large, the 90th percentile It is equal to the 90th percentile of all data after all data are arranged from small to large.

[0068] The data between the 10th and 90th percentiles include 80% of all data. The larger the range of this 80% of data, the greater the significance of the data change. The larger the value, the more significant the change in data is, and In the range of [0,1]; the data between the first quartile and the third quartile include 50% of all the data. The larger the range of this 50% of the data, the greater the significance of the data change, that is, The larger the value, the more significant the change in data is, and In the range [0,1].

[0069] In other embodiments, the change significance satisfies the expression:

[0070]

[0071] In the formula, Indicates the significance of the change of the c1th cluster in the dth dimension, , They represent the maximum and minimum values ​​of all data points contained in the c1th cluster in the data of the dth dimension respectively.

[0072] in, The larger it is, the more significant the change in the data is.

[0073] It should be noted that by analyzing the distribution of the data contained in each cluster, the distribution characteristic values ​​of each cluster in each dimension are determined, and then the large clusters and small clusters are distinguished based on the significance of the changes in each cluster in each dimension, thereby improving the accuracy of identifying clusters that may contain abnormal data points.

[0074] S202. Calculate the distribution difference between each cluster and its neighboring clusters in each dimension according to the difference in data distribution of all data points included in each cluster and its neighboring clusters in each dimension.

[0075] It should be noted that when the difference between the data contained in a cluster and the data contained in its adjacent clusters is large, the cluster is more likely to contain more abnormal data points, and such a cluster should be divided into small clusters. Therefore, this embodiment calculates the degree of distribution difference between each cluster and its adjacent clusters in each dimension based on the difference in data distribution of all data points contained in each cluster and its adjacent clusters in each dimension.

[0076] If the distance between the centers of two clusters is less than a preset distance, the two clusters are adjacent clusters. The specific value of the preset distance can be set according to actual application scenarios and requirements, and the value range of the preset distance is [0.01, 0.5]. The present invention sets the preset distance to 0.37.

[0077] In this embodiment, the distribution difference between each cluster and its neighboring clusters in each dimension satisfies the expression:

[0078]

[0079] In the formula, represents the distribution difference between the c1th cluster and the c2th cluster in the dth dimension, where the c2th cluster is the neighboring cluster of the c1th cluster. Indicates the number of types of data in the dth dimension, The data of all data points contained in the c1th cluster in the dth dimension are The frequency, The data of all data points contained in the c2th cluster in the dth dimension are frequency.

[0080] Among them, the data of all data points contained in the c1th cluster in the dth dimension are Frequency The data of all data points contained in the c2th cluster in the dth dimension are Frequency , respectively represent the data distribution of the c1th cluster and the adjacent cluster of the c1th cluster, namely the c2th cluster. Therefore, the difference between the two The larger is , the greater the distribution difference between the c1th cluster and the c2th cluster in the dth dimension.

[0081] In other embodiments, the distribution difference between each cluster and its neighboring clusters in each dimension satisfies the expression:

[0082]

[0083] In the formula, represents the distribution difference between the c1th cluster and the c2th cluster in the dth dimension, where the c2th cluster is the neighboring cluster of the c1th cluster. Indicates the number of types of data in the dth dimension, The data of all data points contained in the c1th cluster in the dth dimension are The frequency, The data of all data points contained in the c2th cluster in the dth dimension are The frequency, Represents the base 10 logarithmic function.

[0084] represents the information entropy of all data points contained in the c1th cluster in the dth dimension, represents the information entropy of all data points contained in the c2th cluster in the dth dimension, and represents the data distribution of the c1th cluster and the adjacent cluster of the c1th cluster, namely the c2th cluster. Therefore, the difference between the two The larger is, the greater the distribution difference between the c1th cluster and the c2th cluster in the dth dimension; at the same time, the data of all data points contained in the c1th cluster in the dth dimension is Frequency , weighting the differences.

[0085] It should be noted that by analyzing the differences in the distribution of data contained in each cluster and its neighboring clusters, the degree of distribution difference between each cluster and its neighboring clusters in each dimension is determined, which fully reflects the differences in data distribution characteristics between clusters and improves the accuracy of identifying clusters that may contain abnormal data points.

[0086] S203. According to the change significance of each cluster and its neighboring clusters in each dimension, the distribution difference degree of each cluster and its neighboring clusters in each dimension is weighted to obtain the distribution characteristic value of each cluster in each dimension.

[0087] It should be noted that when the difference in data contained in a cluster is large, the cluster is more likely to contain more abnormal data points, and such a cluster should be divided into a small cluster; at the same time, the difference in data contained in its adjacent clusters is small, and its adjacent clusters are more likely to contain fewer abnormal data points, and such a cluster should be divided into a large cluster. At the same time, the greater the difference between the data contained in the cluster and the data contained in its adjacent clusters, the greater the difference in data distribution between the cluster and the cluster that may be a large cluster, and the more likely the cluster contains more abnormal data points, and such a cluster should be divided into a small cluster. Therefore, this embodiment weights the degree of distribution difference between each cluster and its adjacent clusters in each dimension according to the significance of changes in each cluster in each dimension and the significance of changes in its adjacent clusters in each dimension, and obtains the distribution characteristic value of each cluster in each dimension.

[0088] The distribution characteristic values ​​of each cluster in each dimension satisfy the expression:

[0089]

[0090] In the formula, represents the distribution characteristic value of the c1th cluster in the dth dimension, represents the distribution difference between the c1th cluster and the c2th cluster in the dth dimension, where the c2th cluster is the neighboring cluster of the c1th cluster. Indicates the significance of the change of the c1th cluster in the dth dimension, It represents the significance of the change of the c2th cluster in the dth dimension, and exp() represents an exponential function with a natural constant as the base.

[0091] The value range of is [0,1], so Satisfies the gamma transformation function In the form of, r represents the input value, and the value range of r is required to be [0,1]. Represents the gamma coefficient. In the gamma transformation function, the larger the input value r is, the The bigger, The smaller the The larger the value, the greater the distribution difference between the c1th cluster and the c2th cluster in the dth dimension. The larger the value, the farther the cluster is from other clusters in terms of distribution. The distribution characteristic value of the c1th cluster in the dth dimension is The larger the value, the more significant the change of the c1th cluster in the dth dimension. The larger the value, the more discrete the distribution inside the cluster. The smaller the value, the distribution characteristic value of the c1th cluster in the dth dimension The larger the value, the more significant the change of the c2th cluster in the dth dimension. The smaller it is, the more concentrated the distribution inside the c2th cluster is. The smaller the value, the distribution characteristic value of the c1th cluster in the dth dimension The bigger.

[0092] S204. Divide all clusters into large clusters and small clusters according to the size of the clusters and the distribution characteristic values ​​of the clusters in each dimension.

[0093] It should be noted that the larger the distribution characteristic value of a cluster in a certain dimension, the more likely the cluster contains more abnormal data points in this dimension. Therefore, the more abnormal the cluster is in this dimension, the more abnormal dimensions there are in all the dimensions contained in the cluster, or the cluster is particularly abnormal in a certain dimension, which means that the data points in the cluster are likely to be abnormal data points, and the cluster should be divided into small clusters.

[0094] Specifically, the clusters are sorted from large to small according to their sizes; the first B3 clusters after sorting are obtained, and the ratio of the cumulative value of the size of the first B3-1 clusters to the number of all data points is required to be less than the parameter , and the ratio of the cumulative size of the first B1 clusters to the number of all data points is not less than the parameter ; The remaining clusters except the first B3 clusters are recorded as small clusters; the first B4 clusters are obtained from the first B3 clusters, and the ratio of the cumulative value of the size of the first B4-1 clusters to the cumulative value of the size of the first B3 clusters is required to be less than the parameter , and the ratio of the cumulative value of the sizes of the first B4 clusters to the cumulative value of the sizes of the first B3 clusters is not less than the parameter ; The first B4 clusters are regarded as large clusters, and the B4+1th to B3th clusters are regarded as clusters to be determined.

[0095] Among them, the parameters and parameters The specific value can be set according to the actual application scenario and requirements, and the parameter The value range of is [0.7,0.99], and the parameter The value range of is [0.6, 0.9]. The present invention sets the parameter Set to 0.9, and set the parameter Set to 0.7.

[0096] It should be noted that, according to the size of the cluster and two preset parameters, all clusters are divided into large clusters, small clusters and clusters to be determined. By making a more detailed division, the accuracy of identifying clusters that may contain abnormal data points is improved.

[0097] Further, for the distribution characteristic values ​​of the cluster to be determined in each dimension, if there is a dimension whose distribution characteristic value is greater than a preset first threshold, the cluster to be determined is divided into small clusters; otherwise, the product of the number of all dimensions and the preset second ratio is recorded as the first value, and the number of dimensions whose distribution characteristic values ​​are greater than the second preset threshold is recorded as the target number. In response to the target number being greater than the first value, the cluster to be determined is divided into small clusters. In response to the target number being not greater than the first value, the cluster to be determined is divided into large clusters. The preset first threshold is greater than the second preset threshold.

[0098] The specific value of the preset second ratio can be set according to the actual application scenario and requirements, and the value range of the preset second ratio is [0.5, 0.8]. The present invention sets the preset second ratio to 0.65.

[0099] Among them, the specific values ​​of the preset first threshold and the preset second threshold can be set according to the actual application scenario and requirements, and the value range of the preset first threshold is [0.7, 0.99], and the value range of the preset second threshold is [0.5, 0.7]. The present invention sets the preset first threshold to 0.83 and the preset second threshold to 0.65.

[0100] It should be noted that the distribution characteristic values ​​of each cluster in each dimension are obtained by combining the significance of the changes of each cluster in each dimension and the degree of distribution difference between each cluster and its neighboring clusters in each dimension. The size of the cluster and the distribution characteristic values ​​of the cluster in each dimension can fully reflect the differences between clusters. Then, the size of the cluster and the distribution characteristic values ​​of the cluster in each dimension are combined to divide large clusters and small clusters, which can more accurately identify clusters that may contain abnormal data points, thereby improving the accuracy of anomaly detection.

[0101] For example, for Figure 2 For all the data points shown in FIG. 1 , the improved CBLOF algorithm provided in this embodiment is used to perform anomaly detection on all the data points, and the anomaly value scores of all the data points calculated are as follows: Figure 6 , where the horizontal axis is the serial number of the data point, and the vertical axis is the abnormal value score of the data point. According to the abnormal value score of the data point, the abnormal data point is obtained, such as Figure 7 As shown, the horizontal axis is the first dimension, the vertical axis is the first dimension, the dot-shaped data points are normal data points, and the triangular-shaped data points are abnormal data points.

[0102] S3. Determine the abnormal period based on the time interval between abnormal data points.

[0103] Specifically, the abnormal period is determined according to the time interval between abnormal data points, and the time interval between any two abnormal data points in the abnormal period is required to be no more than 2G, where G represents the sampling interval; corresponding measures are taken in the same time period as the abnormal period every day.

[0104] For example, when an abnormal period occurs in environmental data, the frequency of sprinkler trucks and sweeper trucks is increased during the same time period as the abnormal period every day thereafter; in the community, environmental knowledge is disseminated to community residents and environmental protection actions are promoted through publicity activities, lectures and training.

[0105] An embodiment of the present invention also discloses a smart community data analysis system based on big data, including a processor and a memory, wherein the memory stores computer program instructions. When the computer program instructions are executed by the processor, a smart community data analysis method based on big data according to the present invention is implemented.

[0106] The above system also includes other components well known to those skilled in the art, such as a communication bus and a communication interface, and their configuration and functions are known in the art, so they will not be described in detail here.

[0107] In the description of this specification, "plurality" or "several" means at least two, such as two, three or more, etc., unless otherwise clearly and specifically defined.

[0108] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, alternatives to the embodiments of the present invention described herein may be employed.

Claims

1. A smart community data analysis method based on big data, characterized in that: include: The sensing devices are used to collect data points of the smart community at every moment. The data points contain multiple dimensions, including resident data, property management data, security monitoring data, environmental data, and traffic data. The data points are detected for anomalies using the CBLOF algorithm to obtain all abnormal data points. In the process of anomaly detection, the specific steps of dividing large clusters and small clusters include: The clusters to be determined are screened according to the size of the clusters; in response to the distribution characteristic values ​​of the clusters to be determined in each dimension being not greater than a preset first threshold value, and the target number being not greater than a first value, the clusters to be determined are marked as large clusters; otherwise, the clusters to be determined are marked as small clusters; the first value is equal to the product of the number of all dimensions and a preset second ratio, and the target number is the number of dimensions whose distribution characteristic values ​​are greater than a second preset threshold value; The method for obtaining the distribution characteristic value comprises: calculating the change significance of each cluster in each dimension according to the data distribution range of all data points contained in each cluster in each dimension, wherein the change significance is positively correlated with the data distribution range; calculating the distribution difference degree of each cluster and its neighboring clusters in each dimension according to the difference in the data distribution of all data points contained in each cluster and its neighboring clusters in each dimension; and weighting the distribution difference degree of each cluster and its neighboring clusters in each dimension according to the change significance of each cluster and its neighboring clusters in each dimension to obtain the distribution characteristic value of each cluster in each dimension; The method of performing anomaly detection on data points by using the CBLOF algorithm to obtain all abnormal data points also includes: Cluster all data points to obtain multiple clusters: Calculate the outlier score of the data point based on its positional relationship with large and small clusters; Determine abnormal data points based on the abnormal value scores of the data points; The step of screening the clusters to be determined according to the size of the clusters includes: Sort the clusters according to their size from largest to smallest; To obtain the first B3 clusters after sorting, the ratio of the cumulative size of the first B3-1 clusters to the number of all data points must be less than the parameter , and the ratio of the cumulative size of the first B1 clusters to the number of all data points is not less than the parameter ; The remaining clusters except the first B3 clusters are recorded as small clusters; To obtain the first B4 clusters from the first B3 clusters, the ratio of the sum of the sizes of the first B4-1 clusters to the sum of the sizes of the first B3 clusters must be less than the parameter , and the ratio of the cumulative value of the sizes of the first B4 clusters to the cumulative value of the sizes of the first B3 clusters is not less than the parameter ; The first B4 clusters are regarded as large clusters, and the clusters from B4+1 to B3 are regarded as clusters to be determined; The distribution characteristic values ​​of each cluster in each dimension satisfy the expression: ; In the formula, represents the distribution characteristic value of the c1th cluster in the dth dimension, represents the distribution difference between the c1th cluster and the c2th cluster in the dth dimension, where the c2th cluster is the neighboring cluster of the c1th cluster. Indicates the significance of the change of the c1th cluster in the dth dimension, represents the significance of the change of the c2th cluster in the dth dimension, and exp() represents an exponential function with a natural constant as the base; The distribution difference between each cluster and its neighboring clusters in each dimension satisfies the expression: ; In the formula, Indicates the number of types of data in the dth dimension, The data of all data points contained in the c1th cluster in the dth dimension are The frequency, The data of all data points contained in the c2th cluster in the dth dimension are frequency.

2. According to the big data-based smart community data analysis method of claim 1, it is characterized in that: The significance of changes in each cluster in each dimension satisfies the expression: ; In the formula, , They represent the 10th and 90th percentiles of all data points contained in the c1th cluster in the data of the dth dimension, respectively. , They represent the first quartile and the third quartile of all data points contained in the c1th cluster in all data of the dth dimension, respectively. , Represent the first weight and the second weight respectively.

3. According to the big data-based smart community data analysis method of claim 2, it is characterized in that: The significance of changes in each cluster in each dimension satisfies the expression: ; In the formula, , They represent the maximum and minimum values ​​of all data points contained in the c1th cluster in the data of the dth dimension respectively.

4. According to the big data-based smart community data analysis method of claim 1, it is characterized in that: The distribution difference between each cluster and its neighboring clusters in each dimension satisfies the expression: ; In the formula, Indicates the number of types of data in the dth dimension, The data of all data points contained in the c1th cluster in the dth dimension are The frequency, The data of all data points contained in the c2th cluster in the dth dimension are The frequency, Represents the base 10 logarithmic function.

5. A smart community data analysis method based on big data according to claim 1 or 4, characterized in that: The method for obtaining the neighboring clusters includes: If the distance between the centers of two clusters is less than a preset distance, the two clusters are adjacent clusters.

6. A smart community data analysis system based on big data, characterized in that: include: A processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, a smart community data analysis method based on big data according to any one of claims 1-5 is implemented.