Time series-based power marketing inspection scene anomaly detection method and system
By using a time-series-based anomaly detection method for electricity marketing audit scenarios and leveraging unsupervised learning and deep learning techniques, a model for investigating incorrect or missed charges is established. This solves the problems of low efficiency and low accuracy in complex audit scenarios, achieving automated, rapid electricity marketing audits and highly reliable investigation of incorrect or missed charges.
Patent Information
- Application Number
- CN202310510955.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-08
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2043-05-08
AI Technical Summary
Existing electricity marketing audit systems are inefficient and inaccurate in complex audit scenarios. Manual analysis consumes a lot of resources and is prone to favoritism and fraud. Traditional methods cannot update electricity marketing data in a timely manner and report anomalies.
An anomaly detection method based on time series in the electricity marketing audit scenario is adopted. An audit model for incorrect or missed charges is established through unsupervised learning. Anomaly detection is performed using a transformer encoder and machine learning decision tree. Combined with cross-entropy function and data optimization sub-model, anomalies in electricity data are automatically updated and fed back.
It enables automated and rapid electricity marketing audits, reduces the impact of human factors, improves audit efficiency and accuracy, reduces labor costs, prevents false alarms, and supports highly reliable audits of incorrect or missed charges.
Smart Images

Figure CN116702071B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of power marketing, and particularly relates to a power marketing inspection scene anomaly detection method and system based on time series. BACKGROUND
[0002] Electricity is an important indicator of company profit, and the development of electricity anomaly inspection bears the important responsibility of preventing enterprise operation risk, maintaining the fundamental interests of the company, and improving the lean management level of the enterprise. The judgment of complex inspection scene has always been a pain point for company business personnel. The development of digital inspection "new infrastructure" based on model construction bears the important responsibility of promoting the normalization, standardization and long-term of marketing inspection work at all levels of the company, completing the annual inspection and anti-stealing work with high quality, and realizing the important responsibility of tapping potential, increasing efficiency, reducing cost and increasing efficiency.
[0003] In the prior art, the power marketing system inspection application is based on SQL rule construction marketing business inspection theme analysis and query, which cannot support complex marketing business inspection scene, consumes a large amount of data calculation resources and query waiting time, and the accuracy of inspection data analysis is low, which greatly increases the workload of on-site checking of business personnel. Some technical improvements have been made for the judgment and analysis of complex inspection scene, but still face the following problems: manual analysis of massive data leads to low efficiency; and when facing massive power data, only manual extraction of abnormal features and clue mining is time-consuming and laborious, and the accuracy is low; at the same time, the manual judgment method greatly increases the labor cost of power supply area unit, and also causes the phenomenon of inspection personnel malpractice. The power marketing business inspection method based on deep learning is proposed, which can reduce the work burden of power inspection personnel and assist in determining appropriate power marketing business inspection countermeasures. However, the traditional power marketing business inspection technology has the problems of weak pertinence and slow feedback response of power marketing business inspection scene, cannot update the power marketing data in time, and cannot feedback the power data anomaly in time. SUMMARY
[0004] To solve the problems in the prior art, the present application provides a power marketing inspection scene anomaly detection method and system based on time series, which solves the verification problem of different power marketing inspection scenes, and automatically updates and predicts power marketing data and feedbacks power data anomaly.
[0005] The present application adopts the following technical solutions.
[0006] The present application provides a power marketing inspection scene anomaly detection method based on time series, which comprises:
[0007] Step 1, collecting multi-user power consumption data and power consumption file data under the power marketing inspection scene;
[0008] Step 2, based on an unsupervised learning method, establish a fee missing collection inspection model;
[0009] Step 3, input the multi-user electricity consumption data and electricity profile data into the fee missing collection inspection model, obtain multi-user electricity consumption prediction data based on time series, and perform anomaly detection on the multi-user electricity consumption prediction data based on a machine learning decision tree to generate an anomaly score;
[0010] Step 4, when the anomaly score is greater than the anomaly threshold, use the cross-entropy function to calculate the difference between the multi-user electricity consumption prediction data and the electricity profile data;
[0011] Step 5, compare the weighted sum of the difference and the anomaly score with the anomaly threshold, if the weighted sum is less than the anomaly threshold, determine that there is no anomaly in the power marketing inspection scenario; otherwise, go to step 6;
[0012] Step 6, extract single-user electricity consumption prediction data from the multi-user electricity consumption prediction data and input it into the fee missing collection inspection model, perform anomaly detection on the single-user electricity consumption prediction data based on a machine learning decision tree, and output the power marketing inspection scenario corresponding to the abnormal user when an anomaly is detected.
[0013] The fee missing collection inspection model comprises an anomaly detection sub-model and a data optimization sub-model.
[0014] The anomaly detection sub-model comprises a transformer encoder and an anomaly detection encoder, and the data optimization sub-model comprises a data optimization encoder.
[0015] Step 3 comprises:
[0016] Step 3.1, input the multi-user electricity consumption data and electricity profile data into the transformer encoder to generate multi-user electricity consumption prediction data based on time series.
[0017] Step 3.2, input the multi-user electricity consumption prediction data based on time series into the anomaly detection encoder, and perform anomaly detection on the multi-user electricity consumption prediction data based on time series based on a machine learning decision tree to generate an anomaly score.
[0018] The transformer encoder establishes a long-short term time series dependency model through a seasonal trend analysis method, the long-short term time series dependency model compares the multi-user electricity consumption data and the electricity profile data, takes the time in the electricity profile data as a time stamp, and extracts the multi-user electricity consumption data that is complete and truly exists at different time stamps as multi-user electricity consumption prediction data based on time series.
[0019] Based on a sliding window, the multi-user electricity consumption data that is complete and truly exists at different time stamps is extracted.
[0020] The machine learning decision tree is used to calculate the anomaly probability of the multi-user power consumption history anomaly data at each timestamp, and the detection encoder is iteratively trained based on the multi-user power consumption history anomaly data and the anomaly probability.
[0021] When the detection encoder is iteratively trained, a balance factor is introduced to the anomaly score, and the value range of the balance factor is 0 to 1.
[0022] In step 4, when the anomaly score is greater than the anomaly threshold, the value of the anomaly threshold is 0.5, and the difference between the multi-user power consumption prediction data and the power consumption profile data within 24 hours is calculated using the cross-entropy function.
[0023] The data optimization encoder is used to structure the single-user power consumption prediction data based on a sliding window.
[0024] The machine learning decision tree is used to calculate the anomaly probability of the single-user power consumption history anomaly data at each timestamp, and the data optimization encoder is iteratively trained based on the single-user power consumption history anomaly data and the anomaly probability; and the trained data optimization encoder is used for anomaly detection of single users.
[0025] The application also provides a time series-based power marketing inspection scene anomaly detection system, which comprises a collection module, a fee error and omission inspection model module, a multi-user anomaly detection module, and a single-user anomaly detection module.
[0026] The collection module is used to collect multi-user power consumption data and power consumption profile data in a power marketing inspection scene.
[0027] The fee error and omission inspection model module is used to establish a fee error and omission inspection model based on an unsupervised learning method; the multi-user power consumption data and the power consumption profile data are input into the fee error and omission inspection model to obtain time series-based multi-user power consumption prediction data.
[0028] The multi-user anomaly detection module is used to perform anomaly detection on the multi-user power consumption prediction data based on a machine learning decision tree to generate an anomaly score; when the anomaly score is greater than an anomaly threshold, the difference between the multi-user power consumption prediction data and the power consumption profile data is calculated using a cross-entropy function; the weighted sum of the difference and the anomaly score is compared with the anomaly threshold again, and if the weighted sum is less than the anomaly threshold, it is determined that there is no anomaly in the power marketing inspection scene; otherwise, the single-user anomaly detection module is called for anomaly detection.
[0029] The single-user anomaly detection module is used for extracting single-user power consumption prediction data from the multi-user power consumption prediction data, inputting the fee missing collection inspection model, performing anomaly detection on the single-user power consumption prediction data by taking the machine learning decision tree as a criterion, and outputting the power marketing inspection scene corresponding to the abnormal user by the fee missing collection inspection model when the anomaly is detected.
[0030] The method has the advantages that, compared with the prior art, the method collects power data and user power consumption archives in different scenarios to help power marketing enterprises and power safety analysts determine and classify potential power inspection scenes of fee missing collection, thereby automatically calling a deep learning-based power marketing inspection model and rapidly warning and feeding back user information of the power inspection scene.
[0031] The deep learning-based power marketing inspection model simultaneously considers specific power consumption information and power consumption scenarios of the current user, has the functions of automatic judgment and automatic alarm, thereby eliminating the errors caused by human factors and improving the efficiency of power marketing business inspection without personnel intervention.
[0032] The power marketing inspection model is based on a time series-based power marketing inspection scene anomaly detection method, and a long-short-term time series dependency model is established based on the method. The anomaly detection sub-model and the data optimization sub-model are added to the traditional time series prediction model in a cooperative manner to analyze, predict and feed back the data of different inspection scenes. In different power marketing inspection scenes, the anomaly detection sub-model is used to quickly infer the multi-user power consumption anomaly in a certain time period and specifically judge the abnormal condition of the user to prevent false positives. The data optimization sub-model is used to record the abnormal condition of the user and expand the data into a heuristic DT strategy, and the structured user abnormal misjudgment data is added to the existing data non-anomaly event set. Meanwhile, the anomaly detection sub-model is used to constrain the abnormal user data and the influence of the non-anomaly event set on the model, and finally, the high-reliability fee missing collection inspection model is optimized in this way to output the prediction and feedback of the specific inspection scene. BRIEF DESCRIPTION OF DRAWINGS
[0033] Figure 1 A flowchart of the time series-based power marketing inspection scene anomaly detection method according to the present application is shown in the figure.
[0034] Figure 2 A schematic diagram of the training process of the fee missing collection inspection model in the embodiment of the present application is shown in the figure. DETAILED DESCRIPTION
[0035] In order to make the objects, technical solutions and advantages of the present application clearer, the technical solutions of the present application will be described clearly and completely below in combination with the drawings in the embodiments of the present application. The embodiments described in the present application are only a part of the embodiments of the present application, but not all the embodiments. Based on the spirit of the present application, all other embodiments obtained by those skilled in the art without creative labor are within the protection scope of the present application.
[0036] For multiple power marketing high-reliability power inspection scenarios, the present application proposes a time series-based power marketing inspection scenario anomaly detection method, as shown in Figure 1 , which includes:
[0037] Step 1, collect the power consumption data and power consumption profile data of multiple users in the power marketing inspection scenario.
[0038] The multi-user power consumption data includes but is not limited to power load characteristic data, and the power load characteristic data includes but is not limited to: maximum power supply capacity, voltage level, whether the line mode is in the system profile, property boundary point, etc.
[0039] Step 2, based on an unsupervised learning method, a fee error and omission inspection model is established, as shown in Figure 2 , which includes an anomaly detection sub-model and a data optimization sub-model.
[0040] A high-reliability fee error and omission inspection model (Time series power checking model, hereinafter referred to as TSPM) is constructed based on deep learning technology. The TSPM model is designed based on existing unsupervised anomaly detection methods. The anomaly detection sub-model and the data optimization sub-model are constructed by the TSPM model. The TSPM model cooperates with the two modules to clean, store and process data, and finally outputs the inspection scenario of a single abnormal user in the multi-user power marketing inspection scenario.
[0041] The anomaly detection sub-model is used to process the power load characteristic data, which includes: maximum power supply capacity, voltage level, whether the line mode is in the system profile, property boundary point, etc. According to the power supply scheme and the power supply contract, the anomaly detection sub-model obtains the differences of user power information, the differences of high-reliability fee collection rules, and the differences of operation information and profile information, and outputs user power anomaly data and a suspected list of possible error and omission collection. The data optimization sub-model provides single user anomaly information to the anomaly detection sub-model, and updates the learning parameters of the anomaly detection encoder and the data optimization encoder according to the anomaly score received by the anomaly detection sub-model.
[0042] According to the time sequence, the actual power consumption data of the user is analyzed one by one, including first identifying the abnormal time from the actual power consumption data of multiple users, and then identifying single abnormal user (arrears inspection) at the abnormal time. When identifying the abnormal time, the accuracy of power inspection is affected by the abnormal power consumption data at special time such as power failure, therefore, not only the difference between the actual power consumption data and the archive power consumption data is used for comparison, but also the probability of abnormality in the archive power consumption data (i.e. abnormal score) is used to identify the abnormal time. The problem of checking different power marketing inspection scenes is solved, and the problems of automatically updating and predicting power marketing data and feeding back power data anomalies are solved.
[0043] The present application solves the problem of checking different power marketing inspection scenes, and automatically updates and predicts power marketing data and feeds back power data anomalies, realizes the identification and judgment of high-reliability fee error and missing collection user power inspection scene. The model is based on the time series analysis method of abnormal detection in deep learning, and a long-short term time series dependent model is established based on the time series prediction model. The abnormal detection module and the data optimization module are added to the traditional time series prediction model, and the two modules analyze, predict and feedback the data of different inspection scenes in a collaborative way. In different power marketing inspection scenes, the abnormal detection module is used to analyze and quickly infer the abnormal power consumption of multiple users in a certain time period, and the abnormal situation of the extracted user is judged in detail to prevent abnormal false alarm; the data optimization module records the abnormal situation of the user and expands the data into heuristic DT strategy, and adds the structured user abnormal misjudgment data to the existing data non-abnormal event set, and cooperates with the abnormal detection module to constrain the influence of abnormal user data and non-abnormal event set on the model, and finally optimizes the high-reliability fee error and missing collection inspection model to output the prediction and feedback of the specific inspection scene.
[0044] Step 3, the multi-user power consumption data and the power consumption archive data are input into the abnormal detection sub-model, the abnormal detection sub-model outputs the multi-user power consumption prediction data based on the time sequence, and the machine learning decision tree is used as the criterion to detect the abnormality of the multi-user power consumption prediction data to generate the abnormal score.
[0045] Step 3 includes:
[0046] Step 3.1, the multi-user power consumption data and the power consumption archive data are input into the transformer encoder to generate the multi-user power consumption prediction data based on the time sequence.
[0047] Specifically, the transformer encoder establishes a long-short term time series dependency model through a seasonal trend analysis method. The long-short term time series dependency model compares multi-user power consumption data and power consumption profile data, uses time in the power consumption profile data as a time stamp, and extracts multi-user power consumption data that is complete and truly exists under different time stamps as multi-user power consumption prediction data based on time series.
[0048] Specifically, when the long-short term time series dependency model is iteratively trained, the power supply network node with the largest amount of power consumption data is selected as the research object, and power consumption prediction data of multiple users under different time slices of the node is obtained.
[0049] Since the multi-user power consumption data and the power consumption profile data are used to predict the power consumption data of a single user, the multi-user power consumption data is required to be complete and the power consumption data of the current time slice and the past time slice is required to be truly existent. In a non-limiting preferred embodiment, in a high-reliability fee collection and leakage inspection scenario, the data of multiple meters in an industrial park is checked to exclude the case of fee leakage collection. The multi-user power consumption data in the fee collection and leakage inspection scenario of the industrial park is a special abnormal situation, and the multi-user power consumption data in other fee collection and leakage inspection scenarios will be input into the long-short term time series dependency model together with the power consumption profile data as training data to generate power consumption prediction data of different time slices.
[0050] Specifically, based on a sliding window, multi-user power consumption data that is complete and truly exists under different time stamps is extracted as follows:
[0051]
[0052] w={t i ,t i+1 ,…,t i+k-1}
[0053] In the formula,
[0054] W is a set of multi-user power consumption data,
[0055] and are power consumption data in the sliding window of the first user, the second user,..., and the n-th user, respectively, where n represents the number of users for power marketing inspection, and s is the size of the sliding window,
[0056] w is a set of multi-user power consumption data for 24 hours a day,
[0057] t i ,t i+1 ,...,t i+k-1The power consumption data of the multiple users at the i-th moment, the i+1-th moment and the i+k-1-th moment respectively, wherein k represents a sampling constant and is set to 100.
[0058] In the embodiment of the application, the power consumption data is encoded in a sliding window manner, and in this way, the model is allowed to receive a part of data (the model cannot accept all data for learning) to learn first. This way can convert unstructured data into structured data and plays a role of data cleaning.
[0059] In step 3.2, the time series-based multiple user power consumption prediction data is input into an anomaly detection encoder, and a machine learning decision tree (DT) is used as a criterion. The DT strategy is a machine learning algorithm that aggregates the votes of multiple decision trees to obtain the output label at the end of training. The time series-based multiple user power consumption prediction data is subjected to anomaly detection to generate an anomaly score.
[0060] Specifically, the machine learning decision tree is used to calculate the anomaly probability of the multiple user power consumption historical anomaly data at each timestamp, and the multiple user power consumption historical anomaly data and the anomaly probability are used to iteratively train the detection encoder; and the trained detection encoder generates an anomaly score.
[0061] Specifically, the multiple user power consumption data t i obtained in the sliding window manner is used as input data of the detection encoder. i The power consumption data of any user at a certain timestamp is extracted from t and the DT strategy is used to calculate the anomaly probability as follows:
[0062]
[0063] In the formula,
[0064] is the power consumption data of any user at a certain timestamp,
[0065] n is the number of users in the power marketing inspection scenario, j = 1, 2, …, n,
[0066] is the probability of occurrence of an anomaly in the current high-reliability cost error and omission inspection scenario,
[0067] x i,t is the set of power consumption data t i of the multiple users at the i-th moment in the current power marketing inspection scenario.
[0068] The power consumption data difference alone cannot directly determine the user power consumption scenario anomaly, and the anomaly score e s of the power consumption is used to supplement the power consumption data difference, and the anomaly score e sAs follows:
[0069] e s (Q,θ c )=E ch (Q,θ c )
[0070] In the formula,
[0071] θ c is an anomaly detection encoder E ch The parameters to be optimized,
[0072] Q is a multi-user electricity history anomaly data,
[0073] E ch (·) is the input of the anomaly detection encoder.
[0074] The time series-based multi-user electricity prediction data is input into the trained anomaly detection encoder E ch to obtain the anomaly score E s .
[0075] Step 4, when the anomaly score is greater than the anomaly threshold, the difference between the multi-user electricity prediction data and the electricity profile data is calculated using the cross-entropy function.
[0076] Wherein, the anomaly threshold value is 0.5.
[0077] The cross-entropy function A(x i,t ) is used to measure the difference between the multi-user electricity data and the electricity profile data in the electricity marketing inspection scenario within 24 hours of a day, as follows:
[0078]
[0079] In the formula,
[0080] is the cross-entropy function,
[0081] is the corresponding electricity profile data of the sample x i,t ;
[0082] Under the set timestamp, there is a gap between the actual electricity cost and the expected electricity cost of a certain user, which indicates that the consistency between the set x i of the multi-user electricity data t i,t at the i-th moment in the current electricity inspection scenario and the actual user electricity data in the profile is small, the cross-entropy function value is large, indicating that multiple multi-user electricity data sets x i,t are needed to sample the user's electricity data.
[0083] According to the power consumption file data of the incoming line mode, property boundary point, etc. The difference e between the predicted power consumption data and the real power consumption data is obtained in the following relationship r :
[0084]
[0085] In the formula,
[0086] θ r is an optimized parameter of the TSPM model established based on the time series analysis method of the power marketing inspection scene,
[0087] Q r is the multi-user power consumption prediction data,
[0088] is the power consumption data in the sliding window of the user j, wherein j = 1, 2, …, n,
[0089] L M (·) is a mean square error function.
[0090] The user power consumption data is input into the anomaly detection encoder E ch to obtain the power consumption anomaly prediction score e s . In order to avoid the influence of the imbalance of the multi-class information of the user on the training of the TSPM model, a balance factor μ is used to avoid the collapse of the TSPM model, and the overall optimization objective is as follows:
[0091]
[0092] In the formula,
[0093] is the optimized value of the anomaly detection encoder E ch parameter θ,
[0094] L c is a cross-entropy function,
[0095] softmax is a normalization function, e r and e s respectively represent the real power consumption data difference and the power consumption anomaly score.
[0096] Step 5, the weighted sum value of the difference and the anomaly score is compared with the anomaly threshold value again, if the weighted sum value is less than the anomaly threshold value, it is determined that there is no anomaly in the power marketing inspection scene; otherwise, the specific information of the current contract and the process information difference is output and the source of the anomaly value is output, and step 6 is entered.
[0097] The anomaly detection encoder E check parameter in the anomaly detection sub-model D ch is optimized can quickly respond and process user data, and finally the anomaly detection sub-model D check by weighting e r and e s to determine whether the user scenario is abnormal, the whole process can be represented as:
[0098]
[0099] wherein,
[0100] α1 and α2 are the first weighting factor and the second weighting factor, respectively,
[0101] Q i is different user time slice data,
[0102] τ is an anomaly threshold.
[0103] The anomaly determination logic of the optimized anomaly detection sub-model is as follows: when the weighted anomaly score does not exceed the threshold τ, the alarm value of the anomaly detection sub-model is set to 0; when the weighted anomaly score exceeds the threshold τ, the alarm value of the anomaly detection sub-model is set to 1 and the specific information of the current contract and process information difference and the source of the abnormal value are output.
[0104] Step 6: Extract single user electricity prediction data from multi-user electricity prediction data and input the data into the data optimization sub-model. The data optimization sub-model uses a machine learning decision tree as a criterion to perform anomaly detection on single user electricity prediction data, and performs anomaly detection on single users. When an anomaly is detected, the fee error and omission inspection model outputs the corresponding power marketing inspection scenario.
[0105] The data optimization sub-model includes a data optimization encoder, which performs structured processing on single user electricity prediction data based on a sliding window.
[0106] The machine learning decision tree is used to calculate the anomaly probability of single user electricity historical anomaly data at each timestamp. The single user electricity historical anomaly data and the anomaly probability are used to iteratively train the data optimization encoder. The trained data optimization encoder performs anomaly detection on single users.
[0107] While the TSPM model trains the anomaly detection sub-model, the data optimization sub-model D data uses a similar strategy to generate user data expansion for the heuristic DT strategy during the training process of the data optimization sub-model D data , which is added to the existing data anomaly-free event set S event Before starting optimization, the data optimization encoder E data of the data optimization sub-model D daInitialize the encoder parameters according to the given power marketing scenario user data, and constrain the abnormal user data and the data no abnormal event set S event The impact on the model, and finally continuously training and optimizing the TSPM model in this way.
[0108] When the cross entropy function value is large, it is necessary to use a larger timestamp to sample the user's electricity consumption data. For abnormal electricity consumption of the user, the TSPM model calls the user's electricity consumption information file and verifies its recent electricity consumption data. It uses the long-term and short-term time series dependency model to extract the user's recent electricity consumption information and evaluate the rationality of the user's electricity consumption in a certain time period. For the entire user's electricity consumption status, we divide the user's electricity consumption data in different time periods into time slices, which can be expressed as Q i ={q1, q2, ..., q i}, i = 1, ..., 24, the user's electricity consumption data is input into the transformer encoder E in the form of time slices tr The whole process is expressed as:
[0109] P action =E tr (q1, q2, ..., q i )
[0110] Where,
[0111] q i Slice the time information of different electricity users.
[0112] P action The actual electricity consumption data of users.
[0113] Abnormal user data in special power usage scenarios will generate model false alarm warnings. These special scenarios include power outages and fault maintenance, etc. The data optimization sub-model D data The encoder E will be optimized by data da For the anomaly detection sub-model D check The data is processed again using the DT strategy, and the process can be expressed as:
[0114] A d =E da (Q r (Q i ,θ d ), P action )
[0115] Where,
[0116] Q i The user electricity consumption data for different time slices,
[0117] θ dThe data optimization encoder E da Parameters that need to be optimized,
[0118] P action Predict the power consumption data of the scene where the current user is located,
[0119] A d Generate an abnormal event using the DT strategy, which includes the specific information of the user and the reason for the false alarm.
[0120] In addition, in order to reduce the influence of data outliers on the data optimization process, the data optimization sub-model D data An abnormal detection sub-model score is adopted to exclude the top 10% values, which aims to reduce the influence of discrete values on the TSPM model loss calculation, and guide the training of the data optimization sub-model D data The objective function of the data optimization sub-model D data The objective function of the data optimization sub-model D Is expressed as follows:
[0121]
[0122] In the formula,
[0123] W s and W rs are the true power consumption scene information and the predicted power consumption scene information of the user selected from the abnormal detection sub-model.
[0124] The objective function optimizes the TSPM model by minimizing the input and data optimization. The final TSPM model will output the predicted inspection scene.
[0125] The application also provides a time series-based power marketing inspection scene anomaly detection system, comprising: a collection module, a fee error and omission inspection model module, a multi-user anomaly detection module, and a single-user anomaly detection module.
[0126] The collection module is used to collect multi-user power consumption data and power consumption profile data under the power marketing inspection scene.
[0127] The fee error and omission inspection model module is used to establish a fee error and omission inspection model based on an unsupervised learning method. The multi-user power consumption data and power consumption profile data are input into the fee error and omission inspection model to obtain time series-based multi-user power consumption prediction data.
[0128] The multi-user anomaly detection module is configured to perform anomaly detection on the multi-user electricity consumption prediction data based on a machine learning decision tree to generate an anomaly score; when the anomaly score is greater than an anomaly threshold, a cross-entropy function is used to calculate the difference between the multi-user electricity consumption prediction data and the electricity consumption profile data; the weighted sum of the difference and the anomaly score is compared with the anomaly threshold again, if the weighted sum is less than the anomaly threshold, it is determined that there is no anomaly in the power marketing inspection scene; otherwise, the single-user anomaly detection module is called to perform anomaly detection;
[0129] The single-user anomaly detection module is configured to extract single-user electricity consumption prediction data from the multi-user electricity consumption prediction data, input a fee omission inspection model, perform anomaly detection on the single-user electricity consumption prediction data based on a machine learning decision tree, and output an abnormal user corresponding to the power marketing inspection scene when an anomaly is detected.
[0130] The present disclosure can be a system, a method, and / or a computer program product. The computer program product can include a computer readable storage medium (or media) having computer readable program instructions thereon for causing a processor to carry out aspects of the present disclosure.
[0131] The computer readable storage medium can be a tangible device that can retain and store instructions for use by an instruction execution device. The computer readable storage medium can be, for example, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium include the following: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanically encoded device such as punch-cards or punched tape, a magneto-optical storage device, a ROM, a memory, a cache, a cache core, or any suitable combination of the foregoing. A computer readable storage medium, as used herein, is not to be construed as being transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission media (e.g., light pulses passing through a fiber-optic cable), or electrical signals transmitted through a wire.
[0132] Computer readable program instructions described herein can be downloaded to respective computing / processing devices from a computer readable storage medium or to an external computer or external storage device via a network, for example, the Internet, a local area network, a wide area network and / or a wireless network. The network can comprise copper transmission cables, optical transmission fibers, wireless transmission, routers, firewalls, switches, gateway computers and / or edge servers. A network adapter card or network interface in each computing / processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium within the respective computing / processing device.
[0133] Computer readable program instructions for carrying out operations of the present disclosure can be assembly instructions, instruction-set-architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state-setting data, or either source code or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C++ or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer readable program instructions can execute entirely on the user's computing device, partly on the user's computing device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device or entirely on the remote computing device or server. In the latter scenario, the remote computing device can be connected to the user's computing device through any kind of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computing device, for example, through the Internet using an Internet Service Provider. In some embodiments, electronic circuitry including, for example, programmable logic circuitry, field-programmable gate arrays (FPGA), or programmable logic arrays (PLA) can execute the computer readable program instructions by utilizing state information of the computer readable program instructions to personalize the electronic circuitry, in order to perform aspects of the present disclosure.
[0134] Finally, it should be noted that the above-mentioned embodiments are merely intended for describing and illustrating, but not limiting the technical solutions of the present application. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that the specific embodiments of the present application can be modified or replaced by equivalents without departing from the spirit and scope of the present application, and any modification or equivalent replacement without departing from the spirit and scope of the present application should be covered within the protection scope of the claims of the present application.
Claims
1. A time series-based anomaly detection method for power marketing audit scenarios, characterized by: include: Step 1: Collect multi-user electricity consumption data and electricity consumption archive data in the power marketing audit scenario; Step 2: Based on unsupervised learning methods, establish a fee collection error and omission audit model; Step 3: Multi-user electricity consumption data and electricity consumption archive data are input into the fee error and omission audit model to obtain multi-user electricity consumption forecast data based on time series. The multi-user electricity consumption forecast data is then subjected to anomaly detection using a machine learning decision tree as a criterion to generate anomaly scores. Step 3 includes: In step 3.1, the multi-user electricity consumption data and electricity consumption archive data are input into the Transformer encoder. The Transformer encoder uses seasonal trend analysis to establish a long-term and short-term time series dependency model. The long-term and short-term time series dependency model compares the multi-user electricity consumption data with the electricity consumption archive data, uses the time in the electricity consumption archive data as the timestamp, and extracts the multi-user electricity consumption data with complete and real data at different timestamps as the time series-based multi-user electricity consumption forecast data. In step 3.2, the time series-based multi-user electricity consumption forecast data is input into an anomaly detection encoder. The anomaly probability of the multi-user electricity consumption history anomaly data at each time stamp is calculated using a machine learning decision tree. The detection encoder is iteratively trained using the multi-user electricity consumption history anomaly data and anomaly probabilities. The trained detection encoder generates an anomaly score. Step 4: When the anomaly score is greater than the anomaly threshold, the cross entropy function is used to calculate the difference between the multi-user electricity consumption forecast data and the electricity consumption archive data; Step 5: Compare the weighted sum of the difference and the anomaly score with the anomaly threshold. If the weighted sum is less than the anomaly threshold, it is determined that there is no anomaly in the power marketing audit scenario; otherwise, proceed to step 6. Step 6: Extract single-user electricity consumption forecast data from the multi-user electricity consumption forecast data and input it into the fee error and omission audit model. Use the machine learning decision tree as the criterion to perform anomaly detection on the single-user electricity consumption forecast data. When an anomaly is detected, the fee error and omission audit model outputs the power marketing audit scenario corresponding to the abnormal user.
2. The time series-based anomaly detection method for power marketing audit scenarios according to claim 1 is characterized by: The fee collection error and omission audit model includes: anomaly detection sub-model and data optimization sub-model; Among them, the anomaly detection sub-model includes a transformer encoder and an anomaly detection encoder; the data optimization sub-model includes a data optimization encoder.
3. The time series-based anomaly detection method for power marketing audit scenarios according to claim 1 is characterized by: Based on the sliding window, the complete and real multi-user electricity consumption data at different timestamps are extracted.
4. The time series-based anomaly detection method for power marketing audit scenarios according to claim 1 is characterized by: When iteratively training the detection encoder, a balance factor is introduced to the anomaly score, and the value of the balance factor ranges from 0 to 1.
5. The time series-based anomaly detection method for power marketing audit scenarios according to claim 1 is characterized by: The anomaly threshold is 0.
5.
6. The time series-based anomaly detection method for power marketing audit scenarios according to claim 2 is characterized by: The data optimization encoder performs structured processing on single-user electricity consumption prediction data based on a sliding window.
7. The time series-based anomaly detection method for power marketing audit scenarios according to claim 2 is characterized by: A machine learning decision tree is used to calculate the anomaly probability of the abnormal data of the single-user electricity usage history at each time stamp, and the encoder is optimized by iterative training data based on the abnormal data and the anomaly probability of the single-user electricity usage history. The trained data-optimized encoder performs anomaly detection on a single user.
8. A time series-based power marketing audit scenario anomaly detection system, characterized by: include: Collection module, fee error and omission audit model module, multi-user anomaly detection module, single-user anomaly detection module; The collection module is used to collect multi-user electricity consumption data and electricity consumption archive data in the power marketing audit scenario; The fee error and omission audit model module is used to establish a fee error and omission audit model based on an unsupervised learning method; multi-user electricity consumption data and electricity consumption archive data are input into the fee error and omission audit model to obtain multi-user electricity consumption forecast data based on time series, including: multi-user electricity consumption data and electricity consumption archive data are input into the transformer encoder, the transformer encoder establishes a long-term and short-term time series dependency model through a seasonal trend analysis method, the long-term and short-term time series dependency model compares the multi-user electricity consumption data with the electricity consumption archive data, uses the time in the electricity consumption archive data as the timestamp, and extracts the multi-user electricity consumption data with complete and real data at different timestamps as the multi-user electricity consumption forecast data based on time series; The multi-user anomaly detection module is used to input the multi-user electricity consumption forecast data based on time series into the anomaly detection encoder, use the machine learning decision tree to calculate the anomaly probability of the multi-user electricity consumption historical anomaly data at each time stamp, and iteratively train the detection encoder with the multi-user electricity consumption historical anomaly data and anomaly probability; the trained detection encoder generates an anomaly score; when the anomaly score is greater than the anomaly threshold, the cross entropy function is used to calculate the difference between the multi-user electricity consumption forecast data and the electricity consumption archive data; the weighted sum of the difference and the anomaly score is compared with the anomaly threshold. If the weighted sum is less than the anomaly threshold, it is determined that there is no anomaly in the power marketing audit scenario; otherwise, the single-user anomaly detection module is called to perform anomaly detection; The single-user anomaly detection module is used to extract single-user electricity consumption forecast data from multi-user electricity consumption forecast data and input it into the fee error and omission audit model. The single-user electricity consumption forecast data is detected for anomalies based on the machine learning decision tree. When an anomaly is detected, the fee error and omission audit model outputs the power marketing audit scenario corresponding to the abnormal user.
Citation Information
Patent Citations
An electric price inspection execution method based on deep learning of big data
CN109543943A
Intelligent risk identification prevention and control method, system and device and storage medium
CN114444924A