Disclosure of Invention
The disclosure provides a block chain-based electricity consumption data acquisition method and system, which are used for at least solving the problem that errors exist in electricity consumption data acquired by an electricity consumption information acquisition system in the related art. The technical scheme of the disclosure is as follows:
an electricity consumption data acquisition system based on a blockchain, comprising: the system comprises an ammeter, a block chain service platform and a power utilization information acquisition system, wherein the ammeter is in communication connection with the block chain service platform through a first interface and is in communication connection with the power utilization information acquisition system through a second interface;
the ammeter sends an identity authentication request to the block chain service platform;
after receiving a response that the block chain service platform passes feedback authentication, the ammeter generates a first public key and a first private key and sends the first public key to the block chain service platform;
the electricity meter encrypts locally stored electricity utilization data through the first private key and sends the electricity utilization data to the block chain service platform;
the block chain service platform decrypts the electricity consumption data through the first public key and writes the decrypted hash value of the electricity consumption data into a block chain;
the electricity meter sends locally stored electricity utilization data to the electricity utilization information acquisition system;
the electricity utilization information acquisition system compares the hash value of the received electricity utilization data with the hash value of the electricity utilization data written into the block chain, and determines whether the electricity utilization data received by the electricity utilization information acquisition system is tampered according to a comparison result.
Optionally, when the hash value of the electricity consumption data received by the electricity consumption information acquisition system does not need to be compared with the hash value of the electricity consumption data written into the block chain, the block chain service platform is physically isolated from the electricity consumption information acquisition system; when the hash value of the electricity utilization data received by the electricity utilization information acquisition system needs to be compared with the hash value of the electricity utilization data written into the block chain, the block chain service platform and the electricity utilization information acquisition system are in a communication state.
Optionally, the electric meter sends an identity registration request to the blockchain service platform, where the identity registration request includes: the ID of the electric meter and the user information of the electric meter;
the block chain service platform verifies the ID of the electric meter and the user information of the electric meter, and issues a second public key and a second private key corresponding to the electric meter after the verification is passed;
and the ammeter generates the identity authentication request according to the second public key and the second private key.
Optionally, the power consumption information acquisition system obtains the hash value of the power consumption data written in the blockchain from the blockchain service platform.
Optionally, the block chain service platform writes the authentication result of the identity authentication request into the block chain.
A block chain-based power consumption data acquisition method is applied to a block chain-based power consumption data acquisition system, and the power consumption data acquisition system comprises: the electric meter is in communication connection with the block chain service platform through a first interface, and the electric meter is in communication connection with the electricity utilization information acquisition system through a second interface, and the method comprises the following steps:
the ammeter sends an identity authentication request to the block chain service platform;
after receiving a response that the block chain service platform passes feedback authentication, the ammeter generates a first public key and a first private key and sends the first public key to the block chain service platform;
the electricity meter encrypts locally stored electricity utilization data through the first private key and sends the electricity utilization data to the block chain service platform;
the block chain service platform decrypts the electricity consumption data through the first public key and writes the decrypted hash value of the electricity consumption data into a block chain;
the electricity meter sends locally stored electricity utilization data to the electricity utilization information acquisition system;
the electricity utilization information acquisition system compares the hash value of the received electricity utilization data with the hash value of the electricity utilization data written into the block chain, and determines whether the electricity utilization data received by the electricity utilization information acquisition system is tampered according to a comparison result.
Optionally, when the hash value of the electricity consumption data received by the electricity consumption information acquisition system does not need to be compared with the hash value of the electricity consumption data written into the block chain, the block chain service platform is physically isolated from the electricity consumption information acquisition system; when the hash value of the electricity utilization data received by the electricity utilization information acquisition system needs to be compared with the hash value of the electricity utilization data written into the block chain, the block chain service platform and the electricity utilization information acquisition system are in a communication state.
Optionally, the method further includes:
the ammeter sends an identity registration request to the blockchain service platform, wherein the identity registration request comprises: the ID of the electric meter and the user information of the electric meter;
the block chain service platform verifies the ID of the electric meter and the user information of the electric meter, and issues a second public key and a second private key corresponding to the electric meter after the verification is passed;
and the ammeter generates the identity authentication request according to the second public key and the second private key.
Optionally, the method further includes:
and the electricity utilization information acquisition system obtains the hash value of the electricity utilization data written into the blockchain from the blockchain service platform.
Optionally, the method further includes:
and the block chain service platform writes the authentication result of the identity authentication request into a block chain.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
the utility model provides a block chain-based electricity consumption data acquisition method and system, wherein an electricity meter is in communication connection with a block chain service platform and an electricity consumption information acquisition system through different interfaces; the ammeter sends an identity authentication request to the block chain service platform; after receiving a response that the block chain service platform passes the feedback authentication, the ammeter generates a first public key and a first private key and sends the first public key to the block chain service platform; the electricity meter encrypts locally stored electricity utilization data through a first private key and sends the electricity utilization data to the block chain service platform; the block chain service platform decrypts the electricity consumption data through the first public key and writes the hash value of the decrypted electricity consumption data into the block chain; the electricity meter sends the electricity utilization data to the electricity utilization information acquisition system; and the electricity utilization information acquisition system compares the hash value of the received electricity utilization data with the hash value written into the block chain, and determines whether the electricity utilization data is tampered according to the comparison result. The electricity utilization information acquisition system can verify whether the electricity utilization data acquired by the electricity utilization information acquisition system is correct. It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
The embodiment of the present disclosure provides a block chain-based power consumption data acquisition method, which may be applied to a block chain-based power consumption data acquisition system, as shown in fig. 1, the power consumption data acquisition system may include: ammeter 001, block chain service platform 002 and power consumption information acquisition system 003, ammeter 001 pass through first interface and block chain service platform 002 communication connection, and ammeter 001 passes through second interface and power consumption information acquisition system 003 communication connection.
The ammeter that this disclosed embodiment provided can be smart electric meter, and this ammeter can be through two different interfaces respectively with block chain service platform 002, power consumption information acquisition system 003 communication connection. Because the interface is different, consequently the ammeter comes with block chain service platform 002, power consumption information acquisition system 003 communication connection through two passageways, has avoided because the data risk that single channel communication brought. The two interfaces of last data of ammeter have guaranteed the integrality and the authenticity of data from the source, not only can solve the data tampering problem that the procedure overlength that the data circulate arouses, can also reduce the risk of present power consumption data information centralized management.
As shown in fig. 2, a block chain-based power consumption data acquisition method provided in an embodiment of the present disclosure may include:
s100, the electric meter 001 sends an identity authentication request to the blockchain service platform 002.
The identity authentication request carries authentication information encrypted by a secret key, and the authentication information may include: ID of the electricity meter 001, and/or user information of the electricity meter 001.
Optionally, when the electricity data is transmitted each time, the authentication may be performed through the blockchain service platform 002, so as to ensure that the identity of the electricity meter cannot be tampered with.
S200, the blockchain service platform 002 feeds back the response that the authentication passes to the electricity meter 001.
The blockchain service platform 002 may be a blockchain node in the blockchain network, and the blockchain service platform may write data into the blockchain. The blockchain service platform 002 may pre-store the authentication information, and after receiving the identity authentication request, the blockchain service platform may compare the pre-stored authentication information with the authentication information in the received identity authentication request, and if the pre-stored authentication information is consistent with the authentication information in the received identity authentication request, it is determined that the authentication is passed. Otherwise, the authentication is not passed.
S300, after receiving the response that the feedback authentication of the blockchain service platform 002 passes, the electric meter 001 generates a first public key and a first private key.
Optionally, a secure element for generating the first public key and the first private key may be disposed in the electricity meter 001. The Secure Element (SE) is usually provided in a chip form, and the Secure Element can prevent external malicious analysis attacks and protect data security. The secure element has encryption/decryption logic, and the secure element may sign the message using the generated first public key and/or first private key in the present disclosure.
Optionally, the first public key and the first private key may be a corresponding public-private key pair.
It can be understood that through steps S100 to S300, the present disclosure may authenticate the electric meter before transmitting the electricity data, thereby ensuring the legitimacy and safety of the source of the electricity data, that is: the legality and the safety of the data are ensured from the perspective of the data source.
S400, the electric meter 001 sends the first public key to the block chain service platform 002.
Optionally, the electric meter 001 may send the first public key to the blockchain service platform 002 through the first interface.
S500, the electricity meter 001 encrypts the locally stored electricity data through the first private key and sends the electricity data to the blockchain service platform 002.
Since the electricity meter 001 encrypts the electricity consumption data through the first private key, the electricity consumption data can be decrypted only if the electricity consumption data has the first public key corresponding to the first private key. Therefore, the invention can effectively ensure the safety of power utilization data transmission, namely: the legality and the safety of the data are ensured from the transmission point of view.
S600, the block chain service platform 002 decrypts the electricity consumption data by using the first public key and writes the hash value of the decrypted electricity consumption data into the block chain.
The hash value of the electricity utilization data is written into the block chain, so that the electricity utilization data can be recorded into the block chain. The disclosure can utilize the non-tamper property of the block chain to enable the block chain service platform to write the hash value of the electricity consumption data which is verified to be legal and correct by the first public key into the block chain.
Optionally, when the blockchain service platform 002 uploads the hash value, the ID of the electricity meter 001 and the hash value may be mapped and written into the blockchain together. Therefore, when the hash value of the electricity consumption data is searched subsequently, the corresponding hash value of the electricity consumption data can be found through the ID of the electricity meter.
Since the blockchain service platform obtains the power data directly from the electric meter, no third-party equipment exists between the blockchain service platform and the electric meter. It will be appreciated that the more intermediaries involved in transferring data, the more trust that needs to be paid, and the same difficulty in ensuring the authenticity of the data if the intermediaries do not have a strong trust mechanism. This openly can make the electric power data of ammeter directly chain deposit the certificate. Meanwhile, a public key/private key pair is used for signing the message, the trust mechanism of the block chain is enhanced, and the originality and the authenticity of the data are ensured.
Optionally, after obtaining the decrypted power consumption data, the block chain service platform 002 may further perform structured processing on the power consumption data, for example, adjust the format, the sequence, and the like of the power consumption data according to a preset data structure requirement. Then, the blockchain service platform 002 may also perform pre-processing on the electricity consumption data before uplink, and then calculate a hash value of the pre-processed electricity consumption data by using a hash algorithm, where the hash value is recorded as a digest signature of the electricity consumption data.
Optionally, the present disclosure may also compact and send other data to the blockchain service platform, such as sensitive data. For sensitive data, the present disclosure may present only a portion of the data that is needed by the data consumer.
S700, the electricity meter 001 sends locally stored electricity utilization data to an electricity utilization information acquisition system 003.
Optionally, when the electricity consumption data of local storage is sent to the electricity consumption information acquisition system by the ammeter, the electricity consumption data can be firstly encrypted, so that the transmission safety of the electricity consumption data between the ammeter and the electricity consumption information acquisition system is improved.
The secret key used for encrypting the electricity consumption data sent to the electricity consumption information acquisition system by the electricity meter can also be the first secret key, and certainly, other secret keys can also be used, and the disclosure is not limited.
And S800, the power consumption information acquisition system 003 compares the hash value of the received power consumption data with the hash value of the power consumption data written into the block chain, and determines whether the power consumption data received by the power consumption information acquisition system 003 is tampered according to the comparison result.
The power consumption information acquisition system 003 may calculate a hash value of the received power consumption data, compare the hash value with the hash value of the power consumption data written in the block chain in step S600, and determine that the power consumption data received by the power consumption information acquisition system 003 is not tampered when the hash value is identical to the hash value of the power consumption data written in the block chain in step S600, otherwise determine that the power consumption data received by the power consumption information acquisition system 003 is tampered.
Through step S800, the present disclosure may verify the power consumption data through the data recorded in the blockchain, thereby determining whether the power consumption data received by the electrical information collection system 003 is tampered with. Because the data recorded in the blockchain has irreparable modification, the accuracy and the safety of the electricity utilization data used by the electrical information acquisition system 003 can be effectively ensured by the method.
The electricity utilization information acquisition system and the block chain service platform can acquire data from the ammeter through different interfaces respectively, and the block chain service platform can prevent historical electricity utilization data of the electricity utilization information acquisition system from being tampered, can verify the authenticity of real-time electricity utilization data, and enlarges the actual effect of block chain evidence storage information verification.
Optionally, in the method shown in fig. 2, the electric meter may perform data transmission through the communication module.
Optionally, the method shown in fig. 2 may further include:
the ammeter sends a data reading instruction, the clock module times, the communication module responds after receiving the data reading instruction, if the communication module does not respond within the preset timing range of the clock module, the response is overtime, and at the moment, abnormal operation can be recorded by the method. Specifically, when recording an abnormal operation, the electric meter may write the information related to the response timeout into the blockchain through the blockchain service platform 002.
Optionally, after the communication module successfully responds, the system of the electric meter may determine whether the operation of reading the electricity data is legal, and if so, it is determined that the communication module and the electric meter can be matched, and the operation of reading the electricity data may be performed; if the operation is illegal, the abnormal operation is recorded. Of course, the present disclosure may also write the information related to the abnormal operation into the blockchain through the blockchain service platform 002.
Optionally, after the communication module is matched with the electric meter, the electricity utilization data can be read and sent to the electricity utilization data acquisition system. Specifically, the electricity consumption information acquisition system can be docked with the second interface through the acquisition front layer to receive electricity consumption data.
Optionally, the electricity information acquisition system may preprocess the electricity data and form the electricity information base through a distributed file caching technology.
Optionally, when the hash value of the power consumption data received by the power consumption information acquisition system 003 does not need to be compared with the hash value of the power consumption data written into the block chain, the block chain service platform 002 and the power consumption information acquisition system 003 are in a physical isolation state. When the hash value of the power consumption data received by the power consumption information acquisition system 003 needs to be compared with the hash value of the power consumption data written into the block chain, the block chain service platform 002 and the power consumption information acquisition system 003 are in a communication state.
It is understood that the physical isolation refers to a technical means for physically isolating an intranet from an extranet so as to avoid the risk of intrusion or information leakage. Physical isolation is mainly used to solve the network security problem, especially when a secure network, a private network and a special network which need to be absolutely secured are connected with the internet, in order to prevent attacks from the internet and to ensure the confidentiality, security, integrity, denial prevention and high availability of these high-security networks, almost all physical isolation techniques are required. Physical isolation includes isolation gatetechnology, physical isolation cards, and the like.
Through physical isolation, the safety of the electricity utilization data can be effectively improved, and even if someone attacks one of the block chain service platform 002 and the electricity information acquisition system 003, the safety of the other one is ensured due to the physical isolation. The electricity utilization information acquisition system can access the block chain service platform through penetrating the isolation device to obtain evidence of the information of the block chain, so that the authenticity of electricity utilization data is verified.
When the hash value of the power consumption data received by the power consumption information acquisition system 003 needs to be compared with the hash value of the power consumption data written into the block chain, the block chain service platform 002 and the power consumption information acquisition system 003 can be in a communication state through penetration of physical isolation.
The method shown in fig. 2 can realize non-falsification of the whole flow of 'source-transmission-storage' of electricity data, in the disclosure, firstly, a secure element is used to ensure that a data source is not falsified, then, identity authentication is used to match data information with previous authentication information to achieve non-falsification in the transmission process, and finally, data is generated into a digest signature by using a hash algorithm and is stored in a block chain service platform to achieve non-falsification in the storage process.
The method and the device can solve the problem that the data source information is easy to tamper due to the fact that the block chain service platform cannot contact one hand of data. The ammeter is provided with two communication interfaces of butt joint block chain service platform and power consumption information acquisition platform respectively, and block chain service platform need not to call the interface through power consumption information acquisition platform and carries out the deposit evidence of data and collect evidence, has guaranteed the integrality and the authenticity of data from the source, not only can solve the data tampering problem that the program overlength that the data flow arouses, can also reduce the risk of present power consumption data information centralized management.
With respect to the embodiment shown in fig. 2, as shown in fig. 3, another embodiment of the present disclosure provides a block chain-based electricity data collection method, which may further include:
s010, the electric meter 001 sends an identity registration request to the blockchain service platform 002, where the identity registration request includes: ID of the electricity meter 001 and user information of the electricity meter 001.
The user information may be at least one of a plurality of information such as a name, an identification number, an address, a mobile phone number and the like of the user.
S020, the blockchain service platform 002 verifies the ID of the electricity meter 001 and the user information of the electricity meter 001.
The ID of the electric meter 001 and the user information of the electric meter 001 may be stored in advance in the block chain service platform, so that the information in the identity registration request is verified.
Optionally, the information in the identity registration request sent in step S010 may be encrypted information, and the blockchain service platform 002 may decrypt and then verify the encrypted information.
S030, the block chain service platform 002 issues the second public key and the second private key corresponding to the electric meter 001 after passing the verification.
The second public key and the second private key may be a public-private key pair.
And S040, the electric meter 001 generates an identity authentication request according to the second public key and the second private key.
Specifically, the electric meter may encrypt the authentication information using one of the second private key and the second public key, and then generate the identity authentication request including the encrypted authentication information.
It will be appreciated that the blockchain service platform 002, upon receiving the identity authentication request, may decrypt the authentication information using the other of the second private key or the second public key.
The steps from the step S010 to the step S040 can increase the verification strength of the user electric meter identity information and increase the safety degree of the electric meter identity information.
With respect to the embodiment shown in fig. 2, as shown in fig. 4, another embodiment of the present disclosure provides a block chain-based electricity data collection method, which may further include:
s710, the power consumption information collection system 003 obtains the hash value of the power consumption data written in the blockchain from the blockchain service platform 002.
With respect to the embodiment shown in fig. 2, as shown in fig. 5, another embodiment of the present disclosure provides a block chain-based electricity data collection method, which may further include:
s031, the blockchain service platform 002 writes the authentication result of the identity authentication request into the blockchain.
Fig. 1 is a schematic structural diagram illustrating a block chain-based power consumption data acquisition system according to an exemplary embodiment, where the power consumption data acquisition system may include: ammeter 001, block chain service platform 002 and power consumption information acquisition system 003, ammeter 001 pass through first interface and block chain service platform 002 communication connection, and ammeter 001 passes through second interface and power consumption information acquisition system 003 communication connection.
In this power consumption data acquisition system:
the electricity meter 001 sends an identity authentication request to the blockchain service platform 002.
After receiving the response that the feedback authentication of the blockchain service platform 002 passes, the electric meter 001 generates a first public key and a first private key, and sends the first public key to the blockchain service platform 002.
The electricity meter 001 encrypts the locally stored electricity consumption data through the first private key and sends the electricity consumption data to the blockchain service platform 002.
The block chain service platform 002 decrypts the electricity consumption data through the first public key and writes the hash value of the decrypted electricity consumption data into the block chain.
The electricity meter 001 sends the locally stored electricity consumption data to the electricity consumption information collection system 003.
The power consumption information acquisition system 003 compares the hash value of the received power consumption data with the hash value of the power consumption data written in the block chain, and determines whether the power consumption data received by the power consumption information acquisition system 003 is falsified according to the comparison result.
Optionally, when the hash value of the power consumption data received by the power consumption information acquisition system 003 does not need to be compared with the hash value of the power consumption data written into the block chain, the block chain service platform 002 and the power consumption information acquisition system 003 are in a physical isolation state; when the hash value of the power consumption data received by the power consumption information acquisition system 003 needs to be compared with the hash value of the power consumption data written into the block chain, the block chain service platform 002 and the power consumption information acquisition system 003 are in a communication state.
Optionally, the electric meter 001 sends an identity registration request to the blockchain service platform 002, where the identity registration request includes: ID of the electricity meter 001 and user information of the electricity meter 001.
The blockchain service platform 002 verifies the ID of the electric meter 001 and the user information of the electric meter 001, and issues the second public key and the second private key corresponding to the electric meter 001 after the verification is passed.
The electric meter 001 generates an identity authentication request according to the second public key and the second private key.
Optionally, the power consumption information collection system 003 obtains the hash value of the power consumption data written in the blockchain from the blockchain service platform 002.
Optionally, the blockchain service platform 002 writes the authentication result of the identity authentication request into the blockchain.
Optionally, as shown in fig. 6, the electric meter may include an identity information module, an operation instruction module, a storage module, a security element, a power supply module, a clock module, and an electric meter blockchain module. Wherein, the electric meter blockchain module may include: the system comprises an identity authentication sub-module, an encryption algorithm sub-module, an interface calling sub-module, an address acquisition sub-module, an address rewriting sub-module, a data storage sub-module and an information communication sub-module.
The block chain service platform can comprise an identity management module, an abnormal operation module, a data source marking module, a data evidence storing module, a return address module, an electronic abstract module, a data evidence obtaining module and the like. The electricity information collection system may include: the system comprises a collection front layer, a data preprocessing module, a distributed file and a collection generation library.
The identity information module is used for sending data such as user information and electric meter id of the electric meter to the electric meter block chain module.
And the operation instruction module is used for judging the legality of the operation instruction, and sending the information to the abnormal operation module if the operation instruction is judged to be illegal.
And the storage module is used for storing the electric meter data and transmitting the electric meter data to the block chain service platform and the electricity utilization information acquisition system through the electric meter block chain.
The secure element can generate a public key/private key pair in a chip and has strong anti-tampering capability. The secure element may generate a message signature that is sent to the data source tagging module to determine whether the data source information has been tampered with.
And the power supply module is used for displaying the electric quantity information of the electric meter.
And the clock module is used for calculating the instruction execution time through timing, and if the instruction execution time is overtime, the clock module sends the information to the abnormal operation module.
And the electric meter block chain module can work with other modules.
The identity management module obtains the user information of the electric meter, the electric meter id and other data from the identity information module of the electric meter, and calls the identity management module of the block chain service platform through an interface to perform identity authentication after desensitization and encryption.
The encryption algorithm sub-module is responsible for encryption algorithms such as a hash algorithm, a public key and a private key, and is connected with the identity authentication sub-module, the identity management module, the data card storage module and the like.
And the interface calling submodule is responsible for calling all the interfaces of the electric meter blockchain module to serve.
The address acquisition submodule and the address rewriting submodule can provide address query and write services for the return address of the block chain service platform.
The data storage submodule is directly connected with the data storage submodule and can call data information of the user ammeter, and then the data storage submodule forms double channels through the information communication submodule and is respectively communicated with the data storage module and the acquisition front layer of the electricity utilization information acquisition system.
And the data forensics module is mainly used for carrying out data forensics verification on data in the collection generation library of the electricity utilization information collection system.
The ammeter designed by the method increases new functions of identity authentication, abnormal operation recording, message signature and the like, the integration among all modules is needed, the overall coupling of the ammeter is reduced, and the influence of one module on the overall normal operation of the ammeter is avoided.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
In an exemplary embodiment, a computer-readable storage medium comprising instructions, for example a memory, executable by a processor of an electronic device to perform the above method is also provided. Alternatively, the computer readable storage medium may be a non-transitory computer readable storage medium, for example, which may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, a computer program product is also provided, which includes a computer program that causes a processor to execute the above block chain-based electricity consumption data collection method.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.