Electric meter reading anomaly detection method and system
By constructing an address mapping index table and a global immune tensor filtering mechanism, the problems of low efficiency, high false alarm rate and low resource utilization in power data anomaly detection are solved, and efficient and adaptive power anomaly detection is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- STATE GRID JIANGSU ELECTRIC POWER CO LTD MARKETING SERVICE CENT
- Filing Date
- 2026-04-10
- Publication Date
- 2026-05-12
AI Technical Summary
Existing methods for detecting anomalies in electricity data are inefficient, have a high false alarm rate, and low utilization of computing resources when dealing with massive amounts of data. They also cannot adapt to different users’ electricity consumption characteristics and interference during special periods, resulting in inaccurate detection results and high system energy consumption.
By constructing an address mapping index table for physical rearrangement, a rearranged data structure with contiguous storage is generated. The full adaptive threshold tensor is computed in parallel, and sparse computation and global immune tensor filtering are performed using GPUs to achieve adaptive and accurate detection.
It improves the efficiency and accuracy of power anomaly detection, reduces the false alarm rate, optimizes the utilization of computing resources, and meets the real-time requirements of massive data.
Smart Images

Figure CN122020489A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power data processing technology, specifically to a method and system for detecting abnormal meter readings. Background Technology
[0002] Modern power companies have a large number of users, and marketing operations such as billing and market analysis require anomaly detection of massive amounts of meter data before implementation. Accurate meter data is fundamental to various power-related operations, including market transactions, marketing accounting, demand response, and electricity theft detection. However, meter data is prone to errors due to various reasons, such as incorrect meter installation, data transmission interference, and meter malfunctions. These errors are collectively referred to as anomalies before on-site verification. Anomalies need to be identified and addressed separately before normal operations commence. Therefore, meter anomaly detection has become a crucial task for ensuring the smooth operation of business.
[0003] Currently, the detection of abnormal fluctuations in electricity consumption data employs a fixed threshold rule-based judgment method based on serial calculation by the central processing unit (CPU). A typical implementation process of this method is as follows: the system sequentially iterates through each user's current month's and previous month's electricity consumption data, calculates the ratio of current month's consumption to previous month's consumption, and compares this calculation result with a preset global fixed threshold; if the fluctuation rate exceeds this threshold, the user's current period's electricity consumption data is determined to be abnormal.
[0004] However, the core problem facing electricity meter anomaly detection lies in the massive scale of data. Taking a provincial power grid company as an example, it manages tens of millions of electricity customers, corresponding to an equivalent number of electricity meters, requiring automatic checks on tens of millions of electricity consumption data points each month. Under this data scale, existing methods reveal several shortcomings. First, in terms of computing architecture, existing methods mostly employ a logical flow of cyclical calculation and judgment for each customer. This processing mode cannot effectively utilize the Single Instruction Multiple Data (SIMD) instruction set of modern central processing units (CPUs) or the massively parallel computing capabilities of graphics processing units (GPUs). When dealing with tens of millions of user data points, serial calculations are too time-consuming, forming a significant performance bottleneck and failing to meet the timeliness requirements for rapid batch screening of massive amounts of data.
[0005] Secondly, existing methods lack adaptability and refined consideration in terms of the accuracy of the judgment logic. On the one hand, most existing methods set uniform and static thresholds for judging abnormal fluctuations for all types of users, failing to consider the inherent differences in electricity consumption patterns among different users (such as residents, businesses, and industries). This "one-size-fits-all" rule setting approach is difficult to accurately adapt to diverse real-world electricity consumption scenarios, leading to a large number of false alarms in normal situations. Due to the large user base, the absolute number of these false alarms is substantial, exacerbating the burden of invalid manual review and hindering the overall efficiency of electricity bill issuance. On the other hand, existing logic is based solely on raw readings and does not consider or eliminate irregular disturbances to electricity consumption caused by special periods such as statutory holidays. For example, the normal increase in commercial electricity consumption during long holidays is easily judged as abnormal fluctuations, which further affects the accuracy and reliability of the detection results.
[0006] Furthermore, in terms of computing resource utilization, existing technologies lack optimization mechanisms for sparse data. Power grid anomaly data is inherently sparse within the overall dataset, meaning the vast majority of users are functioning normally. However, existing general-purpose algorithms perform the same precision full-process floating-point calculations and logical judgments on all users, regardless of whether they are clearly functioning normally or in an immune period. This indiscriminate computing approach results in a significant waste of computing power on processing invalid or low-value data, failing to reduce system energy consumption through sparsity optimization.
[0007] Therefore, how to design a batch detection method for abnormal power fluctuations that can efficiently process large amounts of abnormal data in parallel and make adaptive and accurate judgments based on the power consumption characteristics of different users to reduce false alarms has become a technical problem that urgently needs to be solved in this field. Summary of the Invention
[0008] The purpose of this invention is to overcome the problems of low efficiency, high false alarm rate due to rigid rules, interference from special time periods, and low utilization of computing resources in existing power meter reading anomaly detection methods, and to provide a method and system for power meter reading anomaly detection. This invention collects current multi-source power business data from the user to be detected, preprocesses and extracts features to generate a detection validity mask; constructs an address mapping index table based on multi-dimensional business attributes, performs physical rearrangement of memory data on the host side to construct a historical data container, and performs parallel computation of the full adaptive threshold tensor; batches the current data are transferred to GPU memory to construct a feature tensor; a sparse computation index is generated based on the validity mask, and tensor aggregation and load fluctuation rate are calculated in parallel; the calculation results are compared with the threshold tensor to generate an anomaly candidate list; finally, physical index inverse mapping is performed, and filtering and updating are performed based on the global immune tensor. This invention utilizes a heterogeneous computing architecture and memory rearrangement technology to solve the memory access bottleneck and computational efficiency problems of massive discrete data, achieving efficient, adaptive, and accurate detection of power meter anomalies.
[0009] The present invention adopts the following technical solution.
[0010] The first aspect is the method for detecting abnormal meter readings, including: Collect current multi-source power business data of the user to be tested; perform preprocessing on the current multi-source power business data, extract the electricity consumption characteristic parameters used to calculate the load fluctuation rate index, and generate a detection validity mask used to mark the effective calculation status of the electricity consumption characteristic parameters; Construct an address mapping index table, perform physical rearrangement on the current multi-source power business data based on the address mapping index table, and generate a continuously stored rearranged data structure; read the historical multi-source power business data of the user to be detected, align the calculation order of the historical multi-source power business data based on the address mapping index table, calculate the historical load volatility index in parallel, and generate a full adaptive threshold tensor that maps to the rearranged data structure. Based on the rearranged data structure and the detection validity mask, a power feature tensor to be detected is constructed. Read the detection validity mask from the power consumption feature tensor to be detected and generate a sparse computation index; based on the sparse computation index, perform a tensor aggregation operation on the power consumption feature tensor to be detected, use the aggregated data to calculate the load volatility index, compare the load volatility index with the full adaptive threshold tensor element by element, identify abnormal data based on the comparison results, and generate an abnormal candidate list based on the abnormal data. Obtain a preset global immune tensor, filter the abnormal candidate list based on the immune weights in the global immune tensor, and generate a final diagnosis list.
[0011] Preferably, the current multi-source power business data includes: daily granular electricity consumption data, multi-dimensional business attribute parameters, full-volume business expansion change status data, and calendar data for special periods; wherein, Daily granular electricity consumption data includes active power meter readings with timestamps; Multidimensional business attribute parameters include industry classification codes and station area codes; The full range of business expansion change status data includes new installations, capacity increases, capacity reductions, capacity reduction recovery, suspension, and suspension recovery; Special period calendar data includes labels for statutory holidays and labels for non-working days reported by users.
[0012] Preferably, calculating the load volatility index specifically includes: Based on the daily granular electricity consumption data in the current multi-source power business data and the calendar data of the special period, the total electricity consumption of the current month, the total electricity consumption of the previous month, the number of natural days in the current month and the number of natural days in the previous month, as well as the cumulative electricity consumption of the special period in the current month, the cumulative electricity consumption of the special period in the previous month, the number of days in the special period in the current month and the number of days in the special period in the previous month are extracted respectively. Calculate the difference between the total electricity consumption in the current month and the cumulative electricity consumption during special periods in the current month to obtain the clean working day electricity consumption for the current month; and calculate the difference between the total electricity consumption in the previous month and the cumulative electricity consumption during special periods in the previous month to obtain the clean working day electricity consumption for the previous month. Calculate the difference between the number of natural days in the current month and the number of days in the special period of the current month to obtain the number of clean working days in the current month; and calculate the difference between the number of natural days in the previous month and the number of days in the special period of the previous month to obtain the number of clean working days in the previous month. Divide the net working day electricity consumption of the current month by the number of net working days in the current month to obtain the net load intensity of the current month; Divide the net working day electricity consumption of the previous month by the number of net working days of the previous month to obtain the net load intensity of the previous month; The ratio of the current month's net load intensity to the previous month's net load intensity is calculated and used as the load volatility index.
[0013] Preferably, an address mapping index table is constructed, and physical rearrangement is performed on the current multi-source power business data based on the address mapping index table to generate a continuously stored rearranged data structure, specifically including: The industry classification code and the station area code of the user to be detected are bit-concatenated to generate a user feature combination key; Perform a sorting operation on the user feature combination key of the user to be detected to generate an address mapping index table pointing from the original logical index to the target physical index; Allocate contiguous physical storage space in the host's memory; Traverse the address mapping index table and copy the current multi-source power business data of the user to be detected from discrete storage to the continuous physical storage space in sequence to obtain the rearranged data structure of continuous storage; In the rearranged data structure, data with the same user characteristic combination key are arranged continuously in physical space, forming multiple clustered data blocks.
[0014] Preferably, based on the address mapping index table, the calculation order of the historical multi-source power business data is aligned, and the historical load volatility index is calculated in parallel to generate a full adaptive threshold tensor, specifically including: Based on the historical multi-source power business data, the host-side multi-threaded parallel instructions or vectorized instructions are invoked to calculate multiple historical load volatility indicators for each user to be detected in the rearranged data structure within a preset historical period. For each of the multiple clustered data blocks, a statistical reduction algorithm is used to calculate the arithmetic mean and standard deviation of the multiple historical load volatility indicators of all users to be detected in the clustered data block. Based on a preset sensitivity coefficient, a weighted sum of the products of the arithmetic mean and the standard deviation is calculated as an adaptive anomaly judgment threshold shared by the clustered data blocks. The adaptive anomaly detection threshold is assigned to each user to be detected within the corresponding clustered data block using a broadcast mechanism, and then encapsulated according to the physical order of the address mapping index table to generate the full adaptive threshold tensor.
[0015] Preferably, generating a sparse computation index and performing tensor aggregation operations based on the sparse computation index specifically includes: Perform a parallel prefix sum scan operation on the detection validity mask, calculate the cumulative count of valid identifier values in the detection validity mask up to the current position, and determine the cumulative count as the sparse computation index; Based on the sparse computation index, data slices corresponding to the valid identifier values in the detection validity mask are extracted from the tensor of the power feature to be detected, and the data slices are assembled into a dense computation queue with contiguous memory.
[0016] Preferably, filtering and updating are performed based on the global immune tensor, specifically including: Based on the address mapping index table, and according to the physical storage index value in the anomaly candidate list, the corresponding user identity information is reverse-parsed. Based on the user identity information, the corresponding immune weights are read from the global immune tensor; wherein, the immune weights in the global immune tensor are dynamically updated by performing a multiplicative decay operation based on a time decay factor according to a preset time period. If the immune weight is greater than the preset false alarm blocking threshold, the corresponding user is removed from the abnormal candidate list; if the immune weight is not greater than the preset false alarm blocking threshold, the corresponding user is retained to generate the final diagnosis list.
[0017] Secondly, the meter reading anomaly detection system includes: The data acquisition and feature preprocessing module is used to acquire current multi-source power business data of the user to be detected; perform preprocessing on the current multi-source power business data, extract the electricity consumption feature parameters used to calculate the load fluctuation rate index, and generate a detection validity mask used to mark the effective calculation status of the electricity consumption feature parameters; The memory rearrangement and threshold generation module is used to construct an address mapping index table, perform physical rearrangement on the current multi-source power business data based on the address mapping index table, and generate a continuously stored rearranged data structure; read the historical multi-source power business data of the user to be detected, align the calculation order of the historical multi-source power business data based on the address mapping index table, calculate the historical load volatility index in parallel, and generate a full adaptive threshold tensor that maps to the rearranged data structure; The heterogeneous data transmission and tensor construction module is used to construct the power feature tensor to be detected based on the rearranged data structure and the detection validity mask. The sparse acceleration computation and comparison module is used to read the detection validity mask in the tensor of the power consumption feature to be detected and generate a sparse computation index; based on the sparse computation index, it performs a tensor aggregation operation on the tensor of the power consumption feature to be detected, calculates the load volatility index using the aggregated data, compares the load volatility index with the full adaptive threshold tensor element by element, identifies abnormal data based on the comparison results, and generates an abnormal candidate list based on the abnormal data. The immune feedback and diagnostic output module is used to obtain a preset global immune tensor, filter the abnormal candidate list based on the immune weights in the global immune tensor, and generate a final diagnostic list.
[0018] Preferably, in the aforementioned electricity meter reading anomaly detection system, the current multi-source power business data includes: daily granular electricity consumption data, multi-dimensional business attribute parameters, full-volume business expansion change status data, and special period calendar data; wherein, the daily granular electricity consumption data includes active power meter readings with timestamps; the multi-dimensional business attribute parameters include industry classification codes and transformer area codes; the full-volume business expansion change status data includes new installations, capacity increases, capacity reductions, capacity reduction recovery, suspension, and suspension recovery; and the special period calendar data includes statutory holiday labels and user-reported non-working day labels.
[0019] Preferably, when calculating the load volatility index, the system specifically performs the following steps: based on the daily granular electricity consumption data in the current multi-source power business data and the calendar data for special periods, it extracts the total electricity consumption for the current month, the total electricity consumption for the previous month, the number of natural days in the current month and the number of natural days in the previous month, as well as the cumulative electricity consumption for special periods in the current month, the cumulative electricity consumption for special periods in the previous month, the number of days in special periods in the current month and the number of days in special periods in the previous month; it calculates the difference between the total electricity consumption for the current month and the cumulative electricity consumption for special periods in the current month to obtain the net working day electricity consumption for the current month; and it calculates the difference between the total electricity consumption for the previous month and the cumulative electricity consumption for special periods in the previous month. The following steps are performed: 1. Obtain the net working day electricity consumption of the previous month; 2. Calculate the difference between the number of natural days in the current month and the number of days in the special period of the current month to obtain the net working day number of the current month; 3. Calculate the difference between the number of natural days in the previous month and the number of days in the special period of the previous month to obtain the net working day number of the previous month; 4. Divide the net working day electricity consumption of the current month by the net working day number of the current month to obtain the net load intensity of the current month; 5. Divide the net working day electricity consumption of the previous month by the net working day number of the previous month to obtain the net load intensity of the previous month; 6. Calculate the ratio of the net load intensity of the current month to the net load intensity of the previous month as the load fluctuation rate index.
[0020] Preferably, when the memory rearrangement and threshold generation module constructs an address mapping index table and performs physical rearrangement on the current multi-source power business data based on the address mapping index table to generate a continuously stored rearranged data structure, it specifically performs the following: bit-concatenating the industry classification code and the transformer area code of the user to be detected to generate a user feature combination key; performing a sorting operation on the user feature combination key of the user to be detected to generate an address mapping index table pointing from the original logical index to the target physical index; allocating a continuous physical storage space in the host memory; traversing the address mapping index table and sequentially copying the discretely stored current multi-source power business data of the user to be detected to the continuous physical storage space to obtain a continuously stored rearranged data structure; wherein, in the rearranged data structure, data with the same user feature combination key are arranged continuously in physical space, forming multiple clustered data blocks.
[0021] Preferably, when the memory rearrangement and threshold generation module aligns the calculation order of the historical multi-source power business data based on the address mapping index table, calculates historical load volatility indicators in parallel, and generates a full adaptive threshold tensor mapped to the rearranged data structure, it specifically performs the following: Based on the historical multi-source power business data, it calls host-side multi-threaded parallel instructions or vectorized instructions to batch calculate multiple historical load volatility indicators for each user to be detected in the rearranged data structure within a preset historical period; for each of the multiple clustered data blocks, it uses a statistical reduction algorithm to calculate the arithmetic mean and standard deviation of the multiple historical load volatility indicators of all users to be detected within the clustered data block; based on a preset sensitivity coefficient, it calculates the weighted sum of the products of the arithmetic mean and the standard deviation as the adaptive anomaly judgment threshold shared by the clustered data block; it uses a broadcast mechanism to assign the adaptive anomaly judgment threshold to each user to be detected within the corresponding clustered data block, and encapsulates it according to the physical order of the address mapping index table to generate the full adaptive threshold tensor.
[0022] Preferably, when the sparse accelerated computation and comparison module generates a sparse computation index and performs a tensor aggregation operation on the tensor of the power feature to be detected based on the sparse computation index, it is specifically used to: sequentially perform a parallel prefix sum scan operation on the detection validity mask, calculate the cumulative count of valid identifier values in the detection validity mask up to the current position, and determine the cumulative count as the sparse computation index; based on the sparse computation index, extract data slices corresponding to the valid identifier values in the detection validity mask from the tensor of the power feature to be detected, and assemble the data slices into a dense computation queue with contiguous memory.
[0023] Preferably, when the immune feedback and diagnostic output module filters the abnormal candidate list based on the immune weights in the global immune tensor to generate the final diagnostic list, it specifically performs the following steps: Based on the address mapping index table and the physical storage index value in the abnormal candidate list, it reverse-parses the corresponding user identity information; based on the user identity information, it reads the corresponding immune weights from the global immune tensor; wherein, the immune weights in the global immune tensor are dynamically updated according to a preset time period based on a time decay factor multiplication decay operation; if the immune weight is greater than a preset false alarm blocking threshold, the corresponding user is removed from the abnormal candidate list; if the immune weight is not greater than the preset false alarm blocking threshold, the corresponding user is retained to generate the final diagnostic list.
[0024] Thirdly, a terminal includes a processor and a storage medium; The storage medium is used to store instructions; The processor is configured to operate according to the instructions to execute the steps of the method.
[0025] Fourthly, a computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the steps of the method.
[0026] The beneficial effects of this invention are compared with those of the prior art: (1) This invention constructs an address mapping index table based on multi-source power business data and completes physical memory rearrangement based on business clustering characteristics on the host side. This feature enables the originally discrete user data of the same type to be arranged continuously in physical space during subsequent heterogeneous transmission and computation, which greatly triggers the burst transmission and merging access mechanism of the underlying hardware and reduces addressing latency. Secondly, this invention cleverly integrates the detection validity mask and the parallel prefix sum scanning algorithm to generate a sparse computation index and perform tensor aggregation operation. Before entering the high-energy-consuming floating-point operation, this mechanism physically strips away invalid or changed users, eliminates the control flow divergence phenomenon in the GPU computing pipeline, and realizes a geometric leap in computing instruction throughput. Finally, this invention constructs an adaptive feedback mechanism based on global immune tensors to accurately truncate the abnormal candidate list, which is perfectly compatible with compliance power change scenarios such as sudden production in factories. While improving the high-speed performance of massive concurrent detection, it ensures an extremely low false alarm rate for business.
[0027] (2) This invention breaks through the traditional serial loop calculation mode of each household and adopts a technical route that combines host-side memory physical rearrangement with heterogeneous computing architecture. By constructing a rearranged data structure with continuous physical addresses, the cache miss rate during CPU and GPU memory access is effectively reduced; at the same time, the tensor parallel computing capability of the GPU is used to replace the CPU serial logic, and the review task of tens of millions of users is transformed into batch matrix operation of high-dimensional tensors, realizing the real-time requirement of completing the review of massive data anomalies in the critical period such as electricity bill issuance, and significantly improving the overall throughput of the system.
[0028] (3) This invention introduces an adaptive threshold generation mechanism based on user grouping. Address mapping is constructed through multi-dimensional business attributes, and historical volatility statistical characteristics (such as mean and standard deviation) of each group are calculated based on a parallel reduction algorithm to generate a full adaptive threshold tensor. This solves the problem that traditional fixed threshold rules cannot be universally applied to different electricity consumption patterns, leading to a high false alarm rate. It allows the anomaly judgment criteria to be dynamically adjusted according to the actual electricity consumption patterns of users in different industries and distribution areas, improving the accuracy and rationality of anomaly detection.
[0029] (4) This invention constructs a load volatility calculation model based on clean working days. When calculating user electricity consumption volatility, this model eliminates the differences in electricity density caused by non-operating periods such as holidays through a double elimination mechanism of numerator and denominator; at the same time, it combines full business expansion change data to generate a detection validity mask, automatically shielding pseudo-abnormal fluctuations caused by business changes such as new installations and suspensions. This technical means solves the technical problem that traditional volatility calculations are distorted due to the inclusion of abnormally low loads during special periods, leading to misjudgments. This makes the volatility index more accurately reflect the changes in electricity consumption under normal working conditions, providing more reliable basic data for subsequent anomaly judgment.
[0030] (5) This invention addresses the sparse characteristics of abnormal power grid data by designing a sparse computation mechanism based on prefix sum scanning and tensor aggregation. By generating a sparse computation index, the originally discrete valid data is reorganized into a dense computation queue, and high-energy-consuming floating-point operations are performed only on the valid data. This mechanism avoids the idle and divergent operation of GPU threads, and significantly reduces the invalid computation overhead while ensuring full coverage, thus significantly improving the utilization rate and energy efficiency of hardware resources.
[0031] (6) This invention establishes a feedback mechanism based on a global immune tensor. Immune weights are applied to users previously identified as false positives, and these weights decay exponentially over time. Simultaneously, it supports real-time weight reset based on manual feedback. This mechanism endows the detection system with the ability to remember and forget, avoiding repeated interference with the same specific user and preventing historical whitelist users from permanently evading supervision. Through the bidirectional adjustment of automatic decay during long-term operation and manual intervention, the false positive rate of the system is continuously reduced. Attached Figure Description
[0032] Figure 1 This is an overall flowchart of the meter reading anomaly detection method provided by the present invention. Detailed Implementation
[0033] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of this invention. The embodiments described in this application are merely some embodiments of this invention, and not all embodiments. Based on the spirit of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the protection scope of this invention.
[0034] Example 1: like Figure 1 As shown, this invention discloses a method for detecting abnormal meter readings, including: Step 1: Collect current multi-source power business data of the user to be tested; perform preprocessing on the current multi-source power business data, extract the power consumption characteristic parameters used to calculate the load fluctuation rate index, and generate a detection validity mask to mark the effective calculation status of the power consumption characteristic parameters.
[0035] 1.1 Acquisition of multi-source business data and data during special time periods In step 1, the current multi-source power business data includes: Daily granular electricity consumption data, including active power meter readings with timestamps; Multidimensional business attribute parameters, including at least industry classification codes and station area codes; The complete data on changes to business expansion status includes at least new installations, capacity increases, capacity reductions, capacity reduction recovery, suspensions, and suspension recoverys. Calendar data for special periods, including labels for statutory holidays and labels for non-working days reported by users.
[0036] The specific implementation process is as follows: (1) Extract daily granular electricity consumption data of the user to be tested through the data interface, generate monthly statistics, and retain the daily detailed index. Based on the user ID index, fill the above data into an N×4-dimensional basic numerical tensor to form preliminary electricity consumption characteristic parameters, including the total electricity consumption for the month. Total electricity consumption last month and the corresponding number of natural days in the month. Number of natural days in the previous month Based on the timestamps of the daily granular data, dates are matched with calendars for specific time periods to accurately filter out the accumulated electricity consumption on non-working days.
[0037] (2) Simultaneously extract the user's multi-dimensional business attribute parameters, including at least the industry classification code and the station area code. These attribute data will be used to construct the address mapping index table. They will not directly participate in the volatility calculation in this step, but will be associated with the electricity data through the user ID.
[0038] (3) Automatically parse customer profiles in the marketing system to extract full business expansion change status information. In this embodiment, the full business expansion change status information includes at least six types of business processes that cause sudden changes in the load baseline throughout the entire life cycle of the power user, specifically including: new installation, capacity increase, capacity reduction, capacity reduction recovery, suspension, and suspension recovery. Perform binary encoding mapping on the above statuses to obtain the full business expansion status code. : If a user is in one of the above six change states, the state value is set to 0 (marked as needing to be suppressed). If the user is using electricity normally and there are no changes, the status value is set to 1 (marked as valid calculation).
[0039] (4) Obtain calendar data for specific time periods and construct tensors This tensor consists of two parts: Global statutory holidays: Holiday mask automatically generated from statutory holiday tags; User-defined reporting date: Non-working day mask generated by user-reported non-working day tags (such as equipment maintenance, shift shutdown, etc.).
[0040] 1.2 Effective Operating Duration Adjustment To overcome the technical shortcomings of traditional models that rely solely on the number of days in a natural month to calculate the average daily load, resulting in false low load reports during long holidays (such as the Spring Festival) or planned shutdowns by enterprises (such as equipment maintenance) due to the natural decline in total electricity consumption, a clean workday feature extraction mechanism is introduced.
[0041] Based on the total duration tensor of the special time period in step 1.1 Based on daily granular electricity consumption data, the following correction parameters are extracted as core electricity consumption characteristic parameters through timestamp matching and tensor reduction calculation: Cumulative electricity consumption during special periods in the current month: Cumulative electricity consumption during special periods (holidays and reporting dates) in the current month. ; Cumulative electricity consumption during special periods last month: Cumulative electricity consumption during special periods last month (holidays and reporting dates). ; Number of special period days in the current month: The cumulative number of days in the current month that fall under the special period. ; Number of special period days in the previous month: The cumulative number of days in the previous month that belonged to special periods. .
[0042] The specific extraction mechanism includes: The timestamps of the daily granular electricity consumption data of the user to be detected are matched with the calendar data of the special time period to generate a binary time period mask vector sorted by date. In this vector, the positions of dates belonging to the special time period (holidays and reporting days) are set to 1, and the positions of normal working days are set to 0.
[0043] The number of 1s in the vector is calculated by calling the CPU or GPU accumulation instruction (such as summation reduction) within the time window of the current month and the previous month, respectively, to directly obtain the number of special time period days in the current month and the number of special time period days in the previous month.
[0044] The binarized time period mask vector is multiplied element-wise with the user's daily granular energy consumption vectors for the current month and the previous month. This operation filters the data by setting the energy consumption for non-special time periods to zero, retaining only the energy consumption readings for special time periods. Then, a parallel accumulation operation is performed on the multiplied result vector to obtain the cumulative energy consumption for special time periods in the current month and the cumulative energy consumption for special time periods in the previous month.
[0045] 1.3 Calculation of Precise Volatility Operator Step 1 involves calculating the load volatility index, specifically including: Based on the daily granular electricity consumption data in the current multi-source power business data and the calendar data of the special period, the total electricity consumption of the current month, the total electricity consumption of the previous month, the number of natural days in the current month and the number of natural days in the previous month, as well as the cumulative electricity consumption of the special period in the current month, the cumulative electricity consumption of the special period in the previous month, the number of days in the special period in the current month and the number of days in the special period in the previous month are extracted respectively. Calculate the difference between the total electricity consumption in the current month and the cumulative electricity consumption during special periods in the current month to obtain the clean working day electricity consumption for the current month; and calculate the difference between the total electricity consumption in the previous month and the cumulative electricity consumption during special periods in the previous month to obtain the clean working day electricity consumption for the previous month. Calculate the difference between the number of natural days in the current month and the number of days in the special period of the current month to obtain the number of clean working days in the current month; and calculate the difference between the number of natural days in the previous month and the number of days in the special period of the previous month to obtain the number of clean working days in the previous month. The net working day electricity consumption for the current month is divided by the number of net working days in the current month to obtain the net load intensity for the current month; the net working day electricity consumption for the previous month is divided by the number of net working days in the previous month to obtain the net load intensity for the previous month. The ratio of the current month's net load intensity to the previous month's net load intensity is calculated and used as the load volatility index.
[0046] In a preferred but non-limiting embodiment of the invention, the load volatility index Defined as:
[0047] The numerator corresponds to the current month's pure load intensity; the denominator corresponds to the previous month's pure load intensity. Total electricity consumption for the month The total electricity consumption for last month, and For the corresponding number of natural days in the current month, This refers to the number of natural days in the previous month.
[0048] 1.4 Business Status Mask Defense and Initial Anomaly Screening To prevent false alarms triggered by drastic fluctuations caused by business process changes (such as new installations or capacity increases), a detection validity mask is constructed to implement parallel filtering. The detection validity mask is defined as follows:
[0049] in, The validity mask is used not only to identify the validity of the calculation of the power consumption characteristic parameters, but also to indicate the branch of the calculation logic (such as normal calculation or forced setting). For volatility The denominator tensor in the formula; This is a bitwise logical OR operation between tensors; Encoding the status of the entire business expansion; Used for identification Which users are in the newly installed, paused, or other similar states?
[0050] The matrix-based implementation methods for exception detection logic include: For business expansion and user changes ( Regardless of its volatility calculation value, it is forcibly reset to the safe value of 100 (i.e., considered as normal volatility). This operation achieves complete automatic immunity to known business volatility such as new installations, capacity increases, and suspensions.
[0051] For normal users ( ):like If the verification fails (e.g., the denominator is singular due to 0 valid days in the previous month), the system will automatically mark it as data abnormal and remove it; otherwise, its original volatility calculation value will be retained and it will enter the subsequent anomaly detection process.
[0052] Step 2: Construct an address mapping index table, perform physical rearrangement of the current multi-source power business data based on the address mapping index table, and generate a continuously stored rearranged data structure; read the historical multi-source power business data of the user to be detected, align the calculation order of the historical multi-source power business data based on the address mapping index table, calculate the historical load volatility index in parallel, and generate a full adaptive threshold tensor that maps to the rearranged data structure.
[0053] 2.1 Multidimensional user segmentation Based on the multidimensional business attribute parameters, two key feature fields are extracted: industry classification code, which identifies the user's industry (such as industrial, commercial, residential, etc.); and transformer area code, which identifies the user's physical power supply area.
[0054] To ensure the rationality of the clustering, this embodiment adopts a differentiated aggregation strategy for users of different voltage levels: high-voltage users and low-voltage non-residential users are aggregated according to two dimensions: industry characteristics and the transformer area to which they belong; low-voltage residential users are aggregated according to the single dimension of the transformer area to which they belong.
[0055] The industry classification code and the transformer area code of the user to be tested are concatenated bitwise to generate a user feature combination key. Specifically, the industry classification code is used as the high-order byte of the combination key, and the transformer area code is used as the low-order byte. These two bytes are then concatenated into an integer value using binary bitwise operations. For low-voltage residential users using single-dimensional aggregation, the high-order industry classification code can be set to a uniform default value during concatenation, thus reflecting only the difference in the transformer area code. Through this step, each user to be tested obtains a unique sorting key value. The numerical similarity of this key value directly represents the similarity of users in the industry and geographical dimensions.
[0056] 2.2 CPU-GPU Collaborative Reordering Based on Cluster Features A sorting operation is performed on the user feature combination key of the user to be detected, generating an address mapping index table pointing from the original logical index to the target physical index. Specifically, the user feature combination key contains integer values of industry and station area information. A quick sorting algorithm (such as QuickSort or RadixSort) is performed on the user feature combination key generated in step 2.1. After sorting, an address mapping index table pointing from the original logical index to the target physical index is generated. This index table is essentially a lookup array, where the i-th element records the ID or memory offset of the user ranked i-th after sorting in the original data.
[0057] In the host-side (CPU) memory, a contiguous physical storage space is requested based on the total number of users to be detected and the data dimensions.
[0058] The address mapping index table is traversed, and a location remapping operation is performed: based on the mapping relationship in the index table, the current multi-source power business data of each user is read from the original discrete storage space and copied sequentially to the corresponding location in the newly allocated contiguous physical storage space, thereby constructing a reordered data structure for contiguous storage. In this reordered data structure, current multi-source power business data with the same user characteristic combination key are arranged contiguously in physical space, forming multiple clustered data blocks. After the copy is completed, user data within the same cluster is compactly arranged in physical memory. This means that when data is subsequently transferred from the CPU to the GPU and read from within the GPU, the hardware burst transfer mechanism can be triggered to the greatest extent.
[0059] Suppose that the original discretely acquired multi-source power business data contains three users: User 1 (textile industry, Chengdong Industrial Park) located at physical memory address A, User 2 (low-voltage resident, Xingfu Community) located at physical memory address B, and User 3 (also textile industry, Chengdong Industrial Park) located at physical memory address C. Under traditional processing mechanisms, the computing unit needs to repeatedly navigate across discrete addresses A, B, and C. However, after steps 2.1 and 2.2 of this invention, User 1 and User 3, having the same industry and distribution area attributes, are assigned the same high and low byte characteristics of the combination key. After sorting and physical rearrangement, the data of User 1 and User 3 are copied to adjacent physical addresses in a newly allocated contiguous physical storage space (e.g., address offsets 0x01 and 0x02). This physical memory rearrangement based on business logic attributes not only naturally aggregates historical data of similar groups at the business level, but also ensures at the underlying computer architecture level that whether the CPU extracts historical samples of the group for SIMD reduction or transmits current data to the GPU in batches via the PCIe bus, it can directly trigger the burst access mechanism of memory, which greatly reduces cache miss rate and addressing overhead.
[0060] To ensure a one-to-one correspondence between current and historical data during tensor operations, the calculation order of the historical multi-source power business data is aligned using the same address mapping index table. Specifically, the structure of the historical multi-source power business data is identical to that of the current multi-source power business data. Given the massive amount of historical data and its sole purpose of generating a one-time threshold, this embodiment preferably avoids performing a full physical deep copy of the historical data on the host side. Instead, it uses an index table to redirect memory pointers, constructing a historical data access view in the host-side memory that is logically aligned with the rearranged data structure of the current data. The alignment mechanism for this view is as follows: when subsequent multi-threaded parallel computations are called, the execution thread assigned to the i-th position in the logical order does not directly read the data at the i-th physical location in the historical data storage space. Instead, it first queries the i-th element of the address mapping index table to obtain the original physical address offset j it points to, and then directly steps to read the historical multi-source power business data at that offset j. Through the aforementioned index-based addressing redirection mechanism, the system ensures that the historical load volatility sample tensor extracted by parallel computing is logically perfectly aligned with the physically continuous current rearranged data structure without incurring large-scale historical data memory transfer overhead. Of course, when host-side memory is extremely abundant, the historical data can be physically rearranged in the same way as the current data without transferring its original data to GPU memory, thus reducing the transfer overhead of heterogeneous computing.
[0061] 2.3 Sampling of Historical Isomorphic Volatility Samples Based on the historical multi-source power business data, the host-side multi-threaded parallel instructions or vectorized instructions (such as OpenMP or AVX instruction sets) are invoked to batch calculate multiple historical load volatility indicators for each user to be detected in the rearranged data structure within a preset historical period.
[0062] Specifically, historical multi-source power business data is read using a 2.2-aligned indexed view and multi-threaded parallel access. For each user to be monitored, its historical data sequence within a preset historical time window is extracted. The historical time window is preferably the most recent 12 calendar months to cover the seasonal variation characteristics of user electricity consumption.
[0063] To ensure the statistical comparability of the generated thresholds, the same clean workday load intensity model as in step 1.3 was strictly applied to each extracted historical month's data to obtain multiple historical load volatility indices. After the above calculations, for N users to be detected, the system generates a historical load volatility sample tensor with dimensions N×12 in the host's memory. Each element in this tensor represents the user's actual volatility level during a specific clean workday period in history. Due to the isomorphism of the calculation logic, these historical samples can accurately reflect the user's normal volatility range under the current algorithm standards.
[0064] 2.4 Data Standardization and Offline Computation For each of the multiple clustered data blocks, a statistical reduction algorithm is used to calculate the arithmetic mean and standard deviation of the multiple historical load volatility indicators of all users to be detected within the clustered data block; based on a preset sensitivity coefficient, a weighted sum of the products of the arithmetic mean and the standard deviation is calculated as the adaptive anomaly judgment threshold for all users to be detected within the clustered data block.
[0065] Specifically, the tensor calculation engine reads the sampled data from step 2.3. In order to smooth out the nonlinear characteristics of the original power fluctuation data, such as eliminating the influence of extreme values and making the data distribution closer to a normal distribution, it performs a process for each historical load fluctuation index. Perform a logarithmic transformation to obtain the standardized logarithmic volatility sequence. , is represented as:
[0066] For each contiguous cluster of memory blocks, the CPU's SIMD vectorized reduction instruction set (such as AVX or SSE) is invoked. Using a parallel reduction algorithm, the statistical characteristics of the overall historical distribution of the cluster are calculated in parallel without loop unrolling. Specifically, the mean μ and standard deviation σ of the logarithm of volatility y are calculated, and an adaptive anomaly detection threshold shared by the cluster data blocks is constructed based on the μ+3σ criterion, expressed as:
[0067] in, This is the total number of historical samples contained within the cluster (i.e., the number of users in the cluster × the historical sampling window size of 12). In this embodiment, the sensitivity coefficient k=3 is preferred to cover 99.7% of the normal fluctuation probability range.
[0068] 2.5 Inverse Exponential Transform and Generation of Full Threshold Tensors The adaptive anomaly detection thresholds for all users to be detected are encapsulated according to the physical order of the address mapping index table to generate the full adaptive threshold tensor.
[0069] Specifically, since the threshold obtained in step 2.4 is in the logarithmic domain, it cannot be directly compared with the original volatility value. Therefore, this step first performs an inverse exponential transformation on the threshold to restore it to the original volatility dimension, thus obtaining the adaptive anomaly detection threshold corresponding to this user group. .
[0070] To adapt to the subsequent SIMT (Single Instruction, Multithreaded) computing mode of GPUs, the aforementioned group-level threshold needs to be expanded to an individual-level tensor. Based on the address mapping index table constructed in step 2.2 and its determined physical storage order, the adaptive anomaly detection threshold is assigned to each user to be detected within the corresponding cluster data block using a broadcast mechanism. That is, the threshold shared by a certain cluster is... The values are batch-filled into the memory locations corresponding to all users in this group.
[0071] Finally, the tensor is encapsulated according to the physical order of the address mapping index table to generate the full adaptive threshold tensor. After the encapsulation, a full adaptive threshold tensor of dimension N×1 is generated, where N is the total number of users to be detected. The physical storage order of this tensor is strictly aligned with the rearranged data structure in step 2.2, ensuring that when tensor comparison is performed in the GPU in the subsequent step 4, the real-time volatility of each user can accurately match the adaptive threshold of their group.
[0072] Step 3: Based on the rearranged data structure and the detection validity mask, construct the power feature tensor to be detected.
[0073] Allocate contiguous physical space in the device's (GPU) video memory and initialize the power feature tensor to be detected. In this tensor, the number of rows N is strictly consistent with the number of users after rearrangement in step 2, and the physical row order is perfectly aligned with the full threshold tensor generated in step 2.5. This means that the tensor... The data in the i-th row will physically correspond directly to the threshold standard of the i-th row of the full threshold tensor.
[0074] To adapt to the effective volatility calculation logic described in step 1, The column dimension features M include, but are not limited to: Core metering channel: Total electricity consumption for the current month Total electricity consumption last month ; Time-series feature channel: Number of natural days in the current month Number of natural days in the previous month ; Corrected parameter channel: Cumulative electricity consumption during special periods in the current month. The cumulative electricity consumption during a special period last month The cumulative number of days in the month that fall under special periods The cumulative number of days in the previous month that fell under a special period. ; Business attribute channels: Industry code, Subway area code, and full business expansion status code. The mask for detecting validity generated in step 1.4 is used as an independent dimension to directly encode the mask into a tensor, allowing subsequent filtering operations to be directly converted into tensor dot multiplication or bitwise operations, thus avoiding branching decisions in the control flow.
[0075] A CPU-GPU heterogeneous collaborative transfer strategy is adopted: Since step 2.2 has already built a contiguous current rearranged data structure in the host memory, the underlying accelerated computing runtime API (such as cudaMemcpy) or DMA (Direct Memory Access) mechanism is directly called to utilize the high bandwidth of the PCIe bus to copy the physically contiguous memory data on the host to the GPU memory in batches using a deep copy method. The corresponding address space. This avoids high-latency random memory access during PCIe transfers, ensuring data enters the GPU at the highest throughput, and laying the physical foundation for the GPU-internal merge access in step 4.
[0076] Step 4: Read the detection validity mask in the tensor of the power consumption feature to be detected, and generate a sparse computation index based on the detection validity mask; perform tensor aggregation operation based on the sparse computation index, and calculate the load volatility index; compare the calculation result with the threshold at the corresponding position in the full adaptive threshold tensor to generate an anomaly candidate list.
[0077] 4.1 Level coarse screening production line Perform a parallel prefix sum scan operation on the detection validity mask to calculate the cumulative count of valid identifier values up to the current position, which serves as the sparse computation index.
[0078] Specifically, for users with known service changes such as new installations and suspensions that are prevalent in power data, a low-power bit-level filtering mechanism is designed to avoid performing expensive floating-point division operations on invalid data.
[0079] The tensor of the electrical quantity to be detected constructed in step 3 In the middle, read the detection validity mask generated in step 1. The mask is a binary vector, where "1" represents that the user is a valid computational object, and "0" represents that the user is an invalid object or an object that needs to be immune.
[0080] A parallel prefix sum scan is performed on the detection validity mask. This operation calculates the total number of "1"s to the left of each element in the vector, i.e., the cumulative count of valid identifier values. This cumulative count directly determines the consecutive physical sequence number of each valid user in the subsequent dense computation queue, thus forming a sparse computation index. For example, if there are 5 valid users ahead of a certain valid user (mask 1), the result calculated by this operation indicates that the user should be ranked in the 6th position (array index 5) in the subsequent compact queue. The filtering operation here is an accelerated implementation of the business state mask defense logic in step 1.4, that is, by physically skipping the calculation, it achieves automatic immunity to users with known business changes. The original N-times calculation task is automatically compressed into Second-rate( This reduces the computational load on the GPU.
[0081] 4.2 Floating-point precision pipeline Parallel aggregation operations are performed based on the sparse computation index. This operation is implemented through the parallel computing mechanism of the GPU to extract data slices corresponding to valid identifier values from the tensor of the power feature to be detected and assemble them into a dense computation queue with contiguous memory. Executed on the GPU floating-point unit, the load volatility index is calculated for the dense computation queue to obtain a dense result vector.
[0082] Specifically, the tensor computation engine performs aggregation operations based on the sparse computation index generated in step 4.1: The tensor of the electrical quantity to be detected constructed in step 3 In the process, extract the data slices corresponding to the valid identifier values, including , The parameters are set, and the extracted data is tightly arranged and assembled into a dense computation queue with contiguous memory. Through this operation, valid data that was originally not physically contiguous is mapped to a compact tensor with contiguous memory addresses, triggering the GPU's merged memory access mechanism.
[0083] The GPU's floating-point unit is invoked to execute the load volatility index R* calculation formula defined in step 1.3 on the valid data in the dense computation queue. After the calculation is completed, a compact result vector is generated. Since all invalid / immune users are removed from the computation queue, the GPU's thread bundles no longer exhibit control flow divergence, thus maximizing instruction throughput.
[0084] To compare the positional correspondence with the full adaptive threshold tensor generated in step 2.5, a scattering operation is performed: based on the same sparse computation index, the computed dense result vector is scattered back into the full physical space of dimension N. For invalid positions that are not computed, default values or marker bits can be filled in, thereby generating a full load volatility tensor with the same physical dimension as the full adaptive threshold tensor.
[0085] 4.3 Compare the calculated R* with the total load volatility tensor element by element:
[0086] in, The system uses a binary anomaly detection mask. If a user's R* is greater than its corresponding adaptive threshold Th, the system determines that the user has an abnormal fluctuation and sets the corresponding position in the mask to 1. This indicates that the user's electricity consumption behavior exceeds its historical statistical patterns and the allowable range for the current period, requiring an alert. Otherwise, the system determines that the user's fluctuation is normal and sets the corresponding position in the mask to 0. Such users are considered to be using electricity within a reasonable range, and the system directly performs automatic filtering, not adding them to the anomaly list.
[0087] Using Boolean mask filtering operators from the GPU to extract only... The index and corresponding data marked as 1 are generated. A list of anomaly triples containing {physical storage index, load volatility index R*, and adaptive threshold Th} is produced as the final anomaly candidate list. Using CUDA Streams technology, this anomaly list is written back to CPU memory non-blockingly.
[0088] Step 5: Obtain the preset global immune tensor, filter the abnormal candidate list based on the immune weights in the global immune tensor, generate the final diagnosis list, and update the global immune tensor based on the time decay factor or false alarm feedback signal.
[0089] 5.1 Inverse mapping of physical indexes for anomaly masks Based on the address mapping index table and the physical storage index value in the anomaly candidate list, the corresponding user identity information and station area code are reversely parsed.
[0090] Specifically, the CPU calls the inverse function of the address mapping index table generated in step 2.2, and uses the physical storage index in the abnormal triplet list generated in step 4.3 as the key value to reversely look up the unique user ID of the corresponding power marketing business system.
[0091] Simultaneously, the corresponding industry code and transformer area code are directly extracted from the data returned in step 4, and re-bound to user ID, load fluctuation rate index, adaptive threshold, and business attributes to generate a preliminary anomaly list. .
[0092] 5.2 False alarm suppression based on immune tensor Based on the user identity information, the corresponding immune weights are read from the global immune tensor; wherein, the immune weights in the global immune tensor are dynamically updated by performing a multiplicative decay operation based on a time decay factor according to a preset time period.
[0093] Specifically, in order to address the problem that traditional detection models cannot adapt to dynamic changes in user electricity consumption behavior (such as sudden overtime work in factories or equipment debugging), a negative feedback immune mechanism is introduced.
[0094] Loading the global immunity tensor This tensor records the users who made false positives in historical feedback and their immunity weights, represented as:
[0095] Each element A false alarm exemption weight is uniquely assigned to each electricity user, where N is the total number of users. Initially set to 0. If =1 indicates that the user was recently manually verified as a false alarm (i.e., although the fluctuations are large, they are within the scope of compliant electricity use), and there is a very high tendency to suppress further fluctuations from such users. If =0 indicates that the user has no historical feedback records, or that previous exemption rights have completely decayed over time. The system adopts a zero-tolerance policy for such fluctuations, directly triggering an alarm; if A value between 0 and 1 indicates that the user is within the validity period of the exemption, but its effectiveness gradually weakens over time.
[0096] For the list of anomaly candidates The following filtering logic is executed on the users to generate the final diagnosis list. :
[0097] in, This is the identifier of the individual user to be determined, corresponding to a unique user ID; Set a preset false alarm blocking threshold (e.g., 0.05 to 0.1). Only when a user's immunity weight is below the preset false alarm blocking threshold will the false alarm be blocked. It is only included in the final diagnosis list when (immunity has expired or there is no immunity). The final diagnosis list is generated; otherwise, it is considered a known special condition, automatically intercepted, and the corresponding user is removed from the abnormal candidate list.
[0098] 5.3 Asynchronous write-back of diagnostic results Using an asynchronous I / O mechanism, the final diagnostic list will be... Batch writes are performed to the electricity marketing business database. This operation is decoupled from the front-end GPU computing pipeline, ensuring that write latency does not block tensor calculations for the next batch. The database automatically generates on-site inspection work orders or SMS alarms via triggers or message queues, achieving a closed loop from algorithm detection to business execution.
[0099] 5.4 Adaptive decay and update of immune weights To support the dynamic attribute update described in step 5.2, a multiplicative decay operation is performed on all immune weights in the global immune tensor based on the time decay factor according to a preset time period; or, in response to a false alarm feedback signal for a specific user, the immune weights of the corresponding user in the global immune tensor are reset to a preset initial value.
[0100] Specifically, a manual feedback interface is established. When frontline staff report a test result as a false alarm, an immune activation operation is automatically executed: the user is then... The corresponding weight in the system is reset to 1.0 (full immunity status).
[0101] Before the start of each time period, such as the 1st of each month, perform an exponential decay update on the total immunity tensor:
[0102] in, This represents the immune tensor for the current testing cycle; This is the immune tensor from the previous cycle; This is the time decay factor, for example, 0.05.
[0103] Updated global immunity tensor This information will be persistently stored and reloaded in step 5.2 of the next detection cycle. This mechanism ensures that the detection model can both remember special operating conditions in the short term and automatically forget expired exemptions over time, thus enabling adaptive evolution of the detection model.
[0104] Example 2: An abnormal meter reading detection system includes: The data acquisition and feature preprocessing module is used to acquire current multi-source power business data of the user to be detected; perform preprocessing on the current multi-source power business data, extract the electricity consumption feature parameters used to calculate the load fluctuation rate index, and generate a detection validity mask used to mark the effective calculation status of the electricity consumption feature parameters; The memory rearrangement and threshold generation module is used to construct an address mapping index table, perform physical rearrangement on the current multi-source power business data based on the address mapping index table, and generate a continuously stored rearranged data structure; read the historical multi-source power business data of the user to be detected, align the calculation order of the historical multi-source power business data based on the address mapping index table, calculate the historical load volatility index in parallel, and generate a full adaptive threshold tensor that maps to the rearranged data structure; The heterogeneous data transmission and tensor construction module is used to construct the power feature tensor to be detected based on the rearranged data structure and the detection validity mask. The sparse acceleration computation and comparison module is used to read the detection validity mask in the tensor of the power consumption feature to be detected and generate a sparse computation index; based on the sparse computation index, it performs a tensor aggregation operation on the tensor of the power consumption feature to be detected, calculates the load volatility index using the aggregated data, compares the load volatility index with the full adaptive threshold tensor element by element, identifies abnormal data based on the comparison results, and generates an abnormal candidate list based on the abnormal data. The immune feedback and diagnostic output module is used to obtain a preset global immune tensor, filter the abnormal candidate list based on the immune weights in the global immune tensor, and generate a final diagnostic list.
[0105] In the aforementioned electricity meter reading anomaly detection system, the current multi-source power business data includes: daily granular electricity consumption data, multi-dimensional business attribute parameters, full-volume business expansion change status data, and special period calendar data; wherein, the daily granular electricity consumption data includes active power meter readings with timestamps; the multi-dimensional business attribute parameters include industry classification codes and transformer area codes; the full-volume business expansion change status data includes new installations, capacity increases, capacity reductions, capacity reduction recovery, suspension, and suspension recovery; and the special period calendar data includes statutory holiday labels and user-reported non-working day labels.
[0106] When calculating the load fluctuation rate index, the system specifically performs the following steps: Based on the daily granular electricity consumption data in the current multi-source power business data and the calendar data for special periods, it extracts the total electricity consumption for the current month, the total electricity consumption for the previous month, the number of natural days in the current month and the number of natural days in the previous month, as well as the cumulative electricity consumption for special periods in the current month, the cumulative electricity consumption for special periods in the previous month, the number of days in special periods in the current month and the number of days in special periods in the previous month; it calculates the difference between the total electricity consumption for the current month and the cumulative electricity consumption for special periods in the current month to obtain the net working day electricity consumption for the current month; and it calculates the difference between the total electricity consumption for the previous month and the cumulative electricity consumption for special periods in the previous month to obtain... The net working day electricity consumption of the previous month is calculated as follows: The net working day electricity consumption of the current month is calculated by dividing the net working day electricity consumption of the current month by the net working day electricity consumption of the current month by the net working day electricity consumption of the current month by the net working day electricity consumption of the previous ... current month by the net working day electricity consumption of the previous month by the net working day electricity consumption of the previous month by the net working day electricity consumption of the current month by the net working day electricity consumption of the previous month by the net working day electricity consumption of the previous month by the net working day electricity consumption of the current month by the net working day electricity consumption of the previous month by the net working day electricity consumption of the previous month by the net working day electricity consumption of the previous month.
[0107] The memory rearrangement and threshold generation module, when constructing an address mapping index table and performing physical rearrangement of the current multi-source power business data based on the address mapping index table to generate a continuously stored rearranged data structure, specifically performs the following: bit-concatenating the industry classification code and the transformer area code of the user to be detected to generate a user feature combination key; performing a sorting operation on the user feature combination key of the user to be detected to generate an address mapping index table pointing from the original logical index to the target physical index; allocating a continuous physical storage space in the host memory; traversing the address mapping index table and sequentially copying the discretely stored current multi-source power business data of the user to be detected to the continuous physical storage space to obtain a continuously stored rearranged data structure; wherein, in the rearranged data structure, data with the same user feature combination key are arranged continuously in physical space, forming multiple clustered data blocks.
[0108] The memory rearrangement and threshold generation module, when aligning the calculation order of the historical multi-source power business data based on the address mapping index table, calculating historical load volatility indicators in parallel, and generating a full adaptive threshold tensor mapped to the rearranged data structure, specifically performs the following: Based on the historical multi-source power business data, it calls host-side multi-threaded parallel instructions or vectorized instructions to batch calculate multiple historical load volatility indicators for each user to be detected in the rearranged data structure within a preset historical period; for each of the multiple clustered data blocks, it uses a statistical reduction algorithm to calculate the arithmetic mean and standard deviation of the multiple historical load volatility indicators of all users to be detected within the clustered data block; based on a preset sensitivity coefficient, it calculates the weighted sum of the products of the arithmetic mean and the standard deviation as the adaptive anomaly judgment threshold shared by the clustered data block; it uses a broadcast mechanism to assign the adaptive anomaly judgment threshold to each user to be detected within the corresponding clustered data block, and encapsulates it according to the physical order of the address mapping index table to generate the full adaptive threshold tensor.
[0109] When the sparse acceleration computation and comparison module generates a sparse computation index and performs a tensor aggregation operation on the tensor of the power feature to be detected based on the sparse computation index, it is specifically used to: sequentially perform a parallel prefix sum scan operation on the detection validity mask, calculate the cumulative count of valid identifier values in the detection validity mask up to the current position, and determine the cumulative count as the sparse computation index; based on the sparse computation index, extract data slices corresponding to the valid identifier values in the detection validity mask from the tensor of the power feature to be detected, and assemble the data slices into a dense computation queue with contiguous memory.
[0110] When the immune feedback and diagnostic output module filters the anomaly candidate list based on the immune weights in the global immune tensor to generate the final diagnostic list, it specifically performs the following steps: Based on the address mapping index table and the physical storage index value in the anomaly candidate list, it reverse-parses the corresponding user identity information; based on the user identity information, it reads the corresponding immune weights from the global immune tensor; wherein, the immune weights in the global immune tensor are dynamically updated according to a preset time period based on a time decay factor multiplication decay operation; if the immune weight is greater than a preset false alarm blocking threshold, the corresponding user is removed from the anomaly candidate list; if the immune weight is not greater than the preset false alarm blocking threshold, the corresponding user is retained to generate the final diagnostic list.
[0111] To verify the effectiveness of the method proposed in this invention, tensor calculation tests were conducted using a sample of over 100,000 residential users in a certain province, based on the aforementioned system. The performance of the tensor calculation scheme proposed in this invention was compared with that of traditional methods under the same hardware environment. Traditional methods are existing detection technologies based on the electricity marketing business system (relational database), which uses a single-threaded CPU to serially scan data from household to household and determines anomalies based on a preset fixed percentage threshold (e.g., volatility > 50%).
[0112] As shown in Table 1, the test results show that compared with the traditional method for detecting anomalies in readings, the tensor calculation efficiency is improved by about 44 times; CPU resources are saved by 58%; the accuracy of fluctuation anomaly detection is improved by 2.81 times; and the rule maintenance time is reduced by 62.5%.
[0113] Table 1. Performance Comparison of Traditional Methods and the Tensor Computation Scheme of the Present Invention
[0114] To more intuitively illustrate the calculation logic of the clean workday model and the adaptive threshold comparison, as shown in Table 2, the following uses 10 typical users within the same cluster as examples to demonstrate intermediate feature data and final judgment results. Among them, user U3's calculated load volatility index exceeded the adaptive threshold of 1.40 calculated based on the group's historical behavior, and was therefore judged as abnormal by the tensor calculation engine. The system will automatically generate an abnormal triplet and send it back to the host. Although user U1's power consumption also fluctuated, it remained within the normal threshold range for the group, and was therefore judged as normal, effectively avoiding false alarms.
[0115] Table 2. Tensor Calculation Process Data for 10 Typical Users in a Certain Substation Area
[0116] Example 3: A terminal, comprising a processor and a storage medium; The storage medium is used to store instructions; The processor is configured to operate according to the instructions to execute the steps of the method.
[0117] Example 4: A computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the steps of the method.
[0118] This disclosure can be a system, method, and / or computer program product. A computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of this disclosure.
[0119] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example—but not limited to—electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination of the foregoing. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.
[0120] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.
[0121] Computer program instructions used to perform the operations of this disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing the status information of the computer-readable program instructions to implement various aspects of this disclosure.
[0122] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the protection scope of the claims of the present invention.
Claims
1. A method for detecting abnormal meter readings, characterized in that, include: Collect current multi-source power business data of the users to be tested; Preprocessing is performed on the current multi-source power business data to extract electricity consumption characteristic parameters for calculating load volatility index, and a detection validity mask is generated to mark the effective calculation status of the electricity consumption characteristic parameters. Construct an address mapping index table, and perform physical rearrangement on the current multi-source power business data based on the address mapping index table to generate a rearranged data structure that is stored continuously. Read the historical multi-source power business data of the user to be detected, align the calculation order of the historical multi-source power business data based on the address mapping index table, calculate the historical load volatility index in parallel, and generate a full adaptive threshold tensor that maps to the rearranged data structure. Based on the rearranged data structure and the detection validity mask, a power feature tensor to be detected is constructed. Read the detection validity mask from the tensor of the power feature to be detected, and generate a sparse computation index; Based on the sparse computation index, a tensor aggregation operation is performed on the tensor of the power feature to be detected. The load volatility index is calculated using the aggregated data. The load volatility index is compared element by element with the full adaptive threshold tensor. Abnormal data is identified based on the comparison results. An abnormal candidate list is generated based on the abnormal data. Obtain a preset global immune tensor, filter the abnormal candidate list based on the immune weights in the global immune tensor, and generate a final diagnosis list.
2. The method for detecting abnormal meter readings according to claim 1, characterized in that, The current multi-source power business data includes: daily granular electricity consumption data, multi-dimensional business attribute parameters, full-volume business expansion change status data, and calendar data for special periods; among which... Daily granular electricity consumption data includes active power meter readings with timestamps; Multidimensional business attribute parameters include industry classification codes and station area codes; The full range of business expansion change status data includes new installations, capacity increases, capacity reductions, capacity reduction recovery, suspension, and suspension recovery; Special period calendar data includes labels for statutory holidays and labels for non-working days reported by users.
3. The method for detecting abnormal meter readings according to claim 2, characterized in that, The calculation of the load volatility index specifically includes: Based on the daily granular electricity consumption data in the current multi-source power business data and the calendar data of the special period, the total electricity consumption of the current month, the total electricity consumption of the previous month, the number of natural days in the current month and the number of natural days in the previous month, as well as the cumulative electricity consumption of the special period in the current month, the cumulative electricity consumption of the special period in the previous month, the number of days in the special period in the current month and the number of days in the special period in the previous month are extracted respectively. Calculate the difference between the total electricity consumption in the current month and the cumulative electricity consumption during special periods in the current month to obtain the clean working day electricity consumption for the current month; and calculate the difference between the total electricity consumption in the previous month and the cumulative electricity consumption during special periods in the previous month to obtain the clean working day electricity consumption for the previous month. Calculate the difference between the number of natural days in the current month and the number of days in the special period of the current month to obtain the number of clean working days in the current month; and calculate the difference between the number of natural days in the previous month and the number of days in the special period of the previous month to obtain the number of clean working days in the previous month. Divide the net working day electricity consumption of the current month by the number of net working days in the current month to obtain the net load intensity of the current month; Divide the net working day electricity consumption of the previous month by the number of net working days of the previous month to obtain the net load intensity of the previous month; The ratio of the current month's net load intensity to the previous month's net load intensity is calculated and used as the load volatility index.
4. The method for detecting abnormal meter readings according to claim 2, characterized in that, Construct an address mapping index table, and perform physical rearrangement of the current multi-source power business data based on the address mapping index table to generate a continuously stored rearranged data structure, specifically including: The industry classification code and the station area code of the user to be detected are bit-concatenated to generate a user feature combination key; Perform a sorting operation on the user feature combination key of the user to be detected to generate an address mapping index table pointing from the original logical index to the target physical index; Allocate contiguous physical storage space in the host's memory; Traverse the address mapping index table and copy the current multi-source power business data of the user to be detected from discrete storage to the continuous physical storage space in sequence to obtain the rearranged data structure of continuous storage; In the rearranged data structure, data with the same user characteristic combination key are arranged continuously in physical space, forming multiple clustered data blocks.
5. The method for detecting abnormal meter readings according to claim 4, characterized in that, Based on the address mapping index table, the calculation order of the historical multi-source power business data is aligned, and the historical load volatility index is calculated in parallel to generate a full adaptive threshold tensor, specifically including: Based on the historical multi-source power business data, the host-side multi-threaded parallel instructions or vectorized instructions are invoked to calculate multiple historical load volatility indicators for each user to be detected in the rearranged data structure within a preset historical period. For each of the multiple clustered data blocks, a statistical reduction algorithm is used to calculate the arithmetic mean and standard deviation of the multiple historical load volatility indicators of all users to be detected in the clustered data block. Based on a preset sensitivity coefficient, a weighted sum of the products of the arithmetic mean and the standard deviation is calculated as an adaptive anomaly judgment threshold shared by the clustered data blocks. The adaptive anomaly detection threshold is assigned to each user to be detected within the corresponding clustered data block using a broadcast mechanism, and then encapsulated according to the physical order of the address mapping index table to generate the full adaptive threshold tensor.
6. The method for detecting abnormal meter readings according to claim 1, characterized in that, Generating a sparse computation index and performing tensor aggregation operations based on the sparse computation index specifically includes: Perform a parallel prefix sum scan operation on the detection validity mask, calculate the cumulative count of valid identifier values in the detection validity mask up to the current position, and determine the cumulative count as the sparse computation index; Based on the sparse computation index, data slices corresponding to the valid identifier values in the detection validity mask are extracted from the tensor of the power feature to be detected, and the data slices are assembled into a dense computation queue with contiguous memory.
7. The method for detecting abnormal meter readings according to claim 1, characterized in that, Filtering and updating are performed based on the global immune tensor, specifically including: Based on the address mapping index table, and according to the physical storage index value in the anomaly candidate list, the corresponding user identity information is reverse-parsed. Based on the user identity information, the corresponding immune weights are read from the global immune tensor; wherein, the immune weights in the global immune tensor are dynamically updated by performing a multiplicative decay operation based on a time decay factor according to a preset time period. If the immune weight is greater than the preset false alarm blocking threshold, the corresponding user is removed from the abnormal candidate list; if the immune weight is not greater than the preset false alarm blocking threshold, the corresponding user is retained to generate the final diagnosis list.
8. An abnormal meter reading detection system, characterized in that, include: The data acquisition and feature preprocessing module is used to collect current multi-source power business data of the user to be tested. Preprocessing is performed on the current multi-source power business data to extract electricity consumption characteristic parameters for calculating load volatility index, and a detection validity mask is generated to mark the effective calculation status of the electricity consumption characteristic parameters. The memory rearrangement and threshold generation module is used to construct an address mapping index table, and perform physical rearrangement on the current multi-source power business data based on the address mapping index table to generate a rearranged data structure that is stored continuously. Read the historical multi-source power business data of the user to be detected, align the calculation order of the historical multi-source power business data based on the address mapping index table, calculate the historical load volatility index in parallel, and generate a full adaptive threshold tensor that maps to the rearranged data structure. The heterogeneous data transmission and tensor construction module is used to construct the power feature tensor to be detected based on the rearranged data structure and the detection validity mask. The sparse accelerated computation and comparison module is used to read the detection validity mask in the tensor of the power feature to be detected and generate a sparse computation index. Based on the sparse computation index, a tensor aggregation operation is performed on the tensor of the power feature to be detected. The load volatility index is calculated using the aggregated data. The load volatility index is compared element by element with the full adaptive threshold tensor. Abnormal data is identified based on the comparison results. An abnormal candidate list is generated based on the abnormal data. The immune feedback and diagnostic output module is used to obtain a preset global immune tensor, filter the abnormal candidate list based on the immune weights in the global immune tensor, and generate a final diagnostic list.
9. A terminal, comprising a processor and a storage medium; characterized in that: The storage medium is used to store instructions; The processor is configured to operate according to the instructions to perform the steps of the method as described in any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps of the method as described in any one of claims 1-7.