Electricity consumption anomaly detection method and device of electricity meter and terminal equipment
By predicting the electricity consumption data of the electricity meter and dynamic update of the alarm rules, the problem of low accuracy of electricity consumption abnormality detection in the prior art is solved, and higher detection accuracy and flexibility are achieved.
Patent Information
- Application Number
- CN202411708227.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-03-18
AI Technical Summary
In the prior art, the accuracy of detection of power consumption abnormalities of smart park electricity meters is low, and it is impossible to effectively match the changes in the power consumption environment or equipment status, resulting in mismatch of alarm rules and reducing detection accuracy.
By obtaining the electricity consumption data of the target electricity meter for a period of time, input the trained electricity consumption data prediction model, predicting the electricity consumption data for a period of time in the future, and updating the alarm rules based on the prediction data, and performing abnormal detection in combination with the current electricity consumption data.
It realizes the timely and precise prediction of electricity consumption trends and updates of alarm rules when the electricity consumption environment or equipment state changes, and improves the accuracy of electricity consumption abnormality detection.
Smart Images

Figure CN119647673A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of electric power monitoring, and in particular, relates to a method, device and terminal equipment for detecting abnormal power consumption of an electric meter. Background Art
[0002] In the security system of smart parks, monitoring of power safety is a key component, which will directly affect the life safety of personnel, the long-term protection of equipment and the improvement of the overall operational efficiency of the park. In power safety monitoring, it is particularly important to be able to issue alarm notifications in a timely and accurate manner when power usage anomalies occur.
[0003] At present, the power safety monitoring of smart parks is often based on the abnormal power consumption detection of the electric meters in the smart parks. By configuring the preset alarm rules in the electric meter, the abnormal power consumption alarm is triggered when the various parameters of the electric meter meet the alarm rules. However, this method often configures fixed alarm rules and preset parameters in the electric meter. When the power consumption environment or equipment status changes, the alarm rules configured in the electric meter may not match the changed power consumption environment or equipment status, which will reduce the accuracy of the abnormal power consumption detection of the electric meter.
[0004] Currently, no effective solution has been proposed for the problem of low accuracy in detecting abnormal power consumption of electric meters in related technologies. Summary of the invention
[0005] The embodiments of the present application provide a method, an apparatus, a terminal device and a computer program product for detecting abnormal power consumption of an electric meter, so as to at least solve the problem of low accuracy in detecting abnormal power consumption of an electric meter in the related art.
[0006] In a first aspect, an embodiment of the present application provides a method for detecting abnormal electricity consumption of an electricity meter, comprising: obtaining first electricity consumption data of a target electricity meter within a first time period, and second electricity consumption data of the target electricity meter within a second time period, wherein the end time of the second time period is before the start time of the first time period; querying a target alarm rule group matching the target electricity meter from a preset alarm rule library, and querying a target alarm rule matching the first time period from the target alarm rule group; inputting the second electricity consumption data into a trained electricity consumption data prediction model to obtain third electricity consumption data of the target electricity meter within a third time period output by the trained electricity consumption data prediction model, wherein the start time of the third time period is after the end time of the first time period; using the third electricity consumption data to update the target alarm rule to obtain an updated target alarm rule; and performing electricity consumption abnormality detection on the target electricity meter based on the first electricity consumption data and the updated target alarm rule.
[0007] In some embodiments, the target alarm rule includes: an alarm type, at least one alarm level corresponding to the alarm type, and a trigger condition corresponding to each alarm level; performing abnormal power consumption detection on the target electric meter based on the first power consumption data and the updated target alarm rule includes: querying the first power consumption parameter corresponding to the alarm type in the updated target alarm rule from the first power consumption data; matching the first power consumption parameter with the trigger conditions corresponding to each alarm level; when the first power consumption parameter matches the trigger condition, determining that abnormal power consumption occurs in the target electric meter, and generating an alarm record, wherein the alarm record includes the alarm type and the alarm level corresponding to the trigger condition.
[0008] In some embodiments, before obtaining the first electricity usage data of the target electricity meter in the first time period and the second electricity usage data of the target electricity meter in the second time period, the method further includes: obtaining the fourth electricity usage data of the target electricity meter in the fourth time period, wherein the start time of the fourth time period is before the start time of the second time period, and the end time of the fourth time period is before the start time of the first time period; dividing the fourth electricity usage data according to a preset time unit to obtain a plurality of historical electricity usage data, wherein each historical electricity usage data corresponds to a historical electricity usage time period; obtaining the historical environmental characteristics of the historical electricity usage time period corresponding to each historical electricity usage data, wherein the historical environmental characteristics include at least two of the following items: weather, temperature, humidity, whether it is a holiday, and the season ; Input each historical electricity consumption data and the historical environmental characteristics corresponding to each historical electricity consumption data into the trained electricity consumption data prediction model to obtain the fifth electricity consumption data of the target electricity meter in the fifth time period output by the trained electricity consumption data prediction model, wherein the start time of the fifth time period is after the end time of the fourth time period; divide the fifth electricity consumption data according to the preset time unit to obtain multiple predicted electricity consumption data, wherein each predicted electricity consumption data corresponds to a predicted electricity consumption time period; based on each predicted electricity consumption data and the predicted electricity consumption time period corresponding to each predicted electricity consumption data, generate multiple target alarm rules, and combine the multiple target alarm rules into a target alarm rule group and store them in a preset alarm rule library, wherein each target alarm rule corresponds to a predicted electricity consumption time period.
[0009] In some embodiments, the target alarm rule includes: an alarm type, at least one alarm level corresponding to the alarm type, and a trigger condition corresponding to each alarm level; the target alarm rule is updated using the third electricity usage data, and the updated target alarm rule includes: querying the third electricity usage parameter corresponding to the alarm type in the target alarm rule from the third electricity usage data; querying the historical electricity usage parameters corresponding to the alarm type in the target alarm rule from each historical electricity usage data; and updating the trigger condition in the target alarm rule when the third electricity usage parameter is greater than the highest value of the historical electricity usage parameters, or less than the lowest value of the historical electricity usage parameters.
[0010] In some embodiments, after determining that the target electricity meter has abnormal electricity consumption and generating an alarm record, the method also includes: storing the alarm record in a preset alarm history record database; querying the historical alarm record corresponding to the target electricity meter from the alarm history record database; if there is a historical alarm record corresponding to the target electricity meter in the alarm history record database, merging the alarm record with the historical alarm record to obtain an alarm merge record, and sending the alarm merge record.
[0011] In some embodiments, querying the first electricity usage parameter corresponding to the alarm type in the updated target alarm rule from the first electricity usage data includes: obtaining the target meter type of the target meter; querying the target mapping rule matching the target meter type from a preset mapping rule library, wherein the mapping rule library includes multiple mapping rules, each mapping rule corresponding to a meter type; based on the target mapping rule, converting the parameter type of each parameter in the first electricity usage data into a template parameter type corresponding to a preset meter template to obtain the target electricity usage data; querying the first electricity usage parameter corresponding to the alarm type in the updated target alarm rule from the target electricity usage data.
[0012] In some embodiments, before inputting the second electricity consumption data into the trained electricity consumption data prediction model, the method also includes: when no target alarm rule group matching the target electricity meter is found in the alarm rule library, obtaining a preset template alarm rule group from the alarm rule library, using the template alarm rule group as the target alarm rule group corresponding to the target electricity meter, and querying the target alarm rule matching the first time period from the target alarm rule group.
[0013] In a second aspect, an embodiment of the present application provides an abnormal power consumption detection device for an electric meter, comprising: an acquisition module, used to acquire first power consumption data of a target electric meter within a first time period, and second power consumption data of the target electric meter within a second time period, wherein the end time of the second time period is before the start time of the first time period; a query module, used to query a target alarm rule group matching the target electric meter from a preset alarm rule library, and query a target alarm rule matching the first time period from the target alarm rule group; a prediction module, used to input the second power consumption data into a trained power consumption data prediction model, and obtain third power consumption data of the target electric meter within a third time period output by the trained power consumption data prediction model, wherein the start time of the third time period is after the end time of the first time period; an update module, used to update the target alarm rule using the third power consumption data, and obtain an updated target alarm rule; a detection module, used to perform power consumption abnormality detection on the target electric meter based on the first power consumption data and the updated target alarm rule.
[0014] In a third aspect, an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for detecting abnormal electricity consumption of an electric meter according to any one of the first aspects above is implemented.
[0015] In a fourth aspect, an embodiment of the present application provides a computer program product, including a computer program. When the computer program is executed, the method for detecting abnormal power consumption of an electric meter described in any one of the first aspects above is executed.
[0016] Compared with the related art, the method, apparatus, terminal device and computer program product for detecting abnormal electricity consumption of an electric meter provided by the embodiments of the present application first obtain the electricity consumption data of the target electric meter in the past period of time (i.e., the second electricity consumption data); then, the second electricity consumption data is input into the trained electricity consumption data prediction model to obtain the electricity consumption data of the target electric meter in the future period of time (i.e., the third electricity consumption data) predicted by the electricity consumption data prediction model; then, the target alarm rule corresponding to the target electric meter is updated based on the third electricity consumption data; finally, the target electric meter is detected for abnormality using the current electricity consumption data of the target electric meter (i.e., the first electricity consumption data) and the updated target alarm rule. By predicting the power consumption data of the target meter in the future, the latest power consumption trend of the target meter can be predicted in a timely and accurate manner when the power consumption environment or device status of the target meter changes; in addition, by updating the target alarm rules based on the power consumption data of the target meter in the future, the target alarm rules can be updated in a timely manner when the power consumption environment or device status of the target meter changes, so that the updated target alarm rules are more closely matched with the current power consumption environment and device status of the target meter, thereby improving the accuracy of subsequent power consumption anomaly detection of the target meter using the updated target alarm rules. Through this application, the problem of low accuracy in power consumption anomaly detection of the meter in the related art is solved, and the technical effect of improving the accuracy of power consumption anomaly detection of the meter is achieved.
[0017] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0019] Figure 1 is a flow chart of a method for detecting abnormal power consumption of an electric meter according to an embodiment of the present application;
[0020] Figure 2 is a flowchart of constructing an alarm rule library according to an embodiment of the present application;
[0021] Figure 3 is a schematic diagram of the structure of an alarm rule library according to an embodiment of the present application;
[0022] Figure 4 is a flow chart of updating target alarm rules according to an embodiment of the present application;
[0023] Figure 5 It is a structural schematic diagram of a power consumption anomaly detection device of an electric meter according to an embodiment of the present application;
[0024] Figure 6 It is a structural diagram of a terminal device according to an embodiment of the present application. DETAILED DESCRIPTION
[0025] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0026] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0027] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0028] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0029] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0030] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0031] In the security system of smart parks, monitoring of power safety is a key component, which will directly affect the life safety of personnel, the long-term protection of equipment and the improvement of the overall operational efficiency of the park. In power safety monitoring, it is particularly important to be able to issue alarm notifications in a timely and accurate manner when power usage anomalies occur. To this end, establishing a reasonable and flexibly adjustable alarm rule configuration method is the basis for ensuring the efficient operation of the alarm system.
[0032] At present, the power safety monitoring of smart parks is often achieved by detecting abnormal power usage of electric meters in smart parks. By configuring preset alarm rules in the electric meter, when various parameters of the electric meter meet the alarm rules, the abnormal power usage alarm is triggered. However, this method has the following shortcomings:
[0033] (1) Slow response time and low accuracy: This method often configures fixed alarm rules and preset parameters in the meter. When the power consumption environment or device status changes, the alarm rules configured in the meter may not match the changed power consumption environment or device status. Usually, manual intervention is required to manually adjust and update the alarm rules. This not only increases the response time, but may also cause lag and inaccuracy in the alarm, making it difficult to cope with rapidly changing scenarios.
[0034] (2) Increased workload and error risk: Traditional alarm rule configuration methods require managers to manually adjust alarm rules. The adjustment process is cumbersome and time-consuming, and the workload of managers is significantly increased when performing these tasks. At the same time, manual operations also increase the risk of incorrect alarm rule configuration. These errors not only lead to inconsistent alarm rules, but also may cause the accuracy of the alarm system to decrease, making it impossible to ensure the safe operation of the smart park.
[0035] (3) Potential risks to system security: Traditional alarm rule configuration methods rely on manual adjustment and maintenance, which is time-consuming and labor-intensive. The relatively complex operation process not only reduces the response speed of the alarm system, but also provides opportunities for the emergence of system vulnerabilities to a certain extent, which will reduce the overall reliability and stability of the alarm system.
[0036] With the development of smart parks, the requirements for power safety will become more stringent. Traditional alarm rule configuration methods have certain limitations in adapting to new technologies and meeting increasingly complex needs, and it is difficult to support the long-term safety management goals of smart parks.
[0037] Currently, no effective solution has been proposed for the problem of low accuracy in detecting abnormal power consumption of electric meters in related technologies.
[0038] In view of this, an embodiment of the present application provides a method for detecting abnormal electricity consumption of an electricity meter. First, the electricity consumption data of a target electricity meter in the past period of time (i.e., the second electricity consumption data) is obtained; then, the second electricity consumption data is input into a trained electricity consumption data prediction model to obtain the electricity consumption data of the target electricity meter in the future period of time predicted by the electricity consumption data prediction model (i.e., the third electricity consumption data); then, the target alarm rule corresponding to the target electricity meter is updated based on the third electricity consumption data; finally, the target electricity meter is detected for abnormality using the current electricity consumption data of the target electricity meter (i.e., the first electricity consumption data) and the updated target alarm rule. By predicting the power consumption data of the target meter in the future, the latest power consumption trend of the target meter can be predicted in a timely and accurate manner when the power consumption environment or device status of the target meter changes; in addition, by updating the target alarm rules based on the power consumption data of the target meter in the future, the target alarm rules can be updated in a timely manner when the power consumption environment or device status of the target meter changes, so that the updated target alarm rules are more closely matched with the current power consumption environment and device status of the target meter, thereby improving the accuracy of subsequent power consumption anomaly detection of the target meter using the updated target alarm rules. Through this application, the problem of low accuracy in power consumption anomaly detection of the meter in the related art is solved, and the technical effect of improving the accuracy of power consumption anomaly detection of the meter is achieved.
[0039] The following will be combined Figure 1 For an explanation of a method for detecting abnormal power consumption of an electric meter provided in an embodiment of the present application, see Figure 1 , Figure 1 is a flow chart of a method for detecting abnormal power consumption of an electric meter according to an embodiment of the present application. Figure 1 As shown, the method includes:
[0040] Step S101 : acquiring first power usage data of a target electric meter in a first time period and second power usage data of the target electric meter in a second time period, wherein the end time of the second time period is before the start time of the first time period.
[0041] In this embodiment, the first power consumption data of the target electric meter in the first time period may also be referred to as the current power consumption data in the current time period, and the first time period may be set by itself, for example, it may be set to 1 second, 5 seconds, 30 seconds, 1 minute, 5 minutes, 30 minutes, 1 hour, etc. It should be noted that the first power consumption data may also be the current power consumption data acquired at a point in time.
[0042] The second power consumption data of the target meter in the second time period refers to the historical power consumption data of the target meter in the past period of time, and the second time period can be set by itself, for example, it can be set to 1 day, 3 days, 7 days, 15 days, 30 days, etc. The second power consumption data is used for subsequent prediction of power consumption data of the target meter in the future period of time.
[0043] As an example, the first electricity usage data of the target meter in the first time period may be the electricity usage data of the target meter at the current time point, and the second electricity usage data of the target meter in the second time period may be the electricity usage data of the target meter in the past 7 days at the current time point.
[0044] In addition, the first power consumption data can be obtained by obtaining the real-time heartbeat data packet of the target meter, and the second power consumption data can be obtained by obtaining the historical heartbeat data packet of the target meter. The heartbeat data packet may include the unique serial identifier of the target meter, current parameters (total current, ABC three-phase current), voltage parameters (total voltage, ABC three-phase voltage), power parameters (active power, reactive power, total power, ABC three-phase power), etc.
[0045] Step S102: query a target alarm rule group that matches the target electricity meter from a preset alarm rule library, and query a target alarm rule that matches the first time period from the target alarm rule group.
[0046] In this embodiment, the alarm rule base can be pre-built. The historical electricity consumption data of the target meter in the past period of time can be obtained to predict the predicted electricity consumption data of the target meter in the future period of time, and a target alarm rule group can be generated based on the predicted electricity consumption data of the target meter in the future period of time. For example, if the current time is 2024, all the historical electricity consumption data of the target meter in 2023 can be obtained, and all the predicted electricity consumption data of the target meter in 2024 can be predicted based on all the historical electricity consumption data of the target meter in 2023. Then, a target alarm rule group can be generated based on all the predicted electricity consumption data of the target meter in 2024, and the target alarm rule group can be stored in the alarm rule base.
[0047] The specific process of building the alarm rule base in step S102 can be found in Figure 2 , Figure 2 is a flowchart of constructing an alarm rule base according to an embodiment of the present application, such as Figure 2 As shown, in one embodiment, building an alarm rule base includes the following steps:
[0048] Step S201, obtaining fourth electricity consumption data of a target electric meter in a fourth time period, wherein the start time of the fourth time period is before the start time of the second time period, and the end time of the fourth time period is before the start time of the first time period.
[0049] In this embodiment, the fourth electricity consumption data of the target meter in the fourth time period refers to the historical electricity consumption data of the target meter in the past period of time. It should be noted that the fourth electricity consumption data of the target meter in the fourth time period and the second electricity consumption data of the target meter in the second time period both refer to the historical electricity consumption data of the target meter in the past period of time, but their time spans are different. The time span of the fourth time period is longer than that of the second time period, and the end time of the fourth time period is before the start time of the first time period.
[0050] As an example, the first electricity usage data of the target electricity meter in the first time period may be the electricity usage data of the target electricity meter at X time on October X day, 2024, the second electricity usage data of the target electricity meter in the second time period may be the electricity usage data of the target electricity meter from (X-1) time on October (X-7) day, 2024 to (X-1) time on October X day, 2024, and the fourth electricity usage data of the target electricity meter in the fourth time period may be the electricity usage data of the target electricity meter in the whole year of 2023 (or the second half of 2023).
[0051] Step S202: Divide the fourth power usage data according to a preset time unit to obtain a plurality of historical power usage data, wherein each historical power usage data corresponds to a historical power usage time period.
[0052] In this embodiment, the preset time unit can be set to days, weeks, ten days, months, seasons, etc. From the perspective of improving the prediction accuracy of the subsequent electricity consumption data prediction model, the time unit can be set to a smaller value; from the perspective of improving the prediction speed of the subsequent electricity consumption data prediction model, the time unit can be set to a larger value. In actual applications, the time unit can be set in combination with the application scenarios of the electricity consumption anomaly detection method for the electric meter provided in the embodiment of the present application and user expectations, and the present application does not impose any restrictions on this.
[0053] Specifically, taking the time unit as month and the fourth time period as the whole year of 2023 as an example, the fourth electricity consumption data can be divided into 12 historical electricity consumption data, and the 12 historical electricity consumption data correspond to January to December 2023, that is, the historical electricity consumption time period corresponding to the first historical electricity consumption data can be January 2023, and the historical electricity consumption time period corresponding to the second historical electricity consumption data can be February 2023, and so on.
[0054] Step S203, obtaining historical environmental characteristics of the historical electricity consumption period corresponding to each historical electricity consumption data, wherein the historical environmental characteristics include at least two of the following items: weather, temperature, humidity, whether it is a holiday, and the season.
[0055] In this embodiment, all historical environmental features can be input into the electricity consumption data prediction model to improve the prediction accuracy of the electricity consumption data prediction model; features that have a greater impact on the electricity consumption data can also be screened out from the historical environmental features and input into the electricity consumption data prediction model, taking into account the prediction accuracy of the electricity consumption data prediction model while improving its prediction speed. For example, the XGBoost feature algorithm can be used to identify the three historical environmental features that have the greatest impact on the electricity consumption data from all the above historical environmental features, combine these features with each historical electricity consumption data, and input into the electricity consumption data prediction model for subsequent prediction steps.
[0056] Step S204, input each historical electricity consumption data and the historical environmental characteristics corresponding to each historical electricity consumption data into the trained electricity consumption data prediction model, and obtain the fifth electricity consumption data of the target electricity meter in the fifth time period output by the trained electricity consumption data prediction model, wherein the start time of the fifth time period is after the end time of the fourth time period.
[0057] In this embodiment, the power consumption data prediction model can be constructed based on a long short-term memory network (LSTM) deep learning model. By inputting each historical power consumption data and the historical environmental characteristics corresponding to each historical power consumption data into the power consumption data prediction model, the fifth power consumption data of the target electric meter in the future period of time output by the power consumption data prediction model can be obtained.
[0058] Specifically, taking the time unit as month, the fourth time period as the whole year of 2023, and the fifth time period as the whole year of 2024 as an example, the fourth electricity consumption data can be divided into 12 historical electricity consumption data, and the 12 historical electricity consumption data correspond to January to December 2023 respectively; the 12 historical electricity consumption data and the historical environmental characteristics corresponding to each historical electricity consumption data are input into the electricity consumption data prediction model to obtain the fifth electricity consumption data of the target electricity meter in the whole year of 2024 output by the electricity consumption data prediction model.
[0059] Step S205 : The fifth power consumption data is divided according to a preset time unit to obtain a plurality of predicted power consumption data, wherein each predicted power consumption data corresponds to a predicted power consumption time period.
[0060] In this embodiment, the time unit required for dividing the fifth power consumption data may be the same as or different from the time unit in step S202. Taking the time unit required for dividing the fifth power consumption data as month as an example, the fifth power consumption data may be divided into 12 predicted power consumption data, and the 12 predicted power consumption data respectively correspond to January to December 2024, that is, the predicted power consumption period corresponding to the first predicted power consumption data may be January 2024, the predicted power consumption period corresponding to the second predicted power consumption data may be February 2024, and so on.
[0061] Step S206, based on each predicted power consumption data and the predicted power consumption time period corresponding to each predicted power consumption data, multiple target alarm rules are generated, and the multiple target alarm rules are combined into a target alarm rule group and stored in a preset alarm rule library, wherein each target alarm rule corresponds to a predicted power consumption time period.
[0062] In this embodiment, after obtaining each predicted power consumption data and the predicted power consumption period corresponding to each predicted power consumption data, multiple target alarm rules can be generated. The target alarm rules may include: an alarm type, at least one alarm level corresponding to the alarm type, and a trigger condition corresponding to each alarm level.
[0063] Specifically, taking the predicted electricity consumption period corresponding to the predicted electricity consumption data as January 2024, and the alarm type corresponding to the target alarm rule as voltage overvoltage, all voltage parameters (total voltage, ABC three-phase voltage) can be extracted from the predicted electricity consumption data, and the highest value, lowest value, average value, variance, standard deviation, etc. of each voltage parameter can be calculated, and then the trigger conditions corresponding to each alarm level of the target alarm rule can be determined based on the highest value, lowest value, average value, variance, standard deviation, etc. of each voltage parameter.
[0064] For example, the alarm level corresponding to the target alarm rule in January 2024 can be set to four levels, namely: a) Emergency alarm: indicates an extremely serious situation, and immediate measures must be taken to avoid major losses or harm; b) Important alarm: points out problems that require high attention and may cause greater impact if not handled in time; c) Minor alarm: involves smaller problems that may not immediately cause major impacts, but still require attention and resolution as soon as possible; d) General alarm: for minor anomalies, it usually does not pose a threat to the normal operation of the system or equipment and can be handled at an appropriate time.
[0065] Among them, the trigger condition corresponding to the emergency alarm may be: the voltage parameter of the target meter is higher than 2 times the highest value of the voltage parameter in the predicted electricity consumption data; the trigger condition corresponding to the important alarm may be: the voltage parameter of the target meter is higher than 1.5 times the highest value of the voltage parameter in the predicted electricity consumption data; the trigger condition corresponding to the minor alarm may be: the voltage parameter of the target meter is higher than 1.2 times the highest value of the voltage parameter in the predicted electricity consumption data; the trigger condition corresponding to the general alarm may be: the voltage parameter of the target meter is higher than 1.05 times the highest value of the voltage parameter in the predicted electricity consumption data.
[0066] It should be noted that the target alarm rule may include multiple alarm types. For example, the target alarm rule may include voltage overvoltage, voltage undervoltage, voltage three-phase imbalance, etc. Each alarm type may correspond to multiple alarm levels, and each alarm level corresponds to a trigger condition.
[0067] After generating multiple target alarm rules through the above steps, the multiple target alarm rules can be combined into a target alarm rule group and stored in a preset alarm rule library. The alarm rule library can include multiple alarm rule groups, each of which corresponds to an electric meter. The specific structure of the alarm rule library in the above step S206 can be found in Figure 3 , Figure 3 is a schematic diagram of the structure of an alarm rule library according to an embodiment of the present application, such as Figure 3 In one embodiment, the alarm rule base includes a plurality of alarm rule groups, each of which corresponds to a type of electric meter. For example, the alarm rule base includes an alarm rule group A corresponding to electric meter A, an alarm rule group B corresponding to electric meter B, ..., and an alarm rule group N corresponding to electric meter N. The types of electric meter A, electric meter B, ..., and electric meter N may be different from each other. For example, electric meter A may be a three-phase electric meter, and electric meter B may be a smart electric meter; or, electric meter A may be a mechanical electric meter, and electric meter B may be an electronic electric meter.
[0068] In addition, the alarm rule base also includes a template alarm rule group, which corresponds to the meter template. Since there is a possibility that the target meter cannot match meter A, meter B, ..., meter N, therefore, when the target alarm rule group matching the target meter is not found in the alarm rule base, the preset template alarm rule group can be obtained from the alarm rule base, the template alarm rule group is used as the target alarm rule group corresponding to the target meter, and the target alarm rule matching the first time period is searched from the target alarm rule group.
[0069] The template alarm rule group is a general alarm rule group, which can be applied in batches to selected meters that cannot be matched with any meter in the alarm rule library, thereby reducing the tediousness of repeated operations and ensuring the uniformity and consistency of alarm rule configuration. It should be noted that each alarm rule in the preset template alarm rule group can be set in combination with the application scenario of the power consumption anomaly detection method for the meter provided in the embodiment of the present application and user expectations, and supports batch updates, thereby improving the configuration efficiency of the alarm rules and reducing the necessity of human intervention.
[0070] In this embodiment, each alarm rule group includes multiple alarm rules, wherein each alarm rule corresponds to a power consumption period. Taking "electricity meter A-alarm rule group A" as the target alarm rule group, the target alarm rule group may include alarm rule a corresponding to power consumption period a, alarm rule b corresponding to power consumption period b, ..., alarm rule n corresponding to power consumption period n, and the above-mentioned power consumption period a, power consumption period b, ..., power consumption period n can also be called predicted power consumption period.
[0071] For example, taking the first time period as October X, 2024, and the power consumption period n corresponding to the alarm rule n as October 2024, the target alarm rule matching the first time period can be queried from the alarm rule library, that is, the alarm rule n is used as the target alarm rule.
[0072] In this embodiment, the target alarm rule may include an alarm type, at least one alarm level corresponding to the alarm type, and a trigger condition corresponding to each alarm level. The target alarm rule may include multiple alarm types, such as Figure 3 As shown, the target alarm rules may include alarm type I, ..., alarm type X. For example, the target alarm rules may include multiple different alarm types such as voltage overvoltage, voltage undervoltage, voltage three-phase imbalance, etc. Each alarm type may correspond to multiple alarm levels (including alarm level i, ..., alarm level x), and each alarm level corresponds to a trigger condition. For example, alarm level i corresponds to trigger condition i, and alarm level x corresponds to trigger condition x.
[0073] In addition, each alarm type can also correspond to an alarm impact and a handling suggestion, so that when the target alarm rule is triggered, the alarm impact, handling suggestion, etc. corresponding to the triggered alarm type can be directly queried from the alarm rule library.
[0074] In this embodiment, the trigger condition may include parameters such as monitoring attribute, monitoring type, monitoring range type, etc. Among them, the monitoring attribute may be at least one of the following items: A phase voltage, B phase voltage, C phase voltage, A phase current, B phase current, C phase current, A phase power, B phase power, C phase power, total power, A phase power factor, B phase power factor, C phase power factor, total power factor, external temperature, internal temperature, external humidity, etc.
[0075] Monitoring types may include: a) Absolute value type: monitor the absolute value of the operating parameters of the equipment or system (for example, power factor) to ensure that the value is within the set range; b) Relative value type (baseline): based on the baseline value set by historical data, monitor the relative changes of parameters (for example, phase A voltage, phase B voltage, phase C voltage, phase A current, phase B current, phase C current, phase A power, phase B power, phase C power, total power, etc.) to determine the degree of deviation from the baseline; c) Configuration value type: monitor according to the preset configuration parameters to ensure the consistency of the parameters during actual operation (for example, total power) with the configuration value; d) Three-phase imbalance: monitor the imbalance of current or voltage of each phase in the three-phase power system (for example, three-phase current imbalance, three-phase voltage imbalance, three-phase power imbalance) to ensure the stability of system operation.
[0076] The monitoring range types may include: a) Exceeding: triggering an alarm when the monitoring parameter is higher than a preset relevant value (relative value type, configuration value type); b) Lower than: triggering an alarm when the monitoring parameter is lower than a preset relevant value (relative value type, configuration value type); c) Others: directly comparing with the preset relevant value (absolute value type, three-phase imbalance).
[0077] It should be noted that the above-mentioned alarm rule base is shown in the form of an overall database. In other embodiments, the above-mentioned alarm rule base may include multiple databases.
[0078] For example, the alarm rule library may include an alarm indicator library, a secondary indicator library, a parameter rule library, etc.; wherein the alarm indicator library indicates a primary alarm type (for example, a voltage alarm), and each overall alarm type may correspond to multiple alarm rule groups, thereby providing a basis for classifying the generated alarm records into primary alarm types and for merging subsequent alarm records; the secondary indicator library indicates a secondary alarm type (for example, a voltage overvoltage), an alarm rule group corresponding to each secondary alarm type, and each secondary alarm type may correspond to an alarm rule group, the name of the alarm rule group, the detection method, the alarm impact, the disposal suggestion, etc., thereby more specifically describing each alarm rule group and providing a basis for merging subsequent alarm records; the parameter rule library indicates a tertiary alarm type (for example, A phase voltage overvoltage), an alarm rule corresponding to each tertiary alarm type, wherein each alarm rule includes at least one alarm level, and a trigger condition corresponding to each alarm level, and the trigger condition may include parameters such as monitoring attributes (for example, A phase voltage), monitoring type (for example, relative value type), and monitoring range type (exceeding a preset threshold).
[0079] Step S103, inputting the second electricity usage data into the trained electricity usage data prediction model to obtain third electricity usage data of the target electric meter in a third time period output by the trained electricity usage data prediction model, wherein the start time of the third time period is after the end time of the first time period.
[0080] In this embodiment, similar to the above-mentioned steps S202 to S204, the second electricity consumption data can also be divided according to preset time units to obtain multiple historical electricity consumption data, wherein each historical electricity consumption data corresponds to a historical electricity consumption time period; the historical environmental characteristics of the historical electricity consumption time period corresponding to each historical electricity consumption data are obtained; each historical electricity consumption data and the historical environmental characteristics corresponding to each historical electricity consumption data are input into the electricity consumption data prediction model to obtain the third electricity consumption data of the target electricity meter in the third time period output by the electricity consumption data prediction model.
[0081] It should be noted that, although the third power consumption data of the target meter in the third time period and the fifth power consumption data of the target meter in the fifth time period both refer to the historical power consumption data of the target meter in the past period, their time spans are different. The time span of the third time period is usually shorter, the time span of the fifth time period is much longer than that of the third time period, and the start time of the third time period is after the end time of the first time period, while the start time of the fifth time period is often after the end time of the first time period.
[0082] As an example, the first electricity usage data of the target electricity meter in the first time period may be the electricity usage data of the target electricity meter at X time on October X day, 2024, the third electricity usage data of the target electricity meter in the third time period may be the electricity usage data of the target electricity meter from 0:00 on October (X+1) day, 2024 to 24:00 on October (X+1) day, 2024, and the fifth electricity usage data of the target electricity meter in the fifth time period may be the electricity usage data of the target electricity meter in the whole year of 2024 (or in the second half of 2024).
[0083] The above-mentioned third time period can be set in combination with the application scenario of the power consumption abnormality detection method of the electric meter provided in the embodiment of the present application and the user's expectations. For example, the third time period can be set to the next day, next three days, next seven days, etc. after the end time of the first time period. This application does not impose any restrictions on this.
[0084] Step S104: Use the third power consumption data to update the target alarm rule to obtain an updated target alarm rule.
[0085] As time goes by and as factors such as the external environment change, it is particularly important to dynamically adjust the alarm rules. For example, the pattern of power consumption may change significantly due to seasonal changes, increased or decreased frequency of device use, or even the addition of new devices. For example, the use of heating equipment in winter may cause an increase in current, while in spring and autumn, the current may remain relatively stable. Therefore, the alarm system needs to be able to flexibly respond to these changes to ensure the accuracy of real-time monitoring.
[0086] In this embodiment, by predicting the power consumption data of the target electric meter in the future, the latest power consumption trend of the target electric meter can be predicted in a timely and accurate manner when the power consumption environment or equipment status of the target electric meter changes (that is, the third power consumption data of the target electric meter in the third time period is predicted using the power consumption data prediction model); in addition, the target alarm rules are updated based on the third power consumption data of the target electric meter in the third time period, and the target alarm rules can be updated in a timely manner when the power consumption environment or equipment status of the target electric meter changes, so that the updated target alarm rules are more closely matched with the current power consumption environment and equipment status of the target electric meter, thereby enhancing the adaptability and accuracy of the power consumption anomaly detection method for the electric meter provided in the embodiment of the present application in the face of environmental changes or equipment status changes, thereby improving the accuracy of subsequent power consumption anomaly detection of the target electric meter using the updated target alarm rules.
[0087] Specifically, the specific process of updating the target alarm rule in step S104 can be found in Figure 4 , Figure 4 is a flow chart of updating target alarm rules according to an embodiment of the present application, such as Figure 4As shown, in one embodiment, using the third power consumption data to update the target alarm rule to obtain the updated target alarm rule includes the following steps:
[0088] Step S401: query the third power usage parameter corresponding to the alarm type in the target alarm rule from the third power usage data.
[0089] Step S402: query historical power usage parameters corresponding to the alarm type in the target alarm rule from each historical power usage data.
[0090] Step S403, determine whether the third power parameter is greater than the highest value of the historical power parameters, or less than the lowest value of the historical power parameters. If the third power parameter is greater than the highest value of the historical power parameters, or less than the lowest value of the historical power parameters, proceed to step S404.
[0091] Step S404: update the triggering condition in the target alarm rule.
[0092] In this embodiment, the trigger condition may include parameters such as monitoring attribute, monitoring type, monitoring range type, etc. Taking the alarm type of A phase voltage overvoltage as an example, the third power parameter may be A phase voltage. If the third power parameter is greater than the highest value of each historical power parameter (that is, the A phase voltage of the target meter in the third time period is greater than the highest value of the A phase voltage of the target meter in the fourth time period), then the preset threshold in the monitoring range type (exceeding the preset threshold) in the trigger condition may be multiplied by a gain parameter.
[0093] For example, the third electricity consumption data of the target meter in the third time period may be the electricity consumption data of the target meter from 0:00 on October (X+1) day, 2024 to 24:00 on October (X+1) day, 2024, and the fourth electricity consumption data of the target meter in the fourth time period may be the electricity consumption data of the target meter for the whole year of 2023. The phase A voltage is queried from the electricity consumption data of the target meter from 0:00 on October (X+1) day, 2024 to 24:00 on October (X+1) day, 2024. If the average value of the phase A voltage during this period is higher than the highest value of the phase A voltage of the target meter in the whole year of 2023, the preset threshold in the trigger condition may be multiplied by a gain parameter.
[0094] Assuming that the trigger condition corresponding to the emergency alarm is that the phase A voltage of the target meter is twice higher than the highest value of the phase A voltage parameter in the predicted power consumption data (called 2α), then k1*2α can be used as the new threshold, and k1 as the gain parameter can take values of 1.05, 1.1, 1.15, 1.2, etc.
[0095] Conversely, if the third power consumption parameter is smaller than the lowest value among all historical power consumption parameters (that is, the phase A voltage of the target meter in the third time period is smaller than the lowest value of the phase A voltage of the target meter in the fourth time period), assuming that the trigger condition corresponding to the emergency alarm is that the phase A voltage of the target meter is higher than twice the highest value of the phase A voltage parameter in the predicted power consumption data (referred to as 2α), then k2*2α can be used as the new threshold, and k2 as a gain parameter can take values such as 0.95, 0.9, 0.8, etc.
[0096] Through the above steps S401 to S404, the target alarm rules are updated based on the third electricity usage data of the target electricity meter in the third time period. When the electricity usage environment or equipment status of the target electricity meter changes, the target alarm rules can be updated in time, so that the updated target alarm rules are more closely matched with the current electricity usage environment and equipment status of the target electricity meter, thereby improving the accuracy of subsequent abnormal electricity usage detection of the target electricity meter using the updated target alarm rules.
[0097] Step S105: performing power consumption anomaly detection on the target power meter based on the first power consumption data and the updated target alarm rule.
[0098] In this embodiment, performing power consumption anomaly detection on the target power meter based on the first power consumption data and the updated target alarm rule may include the following steps:
[0099] Step 1: query the first power usage parameter corresponding to the alarm type in the updated target alarm rule from the first power usage data.
[0100] In this embodiment, querying the first electricity usage parameter corresponding to the alarm type in the updated target alarm rule from the first electricity usage data may include: obtaining the target meter type of the target meter; querying the target mapping rule matching the target meter type from a preset mapping rule library, wherein the mapping rule library includes multiple mapping rules, each mapping rule corresponding to a meter type; based on the target mapping rule, converting the parameter type of each parameter in the first electricity usage data into a template parameter type corresponding to a preset meter template to obtain the target electricity usage data; querying the first electricity usage parameter corresponding to the alarm type in the updated target alarm rule from the target electricity usage data.
[0101] Specifically, the target meter type of the target meter may be determined by acquiring a unique meter sequence identifier in a real-time heartbeat data packet of the target meter.
[0102] Since different brands and types of electricity meters on the market have significant differences in functions and parameter settings, in the traditional alarm rule configuration method, managers need to modify the parameter types in the alarm rules for different types of electricity meters to ensure the accuracy of the alarm rules. This increases the complexity of the operation and is prone to affecting the alarm effect due to incorrect parameter settings.
[0103] In this embodiment, for different types of electric meters, the parameter types corresponding to them can be converted into template parameter types corresponding to the preset electric meter template, that is, they are unified into one parameter type. By establishing mapping rules between template parameter types and different parameter types, unified management of various types of electric meters is achieved. These mapping rules can be stored in a mapping rule library to ensure accurate parameter conversion and calling when configuring and applying alarm rules, thereby simplifying the management of increasingly diverse devices and avoiding complex operations caused by differences in electric meter types.
[0104] Table 1
[0105]
[0106]
[0107] Please refer to Table 1, which shows the parameter types of the meter template, three-phase meter, and smart meter. As shown in Table 1, the parameter types of different meters may be different. For example, for phase A voltage, the parameter field for phase A voltage in the power consumption data of the three-phase meter is "VoltageA", while the parameter field for phase A voltage in the power consumption data of the smart meter is "APhaseVoltage". Therefore, in order to improve the efficiency of alarm rule configuration, the parameter type used when configuring the alarm rules can be uniformly configured as the template parameter type of the meter template (also called the unified model parameter type).
[0108] Therefore, mapping rule A can be generated. If the target electricity meter is a smart electricity meter, the parameter field "APhaseVoltage" is converted to "VoltageA", and so on, until the parameter types of all parameters in the first electricity consumption data are converted to the unified model parameter type to obtain the target electricity consumption data.
[0109] It should be noted that Table 1 only shows the parameter types of three-phase meters and smart meters. In actual applications, the types of meters are not limited to this. For example, the types of meters may also include mechanical meters, electronic meters, single-phase meters, three-phase three-wire meters, three-phase four-wire meters, and the like.
[0110] In this way, when configuring alarm rules, for different types of electricity meters, their corresponding parameter types can be unified into a unified model parameter type. By establishing mapping rules between unified model parameter types and different parameter types, unified management of various types of electricity meters can be achieved. These mapping rules can be stored in a mapping rule library to ensure accurate parameter conversion and calling when configuring and applying alarm rules, improve the efficiency and accuracy of alarm rule configuration, and thus improve the accuracy of abnormal power consumption detection of electricity meters.
[0111] Step 2: Match the first power usage parameter with the trigger conditions corresponding to each alarm level.
[0112] Step 3: When the first power usage parameter matches the trigger condition, determine that the target power meter has abnormal power usage and generate an alarm record, wherein the alarm record includes the alarm type and the alarm level corresponding to the trigger condition.
[0113] The abnormal power consumption detection in the above step S105 is described and illustrated below with a specific example. Taking the updated target alarm rule including the alarm type-A phase voltage overvoltage as an example, the alarm level corresponding to the alarm type may include four, namely emergency alarm, major alarm, minor alarm, and general alarm. Among them, the trigger condition corresponding to the emergency alarm can be: the phase A voltage of the target meter is higher than 2 times the highest value of the phase A voltage in the predicted power consumption data multiplied by a gain parameter (k1*2α); the trigger condition corresponding to the important alarm can be: the phase A voltage of the target meter is higher than 1.5 times the highest value of the phase A voltage in the predicted power consumption data multiplied by a gain parameter (k1*1.5α); the trigger condition corresponding to the minor alarm can be: the phase A voltage of the target meter is higher than 1.2 times the highest value of the phase A voltage in the predicted power consumption data multiplied by a gain parameter (k1*1.2α); the trigger condition corresponding to the general alarm can be: the phase A voltage of the target meter is higher than 1.05 times the highest value of the phase A voltage in the predicted power consumption data multiplied by a gain parameter (k1*1.05α).
[0114] The first power usage parameter corresponding to the alarm type - A phase voltage overvoltage is queried from the first power usage data, that is, the first power usage parameter is the A phase voltage of the target meter in the first time period. If the A phase voltage of the target meter in the first time period is higher than k1*1.5α but lower than k1*2α, then it can be determined that the target meter has abnormal power consumption and an alarm record is generated. The alarm record includes the alarm type - A phase voltage overvoltage and the alarm level - important alarm.
[0115] In one embodiment, after determining that the target electric meter has abnormal power consumption and generating an alarm record, the method further includes the following steps:
[0116] Step 1: Store the alarm record in a preset alarm history record database.
[0117] Step 2: Query the historical alarm records corresponding to the target electric meter from the alarm history record database.
[0118] In this embodiment, the alarm type can be obtained from the alarm record, and the alarm history record database can be queried to see whether there is a historical alarm record that matches the alarm type in the alarm record, and the generation time of the historical alarm record and the generation time of the alarm record need to be less than a preset threshold, which can be 1 day, 3 days, 7 days, etc., and this application does not impose any restrictions on this.
[0119] Step 3: When there is a historical alarm record corresponding to the target electric meter in the alarm history record database, the alarm record is merged with the historical alarm record to obtain an alarm merge record, and the alarm merge record is sent.
[0120] In this embodiment, if there is no historical alarm record in the alarm history record database, it means that the target meter has abnormal power consumption for the first time. At this time, an alarm merge record can be created, and a pre-notification record can be created, and then the alarm merge record can be sent based on the pre-notification record. If there is a historical alarm record in the alarm history record database, it can be determined whether the alarm record and the historical alarm record match the preset merging condition (for example, whether the generation time of the historical alarm record and the generation time of the alarm record are less than 6 hours). If the alarm record and the historical alarm record match the merging condition, the alarm record and the historical alarm record are merged to obtain an alarm merge record; if the alarm record and the historical alarm record do not match the merging condition, it can be said that a long time has passed since the last alarm of the target meter. At this time, a new alarm merge record needs to be created, and a pre-notification record needs to be created, and then the alarm merge record is sent based on the pre-notification record.
[0121] After obtaining the alarm merge record, you can check whether the conditions for sending an email immediately are met. If so, you need to create a pre-notification record. For example, the alarm merge record shows that the alarm level of the target device has been upgraded from a general alarm to an emergency alarm. At this time, no subsequent judgment is required. You need to immediately create a pre-notification record and send the alarm merge record based on the pre-notification record. If the conditions for sending an email immediately are not met, make a subsequent judgment.
[0122] It is determined whether the alarm merge record has a sending history. If there is no sending history, a pre-notification record is created, and the alarm merge record is sent based on the pre-notification record; if there is a sending history, a subsequent determination is performed.
[0123] The time difference between the last sending time of the alarm merge record and the current time is calculated. If the time difference has exceeded the preset notification time interval, a pre-notification record is created, and the alarm merge record is sent based on the pre-notification record.
[0124] Through the above steps S101 to S105, the method for detecting abnormal electricity consumption of an electric meter provided in an embodiment of the present application first obtains the electricity consumption data of the target electric meter in the past period of time (i.e., the second electricity consumption data); then, the second electricity consumption data is input into the trained electricity consumption data prediction model to obtain the electricity consumption data of the target electric meter in the future period of time (i.e., the third electricity consumption data) predicted by the electricity consumption data prediction model; then, the target alarm rule corresponding to the target electric meter is updated based on the third electricity consumption data; finally, the target electric meter is detected for abnormality using the current electricity consumption data of the target electric meter (i.e., the first electricity consumption data) and the updated target alarm rule. By predicting the power consumption data of the target meter in the future, the latest power consumption trend of the target meter can be predicted in a timely and accurate manner when the power consumption environment or device status of the target meter changes; in addition, by updating the target alarm rules based on the power consumption data of the target meter in the future, the target alarm rules can be updated in a timely manner when the power consumption environment or device status of the target meter changes, so that the updated target alarm rules are more closely matched with the current power consumption environment and device status of the target meter, thereby improving the accuracy of subsequent power consumption anomaly detection of the target meter using the updated target alarm rules. Through this application, the problem of low accuracy in power consumption anomaly detection of the meter in the related art is solved, and the technical effect of improving the accuracy of power consumption anomaly detection of the meter is achieved.
[0125] Corresponding to the method for detecting abnormal power consumption of an electric meter described in the above embodiment, Figure 5 A schematic structural diagram of a device for detecting abnormal power consumption of an electric meter according to an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.
[0126] See also Figure 5The power consumption anomaly detection device 5 of the electric meter includes: an acquisition module 50, which is used to acquire the first power consumption data of the target electric meter in the first time period, and the second power consumption data of the target electric meter in the second time period, wherein the end time of the second time period is before the start time of the first time period; a query module 51, which is used to query the target alarm rule group matching the target electric meter from the preset alarm rule library, and query the target alarm rule matching the first time period from the target alarm rule group; a prediction module 52, which is used to input the second power consumption data into the trained power consumption data prediction model, and obtain the third power consumption data of the target electric meter in the third time period output by the trained power consumption data prediction model, wherein the start time of the third time period is after the end time of the first time period; an update module 53, which is used to update the target alarm rule with the third power consumption data to obtain the updated target alarm rule; a detection module 54, which is used to perform power consumption anomaly detection on the target electric meter based on the first power consumption data and the updated target alarm rule.
[0127] In one embodiment, the target alarm rule includes: an alarm type, at least one alarm level corresponding to the alarm type, and a trigger condition corresponding to each alarm level; the detection module 54 is also used to query the first electricity usage parameter corresponding to the alarm type in the updated target alarm rule from the first electricity usage data; match the first electricity usage parameter with the trigger conditions corresponding to each alarm level; when the first electricity usage parameter matches the trigger condition, determine that the target electricity meter has abnormal electricity usage, and generate an alarm record, wherein the alarm record includes the alarm type and the alarm level corresponding to the trigger condition.
[0128] In one embodiment, the power consumption anomaly detection device 5 of the electric meter also includes a construction module, which is used to obtain fourth power consumption data of the target electric meter in a fourth time period, wherein the start time of the fourth time period is before the start time of the second time period, and the end time of the fourth time period is before the start time of the first time period; divide the fourth power consumption data according to a preset time unit to obtain a plurality of historical power consumption data, wherein each historical power consumption data corresponds to a historical power consumption time period; obtain the historical environmental characteristics of the historical power consumption time period corresponding to each historical power consumption data, wherein the historical environmental characteristics include at least two of the following items: weather, temperature, humidity, whether it is a holiday, and the season; and The historical environmental characteristics corresponding to the historical electricity consumption data are input into the trained electricity consumption data prediction model to obtain the fifth electricity consumption data of the target electricity meter in the fifth time period output by the trained electricity consumption data prediction model, wherein the start time of the fifth time period is after the end time of the fourth time period; the fifth electricity consumption data is divided according to the preset time unit to obtain a plurality of predicted electricity consumption data, wherein each predicted electricity consumption data corresponds to a predicted electricity consumption time period; based on each predicted electricity consumption data and the predicted electricity consumption time period corresponding to each predicted electricity consumption data, a plurality of target alarm rules are generated, and the plurality of target alarm rules are combined into a target alarm rule group and stored in a preset alarm rule library, wherein each target alarm rule corresponds to a predicted electricity consumption time period.
[0129] In one embodiment, the target alarm rule includes: an alarm type, at least one alarm level corresponding to the alarm type, and a trigger condition corresponding to each alarm level; the update module 53 is also used to update the target alarm rule using the third electricity consumption data, and the updated target alarm rule includes: querying the third electricity consumption parameter corresponding to the alarm type in the target alarm rule from the third electricity consumption data; querying the historical electricity consumption parameters corresponding to the alarm type in the target alarm rule from each historical electricity consumption data; when the third electricity consumption parameter is greater than the highest value of each historical electricity consumption parameter, or less than the lowest value of each historical electricity consumption parameter, the trigger condition in the target alarm rule is updated.
[0130] In one embodiment, the abnormal power consumption detection device 5 of the electric meter also includes a merging module, which is used to store the alarm record in a preset alarm history record database; query the historical alarm record corresponding to the target electric meter from the alarm history record database; when there is a historical alarm record corresponding to the target electric meter in the alarm history record database, merge the alarm record with the historical alarm record to obtain an alarm merge record, and send the alarm merge record.
[0131] In one embodiment, the detection module 54 is also used to obtain a target meter type of a target meter; query a target mapping rule that matches the target meter type from a preset mapping rule library, wherein the mapping rule library includes multiple mapping rules, and each mapping rule corresponds to a meter type; based on the target mapping rule, convert the parameter type of each parameter in the first electricity usage data into a template parameter type corresponding to a preset meter template to obtain the target electricity usage data; query the first electricity usage parameter corresponding to the alarm type in the updated target alarm rule from the target electricity usage data.
[0132] In one embodiment, the query module 51 is also used to obtain a preset template alarm rule group from the alarm rule library when no target alarm rule group matching the target electricity meter is found in the alarm rule library, use the template alarm rule group as the target alarm rule group corresponding to the target electricity meter, and query the target alarm rule matching the first time period from the target alarm rule group.
[0133] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0134] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0135] Figure 6 is a schematic diagram of the structure of a terminal device according to an embodiment of the present application. Figure 6 As shown, the terminal device 6 includes: at least one processor 60 ( Figure 6 Only one is shown in the figure) a processor, a memory 61, and a computer program 62 stored in the memory 61 and executable on at least one processor 60. When the processor 60 executes the computer program 62, the steps in the above-mentioned method for detecting abnormal power consumption of any of the electric meters are implemented.
[0136] The terminal device 6 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The terminal device 6 may include but is not limited to a processor 60 and a memory 61. It is understood by those skilled in the art that Figure 6 It is only an example of the terminal device 6 and does not constitute a limitation on the terminal device 6. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.
[0137] The processor 60 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0138] In some embodiments, the memory 61 may be an internal storage unit of the terminal device 6, such as a hard disk or memory of the terminal device 6. In other embodiments, the memory 61 may also be an external storage device of the terminal device 6, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 6. In other embodiments, the memory 61 may also include both an internal storage unit and an external storage device of the terminal device 6. The memory 61 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as program codes of a computer program 62. The memory 61 may also be used to temporarily store data that has been output or is to be output.
[0139] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it can implement the steps in the embodiments of the method for detecting abnormal power consumption of each electric meter mentioned above.
[0140] An embodiment of the present application provides a computer program product. When the computer program product is run on a mobile terminal, the mobile terminal implements the steps in the above-mentioned embodiments of the method for detecting abnormal power consumption of each electric meter when executing the computer program product.
[0141] The present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of each of the above-mentioned method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the camera device / terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a disk or an optical disk.
[0142] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0143] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0144] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0145] 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 on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0146] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for detecting abnormal power consumption of an electric meter, characterized in that: include: Acquire first power usage data of a target electric meter in a first time period, and second power usage data of the target electric meter in a second time period, wherein the end time of the second time period is before the start time of the first time period; Querying a target alarm rule group matching the target electricity meter from a preset alarm rule library, and querying a target alarm rule matching the first time period from the target alarm rule group; Inputting the second electricity consumption data into a trained electricity consumption data prediction model to obtain third electricity consumption data of the target electric meter in a third time period output by the trained electricity consumption data prediction model, wherein the start time of the third time period is after the end time of the first time period; Using the third power consumption data to update the target alarm rule to obtain an updated target alarm rule; The target electricity meter is subjected to abnormal electricity consumption detection based on the first electricity consumption data and the updated target alarm rule.
2. The method according to claim 1, characterized in that The target alarm rule includes: an alarm type, at least one alarm level corresponding to the alarm type, and a trigger condition corresponding to each of the alarm levels; performing power consumption abnormality detection on the target electric meter based on the first power consumption data and the updated target alarm rule includes: querying a first power usage parameter corresponding to the alarm type in the updated target alarm rule from the first power usage data; Matching the first power usage parameter with the trigger conditions corresponding to each of the alarm levels; When the first power usage parameter matches the trigger condition, it is determined that the target power meter has abnormal power usage, and an alarm record is generated, wherein the alarm record includes the alarm type and the alarm level corresponding to the trigger condition.
3. The method according to claim 1 or 2, characterized in that: Before the first power usage data of the target power meter in the first time period and the second power usage data of the target power meter in the second time period, the method further includes: Acquire fourth electricity consumption data of the target electric meter in a fourth time period, wherein the start time of the fourth time period is before the start time of the second time period, and the end time of the fourth time period is before the start time of the first time period; Dividing the fourth power consumption data according to a preset time unit to obtain a plurality of historical power consumption data, wherein each of the historical power consumption data corresponds to a historical power consumption period; Acquire historical environmental characteristics of the historical electricity consumption period corresponding to each of the historical electricity consumption data, wherein the historical environmental characteristics include at least two of the following items: weather, temperature, humidity, whether it is a holiday, and the season; Inputting each of the historical electricity consumption data and the historical environmental features corresponding to each of the historical electricity consumption data into the trained electricity consumption data prediction model, and obtaining fifth electricity consumption data of the target electric meter in a fifth time period output by the trained electricity consumption data prediction model, wherein the start time of the fifth time period is after the end time of the fourth time period; Dividing the fifth power consumption data according to the preset time unit to obtain a plurality of predicted power consumption data, wherein each of the predicted power consumption data corresponds to a predicted power consumption time period; Based on each of the predicted electricity consumption data and the predicted electricity consumption time period corresponding to each of the predicted electricity consumption data, multiple target alarm rules are generated, and the multiple target alarm rules are combined into the target alarm rule group and stored in the preset alarm rule library, wherein each of the target alarm rules corresponds to a predicted electricity consumption time period.
4. The method according to claim 3, characterized in that The target alarm rule includes: an alarm type, at least one alarm level corresponding to the alarm type, and a trigger condition corresponding to each of the alarm levels; the target alarm rule is updated using the third power consumption data, and the updated target alarm rule includes: querying a third power usage parameter corresponding to the alarm type in the target alarm rule from the third power usage data; Querying the historical power usage parameters corresponding to the alarm type in the target alarm rule from each of the historical power usage data; When the third power usage parameter is greater than the highest value of the historical power usage parameters, or less than the lowest value of the historical power usage parameters, the trigger condition in the target alarm rule is updated.
5. The method according to claim 2, characterized in that: After determining that the target electric meter has abnormal power consumption and generating an alarm record, the method further includes: Storing the alarm record in a preset alarm history database; Querying the historical alarm record corresponding to the target electric meter from the alarm history record database; In the case that the historical alarm record corresponding to the target electric meter exists in the alarm history record database, the alarm record is merged with the historical alarm record to obtain an alarm merge record, and the alarm merge record is sent.
6. The method according to claim 2, characterized in that Querying the first power usage parameter corresponding to the alarm type in the updated target alarm rule from the first power usage data includes: Acquire a target electric meter type of the target electric meter; Querying a target mapping rule matching the target meter type from a preset mapping rule library, wherein the mapping rule library includes a plurality of mapping rules, each mapping rule corresponding to a meter type; Based on the target mapping rule, converting the parameter type of each parameter in the first power consumption data into a template parameter type corresponding to a preset electric meter template to obtain target power consumption data; A first power usage parameter corresponding to the alarm type in the updated target alarm rule is queried from the target power usage data.
7. The method according to claim 1 or 2, characterized in that: Before inputting the second electricity consumption data into the trained electricity consumption data prediction model, the method further includes: When no target alarm rule group matching the target electricity meter is found in the alarm rule library, a preset template alarm rule group is obtained from the alarm rule library, the template alarm rule group is used as the target alarm rule group corresponding to the target electricity meter, and the target alarm rule matching the first time period is queried from the target alarm rule group.
8. A device for detecting abnormal power consumption of an electric meter, characterized in that: include: an acquisition module, configured to acquire first power usage data of a target electric meter in a first time period, and second power usage data of the target electric meter in a second time period, wherein the end time of the second time period is before the start time of the first time period; A query module, used to query a target alarm rule group matching the target electric meter from a preset alarm rule library, and query a target alarm rule matching the first time period from the target alarm rule group; a prediction module, configured to input the second electricity consumption data into a trained electricity consumption data prediction model, and obtain third electricity consumption data of the target electric meter in a third time period output by the trained electricity consumption data prediction model, wherein the start time of the third time period is after the end time of the first time period; An updating module, configured to update the target alarm rule using the third power consumption data to obtain an updated target alarm rule; A detection module is used to perform power consumption anomaly detection on the target power meter based on the first power consumption data and the updated target alarm rule.
9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method for detecting abnormal power consumption of an electric meter according to any one of claims 1 to 7 is implemented.
10. A computer program product, characterized in that It comprises a computer program, and when the computer program is executed, the method for detecting abnormal power consumption of an electric meter as claimed in any one of claims 1 to 7 is executed.