An electricity larceny prevention identification method and system, and a storage medium

By splitting, training, and encrypting the initial model for electricity theft identification through horizontal federated learning, the problems of insufficient electricity theft tag data and low identification accuracy are solved, achieving high-precision electricity theft identification and information security protection.

CN115983867BActive Publication Date: 2026-01-06STATE GRID HEBEI ELECTRIC POWER CO LTD +3
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211386858.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-07
Publication Date
2026-01-06
Estimated Expiration
2042-11-07

AI Technical Summary

Technical Problem

Existing anti-electricity theft technologies suffer from a lack of data on electricity theft tags, poor identification accuracy, inaccurate identification results, and information security risks associated with data sharing, making it difficult to meet the management needs of power companies.

Method used

The initial anti-theft identification model is split into model fragments by a horizontal federated learning agent terminal. These fragments are then trained and encrypted by the power terminals of various power companies and integrated. Each power terminal decrypts the integrated target model to form an anti-theft identification target model, which is then used for identification.

Benefits of technology

It improves the accuracy of electricity theft detection, expands the training data sample, protects user privacy and information security, avoids data leakage, and simplifies the training process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115983867B_ABST
    Figure CN115983867B_ABST
Patent Text Reader

Abstract

The application provides an electricity stealing prevention identification method and system and a storage medium. The method comprises the following steps: a transverse federal learning agent terminal establishes an electricity stealing prevention identification initial model across power companies; the transverse federal learning agent terminal splits the electricity stealing prevention identification initial model into a plurality of model segments, which are trained by corresponding power terminals of the power companies and then integrated after being encrypted, each power terminal decrypts the integrated target model to obtain an electricity stealing prevention identification target model; each power terminal obtains actual data of a user and inputs the actual data into the electricity stealing prevention identification target model to perform electricity stealing prevention identification and obtain an electricity stealing prevention identification result. The application can solve the problems of insufficient label data and low identification accuracy in the current electricity stealing prevention technology under the premise of protecting the privacy and information security of users of the power companies and improve the electricity stealing prevention identification accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of anti-electricity theft technology, and in particular to an anti-electricity theft identification method, system and storage medium. Background Technology

[0002] With the development of power technology, security vulnerabilities frequently emerge in power management, making it easy for unscrupulous individuals to exploit these vulnerabilities using hacking tools to steal electricity. Therefore, preventing electricity theft has long been a difficult problem for power companies. Although various anti-theft measures have been implemented, electricity theft remains rampant, and the methods employed are diverse and constantly evolving.

[0003] However, current electricity theft prevention data from various power companies involves user privacy. Public sharing would negatively impact the information security of users' actual data, and the data sharing process between multiple power companies would consume significant time and effort. Furthermore, the accumulation of large amounts of diverse data could easily lead to data chaos. Due to the insecurity of data sharing, existing electricity theft prevention technologies suffer from insufficient data on electricity theft tags, poor identification accuracy, and inaccurate results. Therefore, current electricity theft prevention technologies are no longer sufficient to meet management needs, and there is an urgent need to research more precise electricity theft identification technologies. Summary of the Invention

[0004] This invention provides a method, system, and storage medium for identifying electricity theft, in order to solve the problems of insufficient data, poor identification accuracy, and inaccurate identification results of electricity theft tags in the prior art.

[0005] In a first aspect, embodiments of the present invention provide a method for identifying electricity theft, comprising:

[0006] A horizontal federated learning agent terminal establishes an initial model for identifying electricity theft across power companies.

[0007] The horizontal federated learning agent terminal splits the initial anti-electricity theft identification model into several model fragments, which are then trained and encrypted by the corresponding power terminals of each power company and integrated. Each power terminal decrypts the integrated target model to obtain the anti-electricity theft identification target model.

[0008] Each power terminal acquires actual user data and inputs the actual data into the anti-theft electricity identification target model for anti-theft electricity identification, thereby obtaining the anti-theft electricity identification result.

[0009] In one possible implementation of the first aspect, the horizontal federated learning agent terminal splits the initial anti-electricity theft identification model into several model fragments, which are then trained and encrypted by the corresponding power terminals of each power company and integrated. Each power terminal decrypts the integrated target model to obtain the anti-electricity theft identification target model, including:

[0010] S1: The horizontal federated learning agent terminal splits the initial anti-electricity theft identification model into several model fragments and sends them to the corresponding power terminals of each power company.

[0011] S2: Each power terminal trains the current model segment to obtain intermediate model parameters, encrypts the intermediate model parameters, and sends the encrypted data to the horizontal federated learning agent terminal.

[0012] S3: The horizontal federated learning agent terminal will summarize the encrypted data received from each power terminal to obtain the first parameter, and then send the first parameter to each power terminal respectively.

[0013] S4: Each power terminal decrypts the first parameter received and updates the corresponding model segment with the decrypted data to obtain a new model segment. The new model segment is then used as the current model segment, and the process jumps to step S2 until the training ends and the target model segment is obtained.

[0014] S5: Each power terminal encrypts the target model fragment and sends it to the horizontal federated learning agent terminal;

[0015] S6: The horizontal federated learning agent terminal integrates the target model fragments received from each power terminal to obtain a first target model, and sends the first target model to each power terminal.

[0016] S7: Each power terminal decrypts the received first target model to obtain the anti-electricity theft identification target model.

[0017] In one possible implementation of the first aspect, before each power terminal trains the current model segment to obtain intermediate model parameters, the method further includes:

[0018] Different anti-electricity theft detection algorithms were determined;

[0019] Different anti-electricity theft identification algorithms are used to identify the anti-electricity theft data of the input model segment, and the corresponding identification results are obtained.

[0020] Determine the target anti-electricity theft identification algorithm based on the identification results;

[0021] Each power terminal trains the current model segment to obtain intermediate model parameters, including:

[0022] The model fragments were trained using a target anti-electricity theft identification algorithm and anti-electricity theft data to obtain intermediate parameters of the model.

[0023] In one possible implementation of the first aspect, encrypting the intermediate parameters of the model includes:

[0024] according to Generate a public key;

[0025] Where s represents the private key, p k Represents the public key, x n +1 represents the polynomial modulus, p[0] represents the first public key, p[1] represents the second public key, a represents a polynomial randomly generated in the ciphertext space, e0 represents noise, and q represents the first coefficient modulus;

[0026] according to Obtain encrypted data;

[0027] Wherein, c represents the encrypted data, c[0] represents the first encrypted data, c[1] represents the second encrypted data, t represents the second coefficient modulus, m represents the intermediate parameters of the model, u represents the mask, and e1 and e2 represent noise respectively.

[0028] In one possible implementation of the first aspect, each power terminal decrypts the received first parameter, including:

[0029] According to c'[1]·s+c'[0]=[e1+eu+e2s+qm' / t] q The received first parameter is decrypted to obtain the decrypted first parameter;

[0030] Where c' represents the first parameter, c'[0] represents the first item of the first parameter, c'[1] represents the second item of the first parameter, and m' represents the decrypted first parameter;

[0031] The noise term is removed from the decrypted first parameter to obtain the decrypted data.

[0032] In one possible implementation of the first aspect, the step of using different anti-electricity theft identification algorithms to identify the anti-electricity theft data of the input model segment and obtaining corresponding identification results includes:

[0033] Different anti-theft data are input into the model segment, and the same algorithm is used to solve the model segment to obtain the corresponding recognition results.

[0034] according to Determine the accuracy of the recognition results obtained using the same algorithm; where α PThis indicates the accuracy of the algorithm's identification results. TP represents electricity theft data identified as such, and FP represents non-electricity theft data identified as such.

[0035] Based on the method described above for determining the precision of the same algorithm, determine the precision of all different algorithms;

[0036] according to Determine the recall rate of the identification results obtained using the same algorithm; where α R The recall rate represents the algorithm's identification results, and FN represents the electricity theft data that is identified as not being electricity theft data.

[0037] Based on the above method for determining the recall rate corresponding to the same algorithm, determine the recall rates corresponding to all different algorithms;

[0038] The algorithm for determining the target anti-electricity theft identification based on the identification result includes:

[0039] The algorithm with the highest accuracy and recall rate was selected as the target electricity theft detection algorithm.

[0040] In one possible implementation of the first aspect, before identifying the anti-theft data of the input model segment using different anti-theft identification algorithms to obtain the corresponding identification results, the method further includes:

[0041] according to The anti-theft data is normalized.

[0042] Where, x i 'Represents the normalized anti-theft electricity data, x' i Indicates anti-theft data, x max x represents the maximum value of anti-theft data provided by each power company. min This represents the minimum value of anti-theft data provided by each power company.

[0043] Secondly, embodiments of the present invention provide an anti-electricity theft identification system, comprising:

[0044] A horizontal federated learning agent terminal is used to establish an initial model for identifying electricity theft across power companies.

[0045] The horizontal federated learning agent terminal is also used to split the initial anti-electricity theft identification model into several model fragments and send them to the corresponding power terminals of each power company.

[0046] Each power terminal is used to train and encrypt the received model fragments and send them to the horizontal federated learning agent terminal;

[0047] The horizontal federated learning agent terminal is also used to integrate the encrypted model fragments received from each power terminal and send them to each power terminal.

[0048] Each power terminal is also used to decrypt the received integrated target model to obtain an anti-theft identification target model; and to obtain actual user data through each power terminal, and input the actual data into the anti-theft identification target model for anti-theft identification to obtain an anti-theft identification result.

[0049] Thirdly, embodiments of the present invention provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method described in the first aspect or any possible implementation thereof.

[0050] This invention provides a method, system, and storage medium for preventing electricity theft. An initial anti-electricity theft identification model is established across power companies through a horizontal federated learning agent terminal. The agent terminal breaks down the initial model into several model fragments, which are then trained and encrypted by power terminals corresponding to each power company before being integrated. Each power terminal decrypts the integrated target model to obtain the anti-electricity theft identification target model. Each power terminal acquires actual user data and inputs it into the anti-electricity theft identification target model for identification, resulting in the identification result. This invention trains the initial anti-electricity theft identification model and obtains the target model through the training, encryption, and integration of model fragments by each power terminal. During this process, the horizontal federated learning agent terminal does not possess the encryption / decryption rules; therefore, it cannot access the actual user data of each power company, protecting the privacy and information security of users of each power company. Furthermore, the anti-theft identification method provided in this embodiment of the invention splits and distributes the initial anti-theft identification model to each power terminal, and uses anti-theft data from multiple power terminals for training, which greatly expands the training data sample. Therefore, the final anti-theft identification target model is obtained based on a large number of training data samples, which can better solve the problems of insufficient tag data and low identification accuracy in the current anti-theft technology, improve the anti-theft identification accuracy, and obtain the most accurate anti-theft identification result. Attached Figure Description

[0051] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0052] Figure 1 This is a schematic diagram illustrating the implementation process of the anti-electricity theft identification method provided in this embodiment of the invention;

[0053] Figure 2 This is the anti-electricity theft identification model training framework provided in the embodiments of the present invention;

[0054] Figure 3 This is a schematic diagram of the anti-electricity theft system provided in an embodiment of the present invention. Detailed Implementation

[0055] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of the invention. However, those skilled in the art will understand that the invention can be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods are omitted so as not to obscure the description of the invention with unnecessary detail.

[0056] To make the objectives, technical solutions, and advantages of the present invention clearer, specific embodiments will be described below in conjunction with the accompanying drawings.

[0057] Figure 1 The implementation flowchart of the anti-electricity theft identification method provided in the embodiments of the present invention is described in detail below:

[0058] Step 101: The horizontal federated learning agent terminal establishes an initial model for identifying electricity theft across power companies.

[0059] Horizontal federated learning, also known as sample-partitioned federated learning, can be applied to scenarios where the datasets of the various participants in federated learning have the same feature space but different sample spaces. It is similar to horizontally partitioning data in a table view, where records in the table are horizontally divided into different groups according to rows, and each row contains complete data features.

[0060] In one possible implementation, the initial model for identifying electricity theft has a basic framework and initialization parameters β0.

[0061] Step 102: The horizontal federated learning agent terminal splits the initial anti-electricity theft identification model into several model fragments, which are then trained and encrypted by the corresponding power terminals of each power company and integrated. Each power terminal decrypts the integrated target model to obtain the anti-electricity theft identification target model.

[0062] This step may include:

[0063] S1: The horizontal federated learning agent terminal splits the initial model for anti-electricity theft identification into several model fragments and sends them to the corresponding power terminals of each power company.

[0064] The horizontal federated learning agent terminal has the model initialization parameter β0, and the M power terminals divide the model initialization parameter into M segments, specifically... The model fragments corresponding to the model initialization parameters are sent to the corresponding power terminals of each power company.

[0065] S2: Each power terminal trains the current model segment, obtains intermediate model parameters, encrypts the intermediate model parameters, and sends the encrypted data to the horizontal federated learning agent terminal.

[0066] When training the current model segment at each power terminal to obtain intermediate model parameters, the target anti-theft electricity identification algorithm and anti-theft electricity data can be used to train the model segment to obtain intermediate model parameters.

[0067] The determination of the anti-theft electricity identification algorithm here is carried out before each power terminal trains the current model segment and obtains the intermediate parameters of the model. Different anti-theft electricity identification algorithms are used to identify the anti-theft electricity data of the input model segment to obtain the corresponding identification results. The target anti-theft electricity identification algorithm is determined based on the identification results.

[0068] Optionally, the anti-theft electricity detection algorithm can be configured according to actual needs. Generally, anti-theft electricity detection algorithms can include various methods such as outlier analysis, clustering algorithms, neural networks, and decision tree classification.

[0069] Outlier analysis, in particular, identifies outliers based on the differences in general behavior or characteristics between electricity theft data and non-theft data. It then constructs a probabilistic statistical model (such as a normal, Poisson, or binomial distribution, with parameters derived from the data) for the dataset and uses a dissonance test to identify outliers. The dissonance test requires knowledge of the parameters of the electricity theft data (such as the assumed data distribution), the parameters of the distribution (such as expectation and variance), and the expected number of outliers.

[0070] Clustering algorithms first randomly select two points as cluster centers, calculate the clusters of each point to the two cluster centers, then assign the point to the nearest cluster center to form two clusters, and then recalculate the centroid (mean) of each cluster. Repeat the above steps until the position of the centroid no longer changes or the set number of iterations is reached, so that the anti-theft data can be divided into two categories: anti-theft data and non-anti-theft data.

[0071] A neural network is a system that uses a certain number of neurons and hidden layers to predict electricity theft data through forward propagation and correct parameters through backpropagation. In forward propagation, the input electricity theft data is calculated layer by layer from the input layer through the hidden layers until the output layer. The state of each neuron only affects the state of the next neuron. If the output layer does not produce the expected output, backpropagation begins. The network weights and thresholds are adjusted based on the prediction error, allowing the neural network's predicted output to continuously approach the expected output, thus distinguishing between electricity theft data and non-electricity theft data.

[0072] Decision tree classification refers to the specific classification of decision trees. Decision tree classification involves three steps: feature selection, decision tree generation, and decision tree pruning. Feature selection includes metrics such as information gain, information gain ratio, and Gini index. Decision tree pruning can improve overfitting of the model, including pre-pruning and post-pruning. Through these three steps, anti-theft data can be divided into two categories: data related to electricity theft and data related to non-theft.

[0073] Optionally, to eliminate the adverse effects caused by outlier sample data, the anti-theft data can be normalized. Therefore, before using different anti-theft identification algorithms to identify the anti-theft data of the input model segment and obtaining the corresponding identification results, the following steps are also included:

[0074] according to The data on electricity theft prevention is normalized.

[0075] Where, x i 'Represents the normalized anti-theft electricity data, x' i Indicates anti-theft data, x max x represents the maximum value of anti-theft data provided by each power company. min This represents the minimum value of anti-theft data provided by each power company.

[0076] Normalization can limit the preprocessed data to a certain range, and can also speed up the convergence of the training network and potentially improve accuracy.

[0077] After normalizing the anti-theft data, different anti-theft identification algorithms are used to identify the anti-theft data of the input model segment. Here, for a binary classification system, instances can be divided into positive and negative classes, and the pattern classifier has four classification results:

[0078] True Positive (TP): Electricity theft data that is identified as such.

[0079] False Negative (FN): Electricity theft data that is identified as not being electricity theft data.

[0080] False Positive (FP): Non-electricity-stealing data that is identified as electricity-stealing data.

[0081] True Negative (TN): Non-stealing data whose identification result is not electricity theft data.

[0082] For example, when the model segment identifies the input anti-theft data: if the anti-theft data is stolen data and the anti-theft identification algorithm identifies it as stolen data, then TP is output; if the anti-theft data is stolen data and the anti-theft identification algorithm identifies it as non-stolen data, then FN is output; if the anti-theft data is non-stolen data and the anti-theft identification algorithm identifies it as non-stolen data, then TN is output; if the anti-theft data is non-stolen data and the anti-theft identification algorithm identifies it as stolen data, then FP is output.

[0083] Then, the target electricity theft identification algorithm is determined based on the precision and recall of the identification results.

[0084] Precision rate, also known as accuracy, refers to the proportion of correctly predicted positive data out of all correctly predicted positive data. In this embodiment of the invention, it can refer to the proportion of correctly predicted electricity theft data out of all correctly predicted electricity theft data.

[0085] Optional, according to Determine the accuracy of the recognition results obtained using the same algorithm. Wherein, α P This indicates the accuracy of the algorithm's identification results. TP represents electricity theft data identified as such, and FP represents non-electricity theft data identified as such.

[0086] Based on the method described above for determining the accuracy of the same algorithm, determine the accuracy of all different algorithms.

[0087] Recall rate refers to the proportion of correctly predicted positive data out of all actually positive data. In the embodiments of the invention, it can refer to the proportion of correctly predicted electricity theft data out of all electricity theft data.

[0088] according to Determine the recall rate of the identification results obtained using the same algorithm. Wherein, α R FN represents the recall rate of the algorithm's identification results, and FN represents the electricity theft data that is identified as not being electricity theft data.

[0089] Based on the above method for determining the recall rate corresponding to the same algorithm, determine the recall rates corresponding to all different algorithms.

[0090] Determining the target anti-electricity theft identification algorithm based on the identification results may include: identifying the algorithm with the highest accuracy and highest recall as the target electricity theft identification algorithm.

[0091] If no algorithm simultaneously satisfies both the highest accuracy and the highest recall, then the algorithm corresponding to the highest accuracy and the second highest recall will be identified as the target electricity theft detection algorithm.

[0092] If no algorithm simultaneously satisfies the highest accuracy and highest recall, or the highest accuracy and second-highest recall, then the algorithm corresponding to the highest recall and second-highest accuracy will be identified as the target electricity theft detection algorithm.

[0093] The encryption algorithm used to encrypt the intermediate parameters of the model can be the Improved Fully Homomorphic Encryption (IBFV).

[0094] Encryption of intermediate parameters of the model can include:

[0095] according to Generate a public key.

[0096] according to The encrypted data was obtained.

[0097] Where s represents the private key, p k Represents the public key, x n +1 represents the polynomial modulus, p[0] represents the first public key, p[1] represents the second public key, a represents a polynomial randomly generated in the ciphertext space, e0 represents noise, q represents the first system modulus, c represents encrypted data, c[0] represents the first encrypted data, c[1] represents the second encrypted data, t represents the second system modulus, m represents the intermediate parameters of the model, u represents the mask, and e1 and e2 represent noise respectively.

[0098] Optionally, the private key is a polynomial generated in n-dimensional space with coefficients of -1, 0, or 1.

[0099] Substituting the values ​​corresponding to p[0] and p[1] into c[0] and c[1] respectively, we can obtain The value of c can then be obtained, thus completing the encryption of the intermediate parameters of the model.

[0100] like Figure 2 As shown, for example, there may be three power terminals: power terminal A, power terminal B, and power terminal C. These power terminals send encrypted data to the horizontal federated learning agent terminal. The horizontal federated learning agent terminal does not know the encryption algorithm and receives the already encrypted data.

[0101] S3: The horizontal federated learning agent terminal will summarize the encrypted data received from each power terminal to obtain the first parameter, and then send the first parameter to each power terminal respectively.

[0102] The aggregation operation here can be a weighted average of all encrypted data. The horizontal federated learning agent terminal does not decrypt the received encrypted data but directly performs aggregation processing and sends the aggregated first parameter to power terminals A, B, and C, such as... Figure 2 As shown.

[0103] S4: Each power terminal decrypts the received first parameter and uses the decrypted data to update the corresponding model fragment, obtaining a new model fragment. The new model fragment is then used as the current model fragment, and the process jumps to step S2 until training ends, obtaining the target model fragment.

[0104] The decryption operation is performed by each power terminal, and the encryption and decryption rules are only stored in each power terminal and are not known to the horizontal federated learning agent terminal.

[0105] In one possible implementation, the decryption algorithm used by each power terminal to decrypt the received first parameter can be an improved fully homomorphic encryption (IBFV).

[0106] Decrypting the first parameter can include:

[0107] According to c'[1]·s+c'[0]=[e1+eu+e2s+qm' / t] q The first parameter after decryption is obtained. Noise terms are removed from the first parameter after decryption to obtain the decrypted data.

[0108] Where c' represents the first parameter, c'[0] represents the first term of the first parameter, c'[1] represents the second term of the first parameter, and m' represents the first parameter after decryption.

[0109] Noise is a relatively small term. During homomorphic operations, the noise value will increase with the amount of addition and multiplication. When the noise increase is not too large, the noise term can be eliminated by rounding.

[0110] The decrypted data is used to update the corresponding model fragment, resulting in the updated model fragment. This updated model fragment can then be used as the current model fragment for further updates.

[0111] Optionally, the training criteria and the criteria for ending training can be set according to actual needs. In this embodiment, the training criteria and the criteria for ending training are not limited. For example, the training criteria can be the number of iterations in the training process or the accuracy of the model. The criteria for ending training can be 1000 iterations. When the number of iterations has not reached 1000, the training process will continue to jump to step S2 until the number of iterations reaches 1000, at which point the training process stops and the target model fragment is obtained.

[0112] S5: Each power terminal encrypts the target model fragment and sends it to the horizontal federated learning agent terminal.

[0113] In one possible implementation, the encryption algorithm used to encrypt the target model fragment can be an improved fully homomorphic encryption (IBFV).

[0114] Encryption of target model fragments may include:

[0115] according to Generate a public key;

[0116] according to Obtain encrypted data;

[0117] Where s represents the private key, p k Represents the public key, x n +1 represents the polynomial modulus, p[0] represents the first public key, p[1] represents the second public key, a represents a polynomial randomly generated in the ciphertext space, e0 represents noise, q represents the first system modulus, c″ represents the encrypted target model fragment, c″[0] represents the first encrypted target model fragment, c″[1] represents the second encrypted target model fragment, t represents the second system modulus, m″ represents the target model fragment, u represents the mask, and e1 and e2 represent noise respectively.

[0118] Optionally, the private key is a polynomial generated in n-dimensional space with coefficients of -1, 0, or 1.

[0119] Substituting the values ​​of p[0] and p[1] into c″[0] and c″[1] respectively, we can obtain Then we can get c″.

[0120] like Figure 2 As shown, for example, the power terminal can include three: power terminal A, power terminal B, and power terminal C. The encrypted target model fragment is sent to the horizontal federated learning agent terminal. The horizontal federated learning agent terminal does not know the encryption algorithm, so it only receives the encrypted target model fragment.

[0121] S6: The horizontal federated learning agent terminal integrates the target model fragments received from each power terminal to obtain the first target model, and then sends the first target model to each power terminal.

[0122] Model integration refers to combining multiple models into a complete model. Here, the models trained by each power terminal are all model fragments, while a complete model is used for anti-theft identification. Therefore, it is necessary to integrate the various model fragments after training to obtain the target model fragment.

[0123] The horizontal federated learning agent terminal does not decrypt the received target model fragments, but directly integrates them and sends the integrated first target model to power terminal A, power terminal B, and power terminal C, such as... Figure 2 As shown.

[0124] S7: Each power terminal decrypts the received first target model to obtain the anti-theft electricity identification target model.

[0125] In one possible implementation, the decryption algorithm for the received target model by each power terminal can be an improved fully homomorphic encryption (IBFV).

[0126] Decrypting the first target model may include:

[0127] According to c″′[1]·s+c″′[0]=[e1+eu+e2s+qm″′ / t] q The first target model after decryption is obtained. Noise terms are removed from the first target model after decryption to obtain the anti-electricity theft identification target model.

[0128] Where c″′ represents the first target model, c″′[0] represents the first term of the first target model, c″′[1] represents the second term of the first target model, and m″′ represents the decrypted first target model.

[0129] Noise is a relatively small term. During homomorphic operations, the noise value will increase with the amount of addition and multiplication. When the noise increase is not too large, the noise term can be eliminated by rounding.

[0130] Step 103: Each power terminal acquires the actual user data and inputs the actual data into the anti-theft electricity identification target model for anti-theft electricity identification, thereby obtaining the anti-theft electricity identification result.

[0131] In one possible implementation, the user's actual data can be data such as user voltage, current, and power consumption. After the user's actual data is input into the anti-electricity theft identification target model, the anti-electricity theft identification target model can provide a result indicating whether the user's actual data is electricity theft data or not.

[0132] The electricity theft identification method provided in this invention addresses the current limitations of insufficient anti-electricity theft technology tag data and low identification accuracy. It distributes model fragments to each power terminal for individual model fragment training, followed by encryption, integration, and decryption to obtain a complete anti-electricity theft identification target model. This method significantly expands the training data sample and improves identification accuracy by splitting and distributing the initial anti-electricity theft identification model to each power terminal and using anti-electricity theft data from multiple terminals for training. Furthermore, the entire model training process is conducted on encrypted data, ensuring that the horizontal federated learning agent terminal does not access any real data. Each power terminal only accesses its own user data, completely avoiding access to user data from other power terminals. This protects the actual user data of each power company to a certain extent, preventing data leakage and simplifying the training process.

[0133] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0134] The following are system embodiments of the present invention. For details not described in detail, please refer to the corresponding method embodiments described above.

[0135] Figure 3 A schematic diagram of the anti-electricity theft identification system provided in an embodiment of the present invention is shown. For ease of explanation, only the parts related to the embodiment of the present invention are shown, and are described in detail below:

[0136] like Figure 3 As shown, the anti-electricity theft identification system 300 includes:

[0137] The horizontal federated learning agent terminal 301 is used to establish an initial model for identifying electricity theft across power companies.

[0138] The horizontal federated learning agent terminal 301 is also used to split the initial model for anti-electricity theft identification into several model fragments and send them to the corresponding power terminals 302 of each power company.

[0139] Each power terminal 302 is used to train and encrypt the received model segments and send them to the horizontal federated learning agent terminal 301;

[0140] The horizontal federated learning agent terminal 301 is also used to integrate the encrypted model fragments received from each power terminal 302 and send them to each power terminal.

[0141] Each power terminal 302 is also used to decrypt the received integrated target model to obtain the anti-theft identification target model; and to obtain the user's actual data through each power terminal 302, and input the actual data into the anti-theft identification target model for anti-theft identification to obtain the anti-theft identification result.

[0142] In one possible implementation, the anti-electricity theft identification system 3 further includes:

[0143] Each power terminal 302 is used to train the current model segment, obtain intermediate model parameters, encrypt the intermediate model parameters, and send the obtained encrypted data to the horizontal federated learning agent terminal 301.

[0144] The horizontal federated learning agent terminal 301 is also used to summarize the encrypted data received from each power terminal to obtain the first parameter, and then send the first parameter to each power terminal 302 respectively.

[0145] Each power terminal 302 is also used to decrypt the received first parameter, update the corresponding model segment with the decrypted data, obtain a new model segment, and retrain the new model segment as the current model segment until the training is completed and the target model segment is obtained.

[0146] Each power terminal 302 is also used to encrypt the target model fragment and send it to the horizontal federated learning agent terminal 301;

[0147] The horizontal federated learning agent terminal 301 is also used to integrate the target model fragments sent by each power terminal to obtain the first target model, and then send the first target model to each power terminal 302.

[0148] Each power terminal 302 is also used to decrypt the received first target model to obtain the anti-theft identification target model.

[0149] The anti-theft electricity identification system provided in this invention addresses the current limitations of insufficient anti-theft technology tag data and low identification accuracy. It trains individual model fragments by distributing them to each power terminal, and then encrypts, integrates, and decrypts them to obtain a complete anti-theft electricity identification target model. This method significantly expands the training data sample and improves identification accuracy by splitting and distributing the initial anti-theft electricity identification model to each power terminal and using anti-theft data from multiple terminals for training. Furthermore, the entire model training process is conducted on encrypted data, ensuring that the horizontal federated learning agent terminal does not access any real data. Each power terminal only accesses its own user data and avoids access to user data from other power terminals, thus protecting the actual user data of each power company to a certain extent, preventing data leakage, and simplifying the training process.

[0150] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0151] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0152] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0153] In the embodiments provided by this invention, it should be understood that the disclosed devices / terminals and methods can be implemented in other ways. For example, the device / terminal embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0154] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0155] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0156] If integrated modules / units are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the above-described anti-electricity theft identification method embodiments. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.

[0157] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. A power theft prevention identification method, characterized in that, The method comprises the following steps: A cross-federal learning agent terminal establishes an initial model for electricity theft prevention across power companies; The cross-federal learning agent terminal splits the initial model for electricity theft prevention into several model segments, which are trained and encrypted by the power terminals corresponding to the power companies and then integrated, the power terminals decrypt the integrated target model to obtain a target model for electricity theft prevention; The power terminals obtain actual data of users and input the actual data into the target model for electricity theft prevention to identify electricity theft and obtain an electricity theft prevention result; The cross-federal learning agent terminal splits the initial model for electricity theft prevention into several model segments, which are trained and encrypted by the power terminals corresponding to the power companies and then integrated, the power terminals decrypt the integrated target model to obtain a target model for electricity theft prevention, comprising: S1: The cross-federal learning agent terminal splits the initial model for electricity theft prevention into several model segments and sends the model segments to the power terminals corresponding to the power companies; S2: Each power terminal trains the current model segment to obtain model intermediate parameters, encrypts the model intermediate parameters, and sends the encrypted data to the cross-federal learning agent terminal; wherein the cross-federal learning agent terminal does not master the encryption algorithm; the encryption of the model intermediate parameters comprises: According to generating a public key; wherein, s represents a private key, represents a public key, represents a polynomial modulus, represents a first public key, represents a second public key, a represents a polynomial randomly generated within a ciphertext space, represents noise, q represents a first system modulus; According to obtaining encrypted data; wherein, c represents the encrypted data, represents the first encrypted data, represents the second encrypted data, t represents the second system modulus, m represents the model intermediate parameter, u represents the mask, 、 respectively represent noise; S3: The cross-federal learning agent terminal aggregates the encrypted data received from each power terminal to obtain first parameters and sends the first parameters to each power terminal; S4: Each power terminal decrypts the received first parameters and updates the corresponding model segment with the decrypted data to obtain a new model segment, takes the new model segment as the current model segment, and jumps to step S2 for execution until the training is completed to obtain a target model segment; wherein the cross-federal learning agent terminal does not decrypt the received encrypted data; the decryption of the received first parameters by each power terminal comprises: According to decrypting the received first parameter to obtain a decrypted first parameter; wherein, denotes a first parameter, denotes a first term of the first parameter, denotes a second term of the first parameter, denotes the decrypted first parameter; Removing noise terms from the decrypted first parameters to obtain decrypted data; S5: Each power terminal sends the target model segment to the cross-federal learning agent terminal after encryption; S6: The cross-federal learning agent terminal integrates the target model segments received from each power terminal to obtain a first target model and sends the first target model to each power terminal; S7: Each power terminal decrypts the received first target model to obtain the target model for electricity theft prevention.

2. The electricity larceny preventing identification method according to claim 1, characterized by, Before the training of the current model segment by each power terminal to obtain the model intermediate parameters, the method further comprises the following steps: Determining different electricity theft prevention algorithms; Identifying electricity theft data input into the model segment using different electricity theft prevention algorithms to obtain corresponding identification results; Determining a target electricity theft prevention algorithm according to the identification results; The training of the current model segment by each power terminal to obtain the model intermediate parameters comprises: Training the model segment using the target electricity theft prevention algorithm and the electricity theft data to obtain the model intermediate parameters.

3. The electricity larceny preventing identification method according to claim 2, characterized by, The different anti-theft electricity identification algorithms are respectively used to identify the anti-theft electricity data input into the model segment, and corresponding identification results are obtained, including: Different anti-theft electricity data are input into the model segment, and the same algorithm is used to solve the model segment, and corresponding identification results are obtained; According to determining the precision of the identification result solved by the same algorithm; wherein, the precision of the algorithm identification result is represented by, TP the electricity stealing data whose identification result is electricity stealing data is represented by, FP the non-electricity stealing data whose identification result is electricity stealing data is represented by, According to the above method of determining the precision rate corresponding to the same algorithm, the precision rates corresponding to all different algorithms are determined; According to determining the recall rate of the recognition result solved by the same algorithm; wherein, the recall rate of the recognition result of the algorithm, FN the electricity stealing data indicating that the recognition result is non-electricity stealing data; According to the above method of determining the recall rate corresponding to the same algorithm, the recall rates corresponding to all different algorithms are determined; The target anti-theft electricity identification algorithm is determined according to the identification result, including: The algorithm corresponding to the highest accuracy rate and the highest recall rate is determined as the target anti-theft electricity identification algorithm.

4. The electricity larceny preventing identification method according to claim 2, characterized by, Before the different anti-theft electricity identification algorithms are respectively used to identify the anti-theft electricity data input into the model segment, and corresponding identification results are obtained, it further includes: According to normalizing the anti-theft data; wherein, represents the normalized anti-theft electricity data, represents the anti-theft electricity data, represents the maximum value of the anti-theft electricity data provided by each electric power company, represents the minimum value of the anti-theft electricity data provided by each electric power company.

5. An electricity pilferage identification system characterized in that, It includes: A horizontal federal learning agent terminal is used to establish an anti-theft electricity identification initial model across power companies through the horizontal federal learning agent terminal; The horizontal federal learning agent terminal is also used to split the anti-theft electricity identification initial model into several model segments and send them to the corresponding power terminals of each power company; Each power terminal is used to train and encrypt the received model segment and send it to the horizontal federal learning agent terminal; The horizontal federal learning agent terminal is also used to integrate the received encrypted model segments sent by each power terminal and send them to each power terminal; Each power terminal is also used to decrypt the received integrated target model to obtain an anti-theft electricity identification target model, and to obtain actual user data through the power terminal and input the actual data into the anti-theft electricity identification target model for anti-theft electricity identification to obtain an anti-theft electricity identification result; Each power terminal is also used to train the current model segment to obtain model intermediate parameters, encrypt the model intermediate parameters, and send the encrypted data obtained to the horizontal federal learning agent terminal; wherein the horizontal federal learning agent terminal does not master the encryption algorithm; the model intermediate parameters are encrypted, including: According to generating a public key; wherein, s represents a private key, represents a public key, represents a polynomial modulus, represents a first public key, represents a second public key, a represents a polynomial randomly generated within a ciphertext space, represents noise, q represents a first system modulus; According to obtaining encrypted data; wherein, c represents the encrypted data, represents the first encrypted data, represents the second encrypted data, t represents the second system modulus, m represents the model intermediate parameter, u represents the mask, 、 respectively represent noise; The horizontal federal learning agent terminal is also used to collect the encrypted data sent by each power terminal to obtain a first parameter and distribute the first parameter to each power terminal respectively; Each power terminal is also used to decrypt the received first parameter and update the corresponding model segment with the decrypted data to obtain a new model segment, and retrain the new model segment as the current model segment until the training is completed to obtain a target model segment; wherein the horizontal federal learning agent terminal does not decrypt the received encrypted data; the power terminal decrypts the received first parameter, including: According to decrypting the received first parameter to obtain a decrypted first parameter; wherein, denotes a first parameter, denotes a first term of the first parameter, denotes a second term of the first parameter, denotes the decrypted first parameter; The decrypted first parameter is de-noised to obtain decrypted data; Each power terminal is also used to encrypt the target model segment and send it to the horizontal federal learning agent terminal; The transverse federated learning agent terminal is further configured to integrate the target model segments sent by the power terminals to obtain a first target model, and distribute the first target model to the power terminals. The power terminals are further configured to decrypt the received first target model to obtain the electricity larceny prevention identification target model.

6. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 5. The computer program, when executed by a processor, implements the steps of the electricity larceny prevention identification method of any one of claims 1 to 4.

Citation Information

Patent Citations

  • Multi-device federated learning system based on SDN networking

    CN115174404A

  • User electricity stealing behavior detection method and system based on alliance chain and federal learning

    CN115270145A