Abnormality detection method and device of energy data, terminal equipment and storage medium
By performing interval division and delay factor calculation on energy data and temperature data, the target energy data is corrected, and the problem of high false alarm rate of abnormal detection of energy data in the prior art is solved, and the detection accuracy and response efficiency are improved.
Patent Information
- Application Number
- CN202510302242.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-14
- Publication Date
- 2025-06-13
AI Technical Summary
Existing energy data anomaly detection algorithms are difficult to accurately identify normal data affected by the delay effect of temperature changes, resulting in high false alarm rates and affecting rapid response and processing efficiency.
By obtaining energy data and temperature data, an initial sequence is constructed, and the interval is divided according to the temperature change trend, the delay factor at each time point is calculated, the abnormal delay factor is determined, and the target energy data is corrected to reflect the data changes after the sudden change of temperature.
It improves the accuracy of abnormal detection of energy data, reduces the false alarm rate, and enhances the rapid response and processing efficiency of real abnormal events.
Smart Images

Figure CN120146626A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and particularly to an abnormal detection method, device, terminal device and storage medium for energy data. Background Art
[0002] Abnormal detection of energy data is a key link to ensure the stable operation and efficient management of the power grid. Abnormal data may reflect equipment failures, data acquisition errors, or energy waste. If not discovered and processed in time, it may lead to resource waste, equipment damage, or safety hazards.
[0003] Currently, existing abnormal detection algorithms usually rely on real-time data for abnormal detection. However, energy data is greatly affected by temperature changes, and the impact of temperature changes on energy data has a delay effect. For example, when the temperature starts to drop suddenly, in the first hour of the temperature drop, the gas consumption does not immediately increase, but after a period of time, the gas consumption surges. Another example is that when the temperature rises suddenly, residents and commercial buildings often gradually adjust the air-conditioning temperature according to the temperature instead of turning it all on immediately, which means that at the initial stage of the temperature rise, the air-conditioning system may not operate at full load immediately, and the demand growth will lag for several hours.
[0004] Since real-time data often cannot accurately reflect this gradually cumulative process of change, the abnormal detection algorithm may misjudge normal data caused by the delay effect as abnormal data, resulting in false alarms, increasing the false alarm rate of the abnormal detection system, and affecting its rapid response and processing efficiency for real abnormal events. Therefore, how to identify and correct the energy data affected by temperature and delayed has become an urgent problem to be solved. Summary of the Invention
[0005] Embodiments of the present invention provide an abnormal detection method, device, terminal device and storage medium for energy data, which can improve the accuracy of abnormal detection of energy data by correcting the delayed energy data affected by sudden temperature changes.
[0006] An embodiment of the present invention provides an abnormal detection method for energy data, including:
[0007] Obtain energy data and temperature data at a plurality of time points, and construct an initial sequence according to the energy data and the temperature data;
[0008] Divide the initial sequence into a plurality of intervals according to the temperature data; wherein, each interval corresponds to a type of temperature change trend;
[0009] Calculate the delay factor for each time point based on the energy data and temperature data at each time point in each of the intervals; wherein, the delay factor is used to characterize the degree of delay of the energy data at the corresponding time point with respect to the temperature data.
[0010] Compare the delay factors for each time point in each of the intervals to determine the abnormal delay factors, and use the time points corresponding to the abnormal delay factors as the delay points.
[0011] Take the intervals other than the delay interval where the delay points are located as the standard intervals, and correct the target energy data of the delay points according to the energy data and temperature data of the standard intervals to generate a corrected sequence to be detected.
[0012] Perform energy data anomaly detection based on the sequence to be detected to generate an energy anomaly data detection result.
[0013] Further, the dividing the initial sequence into several intervals according to the temperature data includes:
[0014] Determine several temperature extreme points according to the initial sequence, and use the time points corresponding to the temperature extreme points as the interval division points.
[0015] Divide the several time points between two adjacent interval division points into the same interval so that each interval corresponds to a type of temperature change trend.
[0016] Further, the types of temperature change trends include: a rising trend and a falling trend.
[0017] The calculating the delay factor for each time point according to the energy data and temperature data at each time point in each of the intervals includes:
[0018] Traverse several of the intervals;
[0019] When it is determined that the interval temperature change trend corresponding to the target interval currently traversed is a rising trend, calculate the delay factor of the target interval according to the following formula:
[0020] α ki = D ki × max{|D ki - D k(i+1) |, |D ki - D k(i-1) |};
[0021] When it is determined that the interval temperature change trend corresponding to the target interval currently traversed is a falling trend, calculate the delay factor of the target interval according to the following formula:
[0022] β ki= max{|D ki - D k(i+1) |, |D ki - D k(i-1) |};
[0023] Wherein, α ki represents the delay factor of the i-th time point in the k-th target interval when the k-th target interval is in a warming trend, and β ki represents the delay factor of the i-th time point in the k-th target interval when the k-th target interval is in a cooling trend. D ki represents the distance between the energy data and the temperature data of the i-th time point in the k-th target interval, and D k(i+1) represents the distance between the energy data and the temperature data of the (i + 1)-th time point in the k-th target interval, and D k(i-1) represents the distance between the energy data and the temperature data of the (i - 1)-th time point in the k-th interval.
[0024] Furthermore, the comparison of the delay factors of each time point in each of the intervals to determine the abnormal delay factors includes:
[0025] Determining the delay factor thresholds for each interval according to all the delay factors in each of the intervals;
[0026] Determining the delay factors greater than the delay factor threshold in each of the intervals as abnormal delay factors.
[0027] Furthermore, taking the intervals other than the delay interval where the delay point is located as standard intervals, and correcting the target energy data of the delay point according to the energy data and temperature data of the standard intervals to generate a corrected sequence to be detected, includes:
[0028] Traversing the delay points;
[0029] Determining a number of first time points with temperature data equal to the target temperature data from a number of time points in the standard interval according to the target temperature data of the currently traversed delay point;
[0030] Determining the first time point with the smallest delay factor among the number of the first time points as the similarity point of the delay point;
[0031] Generating an adjustment factor for the currently traversed delay point according to the energy data of the similarity point;
[0032] When the traversal is completed, correcting the target energy data of each delay point according to the adjustment factors of each delay point to generate a corrected sequence to be detected.
[0033] Further, generating an adjustment factor for the currently traversed delay point based on the energy data and the delay factor of several said similarity points includes:
[0034] Generating an adjustment factor for the currently traversed delay point according to the following formula:
[0035]
[0036] Wherein, represents the delay factor of the similarity point of the nth delay point in the kth delay interval, represents the set of delay factors of all time points in the standard interval where the similarity point is located, γ kn represents the adjustment factor of the nth delay point in the kth interval, represents the target energy data of the nth delay point in the kth delay interval, represents the energy data of the next adjacent time point of the nth delay point in the kth delay interval, represents the energy data of the similarity point of the nth delay point in the kth delay interval.
[0037] Further, correcting the target energy data of each said delay point according to the adjustment factor of each delay point includes:
[0038] Correcting the target energy data of each said delay point according to the following formula:
[0039]
[0040] Wherein, represents the energy correction data after correcting the target energy data of the nth delay point in the kth delay interval, {γ kn} represents the set of adjustment factors of all delay points.
[0041] Another embodiment of the present invention provides an abnormal detection device for energy data, including:
[0042] A data acquisition module, configured to acquire energy data and temperature data at several time points, and construct an initial sequence according to the energy data and the temperature data;
[0043] An interval division module, configured to divide the initial sequence into several intervals according to the temperature data; wherein, each said interval corresponds to a type of temperature change trend;
[0044] A delay evaluation module, configured to calculate the delay factor of each time point according to the energy data and the temperature data of each time point in each said interval; wherein, the delay factor is used to characterize the delay degree of the energy data at the corresponding time point with respect to the temperature data;
[0045] A delay point determination module, configured to compare the delay factors of each time point in each of the intervals, determine abnormal delay factors, and use the time points corresponding to the abnormal delay factors as delay points;
[0046] A data correction module, configured to use the intervals other than the delay interval where the delay point is located as standard intervals, and correct the target energy data of the delay point according to the energy data and temperature data of the standard intervals, to generate a corrected sequence to be detected;
[0047] An anomaly detection module, configured to perform energy data anomaly detection according to the sequence to be detected, and generate an energy anomaly data detection result.
[0048] Another embodiment of the present invention provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements an energy data anomaly detection method as described in any one of the above embodiments.
[0049] Another embodiment of the present invention provides a storage medium, characterized in that the storage medium includes a stored computer program, wherein when the computer program runs, it controls the device where the storage medium is located to execute an energy data anomaly detection method as described in any one of the above embodiments.
[0050] By implementing the present invention, the following beneficial effects are achieved:
[0051] The present invention discloses an energy data anomaly detection method, device, terminal device, and storage medium. The method divides an initial sequence composed of energy data and temperature data at several time points according to the temperature change trend into several intervals, and then calculates the delay factors of each time point in each interval to evaluate the delay degree of the energy data at each time point with respect to the temperature data. Then, by comparing the delay factors in the same temperature change type, abnormal delay factors can be accurately identified, and the corresponding time points are used as delay points. Furthermore, by referring to the energy data and temperature data of the standard intervals with lower delay effects, the target energy data and target temperature data of the delay points are corrected, so that the corrected sequence to be detected can reflect the process of gradual accumulation of energy data after a sudden temperature change, thereby improving the accuracy of energy data anomaly detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 is a schematic flowchart of an energy data anomaly detection method provided by an embodiment of the present invention.
[0053] Figure 2It is a schematic structural diagram of an abnormal detection device for energy data provided by an embodiment of the present invention. Detailed implementation manners
[0054] To make the objectives, technical solutions, and advantages of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Apparently, the described embodiments are some but not all of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art without making creative efforts based on the embodiments in the present application belong to the scope of protection of the present application.
[0055] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which this application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" and any variations thereof in the specification and claims of this application and the above drawings are intended to cover non-exclusive inclusion.
[0056] In the description of the embodiments of this application, technical terms such as "first" and "second" are only used to distinguish different objects and cannot be understood as indicating or implying relative importance or implicitly indicating the quantity, specific order, or primary-secondary relationship of the indicated technical features. In the description of the embodiments of this application, "a plurality of" means two or more, unless otherwise specifically defined.
[0057] Referring to "embodiments" herein means that specific features, structures, or characteristics described in connection with the embodiments can be included in at least one embodiment of this application. The phrase appears in various places in the specification and does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.
[0058] In the description of the embodiments of this application, the term "and / or" is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " herein generally represents an "or" relationship between the associated objects before and after.
[0059] In the description of the embodiments of this application, the term "a plurality of" refers to two or more (including two). Similarly, "a plurality of groups" refers to two or more groups (including two groups), and "a plurality of pieces" refers to two or more pieces (including two pieces).
[0060] In the description of the embodiments of the present application, unless otherwise clearly specified and limited, technical terms such as "installation", "connection", "connection", "fixation", etc. should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or integrated; it can also be a mechanical connection or an electrical connection; it can be directly connected, or indirectly connected through an intermediate medium, and can be the communication inside two components or the interaction relationship between two components. For those of ordinary skill in the art, the specific meanings of the above terms in the embodiments of the present application can be understood according to specific situations.
[0061] See Figure 1 , which is a schematic flow chart of an abnormal detection method for energy data provided by an embodiment of the present invention, including:
[0062] S1. Obtain energy data and temperature data at several time points, and construct an initial sequence according to the energy data and the temperature data;
[0063] In a preferred embodiment of the present invention, the temperature data is the influencing data of the energy data. It can be understood that the embodiments of the present application aim to reduce the delay effect of temperature on the energy data and improve the accuracy of abnormal detection of energy data. Therefore, it is necessary to first obtain the energy data and the temperature data that affect the energy data, and at the same time, ensure that the sampling time intervals of the energy data and the temperature data are consistent, which can provide a basis for subsequent analysis of the delay effect of weather on the energy data.
[0064] In the specific implementation process, obtain the energy data and temperature data at several time points at the same time interval in the energy monitoring system. The time interval can be hours, days, weeks, etc. It should be noted that it is necessary to ensure that the timestamps of the energy data and the temperature data are aligned to avoid data deviation.
[0065] S2. Divide the initial sequence into several intervals according to the temperature data; wherein, each interval corresponds to a type of temperature change trend;
[0066] Preferably, the dividing the initial sequence into several intervals according to the temperature data includes:
[0067] S21. Determine several temperature extreme points according to the initial sequence, and use the time points corresponding to the temperature extreme points as interval division points;
[0068] S22. Divide several time points between two adjacent interval division points into the same interval, so that each interval corresponds to a type of temperature change trend.
[0069] In a preferred embodiment of the present invention, since the temperature data and the energy data are non-linearly related, and the influence trends of different temperatures on the energy data are different. Taking the power consumption as an example, when the temperature gradually rises in summer, the usage of air conditioners and refrigeration equipment will gradually increase, and the power consumption increases with the increase of the temperature data; while when the temperature gradually drops in winter, the usage of heating equipment increases, and the power consumption increases with the decrease of the temperature data.
[0070] Based on this, in this embodiment, first, based on the change trend of the temperature data, the energy data is divided into multiple intervals, and the temperature data corresponding to each interval is increasing or decreasing. Further, the intervals can also be classified based on the temperature values of each interval, separating winter and summer, that is, separating the two different change trends that the energy data increases with the decrease of the temperature data and the energy data increases with the increase of the temperature data, so that different types of temperature data and energy data can be processed independently.
[0071] In the specific implementation process, first, the energy data is divided into multiple intervals by using the temperature data and the interval type of each interval is determined. Among them, the interval type can include the summer interval type and the winter interval type, and the preset classification threshold can be set by the operator according to actual needs. For example, the preset classification threshold can be set to 10 degrees Celsius, and the specific limitation of the preset classification threshold is not given here.
[0072] In the specific implementation process, first, the extreme points of the temperature data are obtained, and then the energy data is divided into multiple intervals based on the time points corresponding to each extreme point. Among them, the temperature data corresponding to each interval is increasing or decreasing.
[0073] S3. Calculate the delay factor of each time point according to the energy data and the temperature data of each time point in each of the intervals; wherein, the delay factor is used to characterize the delay degree of the energy data at the corresponding time point with respect to the temperature data;
[0074] Preferably, the temperature change trend type includes: the rising trend and the falling trend;
[0075] The calculating the delay factor of each time point according to the energy data and the temperature data of each time point in each of the intervals includes:
[0076] S31. Traverse a number of the intervals;
[0077] S32. When it is determined that the interval temperature change trend corresponding to the target interval currently traversed is the rising trend, calculate the delay factor of the target interval according to the following formula:
[0078] α ki =D ki ×max{|D ki-D k(i+1) |,|D ki -D k(i-1) |};
[0079] S33. When it is determined that the temperature change trend corresponding to the target interval currently traversed is a decreasing trend, calculate the delay factor of the target interval according to the following formula:
[0080] β ki = max{|D ki -D k(i+1) |,|D ki -D k(i-1) |};
[0081] Where α ki represents the delay factor at the i-th time point in the k-th target interval when the k-th target interval is in an increasing trend, and β ki represents the delay factor at the i-th time point in the k-th target interval when the k-th target interval is in a decreasing trend. D ki represents the distance between the energy data and the temperature data at the i-th time point in the k-th target interval, and D k(i+1) represents the distance between the energy data and the temperature data at the (i + 1)-th time point in the k-th target interval, and D k(i-1) represents the distance between the energy data and the temperature data at the (i - 1)-th time point in the k-th interval.
[0082] In a preferred embodiment of the present invention, the delay factor is the degree of delay of the energy data at each time point affected by temperature, and the delay point is the time point corresponding to the energy data that is greatly affected by the temperature delay effect.
[0083] It should be noted that since the influence of temperature data on the change trend of energy data is different. For example, in summer, as the temperature rises, the energy consumption increases; while in winter, as the temperature drops, the energy consumption also increases. Therefore, the delay effect caused by weather on energy data of different interval types is also different. For example, if the temperature data (unit: degree Celsius) in a certain interval is 20, 33, 34, 35; taking the electricity consumption as an example for illustration, due to the influence of the delay effect, the electricity consumption corresponding to 30 degrees Celsius does not show a sudden increase, while the electricity consumption corresponding to 31 degrees Celsius shows a sudden increase. The electricity consumption corresponding to this interval (unit: kWh) is 10, 15, 25, 26; calculate the distance between each electricity consumption and its corresponding temperature data. The distance corresponding to 15 kWh is larger than the distances corresponding to 10 kWh, 25 kWh, and 26 kWh, and there are differences between the distance corresponding to 15 kWh and its adjacent two points.
[0084] If the temperature data (in degrees Celsius) in a certain interval is 5, -5, -6, -8; taking the natural gas consumption as an example, due to the influence of the delay effect, the energy data corresponding to this interval, the natural gas consumption corresponding to this interval (in cubic meters) is 15, 17, 30, 31; calculate the distance between each natural gas consumption and its corresponding temperature data. The distance corresponding to 17 cubic meters has differences with the two adjacent points. However, when the temperature is relatively low, as the temperature decreases, the energy data shows an increasing trend. Therefore, the distance corresponding to 17 cubic meters is not always greater than the distances corresponding to other data points within its interval.
[0085] Furthermore, according to the temperature change trend corresponding to the interval, a delay factor representing the delay degree of each data point affected by the weather is obtained. Then, the delay point of the energy data can be determined by the value of the delay factor, that is, the data point with a greater influence degree by the weather delay effect.
[0086] S4. Compare the delay factors of each time point in each of the above intervals, determine the abnormal delay factors, and use the time points corresponding to the abnormal delay factors as the delay points;
[0087] Preferably, the step of comparing the delay factors of each time point in each of the above intervals to determine the abnormal delay factors includes:
[0088] S41. Determine the delay factor thresholds for each interval according to all the delay factors in each of the above intervals;
[0089] S42. Determine the delay factors greater than the delay factor thresholds in each of the above intervals as the abnormal delay factors.
[0090] In a preferred embodiment of the present invention, the delay factor thresholds are set through the delay factors of each interval. It can be understood that the delay factor thresholds can be the mean of all the delay factors in each interval, or the median of all the delay factors, or the mean of the delay factors excluding the maximum and minimum values, etc. Then, for all the time points in this interval, the corresponding time points are selected as the delay points according to the order of the delay factors from large to small.
[0091] S5. Use the intervals other than the delay interval where the delay point is located as the standard intervals, and correct the target energy data of the delay point according to the energy data and temperature data of the standard intervals to generate a corrected sequence to be detected;
[0092] Preferably, the step of using the intervals other than the delay interval where the delay point is located as the standard intervals, and correcting the target energy data of the delay point according to the energy data and temperature data of the standard intervals to generate a corrected sequence to be detected includes:
[0093] S51. Traverse the delay points;
[0094] S52. Determine a number of first time points with temperature data equal to the target temperature data from a number of time points in the standard interval according to the target temperature data of the currently traversed delay point;
[0095] S53. Determine the first time point with the smallest delay factor among the several first time points as the similarity point of the delay point;
[0096] S54. Generate an adjustment factor for the currently traversed delay point according to the energy data of the similarity point;
[0097] Preferably, generating an adjustment factor for the currently traversed delay point according to the energy data and delay factors of the several similarity points includes:
[0098] S541. Generate an adjustment factor for the currently traversed delay point according to the following formula:
[0099]
[0100] Wherein, represents the delay factor of the similarity point of the nth delay point in the kth delay interval, represents the set of delay factors of all time points in the standard interval where the similarity point is located, γ kn represents the adjustment factor of the nth delay point in the kth interval, represents the target energy data of the nth delay point in the kth delay interval, represents the energy data of the next adjacent time point of the nth delay point in the kth delay interval, represents the energy data of the similarity point of the nth delay point in the kth delay interval.
[0101] S55. When the traversal is completed, correct the target energy data of each delay point according to the adjustment factors of each delay point to generate a corrected sequence to be detected.
[0102] Preferably, correcting the target energy data of each delay point according to the adjustment factors of each delay point includes:
[0103] S551. Correct the target energy data of each delay point according to the following formula:
[0104]
[0105] Wherein, represents the energy correction data after correcting the target energy data of the nth delay point in the kth delay interval, {γ kn} represents the set of adjustment factors for all delay points.
[0106] In a preferred embodiment of the present invention, taking any delay point as an example, according to the delay interval where the delay point is located, the change rate of the temperature data of the delay point is calculated. It should be noted that the slope of the temperature data refers to the slope between the temperature data and the temperature data.
[0107] Furthermore, temperature data identical to the temperature data of the delay point is obtained from the temperature data, and the slopes of these temperature data are calculated. It should be noted that if there is no temperature identical to the temperature data of the delay point, the temperature with the smallest difference is obtained.
[0108] It can be understood that if the slope of a certain temperature data point among these temperature data points differs less from the slope of the temperature value, it indicates that the energy data value corresponding to this temperature data point is affected by a temperature change trend similar to that of the delay point. Furthermore, the energy data value corresponding to this temperature data point can be used to adjust the delay point.
[0109] Furthermore, the absolute value of the difference between the slopes of each temperature data point and the slope of the temperature value is calculated, the target sampling time of the temperature data point corresponding to the smallest absolute value of the difference is obtained, and the data point corresponding to this target sampling time is obtained from the energy data. The interval where this data point is located is used as the similar interval of the delay point.
[0110] Furthermore, the delay point is adjusted based on the similar interval to obtain adjusted energy data. It can be understood that if the delay factor of a similar point of a certain delay point is small, it indicates that this similar point is less affected by the weather delay effect. Furthermore, this similar point can be used to adjust the delay point; if the delay factor of this similar point is large, it indicates that this similar point is also affected by a strong weather delay effect. At this time, this similar point cannot be used to correct the delay point, but the adjacent data point with a temperature close to that of the delay point should be used to adjust the delay point.
[0111] S6. Perform energy data anomaly detection according to the to-be-detected sequence, and generate an energy anomaly data detection result.
[0112] In a preferred embodiment of the present invention, the LOF anomaly detection algorithm (Local Outliers Factor) can also be the COF anomaly detection algorithm (Connectivity-Based Outlier Factor) for energy data anomaly detection. This embodiment takes the LOF anomaly detection algorithm as an example for illustration. The LOF anomaly detection algorithm is used to perform anomaly detection on the adjusted energy data, and then the result of the anomaly detection is fed back to the operator for further analysis of the anomaly cause and taking corresponding measures.
[0113] This embodiment provides an abnormal detection method for energy data. By dividing an initial sequence composed of energy data and temperature data at several time points according to the temperature change trend, and then calculating the delay factor of each time point in each interval to evaluate the delay degree of the energy data at each time point with respect to the temperature data. Furthermore, by comparing the delay factors in the same temperature change type, abnormal delay factors can be accurately identified, and the time points corresponding to them are used as delay points. Then, referring to the energy data and temperature data in the standard interval with a lower delay effect, the target energy data and target temperature data at the delay points are corrected, so that the corrected sequence to be detected can reflect the process of gradual accumulation of energy data after a sudden temperature change, thereby improving the accuracy of abnormal detection of energy data.
[0114] See Figure 2 , which is a schematic structural diagram of an abnormal detection device for energy data provided by an embodiment of the present invention, includes:
[0115] A data acquisition module, configured to acquire energy data and temperature data at several time points, and construct an initial sequence according to the energy data and the temperature data;
[0116] An interval division module, configured to divide the initial sequence into several intervals according to the temperature data; wherein, each interval corresponds to a type of temperature change trend;
[0117] A delay evaluation module, configured to calculate the delay factor of each time point according to the energy data and temperature data of each time point in each interval; wherein, the delay factor is used to characterize the delay degree of the energy data at the corresponding time point with respect to the temperature data;
[0118] A delay point determination module, configured to compare the delay factors of each time point in each interval, determine the abnormal delay factors, and use the time points corresponding to the abnormal delay factors as delay points;
[0119] A data correction module, configured to use the intervals other than the delay interval where the delay point is located as standard intervals, and correct the target energy data at the delay point according to the energy data and temperature data of the standard intervals to generate a corrected sequence to be detected;
[0120] An abnormal detection module, configured to perform abnormal detection of energy data according to the sequence to be detected and generate an energy abnormal data detection result.
[0121] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. In addition, in the attached drawings of the device embodiments provided by the present invention, the connection relationship between modules indicates that they have a communication connection, which can be specifically implemented as one or more communication buses or signal lines. Those of ordinary skill in the art can understand and implement it without creative work.
[0122] Those skilled in the art can clearly understand that for the sake of convenience and brevity, the specific working process of the device described above can refer to the corresponding process in the foregoing method embodiment, and will not be repeated here.
[0123] Another preferred embodiment of the present invention provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements an abnormal detection method for energy data as described in any one of the above embodiments.
[0124] The terminal device can be a computing device such as a desktop computer, a notebook, a palm computer, and a cloud server. The terminal device may include, but is not limited to, a processor and a memory.
[0125] The so-called processor may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The processor is the control center of the terminal device, and connects various parts of the entire terminal device through various interfaces and lines.
[0126] The memory can be used to store the computer program. By running or executing the computer program stored in the memory and invoking the data stored in the memory, the processor realizes various functions of the terminal device. The memory mainly includes a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function, etc.; the data storage area can store data created according to the use of the mobile phone, etc. In addition, the memory can include high-speed random access memory and can also include non-volatile memory, such as a hard disk, memory, plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, Flash Card, at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage devices.
[0127] Another preferred embodiment of the present invention provides a storage medium, which is a computer-readable storage medium. The computer program is stored in the computer-readable storage medium. When the computer program is executed by a processor, the steps of the above-mentioned method embodiments can be realized. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc.
[0128] The above are the preferred embodiments of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements are also regarded as the protection scope of the present invention.
Claims
1. A method for detecting anomalies in energy data, characterized in that: include: Acquire energy data and temperature data at a number of time points, and construct an initial sequence based on the energy data and the temperature data; According to the temperature data, the initial sequence is divided into a plurality of intervals; wherein each of the intervals corresponds to a temperature change trend type; Calculate the delay factor at each time point according to the energy data and the temperature data at each time point in each of the intervals; wherein the delay factor is used to characterize the degree of delay of the energy data to the temperature data at the corresponding time point; Comparing the delay factors at each time point in each of the intervals, determining an abnormal delay factor, and taking the time point corresponding to the abnormal delay factor as the delay point; The interval other than the delay interval where the delay point is located is used as a standard interval, and the target energy data of the delay point is corrected according to the energy data and temperature data of the standard interval to generate a corrected sequence to be detected; An energy data anomaly detection is performed according to the sequence to be detected to generate an energy data anomaly detection result.
2. The method for detecting anomalies in energy data according to claim 1, characterized in that: The initial sequence is divided into several intervals according to the temperature data, including: According to the initial sequence, a number of temperature extreme value points are determined, and the time points corresponding to the temperature extreme value points are used as interval division points; A number of time points between two adjacent interval dividing points are divided into the same interval, so that each of the intervals corresponds to a temperature change trend type.
3. The method for detecting anomalies in energy data according to claim 2, characterized in that: The temperature change trend types include: warming trend and cooling trend; The step of calculating the delay factor at each time point according to the energy data and the temperature data at each time point in each of the intervals includes: traversing a number of said intervals; When it is determined that the temperature change trend of the interval corresponding to the currently traversed target interval is a rising trend, the delay factor of the target interval is calculated according to the following formula: α ki =D ki ×max{|D ki -D k(i+1) |,|D ki -D k(i-1) |; When it is determined that the temperature change trend of the interval corresponding to the currently traversed target interval is a cooling trend, the delay factor of the target interval is calculated according to the following formula: β ki =max{|D ki -D k(i+1) |,|D ki -D k(i-1) |}; Among them, α ki Indicates the delay factor at the i-th time point in the k-th target interval when the k-th target interval is a warming trend, β ki Indicates the delay factor at the i-th time point in the k-th target interval when the k-th target interval is a cooling trend, D ki represents the distance between the energy data and temperature data at the i-th time point in the k-th target interval, D k(i+1) represents the distance between the energy data and temperature data at the i+1th time point in the kth target interval, D k(i-1) Represents the distance between the energy data and temperature data at the i-1th time point in the kth interval.
4. The method for detecting anomalies in energy data according to claim 3, characterized in that: The comparing the delay factors at each time point in each of the intervals to determine the abnormal delay factor includes: Determining a delay factor threshold for each interval according to all delay factors in each of the intervals; A delay factor greater than the delay factor threshold in each of the intervals is determined as an abnormal delay factor.
5. The method for detecting anomalies in energy data according to claim 4, characterized in that: The step of taking the delay interval other than the delay interval where the delay point is located as the standard interval, and correcting the target energy data of the delay point according to the energy data and temperature data of the standard interval to generate a corrected sequence to be detected includes: Traversing the delay points; According to the target temperature data of the currently traversed delay point, a plurality of first time points whose temperature data are equal to the target temperature data are determined from a plurality of time points in the standard interval; Determining, from among the first time points, a first time point with a minimum delay factor as a similarity point of the delay points; generating an adjustment factor of a currently traversed delay point according to the energy data of the similar point; When the traversal is completed, the target energy data of each delay point is corrected according to the adjustment factor of each delay point to generate a corrected sequence to be detected.
6. The method for detecting anomalies in energy data according to claim 5, characterized in that: The step of generating the adjustment factor of the currently traversed delay point according to the energy data and the delay factor of the similar points includes: Generate the adjustment factor of the currently traversed delay point according to the following formula: in, represents the delay factor of the similar point of the nth delay point in the kth delay interval, represents the set of delay factors of all time points in the standard interval where the similarity point is located, γ kn represents the adjustment factor of the nth delay point in the kth interval, represents the target energy data of the nth delay point in the kth delay interval, represents the energy data of the next adjacent time point of the nth delay point in the kth delay interval, Represents the energy data of the similar point of the nth delay point in the kth delay interval.
7. The method for detecting anomalies in energy data according to claim 6, characterized in that: The target energy data of each delay point is corrected according to the adjustment factor of each delay point, including: According to the following formula, the target energy data of each delay point is corrected: in, represents the energy correction data after the target energy data of the nth delay point in the kth delay interval is corrected, {γ kn } represents the set of adjustment factors for all delay points.
8. An energy data anomaly detection device, characterized in that: include: A data acquisition module, used to acquire energy data and temperature data at several time points, and construct an initial sequence according to the energy data and the temperature data; An interval division module, used to divide the initial sequence into a number of intervals according to the temperature data; wherein each of the intervals corresponds to a temperature change trend type; A delay evaluation module, used to calculate the delay factor at each time point according to the energy data and the temperature data at each time point in each of the intervals; wherein the delay factor is used to characterize the degree of delay of the energy data to the temperature data at the corresponding time point; A delay point determination module, used to compare the delay factors of each time point in each of the intervals, determine the abnormal delay factor, and use the time point corresponding to the abnormal delay factor as the delay point; A data correction module, used to take the interval other than the delay interval where the delay point is located as a standard interval, and correct the target energy data of the delay point according to the energy data and temperature data of the standard interval to generate a corrected sequence to be detected; The anomaly detection module is used to perform energy data anomaly detection according to the sequence to be detected and generate energy anomaly data detection results.
9. A terminal device, characterized in that: The invention comprises a processor, a memory and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, an abnormality detection method for energy data as described in any one of claims 1 to 7 is implemented.
10. A storage medium, characterized in that: The storage medium includes a stored computer program, wherein when the computer program is executed, the device where the storage medium is located is controlled to execute the method for detecting anomalies in energy data according to any one of claims 1 to 7.