Method, device and equipment for determining users with abnormal electricity consumption
By collecting electrical data in the oil field power grid for cluster analysis and Spearman correlation coefficient calculation, the users of abnormal electricity use in the oil field power grid are accurately identified, and the problem of inaccurate identification results in the existing technology is solved, and the identification efficiency and accuracy are improved.
Patent Information
- Application Number
- CN202311255144.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-26
- Publication Date
- 2025-03-28
AI Technical Summary
In oil field power grids, it is difficult for the prior art to accurately identify power stolen users, especially in peak electricity consumption or extreme weather conditions, which are greatly disturbed by the environment, resulting in low accuracy of the identification results.
By collecting the electrical data corresponding to multiple users, performing cluster analysis based on voltage data, multiple cluster clusters are obtained, and the Spearman correlation coefficient of each cluster cluster is calculated to analyze whether there are users with electricity consumption abnormalities in the cluster cluster.
This method can narrow the range of users with abnormal electricity consumption, improve the efficiency of determining users with abnormal electricity consumption, avoid the influence of environmental interference, and improve the accuracy of identification results.
Smart Images

Figure CN119719822A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of oilfield power, and in particular to a method, device, and equipment for determining users with abnormal electricity consumption. Background Art
[0002] Electricity theft is a common phenomenon in oilfield power grids. Electricity theft refers to the illegal occupation of electrical energy. The purpose of electricity theft users is not to pay or to pay less electricity bills. By identifying electricity theft users, the operating costs of the power system can be reduced.
[0003] In the related technology, the electricity amount, voltage and other data in the meter are mainly collected, and the voltage amplitude and other parameters are calculated based on the data in the meter. According to the changes in the parameters, it is determined whether there is electricity theft. For example, if the voltage amplitude changes significantly in a short period of time, there may be electricity theft in this time period.
[0004] However, during peak electricity consumption periods or extreme weather conditions, the above parameters may also change significantly. Therefore, determining electricity theft based solely on data such as power consumption and voltage is greatly affected by environmental interference, and the accuracy of the identification results for electricity theft users is low. Summary of the invention
[0005] The embodiment of the present application provides a method, device, and apparatus for determining users with abnormal electricity consumption, which can accurately identify users with abnormal electricity consumption in an oil field power grid. The technical solution is as follows:
[0006] In one aspect, a method for determining users with abnormal electricity consumption is provided, the method comprising:
[0007] Collecting electrical data, the electrical data including voltage data and power data corresponding to a plurality of users respectively;
[0008] Performing cluster analysis on the multiple users based on the voltage data to obtain multiple clusters, wherein each cluster includes at least one user, and each cluster corresponds to cluster voltage data and cluster power data;
[0009] Determining the Spearman correlation coefficients corresponding to the plurality of clusters respectively based on the cluster voltage data and the cluster power data, wherein the Spearman correlation coefficient is used to analyze the situation in which there are users with abnormal electricity consumption in the cluster;
[0010] In response to the Spearman correlation coefficient corresponding to a target cluster among the multiple clusters meeting a preset abnormal requirement, the abnormal power consumption user is determined from the target cluster based on voltage data and power data respectively corresponding to multiple users in the target cluster.
[0011] On the other hand, a device for determining abnormal electricity users is provided, the device comprising:
[0012] A collection module, used for collecting electrical data, wherein the electrical data includes voltage data and power data corresponding to a plurality of users respectively;
[0013] A cluster analysis module, configured to perform cluster analysis on the plurality of users based on the voltage data to obtain a plurality of clusters, wherein each cluster includes at least one user, and each of the clusters corresponds to cluster voltage data and cluster power data;
[0014] A correlation analysis module, used to determine the Spearman correlation coefficients corresponding to the plurality of clusters respectively based on the cluster voltage data and the cluster power data, wherein the Spearman correlation coefficients are used to analyze the existence of users with abnormal electricity consumption in the clusters;
[0015] The correlation analysis module is also used to determine the abnormal electricity consumption user from the target cluster cluster based on the voltage data and power data corresponding to multiple users in the target cluster cluster in response to the Spearman correlation coefficient corresponding to the target cluster cluster among the multiple cluster clusters meeting the preset abnormality requirements.
[0016] On the other hand, a computer device is provided, which includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement a method for determining users with abnormal electricity consumption as described in any of the above-mentioned embodiments of the present application.
[0017] On the other hand, a computer-readable storage medium is provided, in which at least one instruction, at least one program, a code set or an instruction set is stored, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement a method for determining users with abnormal electricity consumption as described in any of the above-mentioned embodiments of the present application.
[0018] On the other hand, a computer program product or a computer program is provided, the computer program product or the computer program includes a computer instruction, the computer instruction is stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the method for determining an abnormal power consumption user described in any of the above embodiments.
[0019] The beneficial effects brought by the technical solution provided by the embodiment of the present application include at least:
[0020] By collecting electrical data corresponding to multiple users, clustering analysis is performed on multiple users based on the electrical data to obtain multiple clusters, and the Spearman correlation coefficient of each cluster is calculated respectively. It is judged whether there are users with abnormal electricity consumption in the cluster according to the Spearman correlation coefficient, which can narrow the scope of users with abnormal electricity consumption and improve the efficiency of determining users with abnormal electricity consumption. When the Spearman correlation coefficient corresponding to the target cluster among multiple clusters is abnormal, the abnormal electricity consumption user is further located according to the electrical data corresponding to multiple users in the target cluster. The method of determining users with abnormal electricity consumption based on electrical data and Spearman correlation coefficient can avoid the influence of environmental interference and improve the accuracy of the identification results of users with abnormal electricity consumption. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1 It is a schematic diagram of a single-phase equivalent circuit of one of the branch trunk lines of an oil field power grid provided by an exemplary embodiment of the present application;
[0023] Figure 2 An exemplary embodiment of the present application provides a Figure 1 A schematic diagram of a single-phase equivalent circuit after replacing the low-voltage user equivalent of one of the branch trunk lines of the oil field power grid with a simulated user;
[0024] Figure 3 is a flow chart of a method for determining users with abnormal electricity consumption provided by an exemplary embodiment of the present application;
[0025] Figure 4 is a schematic diagram of a meter box topology structure provided by an exemplary embodiment of the present application;
[0026] Figure 5 It is a schematic diagram of a process of clustering analysis of multiple users based on the OPTICS clustering algorithm provided by an exemplary embodiment of the present application;
[0027] Figure 6 It is a schematic diagram of a daily average active power curve of a three-phase total load of an oil field power grid simulated by a smart telegraph data set provided by an exemplary embodiment of the present application;
[0028] Figure 7 It is a schematic diagram of an over-limit situation of the Spearman correlation coefficient of the voltage amplitude-active power subsequence provided by an exemplary embodiment of the present application;
[0029] Figure 8 is a flow chart of a method for determining abnormal electricity users based on coefficient analysis results provided by an exemplary embodiment of the present application;
[0030] Fig. 9 is a schematic diagram of voltage amplitude similarity provided by an exemplary embodiment of the present application;
[0031] Fig.10 is a schematic diagram of a clustering result provided by another exemplary embodiment of the present application;
[0032] Fig.11 is a structural block diagram of a device for determining abnormal electricity users provided by another exemplary embodiment of the present application;
[0033] Fig.12 It is a structural block diagram of a computer device provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0034] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0035] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0036] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0037] It should be noted that the information (including but not limited to the electricity usage of multiple users, etc.) and data (including but not limited to electrical data, neighborhood radius, reachable distance, minimum number of neighborhood points, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0038] It should be understood that, although the terms first, second, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first parameter may also be referred to as the second parameter, and similarly, the second parameter may also be referred to as the first parameter. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0039] First, a brief introduction is given to the terms involved in the embodiments of this application:
[0040] Spearman correlation coefficient: Also known as Spearman's rank correlation coefficient, in statistics, the Spearman correlation coefficient is a nonparametric indicator that measures the dependence of two variables. It uses a monotonic equation to evaluate the correlation between two statistical variables. If there are no repeated values in the data and when the two variables are completely monotonically correlated, the Spearman correlation coefficient is +1 or -1.
[0041] DBSCAN clustering algorithm (Density-Based Spatial Clustering of Applications with Noise): It is a representative density-based clustering algorithm. It defines a cluster as the largest set of density-connected points, can divide areas with sufficiently high density into clusters, and can find clusters of any shape in a noisy spatial database.
[0042] OPTICS clustering algorithm (Ordering Points To Identify the Clustering Structure, density-based clustering algorithm): The goal is to cluster data in space according to density distribution. Its idea is very similar to DBSCAN, but different from DBSCAN, the OPTICS algorithm can obtain clusters of different densities, that is, after processing by the OPTICS algorithm, clusters of arbitrary density can be obtained in theory. Because the OPTICS algorithm outputs an ordered queue of samples, clusters of arbitrary density can be obtained from this queue.
[0043] Power flow calculation: Power flow calculation is a term in electrical engineering, which refers to the calculation of active power, reactive power and voltage distribution in the power grid under given power system network topology, component parameters and power generation and load parameters. Power flow calculation is the calculation of steady-state operating state parameters of each part of the power system based on given power grid structure, parameters and operating conditions of components such as generators and loads. Usually, the given operating conditions include the power of each power source and load point in the system, the voltage at the hub point, and the voltage and phase angle at the balance point. The operating state parameters to be determined include the voltage amplitude and phase angle of each bus node of the power grid, as well as the power distribution of each branch, the power loss of the network, etc.
[0044] The phenomenon of electricity theft is quite common in oilfield power grids. Electricity theft users illegally occupy electricity in various ways to avoid paying or pay less electricity bills. The electricity usage of electricity theft users is abnormal, and they are hereinafter referred to as abnormal electricity users.
[0045] In the field of electricity theft identification technology for oilfield power grids, the common electricity theft identification method is to collect the electricity data in the meter and obtain the voltage amplitude and other parameters of the meter based on the data in the meter. And determine whether the meter is abnormal according to the change of parameters in different time periods, and then analyze whether the user corresponding to the meter has electricity theft behavior. For example, if the voltage amplitude changes significantly in a short period of time, there may be electricity theft in this period.
[0046] However, during peak electricity consumption periods or extreme weather conditions, the above parameters may also change significantly. Therefore, determining electricity theft based solely on data such as electricity consumption is greatly affected by environmental interference, and the accuracy of the identification results for electricity theft users is low.
[0047] The present application provides a method for determining users with abnormal electricity consumption, which analyzes whether there is abnormal electricity consumption based on the OPTICS clustering algorithm and the Spearman correlation coefficient, can avoid interference from environmental factors and improve the accuracy of electricity theft identification results.
[0048] The principle is as follows.
[0049] The voltage amplitude of low-voltage users in the oilfield power grid presents the characteristics of settlement distribution. The OPTICS clustering algorithm is used to cluster low-voltage users based on the voltage amplitude to obtain multiple clusters, each of which includes multiple low-voltage users. A simulated user is constructed from the low-voltage users in each cluster. The voltage amplitude of the simulated user is the mean of the voltage amplitude of each low-voltage user in the cluster, and the load power is the sum of the load powers of the low-voltage users. According to the principle that there is an approximately linear negative correlation between the voltage amplitude and active power of normal simulated users, the Spearman correlation coefficient between the voltage amplitude and active power sequence of the simulated user is calculated. Whether the simulated user is a user with abnormal power consumption is determined by whether the Spearman correlation coefficient exceeds the normal range. The low-voltage users in the simulated users with abnormal power consumption are excluded one by one. According to the Spearman correlation coefficient between the voltage amplitude and active power sequence of the simulated user, the difference before and after the exclusion check is used to give the abnormal situation ranking of the power consumption of each low-voltage user in the simulated user, and then determine the users with abnormal power consumption.
[0050] Indicative, such as Figure 1 As shown, Figure 1 It is a schematic diagram of a single-phase equivalent circuit of one of the branch trunk lines of the oil field power grid.
[0051] exist Figure 1 In the embodiment, the single-phase equivalent circuit 100 includes a plurality of branches, each branch corresponds to a meter box 101, and there is at least one electric meter in a meter box 101, and each electric meter corresponds to a household user.
[0052] U i represents the voltage amplitude at the branch point i of the branch trunk line, where U0 is the voltage amplitude at the head end of the branch trunk line (i.e. the branch point of the branch box); Z i Indicates the impedance of the branch line trunk; Z i ' represents the impedance of the branch line from the branch point of the meter box to the small branch line between the meter boxes; S i Indicates the sum of the load power loss of all users in the meter box; U ij represents the voltage amplitude of user j in meter box i; Z ij S represents the impedance of the branch between user (j-1) and user j in meter box i; ij Represents the load power of user j in meter box i.
[0053] P is active power, Q is reactive power, S=P+jQ means: load power includes active power and reactive power.
[0054] Then the branch impedance between the meter box branch node (i-1) and i is Z i :Z i =r i +x i j, where ri and x i are the coefficients of the real and imaginary parts respectively.
[0055] Branch L i The voltage at the beginning and end of satisfies the following relationship (1):
[0056]
[0057] Taking the square of the vector modulus value on both sides of the relationship (1), we can know that the voltage amplitude relationship between the first and last nodes of the branch is as follows:
[0058]
[0059] Among them, P i is the active power of node i, Q i It refers to the reactive power of node i.
[0060] Since the voltage amplitude per unit value of each node in the distribution network can be approximated to 1, the node voltage loss can be obtained by further transforming the relationship (2) as follows:
[0061]
[0062] Indicative, such as Figure 2 As shown, Figure 2 is based on Figure 1 The schematic diagram of the single-phase equivalent circuit after replacing the low-voltage user equivalent of one of the branch trunk lines of the oil field power grid with the simulated user. That is, Figure 1 Branch 110 in corresponds to Figure 2 The single-phase equivalent circuit 200 in FIG.
[0063] Figure 2 Middle U t is the voltage amplitude at the low-voltage side outlet of the distribution transformer; U0 is the voltage amplitude at the branch trunk terminal of the branch box; S Li is the total simulated user load at the meter box branch point. Usually, the low-voltage outlet side of the distribution transformer and the branch box branch node are often located in the same distribution room, so the distance between the two transmission lines is short and the voltage loss can be ignored. Therefore, it can be considered that U t =U0, therefore, the voltage distribution of the simulated user under any branch trunk of the oilfield power grid has nothing to do with other branches, but is only related to the line impedance and load power of each simulated user under this branch trunk. In addition, the simulated user load at the meter box branch point will also affect the voltage distribution. Therefore, the voltage amplitude U0 of any meter box branch node can be derived based on the relationship (4) and the voltage amplitude U0 of the trunk branch node. i , the relationship (4) is as follows:
[0064]
[0065] Voltage amplitude U at the branch node i of the meter box i Subtract the voltage loss of the small branch line between the meter box branch point and the centralized meter box △U i The voltage amplitude U of the simulated user i can be obtained i ′ , as shown in the following relation (5):
[0066]
[0067] In addition, since the active power of each simulated user in the oilfield power grid concentrates the active power of multiple low-voltage users, the load active power of any simulated user can be approximately represented by the load curve similarity coefficient of the simulated user and the load active power of the simulated user. Therefore, the voltage amplitude of the simulated user can be approximately expressed as the following relationship (6):
[0068]
[0069] in, and ω are the coefficients r in the above equations (2) to (5). i and coefficient x i The coefficient obtained after deformation. It can be seen from equation (6) that there is a negative correlation between the voltage amplitude of the simulated user and the active power of the simulated user.
[0070] Since the power supply radius of the oilfield power grid is short, the number of centralized meter boxes on the branch trunk is small, and the number of simulated users is small; at the same time, the voltage amplitude of the simulated user i is mainly affected by the load active power of the simulated user, so there is a robust negative correlation between the voltage amplitude of the simulated user and the load active power. This negative correlation is monotonically decreasing. Therefore, the Spearman correlation coefficient ρ can be introduced, as shown in the following relationship (7):
[0071]
[0072] Among them, R(x) refers to the position of x, and R(y) refers to the position of y. is the average rank of x, It refers to the average rank of y. x and y are used to indicate the voltage amplitude and active power of the simulated user respectively. The rank refers to the serial number corresponding to each simulated user after multiple simulated users are arranged in a preset order.
[0073] By quantitatively analyzing the negative correlation between the voltage amplitude and active power of the simulated user, the Spearman correlation coefficient is between -1 and 1. The closer it is to -1, the stronger the negative correlation between the voltage amplitude and active power, and the lower the probability of abnormal power consumption of the simulated user. In other words, the closer the Spearman correlation coefficient of the simulated user is to 1, the higher the probability of abnormal power consumption (power theft) among the simulated users.
[0074] In combination with the above-mentioned noun introduction and application scenarios, the method for determining abnormal electricity users provided by the present application is described. The method can be executed by a server or a terminal, or can be executed by a server and a terminal together. In the embodiment of the present application, the method is described by taking the method executed by a terminal as an example. Figure 3 As shown, Figure 3 This is a flow chart of a method for determining users with abnormal electricity consumption provided by an exemplary embodiment of the present application. The method includes the following steps.
[0075] Step 310, collecting electrical data.
[0076] The electrical data includes voltage data and power data corresponding to a plurality of users respectively.
[0077] There are multiple trunk branches in the oilfield power grid, and each trunk branch is equipped with multiple centralized meter boxes (i.e., meter boxes). Each meter box contains multiple electric meters, and each electric meter corresponds to the power consumption of a user. The user's power consumption, such as the remaining power, can be viewed in the electric meter.
[0078] Indicative, such as Figure 4 As shown, Figure 4 It is a schematic diagram of the meter box topology.
[0079] There are three branches in the topology 400, each of which includes 10 centralized meter boxes 410. After expanding the meter box 410, you can see that there are electric meters 411 in the meter box. Among them, node 1 is a branch node, and there is a distance between node 2 and node 1, which is used for transition between the electric meter 411 and the branch node. The number of electric meters 411 is 5, corresponding to Figure 4 Node 3, Node 4, Node 5, Node 6 and Node 7 in .
[0080] Exemplarily, the electric meter is a smart meter, and a communication connection is established between the terminal. The terminal can export the data in the electric meter, perform power flow calculation on the data in the electric meter, and obtain the voltage data and power data of each user, wherein the voltage data refers to the voltage amplitude and the power data refers to the active power.
[0081] Step 320: Perform cluster analysis on multiple users based on voltage data to obtain multiple clusters.
[0082] Each cluster includes at least one user, and each cluster corresponds to cluster voltage data and cluster power data.
[0083] For example, there are 150 users in total, and the voltage data and power data corresponding to each of the 150 users are collected. The 150 users are numbered 0 to 149 respectively.
[0084] After cluster analysis of 150 users, 5 clusters are obtained, and these 5 clusters are numbered: 1 to 5.
[0085] Each cluster includes 30 users, and each cluster corresponds to the following users:
[0086] Cluster 1 includes users numbered 0 to 29, cluster 2 includes users numbered 30 to 59, cluster 3 includes users numbered 60 to 89, cluster 4 includes users numbered 90 to 119, and cluster 5 includes users numbered 120 to 149.
[0087] Optionally, cluster analysis is performed on multiple users based on the OPTICS clustering algorithm and respective voltage data of the multiple users, and the steps are as follows.
[0088] 1. Establish an ordered queue and a result queue, wherein the ordered queue includes voltage data corresponding to a plurality of users respectively, wherein the result queue is empty before cluster analysis is performed based on the voltage data;
[0089] 2. Perform n iterative cluster analysis on the voltage data based on the ordered queue and the result queue to obtain n clusters, where n is a positive integer.
[0090] 2.1 When performing the i-th cluster analysis on the voltage data, if there is voltage data in the ordered queue, randomly select a voltage data from the ordered queue to obtain the i-th random voltage data, and transfer the i-th random voltage data from the ordered queue to the result queue, where i is a positive integer not exceeding n;
[0091] 2.2 Obtain a preset neighborhood radius, which is used to determine the neighborhood range of the i-th random voltage data;
[0092] 2.3 In response to the existence of voltage data in the neighborhood range of the i-th random voltage data, determining a reachable distance between the i-th random voltage data and the voltage data in the neighborhood range, and transferring the voltage data in the neighborhood range from the ordered queue to the result queue;
[0093] 2.4 Determine the voltage data with the shortest reachable distance from the i-th voltage data as the i-th core voltage data;
[0094] 2.5 Obtain the preset minimum number of neighborhood points, where the minimum number of neighborhood points refers to the number of voltage data that must exist within the neighborhood of the i-th core voltage data;
[0095] 2.6 In response to the voltage data existing in the neighborhood range of the i-th core voltage data reaching the minimum number of neighborhood points, the voltage data existing in the neighborhood range of the i-th core is transferred from the ordered queue to the result queue;
[0096] 2.7 Determine the i-th cluster based on the voltage data transferred from the ordered queue to the result queue during the i-th cluster analysis.
[0097] Indicative, such as Figure 5 As shown, Figure 5 This is a schematic diagram of the process of clustering analysis of multiple users based on the OPTICS clustering algorithm, which shows the process of clustering analysis once. When there is unaccessed voltage data in the ordered queue, it needs to be repeated as follows: Figure 5 Cluster analysis process 500 is shown.
[0098] Exemplarily, when cluster analysis is not performed, the ordered queue includes voltage data of 150 users respectively, and the result queue is empty.
[0099] The preset neighborhood parameters are (0.1, 10), where 0.1 refers to the neighborhood radius and 10 refers to the minimum number of neighborhood points, that is, the minimum number of voltage data points in the neighborhood. If a voltage data point has at least 10 voltage data points in the neighborhood radius of 0.1, the voltage data point can be used as a core point.
[0100] The OPTICS clustering algorithm mainly involves the following concepts:
[0101] (1) Core distance: The radius that allows the neighborhood of the core point to contain exactly the minimum number of voltage data points in the neighborhood is the core distance. For example, the preset neighborhood parameters are (0.1, 10). In the neighborhood with a radius of 0.1, there are 15 voltage data points. In the neighborhood with a radius of 0.09, there are exactly 10 voltage data points. If the radius is less than 0.09, there are less than 10 voltage data points. If the radius is greater than 0.09, there may be more than 10 voltage data points. Therefore, 0.09 is the core distance.
[0102] (2) Reachable distance: the distance from the core point to other points. There are two cases: In the first case, point P1 is within the core distance range of core point P0, that is, the straight-line distance between point P1 and core point P0 is less than the core distance, and the reachable distance is the core distance; In the second case, point P2 is outside the core distance range of core point P0, that is, the straight-line distance between point P2 and core point P0 is greater than the core distance, and the reachable distance is the straight-line distance.
[0103] When performing n-iteration cluster analysis, first determine whether the ordered queue D is empty. If the ordered queue D is empty, it means that the cluster analysis iteration is completed. If the ordered queue D is not empty, it means that it is necessary to continue executing the following steps: Figure 5 The process shown.
[0104] Among them, the voltage data that has not been visited in the ordered queue D is marked as unvisited. When the voltage data is selected, it is transferred from the ordered queue D to the result queue O, indicating that the voltage data has been visited.
[0105] When performing the i-th cluster analysis, one voltage data u is randomly selected from the ordered queue D, and the voltage data u is transferred from the ordered queue D to the result queue O.
[0106] Get the preset neighborhood parameters: (neighborhood radius r, minimum number of neighborhood points minpoints). If there are other voltage data in the neighborhood range divided based on the neighborhood radius r, arrange the reachable distances between the other voltage data in the neighborhood range and the voltage data u in descending (or ascending) order, and transfer the voltage data u and other voltage data in its neighborhood range from the ordered queue D to the result queue O.
[0107] Select the voltage data q with the smallest reachable distance. If the voltage data q meets the preset neighborhood parameter requirements (neighborhood radius r, minimum number of neighborhood points minpoints), it means that the voltage data q is a core point. Transfer the voltage data q and all voltage data within its neighborhood from the ordered queue D to the result queue O.
[0108] Since the voltage data u and the voltage data q both meet the preset requirements, all the voltage data transferred from the ordered queue D to the result queue O in the above process are grouped as a cluster Q, that is, the users corresponding to these voltage data are grouped as a cluster.
[0109] If the voltage data u does not exist in the neighborhood range divided by the neighborhood radius r, the cluster analysis will end directly and a new voltage data will be selected from the ordered queue D to perform Figure 5 The cluster analysis process 500 in FIG.
[0110] Step 330 : determining the Spearman correlation coefficients corresponding to the plurality of clusters respectively based on the cluster voltage data and the cluster power data.
[0111] Among them, the Spearman correlation coefficient is used to analyze the situation where there are abnormal electricity users in the cluster, and the abnormal electricity users are electricity theft users.
[0112] Optionally, when determining the Spearman correlation coefficient corresponding to the i-th cluster, the voltage data corresponding to multiple users in the j-th cluster are averaged to obtain the cluster voltage data of the j-th cluster; the power data corresponding to multiple users in the j-th cluster are summed to obtain the cluster power data of the j-th cluster; based on the cluster voltage data of the j-th cluster and the cluster power data of the j-th cluster, the Spearman correlation coefficient of the j-th cluster is determined, where j is a positive integer.
[0113] For example, there are 5 clusters, each of which includes 30 users. When determining the Spearman correlation coefficient of the first cluster, the voltage data (voltage amplitude) corresponding to each of the 30 users in the first cluster is averaged to obtain the cluster voltage data; the power data (active power) corresponding to each of the 30 users in the first cluster is summed to obtain the cluster power data.
[0114] Substituting the cluster voltage data and cluster power data of the first cluster into the above relational formula (7) can obtain the Spearman correlation coefficient corresponding to the first cluster. The process of determining the Spearman correlation coefficients of other clusters is the same as above.
[0115] Step 340 , in response to the Spearman correlation coefficient corresponding to the target cluster among the multiple clusters meeting the preset abnormal requirement, based on the voltage data and power data respectively corresponding to the multiple users in the target cluster, determine the abnormal power consumption users from the target cluster.
[0116] Optionally, the abnormal requirement refers to that the Spearman correlation coefficient exceeds a preset coefficient threshold, and the cluster whose Spearman correlation coefficient meets the abnormal requirement is determined as the target cluster.
[0117] In response to the Spearman correlation coefficient of the qth cluster reaching a preset coefficient threshold, determining the qth cluster as a target cluster, where q is a positive integer;
[0118] Based on the voltage data and power data respectively corresponding to a plurality of users in the target cluster, users with abnormal power consumption are determined from the target cluster.
[0119] Each cluster includes multiple users, and each user has corresponding voltage data and power data.
[0120] Generally, since voltage data and power data are not constant values but change over time, when determining the Spearman correlation coefficient based on voltage data and power data, it is necessary to collect the voltage amplitude and active power values at different times in a specified time period, and obtain multiple voltage amplitude-active power subsequences based on the collected discrete voltage amplitude and active power values.
[0121] Exemplarily, N moments are selected in the first time period to collect the voltage amplitude and active power values, and these N moments are also called N sections.
[0122] Indicative, such as Figure 6 As shown, Figure 6 This is a schematic diagram of the daily average active power curve of the three-phase total load of the oil field power grid simulated by a smart telegraph dataset.
[0123] The horizontal axis of the active power curve diagram 600 is time, and the vertical axis is the daily average power corresponding to the user of the meter. The active power curve diagram 600 is a curve fitted based on the collected active power data of N sections.
[0124] For example, there are H clusters in total, and these H clusters contain H1 users in total. The voltage amplitude U is obtained by taking N sections of the voltage data and power data of the H1 users. h , Active power P h , reactive power Q h They are shown in the following relation (8):
[0125]
[0126]
[0127]
[0128] Among them, ρ(h) is the set of users in cluster h, M h is the number of users included in cluster h.
[0129] Sliding the voltage amplitude and load active power time series of the N sections of each cluster with a time window of length l, a total of (N-l+1) voltage amplitude-load active power subsequences can be obtained. The Spearman correlation coefficient between the (N-l+1) voltage amplitude subsequences and load active power subsequences of the H clusters is calculated, as shown in the following relationship (9):
[0130]
[0131] Among them, the relationship (9) is also the relationship obtained by replacing the parameters in the relationship (7) with the voltage amplitude u and the active power p. Among them, R(u) refers to the rank of u, and R(p) refers to the rank of p. is the average rank of u, It refers to the average rank of p.
[0132] Analyze the distribution of the Spearman correlation coefficient, and set the coefficient threshold of the normal range of the Spearman correlation coefficient to △ρ. When the Spearman correlation coefficient of the simulated user voltage amplitude-load active power subsequence is higher than △ρ, the subsequence correlation is determined to be abnormal. Count the number of abnormal subsequences of correlation of cluster h. When the proportion of the number of abnormal subsequences to the total number of subsequences exceeds the proportion threshold, the cluster is determined to be the target cluster. There are users with abnormal electricity consumption in the target cluster, and the specific situation of the abnormal electricity consumption user needs to be further identified.
[0133] Indicative, such as Figure 7 As shown, Figure 7 It is a schematic diagram of the over-limit situation of the Spearman correlation coefficient of the voltage amplitude-active power subsequence. In the figure, the preset coefficient threshold 710 is -0.75, and the Spearman correlation coefficients exceeding -0.75 are all over-limit Spearman correlation coefficients. The number of over-limit coefficients is counted as the proportion of all coefficients, and it can be determined whether the cluster is a target cluster.
[0134] Exemplarily, the first cluster corresponds to 30 subsequences of voltage amplitude-active power. Based on the above 30 subsequences, 30 corresponding Spearman correlation coefficients are obtained. If there is a Spearman correlation coefficient that exceeds the preset coefficient threshold, the subsequence is abnormal. Repeat the above steps and determine the proportion of the number of abnormal subsequences in all subsequences. If the proportion of abnormal subsequences exceeds the preset proportion threshold, the first cluster is determined as the target cluster; if the proportion of abnormal subsequences does not exceed the preset proportion threshold, the first cluster is not the target cluster.
[0135] Optionally, there are 15 abnormal subsequences in the 30 subsequences, the preset proportion threshold is 40%, and the proportion of abnormal subsequences is 50%, which exceeds the preset proportion threshold, and the first cluster is determined as the target cluster.
[0136] In summary, the method provided by the present application collects electrical data corresponding to multiple users, performs cluster analysis on multiple users based on the electrical data, obtains multiple clusters, calculates the Spearman correlation coefficient of each cluster, and determines whether there are users with abnormal electricity consumption in the cluster according to the Spearman correlation coefficient, which can narrow the scope of users with abnormal electricity consumption and improve the efficiency of determining users with abnormal electricity consumption. When there is an abnormality in the Spearman correlation coefficient corresponding to a target cluster among multiple clusters, the abnormal electricity consumption user is further located according to the electrical data corresponding to multiple users in the target cluster. The method of determining users with abnormal electricity consumption based on electrical data and the Spearman correlation coefficient can avoid the influence of environmental interference and improve the accuracy of the identification results of users with abnormal electricity consumption.
[0137] The method provided in this embodiment establishes an ordered queue and a result queue, performs n-time iterative clustering analysis on voltage data based on the OPTICS clustering algorithm, obtains multiple clusters, and can classify multiple users. In the process of searching for users with abnormal electricity consumption, the scope is effectively narrowed, thereby improving the efficiency of determining users with abnormal electricity consumption from the oilfield power grid.
[0138] The method provided in this embodiment takes the average of the voltage data of multiple users in each cluster to obtain the cluster voltage data, and sums the power data to obtain the cluster power data. When the Spearman correlation coefficient is determined based on the cluster voltage data and the cluster power data, the accuracy of the coefficient result can be improved, and the accuracy of the results of determining abnormal electricity users in the oil field power grid is improved.
[0139] After determining the target cluster, it is necessary to check multiple users in the target cluster one by one to determine the users with abnormal electricity usage. This embodiment provides a method for determining users with abnormal electricity usage based on coefficient analysis results.
[0140] like Figure 8 As shown, Figure 8 The present invention is a flow chart of a method for determining abnormal electricity users based on coefficient analysis results, and the method includes the following steps.
[0141] Step 810 , when performing iterative coefficient analysis on the voltage data and power data corresponding to the k-th user, determine the users except the k-th user among the m users as candidate users.
[0142] Optionally, there are m users in the target cluster, where m is a positive integer.
[0143] Based on the voltage data and power data corresponding to m users, m iterative coefficient analysis is performed to obtain m coefficient analysis results, which are used to represent the change of the Spearman correlation coefficient corresponding to the target cluster. Based on the m coefficient analysis results, the abnormal power consumption users are determined.
[0144] k is a positive integer not exceeding m.
[0145] Exemplarily, m is 30, that is, there are 30 users in the target cluster. When performing iterative coefficient analysis on the first user, the remaining 29 users are determined as candidate users.
[0146] Step 820 , taking an average of the voltage data corresponding to a plurality of candidate users, to obtain the voltage data of the candidate users.
[0147] Exemplarily, the voltage data of 29 users are averaged to obtain the voltage data of the candidate users.
[0148] Step 830: sum the power data corresponding to multiple users among the candidate users to obtain the power data of the candidate users.
[0149] Exemplarily, the power data of each of the 29 users is summed to obtain the voltage data of the candidate users.
[0150] It is worth noting that the execution order of step 820 and step 830 can be arbitrary, that is, step 820 can be executed first and then step 830; or step 820 can be executed first and then step 830.
[0151] Step 840: Determine the Spearman correlation coefficient of the candidate user based on the candidate user voltage data and the candidate user power data.
[0152] Substituting the voltage data and power data of the candidate users into equation (8), the Spearman correlation coefficient of the candidate users can be obtained.
[0153] Exemplarily, 9230 cross-sectional data are obtained for the voltage data and power data of 30 users in the target cluster in the first time period to obtain 9230 voltage amplitude-active power subsequences, of which 500 subsequences correspond to the first user and 8830 subsequences correspond to the candidate users.
[0154] Based on equation (8), the Spearman correlation coefficients corresponding to the 8830 subsequences of the candidate users are obtained respectively.
[0155] Step 850: Determine the kth coefficient analysis result based on the Spearman correlation coefficient of the candidate user and the Spearman correlation coefficient of the target cluster.
[0156] Exemplarily, the abnormal subsequences among the 9230 subsequences in the target cluster account for 50% of all subsequences, while the abnormal subsequences among the 8830 subsequences in the candidate users account for 40% of all subsequences. Before and after excluding the first user, the difference of 10% in the proportion of abnormal subsequences is positive, which means that after excluding the voltage data and power data of the first user in the target cluster, the abnormal subsequence decreases, which means that the first user is likely to be an abnormal electricity user.
[0157] Optionally, the first coefficient analysis result is a change in the Spearman correlation coefficient of the target cluster before and after excluding the first user.
[0158] The proportion of abnormal subsequences in all subsequences can also be used as the coefficient analysis result. If the difference in the proportion of abnormal subsequences before and after excluding the kth user is a positive number, it means that the probability of abnormal electricity usage of the kth user is relatively high. Therefore, the probability of abnormal electricity usage of each user can be ranked according to the size of the difference in the proportion of abnormal subsequences, and then the abnormal electricity usage users can be determined. This embodiment does not limit this.
[0159] Repeat steps 810 to 850 for each user in the target cluster, that is, exclude each user in the target cluster once, perform statistics on the changes in the Spearman correlation coefficient (or, perform statistics on the changes in the proportion of abnormal subsequences), and obtain a total of m coefficient analysis results.
[0160] Step 860: Determine users with abnormal electricity consumption based on the m coefficient analysis results.
[0161] The users corresponding to the coefficient analysis results that meet the analysis result requirements among the m coefficient analysis results are determined as abnormal electricity consumption users.
[0162] Optionally, the preset analysis result requirement means that the difference in the Spearman correlation coefficient before and after excluding the kth user reaches a preset threshold, or the difference in the proportion of abnormal subsequences before and after excluding the kth user reaches a preset value.
[0163] Exemplarily, m is 30, and the 30 coefficient analysis results are arranged in descending order. Some of the coefficient analysis results are as follows: the first coefficient analysis result indicates that the difference in the proportion of abnormal subsequences is 10%, the second coefficient analysis result indicates that the difference in the proportion of abnormal subsequences is 5%, and the 30th coefficient analysis result indicates that the difference in the proportion of abnormal subsequences is -20%. The preset analysis result requirement means that before and after excluding the kth user, the difference in the proportion of abnormal subsequences reaches a preset value of 7%. Only the first coefficient analysis result meets the requirement, and the first user corresponding to the first coefficient analysis result is an abnormal electricity consumption user.
[0164] It is worth noting that the above-mentioned method of determining abnormal electricity users can be other methods in addition to determining abnormal electricity users according to the change of the Spearman correlation coefficient before and after excluding the users, and determining abnormal electricity users according to the difference in the proportion of abnormal subsequences. The number of users included in each cluster and the number of sections selected for the user's voltage data and power data can be arbitrary, and the preset abnormal requirements of the Spearman correlation coefficient and the method for determining the coefficient analysis results can be arbitrary, and this embodiment does not limit this.
[0165] In summary, the method provided by the present application collects electrical data corresponding to multiple users, performs cluster analysis on multiple users based on the electrical data, obtains multiple clusters, calculates the Spearman correlation coefficient of each cluster, and determines whether there are users with abnormal electricity consumption in the cluster according to the Spearman correlation coefficient, which can narrow the scope of users with abnormal electricity consumption and improve the efficiency of determining users with abnormal electricity consumption. When there is an abnormality in the Spearman correlation coefficient corresponding to a target cluster among multiple clusters, the abnormal electricity user is further located based on the electrical data corresponding to multiple users in the target cluster. The method of determining users with abnormal electricity consumption based on electrical data and the Spearman correlation coefficient can avoid being affected by environmental interference and improve the accuracy of the identification results of users with abnormal electricity consumption.
[0166] The method provided in this embodiment excludes each user in the target cluster one by one, and gives a probability ranking of abnormal power consumption of users according to the change of the Spearman correlation coefficient before and after the users are excluded, which can improve the accuracy and efficiency of determining users with abnormal power consumption in the oil field power grid.
[0167] In some embodiments, when clustering analysis is performed on multiple users based on the OPTICS clustering algorithm and the voltage data and power data of multiple users, a preset number of sections are first taken for the voltage data and power data to obtain multiple voltage amplitude-active power subsequences, and then the multiple subsequences are clustered to obtain different cluster clusters containing multiple users.
[0168] Exemplarily, the electrical data includes active power data and voltage amplitude data of 150 users respectively taken from a smart meter data set, which contains a total of 25728 sections (the data collection resolution is 30 minutes each time).
[0169] Optionally, the preset neighborhood parameters are (0.1, 10), the neighborhood radius is 0.1, the minimum number of neighborhood points is 10, and the voltage amplitudes of the 25728 sections of the above 150 users are clustered section by section, and the voltage amplitude similarity between all users is obtained by statistics, such as Fig. 9 As shown, Fig. 9 is a schematic diagram of voltage amplitude similarity. In the voltage amplitude similarity graph 900, each voltage amplitude is represented by a node, wherein the horizontal and vertical coordinates of the voltage amplitude similarity graph 900 are recursive distances. Taking the threshold of voltage amplitude similarity as 95% of the total number of sections, the clustering results between users can be obtained as follows: Fig.10 As shown, Fig.10 1000 is a schematic diagram of clustering results, wherein the clustering result schematic diagram 1000 includes five clusters, namely a first cluster 1010 , a second cluster 1020 , a third cluster 1030 , a fourth cluster 1040 and a fifth cluster 1050 .
[0170] According to Fig.10 The clustering result shown further divides the users corresponding to the voltage amplitude to obtain 5 clusters, each of which includes 30 users.
[0171] In summary, the method provided by the present application, based on electrical data and the OPTICS clustering algorithm, performs cluster analysis on multiple users, obtains multiple clusters, calculates the Spearman correlation coefficient of each cluster respectively, and judges whether there are abnormal electricity users in the cluster according to the Spearman correlation coefficient, which can narrow the scope of abnormal electricity users and improve the efficiency of determining abnormal electricity users. It can realize accurate identification and timely alarm of abnormal electricity consumption behavior (such as electricity theft behavior) in the oil field power grid, and improve the accuracy and efficiency of electricity theft identification.
[0172] Fig.11 is a structural block diagram of a device for determining abnormal electricity users provided by an exemplary embodiment of the present application, such as Fig.11 As shown, the device includes the following parts.
[0173] A collection module 1110 is used to collect electrical data, where the electrical data includes voltage data and power data corresponding to a plurality of users respectively;
[0174] A cluster analysis module 1120, configured to perform cluster analysis on the plurality of users based on the voltage data to obtain a plurality of clusters, wherein each cluster includes at least one user, and each of the clusters corresponds to cluster voltage data and cluster power data;
[0175] A correlation analysis module 1130, configured to determine the Spearman correlation coefficients corresponding to the plurality of clusters respectively based on the cluster voltage data and the cluster power data, wherein the Spearman correlation coefficients are used to analyze the existence of users with abnormal electricity consumption in the clusters;
[0176] The correlation analysis module 1130 is also used to determine the abnormal electricity consumption user from the target cluster cluster based on the voltage data and power data corresponding to multiple users in the target cluster cluster in response to the Spearman correlation coefficient corresponding to the target cluster cluster among the multiple cluster clusters meeting the preset abnormality requirements.
[0177] In an optional embodiment, the cluster analysis module 1120 is further used to establish an ordered queue and a result queue, wherein the ordered queue includes voltage data corresponding to the plurality of users respectively, wherein before cluster analysis is performed based on the voltage data, the result queue is empty;
[0178] Based on the ordered queue and the result queue, n iterative clustering analyses are performed on the voltage data to obtain n clusters, where n is a positive integer.
[0179] In an optional embodiment, the cluster analysis module 1120 is further used to, when performing the i-th cluster analysis on the voltage data, randomly select a voltage data from the ordered queue to obtain the i-th random voltage data if there is voltage data in the ordered queue, and transfer the i-th random voltage data from the ordered queue to the result queue, wherein i is a positive integer not exceeding n; obtain a preset neighborhood radius, the neighborhood radius being used to determine the neighborhood range of the i-th random voltage data; in response to the existence of voltage data within the neighborhood range of the i-th random voltage data, determine the reachable distance between the i-th random voltage data and the voltage data within the neighborhood range, and transfer the i-th random voltage data from the ordered queue to the result queue. The voltage data in the neighborhood range is transferred from the ordered queue to the result queue; the voltage data with the shortest reachable distance to the i-th voltage data is determined as the i-th core voltage data; a preset minimum number of neighborhood points is obtained, and the minimum number of neighborhood points refers to the number that the voltage data existing in the neighborhood range of the i-th core voltage data needs to meet; in response to the voltage data existing in the neighborhood range of the i-th core voltage data reaching the minimum number of neighborhood points, the voltage data existing in the neighborhood range of the i-th core is transferred from the ordered queue to the result queue; the i-th cluster cluster is determined based on the voltage data transferred from the ordered queue to the result queue during the i-th cluster analysis.
[0180] In an optional embodiment, the correlation analysis module 1130 is also used to take the average of the voltage data corresponding to multiple users in the j-th cluster to obtain the cluster voltage data of the j-th cluster; sum the power data corresponding to multiple users in the j-th cluster to obtain the cluster power data of the j-th cluster; based on the cluster voltage data of the j-th cluster and the cluster power data of the j-th cluster, determine the Spearman correlation coefficient of the j-th cluster, where j is a positive integer.
[0181] In an optional embodiment, the correlation analysis module 1130 is also used to determine that the qth cluster is the target cluster in response to the Spearman correlation coefficient of the qth cluster reaching a preset coefficient threshold, where q is a positive integer; and determine the abnormal electricity consumption user from the target cluster based on the voltage data and power data corresponding to multiple users in the target cluster.
[0182] In an optional embodiment, there are m users in the target cluster, where m is a positive integer;
[0183] The correlation analysis module 1130 is further used to perform m iteration coefficient analysis based on the voltage data and power data corresponding to the m users, respectively, to obtain m coefficient analysis results, wherein the coefficient analysis results are used to represent the change of the Spearman correlation coefficient corresponding to the target cluster;
[0184] Based on the m coefficient analysis results, the abnormal electricity usage user is determined.
[0185] In an optional embodiment, the correlation analysis module 1130 is also used to perform iterative coefficient analysis on the voltage data and power data corresponding to the kth user, determine the users among the m users except the kth user as candidate users, where k is a positive integer not exceeding m; take the average of the voltage data corresponding to multiple users among the candidate users to obtain the candidate user voltage data; sum the power data corresponding to multiple users among the candidate users to obtain the candidate user power data; determine the Spearman correlation coefficient of the candidate user based on the candidate user voltage data and the candidate user power data; determine the kth coefficient analysis result based on the Spearman correlation coefficient of the candidate user and the Spearman correlation coefficient of the target cluster.
[0186] In an optional embodiment, the correlation analysis module 1130 is further used to determine the user corresponding to the coefficient analysis result that meets the analysis result requirements among the m coefficient analysis results as the abnormal electricity consumption user.
[0187] In summary, the device for determining users with abnormal electricity usage provided by the present application can collect electrical data corresponding to multiple users, perform cluster analysis on multiple users based on the electrical data, obtain multiple clusters, calculate the Spearman correlation coefficient of each cluster respectively, and judge whether there are users with abnormal electricity usage in the cluster according to the Spearman correlation coefficient, which can narrow the scope of users with abnormal electricity usage and improve the efficiency of determining users with abnormal electricity usage. When there is an abnormality in the Spearman correlation coefficient corresponding to a target cluster among multiple clusters, the abnormal electricity usage user is further located according to the electrical data corresponding to multiple users in the target cluster. The method for determining users with abnormal electricity usage based on electrical data and the Spearman correlation coefficient can avoid the influence of environmental interference and improve the accuracy of the identification results of users with abnormal electricity usage.
[0188] It should be noted that the device for determining abnormal electricity users provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device for determining abnormal electricity users provided in the above embodiment and the method for determining abnormal electricity users belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0189] Fig.12 The block diagram of the structure of a computer device 1200 provided by an exemplary embodiment of the present application is shown. The computer device 1200 may be: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, Moving Picture Experts Group Audio Layer 3), an MP4 player (Moving Picture Experts Group Audio Layer IV, Moving Picture Experts Group Audio Layer 4), a laptop computer or a desktop computer. The computer device 1200 may also be called a user device, a portable terminal, a laptop terminal, a desktop terminal or other names.
[0190] Typically, the computer device 1200 includes a processor 1201 and a memory 1202 .
[0191] The processor 1201 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1201 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 1201 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 1201 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1201 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0192] The memory 1202 may include one or more computer-readable storage media, which may be non-transitory. The memory 1202 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 1202 is used to store at least one instruction, which is used to be executed by the processor 1201 to implement the method for determining abnormal electricity users provided in the method embodiment of the present application.
[0193] In some embodiments, the computer device 1200 may further include other components, which may be understood by those skilled in the art. Fig.12 The structure shown in the figure does not constitute a limitation on the computer device 1200, and the computer device 1200 may include more or less components than shown in the figure, or combine some components, or adopt a different component arrangement.
[0194] Optionally, the computer readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a solid state drive (SSD), or an optical disk. Among them, the random access memory may include a resistance random access memory (ReRAM) and a dynamic random access memory (DRAM). The serial numbers of the above embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.
[0195] An embodiment of the present application also provides a computer device, which includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set, or an instruction set, and the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement a method for determining users with abnormal electricity consumption as described in any of the above embodiments of the present application.
[0196] An embodiment of the present application also provides a computer-readable storage medium, in which at least one instruction, at least one program, a code set or an instruction set is stored. The at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement a method for determining users with abnormal electricity consumption as described in any of the above embodiments of the present application.
[0197] The embodiment of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the method for determining an abnormal power user described in any of the above embodiments.
[0198] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0199] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for determining users with abnormal electricity consumption, characterized in that: The method comprises: Collecting electrical data, the electrical data including voltage data and power data corresponding to a plurality of users respectively; Performing cluster analysis on the multiple users based on the voltage data to obtain multiple clusters, wherein each cluster includes at least one user, and each cluster corresponds to cluster voltage data and cluster power data; Determining the Spearman correlation coefficients corresponding to the plurality of clusters respectively based on the cluster voltage data and the cluster power data, wherein the Spearman correlation coefficient is used to analyze the situation in which there are users with abnormal electricity consumption in the cluster; In response to the Spearman correlation coefficient corresponding to a target cluster among the multiple clusters meeting a preset abnormal requirement, the abnormal power consumption user is determined from the target cluster based on voltage data and power data respectively corresponding to multiple users in the target cluster.
2. The method according to claim 1, characterized in that The clustering analysis is performed on the multiple users based on the voltage data to obtain multiple clusters, including: Establishing an ordered queue and a result queue, wherein the ordered queue includes voltage data corresponding to the plurality of users respectively, wherein before cluster analysis is performed based on the voltage data, the result queue is empty; Based on the ordered queue and the result queue, n iterative clustering analyses are performed on the voltage data to obtain n clusters, where n is a positive integer.
3. The method according to claim 2, characterized in that The performing n-times iterative cluster analysis on the voltage data based on the ordered queue and the result queue comprises: When performing the i-th cluster analysis on the voltage data, if there is voltage data in the ordered queue, randomly select a voltage data from the ordered queue to obtain the i-th random voltage data, and transfer the i-th random voltage data from the ordered queue to the result queue, wherein i is a positive integer not exceeding n; Obtaining a preset neighborhood radius, where the neighborhood radius is used to determine a neighborhood range of the i-th random voltage data; In response to the existence of voltage data in a neighborhood range of the i-th random voltage data, determining a reachable distance between the i-th random voltage data and the voltage data in the neighborhood range, and transferring the voltage data in the neighborhood range from the ordered queue to the result queue; Determine the voltage data having the shortest reachable distance from the i-th voltage data as the i-th core voltage data; Obtaining a preset minimum number of neighborhood points, where the minimum number of neighborhood points refers to the number of voltage data that needs to be satisfied within the neighborhood range of the i-th core voltage data; In response to the voltage data existing in the neighborhood range of the i-th core voltage data reaching the minimum number of neighborhood points, transferring the voltage data existing in the neighborhood range of the i-th core from the ordered queue to the result queue; An i-th cluster is determined based on the voltage data transferred from the ordered queue to the result queue during the i-th cluster analysis.
4. The method according to any one of claims 1 to 3, characterized in that: The determining of the Spearman correlation coefficients corresponding to the plurality of clusters respectively based on the cluster voltage data and the cluster power data comprises: Taking an average of the voltage data corresponding to a plurality of users in the j-th cluster, to obtain the cluster voltage data of the j-th cluster; Summing the power data corresponding to a plurality of users in the j-th cluster to obtain cluster power data of the j-th cluster; Based on the cluster voltage data of the j-th cluster and the cluster power data of the j-th cluster, the Spearman correlation coefficient of the j-th cluster is determined, where j is a positive integer.
5. The method according to any one of claims 1 to 3, characterized in that: In response to the Spearman correlation coefficient corresponding to the target cluster among the multiple clusters meeting the preset abnormal requirement, based on the voltage data and power data respectively corresponding to the multiple users in the target cluster, determining the abnormal power consumption user from the target cluster, including: In response to the Spearman correlation coefficient of the qth cluster reaching a preset coefficient threshold, determining the qth cluster as the target cluster, where q is a positive integer; Based on the voltage data and power data respectively corresponding to a plurality of users in the target cluster, the abnormal power consumption user is determined from the target cluster.
6. The method according to claim 5, characterized in that There are m users in the target cluster, where m is a positive integer; The determining the abnormal power consumption user from the target cluster based on the voltage data and power data respectively corresponding to the plurality of users in the target cluster comprises: Perform m iterations of coefficient analysis based on the voltage data and power data corresponding to the m users, respectively, to obtain m coefficient analysis results, wherein the coefficient analysis results are used to indicate changes in the Spearman correlation coefficient corresponding to the target cluster; Based on the m coefficient analysis results, the abnormal electricity usage user is determined.
7. The method according to claim 6, characterized in that The performing m iteration coefficient analysis based on the voltage data and power data respectively corresponding to the m users to obtain m coefficient analysis results includes: When performing iterative coefficient analysis on the voltage data and power data corresponding to the k-th user, users other than the k-th user among the m users are determined as candidate users, where k is a positive integer not exceeding m; Taking an average of the voltage data corresponding to a plurality of users among the candidate users, to obtain the voltage data of the candidate users; Summing the power data corresponding to a plurality of users among the candidate users to obtain the power data of the candidate users; Determine the Spearman correlation coefficient of the candidate user based on the candidate user voltage data and the candidate user power data; Based on the Spearman correlation coefficient of the candidate user and the Spearman correlation coefficient of the target cluster, a kth coefficient analysis result is determined.
8. The method according to claim 7, characterized in that The determining the abnormal electricity consumption user based on the m coefficient analysis results includes: The user corresponding to the coefficient analysis result that meets the analysis result requirements among the m coefficient analysis results is determined as the abnormal electricity consumption user.
9. A device for determining users with abnormal electricity consumption, characterized in that: The device comprises: A collection module, used for collecting electrical data, wherein the electrical data includes voltage data and power data corresponding to a plurality of users respectively; A cluster analysis module, configured to perform cluster analysis on the plurality of users based on the voltage data to obtain a plurality of clusters, wherein each cluster includes at least one user, and each of the clusters corresponds to cluster voltage data and cluster power data; A correlation analysis module, used to determine the Spearman correlation coefficients corresponding to the plurality of clusters respectively based on the cluster voltage data and the cluster power data, wherein the Spearman correlation coefficients are used to analyze the existence of users with abnormal electricity consumption in the clusters; The correlation analysis module is also used to determine the abnormal electricity consumption user from the target cluster cluster based on the voltage data and power data corresponding to multiple users in the target cluster cluster in response to the Spearman correlation coefficient corresponding to the target cluster cluster among the multiple cluster clusters meeting the preset abnormality requirements.
10. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one program, and the at least one program is loaded and executed by the processor to implement the method for determining abnormal electricity users as described in any one of claims 1 to 8.
Citation Information
Cited By
Power consumption anomaly detection method and system based on Bayesian model
CN120892950A