Ammeter and collector key control method and device based on block chain
By combining symmetric and asymmetric encryption in blockchain technology, the problems of data transmission reliability and abnormal data traceability are solved, reliable transmission of data packets and abnormal alarms are achieved, the credibility of the data is improved, and economic losses are avoided. .
Patent Information
- Application Number
- CN202410878555.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-02
- Publication Date
- 2024-09-17
AI Technical Summary
Existing technology fails to effectively solve the reliability problem of data transmission in blockchain technology, especially the data analysis and abnormal data traceability functions, and only using asymmetric encryption results in low data transmission reliability.
Using a combination of symmetric encryption and asymmetric encryption, the encryption key is generated through a pseudo-random password generator, double encryption is performed on the meter and collector data, and smart contracts are used for automatic decryption and data comparison to achieve reliable data packets Transmission and exception alarms.
It improves the reliability of blockchain data transmission and the credibility of data, and can provide timely alarms when data anomalies occur to avoid economic losses.
Smart Images

Figure CN118659869A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of blockchain, and in particular to a method and device for controlling keys of an electric meter and a collector based on blockchain. Background Art
[0002] With the rapid development of technologies such as artificial intelligence and the Internet of Things, the types and numbers of power grid terminals are increasing. In order to ensure data security during transactions at power grid terminals, a preset meter key is usually used to encrypt the data to be transmitted, and then the encrypted power data is transmitted to reduce the risk of power data leakage. This encryption technology can effectively prevent hacker attacks and data tampering, protect user privacy and the safe and stable operation of the power system. At the same time, with the intelligence and interconnection of power grid terminals, the encryption processing of power data will become more complex and sophisticated to meet the growing challenges of network security. By continuously improving encryption algorithms and encryption technologies, the security and reliability of power data transmission can be improved, providing a solid guarantee for the development of smart grids. Based on the above problems, patent CN 113852464A provides a blockchain-based meter key control method and related equipment.
[0003] However, the existing technology only uses blockchain technology to encrypt data transmission and distributed storage, but does not have the function of data analysis and traceability of abnormal data; in addition, the existing technology generally only uses one type of asymmetric encryption, and the data transmission reliability is low. Summary of the invention
[0004] In order to overcome the shortcomings of the prior art, the purpose of the present invention is to provide a blockchain-based electric meter and collector key control method and device, which increases the reliability of blockchain data transmission by introducing symmetric encryption and asymmetric encryption; by comparing the electric meter data and the collector data, the credibility of the data is further increased, and an alarm is issued when the data is abnormal to avoid greater economic losses.
[0005] To achieve the above object, the present invention provides the following solutions:
[0006] A method for controlling keys of electric meters and collectors based on blockchain is applied to electric meter blockchains based on multiple smart meters and collector blockchains based on multiple collectors; the collector is connected to at least one of the smart meters; the method comprises:
[0007] Generate meter encryption code, collector encryption code and service encryption code using a pseudo-random password generator;
[0008] The meter public key of the meter blockchain and the collector public key of the collector blockchain are symmetrically encrypted using the meter encryption code and the collector encryption code respectively to obtain the meter encryption public key and the collector encryption public key;
[0009] Asymmetrically encrypt the meter electrical parameters collected by the smart meter and the collector electrical parameters collected by the collector using the meter key of the meter blockchain and the collector key of the collector blockchain respectively to obtain meter encrypted data and collector encrypted data;
[0010] Using the service encryption code, symmetrically encrypt the meter encryption public key, the meter encryption data, and the basic meter information of the smart meter to obtain a meter data packet;
[0011] Using the service encryption code, symmetrically encrypt the collector encryption public key, the collector encryption data and the basic collector information of the collector to obtain a collector data packet;
[0012] Sending the meter data packet and the collector data packet to a preset server;
[0013] Automatically decrypt the meter data packet and the collector data packet based on a preset smart contract program;
[0014] The electric parameters of the electric meter, the electric parameters of the collector, the basic electric meter information and the basic collector information are stored in a preset storage module;
[0015] Calculating the sum of the electrical parameters of all the smart meters connected to the collector to obtain the total electrical parameters of the meters;
[0016] The difference between the electrical total of the electric meter and the electrical parameter of the collector is calculated, and if the difference exceeds a preset threshold, a power supply alarm is issued.
[0017] Preferably, the meter data packet and the collector data packet are automatically decrypted based on a preset smart contract program, including:
[0018] Using the service encryption code, symmetrically decrypt the meter data packet and the collector data packet to obtain the meter encryption public key, the meter encryption data, the basic meter information, the collector encryption public key, the collector encryption data and the basic collector information;
[0019] The meter encryption code and the collector encryption code are used to symmetrically decrypt the meter encryption public key and the collector encryption public key respectively to obtain the meter public key and the collector public key;
[0020] The meter public key and the collector public key are used to asymmetrically decrypt the meter encrypted data and the collector encrypted data to obtain the meter electrical parameters and the collector electrical parameters.
[0021] Preferably, it also includes:
[0022] When the smart contract completes the decryption of the meter data packet, the server generates a meter data reception completion feedback signal, and uses the server encryption code to symmetrically encrypt the meter data reception completion feedback signal to obtain encrypted feedback meter data;
[0023] Sending the encrypted feedback meter data to the smart meter;
[0024] Symmetrically decrypting the encrypted feedback meter data using the service encryption code to obtain a meter data reception completion feedback signal;
[0025] When the smart contract completes the decryption of the collector data packet, the server generates a collector data reception completion feedback signal, and uses the server encryption code to symmetrically encrypt the collector data reception completion feedback signal to obtain encrypted feedback collector data;
[0026] sending the encrypted feedback collector data to the collector;
[0027] The encrypted feedback collector data is symmetrically decrypted using the service encryption code to obtain the collector data reception completion feedback signal.
[0028] Preferably, the electrical parameters of the electric meter include: electric meter current data, electric meter voltage data, electric meter frequency data, electric meter active power data, electric meter reactive power data, and electric meter apparent power data; the electrical parameters of the collector include: collector current data, collector voltage data, collector frequency data, collector active power data, collector reactive power data, and collector apparent power data.
[0029] Preferably, the basic meter information includes: time, meter ID and meter working status; the basic collector data includes: time, collector ID and collector working status.
[0030] Preferably, the degree of difference includes: current difference, voltage difference, frequency difference, active power difference, reactive power difference and apparent power difference.
[0031] Preferably, both the electricity meter blockchain and the collector blockchain run on the Hyperledger Fabric platform.
[0032] Preferably, a blockchain-based electric meter key control device comprises:
[0033] Communication module; the communication module is used to receive the meter data packet and the collector data packet, and send the meter data reception completion feedback signal and the collector data reception completion feedback signal to the smart meter and the collector respectively;
[0034] Storage module; the storage module is used to record the electrical parameters of the meter and the electrical parameters of the collector;
[0035] Contract module; the contract module is used to execute the smart contract program.
[0036] The present invention discloses the following technical effects:
[0037] The present invention provides a method and device for controlling keys of electric meters and collectors based on blockchain. By introducing symmetric encryption and asymmetric encryption, the problem of secret key transmission in blockchain is solved, and reliable encryption and decryption of secret keys are realized. By comparing and analyzing the data uploaded by the electric meter and collector, the problem of problem monitoring is solved, and timely locking of faults and rapid matching of fault locations are realized. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0039] Figure 1 A key control flow chart provided for an embodiment of the present invention. DETAILED DESCRIPTION
[0040] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0041] The purpose of the present invention is to provide a method and device for controlling the key of an electric meter and a collector based on blockchain, which increases the reliability of blockchain data transmission by introducing symmetric encryption and asymmetric encryption; further increases the credibility of the data by comparing the electric meter data and the collector data, and issues an alarm when the data is abnormal to avoid greater economic losses.
[0042] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0043] Figure 1 The key control flow chart provided by the embodiment of the present invention is as follows: Figure 1 As shown, the present invention provides a blockchain-based electric meter and collector key control method, which is applied to an electric meter blockchain based on multiple smart meters and a collector blockchain based on multiple collectors; the collector is connected to at least one smart meter; the method includes:
[0044] Step 100, using a pseudo-random password generator to generate a meter encryption code, a collector encryption code, and a service encryption code;
[0045] Step 200, symmetrically encrypting the meter public key of the meter blockchain and the collector public key of the collector blockchain using the meter encryption code and the collector encryption code respectively, to obtain the meter encryption public key and the collector encryption public key;
[0046] Step 300, asymmetrically encrypting the meter electrical parameters collected by the smart meter and the collector electrical parameters collected by the collector using the meter key of the meter blockchain and the collector key of the collector blockchain, respectively, to obtain meter encrypted data and collector encrypted data;
[0047] Step 400, using the service encryption code to symmetrically encrypt the meter encryption public key, the meter encryption data and the basic meter information of the smart meter to obtain a meter data packet;
[0048] Step 500, using the service encryption code to symmetrically encrypt the collector encryption public key, the collector encryption data and the basic collector information of the collector to obtain a collector data packet;
[0049] Step 600, sending the meter data packet and the collector data packet to a preset server;
[0050] Step 700, automatically decrypting the meter data packet and the collector data packet based on a preset smart contract program;
[0051] Step 800, storing the electric parameters of the electric meter, the electric parameters of the collector, the basic electric meter information and the basic collector information in a preset storage module;
[0052] Step 900, calculating the sum of the electrical parameters of all smart meters connected to the collector to obtain the total electrical parameters of the meters;
[0053] Step 1000, calculating the difference between the total electrical parameters of the electric meter and the electrical parameters of the collector, and if the difference exceeds a preset threshold, a power supply alarm is issued.
[0054] Specifically, the meter data packet and collector data packet are automatically decrypted based on the preset smart contract program, including:
[0055] Use the service encryption code to symmetrically decrypt the meter data packet and the collector data packet to obtain the meter encryption public key, meter encryption data, basic meter information, collector encryption public key, collector encryption data and basic collector information;
[0056] The meter encryption code and the collector encryption code are used to symmetrically decrypt the meter encryption public key and the collector encryption public key to obtain the meter public key and the collector public key;
[0057] The meter public key and the collector public key are used to asymmetrically decrypt the meter encrypted data and the collector encrypted data to obtain the meter electrical parameters and the collector electrical parameters.
[0058] Furthermore, it also includes:
[0059] When the smart contract completes the decryption of the meter data packet, the server generates a meter data reception completion feedback signal, and uses the server encryption code to symmetrically encrypt the meter data reception completion feedback signal to obtain the encrypted feedback meter data;
[0060] Sending encrypted feedback meter data to smart meters;
[0061] The encrypted feedback meter data is symmetrically decrypted using the service encryption code to obtain a meter data reception completion feedback signal;
[0062] When the smart contract completes the decryption of the collector data packet, the server generates a collector data reception completion feedback signal, and uses the server encryption code to symmetrically encrypt the collector data reception completion feedback signal to obtain the encrypted feedback collector data;
[0063] Sending encrypted feedback collector data to the collector;
[0064] The encrypted feedback collector data is symmetrically decrypted using the service encryption code to obtain a collector data reception completion feedback signal.
[0065] Optionally, the electrical parameters of the electric meter include: electric meter current data, electric meter voltage data, electric meter frequency data, electric meter active power data, electric meter reactive power data, and electric meter apparent power data; the electrical parameters of the collector include: collector current data, collector voltage data, collector frequency data, collector active power data, collector reactive power data, and collector apparent power data.
[0066] Specifically, basic meter information includes: time, meter ID and meter working status; basic collector data includes: time, collector ID and collector working status.
[0067] Optionally, the degree of difference includes: current difference, voltage difference, frequency difference, active power difference, reactive power difference and apparent power difference.
[0068] Optionally, both the electricity meter blockchain and the collector blockchain run on the Hyperledger Fabric platform.
[0069] Furthermore, a blockchain-based electric meter key control device includes:
[0070] Communication module; the communication module is used to receive meter data packets and collector data packets, and send meter data reception completion feedback signals and collector data reception completion feedback signals to the smart meter and collector respectively;
[0071] Storage module: The storage module is used to record the electrical parameters of the meter and the collector;
[0072] Contract module: The contract module is used to execute smart contract programs.
[0073] Contract module: The contract module is used to execute smart contract programs.
[0074] Furthermore, before the smart contract program integrates the data, the server will match the decrypted data based on the basic meter information and basic collector information, and one collector corresponds to multiple meters; the smart contract program will integrate the data uploaded by all meters corresponding to the collector based on the matching results of the server for subsequent data comparison.
[0075] Specifically, the working process of the smart meter includes: collecting electrical data, storing it, and uploading various data to the blockchain according to the RS-485 communication protocol. The smart meter can monitor the current, voltage, frequency, active power, reactive power, apparent power, power factor, total active power (sharp, peak, flat, valley), total reactive power (sharp, peak, flat, valley) and other data in real time. The data is collected every 10 minutes, and the data of the smart meter is uploaded to the blockchain synchronously.
[0076] Optionally, the electric meter key control device used in this embodiment may include but is not limited to a single chip microcomputer, a microprocessor, a cloud server, a personal computer, etc. In practical applications, the electric meter key control device may include more components, or combine certain components, and may also include various input devices, output devices, various sensors, antennas, batteries, etc., which are not listed one by one in this application.
[0077] Furthermore, the storage module used in this embodiment will perform block screening based on the basic information of the collector and the smart meter before storage, and configure the electrical data sent by each collector and the smart meter connected to it into a block to facilitate subsequent data analysis. In order to ensure the security of the data, the server will encrypt the data in each block, and the encryption method includes but is not limited to file encryption software, compression tool encryption, etc. In addition, in order to avoid random data loss due to aging of the storage device, this embodiment adopts dual-disk synchronous storage. After receiving the electrical data, it is stored on two disks at the same time, and the hash value repeatability comparison is performed every other day. If the hash value of the storage information corresponding to one disk changes, it is overwritten with another disk to ensure the integrity of the stored information.
[0078] Optionally, the asymmetric data encryption method adopted in this embodiment includes but is not limited to data encryption algorithms such as Secure Hash Algorithm (SHA).
[0079] Furthermore, this embodiment deploys the blockchain on the Hyperledger Fabric platform, which packages each action into a transaction block and updates the blockchain status after each action is completed. The Hyperledger Fabric platform provides support for writing smart contracts in multiple programming languages, such as Go, Java, JavaScript, etc., which facilitates the writing of smart contract programs in this embodiment; in addition, the Hyperledger Fabric platform uses the Byzantine Fault Tolerant consensus algorithm, which has a higher transaction processing speed and throughput than the traditional proof-of-work consensus algorithm, and is suitable for the high-frequency transaction scenarios of this embodiment.
[0080] Specifically, the collector used in this embodiment includes: RS485 interface, RS232 interface, SIM card interface, I 2 S interface, parallel MIPI CSI camera interface, HDMI 1.4 interface, LCD interface, LVDS interface; operating voltage range is 12±2V, average operating power consumption is 100mA-160mA; supports 4G, 3G, 2G; embedded arm linux blockchain service system. The collector has the advantages of low power consumption, wide operating temperature, high upload rate and fast collection speed.
[0081] The beneficial effects of the present invention are as follows:
[0082] The present invention increases the reliability of blockchain data transmission by introducing symmetric encryption and asymmetric encryption; by comparing the meter data and the collector data, the credibility of the data is further increased, and an alarm can be issued when the data is abnormal, avoiding greater economic losses.
[0083] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0084] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the method and core idea of the present invention. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A blockchain-based electric meter and collector key control method, characterized in that: Applied to meter blockchain based on multiple smart meters and collector blockchain based on multiple collectors; The collector is connected to at least one of the smart meters; the method comprises: Generate meter encryption code, collector encryption code and service encryption code using a pseudo-random password generator; The meter public key of the meter blockchain and the collector public key of the collector blockchain are symmetrically encrypted using the meter encryption code and the collector encryption code respectively to obtain the meter encryption public key and the collector encryption public key; Asymmetrically encrypt the meter electrical parameters collected by the smart meter and the collector electrical parameters collected by the collector using the meter key of the meter blockchain and the collector key of the collector blockchain respectively to obtain meter encrypted data and collector encrypted data; Using the service encryption code, symmetrically encrypt the meter encryption public key, the meter encryption data, and the basic meter information of the smart meter to obtain a meter data packet; Using the service encryption code, symmetrically encrypt the collector encryption public key, the collector encryption data and the basic collector information of the collector to obtain a collector data packet; Sending the meter data packet and the collector data packet to a preset server; Automatically decrypt the meter data packet and the collector data packet based on a preset smart contract program; The electric parameters of the electric meter, the electric parameters of the collector, the basic electric meter information and the basic collector information are stored in a preset storage module; Calculating the sum of the electrical parameters of all the smart meters connected to the collector to obtain the total electrical parameters of the meters; The difference between the electrical total of the electric meter and the electrical parameter of the collector is calculated, and if the difference exceeds a preset threshold, a power supply alarm is issued.
2. According to a blockchain-based electric meter and collector key control method according to claim 1, it is characterized in that: Automatically decrypting the meter data packet and the collector data packet based on a preset smart contract program, including: Symmetrically decrypt the meter data packet and the collector data packet using the service encryption code to obtain the meter encryption public key, the meter encryption data, the basic meter information, the collector encryption public key, the collector encryption data and the basic collector information; The meter encryption code and the collector encryption code are used to symmetrically decrypt the meter encryption public key and the collector encryption public key respectively to obtain the meter public key and the collector public key; The meter public key and the collector public key are used to asymmetrically decrypt the meter encrypted data and the collector encrypted data to obtain the meter electrical parameters and the collector electrical parameters.
3. According to a blockchain-based electric meter and collector key control method according to claim 1, it is characterized in that: Also includes: When the smart contract completes the decryption of the meter data packet, the server generates a meter data reception completion feedback signal, and uses the server encryption code to symmetrically encrypt the meter data reception completion feedback signal to obtain encrypted feedback meter data; Sending the encrypted feedback meter data to the smart meter; Symmetrically decrypting the encrypted feedback meter data using the service encryption code to obtain a meter data reception completion feedback signal; When the smart contract completes the decryption of the collector data packet, the server generates a collector data reception completion feedback signal, and uses the server encryption code to symmetrically encrypt the collector data reception completion feedback signal to obtain encrypted feedback collector data; sending the encrypted feedback collector data to the collector; The encrypted feedback collector data is symmetrically decrypted using the service encryption code to obtain the collector data reception completion feedback signal.
4. According to a blockchain-based electric meter and collector key control method according to claim 1, it is characterized in that: The electrical parameters of the electric meter include: electric meter current data, electric meter voltage data, electric meter frequency data, electric meter active power data, electric meter reactive power data, and electric meter apparent power data; the electrical parameters of the collector include: collector current data, collector voltage data, collector frequency data, collector active power data, collector reactive power data, and collector apparent power data.
5. According to a blockchain-based electric meter and collector key control method according to claim 1, it is characterized in that: The basic meter information includes: time, meter ID and meter working status; the basic collector data includes: time, collector ID and collector working status.
6. A blockchain-based electric meter and collector key control method according to claim 1, characterized in that: The degree of difference includes: current difference, voltage difference, frequency difference, active power difference, reactive power difference and apparent power difference.
7. The method for controlling electric meter and collector keys based on blockchain according to claim 1, characterized in that: The electricity meter blockchain and the collector blockchain both run on the Hyperledger Fabric platform.
8. A blockchain-based electric meter key control device, characterized in that: Used to implement a blockchain-based electric meter and collector key control method as described in any one of claims 1 to 7, the electric meter key control device comprises: Communication module; the communication module is used to receive the meter data packet and the collector data packet, and send the meter data reception completion feedback signal and the collector data reception completion feedback signal to the smart meter and the collector respectively; Storage module; the storage module is used to record the electrical parameters of the meter and the electrical parameters of the collector; Contract module; the contract module is used to execute the smart contract program.
Citation Information
Cited By
Block chain-based electric energy quality tracing method
CN119379097A
