A method and system for processing energy consumption data
By using differential algorithms and predictive models to quickly identify and clean abnormal energy consumption data, this technology solves the problems of insufficient real-time performance and efficiency in existing technologies, and achieves efficient energy consumption data processing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-15
- Publication Date
- 2026-03-10
AI Technical Summary
Existing energy consumption data processing methods are insufficient in terms of real-time performance and efficiency in handling abnormal data. They cannot quickly identify and eliminate abnormal data, especially in cases of periodic jumps, spike jumps, reverse readings, missing data, and negative values commonly found in electricity, water, and gas meter data. Existing methods are computationally complex and have poor real-time performance.
By acquiring real-time energy consumption data, the first-order and second-order difference algorithms are used to calculate the measured energy consumption and changes. The difference exponential smoothing method and the least squares method are combined to predict the energy consumption and changes. A preset feature database is used to identify data anomalies, and cleaning is performed when anomalies are confirmed.
It improves the efficiency of abnormal data processing for real-time energy consumption data, enabling rapid identification and elimination of abnormal data, reducing computational load, and improving processing speed and accuracy.
Smart Images

Figure CN116340299B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing, and in particular to a method and system for processing energy consumption data. Background Technology
[0002] Currently, the processing of energy consumption (electricity, water, gas) meter data mainly addresses the following scenarios: Periodic jumps: The data is consistently unstable, always in a jump state, with large jump amplitudes, often tens of times greater than the actual value; Peak jumps: The data is stable most of the time, but occasionally experiences upward or downward spikes; The output remains unchanged when the liquid level changes, with the displayed level gradually decreasing from the normal value to a very low level; Reverse flow: Due to improper installation of the metering instrument, backflow and eddies occur during valve linkage, causing the meter to run backward; Data loss: Communication abnormalities, with no polling data uploaded for a long time; Negative values: Meter malfunction or protocol read abnormalities; Some water and gas meters use vibration to acquire data, which may cause short-term spikes in values due to environmental influences. Existing methods for handling abnormal data, particularly those based on big data analysis, require large amounts of historical data, and the calculation process is complex, time-consuming, and lacks real-time performance, making them unsuitable for applications using real-time data. Existing time-series-based methods for handling abnormal data cannot reflect the characteristics of data points and cannot quickly eliminate anomalies.
[0003] Therefore, how to improve the efficiency of abnormal data processing of real-time energy consumption data is a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0004] To address the aforementioned technical problems, this application provides a method for processing energy consumption data, which can improve the efficiency of handling abnormal data in real-time energy consumption data. This application also provides a system for processing energy consumption data, which has the same technical effect.
[0005] The first objective of this application is to provide a method for processing energy consumption data.
[0006] The aforementioned objective of this application is achieved through the following technical solution:
[0007] A method for processing energy consumption data includes:
[0008] Obtain real-time energy consumption data;
[0009] The real-time energy consumption data is processed to obtain the measured energy consumption and the measured energy consumption change.
[0010] The measured energy consumption and the measured energy consumption change are processed to obtain the predicted energy consumption and the predicted energy consumption change.
[0011] Based on the measured energy consumption, the measured energy consumption change, the predicted energy consumption, the predicted energy consumption change, and the preset feature database, confirm whether the real-time energy consumption data is abnormal data;
[0012] If the real-time energy consumption data is abnormal, then the real-time energy consumption data will be cleaned.
[0013] The preset feature database includes a preset maximum energy consumption and a preset maximum energy consumption variation.
[0014] Preferably, in the energy consumption data processing method, the step of processing the real-time energy consumption data to obtain the measured energy consumption and the measured energy consumption change includes:
[0015] The real-time energy consumption data is processed using a first-order difference algorithm to obtain the measured energy consumption.
[0016] The real-time energy consumption data is processed using a second-order difference algorithm to obtain the measured change in energy consumption.
[0017] Preferably, in the energy consumption data processing method, the step of processing the measured energy consumption and the measured energy consumption change to obtain the predicted energy consumption and the predicted energy consumption change includes:
[0018] The measured energy consumption and the measured energy consumption change are processed using the first-order difference exponential smoothing method to obtain the first predicted energy consumption and the first predicted energy consumption change.
[0019] The measured energy consumption and the change in measured energy consumption are processed using the second-order difference exponential smoothing method to obtain the second predicted energy consumption and the second predicted change in energy consumption.
[0020] The measured energy consumption and the measured energy consumption change are processed using the least squares method to obtain the third predicted energy consumption and the third predicted energy consumption change.
[0021] The predicted energy consumption is obtained by selecting the value with the largest absolute value from the first predicted energy consumption, the second predicted energy consumption, and the third predicted energy consumption.
[0022] The predicted energy consumption change is obtained by selecting the value with the largest absolute value from the first predicted energy consumption change, the second predicted energy consumption change, and the third predicted energy consumption change.
[0023] Preferably, in the energy consumption data processing method, the step of confirming whether the real-time energy consumption data is abnormal data based on the measured energy consumption, the measured energy consumption change, the predicted energy consumption, the predicted energy consumption change, and a preset feature database includes:
[0024] Based on the measured energy consumption, the measured energy consumption change, the predicted energy consumption, the predicted energy consumption change, and a preset feature database, it is determined whether the real-time energy consumption data meets preset judgment conditions, wherein the preset judgment conditions are specifically:
[0025]
[0026] In the formula, m t The measured energy consumption is represented by l t This indicates the change in the measured energy consumption. This represents the predicted energy consumption. The predicted energy consumption change is represented by m. max Indicates the preset maximum energy consumption, l max This represents the preset maximum energy consumption variation, where γ, δ, θ, and μ represent weighting coefficients;
[0027] If so, then the real-time energy consumption data is confirmed to be non-abnormal data;
[0028] If not, then the real-time energy consumption data is confirmed to be abnormal.
[0029] Preferably, in the method for processing energy consumption data, the step of acquiring real-time energy consumption data includes:
[0030] Select the starting point for the data;
[0031] Real-time energy consumption data is obtained based on the data starting point and the preset sampling period.
[0032] Preferably, in the energy consumption data processing method, if the real-time energy consumption data is abnormal data, the method further includes:
[0033] Determine whether there are consecutive preset number of abnormal data in the real-time energy consumption data.
[0034] If so, return to the step of selecting the starting point of the data.
[0035] Preferably, in the energy consumption data processing method, after confirming whether the real-time energy consumption data is abnormal based on the measured energy consumption, the measured energy consumption change, the predicted energy consumption, the predicted energy consumption change, and a preset feature database, the method further includes:
[0036] If the real-time energy consumption data is non-abnormal, the preset feature database is updated based on the measured energy consumption, the measured energy consumption change, the predicted energy consumption, and the predicted energy consumption change.
[0037] Preferably, in the energy consumption data processing method, after acquiring the real-time energy consumption data, the method further includes:
[0038] The real-time energy consumption data is preprocessed to obtain preprocessed energy consumption data;
[0039] Accordingly, the processing of the real-time energy consumption data to obtain the measured energy consumption and the measured change in energy consumption includes:
[0040] The preprocessed energy consumption data is processed to obtain the measured energy consumption and the measured change in energy consumption.
[0041] Preferably, in the energy consumption data processing method, the calculation formula for the first-order difference exponential smoothing method is as follows:
[0042]
[0043] In the formula, For difference notation, As a parameter, y t This represents the measured energy consumption at time t. Let y represent the first predicted energy consumption at time t, or y t This represents the change in the measured energy consumption at time t. This represents the change in the first predicted energy consumption at time t;
[0044] The calculation formula for the second-order difference exponential smoothing method is as follows:
[0045]
[0046] In the formula, Here, y is the difference notation, β is the parameter, and y is the difference notation. t This represents the measured energy consumption at time t. This represents the second predicted energy consumption at time t, or y t This represents the change in the measured energy consumption at time t. This represents the second predicted energy consumption change at time t;
[0047] The method for processing the energy consumption data further includes:
[0048] Obtain historical energy consumption data, and use the historical energy consumption data to adjust the parameters. The parameter β is calibrated.
[0049] Preferably, in the method for processing energy consumption data, the step of acquiring historical energy consumption data and using the historical energy consumption data to process the parameters... Calibration includes:
[0050] Obtain n sets of historical energy consumption data, where n is a positive integer;
[0051] Process the n sets of historical energy consumption data to obtain n sets of historical measured energy consumption, or process the n sets of historical energy consumption data to obtain n sets of historical measured energy consumption changes.
[0052] The parameters The preset value range is divided into k+1 uniform intervals, resulting in k first division points, where k is a positive integer;
[0053] Based on k of the first segmentation points, the first-order difference exponential smoothing method is used to process the n groups of historical measured energy consumption to obtain k×n groups of first predicted historical energy consumption. Alternatively, based on k of the first segmentation points, the first-order difference exponential smoothing method is used to process the n groups of historical measured energy consumption changes to obtain k×n groups of first predicted historical energy consumption changes.
[0054] Calculate the absolute value of the difference between the first predicted historical energy consumption of each group and the historical measured energy consumption corresponding to the first predicted historical energy consumption of each group, and obtain k×n first differences; or, calculate the absolute value of the difference between the change in the first predicted historical energy consumption of each group and the historical measured energy consumption change corresponding to the change in the first predicted historical energy consumption of each group, and obtain k×n first differences.
[0055] Based on k first segmentation points, k×n first differences are divided into k first data groups. The first predicted historical energy consumption or the first predicted historical energy consumption change corresponding to the first difference in each first data group is obtained based on the same first segmentation point.
[0056] Sum the first differences in the k first data groups according to the data groups to obtain k second differences;
[0057] Selecting m consecutive first dividing points as intervals yields k-m+1 first intervals, where m is a positive integer. <k;
[0058] Based on the first dividing point corresponding to each of the first intervals, the second difference is summed to obtain k-m+1 third differences;
[0059] Select the first interval corresponding to the smallest difference among the k-m+1 third differences as the first target interval;
[0060] The median of the m first segmentation points corresponding to the first target interval is used as the parameter. The final value;
[0061] Accordingly, the step of acquiring historical energy consumption data and using the historical energy consumption data to calibrate the parameter β includes:
[0062] Obtain n sets of historical energy consumption data, where n is a positive integer;
[0063] Process the n sets of historical energy consumption data to obtain n sets of historical measured energy consumption, or process the n sets of historical energy consumption data to obtain n sets of historical measured energy consumption changes.
[0064] The preset range of values for the parameter β is divided into k+1 uniform intervals to obtain k second dividing points, where k is a positive integer;
[0065] Based on k second segmentation points, the second-order difference exponential smoothing method is used to process n groups of historical measured energy consumption to obtain k×n groups of second predicted historical energy consumption; or, based on k second segmentation points, the second-order difference exponential smoothing method is used to process n groups of historical measured energy consumption changes to obtain k×n groups of second predicted historical energy consumption changes.
[0066] Calculate the absolute value of the difference between the second predicted historical energy consumption of each group and the historical measured energy consumption corresponding to the second predicted historical energy consumption of each group, and obtain k×n fourth differences; or, calculate the absolute value of the difference between the change in the second predicted historical energy consumption of each group and the historical measured energy consumption change corresponding to the second predicted historical energy consumption of each group, and obtain k×n fourth differences.
[0067] Based on k second segmentation points, k×n fourth differences are divided into k second data groups, wherein the second predicted historical energy consumption or the second predicted historical energy consumption change corresponding to the fourth difference in each second data group is obtained based on the same second segmentation point.
[0068] Sum the first differences in the k second data groups according to the data groups to obtain k fifth differences;
[0069] Selecting m consecutive second dividing points as intervals yields k-m+1 second intervals, where m is a positive integer. <k;
[0070] Based on the second dividing point corresponding to each second interval, the fifth difference is summed to obtain k-m+1 sixth differences;
[0071] Select the second interval corresponding to the smallest difference among the k-m+1 sixth differences as the second target interval;
[0072] The median of the m second segmentation points corresponding to the second target interval is taken as the final value of the parameter β.
[0073] The second objective of this application is to provide a system for processing energy consumption data.
[0074] The second objective of this application is achieved through the following technical solution:
[0075] An energy consumption data processing system, comprising:
[0076] The data acquisition unit is used to acquire real-time energy consumption data;
[0077] The first processing unit is used to process the real-time energy consumption data to obtain the measured energy consumption and the measured energy consumption change.
[0078] The second processing unit is used to process the measured energy consumption and the measured energy consumption change to obtain the predicted energy consumption and the predicted energy consumption change.
[0079] An anomaly identification unit is used to confirm whether the real-time energy consumption data is abnormal based on the measured energy consumption, the measured energy consumption change, the predicted energy consumption, the predicted energy consumption change, and a preset feature database.
[0080] The data cleaning unit is used to clean the real-time energy consumption data when the real-time energy consumption data is abnormal.
[0081] The preset feature database includes a preset maximum energy consumption and a preset maximum energy consumption variation.
[0082] The above technical solution acquires real-time energy consumption data, processes the data to obtain measured energy consumption and measured energy consumption change. Since real-time energy consumption data is mostly in the form of cumulative values, the calculated measured energy consumption and measured energy consumption change reflect the physical characteristics of the data, and these characteristics can accelerate the detection and processing of abnormal data. The measured energy consumption and measured energy consumption change are further processed to obtain predicted energy consumption and predicted energy consumption change. Based on the measured energy consumption, measured energy consumption change, predicted energy consumption, predicted energy consumption change, and a preset feature database, it is determined whether the real-time energy consumption data is abnormal. The preset feature database includes a preset maximum energy consumption and a preset maximum energy consumption change. Comparing feature values based on these values ensures consistency with the physical characteristics of the energy consumption data and accelerates computation. If the real-time energy consumption data is abnormal, it is then cleaned. Compared to existing anomaly data processing methods, this technical solution does not require extensive data computation and can quickly eliminate anomalies by utilizing the characteristics of real-time energy consumption data. In summary, the above technical solution can improve the efficiency of anomaly data processing for real-time energy consumption data. Attached Figure Description
[0083] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0084] Figure 1 This is a flowchart illustrating a method for processing energy consumption data according to an embodiment of this application;
[0085] Figure 2 This is a schematic diagram of the process for calculating the predicted energy consumption and the predicted change in energy consumption in the embodiments of this application;
[0086] Figure 3 This is another flowchart illustrating a method for processing energy consumption data in an embodiment of this application;
[0087] Figure 4 This is a schematic diagram of the structure of an energy consumption data processing system according to an embodiment of this application. Detailed Implementation
[0088] To enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0089] In the embodiments provided in this application, it should be understood that the disclosed methods and systems can be implemented in other ways. The system embodiments described below are merely illustrative. For example, the division of units and modules is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or modules can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, and can be electrical, mechanical, or other forms.
[0090] In addition, each functional unit in the various embodiments of this application can be integrated into a single processor, or each unit can be a separate device, or two or more units can be integrated into a single device; each functional unit in the various embodiments of this application can be implemented in hardware or in the form of hardware plus software functional units.
[0091] Those skilled in the art will understand that all or part of the steps of the following method embodiments can be implemented by program instructions and related hardware. The aforementioned program instructions can be stored in a computer-readable storage medium. When the program instructions are executed, they perform the steps of the following method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, read-only memory (ROM), magnetic disks, or optical disks.
[0092] It should be understood that the use of terms such as "system," "device," "unit," and / or "module" in this application is merely one method of distinguishing different components, elements, parts, sections, or assemblies at different levels. However, if other terms can achieve the same purpose, they may be replaced by other expressions.
[0093] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "a plurality of" or "several" means two or more, unless otherwise explicitly specified.
[0094] If a flowchart is used in this application, it is used to illustrate the operations performed by the system according to embodiments of this application. It should be understood that the preceding or following operations are not necessarily performed in exact order. Instead, the steps can be processed in reverse order or simultaneously. Furthermore, other operations can be added to these processes, or one or more steps can be removed from them.
[0095] It should also be noted that, in this document, terms such as “comprising,” “including,” or any other variations thereof are intended to cover non-exclusive inclusion, such that an article or device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such an article or device. Without further limitation, an element defined by the phrase “comprising one…” does not exclude the presence of other identical elements in the article or device that includes the aforementioned element.
[0096] The embodiments in this application are written in a progressive manner.
[0097] like Figure 1 As shown in the figure, an embodiment of this application provides a method for processing energy consumption data, including:
[0098] S101. Obtain real-time energy consumption data;
[0099] In S101, the real-time energy consumption data can be energy consumption (electricity, water, gas) meter data. Currently, most raw meter energy consumption data exists in the form of cumulative values. The real-time energy consumption data can be acquired using existing energy consumption data acquisition equipment, and the specific acquisition method does not affect the implementation of this embodiment. One specific implementation of this step is as follows: Select a data starting point; acquire real-time energy consumption data based on the data starting point and a preset sampling period; for example, based on the selected data starting point, select t times the sampling period backward from the current time, and select t energy consumption data points from t periods as the real-time energy consumption data, denoted as D = [d0, d1, d2...d...]. t-1 ], where t is a positive integer.
[0100] S102. Process the real-time energy consumption data to obtain the measured energy consumption and the measured energy consumption change;
[0101] In step S102, the real-time energy consumption data can be processed based on the time period of the data to obtain the measured energy consumption and the measured energy consumption change. Real-time energy consumption data is mostly in the form of cumulative values. The calculated measured energy consumption and measured energy consumption change can reflect the physical characteristics of the real-time energy consumption data. For example, when the real-time energy consumption data is fluid meter data, the measured energy consumption can reflect the current flow rate, and the measured energy consumption change can reflect the current flow velocity. Utilizing these characteristic attributes can accelerate the detection and processing of abnormal data. One specific implementation of this step is as follows: using a first-order difference algorithm to process the real-time energy consumption data to obtain the measured energy consumption; and using a second-order difference algorithm to process the real-time energy consumption data to obtain the measured energy consumption change.
[0102] The calculation formula for the first-order difference algorithm is as follows:
[0103] m t =d t -d t-1
[0104] In the formula, d t This represents the real-time energy consumption data at time t, m t This represents the measured energy consumption at time t;
[0105] Specifically, the calculation formula of the first-order difference algorithm can be used to process the above real-time energy consumption data D=[d0,d1,d2...d t-1 After processing, the corresponding measured energy consumption M = [m1, m2... m t-1 ].
[0106] The calculation formula for the second-order difference algorithm is as follows:
[0107] lt =d t -2d t +d t-2
[0108] In the formula, d t L represents the real-time energy consumption data at time t. t This represents the change in measured energy consumption at time t;
[0109] Specifically, the calculation formula of the second-order difference algorithm can be used to process the above real-time energy consumption data D=[d0,d1,d2...d t-1 After processing, the corresponding measured energy consumption change L = [l2, l3…l] can be obtained. t-1 ].
[0110] S103. Process the measured energy consumption and the measured energy consumption change to obtain the predicted energy consumption and the predicted energy consumption change;
[0111] In S103, a preset algorithm can be used to process the measured energy consumption and the measured energy consumption change to predict the possible values of the data at the current moment and obtain the predicted energy consumption and the predicted energy consumption change. The preset algorithm may include the differential exponential smoothing algorithm and the least squares trend algorithm.
[0112] S104. Based on the measured energy consumption, the measured energy consumption change, the predicted energy consumption, the predicted energy consumption change, and the preset feature database, determine whether the real-time energy consumption data is abnormal data. If the real-time energy consumption data is abnormal data, then execute S105, wherein the preset feature database includes a preset maximum energy consumption and a preset maximum energy consumption change.
[0113] In S104, the preset feature database includes a preset maximum energy consumption and a preset maximum energy consumption change. Feature value comparisons are performed based on the preset maximum energy consumption and the preset maximum energy consumption change, which conforms to the physical characteristics of energy consumption data and can accelerate the calculation speed. The preset maximum energy consumption and the preset maximum energy consumption change can be determined according to the actual energy-consuming equipment. For example, the maximum current of the line can be predetermined based on the equipment model. These can also be obtained through other methods, and this application is not limited to these.
[0114] S105. Clean the real-time energy consumption data;
[0115] In S105, when the real-time energy consumption data is abnormal, the real-time energy consumption data is cleaned. Existing data cleaning methods can be used, and this application does not limit the comparison.
[0116] In the above embodiments, real-time energy consumption data is acquired and processed to obtain measured energy consumption and measured energy consumption change. Since real-time energy consumption data is mostly in the form of cumulative values, the calculated measured energy consumption and measured energy consumption change reflect the physical characteristics of the real-time energy consumption data. These characteristic attributes can accelerate the detection and processing of abnormal data. The measured energy consumption and measured energy consumption change are processed to obtain predicted energy consumption and predicted energy consumption change. Based on the measured energy consumption, measured energy consumption change, predicted energy consumption, predicted energy consumption change, and a preset feature database, it is determined whether the real-time energy consumption data is abnormal. The preset feature database includes a preset maximum energy consumption and a preset maximum energy consumption change. Comparing feature values based on the preset maximum energy consumption and preset maximum energy consumption change conforms to the physical characteristics of the energy consumption data and can accelerate the calculation speed. If the real-time energy consumption data is abnormal, it is then cleaned. Compared to existing anomaly data processing methods, this technical solution does not require extensive data computation and can quickly eliminate anomalies by utilizing the characteristics of real-time energy consumption data. In summary, the above embodiments can improve the efficiency of anomaly data processing for real-time energy consumption data.
[0117] like Figure 2 As shown, based on the above embodiments, one implementation of the step of processing the measured energy consumption and the measured energy consumption change to obtain the predicted energy consumption and the predicted energy consumption change may include the following steps:
[0118] S201. Using the first-order difference exponential smoothing method, the measured energy consumption and the measured energy consumption change are processed to obtain the first predicted energy consumption and the first predicted energy consumption change.
[0119] In S201, the calculation formula for the first-order difference exponential smoothing method is as follows:
[0120]
[0121] In the formula, For difference notation, As a parameter, it is typically taken as 0.1 to 0.4, y t This represents the measured energy consumption at time t. Let y represent the first predicted energy consumption at time t, or y t This represents the change in the measured energy consumption at time t. This represents the first predicted energy consumption change at time t.
[0122] S202. Using the second-order difference exponential smoothing method, the measured energy consumption and the measured energy consumption change are processed to obtain the second predicted energy consumption and the second predicted energy consumption change.
[0123] In S202, the calculation formula for the second-order difference exponential smoothing method is as follows:
[0124]
[0125] In the formula, y is the difference notation, β is a parameter, typically taken as 0.1 to 0.4. t This represents the measured energy consumption at time t. This represents the second predicted energy consumption at time t, or y t This represents the change in the measured energy consumption at time t. This represents the second predicted change in energy consumption at time t.
[0126] S203. Using the least squares method, the measured energy consumption and the measured energy consumption change are processed to obtain the third predicted energy consumption and the third predicted energy consumption change;
[0127] In S203, the calculation formula for the least squares method is as follows:
[0128]
[0129] In the formula, a and b are constants, a represents the slope of the straight line, b represents the initial value, n represents the number of data points, i and t are the indices of the energy consumption or energy consumption change in the sequence, 1≤i≤n, t>n, and y t This represents the third predicted energy consumption, or y t This represents the third predicted change in energy consumption; specifically, y t y represents the numerical value indicating the energy consumption or the trend of energy consumption changes. t =a×t+b The trend of sequence change is represented by a straight line. It should be noted that the execution order of S201, S202, and S203 can be interchanged or executed simultaneously without affecting the implementation of this embodiment.
[0130] S204. Select the value with the largest absolute value from the first predicted energy consumption, the second predicted energy consumption, and the third predicted energy consumption to obtain the predicted energy consumption;
[0131] S205. Select the value with the largest absolute value from the first predicted energy consumption change, the second predicted energy consumption change, and the third predicted energy consumption change to obtain the predicted energy consumption change.
[0132] In S204 and S205, the predicted energy consumption and the predicted energy consumption change are selected from the three sets of predicted quantities based on the principle of the largest absolute value. It should be noted that the execution order of S204 and S205 can be interchanged or executed simultaneously without affecting the implementation of this embodiment.
[0133] In the above implementation steps, the energy consumption and energy consumption change at the current moment are predicted based on the first-order difference exponential smoothing method, the second-order difference exponential smoothing method, and the least squares method. The value with the largest absolute value obtained from the three methods is selected as the reference value for the next step of calculation, which can further speed up the calculation and improve the accuracy of subsequent anomaly detection.
[0134] Based on the above embodiments, one implementation of the step of confirming whether the real-time energy consumption data is abnormal data according to the measured energy consumption, the measured energy consumption change, the predicted energy consumption, the predicted energy consumption change, and the preset feature database may include the following steps:
[0135] S301. Based on the measured energy consumption, the measured energy consumption change, the predicted energy consumption, the predicted energy consumption change, and a preset feature database, determine whether the real-time energy consumption data meets preset judgment conditions. If yes, confirm that the real-time energy consumption data is non-abnormal data; otherwise, confirm that the real-time energy consumption data is abnormal data.
[0136] The preset judgment condition is specifically as follows:
[0137]
[0138] In the formula, m t The measured energy consumption is represented by l t This indicates the change in the measured energy consumption. This represents the predicted energy consumption. The predicted energy consumption change is represented by m. max Indicates the preset maximum energy consumption, l max The preset maximum energy consumption change is represented by γ, δ, θ, and μ, which are weighting coefficients. Based on the 3-Sigma principle, δ and μ are selected from 3 to 5, and γ and θ are selected from 1.5 to 3 (γ can be 1 when the preset maximum energy consumption can be confirmed, and θ can be 1 when the preset maximum energy consumption change can be confirmed).
[0139] It should be noted that if the eigenvalue m is not known in advance... max and l max In the early stages of system operation, the preset judgment condition can be adjusted as follows:
[0140]
[0141] In the formula, m t The measured energy consumption is represented by l t This indicates the change in the measured energy consumption. This represents the predicted energy consumption. The predicted energy consumption change is represented by γ and δ, which are weighting coefficients. Based on the 3-Sigma principle, δ and μ are selected from 3 to 5.
[0142] In other embodiments of this application, the preset feature database may also include a preset average energy consumption and a preset estimated energy consumption change, which can be used as a basis for human verification of data.
[0143] In practical applications, m t <γ×m max The error rate for judgment conditions is the highest; therefore, how to deduce and determine a reasonable value for m is crucial. max This is extremely important. Based on this, this application also provides another method for processing energy consumption data, such as... Figure 3 As shown, it includes:
[0144] S401. Select the starting point for data;
[0145] S402. Obtain real-time energy consumption data based on the data starting point and the preset sampling period;
[0146] S403. Process the real-time energy consumption data to obtain the measured energy consumption and the measured energy consumption change;
[0147] S404. Process the measured energy consumption and the measured energy consumption change to obtain the predicted energy consumption and the predicted energy consumption change;
[0148] For details of the implementation of S401 and S402, please refer to S101 above; for details of the implementation of S403, please refer to S102 above; for details of the implementation of S404, please refer to S201 to S205 above.
[0149] S405. Based on the measured energy consumption, the measured energy consumption change, the predicted energy consumption, the predicted energy consumption change, and the preset feature database, determine whether the real-time energy consumption data meets the preset judgment conditions. If yes, confirm that the real-time energy consumption data is non-abnormal data, and then execute S406. If no, confirm that the real-time energy consumption data is abnormal data, and then execute S407.
[0150] The preset feature database includes a preset maximum energy consumption and a preset maximum energy consumption variation; the preset judgment condition is specifically as follows:
[0151]
[0152] In the formula, m t The measured energy consumption is represented by l t This indicates the change in the measured energy consumption. This represents the predicted energy consumption. The predicted energy consumption change is represented by m. max Indicates the preset maximum energy consumption, l max The preset maximum energy consumption variation is represented by γ, δ, θ, and μ, which represent weighting coefficients. Based on the 3-Sigma principle, δ and μ are selected from 3 to 5, and γ and θ are selected from 1.5 to 3.
[0153] S406. Update the preset feature database based on the measured energy consumption, the measured energy consumption change, the predicted energy consumption, and the predicted energy consumption change;
[0154] In S406, when the current real-time energy consumption data is non-abnormal, the preset feature database is updated using the measured energy consumption, the measured energy consumption change, the predicted energy consumption, and the predicted energy consumption change. The purpose is to use the non-abnormal data to realize the feature value, i.e., the preset maximum energy consumption m. max and the preset maximum energy consumption change amount l max The update, after multiple calculations, can deduce and determine reasonable feature values. The update of the preset feature database can be calculated using the following formula:
[0155]
[0156] In the formula, This represents the predicted energy consumption. This represents the predicted change in energy consumption. This represents the preset maximum energy consumption at time t. n represents the preset maximum energy consumption change at time t. t This indicates that there are n valid data points for this energy consumption point at time t. This represents the average energy consumption at time t. This represents the average change in energy consumption at time t.
[0157] S407. Clean the real-time energy consumption data;
[0158] For details on the specific implementation of S407, please refer to S105 above.
[0159] In this embodiment, when the current real-time energy consumption data is not abnormal, the preset feature database is updated using the calculation results of the real-time energy consumption data. After multiple calculations, reasonable feature values can be deduced to improve the accuracy of anomaly detection.
[0160] In another embodiment based on the above embodiments, if the real-time energy consumption data is abnormal data, it further includes:
[0161] S501. Determine whether there are consecutive preset number of abnormal data in the real-time energy consumption data. If so, return to the step of selecting the data starting point.
[0162] In S501, for situations where continuous abnormal data is caused by changes in the initial value of the instrument (such as changing the meter, zeroing, etc.), statistics are performed by reselecting the data starting point. The system determines whether there is a preset number of consecutive abnormal data points in the real-time energy consumption data, primarily focusing on energy consumption. For example, if the measured energy consumption data obtained based on the real-time energy consumption data shows a preset number of consecutive abnormal data points, the system returns to re-execute the step of selecting the data starting point, using the first abnormal point as the data starting point. Previous data is no longer added to the queue for calculation. Then, the abnormal data is re-determined. If the data is determined to be non-abnormal, the data starting point is successfully updated; if it is determined to be abnormal, the starting point is not updated, and the data continues to be cleaned. In practical applications, the preset number can be set to 7. When more than 7 consecutive energy consumption abnormal points appear, the first 4 points represent the minimum data volume for implementing the algorithm, and the remaining 3 values are used for verification.
[0163] In another embodiment of this application, after acquiring the real-time energy consumption data, the method further includes:
[0164] S601. Preprocess the real-time energy consumption data to obtain preprocessed energy consumption data;
[0165] In S601, specifically, considering that the real-time energy consumption data is generally an accumulated value, negative and zero values in the real-time energy consumption data can be directly identified as abnormal data, and abnormal data is deleted and no longer participates in the calculation.
[0166] Accordingly, the processing of the real-time energy consumption data to obtain the measured energy consumption and the measured change in energy consumption includes:
[0167] S602. Process the preprocessed energy consumption data to obtain the measured energy consumption and the measured energy consumption change.
[0168] In S602, subsequent calculations based on preprocessed energy consumption data can reduce the amount of computation and improve the efficiency of subsequent abnormal data processing.
[0169] To improve the accuracy of anomaly detection, historical energy consumption data can be used to adjust the parameters in the first-order difference exponential smoothing method. In another embodiment of this application, the energy consumption data processing method further includes calibrating the parameter β in the second-order difference exponential smoothing method with the parameter β.
[0170] S701. Obtain historical energy consumption data, and use the historical energy consumption data to adjust the parameters. The parameter β is calibrated.
[0171] The historical energy consumption data can be obtained using existing energy consumption data acquisition equipment, and the specific acquisition method does not affect the implementation of this embodiment. Specifically, the acquisition of historical energy consumption data involves using the historical energy consumption data to adjust the parameters. One way to perform calibration is as follows:
[0172] Obtain n sets of historical energy consumption data, where n is a positive integer;
[0173] Process the n sets of historical energy consumption data to obtain n sets of historical measured energy consumption, or process the n sets of historical energy consumption data to obtain n sets of historical measured energy consumption changes.
[0174] The parameters The preset value range is divided into k+1 uniform intervals, resulting in k first dividing points, where k is a positive integer. The parameter... The preset value range can be (0,1);
[0175] Based on k of the first segmentation points, the first-order difference exponential smoothing method is used to process the n groups of historical measured energy consumption to obtain k×n groups of first predicted historical energy consumption. Alternatively, based on k of the first segmentation points, the first-order difference exponential smoothing method is used to process the n groups of historical measured energy consumption changes to obtain k×n groups of first predicted historical energy consumption changes.
[0176] Calculate the absolute value of the difference between the first predicted historical energy consumption of each group and the historical measured energy consumption corresponding to the first predicted historical energy consumption of each group, and obtain k×n first differences; or, calculate the absolute value of the difference between the change in the first predicted historical energy consumption of each group and the historical measured energy consumption change corresponding to the change in the first predicted historical energy consumption of each group, and obtain k×n first differences.
[0177] Based on k first segmentation points, k×n first differences are divided into k first data groups. The first predicted historical energy consumption or the first predicted historical energy consumption change corresponding to the first difference in each first data group is obtained based on the same first segmentation point.
[0178] The first differences in the k first data groups are summed according to the data groups to obtain k second differences, that is, each first split point corresponds to a second difference.
[0179] Selecting m consecutive first dividing points as intervals yields k-m+1 first intervals, where m is a positive integer. <k;
[0180] Based on the first dividing point corresponding to each first interval, the second difference is summed to obtain k-m+1 third differences, that is, the m second differences corresponding to the m first dividing points corresponding to each first interval are summed to obtain k-m+1 third differences;
[0181] Select the first interval corresponding to the smallest difference among the k-m+1 third differences as the first target interval;
[0182] The median of the m first segmentation points corresponding to the first target interval is used as the parameter. The final value;
[0183] Specifically, one implementation method for acquiring historical energy consumption data and using the historical energy consumption data to calibrate the parameter β is as follows:
[0184] Obtain n sets of historical energy consumption data, where n is a positive integer;
[0185] Process the n sets of historical energy consumption data to obtain n sets of historical measured energy consumption, or process the n sets of historical energy consumption data to obtain n sets of historical measured energy consumption changes.
[0186] The preset value range of the parameter β is divided into k+1 uniform intervals to obtain k second division points, where k is a positive integer and the preset value range of the parameter β can be (0,1).
[0187] Based on k second segmentation points, the second-order difference exponential smoothing method is used to process n groups of historical measured energy consumption to obtain k×n groups of second predicted historical energy consumption; or, based on k second segmentation points, the second-order difference exponential smoothing method is used to process n groups of historical measured energy consumption changes to obtain k×n groups of second predicted historical energy consumption changes.
[0188] Calculate the absolute value of the difference between the second predicted historical energy consumption of each group and the historical measured energy consumption corresponding to the second predicted historical energy consumption of each group, and obtain k×n fourth differences; or, calculate the absolute value of the difference between the change in the second predicted historical energy consumption of each group and the historical measured energy consumption change corresponding to the second predicted historical energy consumption of each group, and obtain k×n fourth differences.
[0189] Based on k second segmentation points, k×n fourth differences are divided into k second data groups, wherein the second predicted historical energy consumption or the second predicted historical energy consumption change corresponding to the fourth difference in each second data group is obtained based on the same second segmentation point.
[0190] The first differences in the k second data groups are summed according to the data groups to obtain k fifth differences, that is, each second dividing point corresponds to a fifth difference.
[0191] Selecting m consecutive second dividing points as intervals yields k-m+1 second intervals, where m is a positive integer. <k;
[0192] Based on the second dividing point corresponding to each second interval, the fifth difference is summed to obtain k-m+1 sixth differences, that is, the m fifth differences corresponding to the m second dividing points corresponding to each second interval are summed to obtain k-m+1 sixth differences;
[0193] Select the second interval corresponding to the smallest difference among the k-m+1 sixth differences as the second target interval;
[0194] The median of the m second segmentation points corresponding to the second target interval is taken as the final value of the parameter β.
[0195] By implementing the above steps and utilizing historical energy consumption data, the parameters are identified. and the target interval of the parameter β, within this target interval, the parameter The value of parameter β is chosen to minimize the error between the total measured and predicted values. Finally, the median of the dividing points within the target interval is selected to adjust the parameter. The parameter β is then calibrated. The width of the target interval is determined by m. In other embodiments of this application, the value of m can be varied multiple times for calibration to improve the accuracy of anomaly detection.
[0196] like Figure 4 As shown, in another embodiment of this application, an energy consumption data processing system is provided, comprising:
[0197] Data acquisition unit 10 is used to acquire real-time energy consumption data;
[0198] The first processing unit 11 is used to process the real-time energy consumption data to obtain the measured energy consumption and the measured energy consumption change.
[0199] The second processing unit 12 is used to process the measured energy consumption and the measured energy consumption change to obtain the predicted energy consumption and the predicted energy consumption change.
[0200] Anomaly identification unit 13 is used to confirm whether the real-time energy consumption data is abnormal based on the measured energy consumption, the measured energy consumption change, the predicted energy consumption, the predicted energy consumption change, and a preset feature database.
[0201] The data cleaning unit 14 is used to clean the real-time energy consumption data when the real-time energy consumption data is abnormal.
[0202] The preset feature database includes a preset maximum energy consumption and a preset maximum energy consumption variation.
[0203] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method of processing energy consumption data, characterized by, The method comprises the following steps: acquiring real-time energy consumption data; processing the real-time energy consumption data to obtain a measured energy consumption amount and a measured energy consumption change amount; processing the measured energy consumption amount and the measured energy consumption change amount to obtain a predicted energy consumption amount and a predicted energy consumption change amount; determining whether the real-time energy consumption data is abnormal data according to the measured energy consumption amount, the measured energy consumption change amount, the predicted energy consumption amount, the predicted energy consumption change amount and a preset characteristic database; if the real-time energy consumption data is abnormal data, performing cleaning processing on the real-time energy consumption data; wherein the preset characteristic database comprises a preset maximum energy consumption amount and a preset maximum energy consumption change amount; the determining whether the real-time energy consumption data is abnormal data according to the measured energy consumption amount, the measured energy consumption change amount, the predicted energy consumption amount, the predicted energy consumption change amount and the preset characteristic database comprises: judging whether the real-time energy consumption data satisfies a preset judgment condition according to the measured energy consumption amount, the measured energy consumption change amount, the predicted energy consumption amount, the predicted energy consumption change amount and the preset characteristic database, wherein the preset judgment condition is specifically: ; In the formula, represents the measured energy consumption amount, represents the measured energy consumption change amount, represents the predicted energy consumption amount, represents the predicted energy consumption change amount, represents the preset maximum energy consumption amount, represents the preset maximum energy consumption change amount, , , , represents a weighting coefficient; and are selected from 3 to 5, and are selected from 1.5 to 3, or, when the preset maximum energy consumption amount can be confirmed, is 1, when the preset maximum energy consumption change amount can be confirmed, is 1. if yes, determining that the real-time energy consumption data is non-abnormal data; if no, determining that the real-time energy consumption data is abnormal data.
2. The method as claimed in claim 1, characterized in that, the processing the real-time energy consumption data to obtain a measured energy consumption amount and a measured energy consumption change amount comprises: processing the real-time energy consumption data by using a first-order difference algorithm to obtain a measured energy consumption amount; processing the real-time energy consumption data by using a second-order difference algorithm to obtain a measured energy consumption change amount.
3. The method as claimed in claim 1, wherein, the processing the measured energy consumption amount and the measured energy consumption change amount to obtain a predicted energy consumption amount and a predicted energy consumption change amount comprises: processing the measured energy consumption amount and the measured energy consumption change amount by using a first-order difference exponential smoothing method to obtain a first predicted energy consumption amount and a first predicted energy consumption change amount; processing the measured energy consumption amount and the measured energy consumption change amount by using a second-order difference exponential smoothing method to obtain a second predicted energy consumption amount and a second predicted energy consumption change amount; processing the measured energy consumption amount and the measured energy consumption change amount by using a least square method to obtain a third predicted energy consumption amount and a third predicted energy consumption change amount; selecting a value with the largest absolute value from the first predicted energy consumption amount, the second predicted energy consumption amount and the third predicted energy consumption amount to obtain a predicted energy consumption amount; selecting a value with the largest absolute value from the first predicted energy consumption change amount, the second predicted energy consumption change amount and the third predicted energy consumption change amount to obtain a predicted energy consumption change amount.
4. The method as claimed in claim 1, wherein, the acquiring real-time energy consumption data comprises: selecting a data starting point; acquiring real-time energy consumption data according to the data starting point and a preset sampling period.
5. The method as claimed in claim 4, characterized in that, if the real-time energy consumption data is abnormal data, further comprising: judging whether there is continuous preset number of abnormal data in the real-time energy consumption data, if yes, returning to execute the step of selecting a data starting point.
6. The method as claimed in claim 1, wherein, The method further comprises: If the real-time energy consumption data is non-abnormal data, updating the preset feature database according to the measured energy consumption amount, the measured energy consumption change amount, the predicted energy consumption amount and the predicted energy consumption change amount.
7. The method as claimed in claim 1, wherein, The method further comprises: preprocessing the real-time energy consumption data to obtain preprocessed energy consumption data; Accordingly, the processing of the real-time energy consumption data to obtain a measured energy consumption amount and a measured energy consumption change amount comprises: processing the preprocessed energy consumption data to obtain a measured energy consumption amount and a measured energy consumption change amount.
8. The method as claimed in claim 3, wherein, The calculation formula of the first-order difference exponential smoothing method is as follows: ; In the formula, is a differential sign, is a parameter, represents the measured energy consumption amount at the time point, represents the first predicted energy consumption amount at the time point, or represents the measured energy consumption change amount at the time point, represents the first predicted energy consumption change amount at the time point. The calculation formula of the second-order difference exponential smoothing method is as follows: ; In the formula, For difference notation, For parameters, Indicates in The measured energy consumption at time [time]. Indicates in The second predicted energy consumption at time t, or, Indicates in The measured change in energy consumption at time t, Indicates in The second predicted change in energy consumption at time t; The method further comprises: acquiring historical energy consumption data, using the historical energy consumption data to calibrate the parameters and the parameters are calibrated.
9. The method as claimed in claim 8, characterized in that, The acquisition history energy consumption data, using the history energy consumption data to the parameter Calibration, comprising: obtaining n groups of historical energy consumption data, wherein n is a positive integer; processing the n groups of historical energy consumption data to obtain n groups of historical measured energy consumption amounts, or processing the n groups of historical energy consumption data to obtain n groups of historical measured energy consumption change amounts; The parameters The preset value range is divided into k+1 uniform intervals to obtain k first division points, where k is a positive integer; Based on the k first segmentation points, using a first-order difference exponential smoothing method, n groups of the historical measured energy consumption quantities are processed respectively to obtain a group of first predicted historical energy consumption quantities, or, based on the k first segmentation points, using a first-order difference exponential smoothing method, n groups of the historical measured energy consumption change quantities are processed respectively to obtain a group of first predicted historical energy consumption change quantities; calculating absolute values of differences between each of the first predicted historical energy consumption amounts and the historical measured energy consumption amounts corresponding to each of the first predicted historical energy consumption amounts, to obtain a first difference value, or calculating absolute values of differences between each of the first predicted historical energy consumption change amounts and the historical measured energy consumption change amounts corresponding to each of the first predicted historical energy consumption change amounts, to obtain a first difference value. Based on k of the first segmentation points, Each first difference is divided into k first data groups, wherein the first predicted historical energy consumption or the first predicted historical energy consumption change corresponding to the first difference in each first data group is obtained based on the same first dividing point. summing the first differences in the k first data groups respectively according to data groups to obtain k second differences; Selecting m continuous first segmentation points as intervals, obtaining first intervals, wherein m is a positive integer, ; summing the second difference values based on the first split points corresponding to each of the first intervals, to obtain a third difference value; From selects the first interval corresponding to the smallest difference value among the third differences as a first target interval; a median value of the m first split points corresponding to the first target interval as the parameter of the final value; Correspondingly, the historical energy consumption data is acquired, the parameter is calibrated by using the historical energy consumption data includes: obtaining n groups of historical energy consumption data, wherein n is a positive integer; processing the n groups of historical energy consumption data to obtain n groups of historical measured energy consumption amounts, or processing the n groups of historical energy consumption data to obtain n groups of historical measured energy consumption change amounts; The parameters The preset value range is divided into k+1 uniform intervals to obtain k second dividing points, where k is a positive integer; Based on the k second split points, the n groups of historical measured energy consumption quantities are processed respectively by using a second-order difference exponential smoothing method to obtain a group of second predicted historical energy consumption quantities, or, based on the k second split points, the n groups of historical measured energy consumption change quantities are processed respectively by using a second-order difference exponential smoothing method to obtain a group of second predicted historical energy consumption change quantities. calculating absolute values of differences between each of the second predicted historical energy consumption amounts and the historical measured energy consumption amounts corresponding to each of the second predicted historical energy consumption amounts, to obtain fourth differences, or calculating absolute values of differences between each of the second predicted historical energy consumption change amounts and the historical measured energy consumption change amounts corresponding to each of the second predicted historical energy consumption change amounts, to obtain fourth differences. Based on k second segmentation points, Each fourth difference is divided into k second data groups, wherein the second predicted historical energy consumption or the second predicted historical energy consumption change corresponding to the fourth difference in each second data group is obtained based on the same second dividing point; summing the fourth differences in the k second data groups respectively according to data groups to obtain k fifth differences; Selecting m continuous second segmentation points as intervals, to obtain second intervals, wherein m is a positive integer, ; summing the fifth difference values based on the second split points corresponding to each of the second intervals, to obtain a sixth difference value; From selects the second interval corresponding to the smallest difference value from the sixth difference values as a second target interval; a median value of the m second split points corresponding to the second target interval as the final value of the parameter .
10. A processing system of energy consumption data, characterized by, The method is applied to the processing of energy consumption data as claimed in claim 1, and comprises: a data acquisition unit configured to acquire real-time energy consumption data; a first processing unit configured to process the real-time energy consumption data to obtain a measured energy consumption amount and a measured energy consumption change amount; a second processing unit configured to process the measured energy consumption amount and the measured energy consumption change amount to obtain a predicted energy consumption amount and a predicted energy consumption change amount; an abnormality identification unit configured to identify whether the real-time energy consumption data is abnormal data according to the measured energy consumption amount, the measured energy consumption change amount, the predicted energy consumption amount, the predicted energy consumption change amount and a preset feature database; a data cleaning unit configured to clean the real-time energy consumption data when the real-time energy consumption data is abnormal data. The preset feature database comprises a preset maximum energy consumption amount and a preset maximum energy consumption change amount.
Citation Information
Patent Citations
Data mining-based intelligent street lamp energy consumption analysis system
CN106886591A
Regional energy consumption monitoring data abnormity early warning method, system and device and storage medium
CN115270933A