CN115270145A - User electricity stealing behavior detection method and system based on alliance chain and federal learning - Google Patents

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

Info

Publication number
CN115270145A
CN115270145A CN202210712406.7A CN202210712406A CN115270145A CN 115270145 A CN115270145 A CN 115270145A CN 202210712406 A CN202210712406 A CN 202210712406A CN 115270145 A CN115270145 A CN 115270145A
Authority
CN
China
Prior art keywords
model
local
training
electricity stealing
node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210712406.7A
Other languages
Chinese (zh)
Inventor
杨会峰
陈连栋
程凯
王乃玉
李轩
关志涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
State Grid Corp of China SGCC
North China Electric Power University
Information and Telecommunication Branch of State Grid Hebei Electric Power Co Ltd
Original Assignee
State Grid Corp of China SGCC
North China Electric Power University
Information and Telecommunication Branch of State Grid Hebei Electric Power Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by State Grid Corp of China SGCC, North China Electric Power University, Information and Telecommunication Branch of State Grid Hebei Electric Power Co Ltd filed Critical State Grid Corp of China SGCC
Priority to CN202210712406.7A priority Critical patent/CN115270145A/en
Publication of CN115270145A publication Critical patent/CN115270145A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/604Tools and structures for managing or administering access control systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Systems or methods specially adapted for specific business sectors, e.g. utilities or tourism
    • G06Q50/06Electricity, gas or water supply

Abstract

The invention discloses a user electricity stealing behavior detection method and a system model based on alliance chain and federal learning, wherein the detection method comprises the following steps of sequentially connecting: 1) Registering a node; 2) Training initialization; 3) Key distribution; 4) Local training: the selected participants download the global model, iterate through a local optimization strategy, and send the ciphertext to the proxy node after encryption; 5) Model polymerization: the agent node clusters meeting the threshold value jointly recover the decryption key, and transfer the intelligent contract to execute two-stage aggregation, and the result is subjected to cochain after being identified; 6) And (3) global model updating: after the global iteration meets the conditions, the global training is finished, and the electricity stealing detection model is updated; 7) And detecting the electricity stealing behavior. The method can obtain the model with the performance superior to that of local independent training, can also take the privacy of local data into consideration, improve the safety, and can realize sustainable iteration and updating of the electricity stealing detection model of the user.

Description

User electricity stealing behavior detection method and system based on alliance chain and federal learning
Technical Field
The invention relates to a user electricity stealing behavior detection method and system based on alliance chain and federal learning, and belongs to the technical field of block chain and federal learning.
Background
For a long time, the electricity stealing and electricity leakage behaviors in the power grid are difficult to eradicate, the benefits of related power companies are damaged, the life and property safety of people around is threatened, and the stable transmission of the power grid is threatened. The traditional measures for preventing electricity leakage and stealing are not only in need of huge cost of manpower and material resources, but also have little effect. Therefore, many researches have been made to construct a power consumption abnormality detection model through a machine learning algorithm, so that the daily power consumption mode of a relevant user can be efficiently and accurately detected. However, the traditional machine learning method usually needs a large amount of effective data to train the algorithm model, and in practical situations, the performance of the trained model is poor due to reasons such as backward equipment, terminal alarm, false alarm and missing report, and the like of part of electric power companies, and the standard of online operation cannot be achieved. This problem is generally solved by collecting data of different electric power companies to a data center, but this not only causes a large amount of communication overhead, but also raises a broad concern about data privacy and security issues.
Disclosure of Invention
In order to overcome the defects of a data collection method adopted by the traditional electricity stealing detection model training, the invention provides a user electricity stealing behavior detection method and a system model based on alliance chain and federal learning.
In order to solve the technical problems, the technical scheme adopted by the invention is as follows:
a user electricity stealing behavior detection method based on a federation chain and federation learning is characterized in that each participant and agent node participating in federation training are different nodes of the same federation chain, and the method comprises the following steps:
1) All participants as alliance chain peer nodes enter the system by submitting legal identity certificates approved by organizations;
2) Writing initial global model parameter information into a creature block, and responding and training by each participant;
3) A key management mechanism generates and distributes a threshold homomorphic key pair;
4) The selected participants download the global model, iterate through a local optimization strategy, and send the ciphertext to the proxy node after encryption;
5) The agent node clusters meeting the threshold value jointly recover the decryption key, and transfer the intelligent contract to execute two-stage aggregation, and the result is subjected to cochain after being identified;
6) After the model updating global iteration meets the conditions, the global training is finished, and the electricity stealing detection model is updated.
7) The client submits the power utilization data records of the user within a period of time as the input of the electricity stealing detection model, and the electricity stealing detection model outputs whether the electricity stealing data records are electricity stealing users or not.
In step 6), if the performance of the current global model is detected and the model updating condition is not met, returning to the local training step of step 4) until the detection result of the performance of the current global model meets the model updating condition.
In the step 1), only the peer node in the federation chain needs to register to the system through the identity certificate, the proxy node is used as a super node in the federation chain and has write permission, each organization selects a commonly authorized node to act as the super node, and a block chain consensus mechanism is executed and has the permission of chain accounting. The proxy node is not completely reliable, and risks such as disconnection and the like may exist.
In the step 2), in the system initialization stage, the initial global model parameter information can be written into the created block as the first transaction information; and in the subsequent initialization stage of the update of the electricity stealing detection model, directly using the final model of the previous version as the initial global model of the new round of version training, packing the training parameters of the model update condition into a new block, and enabling each participant to respond to the training.
In the step 3), the key pair generated by the key management mechanism is generated based on a Paillier threshold variant algorithm, and the key management mechanism needs to broadcast the public key to all peer nodes, distribute the private key share to each agent node, and then go offline.
The step 4) includes:
4.1 Each round selects participants from the peer node cluster according to a fixed proportion C;
4.2 Local optimization strategies in local training, including optimization methods, local iteration times, local learning rates and the like, can be downloaded from the blockchain together with the initial global model;
4.3 ) the peer node obtains local model update after training the local data set according to a local optimization strategy, and encrypts the local model update by using a public key issued by a key management mechanism and adopting a threshold variant of a Paillier algorithm;
4.4 Encrypted ciphertext is sent to any proxy node.
In the step 5), the 5.1) two-stage polymerization comprises that in the prepolymerization stage, the local sample numbers of all the participants are weighted to obtain a prepolymerization global model; in the formal aggregation stage, the weight is divided into two parts, the first part is weighted according to the local sample number of the participants, and the second part is weighted according to the Euclidean distance between the global model ciphertext and each local model ciphertext in the prepolymerization stage; 5.2 In combination with the threshold Paillier variant method, a threshold is set on the basis of the assumed honest and stable node number in the system, and the decryption key can be recovered only if the collected share number of the private key exceeds the threshold; 5.3 The agent node packages the decrypted global model, performs raft consensus in the agent node, and adds the transaction block successfully agreed to the tail end of the block chain.
In the step 6), after each round of global model generation, the agent node needs to detect the model by contrasting the model updating conditions recorded on the chain, and if the model updating conditions are met, the global training is finished; and after adding the transaction block to the end of the blockchain, the agent node adds a mark of training completion and adds a new power stealing detection model version to the mark as an initial model for the next training.
In the step 7), as the input of the electricity stealing detection model, the client submits the electricity stealing detection request to the system, and can selectively submit the electricity consumption data records of a certain user within a period of time, and also can input electricity consumption data of a batch of users in batch. The agent node collects the detection request of the client and detects by using the model of the current latest version, the model outputs whether the client is a power stealing user, and the agent node returns the detection result to the client.
A user electricity stealing behavior detection system based on alliance chain and federal learning comprises:
a peer node: a first entity with actual electricity utilization data is used as a training entity to participate in horizontal federal training, and has the authority of reading data on a chain in a block chain; after downloading the global model from the agent node in each round, performing iterative training by using local data, encrypting the trained local model parameters by using a threshold Paillier algorithm, sending the encrypted ciphertext to any agent node, and repeating the iteration in such a way until the global model meets the model updating condition;
the proxy node: the second entity collects the model update ciphertexts submitted by each peer node, performs combined decryption and executes the model cipher text aggregation process;
organizing: and the third entity organizes the first entity to participate in the training of the system model and is responsible for the admission of the peer node in the block chain. The second entity must be co-authorized by the organization in the system; a key management mechanism: the fourth entity is responsible for generating and issuing the key pair required by the cryptographic algorithm;
the global model structure and the local iteration strategy generated by system initialization are written into the founding block, the subsequent iteration round training initialization only needs to add the local iteration strategy, a key management mechanism generates a key pair required by a subsequent cryptographic algorithm, and public and private keys are respectively issued; selecting a peer node with a certain proportion (a participant proportion set in a local iteration strategy) for local training in each round, updating a new round of local model by the selected node according to the downloaded current global model and a local data set, encrypting by using a distributed public key and transmitting to an agent node; the agent nodes call the intelligent contract to successively execute a two-stage aggregation algorithm and a decryption algorithm to obtain a global model of the current round, wherein the decryption key needs to be recovered by providing a private key share by the agent nodes exceeding a threshold; repeating the steps from local training to global aggregation until the obtained global model meets the model updating condition, finishing training, and recording the global model mark of the new version into the block chain; when the detection task is executed, the client submits the electricity utilization data records of the user in a period of time to the system as the input of the electricity stealing detection model, the agent node performs electricity stealing detection by using the current latest version of the model, and the result of whether the model is the electricity stealing user or not is output to the client.
Of the four entities of the system described above:
1) The first entity and the second entity mainly undertake a transverse federal training task in a model training stage, are respectively used as a peer node and a super node in a federation chain and respectively have a reading right and a reading-writing right. The second entity performs a consensus algorithm in the blockchain.
2) The third entity is responsible for granting admission rights to the first entity system and jointly authorizing the second entity.
3) And the fourth entity is responsible for initializing the cryptographic algorithm in the Paillier-based threshold variant algorithm execution system, and the key management mechanism broadcasts the public key to all peer nodes and distributes the private key share to each agent node.
The system comprises a model training process and an electricity stealing detection process, and the two processes are not in conflict with each other.
In the initialization stage of the system, a global model structure and a local iteration strategy are written into a creation block, when a subsequent electricity stealing detection model is updated, the global model structure and the local iteration strategy are used as an initial model, and then the local iteration strategy is added, for example, the proportion C of the selected peer nodes in each round is added. After the training initialization is finished, the peer node responds to the training.
The local training phase of the system training process comprises:
1) Randomly selecting each round of nodes participating in training from the peer node cluster according to the proportion C in the local iteration strategy on the block chain;
2) The selected participants download local optimization strategies from the block chain, the local optimization strategies comprise optimization methods, local iteration times and local learning rates, then local data are trained according to the local optimization strategies, model parameters obtained through threshold variant encryption of a Paillier algorithm are used, and ciphertext is sent to any agent node.
The two-stage aggregation stage of the system training process comprises:
1) In the prepolymerization stage, a Federal averaging algorithm (FedAvg) is adopted, namely the polymerization weight is positively correlated with the local sample number of the participants, so that a prepolymerization global model is obtained;
2) In the formal aggregation stage, the aggregation weight is divided into two parts, the first part is positively correlated with the local sample number of the participating party, the second part is negatively correlated with the Euclidean distance between the global model ciphertext in the prepolymerization stage and each local model ciphertext, and the two parts are combined for weighting together.
After the aggregation model is obtained, the agent nodes execute combined decryption, and according to the characteristics of the threshold Paillier variant method, the number of the agent nodes for combined decryption can successfully recover the decryption key only when exceeding the threshold value; and packaging the decrypted global model into a transaction, performing raft consensus in the agent node, and adding the transaction block with successful consensus to the tail end of the block chain.
The global detection stage of the system training process comprises:
1) The agent node needs to detect the global model generated in each round, and if the model updating condition recorded on the chain is met, the global training is finished; and adding a mark of training completion after the newly generated transaction block is added to the end of the block chain by the agent node, and recording the version number of the new electricity stealing detection model as an initial model of the next training.
2) And if the model updating condition is not met, returning to the local training step until the detection result of the current global model performance meets the model updating condition.
In the electricity stealing detection process of the system, the system receives an electricity stealing detection request submitted by a client, wherein the electricity stealing detection request comprises electricity consumption data records of a certain user or a batch of users within a period of time; and the agent node collects the detection request of the client and detects by using the current latest version of the electricity stealing detection model, and the agent node returns the detection result to the client.
By executing the method, the data islands of all power companies can be broken through, the safety of the training process is guaranteed while data are widely collected for federal training, and sustainable iteration and updating of the power stealing detection model of the user can be realized.
The symbols and definitions used in this application are as follows: the peer node is denoted as PiNumber of data set samples it owns
Figure BDA0003708553150000051
The proportion of the peer nodes selected in each round is C; the proxy node is denoted priTotal number of proxy nodes is nrThe number of honest and stable proxy nodes is t. E is the local iteration frequency, and eta is the local learning rate; threshold value k = n required for decryptionr-t +1; in round I, the global model is Gwl,PiThe local model of
Figure BDA0003708553150000052
Aggregation weight based on number of samples is wsThe weight based on the actual performance of the model is wp. In the encryption algorithm, the public key is pk, and the private key is pk
Figure BDA0003708553150000053
The prior art is referred to in the art for techniques not mentioned in the present invention.
According to the user electricity stealing behavior detection method and system model based on alliance chain and federal learning, all participants can participate in the training of the detection model under the condition that data is not available locally, so that a model with performance superior to local independent training can be obtained, and the privacy of local data can be considered; meanwhile, the alliance chain can screen the access of the nodes to a certain degree and serve as a non-falsifiable record book of the model; furthermore, in order to prevent an adversary from predicting sensitive information in a sample through local model updating, the local models submitted by all participants are encrypted, and a threshold cryptographic algorithm is designed to prevent malicious behaviors such as agent node disconnection, collusion and the like; the two-stage model aggregation algorithm can also better evaluate the performance of each local model to match with the corresponding weight, so that the influence of the poor local model on the global model training process is avoided.
Drawings
FIG. 1 is a schematic diagram of a user electricity stealing behavior detection system model based on alliance chain and federal learning;
FIG. 2 is a flow chart of the user electricity stealing behavior detection method based on alliance chain and federal learning;
FIG. 3 is an alternative federated learning model (CNN) embodiment employed in the simulation of the present invention;
FIG. 4 is a comparison of the FedAvg experiment of the invention with the baseline method;
Detailed Description
In order to better understand the present invention, the following examples are further provided to illustrate the present invention, but the present invention is not limited to the following examples.
It should be noted that the terms "first" and "second" in the description of the present invention are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
A user electricity stealing behavior detection method based on alliance chain and federal learning uses a federal learning system as shown in figure 1, each participant and agent node participating in federal training are different nodes of the same alliance chain,
the embodiment of the invention provides a user electricity stealing behavior detection system based on a federation chain and federation learning, as shown in fig. 1, each participant participating in federation training is different nodes of the same federation chain, a server end in a traditional federation learning system is replaced by an intelligent contract in the federation chain, and entities in a system model comprise:
a peer node: a first entity with actual power utilization data is used as a training entity to participate in horizontal federal training, and has the authority of reading data on a chain in a block chain; after downloading the global model from the agent node in each round, performing iterative training by using local data, encrypting the trained local model parameters by using a threshold Paillier algorithm, sending the encrypted ciphertext to any agent node, and repeating the iteration in such a way until the global model meets the model updating condition;
the proxy node: the second entity collects the model update ciphertexts submitted by each peer node, performs combined decryption and executes the model cipher text aggregation process;
organizing: and the third entity organizes the first entity to participate in the training of the system model and is responsible for the admission of the peer node in the block chain. The second entity must be co-authorized by the organization in the system; a key management mechanism: the fourth entity is responsible for generating and issuing a key pair required by a cryptographic algorithm;
the global model structure and the local iteration strategy generated by system initialization are written into the founding block, the subsequent iteration round training initialization only needs to add the local iteration strategy, a key management mechanism generates a key pair required by a subsequent cryptographic algorithm, and public and private keys are respectively issued; selecting a peer node with a certain proportion (a participant proportion set in a local iteration strategy) for local training in each round, updating a new round of local model by the selected node according to the downloaded current global model and a local data set, encrypting by using a distributed public key and transmitting to an agent node; the agent nodes call the intelligent contract to successively execute a two-stage aggregation algorithm and a decryption algorithm to obtain a global model of the current round, wherein the decryption key needs to be recovered by providing a private key share by the agent nodes exceeding a threshold; repeating the steps from local training to global aggregation until the obtained global model meets the model updating condition, finishing training, and recording the global model mark of the new version into the block chain; when the detection task is executed, the client submits the electricity utilization data records of the user in a period of time to the system as the input of the electricity stealing detection model, the agent node performs electricity stealing detection by using the current latest version of the model, and the result of whether the model is the electricity stealing user or not is output to the client.
In an alternative embodiment, the first entity and the second entity serve as main undertakers of a horizontal federal training task in a model training stage, and serve as a peer node and a super node in a federation chain respectively, and have read authority and read-write authority respectively. The second entity performs a consensus algorithm in the block chain.
In an alternative embodiment, the third entity is responsible for giving admission rights to the system of first entities and jointly authorises the second entity.
In an alternative embodiment, the fourth entity is responsible for performing cryptographic algorithm initialization in the system based on Paillier's threshold variant algorithm, successful system model training process required public and private key pair, where the private key is split into equal shares as the number of agent nodes. The key management authority broadcasts the public key to all peer nodes and distributes the private key share to each agent node.
In an alternative embodiment, the system comprises a model training process and a power stealing detection process, which are not conflicting with each other.
In an alternative embodiment, the system first begins the model training process, and the global model structure and local iteration strategy are written to the founder block during the initialization phase of the system described above. And restarting the federal training initialization once the current version of the electricity stealing detection model cannot meet the detection requirement or the detection success rate is reduced. In the subsequent training initialization stage, the model of the previous version is used as an initial model, and then a local iteration strategy is added, such as the selected peer node participation ratio C of each round, an optimization method, the local iteration times and the like. After the training initialization is finished, the peer node responds to the training.
In an optional embodiment, the local training randomly selects each round of nodes participating in training from the peer node cluster according to the proportion C in the local iteration strategy on the block chain. The selected participants download local optimization strategies from the block chain, the local optimization strategies comprise optimization methods, local iteration times and local learning rates, local data are trained according to the local optimization strategies, and a new round of local model parameters are obtained through multiple iterations. The Peer node encrypts the obtained model parameters through the threshold variant of the Paillier algorithm, and the ciphertext is sent to any proxy node.
In an alternative embodiment, the two-stage polymerization of the system training process includes a pre-polymerization stage and a formal polymerization stage: in the prepolymerization stage, a Federal averaging algorithm (FedAvg) is adopted, namely the polymerization weight is positively correlated with the local sample number of the participants, so that a prepolymerization global model is obtained; in the formal aggregation stage, the aggregation weight is divided into two parts, the first part is positively correlated with the local sample number of the participating party, the second part is negatively correlated with the Euclidean distance between the global model ciphertext in the prepolymerization stage and each local model ciphertext, and the two parts are weighted together in equal proportion.
After a formally aggregated global model ciphertext is obtained, the proxy node submits the summarized private key shares to carry out combined decryption, and according to the necessary condition of a threshold Paillier variant decryption algorithm, the number of the collected private key shares can be successfully recovered only if the number exceeds a threshold value;
and packaging the decrypted global model into a transaction, performing raft consensus in the proxy node, and adding the transaction block successfully agreed to the tail end of the block chain for the next round of participant to read.
In an optional embodiment, the agent node needs to detect the global model generated in each round, and if the model update condition recorded on the chain is met, the global training is finished; and adding a training end mark after the newly generated transaction block is added to the end of the block chain by the agency node, and recording the version number of the new electricity stealing detection model as a final model of the current training.
And if the model updating condition is not met, returning to the local training step until the detection result of the current global model performance meets the model updating condition.
In an optional embodiment, in the electricity stealing detection process of the system, the system receives an electricity stealing detection request submitted by a client, wherein the electricity stealing detection request comprises electricity consumption data records of a certain user or a batch of users within a period of time; and collecting the detection request of the client by the proxy node, detecting by using the current latest version electricity stealing detection model, and returning the detection result to the client by the proxy node.
As shown in fig. 2, the method for detecting electricity stealing behavior of a user based on alliance chain and federal learning comprises the following steps:
step S1: each participant enters the system as a federation chain peer node by submitting a legal identity credential approved by the organization.
In an optional embodiment, based on an admission mechanism of a federation chain, each peer node joining the system for the first time needs to submit its own identity credential to register as a legal node in the blockchain, and this credential needs to be prepared by peer nodes organized to meet conditions to participate in training, which will reduce the possibility of a malicious adversary joining the system to some extent. If a new organization needs to join the system, the certificate chain of the whole organization and the identity certificate of each peer node carried by the certificate chain need to be provided for the system.
In an optional embodiment, after each peer node is added into the system, the peer nodes are used as training entities to participate in horizontal federal training, the peer nodes have a large amount of user electricity utilization data, a local model can be trained and uploaded, and any party cannot acquire specific data sample information of other parties; they are subordinate to their organization in the blockchain and can only read data on the blockchain without accounting rights. After downloading the global model from the agent node in each round, performing iterative training by using local data, encrypting the trained local model parameters by using a threshold Paillier algorithm, sending the encrypted ciphertext to any agent node, and repeating the iteration in such a way until the global model meets the convergence condition.
In an optional embodiment, only the peer node in the federation chain needs to register with the system through the identity certificate, the proxy node is used as a super node in the federation chain and has writing authority, the nodes selected by various organizations to be commonly authorized act as the super node, and the consensus mechanism of the block chain is executed and has the authority of accounting on the chain. The proxy node is not completely reliable, and threats such as disconnection and collusion can exist.
In an alternative embodiment, the organization in the system does not perform a specific federal learning task, but as an area dividing unit in a alliance chain, the organization is responsible for enabling peer nodes in the area where the organization is located to participate in the training of the electricity stealing detection model and granting admission certificates participating in the system. Once the peer node in the jurisdiction area has dishonest behaviors such as 'taking a free car', etc., the peer node can take responsibility.
Step S2: writing parameter information such as an initial global model into a creating block, and responding and training by each participant;
in an alternative embodiment, the final global model may be used as the initial model for the last time each training since the entire electricity stealing detection model may need to be updated continuously. Before the first training of the system, the initialized global model Gw0The termination condition, the local iteration times E, the participant proportion C of each round, the participant ID set of the first round participating in training and the like are used as a first initial transaction write creation block. The ID of the participant participating in the training for the first time is generated by calling a random selection algorithm by the agent node according to the participation ratio C of the participant.
In an alternative embodiment, in the initialization stage of the subsequent power stealing detection model updating, the final model of the previous version can be directly used as the initial global model for the new round of training, so that only training parameters such as model updating conditions need to be provided and packed into a new block.
In an optional embodiment, when a participant joins the training, the participant needs to call a party _ confirm () function in the intelligent contract to submit the identity, the number of local users and the total number of samples participating in the training
Figure BDA0003708553150000095
Etc., and signs as confirmation of participation in the training. Data back submitted by peer nodes of each organizationA book.
And step S3: a key management mechanism generates and distributes a threshold homomorphic key pair;
in this embodiment, the key management entity needs to execute a key generation algorithm of Paillier's threshold variant algorithm, and immediately goes offline after issuing the key pair.
In this embodiment, the key management entity generates a public and private key required by the homomorphic encryption algorithm, broadcasts the public key to all peer nodes, and sets the number of the proxy nodes in the system to nrIf so, the private key is split into shares
Figure BDA0003708553150000091
And distributing the data to the agent nodes. Assume that the minimum honesty that the system can tolerate and the number of stable proxy nodes is t. The decryption threshold is k = nr-t+1。
And step S4: the selected participants download the global model, iterate through a local optimization strategy, and send the ciphertext to the proxy node after encryption;
in this embodiment, in the first round, the chosen participant PiDownloading a global model of a current wheel from a block chain, training according to a local data set, and assuming that a random gradient descent algorithm is adopted in a local optimization strategy to make a loss function Fi(w), if the local iteration is performed E times, the local iteration process can be expressed as
Figure BDA0003708553150000092
Wherein
Figure BDA0003708553150000093
η is the local learning rate.
After E iterations, the model parameters of the round are obtained
Figure BDA0003708553150000094
PiAnd calling a threshold variant of the Paillier algorithm by using a public key pk issued by a key management mechanism to encrypt the obtained local model update:
Figure BDA0003708553150000101
the encrypted ciphertext is sent to any proxy node pri
In an alternative embodiment, the participants employ a threshold variant algorithm of the Paillier algorithm when encrypting local model updates, wherein,
KeyGen()→{n,si|i∈{1,2,…nris to select an integer n satisfying n = pq, m = p 'q', wherein p and q satisfy p =2p '+1, q =2q' +1. The plaintext space is Zn. D =0mod m and d =1modn are selected. Selecting a from {0, … n x m-1}iStructural polynomial
Figure BDA0003708553150000102
a0And = d, wherein 0 < i < k, k being the decryption threshold value. If there are l' decryption entities, the share of the private key of the ith entity is si= f (i), public key n, g, where g =1+n
Encrypt(m)→c=gMrnmodn2Random selection of
Figure BDA0003708553150000103
And encrypting to obtain a ciphertext of the plaintext M.
Figure BDA0003708553150000104
Each decryption entity calculates a decryption share from the ciphertext
Figure BDA0003708553150000105
Wherein Δ = l'! If more than k decryption shares are collected, making the set of decryption shares S, then it can be calculated
Figure BDA0003708553150000106
Wherein
Figure BDA0003708553150000107
Derived from the secret sharing algorithm:
Figure BDA0003708553150000108
so if a function is set
Figure BDA0003708553150000109
Then:
Figure BDA00037085531500001010
wherein
Figure BDA00037085531500001011
The homomorphism possessed by the algorithm is proved as follows, and a plaintext m is set1,m2
Figure BDA0003708553150000111
Step S5: and jointly recovering the decryption key by the agent node clusters meeting the threshold value, calling an intelligent contract to execute two-stage aggregation, and performing uplink after the results are identified.
In this embodiment, after each agent node collects the model update ciphertext, it reports the model update number received by itself to other agent nodes, and queries the sample number of the local data set owned by the agent node on the chain according to the uploaded peer node ID, and then combines all online agent common signatures to invoke Two _ stage _ Aggr () of the intelligent contract to perform model aggregation.
In an alternative embodiment, a two-stage aggregation algorithm is performed:
in the pre-polymerization stage, the weights of all the participants in the polymerization are weighted according to the local sample number
Figure BDA0003708553150000112
Wherein n ispThe set of participant IDs selected for this round.
Figure BDA0003708553150000113
Local samples submitted for each participantThe participator with more samples is considered to have higher possibility to train out a better model, and the sample weight is set
Figure BDA0003708553150000114
The algorithm of the aggregation is
Figure BDA0003708553150000115
In the formal polymerization stage, in order to screen out malicious participants or incompletely trained participants, the weight of each participant during polymerization is divided into two parts, wherein the first part is the same as the prepolymerization stage, and the weights are weighted according to the number of local samples capable of estimating the model performance. The second part calculates the Euclidean distance between each model ciphertext and the pre-polymerized model ciphertext according to the weighting of the actual performance of the model
Figure BDA0003708553150000116
On the premise that most of the system is honest nodes, it can be considered that the participants farther away from the pre-polymerization model have a high possibility of being malicious participants or incompletely trained participants, which may negatively affect the training process of the global model. Therefore, the reciprocal of the distance is used as the weighting basis of the second part of the weight
Figure BDA0003708553150000117
The total weight is
Figure BDA0003708553150000118
The final aggregation algorithm is therefore:
Figure BDA0003708553150000119
in this embodiment, each proxy node needs to jointly invoke a decryption contract to decrypt the obtained global model ciphertext, and invoking the contract needs to set at least k = nrT +1 private key shares of the proxy node, so that the proxy node pr can recover the decryption keyiAccording to the private key share skiThe decrypted share is computed and used as input to the contract. The decryption contract performs the Decrypt () function of the threshold variant of the Paillier algorithm to solve the plaintext of the global model.
In an optional embodiment, the officially aggregated global model adopts a Raft mechanism to perform consensus confirmation among the proxy nodes, wherein the Raft consensus is a consensus algorithm which is more suitable for a federation chain. Nodes participating in consensus have three states, namely leader, follower and candidate. To achieve synchronization in a distributed system, the raft consensus segments the time in "tenure", with one leader in a tenure, responsible for accounting in that time period. The Raft consensus accounting process applied in the block chain system includes the following processes:
(1) leader election: when a follower finds that an expiration period is up, the follower is considered to be invalid, the state of the follower can be converted into candidate, voting is carried out on the follower, and if the support of more than half of nodes is obtained, the election is successfully carried out to form the follower; otherwise, election fails.
(2) And (4) consensus accounting: the leader writes the received command into a local log, and synchronizes the log to all the folders at the moment when the command state is unconmited; by the time all nodes write the command to the log, the leader submits the command and returns the result. After other nodes receive the command, the state machine executes the command, and all node logs are kept consistent.
In this embodiment, after the global model after each round of formal aggregation is written into the blockchain, the agent node needs to check the model against the model update conditions recorded on the chain.
If the model updating condition is satisfied after the verification is completed, executing the following steps:
step S6: after the model updating global iteration meets the conditions, the global training is finished, and the electricity stealing detection model is updated.
In this embodiment, if the model update condition is satisfied, the global training is ended; after adding the transaction block to the end of the blockchain, the agent node needs to add a mark of training completion and add a new power stealing detection model version to the mark.
In this embodiment, if the model update condition is not satisfied, the proxy node further needs to invoke the random selection algorithm in step S2 to reselect the ID of the next round of participants according to the participant ratio C. And then repeating the steps S4-S5 until the model updating condition is met.
Step S7: the client submits the electricity consumption data record of the user in a period of time as the input of the electricity stealing detection model, and the model outputs whether the electricity stealing detection model is an electricity stealing user.
In the embodiment, the latest version of the model in the current system is used for detecting the electricity stealing behavior. As the input of the electricity stealing detection model, the client submits an electricity stealing detection request to the system, can select to submit the electricity consumption data records of a certain user within a period of time, and can also input the electricity consumption data of a batch of users in batch. The agent node collects the detection request of the client and detects by using the model of the current latest version, the model outputs whether the client is a power stealing user, and the agent node returns the detection result to the client.
In the user electricity stealing behavior detection method and system based on alliance chain and federal learning, provided by the invention, each participant can participate in the training of the detection model under the condition that data is not available locally, so that a model with performance superior to local single training can be obtained, and the privacy of local data can be considered. Meanwhile, the federation chain can screen the admission of the nodes to a certain extent and serve as a non-falsifiable record ledger of the model. Furthermore, in order to prevent an adversary from predicting sensitive information in a sample through local model updating, the local models submitted by each participant are encrypted, and a threshold cryptographic algorithm is designed to prevent malicious behaviors such as agent node disconnection, collusion and the like. The two-stage model aggregation algorithm can also better evaluate the performance of each local model to match with the corresponding weight, so that the influence of the poor local model on the global model training process is avoided.
Application example
The implementation adopts the application scenario of detecting the electricity stealing behavior of the user based on the alliance chain and the federal learning shown in fig. 1, wherein 500 peer nodes are set in an alliance chain system and compiledNumber { P1,P2,...,P 50010 proxy nodes, i.e. nrNumber of { Pr =101,Pr2,...,Pr10Let us assume that the system can tolerate the minimum honest and the number of stable proxy nodes is t = nr/2=5, then the decryption threshold is k = nr-t +1=6. The example shows the training process of the whole electricity stealing detection model, and the training process comprises the steps that after each peer node is locally trained, the local model is encrypted and then sent to the agent node, and the agent node aggregates the models according to a two-stage aggregation algorithm and then records the aggregated models on a block chain.
The security parameter in the system is set to 128, i.e. the choice of the large prime number will choose 0-2128The number of bits. The key management organization randomly generates two large prime numbers at first in the key generation stage:
p′=40381822629508445329194325876161708563
q′=79352408235426049959432545381794026419
then, calculating:
p=2p′+1=80763645259016890658388651752323417127
q=2q′+1=158704816470852099918865090763588052839
n=pq=12817579498349279940142085707121137292846181805728973273359499808188713573553
g=n+1=12817579498349279940142085707121137292846181805728973273359499808188713573554
m=p′q′=3204394874587319985035521426780284323151678335999776070695561516418200525897
to satisfy d =0mod m and d =1modn, let Ω = mn according to the Chinese remainder theorem, then
Figure BDA0003708553150000141
Wherein e1m≡1modm,e2n ≡ 1modn, so it is necessary to first find the multiplicative inverse of m under modulo n
e2=5977363971036351473180424920716591231307266244063897728080167121948391334922, which is then multiplied by m to yield d.
d=19153834472331794446342636971405433717619144009556340207690497801710872918643788689314864712418170761084059330217484543750900261794076249309538261475034
Then, private key shares of 10 agent nodes are calculated, and a is selected from {0, … n multiplied by m-1}iWherein a is0= d, random numbers chosen are shown in table 1. Thereby constructing a polynomial
Figure BDA0003708553150000142
Wherein 0 < i < 6, k =6 is the decryption threshold value.
Private key share of the 1 st proxy node is
Figure BDA0003708553150000143
Private key share of 2 nd proxy node is
Figure BDA0003708553150000144
By analogy, the private key shares of all proxy nodes are shown in table 1:
table 1: basic parameter setting of key generation phase
Figure BDA0003708553150000145
Figure BDA0003708553150000151
Figure BDA0003708553150000161
And ending the key generation part of the key management mechanism, distributing the private key share to the agent node, distributing the public key to all peer nodes, and then taking the key management mechanism off line.
Assuming that the global model of system initialization is a simple convolutional neural network CNN, the network structure is shown in fig. 3, where an Adam optimizer is used for both the optimizer at the server side and the optimizer at the client side, where learning _ rate =0.001, and β is used for the optimizer at the client side1=0.9,β2=0.999,ε=10-7The proportion of clients selected in each round is 20%, each round of clients iterates locally 3 times, and the batch size is 32.
To simulate the learning effect of the proposed model, the test was performed using the federal version of the mnist dataset, which contains 10 types of handwritten digit recognition from 0 to 9, and a common training set/test set 341873/40832, which contains 3383 clients, each of which contains different sample sizes, where we only take 47981 samples in total from 500 of the training sets of the clients and all the test sets. Each participant trains according to the local sample according to the global model issued in each round, submits the model ciphertext to the server, and in order to describe the specific embodiment of the threshold Paillier algorithm, an integer is taken as a plaintext, and the processes of complete encryption and shared decryption are as follows:
to simplify our description, we set plaintext M =6, choose random number r =101960347371885113110184269182448853610901741345978585331634093808881646486067518415372985634215497110082422270547678345388931251516201211042381948980481, encrypt:
c=gMrnmodn2=16528152545340870770429405359833445371177443845098765007198974137821257489743712629717094782491383462635261741277562585112234290199582516286715080925467
during decryption, let us assume that there are exactly k =6 proxy nodes (holding s)1,…,s6) Participate in decryption, each proxy node needs to compute a decryption share
Figure BDA0003708553150000162
Wherein Δ = nr!=10!=3628800:
The first proxy node:
Figure BDA0003708553150000163
by analogy, the decryption shares of all proxy nodes are shown in table 2:
table 2: calculation parameters of decryption stage
Figure BDA0003708553150000171
Jointly decrypt all decrypted shares
Figure BDA0003708553150000172
Wherein
Figure BDA0003708553150000173
Figure BDA0003708553150000174
Can be solved to obtain
Figure BDA0003708553150000175
To detect the homomorphism of the algorithm, we further processed the plaintext m1=2,m2=3, and the ciphertext obtained is
c1=72398289451786246873548974563049369275674864655032764741387270887706172510620576154118858935541962081564646988846259513155400234985222470585299685827373
c2=72107121812442184759626961110251146656102345188190211667954065780165677880418586846817157606163220695474215687776134086481280111347592798163349456853740
c1×c2=5220432276512399024515941325193760886448636890264413177773543111062891183229311845203613043265887592014238049874800155494841639413607883321214166957088599332894761714596067614967075286905364599242002182568332690304630330019623738020162771521340062744123917153689600710957874969029063374020043237349425020
D (c) is obtained by decryption1×c2)=5=m1+m2
The server adopts a two-stage aggregation algorithm to aggregate local models of the clients, compares a baseline algorithm (a federal average algorithm) with the method provided by the invention to show the advancement of the method, and tests the accuracy of the global model in 100 rounds, as shown in fig. 4, it can be seen that the method can avoid the problem of uneven distribution of the client data to a certain extent, thereby improving the accuracy of the global model.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Finally, it should be noted that: although the present invention has been described in detail with reference to the above embodiments, it should be understood by those skilled in the art that: modifications and equivalents may be made to the embodiments of the invention without departing from the spirit and scope of the invention, which is to be covered by the claims.

Claims (16)

1. A user electricity stealing behavior detection method based on a federation chain and federation learning is characterized in that each participant and agent node participating in federation training are different nodes of the same federation chain, and comprises the following steps:
1) Each participant as a coalition chain peer node enters the system by submitting a legal identity certificate approved by an organization;
2) Writing initial global model parameter information into a creating block, and responding and training by each participant;
3) A key management mechanism generates and distributes a threshold homomorphic key pair;
4) The selected participants download the global model, iterate through a local optimization strategy, and send the ciphertext to the proxy node after encryption;
5) The agent node clusters meeting the threshold value jointly recover the decryption key, and transfer the intelligent contract to execute two-stage aggregation, and the result is subjected to cochain after being identified;
6) After the model updating global iteration meets the conditions, the global training is finished, and the electricity stealing detection model is updated;
7) The client submits the electricity utilization data record of the user in a period of time as the input of the electricity stealing detection model, and the electricity stealing detection model outputs whether the electricity stealing detection model is an electricity stealing user.
2. The method for detecting electricity stealing behavior of users based on alliance chain and federal learning as claimed in claim 1, wherein in step 6), if the performance of the current global model is detected and the model updating condition is not satisfied, the method returns to the local training step of step 4) until the result of the detection of the performance of the current global model satisfies the model updating condition.
3. The federation chain and federation learning-based user electricity stealing behavior detection method according to claim 1 or 2, wherein in step 1), the agent node is used as a super node in the federation chain and has writing authority, nodes selected by various organizations for common authorization act as the super node, and a consensus mechanism of the block chain is executed and has the authority of billing on the chain.
4. The method for detecting the electricity stealing behavior of the users based on alliance chain and federal learning as claimed in claim 1 or 2, wherein in the step 2), in the system initialization phase, the initial global model parameter information is written into the creature block as the first transaction information; and in the subsequent initialization stage of the update of the electricity stealing detection model, the final model of the previous version is used as an initial global model for a new round of version training, the training parameters of the model updating conditions are packed into a new block, and all the participants respond to the training.
5. The alliance chain and federal learning based user electricity stealing behavior detection method according to claim 1 or 2, wherein in step 3), the key pair generated by the key management authority is generated based on a Paillier threshold variant algorithm, and the key management authority broadcasts the public key to all peer nodes and distributes the private key share to each agent node.
6. A federation chain and federal learning-based user electricity stealing behavior detection method according to claim 1 or 2, wherein step 4) comprises:
4.1 Each round randomly selects participants from the peer node cluster according to a fixed proportion C;
4.2 Local optimization strategies in local training, including optimization methods, local iteration times and local learning rates, together with an initial global model, are downloaded from a blockchain;
4.3 The peer node obtains local model update after training a local data set according to a local optimization strategy, and encrypts the local model update by using a public key issued by a key management mechanism and adopting a threshold variant of a Paillier algorithm;
4.4 Encrypted ciphertext is sent to any proxy node.
7. The alliance-chain and federal-learning-based user electricity stealing behavior detection method according to claim 1 or 2, wherein in step 5), the two-stage aggregation comprises, in a pre-aggregation stage, weighting by the number of local samples of each participant, to obtain a pre-aggregation global model; in the formal aggregation stage, the weight is divided into two parts, the first part is weighted according to the local sample number of the participants, and the second part is weighted according to the Euclidean distance between the global model ciphertext and each local model ciphertext in the prepolymerization stage; setting a threshold value on the basis of the assumed honest and stable node number in the system by combining a threshold Paillier variant method, and recovering a decryption key when the share number of the collected private keys exceeds the threshold value; and the agent node packages the decrypted global model, performs raft consensus in the agent node, and adds the transaction block successfully subjected to consensus to the tail end of the block chain.
8. The user electricity stealing behavior detection method based on alliance chain and federal learning according to claim 1 or 2, wherein in step 6), after each round of global model generation, the agent node needs to check the model against the model updating conditions recorded on the chain, if the model updating conditions are met, the global training is finished; and after adding the transaction block to the end of the blockchain, the agent node adds a mark of training completion and adds a new power stealing detection model version to the mark as an initial model for the next training.
9. The alliance chain and federal learning-based user electricity stealing behavior detection method according to claim 1 or 2, wherein, as an input of the electricity stealing detection model in step 7), the client submits an electricity stealing detection request to the system, submits an electricity consumption data record of a certain user for a period of time, or inputs electricity consumption data of a batch of users in batch; the agent node collects the detection request of the client and detects the client by using the electricity stealing detection model, the electricity stealing detection model outputs whether the client is an electricity stealing user or not, and the agent node returns the detection result to the client.
10. A user electricity stealing behavior detection system based on alliance chain and federal learning is characterized by comprising:
a peer node: the first entity participates in horizontal federal training as a training entity and has the authority of reading data on a chain in a block chain; after downloading the global model from the agent node in each round, performing iterative training by using local data, encrypting the trained local model parameters by using a threshold Paillier algorithm, sending the encrypted ciphertext to any agent node, and repeating the iteration in such a way until the global model meets the model updating condition;
the proxy node: the second entity collects the model update ciphertexts submitted by each peer node, performs combined decryption and executes the model cipher text aggregation process;
organizing: the third entity organizes the first entity to participate in the training of the system model and is responsible for the admission of the peer node in the block chain, and the second entity needs to be jointly authorized through organization in the system;
a key management mechanism: the fourth entity is responsible for generating and issuing a key pair required by a cryptographic algorithm;
the global model structure and the local iteration strategy generated by system initialization are written into the founding block, the subsequent iteration round training initialization only needs to add the local iteration strategy, a key management mechanism generates a key pair required by a subsequent cryptographic algorithm, and public and private keys are respectively issued; selecting a peer node of a participant proportion set in a local iteration strategy for local training in each round, obtaining a new round of local model update by the selected node according to the downloaded current global model and a local data set, encrypting by using a distributed public key and transmitting to an agent node; the agent nodes call the intelligent contract to successively execute a two-stage aggregation algorithm and a decryption algorithm to obtain a global model of the current round, wherein the decryption key needs to be recovered by providing a private key share by the agent nodes exceeding a threshold; repeating the steps from local training to global aggregation until the obtained global model meets the model updating condition, finishing training, and recording the global model mark of the new version into the block chain; when the detection task is executed, the client submits the electricity utilization data records of the user in a period of time to the system as the input of the electricity stealing detection model, the agent node performs electricity stealing detection by using the current latest version of the model, and the result of whether the model is the electricity stealing user or not is output to the client.
11. The alliance chain and federal learning based user electricity stealing behavior detection system as in claim 10, wherein the system comprises a model training process and an electricity stealing detection process, both processes being non-conflicting; the first entity and the second entity have a reading authority and a reading-writing authority respectively, and the second entity executes a consensus algorithm in the block chain; and the fourth entity is responsible for initializing the cryptographic algorithm in the Paillier-based threshold variant algorithm execution system, and the key management mechanism broadcasts the public key to all peer nodes and distributes the private key share to each agent node.
12. The alliance chain and federal learning based user electricity stealing behavior detection system as claimed in claim 10 or 11, wherein in the system initialization phase, the global model structure and the local iteration strategy are written into the creation block, and when the subsequent electricity stealing detection model is updated, the above version model is used as the initial model, and then the local iteration strategy is added.
13. Federation chain and federal learning based user steal behavior detection system as claimed in claim 10 or 11, wherein local training comprises:
a. randomly selecting each round of nodes participating in training from the peer node cluster according to the proportion C in the local iteration strategy on the block chain;
b. the selected participants download local optimization strategies from the block chain, the local optimization strategies comprise optimization methods, local iteration times and local learning rates, then local data are trained according to the local optimization strategies, model parameters obtained through threshold variant encryption of a Paillier algorithm are used, and ciphertext is sent to any agent node.
14. A federation chain and federal learning-based user electricity stealing behavior detection system as claimed in claim 10 or 11, wherein the two-stage aggregation algorithm comprises,
a. in the prepolymerization stage, a federal average algorithm is adopted, and the polymerization weight is positively correlated with the number of local samples of the participants to obtain a prepolymerization global model;
b. in the formal aggregation stage, the aggregation weight is divided into two parts, the first part is positively correlated with the local sample number of the participant, the second part is negatively correlated with the Euclidean distance between the global model cryptograph and each local model cryptograph in the prepolymerization stage, and the two parts are combined for weighting together.
15. The user electricity stealing behavior detection system based on alliance chain and federal learning according to claim 14, wherein after obtaining the aggregation model, the agent nodes perform joint decryption, and according to the characteristics of a threshold Paillier variant method, the number of the agent nodes for joint decryption can successfully recover the decryption key only if exceeding a threshold value; and packaging the decrypted global model into a transaction, performing raft consensus in the agent node, and adding the transaction block with successful consensus to the tail end of the block chain.
16. The system for detecting the electricity stealing behavior of the users based on the alliance chain and federal learning as claimed in claim 10 or 11, wherein the agent node needs to detect the global model generated in each round, and if the model updating condition recorded on the chain is met, the global training is finished; adding a training end mark after the newly generated transaction block is added to the end of the block chain by the agent node, and recording the version number of a new electricity stealing detection model as an initial model for the next training;
and if the model updating condition is not met, returning to the local training step until the detection result of the performance of the current global model meets the model updating condition.
CN202210712406.7A 2022-06-22 2022-06-22 User electricity stealing behavior detection method and system based on alliance chain and federal learning Pending CN115270145A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210712406.7A CN115270145A (en) 2022-06-22 2022-06-22 User electricity stealing behavior detection method and system based on alliance chain and federal learning

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210712406.7A CN115270145A (en) 2022-06-22 2022-06-22 User electricity stealing behavior detection method and system based on alliance chain and federal learning

Publications (1)

Publication Number Publication Date
CN115270145A true CN115270145A (en) 2022-11-01

Family

ID=83761659

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210712406.7A Pending CN115270145A (en) 2022-06-22 2022-06-22 User electricity stealing behavior detection method and system based on alliance chain and federal learning

Country Status (1)

Country Link
CN (1) CN115270145A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115766295A (en) * 2023-01-05 2023-03-07 成都墨甲信息科技有限公司 Industrial internet data secure transmission method, device, equipment and medium
CN116151370A (en) * 2023-04-24 2023-05-23 西南石油大学 Model parameter optimization selection system
CN117395279A (en) * 2023-10-18 2024-01-12 广州北星科技有限公司 Building intelligent energy management system based on Internet of things
CN117811722A (en) * 2024-03-01 2024-04-02 山东云海国创云计算装备产业创新中心有限公司 Global parameter model construction method, secret key generation method, device and server

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115766295A (en) * 2023-01-05 2023-03-07 成都墨甲信息科技有限公司 Industrial internet data secure transmission method, device, equipment and medium
CN116151370A (en) * 2023-04-24 2023-05-23 西南石油大学 Model parameter optimization selection system
CN117395279A (en) * 2023-10-18 2024-01-12 广州北星科技有限公司 Building intelligent energy management system based on Internet of things
CN117395279B (en) * 2023-10-18 2024-03-19 广州北星科技有限公司 Building intelligent energy management system based on Internet of things
CN117811722A (en) * 2024-03-01 2024-04-02 山东云海国创云计算装备产业创新中心有限公司 Global parameter model construction method, secret key generation method, device and server

Similar Documents

Publication Publication Date Title
CN108418680B (en) Block chain key recovery method and medium based on secure multi-party computing technology
CN107682308B (en) Electronic evidence preservation system based on block chain latent channel technology
CN111914027B (en) Block chain transaction keyword searchable encryption method and system
CN110288480B (en) Private transaction method and device for blockchain
CN109145612B (en) Block chain-based cloud data sharing method for preventing data tampering and user collusion
CN115270145A (en) User electricity stealing behavior detection method and system based on alliance chain and federal learning
JP2021512569A (en) Blockchain data processing method, management side, client side, converter and medium
CN112714106B (en) Block chain-based federal learning casual vehicle carrying attack defense method
CN112019591A (en) Cloud data sharing method based on block chain
CN112861172B (en) Symmetric searchable encryption method based on PBFT (public domain representation) consensus mechanism
Sun et al. Permissioned blockchain frame for secure federated learning
CN112383550B (en) Dynamic authority access control method based on privacy protection
Hong et al. A secure peer to peer multiparty transaction scheme based on blockchain
CN115765965A (en) Medical data safety sharing method based on federal learning and double union block chains
Guo et al. Accountable attribute-based data-sharing scheme based on blockchain for vehicular ad hoc network
Hu et al. Privacy-preserving combinatorial auction without an auctioneer
CN111091380A (en) Block chain asset management method based on friend covert verification
Xu et al. Trusted and flexible electronic certificate catalog sharing system based on consortium blockchain
CN113554421A (en) Police affair resource data governance cooperation method based on block chain
CN110912702B (en) Block chain asset management method based on hidden social relationship
CN116527322A (en) Combined credit investigation method and device based on block chain and privacy calculation
CN114866289B (en) Privacy credit data security protection method based on alliance chain
CN115664682A (en) Consensus method for sharing medical data based on alliance chain master-slave multi-chain
Zhou et al. VDFChain: Secure and verifiable decentralized federated learning via committee-based blockchain
Feng et al. Secure data collaborative computing scheme based on blockchain

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination