Energy Data Processing Method, Device, Electronic Device and Storage Medium
By adding type marks to energy data and screening and cleaning abnormal data, the problems of uncontrollable, high cost and low efficiency of energy data processing in the prior art are solved, and automatic and efficient processing and meter reading accounting of energy data are realized.
Patent Information
- Application Number
- CN202111577754.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-22
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2041-12-22
AI Technical Summary
When handling abnormal data, the existing energy management system is uncontrollable, has high cost, low efficiency and is prone to errors, and cannot realize automatic and efficient screening and processing of abnormal data.
By obtaining the energy data reported by the metering equipment, adding type marks to the target data according to the predefined data characteristics, determining whether the data is abnormal data, and cleaning the abnormal data, finally performing meter reading and accounting to obtain energy consumption data.
Automatic screening and cleaning of abnormal data in energy data is realized, which reduces manpower investment, improves processing efficiency and accuracy, and reduces data error problems caused by human participation.
Smart Images

Figure CN114218206B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and more particularly, to an energy data processing method, apparatus, electronic device, and storage medium. Background Art
[0002] With the rapid development of informatization, more and more enterprises adopt energy management systems to reasonably plan and utilize energy, reduce the energy consumption per unit product, and improve economic efficiency.
[0003] Existing energy management systems provide an alarm function for abnormal data that appears during the business execution process. After prompting the operation and maintenance personnel to correct or delete the abnormal data, they manually trigger the meter reading calculation again to eliminate the impact of the abnormal data. This method of screening and processing abnormal data is overall uncontrollable, costly, inefficient, and error-prone. Summary of the Invention
[0004] The purpose of the present invention is to provide an energy data processing method, apparatus, electronic device, and storage medium for automatically and efficiently screening abnormal data in energy data in view of the above-mentioned deficiencies in the prior art.
[0005] To achieve the above object, the technical solutions adopted in the embodiments of the present application are as follows:
[0006] In a first aspect, an embodiment of the present application provides an energy data processing method, including:
[0007] Obtain energy data reported by a metering device;
[0008] According to predefined data characteristics, add a type tag to target data in the energy data that meets the predefined data characteristics to obtain target energy data, where the type tag is used to indicate the type of the target data;
[0009] Determine whether the target data is abnormal data according to the type tag of the target data in the target energy data;
[0010] Clean the abnormal data in the target energy data;
[0011] Execute a meter reading and accounting operation according to the cleaned data to obtain the energy consumption data of the metering device.
[0012] Optionally, the determining whether the target data is abnormal data according to the type tag of the target data in the target energy data includes:
[0013] Write the target energy data into a data buffer queue;
[0014] Successively take out the data in the data buffer queue;
[0015] If the retrieved data is the target data with a type tag, then according to the type tag of the target data, determine whether the target data is the abnormal data.
[0016] Optionally, the determining whether the target data is the abnormal data according to the type tag of the target data includes:
[0017] If the type tag of the target data indicates that the target data is a string or null data, determine that the target data is abnormal data.
[0018] Optionally, the determining whether the target data is the abnormal data according to the type tag of the target data includes:
[0019] If the type tag of the target data indicates that the target data is zero data, then according to the data before and after the target data in the energy data, determine whether the target data is abnormal data.
[0020] Optionally, the determining whether the target data is the abnormal data according to the data before and after the target data in the energy data includes:
[0021] If there is zero data in the historical data of the target data, determine that the target data is not abnormal data; wherein, the historical data is the data retrieved from the energy data before the target data;
[0022] If there is no zero data in the historical data, determine whether the next data of the target data in the energy data is zero data;
[0023] If the next data is zero data, determine that the target data is not abnormal data;
[0024] If the next data is not zero data, determine that the target data is abnormal data.
[0025] Optionally, the determining whether the target data is the abnormal data according to the type tag of the target data includes:
[0026] If the type tag of the target data indicates that the target data is mutation data, then according to the mutation situation of the target data, determine whether the target data is abnormal data.
[0027] Optionally, the determining whether the target data is the abnormal data according to the mutation situation of the target data includes:
[0028] Determine whether the mutation rate of the target data within a preset time period reaches or exceeds a preset mutation threshold;
[0029] If the mutation rate of the target data reaches or exceeds the preset mutation threshold, determine that the target data is abnormal data;
[0030] If the mutation rate of the target data does not reach the preset mutation threshold, then determine whether the mutation types of the target data relative to the adjacent front and rear data in the data buffer queue are consistent;
[0031] If the mutation types of the target data relative to the adjacent front and rear data are consistent, determine that the target data is abnormal data;
[0032] If the mutation types of the target data relative to the adjacent front and rear data are inconsistent, determine that the target data is not abnormal data.
[0033] In a second aspect, an energy system data processing device provided by an embodiment of the present application further includes: an acquisition module, a marking module, a determination module, a cleaning module, and an accounting module;
[0034] The acquisition module is configured to acquire energy data reported by a metering device;
[0035] The marking module is configured to add a type mark to the target data in the energy data that meets the predefined data characteristics according to the predefined data characteristics, to obtain target energy data, where the type mark is used to indicate the type of the target data;
[0036] The determination module is configured to determine whether the target data is abnormal data according to the type mark of the target data in the target energy data;
[0037] The cleaning module is configured to clean the abnormal data in the target energy data;
[0038] The accounting module is configured to perform a meter reading and accounting operation according to the cleaned data to obtain the energy consumption data of the metering device.
[0039] In a third aspect, an electronic device provided by an embodiment of the present application further includes: a processor, a storage medium, and a bus. The storage medium stores program instructions executable by the processor. When the electronic device runs, the processor communicates with the storage medium through the bus, and the processor executes the program instructions to perform the steps of the energy data processing method according to any one of the first aspects when executed.
[0040] In a fourth aspect, a computer-readable storage medium provided by an embodiment of the present application stores a computer program, and when the computer program is run by a processor, it performs the steps of the energy data processing method according to any one of the first aspects.
[0041] The beneficial effects of the present application are as follows: The embodiments of the present application provide an energy data processing method. Energy data obtained from metering devices is added with type tags for target data that meets predefined data characteristics according to the predefined data characteristics, thereby obtaining target energy data. Then, according to the type tags of the target data in the target energy data, it is determined whether the target data is abnormal data; the abnormal data in the target energy data is cleaned, and based on the cleaned data, a meter reading and accounting operation is performed to obtain the energy consumption data of the metering device. The method of the present application can operate automatically, automatically add type tags to target data through predefined data characteristics, thereby initially screening possible abnormal data in the energy data to obtain target energy data; on this basis, according to the type tags, it is confirmed whether the target data is abnormal data, realizing the screening of abnormal data, and further realizing the cleaning of abnormal data, so as to realize the meter reading and accounting of energy data. Through automatic operation, the manual input is reduced, and the timeliness, accuracy, and processing efficiency of abnormal data processing in energy data are enhanced. In addition, on the basis of data cleaning, the energy data can be corrected, and re-accounting can be performed without manual intervention, reducing the problem of data errors caused by human participation. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention, and therefore should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.
[0043] Figure 1 It is a flowchart of an energy data processing method provided by an embodiment of the present application;
[0044] Figure 2 It is a flowchart for determining abnormal data in an energy data processing method provided by another embodiment of the present application;
[0045] Figure 3 It is a flowchart for determining abnormal data in an energy data processing method provided by another embodiment of the present application;
[0046] Figure 4 It is a flowchart for determining abnormal data in an energy data processing method provided by still another embodiment of the present application;
[0047] Figure 5 It is a schematic diagram of an energy data processing device provided by an embodiment of the present application;
[0048] Figure 6 It is a schematic diagram of an electronic device provided by an embodiment of the present application. Specific Embodiments
[0049] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention.
[0050] In this application, unless otherwise clearly specified and defined, in the description of the present invention, the meaning of "a plurality" is at least two, such as two or three, unless otherwise clearly and specifically defined. The terms "comprising", "including", or any other variation thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or also includes elements inherent to such process, method, article, or device. Without further limitation, an element defined by the statement "comprising one..." does not exclude the existence of additional identical elements in the process, method, article, or device comprising the element.
[0051] It should be noted that after automatically collecting and performing difference operations on energy data, the usage data of energy such as electricity, water, and gas during this time period can be obtained. During the execution of this business, due to equipment failures or network protocol parsing errors, abnormal data often appears, such as empty data, suddenly increased or decreased data, negative or data type error data, etc. Such abnormal data may affect the correct statistics of the usage of energy such as electricity, water, and gas. In response to this situation, the current energy data processing method provides a foreground alarm function to prompt the operation and maintenance personnel to delete or modify the abnormal data and then manually trigger the meter reading calculation again, so as to eliminate the impact of the abnormal data on the business. Since the causes, times, and frequencies of the abnormal data are all unknown; manually identifying abnormal data requires a large amount of human input; notifying the operation and maintenance personnel to intervene manually through the alarm method has poor timeliness and low processing efficiency; the data correction process is cumbersome, and it is necessary to manually judge whether it will affect the energy usage statistical data and whether it needs to be recalculated, etc., and it is easy to make mistakes. Therefore, the current processing of energy data is uncontrollable, costly, inefficient, and error-prone.
[0052] In response to the above problems, the embodiments of the present application provide multiple possible implementation manners to realize automatic and efficient screening of abnormal data in energy data. The following will be explained and illustrated through multiple examples with reference to the accompanying drawings. Figure 1 The flowchart of a method for processing energy data provided by an embodiment of the present application. This method can be implemented by an electronic device running the above method. The electronic device can be, for example, a terminal device or a server. As Figure 1 shown, this method includes:
[0053] Step 101: Obtain the energy data reported by the metering device.
[0054] It should be noted that the metering device can be, for example, a metering instrument such as an electric meter, a water meter, a gas meter, etc., from which corresponding energy data such as electric meter readings, water meter readings, gas meter readings, etc. can be obtained. For example, at least one type of energy data can be obtained from the metering devices on the energy management platform of the energy management system (or energy management center, Energy Management System, EMS) built by the enterprise.
[0055] Step 102: According to the predefined data characteristics, add a type tag to the target data in the energy data that meets the predefined data characteristics to obtain the target energy data. The type tag is used to indicate the type of the target data.
[0056] It should be noted that the user can define the data characteristics of the target data according to actual usage needs, so as to achieve the initial screening of the energy data. In this application, the definition of the energy data can be the definition of its value, the definition of its data type, special data, data format, the definition of its data change, the definition of the processing of its sudden increase and decrease data, spike data, etc., or a combination of multiple definitions. This application does not limit the specific definition content.
[0057] In a possible implementation manner, the data characteristics of the energy data can be defined as follows: add a type tag to the energy data whose data format does not match the preset format or the energy data that is empty; add a type tag to the energy data whose data is zero; add a tag to the energy data whose increase or decrease ratio is greater than the preset threshold within the preset time. It should be noted that when adding tags, the same tag can be added to all target energy data, or different tags can be added to the defined different data characteristics. This application does not limit this, and the user can choose according to actual needs.
[0058] In a specific implementation manner, add a type tag to the energy data whose data format does not match the preset format (such as string data) or the empty data that is empty, and mark it as type A data; add a type tag to the energy data whose data is zero, and mark it as type B data; add a type tag to the energy data whose sudden increase or decrease is 50% within 5 minutes, and mark it as type C data.
[0059] Step 103: Determine whether the target data is abnormal data according to the type tag of the target data in the target energy data.
[0060] In a possible implementation, after defining the predefined data features, obtain the energy data reported in real time by the metering device (for example, it can be obtained by the monitoring device, and the monitoring device can be a terminal device or a server), perform type marking on each piece of target data that meets the above-defined data feature conditions, and further, the target energy data can be classified according to the type marking.
[0061] It should be noted that, based on the type marking of the target data in the target energy data, it can be determined whether the target data is abnormal data; or the target data can be further calculated or judged according to the type marking to determine whether the target data is abnormal data; it is also possible to determine whether a part of the target data with type marking is abnormal data according to the type marking, and determine the other part of the target data with type marking through further calculation or judgment. The above is only an example, and in actual implementation, there can be other ways to determine the target data, and this application does not limit this.
[0062] Step 104: Clean the abnormal data in the target energy data.
[0063] It should be noted that through the above steps, the abnormal data is confirmed from the target energy data, and then the abnormal data is cleaned to delete duplicate information, correct existing errors, etc. In this application, the methods for cleaning abnormal data include but are not limited to: deleting abnormal data, deleting or estimating invalid values and missing values, etc.
[0064] In a specific implementation, the energy data processing method can also include a scheduled task program to continuously monitor the obtained energy data all day long, mark and identify abnormal data, and clean the abnormal data.
[0065] In a possible implementation, the abnormal data in the energy data is cleaned by deleting some or all of the abnormal data. After deleting the abnormal data, there will be missing data in the original energy data, and this missing data needs to be filled. For example: if the data before and after the missing position is not empty, assign the average value of the adjacent two numbers; if the data after the missing position is empty, assign the previous value; by processing the missing data, invalid values and missing values in the energy data are avoided, ensuring the integrity of the data.
[0066] Step 105: According to the cleaned data, perform the meter reading and accounting action to obtain the energy consumption data of the metering device.
[0067] In a possible implementation, the data after cleaning is used for meter reading and accounting to obtain the energy consumption data of the metering device. For example, the data after cleaning (which can also be the offline data after cleaning) can be applied to the EMS meter reading and accounting service.
[0068] In a specific implementation, after the energy data of metering devices such as electricity meters, water meters, and gas meters is cleaned, the data interval to be calculated is selected. According to the selected interval, the energy consumption data within this interval is obtained. For example: Energy consumption data = the reading at the end of the interval - the reading at the beginning of the interval.
[0069] It should be noted that when there are multiple types of data in the energy data, data intervals can be set separately for each type of energy data, or a unified data interval can be set. This application does not make any restrictions on this. It should also be noted that according to the different lengths of the set data intervals, the corresponding time intervals of the obtained energy consumption data also vary. For example, if the data interval to be calculated is selected as one hour, then according to the selected interval, the energy consumption data within this interval is the energy data at the end of this hour - the energy data at the start of this hour. Similarly, if the data interval to be calculated is selected as one day, the energy consumption data within this interval is the energy data at the end of this day - the energy data at the start of this day. It should be pointed out that in this application, the length of the data interval and the length of the time interval may not exactly correspond. The time interval indicates the time interval of data collection. For example, if data is collected once per hour, the time interval between two adjacent collections is one hour. On this basis, the length of the data interval can be set as one hour, or the length of the data interval can be set to be longer than one hour, and the energy consumption data within the data interval is calculated according to the data interval.
[0070] In summary, the embodiment of the present application provides an energy data processing method. The energy data obtained from the metering device is added with type tags to the target data that meets the predefined data characteristics according to the predefined data characteristics, so as to obtain the target energy data. Then, according to the type tags of the target data in the target energy data, it is determined whether the target data is abnormal data; the abnormal data in the target energy data is cleaned, and according to the cleaned data, the meter reading and accounting operation is performed to obtain the energy consumption data of the metering device. The method of the present application can run automatically, automatically add type tags to the target data through the predefined data characteristics, so as to realize the preliminary screening of the possible abnormal data in the energy data and obtain the target energy data; on this basis, according to the type tags, it is confirmed whether the target data is abnormal data, the screening of the abnormal data is realized, and then the cleaning of the abnormal data is realized, so as to realize the meter reading and accounting of the energy data. Through automatic operation, the manpower input is reduced, and the timeliness, accuracy and processing efficiency of the abnormal processing in the energy data are enhanced. In addition, on the basis of data cleaning, the energy data can be corrected, and the re-accounting can be carried out without manual intervention, reducing the problem of data errors caused by human participation.
[0071] Optionally, on the basis of the above Figure 1 , the present application also provides a possible implementation manner for determining abnormal data in an energy data processing method. Figure 2 This is a flowchart for determining abnormal data in an energy data processing method provided by another embodiment of the present application; as Figure 2 shown, determining whether the target data is abnormal data according to the type tag of the target data in the target energy data includes:
[0072] Step 201: Write the target energy data into the data buffer queue.
[0073] After obtaining the target energy data in step 102, according to the obtained order, write the target energy data into the data buffer queue and wait for the next processing.
[0074] Step 202: Take out the data in the data buffer queue in turn.
[0075] As a special linear list, the queue is operated in a first-in, first-out manner. Therefore, for the data buffer queue, the target energy data is taken out in turn in a first-in, first-out manner, and the following processing is performed on the target energy data:
[0076] Step 203: If the taken-out data is the target data with a type tag, determine whether the target data is abnormal data according to the type tag of the target data.
[0077] For the target energy data retrieved from the data buffer queue, determine whether the target data is abnormal data according to the type tag of the target data.
[0078] In this application, by using the data buffer queue, it is ensured that the target energy data is processed in chronological order, so that the target energy data with a later time will not interfere with the target energy data of the same type with an earlier time, enhancing the robustness of the method of this application.
[0079] Optionally, on the basis of the above Figure 2 This application also provides a possible implementation manner for determining abnormal data in an energy data processing method. To determine whether the target data is abnormal data according to the type tag of the target data, it includes:
[0080] If the type tag of the target data indicates that the target data is a string or null data, determine that the target data is abnormal data.
[0081] In a possible implementation manner, if the type tag of the target data indicates that the target data is a string or null data, determine that the target data is abnormal data. For example, for the energy data with a data format inconsistent with the preset format (such as string data) or null data with an empty data, add a type tag and mark it as type A data. When processing the data in the data buffer queue, if the type tag of the target data is type A data, then the target data is abnormal data.
[0082] Through the above method, the identification of abnormal data of string or null data types is realized.
[0083] Optionally, on the basis of the above Figure 2 This application also provides a possible implementation manner for determining abnormal data in an energy data processing method. To determine whether the target data is abnormal data according to the type tag of the target data, it includes:
[0084] If the type tag of the target data indicates that the target data is zero data, then judge whether the target data is abnormal data according to the data before and after the target data in the energy data.
[0085] If the type tag of the target data indicates that the target data is zero data, it means that the current value of this data is zero. For this type of target data, it is necessary to judge in combination with the data before and after this target data in its corresponding energy data. It should be noted that if the collected energy data includes multiple types of energy data (for example, electricity data, water volume data, gas volume data), if this target data (for example, electricity data) is zero data, then it is necessary to judge in combination with the data before and after this target data in the corresponding energy data (that is, it is necessary to judge in combination with the data before and after this target data in the electricity data).
[0086] By analyzing the data before and after the target data in the energy data, it is determined whether the target data with a type marker indicating that the target data is zero data is abnormal data. Considering the possibility and rationality of the existence of zero data in this type of energy data, the judgment of abnormal data is completed, enhancing the accuracy of the judgment and processing of such target data.
[0087] Optionally, based on the above embodiments, the present application further provides a possible implementation manner for determining abnormal data in an energy data processing method. Figure 3 It is a flowchart for determining abnormal data in an energy data processing method provided by another embodiment of the present application; as Figure 3 shown, according to the data before and after the target data in the data buffer queue, it is determined whether the target data is abnormal data, including:
[0088] Step 301: If there is zero data in the historical data of the target data, it is determined that the target data is not abnormal data; where the historical data is the data retrieved from the energy data before the target data.
[0089] If the type marker of the target data indicates that the target data is zero data and there is zero data in the historical data of the target data, it means that the existence of zero data in this type of energy data is reasonable, so this target data is not abnormal data.
[0090] It should be noted that the historical data is the energy data of the type corresponding to the target data. If the collected energy data includes multiple types of energy data (for example, electricity data, water volume data, gas volume data), if the target data (for example, electricity data) is zero data, it is necessary to judge in combination with the historical data before the target data in the corresponding energy data (that is, it is necessary to judge in combination with the historical data before the target data in the electricity data).
[0091] Step 302: If there is no zero data in the historical data, judge whether the next data of the target data in the energy data is zero data.
[0092] Step 303: If the next data is zero data, it is determined that the target data is not abnormal data.
[0093] Step 304: If the next data is not zero data, it is determined that the target data is abnormal data.
[0094] If the type marker of the target data indicates that the target data is not zero data, it is impossible to judge the rationality of the existence of zero data in this type of energy data based on the historical data of the target data. Therefore, it is necessary to judge whether the next data of the target data in the energy data is zero data, so as to know the rationality of the existence of zero data in this type of energy data. The specific judgment method is as follows:
[0095] If the next data is zero data, it indicates that the existence of zero data in this type of energy data is reasonable, and then this target data is not abnormal data.
[0096] If the next data is not zero data, it indicates that the existence of zero data in this type of energy data is unreasonable, and then it is determined that the target data is abnormal data.
[0097] It should be noted that the next data is the next data at the corresponding position of the target data in the energy data of the energy data type corresponding to the target data. If the collected energy data includes multiple types of energy data (for example, electricity data, water volume data, gas volume data), if the target data (for example, electricity data) is zero data, it is necessary to combine the next data of the target data in the corresponding energy data to make a judgment (that is, it is necessary to combine the next data of the target data in the electricity data to make a judgment).
[0098] By judging the historical data and the next data in the energy data, whether the target data with the type mark indicating that the target data is zero data is abnormal data, the possibility and reasonableness of the existence of zero data in this type of energy data are considered, and the accuracy of the judgment and processing of such target data is enhanced.
[0099] Optionally, on the basis of the above Figure 2 In the energy data processing method provided by the present application, a possible implementation manner for determining abnormal data is further provided. According to the type mark of the target data, it is judged whether the target data is abnormal data, including:
[0100] If the type mark of the target data indicates that the target data is a mutation data, then according to the mutation situation of the target data, it is judged whether the target data is abnormal data.
[0101] If the type mark of the target data indicates that the target data is a mutation data, it is necessary to judge whether it is abnormal data according to the mutation situation of the target data. The mutation data may be a sudden increase or a sudden decrease of the data. For example, type marks are added to the energy data with sudden increases or decreases in the energy data and marked as type C data. Then when the target data is type C data, it is necessary to judge the mutation situation of the target data to further confirm whether the target data is abnormal data. It should be noted that the specific judgment criteria for judging abnormal data through the mutation situation can be set by the user according to needs, and the present application does not limit this.
[0102] Optionally, on the basis of the above embodiments, the present application further provides a possible implementation manner for determining abnormal data in an energy data processing method, Figure 4Flowchart for determining abnormal data in an energy data processing method provided by another embodiment of this application; as Figure 4 shown, according to the mutation situation of the target data, it is judged whether the target data is abnormal data, including:
[0103] Step 401: Judge whether the mutation rate of the target data within a preset duration reaches or exceeds a preset mutation threshold.
[0104] Step 402: If the mutation rate of the target data reaches or exceeds the preset mutation threshold, determine that the target data is abnormal data.
[0105] If the mutation rate of the target data reaches or exceeds the preset mutation threshold, that is, the target data has an unreasonable sudden increase or decrease, which means that the mutation rate of the target data is unreasonable, then this target data is abnormal data. In this application, the specific value of the preset mutation threshold is not limited, and users can set it according to actual needs. In addition, users can also set different preset mutation thresholds for different types of energy data. In this application, the mutation rate can represent the mutation situation of the target data compared with other data of the same type of energy data within a preset duration. Other data of the same type of energy data can be the maximum value, the minimum value, or the average value of other energy data, etc., and this application does not limit this.
[0106] In a specific implementation manner, the preset mutation threshold can be set to 10, that is, when the mutation rate of the target data reaches or exceeds 10 (it can be considered as spike data), the target data is determined to be abnormal data.
[0107] Step 403: If the mutation rate of the target data does not reach the preset mutation threshold, then judge whether the mutation types of the target data relative to the adjacent data before and after in the energy data are the same.
[0108] Step 404: If the mutation types of the target data relative to the adjacent data before and after are the same, determine that the target data is abnormal data.
[0109] Step 405: If the mutation types of the target data relative to the adjacent data before and after are different, determine that the target data is not abnormal data.
[0110] If the mutation rate of the target data does not reach the preset mutation threshold, it is necessary to judge whether the target data is abnormal data according to whether the mutation types of the target data relative to the adjacent data before and after in the energy data are the same.
[0111] If the mutation types of the target data relative to the adjacent data before and after are the same, that is, when the mutation type of the target data compared to the previous adjacent data is the same as the mutation type of the target data compared to the next adjacent data, the target data is abnormal data. For example, if the mutation type of the target data compared to the previous adjacent data is a sudden increase (i.e., the target data is greater than the previous adjacent data), and the mutation type of the target data compared to the next adjacent data is a sudden increase (i.e., the target data is greater than the next adjacent data), then it is determined that the target data is abnormal data.
[0112] If the mutation types of the target data relative to the adjacent data before and after are different, that is, when the mutation type of the target data compared to the previous adjacent data is different from the mutation type of the target data compared to the next adjacent data, the target data is not abnormal data. For example, if the mutation type of the target data compared to the previous adjacent data is a sudden increase (i.e., the target data is greater than the previous adjacent data), and the mutation type of the target data compared to the next adjacent data is a sudden decrease (i.e., the target data is less than the next adjacent data), then it is determined that the target data is not abnormal data.
[0113] Optionally, in this application, the confirmed abnormal data can be marked to facilitate subsequent cleaning of the abnormal data. For example, the abnormal data can be marked as 1, and vice versa marked as 0. When cleaning the abnormal data, only the data marked as 1 needs to be cleaned.
[0114] The following describes the energy data processing device, electronic device, storage medium, etc. for implementing the present application. For the specific implementation process and technical effects, refer to the above, and will not be elaborated below.
[0115] An exemplary implementation of an energy data processing device provided by an embodiment of the present application can execute the energy data processing method provided by the above embodiment. Figure 5 It is a schematic diagram of an energy data processing device provided by an embodiment of the present application. As Figure 5 shown, the above energy data processing device 100 includes: an acquisition module 51, a marking module 53, a determination module 55, a cleaning module 57, and an accounting module 59;
[0116] The acquisition module 51 is configured to acquire energy data reported by a metering device;
[0117] The marking module 53 is configured to add a type mark to the target data in the energy data that meets the predefined data characteristics according to the predefined data characteristics, to obtain target energy data, and the type mark is used to indicate the type of the target data;
[0118] The determination module 55 is configured to determine whether the target data is abnormal data according to the type mark of the target data in the target energy data;
[0119] A cleaning module 57 for cleaning abnormal data in the target energy data;
[0120] An accounting module 59 for performing a meter reading and accounting operation based on the cleaned data to obtain the energy consumption data of the metering device.
[0121] Optionally, a determination module 55 for writing the target energy data into the energy data; sequentially extracting the data in the energy data; if the extracted data is the target data with a type tag, then judging whether the target data is abnormal data according to the type tag of the target data.
[0122] Optionally, the determination module 55 is used to determine that if the type tag of the target data indicates that the target data is a string or null data, then the target data is determined to be abnormal data.
[0123] Optionally, the determination module 55 is used to judge that if the type tag of the target data indicates that the target data is zero data, then judge whether the target data is abnormal data according to the data before and after the target data in the energy data.
[0124] Optionally, the determination module 55 is used to judge that if there is zero data in the historical data of the target data, then it is determined that the target data is not abnormal data; where the historical data is the data taken out from the data buffer queue before the target data; if there is no zero data in the historical data, judge whether the next data of the target data in the energy data is zero data; if the next data is zero data, then it is determined that the target data is not abnormal data; if the next data is not zero data, then it is determined that the target data is abnormal data.
[0125] Optionally, the determination module 55 is used to judge that if the type tag of the target data indicates that the target data is a mutation data, then judge whether the target data is abnormal data according to the mutation situation of the target data.
[0126] Optionally, the determination module 55 is used to judge whether the mutation rate of the target data within a preset time duration reaches or exceeds a preset mutation threshold; if the mutation rate of the target data reaches or exceeds the preset mutation threshold, then it is determined that the target data is abnormal data; if the mutation rate of the target data does not reach the preset mutation threshold, then judge whether the mutation types of the target data relative to the adjacent data before and after in the energy data are the same; if the mutation types of the target data relative to the adjacent data before and after are the same, then it is determined that the target data is abnormal data; if the mutation types of the target data relative to the adjacent data before and after are different, then it is determined that the target data is not abnormal data.
[0127] The above device is used to execute the method provided in the foregoing embodiment, and its implementation principle and technical effects are similar, and will not be elaborated here.
[0128] The above-mentioned modules may be one or more integrated circuits configured to implement the above methods. For example: one or more Application Specific Integrated Circuits (ASICs), or, one or more digital signal processors (DSPs), or, one or more Field Programmable Gate Arrays (FPGAs), etc. For another example, when a certain above-mentioned module is implemented in the form of processing element scheduler code, the processing element may be a general-purpose processor, such as a Central Processing Unit (CPU) or other processors that can call program code. For yet another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0129] An exemplary implementation of an electronic device provided in an embodiment of the present application can execute the energy data processing method provided in the above embodiment. Figure 6 A schematic diagram of an electronic device provided in an embodiment of the present application. The device may be integrated into a terminal device or a chip of a terminal device, and the terminal may be a computing device with data processing capabilities.
[0130] The electronic device includes: a processor 601, a storage medium 602, and a bus. The storage medium stores program instructions executable by the processor. When the control device runs, the processor communicates with the storage medium through the bus, and the processor executes the program instructions to perform the steps of the above energy data processing method when executed. The specific implementation manners and technical effects are similar and will not be elaborated here.
[0131] An exemplary implementation of a computer-readable storage medium provided in an embodiment of the present application can execute the energy data processing method provided in the above embodiment. A computer program is stored on the storage medium, and when the computer program is run by a processor, it performs the steps of the above energy data processing method.
[0132] A computer program stored in a storage medium may include several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to execute some steps of the methods in various embodiments of the present invention. The foregoing storage medium includes: various media such as a USB flash drive, a mobile hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disc that can store program code.
[0133] In several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods. For example, 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 displayed or discussed couplings or direct couplings or communication connections between each other can be through some interfaces. The indirect couplings or communication connections of devices or units can be in electrical, mechanical or other forms.
[0134] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0135] In addition, each functional unit in various embodiments of the present invention can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of a combination of hardware and software functional units.
[0136] The above-mentioned integrated units implemented in the form of software functional units can be stored in a computer-readable storage medium. The above-mentioned software functional units stored in a storage medium include several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to execute some steps of the methods in various embodiments of the present invention. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (English: Read-Only Memory, abbreviated as: ROM), random access memories (English: Random Access Memory, abbreviated as: RAM), magnetic disks or optical discs that can store program codes.
[0137] The above is only the specific implementation manner of this application, but the protection scope of this application is not limited thereto. Any person skilled in the art within the technical scope disclosed by this application can easily think of changes or substitutions, which should all be covered by the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.
Claims
1. An energy data processing method, characterized in that, Including: Obtaining energy data reported by a metering device; According to predefined data characteristics, adding a type tag to target data in the energy data that meets the predefined data characteristics to obtain target energy data, where the type tag is used to indicate the type of the target data; Writing the target energy data into a data buffer queue, and determining whether the target data is abnormal data according to the type tag of the target data in the target energy data; Cleaning the abnormal data in the target energy data; Performing a meter reading and accounting operation according to the cleaned data to obtain the energy consumption data of the metering device; The determining whether the target data is abnormal data according to the type tag of the target data in the target energy data includes: If the type tag of the target data indicates that the target data is a mutation data, determining whether the mutation rate of the target data within a preset time period reaches or exceeds a preset mutation threshold; If the mutation rate of the target data does not reach the preset mutation threshold, determining whether the mutation type of the target data relative to the adjacent data before and after in the data buffer queue is consistent; If the mutation type of the target data relative to the adjacent data before and after is consistent, determining that the target data is abnormal data; If the mutation type of the target data relative to the adjacent data before and after is inconsistent, determining that the target data is not abnormal data.
2. The method according to claim 1, characterized in that, The determining whether the target data is abnormal data according to the type tag of the target data in the target energy data includes: Successively taking out the data in the data buffer queue; If the taken-out data is the target data with a type tag, determining whether the target data is the abnormal data according to the type tag of the target data.
3. The method according to claim 2, wherein The determining whether the target data is the abnormal data according to the type tag of the target data includes: If the type tag of the target data indicates that the target data is a string or null data, determining that the target data is abnormal data.
4. The method according to claim 2, wherein The determining whether the target data is the abnormal data according to the type tag of the target data includes: If the type tag of the target data indicates that the target data is zero data, determining whether the target data is abnormal data according to the data before and after the target data in the energy data.
5. The method according to claim 4, wherein The determining whether the target data is abnormal data according to the data before and after the target data in the energy data includes: If there is zero data in the historical data of the target data, determining that the target data is not abnormal data; where the historical data is the data taken out from the energy data before the target data; If there is no zero data in the historical data, determining whether the next data of the target data in the energy data is zero data; If the next data is zero data, determining that the target data is not abnormal data; If the next data is not zero data, determining that the target data is abnormal data.
6. The method according to claim 2, wherein The determining whether the target data is the abnormal data according to the type tag of the target data further includes: If the mutation rate of the target data reaches or exceeds the preset mutation threshold, determine that the target data is abnormal data.
7. An energy system data processing device, characterized in that, Including: An acquisition module, a marking module, a determination module, a cleaning module, and an accounting module; The acquisition module is used to acquire energy data reported by a metering device; The marking module is used to add a type mark to the target data in the energy data that meets the predefined data characteristics according to the predefined data characteristics, to obtain target energy data, and the type mark is used to indicate the type of the target data; The determination module is used to write the target energy data into a data buffer queue, and determine whether the target data is abnormal data according to the type mark of the target data in the target energy data; The cleaning module is used to clean the abnormal data in the target energy data; The accounting module is used to perform a meter reading and accounting operation according to the cleaned data to obtain the energy consumption data of the metering device; The determination module is specifically used to, if the type mark of the target data indicates that the target data is mutant data, determine whether the mutation rate of the target data reaches or exceeds the preset mutation threshold within a preset time period; if the mutation rate of the target data does not reach the preset mutation threshold, determine whether the mutation type of the target data relative to the adjacent data before and after in the data buffer queue is consistent; if the mutation type of the target data relative to the adjacent data before and after is consistent, determine that the target data is abnormal data; If the mutation type of the target data relative to the adjacent data before and after is inconsistent, determine that the target data is not abnormal data.
8. An electronic device, characterized in that, Including: A processor, a storage medium, and a bus. The storage medium stores program instructions executable by the processor. When the electronic device runs, the processor communicates with the storage medium through the bus, and the processor executes the program instructions to perform the steps of the energy data processing method according to any one of claims 1 to 6 when executed.
9. A computer-readable storage medium, characterized in that, A computer program is stored on the storage medium, and when the computer program is run by the processor, it performs the steps of the energy data processing method according to any one of claims 1 to 6.