Analysis method of abnormal changes in electricity consumption of lonely elderly people by grade and time
Through the analysis methods of grade and time-sharing, combined with probability and month-on-month model, the flexibility and accuracy of monitoring of electricity consumption changes of elderly people in the elderly people in the elderly are solved, and accurate monitoring of electricity consumption and abnormal grading judgment of elderly people in the elderly are realized. Improves electricity safety and provides necessary early warnings.
Patent Information
- Application Number
- CN202111296673.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-03
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2041-11-03
AI Technical Summary
The existing technology lacks universal classification standards and flexibility, making it difficult to effectively monitor abnormal changes in household electricity consumption of elderly people in the elderly, especially the inability to combine day and day electricity consumption changes, resulting in insufficient sensitivity and accuracy in monitoring.
Using the analysis method of graded and time-sharing, the power consumption data is preprocessed, probability models and month-on-month models are introduced, dynamic thresholds and abnormal proportion coefficients are calculated, and abnormal detection and grading judgment of the electricity consumption of the elderly are realized, and the electricity consumption is evaluated. Safety and early warning.
It realizes accurate monitoring and abnormal grading judgment of changes in electricity consumption of elderly people in the elderly, improves the flexibility and accuracy of monitoring, can effectively identify abnormal electricity consumption situations and give necessary warnings, and improves the safety of electricity consumption.
Smart Images

Figure CN114022307B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of big data analysis and home safety measures, and relates to a method for analyzing abnormal changes in electricity consumption of lonely elderly people by grade and time. Background Art
[0002] With the rapid increase of the aging population, the proportion of lonely elderly people in the community is also increasing. Due to their physical factors, special fragility of family situations and lack of knowledge on safe electricity use, this group of people faces huge risks in their home electricity safety, which also limits the use of existing methods such as video surveillance and smart bracelet monitoring, which require high economic requirements. The method of relying on community workers to conduct irregular door-to-door inspections is costly and time-consuming, and does not have the ability to monitor changes in electricity consumption in real time and is not sensitive enough.
[0003] Electricity is a basic civilian need and can reflect the user's behavior at home to a certain extent. The use of electricity data analysis avoids the economic and resource consumption of additional equipment installation, which is a convenient and economical analysis method.
[0004] In the existing solutions, there are only some fixed thresholds to distinguish the power consumption status of users under typical power consumption conditions. This fixed threshold set is used to judge all power consumption conditions, which is not flexible and applicable enough. Or only basic statistics such as the mean are used to calculate a single threshold, which cannot monitor abnormal power consumption changes in a graded manner and lacks specificity for abnormal situations. Or a binary classification method is used to classify user power consumption conditions. It is difficult to play an effective role in the above-mentioned monitoring scenarios. Summary of the invention
[0005] In view of the defects and shortcomings of the prior art, the purpose of the present invention is to provide a hierarchical and time-based analysis method for abnormal changes in electricity consumption of lonely elderly people. It includes: preprocessing the collected electricity consumption data; calculating the dynamic thresholds of each level of daily electricity consumption data, and completing the abnormal detection and abnormal state classification judgment of the daily electricity consumption data to be detected; calculating the dynamic thresholds of each level of daily hourly electricity consumption data, and completing the abnormal detection and abnormal state classification judgment of the hourly data to be detected; calculating the abnormal proportion coefficient of electricity consumption of lonely elderly people, and evaluating the safety of electricity consumption of users.
[0006] It fills the following two gaps in current technology:
[0007] 1. Currently, there is no universal classification standard for the abnormal changes in household electricity consumption of lonely elderly people, and the degree of abnormal changes cannot be effectively classified.
[0008] 2. The current analysis of abnormal electricity consumption of lonely elderly people does not combine diurnal changes with intraday changes, making it difficult to explore the long-term electricity consumption trends and short-term electricity consumption behaviors of the elderly.
[0009] The present invention specifically adopts the following technical solutions:
[0010] A method for analyzing abnormal changes in electricity consumption of lonely elderly people by grade and time, characterized by comprising the following steps:
[0011] Step S1: pre-process the collected electricity consumption data of lonely elderly users, fill in the missing data, and set abnormal electricity consumption classification labels and abnormal judgment conditions at each level;
[0012] Step S2: For the daily electricity data preprocessed in step S1, a probability model is introduced to perform data analysis and feature mining, and anomaly detection and anomaly level discrimination are performed on the daily electricity data to be detected;
[0013] Step S3: for the abnormal electricity consumption data of a certain day in step S2, the hourly electricity consumption data preprocessed by S1 is further introduced into the month-on-month model to detect the abnormality of hourly electricity consumption within the day and distinguish the abnormality level;
[0014] Step S4: Based on the electricity consumption data, the electricity safety of lonely elderly people is evaluated and necessary warnings are issued.
[0015] In step S1, the average power consumption of the user at each time point is first calculated, and the data to be detected is traversed to fill in the missing parts with the average power data; the power consumption data anomalies are divided into power consumption surge anomalies and power consumption decrease anomalies, and the above two situations are divided into different anomaly levels according to the different degrees of power consumption changes.
[0016] Furthermore, step S1 specifically includes the following steps:
[0017] Step S11: Calculate the average power consumption of the unit where the lonely elderly person is located at each moment. The daily power consumption of user x in the past 1 to n days is P x1 , P x2 , ..., P xn , calculate the average daily power consumption and record it as The hourly electricity consumption data of user x in the past 1 to n days are P x1 =[P 1,1 ,P 1,2 ,......,P 1,t ,......],……,P xn =[P n,1 ,P n,2 ,......,P n,t ,......], calculate the average power consumption sample set of the user at each moment and record it as The mean calculation formula is as follows:
[0018]
[0019] where x i represents the data sample set for which the mean is to be calculated, E x represents the mean of the sample set;
[0020] Secondly, traverse the daily electricity data to be tested. If there are missing daily electricity data or negative value anomalies, use the required daily electricity average to fill them; traverse the hourly electricity data to be tested. If there are missing data or negative value anomalies at a certain moment, use the average electricity consumption at that moment to fill them.
[0021] Furthermore, the processing and analysis of the user's daily electricity consumption data in step S2 includes the following steps:
[0022] Step S21: obtaining a user's historical power consumption data set of a certain time window length preprocessed by step S1 as a training set for inputting various probability models, and calculating a dynamic threshold for distinguishing between normal and abnormal power consumption status;
[0023] Step S22: Introduce the cloud model, 3sigma model, and quartile model to calculate the expected daily power consumption sample E of the user respectively x , entropy H e , super entropy H e , standard deviation S, and quartiles Q1, Q2, Q3, Q4; and calculate the dynamic thresholds for distinguishing normal and abnormal power consumption data under each model;
[0024] Step S23: obtaining the daily power consumption data set to be detected that has been preprocessed by step S1 as a test set for inputting the daily power consumption change analysis model;
[0025] Step S24: Compare the test set with the three sets of dynamic thresholds calculated in step S22 respectively. If it is outside the dynamic threshold corresponding to the cloud model, it is defined as a first-level anomaly; if it is within the dynamic threshold corresponding to the cloud model and outside the dynamic threshold of the 3sigma model, it is defined as a second-level anomaly; if it is within the dynamic threshold of the 3sigma model and outside the quartile model, it is defined as a third-level anomaly.
[0026] Furthermore, the processing and analysis of the user's hourly electricity consumption data in step S3 includes the following steps:
[0027] Step S31: for the number of abnormal power consumption days determined in step S2, the power consumption of each time period in the day is determined;
[0028] Step S32: Obtain the user's historical hourly electricity consumption data of a certain time window length preprocessed by step S1, and calculate the average of the hourly electricity consumption within the day as a reference value for determining whether the hourly electricity consumption is normal;
[0029] Step S33: obtaining the hourly electricity consumption data set to be tested that has been processed by step S1 as a test set for the month-on-month model of input hourly electricity consumption;
[0030] Step S34: Calculate the month-on-month coefficient using the month-on-month model to determine whether the data at that moment is within the abnormal value range; if the month-on-month coefficient is greater than 1, it is defined as a first-level abnormality; if the month-on-month coefficient is greater than 0.5 and less than 1, it is defined as a second-level abnormality.
[0031] Furthermore, the month-on-month model specifically includes:
[0032] First, the average hourly electricity consumption sample set obtained by using the user's historical hourly electricity consumption data in step S1 is used. in Represents the average power consumption of user x; this sample set is used as the benchmark value for calculating the month-on-month coefficient in the month-on-month model;
[0033] Secondly, the Z-score algorithm is used to detect the hourly consumption data; the electricity consumption data P of the ith hour in the previous n days is selected. hi =[P 1i ,P 2i ,......,P ni ], the data is standardized and recorded as P hi ′=[P 1i ′,P 2i ′,......,P ni ′], the standardized calculation formula is as follows:
[0034]
[0035] Where P ni represents the electricity consumption in the ith hour of the nth day, represents the average electricity consumption in the ith hour calculated from historical data, σ i represents the standard deviation of electricity consumption in the ith hour, P ni ′ represents the standardized electricity consumption data of the i-th hour in the n-th day;
[0036] If the Z-score of a certain hour in a certain day is greater than 2 and less than 3, it is determined that the power consumption data at that moment may have a small change; all the power consumption that may have abnormalities in the ith hour of the day in the previous n days is recorded as P fi =[P fi1 ,P fi2 ,......,P fim ], calculate its average and compare it with the average power consumption in the i-th hour as the threshold for judging the secondary abnormality in the month-on-month model. The calculation formula is as follows:
[0037]
[0038] If the Z-score of a certain hour is greater than 3, it is determined that the electricity consumption data of that hour may have a large change; all the electricity consumption data that may have a large change in the ith hour of the previous n days is recorded as P si =[P si1 ,P si2 ,......,P sim ], and similarly calculate the threshold for judging the first-level abnormality in the month-on-month model. The calculation formula is as follows:
[0039]
[0040] Similarly, calculate the first-level abnormal threshold and the second-level abnormal threshold corresponding to each hour, denoted as L th1 =[L f1 ,L f2 ,......,L f24 ] and L th2 =[L s1 ,L s2 ,......,L s24 ];
[0041] Finally, the hourly power consumption data P of the day to be detected with abnormal daily power consumption will be h =[P h1 ,P h2 ,......,P hi ,......,P h24 ] Input the month-on-month model and calculate the month-on-month coefficient L i , the calculation formula is as follows:
[0042]
[0043] Among them, L i P represents the month-on-month coefficient at time i on a certain day. hi Indicates the electricity consumption data at time i on a certain day, Indicates the average hourly electricity consumption corresponding to the moment; if the month-on-month coefficient at moment i is greater than L fi Less than L si , then define the sudden increase / decrease of electricity consumption at this moment as less warning, and give a secondary abnormal label; if the month-on-month coefficient is greater than L si , then define the sudden increase / decrease of electricity consumption at this moment as a warning and give a first-level abnormal label.
[0044] Further, in step S4:
[0045] Take D days as the judgment period of daily power consumption change of users, calculate the number of days with abnormal daily power consumption and the corresponding abnormal level within the period, and set the number of days with level 1 abnormality as D1, the number of days with level 2 abnormality as D2, and the number of days with level 3 abnormality as D3. The calculation formula of the abnormal proportion coefficient of daily power consumption change of the lonely elderly user x is as follows:
[0046] D x =(D1×3+D2×2+D3×1) / (D×3) Formula (16)
[0047] The total number of hours with abnormal hourly electricity consumption during the calculation period, assuming that the number of hours with first-level abnormality is H1 and the number of hours with second-level abnormality is H2, then the calculation formula for the abnormal proportion coefficient of hourly electricity consumption change of the lonely elderly user x is as follows:
[0048] H x =(H1×2+H2×1) / ((D1+D2+D3)×24×2) Formula (17)
[0049] The larger the above two proportional coefficients are, the higher the frequency of abnormal changes in the user's electricity consumption. If the abnormal proportional coefficient of the user's daily electricity consumption change is greater than 0.5, and the abnormal proportional coefficient of the hourly electricity consumption change is greater than 0.5, it is defined that there are frequent surges or decreases in electricity consumption in the user's home, and appropriate attention and necessary warnings should be given.
[0050] And, an electronic device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that when the processor executes the program, the steps of the method for analyzing abnormal changes in electricity consumption of lonely elderly people by grade and time are implemented as described above.
[0051] And, a non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that when the computer program is executed by a processor, the steps of the method for analyzing abnormal changes in electricity consumption of lonely elderly people at different levels and time periods as described above are implemented.
[0052] Compared with the prior art, the present invention and its preferred solution detect abnormalities in user electricity consumption data by time and level, and realize accurate monitoring and abnormal classification judgment of household electricity consumption changes of lonely elderly people. The method is simple in principle, objective and reliable in results, has strong promotion value, and can be used for long-term and large-scale monitoring of household electricity consumption changes of lonely elderly people. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments:
[0054] Figure 1A flow chart of a method for analyzing abnormal changes in electricity consumption of lonely elderly people by grade and time in an embodiment of the present invention.
[0055] Figure 2 A schematic diagram of the relationship between the three groups of thresholds used in an embodiment of the present invention. DETAILED DESCRIPTION
[0056] In order to make the features and advantages of this patent more obvious and easy to understand, the following embodiments are specifically described in detail as follows:
[0057] Figure 1 The flowchart of the method for analyzing abnormal changes in electricity consumption of lonely elderly people by grade and time is shown in the embodiment of the present invention. The steps of referring to the figure are as follows:
[0058] 1. Pre-process the collected electricity consumption data of elderly users, fill in the data gaps, and set reasonable electricity consumption anomaly classification labels and anomaly judgment conditions at each level.
[0059] 2. For the daily electricity data preprocessed in step S1, a probability model is introduced to perform data analysis and feature mining, and anomaly detection and anomaly level discrimination are performed on the daily electricity data to be detected.
[0060] 3. For the abnormal electricity consumption data of a certain day in step S2, the hourly electricity consumption data preprocessed by S1 is further introduced into the month-on-month model to detect and grade the abnormal hourly electricity consumption within the day.
[0061] 4. Based on electricity consumption data, assess the safety of electricity use for elderly people living alone and provide necessary warnings.
[0062] For step 1, we first calculate the average power consumption of the elderly at each moment. The daily power consumption of user x in the past 1 to n days is P x1 , P x2 , ..., P xn , calculate the average daily power consumption and record it as The hourly electricity consumption data of user x in the past 1 to n days are P x1 =[P 1,1 ,P 1,2 ,......,P 1,t ,......],……,P xn =[P n,1 ,P n,2 ,......,P n,t ,......], calculate the average power consumption sample set of the user at each moment and record it as The mean calculation formula is as follows:
[0063]
[0064] where x i represents the data sample set for which the mean is to be calculated, E x Represents the mean of the sample set.
[0065] Secondly, traverse the daily electricity data to be tested. If there is missing or negative abnormality in the daily electricity data, use the daily electricity average to fill it. Traverse the hourly electricity data to be tested. If there is missing or negative abnormality in the data at a certain moment, use the average electricity consumption at that moment to fill it.
[0066] At this point, the data preprocessing of daily electricity data and hourly electricity data is completed.
[0067] For step 2, three probability models are introduced for daily electricity consumption data to obtain three sets of dynamic thresholds for distinguishing normal and abnormal electricity consumption. The mathematical relationship between the three sets of thresholds is used as the dividing line for distinguishing different levels of abnormalities.
[0068] First, the cloud model, 3sigma model and quartile model are introduced. The historical daily electricity consumption data within a certain time window preprocessed in step S1 is used as a training set and input into the three probability models respectively to calculate the following basic statistics: the expected spatial distribution of the user's historical electricity consumption data E x , uncertainty from the degree of entropy E n , the hyperentropy H representing the uncertainty of entropy e , standard deviation S and quartiles Q1, Q2, Q3, Q4 of the training set. The calculation formulas for each statistic are as follows:
[0069]
[0070]
[0071]
[0072] where x i represents the daily usage of a user on the i-th day, n represents the length of the selected historical daily usage window is n days, E x Indicates the average daily electricity consumption of a user within n days.
[0073] Secondly, according to the mathematical meaning of each probability model, three sets of dynamic thresholds are calculated. Starting from the mathematical meaning of the probability distribution of the cloud model, it can be known that the upper and lower dynamic threshold algorithm formulas calculated by the model are as follows:
[0074] MAX1=E x +3(E n +3H e ) Formula (5)
[0075] MIN1=E x -3(En +3H e ) Formula (6)
[0076] Based on the mathematical meaning of the 3sigma probability model, the upper and lower dynamic threshold algorithm formulas calculated by the model are as follows:
[0077] MAX2=E x +3S Formula (7)
[0078] MIN2=E x -3S Formula (8)
[0079] Based on the mathematical meaning of the quartile model, the upper and lower dynamic threshold algorithm formulas calculated by the model are as follows:
[0080] MAX3=Q3+1.5×(Q3-Q4) Formula (9)
[0081] MIN3=Q1-1.5×(Q3-Q4) Formula (10)
[0082] Further, repeat the above steps to calculate three sets of dynamic thresholds for j historical data sets, and form two sets of dynamic thresholds, which are upper and lower threshold sets, respectively, denoted as MAX = [MAX 11 ,......,MAX 1j ,MAX 21 ,......,MAX 2j ,MAX 31 ,......,MAX 3j ], the lower threshold set, denoted as MIN = [MIN 11 ,......,MIN 1j ,MIN 21 ,......,MIN 2j ,MIN 31 ,......,MIN 3j ]. The two threshold sets are respectively input into the Kmeans clustering model for clustering with 3 clusters. From the clustering results, we can see that the three threshold sets calculated by the three models are clustered into one category, and there are clear boundaries between the three clusters. The size relationship between the three clusters is: the upper threshold set clustering result: cloud model threshold>3sigma threshold>quartile model threshold; the lower threshold set clustering result: cloud model threshold<3sigma threshold<quartile model threshold. That is, the size relationship between the three threshold sets is as follows: Figure 2 As shown:
[0083] Therefore, the cluster centers of the three clusters after clustering are used as the dynamic thresholds finally output by each probability model and as the reference values for subsequent judgments. That is, the cluster center of the quartile cluster is used as the threshold for defining the third-level anomaly; the cluster center of the 3sigma cluster is used as the threshold for defining the second-level anomaly; and the cluster center of the cloud model cluster is used as the threshold for defining the first-level anomaly.
[0084] Finally, the power consumption data of the day to be tested is compared with the three sets of thresholds obtained above. If the power consumption data falls within the interval of [MIN3, MAX3], it is determined that the power consumption data of the user on that day is normal. If the power consumption data exceeds MAX1 and MIN1, it is determined that the user has a large increase or decrease in power consumption on that day, which is a first-level abnormality; if the power consumption data falls within the range of [MAX2, MAX1] or [MIN1, MIN2], it is determined that the user has an increase or decrease in power consumption on that day, which is a second-level abnormality; if the power consumption data falls within the range of [MAX3, MAX2] or [MIN2, MIN3], it is determined that the user has a slight increase or decrease in power consumption on that day, which is a third-level abnormality.
[0085] At this point, the abnormal value detection and abnormal classification judgment of the user's daily electricity consumption are completed.
[0086] For step S3, after the user's daily electricity consumption data is graded for abnormality in step S2, a month-on-month model is introduced for the hourly electricity consumption data on the days with abnormal daily electricity consumption, and the month-on-month coefficient is calculated. The electricity consumption status and abnormality level of each hour in the day are determined based on the month-on-month coefficient.
[0087] First, the average hourly electricity consumption sample set obtained by using the user's historical hourly electricity consumption data in step S1 is used. in Represents the average power consumption of user x. This sample set is used as the benchmark value for calculating the month-on-month coefficient in the month-on-month model.
[0088] Secondly, the Z-score algorithm is used to detect the hourly consumption data. Select the electricity consumption data P of the first hour of the previous n days. hi =[P 1i ,P 2i ,......,P ni ], the data is standardized and recorded as P hi ′=[P 1i ′,P 2i ′,......,P ni ′], the standardized calculation formula is as follows:
[0089]
[0090] Where P nirepresents the electricity consumption in the ith hour of the nth day, represents the average electricity consumption in the ith hour calculated from historical data, σ i represents the standard deviation of electricity consumption in the ith hour, P ni ′ represents the standardized electricity consumption data of the i-th hour in the n-th day.
[0091] If the Z-score of a certain hour in a certain day is greater than 2 and less than 3, it is determined that the power consumption data at that moment may have a small change. Record all the power consumption that may have abnormalities in the ith hour of the day in the previous n days as P fi =[P fi1 ,P fi2 ,......,P fim ], calculate its average and compare it with the average power consumption in the i-th hour as the threshold for judging the secondary abnormality in the month-on-month model. The calculation formula is as follows:
[0092]
[0093] If the Z-score of a certain hour is greater than 3, it is determined that the electricity consumption data of that hour may have a large change. All the electricity consumption data that may have a large change in the ith hour of the previous n days is recorded as P si =[P si1 ,P si2 ,......,P sim ], and similarly calculate the threshold for judging the first-level abnormality in the month-on-month model. The calculation formula is as follows:
[0094]
[0095] Similarly, calculate the first-level abnormal threshold and the second-level abnormal threshold corresponding to each hour, denoted as L th1 =[L f1 ,L f2 ,......,L f24 ] and L th2 =[L s1 ,L s2 ,......,L s24 ].
[0096] Finally, the hourly power consumption data P of the day to be detected with abnormal daily power consumption will be h =[P h1 ,P h2 ,......,P hi ,......,P h24 ] Input the month-on-month model and calculate the month-on-month coefficient L i , the calculation formula is as follows:
[0097]
[0098] Among them, L i P represents the month-on-month coefficient at time i on a certain day. hi Represents the electricity consumption data at time i on a certain day, Indicates the average hourly electricity consumption corresponding to the time. If the month-on-month coefficient at time i is greater than L fi Less than L si , then define the sudden increase / decrease in electricity consumption at this moment as less warning, and give a secondary abnormal label; if the month-on-month coefficient is greater than L si , then define the sudden increase / decrease of electricity consumption at this moment as a warning and give a first-level abnormal label.
[0099] At this point, the abnormal value detection and abnormal classification judgment of the user's hourly electricity consumption are completed.
[0100] For step S4, D days is used as the user's daily power consumption change judgment period, and the number of days with daily power consumption abnormality and the corresponding abnormality level within the period are calculated. Suppose the number of days with level 1 abnormality is D1, the number of days with level 2 abnormality is D2, and the number of days with level 3 abnormality is D3. The calculation formula for the abnormal proportion coefficient of daily power consumption change of the lonely elderly user x is as follows:
[0101] D x =(D1×3+D2×2+D3×1) / (D×3) Formula (16)
[0102] The total number of hours with abnormal hourly electricity consumption during the calculation period, assuming that the number of hours with first-level abnormality is H1 and the number of hours with second-level abnormality is H2, then the calculation formula for the abnormal proportion coefficient of hourly electricity consumption change of the lonely elderly user x is as follows:
[0103] H x =(H1×2+H2×1) / ((D1+D2+D3)×24×2) Formula (17)
[0104] The larger the above two proportional coefficients, the higher the frequency of abnormal changes in the user's electricity consumption. If the abnormal proportion coefficient of the user's daily electricity consumption change is greater than 0.5, and the abnormal proportion coefficient of the hourly electricity consumption change is greater than 0.5, it is defined that the user's home has frequent surges or decreases in electricity consumption, and appropriate attention and necessary warnings are given.
[0105] The embodiments of the present invention are described in detail above with reference to the accompanying drawings, but the present invention is not limited to the described embodiments. For those skilled in the art, various changes, modifications, substitutions and variations of these embodiments are made without departing from the principles and spirit of the present invention, and still fall within the scope of protection of the present invention.
[0106] The above system and method provided in this embodiment can be stored in a computer-readable storage medium in a coded form and implemented in the form of a computer program, and the basic parameter information required for calculation is input through computer hardware, and the calculation result is output.
[0107] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0108] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0109] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0110] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0111] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
[0112] This patent is not limited to the above-mentioned best implementation method. Anyone can derive other various forms of graded and time-based analysis methods for abnormal changes in electricity consumption of lonely elderly people under the inspiration of this patent. All equal changes and modifications made within the scope of the patent application of this invention should be covered by this patent.
Claims
1. A method for analyzing abnormal changes in electricity consumption of lonely elderly people by grade and time, characterized in that: The following steps are involved: Step S1: pre-process the collected electricity consumption data of lonely elderly users, fill in the missing data, and set abnormal electricity consumption classification labels and abnormal judgment conditions at each level; Step S2: For the daily electricity data preprocessed in step S1, a probability model is introduced to perform data analysis and feature mining, and anomaly detection and anomaly level discrimination are performed on the daily electricity data to be detected; Step S3: for the abnormal electricity consumption data of a certain day in step S2, the hourly electricity consumption data preprocessed by S1 is further introduced into the month-on-month model to detect the abnormality of hourly electricity consumption within the day and distinguish the abnormality level; Step S4: Based on the electricity consumption data, the electricity safety of the elderly living alone is evaluated and necessary warning is issued; The processing and analysis of the user's daily electricity consumption data in step S2 includes the following steps: Step S21: obtaining a user's historical power consumption data set of a certain time window length preprocessed by step S1 as a training set for inputting various probability models, and calculating a dynamic threshold for distinguishing between normal and abnormal power consumption status; Step S22: Introduce the cloud model, 3sigma model, and quartile model to calculate the expected daily power consumption sample E of the user respectively x , entropy H e , super entropy H e , standard deviation S, and quartiles Q1, Q2, Q3, Q4; and calculate the dynamic thresholds for distinguishing normal and abnormal power consumption data under each model; Step S23: obtaining the daily power consumption data set to be detected that has been preprocessed by step S1 as a test set for inputting the daily power consumption change analysis model; Step S24: Compare the test set with the three sets of dynamic thresholds calculated in step S22 respectively. If the test set is outside the dynamic threshold corresponding to the cloud model, it is defined as a first-level anomaly; if the test set is within the dynamic threshold corresponding to the cloud model and outside the dynamic threshold of the 3sigma model, it is defined as a second-level anomaly; if the test set is within the dynamic threshold of the 3sigma model and outside the quartile model, it is defined as a third-level anomaly; The processing and analysis of the user's hourly electricity consumption data in step S3 includes the following steps: Step S31: for the number of abnormal power consumption days determined in step S2, the power consumption of each time period in the day is determined; Step S32: Obtain the user's historical hourly electricity consumption data of a certain time window length preprocessed by step S1, and calculate the average of the hourly electricity consumption within the day as a reference value for determining whether the hourly electricity consumption is normal; Step S33: obtaining the hourly electricity consumption data set to be tested that has been processed by step S1 as a test set for the month-on-month model of input hourly electricity consumption; Step S34: Calculate the month-on-month coefficient using the month-on-month model to determine whether the data for this period is within the abnormal value range; if the month-on-month coefficient is greater than 1, it is defined as a first-level abnormality; if the month-on-month coefficient is greater than 0.5 and less than 1, it is defined as a second-level abnormality.
2. The method for analyzing abnormal changes in electricity consumption of lonely elderly people according to claim 1 is characterized by: In step S1, the average power consumption of the user at each time point is first calculated, and the data to be detected is traversed to fill in the missing parts with the average power data; the power consumption data anomalies are divided into power consumption surge anomalies and power consumption decrease anomalies, and the above two situations are divided into different anomaly levels according to the different degrees of power consumption changes.
3. The method for analyzing abnormal changes in electricity consumption of lonely elderly people according to claim 2 is characterized by: Step S1 specifically includes the following steps: Step S11: Calculate the average power consumption of the unit where the lonely elderly person is located at each moment. The daily power consumption of user x in the past 1 to n days is P x1 , P x2 , ..., P xn , calculate the average daily power consumption and record it as The hourly electricity consumption data of user x in the past 1 to n days are P x1 =[P 1,1 ,P 1,2 ,......,P 1,t ,......],……,P xn =[P n,1 ,P n,2 ,......,P n,t ,......], calculate the average power consumption sample set of the user at each moment and record it as The mean calculation formula is as follows: where x i represents the data sample set for which the mean is to be calculated, E x represents the mean of the sample set; Secondly, traverse the daily electricity data to be tested. If there are missing daily electricity data or negative value anomalies, use the required daily electricity average to fill them; traverse the hourly electricity data to be tested. If there are missing data or negative value anomalies at a certain moment, use the average electricity consumption at that moment to fill them.
4. The method for analyzing abnormal changes in electricity consumption of lonely elderly people according to grade and time according to claim 1 is characterized by: The month-on-month model specifically includes: First, the average hourly electricity consumption sample set obtained by using the user's historical hourly electricity consumption data in step S1 is used. in Represents the average power consumption of user x; this sample set is used as the benchmark value for calculating the month-on-month coefficient in the month-on-month model; Secondly, the Z-score algorithm is used to detect the hourly consumption data; the electricity consumption data P of the ith hour in the previous n days is selected. hi =[P 1i ,P 2i ,......,P ni ], the data is standardized and recorded as P hi ′=[P 1i ′,P 2i ′,......,P ni ′], the standardized calculation formula is as follows: Where P ni represents the electricity consumption in the ith hour of the nth day, represents the average electricity consumption in the ith hour calculated from historical data, σ i represents the standard deviation of electricity consumption in the ith hour, P ni ′ represents the standardized electricity consumption data of the i-th hour in the n-th day; If the Z-score of a certain hour in a certain day is greater than 2 and less than 3, then all abnormal power consumption in the ith hour of the previous n days is recorded as P fi =[P fi1 ,P fi2 ,......,P fim ], calculate its average and compare it with the average power consumption in the i-th hour as the threshold for judging the secondary abnormality in the month-on-month model. The calculation formula is as follows: If the Z-score of a certain hour is greater than 3, then all the electricity consumption with large changes in the ith hour of the previous n days is recorded as P si =[P si1 ,P si2 ,......,P sim ], and similarly calculate the threshold for judging the first-level abnormality in the month-on-month model. The calculation formula is as follows: Similarly, calculate the first-level abnormal threshold and the second-level abnormal threshold corresponding to each hour, denoted as L th1 =[L f1 ,L f2 ,......,L f24 ] and L th2 =[L s1 ,L s2 ,......,L s24 ]; Finally, the hourly power consumption data P of the day to be detected with abnormal daily power consumption will be h =[P h1 ,P h2 ,......,P hi ,......,P h24 ] Input the month-on-month model and calculate the month-on-month coefficient L i , the calculation formula is as follows: Among them, L i P represents the month-on-month coefficient at time i on a certain day. hi Indicates the electricity consumption data at time i on a certain day, Indicates the average hourly electricity consumption corresponding to the moment; if the month-on-month coefficient at moment i is greater than L fi Less than L si , then a secondary abnormal label is given; if the month-on-month coefficient is greater than L si , a first-level abnormal label is given.
5. The method for analyzing abnormal changes in electricity consumption of lonely elderly people according to grade and time according to claim 1 is characterized by: In step S4: Take D days as the judgment period of daily power consumption change of users, calculate the number of days with abnormal daily power consumption and the corresponding abnormal level within the period, and set the number of days with level 1 abnormality as D1, the number of days with level 2 abnormality as D2, and the number of days with level 3 abnormality as D3. The calculation formula of the abnormal proportion coefficient of daily power consumption change of the lonely elderly user x is as follows: D x =(D1×3+D2×2+D3×1) / (D×3) Formula (16) The total number of hours with abnormal hourly electricity consumption during the calculation period, assuming that the number of hours with first-level abnormality is H1 and the number of hours with second-level abnormality is H2, then the calculation formula for the abnormal proportion coefficient of hourly electricity consumption change of the lonely elderly user x is as follows: H x =(H1×2+H2×1) / ((D1+D2+D3)×24×2) Formula (17) The larger the above two proportional coefficients are, the higher the frequency of abnormal changes in the user's electricity consumption. If the abnormal proportional coefficient of the user's daily electricity consumption change is greater than 0.5, and the abnormal proportional coefficient of the hourly electricity consumption change is greater than 0.5, it is defined that there are frequent surges or decreases in electricity consumption in the user's home, and appropriate attention and necessary warnings should be given.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method for analyzing abnormal changes in electricity consumption of lonely elderly people in different levels and time periods are implemented as described in any one of claims 1-5.
7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for analyzing abnormal changes in electricity consumption of lonely elderly people in different levels and time periods are implemented as described in any one of claims 1-5.