A method and related device for protecting energy purchase and electricity transaction data based on blockchain

By building a blockchain network in the energy power purchase trading system and encrypting data, the problem of low data security caused by centralized databases is solved, and the security and decentralized management of transaction data are improved.

CN113935839BActive Publication Date: 2024-11-08ELECTRIC POWER RES INST CHINA SOUTHERN POWER GRID CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111256204.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-27
Publication Date
2024-11-08
Estimated Expiration
2041-10-27

AI Technical Summary

Technical Problem

The existing energy power purchasing trading system uses a centralized database to store transaction data, resulting in a higher risk of transaction data being tampered with and low data security.

Method used

By building a blockchain network, a traditional database is configured on the target node of the blockchain network for connection, synchronizing the data on the chain to the traditional database, and encrypting the power supply party's equipment information table, user power purchase record table and monthly settlement table. Use smart contracts to perform power purchase calculation and settlement, and finally synchronize the encrypted data to the traditional database.

Benefits of technology

Improve the security of transaction data, decentralized maintenance of traditional databases through blockchain technology, reduce the risk of data being tampered with and improve data security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113935839B_ABST
    Figure CN113935839B_ABST
Patent Text Reader

Abstract

The present application discloses a method and related device for protecting energy power purchase transaction data based on blockchain. A traditional database is configured on the target node of the constructed blockchain network for connection to synchronize the data on the chain. After constructing the power supplier equipment information table and the power supplier product information table, the power supplier product information table is broadcast to the blockchain network for selection by users on the blockchain network. When a user submits a power purchase request on the blockchain network, the power purchase calculation is performed through a smart contract, and the obtained power purchase information is recorded in the user power purchase record table corresponding to the user. Monthly settlement is performed through a smart contract, and the settlement information is recorded in the monthly settlement table. The power supplier equipment information table, the user power purchase record table and the monthly settlement table are encrypted and synchronized to the traditional database, thereby improving the technical problem that the existing energy power purchase transaction system uses a centralized database to store transaction data, resulting in a high risk of transaction data being tampered with and low data security.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data security technology, and in particular to a blockchain-based energy purchase and electricity transaction data protection method and related devices. Background Art

[0002] The traditional energy purchase and electricity trading system is mainly based on a centralized architecture. The sources of data in the energy purchase and electricity trading system mainly include energy supply plants, usage information reported by energy users, usage information statistically collected by the metering department, energy market system database, and energy information from other departments. At the same time, the energy purchase and electricity trading system faces business scenarios such as distributed energy, high frequency, and small transactions, and there are still some problems with the model of centralized institutions managing transactions. The centralized database increases the risk of transaction data being tampered with, and the data security is low. Summary of the invention

[0003] The present application provides a blockchain-based energy purchase and electricity transaction data protection method and related devices, which are used to improve the technical problems that the existing energy purchase and electricity transaction system uses a centralized database to store transaction data, resulting in a high risk of transaction data being tampered with and low data security.

[0004] In view of this, the first aspect of the present application provides a method for protecting energy purchase and electricity transaction data based on blockchain, comprising:

[0005] After building the blockchain network, configure a traditional database on the target node of the blockchain network for connection to synchronize the on-chain data to the traditional database;

[0006] After constructing the power supply party equipment information table and the power supply party product information table, broadcasting the power supply party product information table to the blockchain network for selection by users on the blockchain network;

[0007] After the user electricity purchase record table is constructed, when a user submits an electricity purchase request on the blockchain network, the electricity purchase calculation is performed through the smart contract, and the obtained electricity purchase information is recorded in the user electricity purchase record table corresponding to the user;

[0008] After the monthly settlement table is constructed, monthly settlement is performed through the smart contract, and the settlement information obtained is recorded in the monthly settlement table;

[0009] The power supply side equipment information table, the user power purchase record table and the monthly settlement table are encrypted, and the encrypted power supply side equipment information table, the encrypted user power purchase record table and the encrypted monthly settlement table are synchronized to the traditional database.

[0010] Optionally, the monthly settlement table includes a monthly settlement table for users and a monthly settlement table for power suppliers.

[0011] Optionally, the specific process of encrypting the power supply equipment information table, the user power purchase record table and the monthly settlement table is:

[0012] Symmetrically encrypt the power supply device information table using a first encryption key to obtain an encrypted power supply device information table, and asymmetrically encrypt the first encryption key using a public key of a first authorized object of the power supply device information table and save the asymmetrically encrypted first encryption key on the blockchain;

[0013] Symmetrically encrypt the user electricity purchase record table using a second encryption key to obtain an encrypted user electricity purchase record table, and asymmetrically encrypt the second encryption key using a public key of a second authorized object of the user electricity purchase record table and save the encrypted data on the blockchain;

[0014] Symmetrically encrypting the user monthly settlement table by using a third encryption key to obtain an encrypted user monthly settlement table;

[0015] The power supplier monthly settlement sheet is symmetrically encrypted using a fourth encryption key to obtain an encrypted power supplier monthly settlement sheet.

[0016] Optionally, the method further includes:

[0017] Asymmetrically encrypting the encrypted power supply device information table by using the public key of the first authorized object to authorize the first authorized object to have access rights to the encrypted power supply device information table;

[0018] The encrypted user electricity purchase record table is asymmetrically encrypted through the public key of the second authorization object to authorize the second authorization object to have access rights to the encrypted user electricity purchase record table.

[0019] Optionally, the method further includes:

[0020] A supervision node is set in the blockchain network, and the access rights to the encrypted power supply equipment information table, the encrypted user electricity purchase record table and the encrypted monthly settlement table are authorized to the supervision node to perform data table supervision.

[0021] The second aspect of the present application provides a blockchain-based energy purchase and electricity transaction data protection device, comprising:

[0022] A construction unit, configured to configure a traditional database on a target node of the blockchain network for connection after the blockchain network is constructed, so as to synchronize the on-chain data to the traditional database;

[0023] A broadcast unit, configured to construct a power supply equipment information table and a power supply product information table, and then broadcast the power supply product information table to the blockchain network for selection by users on the blockchain network;

[0024] The first recording unit is used to construct a user electricity purchase record table, and when a user submits an electricity purchase request on the blockchain network, the electricity purchase calculation is performed through the smart contract, and the obtained electricity purchase information is recorded in the user electricity purchase record table corresponding to the user;

[0025] The second recording unit is used to construct a monthly settlement table, perform monthly settlement through a smart contract, and record the settlement information obtained in the monthly settlement table;

[0026] The encryption and synchronization unit is used to encrypt the power supply equipment information table, the user power purchase record table and the monthly settlement table, and synchronize the encrypted power supply equipment information table, the encrypted user power purchase record table and the encrypted monthly settlement table to the traditional database.

[0027] Optionally, the monthly settlement table includes a monthly settlement table for users and a monthly settlement table for power suppliers.

[0028] Optionally, the encryption and synchronization unit is specifically used for:

[0029] Symmetrically encrypt the power supply device information table using a first encryption key to obtain an encrypted power supply device information table, and asymmetrically encrypt the first encryption key using a public key of a first authorized object of the power supply device information table and save the asymmetrically encrypted first encryption key on the blockchain;

[0030] Symmetrically encrypt the user electricity purchase record table using a second encryption key to obtain an encrypted user electricity purchase record table, and asymmetrically encrypt the second encryption key using a public key of a second authorized object of the user electricity purchase record table and save the encrypted data on the blockchain;

[0031] Symmetrically encrypting the user monthly settlement table by using a third encryption key to obtain an encrypted user monthly settlement table;

[0032] Symmetrically encrypt the monthly settlement table of the power supplier by using a fourth encryption key to obtain an encrypted monthly settlement table of the power supplier;

[0033] The encrypted power supply equipment information table, the encrypted user power purchase record table and the encrypted monthly settlement table are synchronized to the traditional database.

[0034] A third aspect of the present application provides an electronic device, the device comprising a processor and a memory;

[0035] The memory is used to store program code and transmit the program code to the processor;

[0036] The processor is used to execute the blockchain-based energy purchase and electricity transaction data protection method described in any one of the first aspects according to the instructions in the program code.

[0037] The fourth aspect of the present application provides a computer-readable storage medium, which is used to store program code. When the program code is executed by a processor, it implements the blockchain-based energy purchase and electricity transaction data protection method described in any one of the first aspects.

[0038] It can be seen from the above technical solutions that this application has the following advantages:

[0039] The present application provides a method for protecting energy power purchase transaction data based on blockchain, comprising: after building a blockchain network, configuring a traditional database on a target node of the blockchain network for connection to synchronize on-chain data to the traditional database; after building a power supply equipment information table and a power supply product information table, broadcasting the power supply product information table to the blockchain network for selection by users on the blockchain network; after building a user power purchase record table, when a user submits a power purchase request on the blockchain network, performing power purchase calculations through a smart contract, and recording the obtained power purchase information in the user power purchase record table corresponding to the user; after building a monthly settlement table, performing monthly settlement through a smart contract, and recording the settlement information obtained in the monthly settlement table; encrypting the power supply equipment information table, the user power purchase record table, and the monthly settlement table, and synchronizing the encrypted power supply equipment information table, the encrypted user power purchase record table, and the encrypted monthly settlement table to the traditional database.

[0040] In this application, a blockchain network is constructed, and a traditional database is configured on the target node of the blockchain network for connection to synchronize the on-chain data to the traditional database. The power supplier equipment information table, user power purchase record table and monthly settlement table constructed based on the energy power purchase transaction data are encrypted and synchronized to the traditional database, thereby improving the security of transaction data. The traditional database is decentralizedly maintained through blockchain technology, reducing the risk of data tampering, thereby improving the existing energy power purchase transaction system that uses a centralized database to store transaction data, resulting in a high risk of transaction data tampering and low data security. Technical problems. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0042] Figure 1 A flowchart of a method for protecting energy purchase and electricity transaction data based on blockchain provided in an embodiment of the present application;

[0043] Figure 2 A schematic diagram of data table access permission control provided in an embodiment of the present application;

[0044] Figure 3 A structural schematic diagram of a blockchain-based energy purchase and electricity transaction data protection device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0045] The present application provides a blockchain-based energy purchase and electricity transaction data protection method and related devices, which are used to improve the technical problems that the existing energy purchase and electricity transaction system uses a centralized database to store transaction data, resulting in a high risk of transaction data being tampered with and low data security.

[0046] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0047] For easier understanding, see Figure 1 The embodiment of the present application provides a method for protecting energy purchase and electricity transaction data based on blockchain, including:

[0048] Step 101: After building the blockchain network, configure a traditional database on the target node of the blockchain network for connection to synchronize the on-chain data to the traditional database.

[0049] The platform manager builds a blockchain network and configures a traditional database (i.e., the database in the traditional energy purchasing and electricity trading system) on the node controlled by the platform manager for connection to synchronize the on-chain data to the traditional database. This application transforms the traditional database into a blockchain transaction format and performs operations on the chain, thereby recording database operations in the blockchain, making it easier to trace and restore database operations, and such on-chain records are not tampered with. By adopting blockchain technology to maintain the database in a decentralized manner, the risk of data in the database being tampered with is reduced. Among them, the specific construction process of the blockchain network belongs to the prior art and will not be repeated here.

[0050] Step 102: After constructing the power supply equipment information table and the power supply product information table, broadcast the power supply product information table to the blockchain network for selection by users on the blockchain network.

[0051] Different roles (power suppliers, users) establish accounts on the blockchain through the platform management party's operation platform. All operations such as power suppliers providing power sales product information, users purchasing power sales products, and monthly settlement are carried out through the operation platform. The platform management party constructs the power supplier equipment information table and the power supplier product information table. The power supplier records the equipment information through the power supplier equipment information table, and the power supplier records the power sales product information through the power supplier product information table. After the equipment information and power sales product information are uploaded to the chain, the equipment information is reviewed by the platform management party, and the power sales product information is displayed through the operation platform. Users choose to purchase through the operation platform.

[0052] Step 103: After the user electricity purchase record table is constructed, when a user submits an electricity purchase request in the blockchain network, the electricity purchase calculation is performed through the smart contract, and the obtained electricity purchase information is recorded in the user electricity purchase record table corresponding to the user.

[0053] In order to record the user's electricity purchase information, the platform manager constructs a user electricity purchase record table. When a user submits an electricity purchase request on the blockchain network, the platform manager performs relevant electricity purchase calculations through smart contracts, pre-freezes the user's electricity purchase expenses, deducts the electricity purchase expenses, and records the obtained electricity purchase information in the user's corresponding electricity purchase record table.

[0054] Step 104: After the monthly settlement table is constructed, monthly settlement is performed through the smart contract, and the settlement information obtained is recorded in the monthly settlement table.

[0055] In order to conduct monthly settlement for users and power suppliers, the platform management party constructs a monthly settlement table, which includes the monthly settlement table for users and the monthly settlement table for power suppliers. The platform management party obtains the user settlement data and calls the smart contract to conduct monthly settlement for the user settlement data. After the settlement is completed, the settlement information obtained will be recorded in the user monthly settlement table. The platform management party obtains the power supplier settlement data and calls the smart contract to conduct monthly settlement for the power supplier settlement data. After the settlement is completed, the settlement information obtained will be recorded in the monthly settlement table for the power supplier.

[0056] Step 105: Encrypt the power supply party equipment information table, the user power purchase record table and the monthly settlement table, and synchronize the encrypted power supply party equipment information table, the encrypted user power purchase record table and the encrypted monthly settlement table to the traditional database.

[0057] By carrying out energy marketization business through the energy purchase and electricity trading system based on blockchain smart contracts, the transparency of energy purchase and electricity trading can be improved, and the fairness and justice of the trading system can be guaranteed. However, due to the distributed, open and transparent nature of blockchain technology, data privacy in multi-party blockchain systems faces huge challenges. In order to improve data security and protect data privacy, the embodiment of the present application encrypts and sets access rights for the power supplier equipment information table, user power purchase record table and monthly settlement table, and synchronizes the encrypted power supplier equipment information table, encrypted user power purchase record table and encrypted monthly settlement table to the traditional database.

[0058] Since the power supplier equipment information table, user power purchase record table and monthly settlement table are constructed by the platform management party, the platform management party has the access rights to the power supplier equipment information table, user power purchase record table and monthly settlement table. The power supplier equipment information table only needs to be viewed by the power supplier and the platform management party, so it is set as an encrypted table. The platform management party encrypts the power supplier equipment information table and authorizes the power supplier to have access to the encrypted power supplier equipment information table, allowing the power supplier to submit and query equipment information, but not allowing it to update or delete. After the power supplier submits the equipment information, it will be reviewed by the platform management party. After the review is passed, the information will be updated to passed and recorded in the power supplier equipment information table.

[0059] The power supplier product information table needs to be displayed to users for selection and purchase, so it is set as a normal table, authorizing the corresponding power supplier to add and query functions, not allowing them to update and delete, and authorizing all users on the chain to query. After the power supplier submits the power sales product information, it will be reviewed by the platform management party. If the review is passed, the product information record will be updated as approved. The platform management party will also display the table information to users through the operation platform, so that the table can be viewed by all users on the chain.

[0060] The user electricity purchase record table is created and encrypted by the platform management party, and the user is authorized to query the table. When the user submits the electricity purchase operation, the platform management party performs relevant electricity purchase calculations and pre-freezes the user's electricity purchase fee through smart contracts, and then records the electricity purchase information in the table, so that only the platform management party and the user themselves can view it on the chain.

[0061] The user monthly settlement table is encrypted by the platform management party into an encrypted table. The platform management party provides the user settlement data to the smart contract for user monthly settlement, and the settlement information is recorded in this table after the settlement is completed. This table can only be accessed by the platform management party.

[0062] The monthly settlement table of the power supplier is encrypted by the platform management party. The platform management party provides the settlement data of the power supplier to the smart contract for the monthly settlement of the power supplier. After the settlement is completed, the settlement information is recorded in this table. This table can only be accessed by the platform management party. For the permission control of each data table, please refer to Figure 2 ,in, Figure 2 The electricity user is the user.

[0063] Furthermore, the specific process of the platform management party encrypting the power supplier's equipment information table, the user's electricity purchase record table and the monthly settlement table is as follows:

[0064] The power supply party device information table is symmetrically encrypted using the first encryption key to obtain an encrypted power supply party device information table, and the first encryption key is asymmetrically encrypted using the public key of the first authorized object of the power supply party device information table and then stored on the blockchain;

[0065] The user's electricity purchase record table is symmetrically encrypted using the second encryption key to obtain an encrypted user's electricity purchase record table, and the second encryption key is asymmetrically encrypted using the public key of the second authorized object of the user's electricity purchase record table and then stored on the blockchain;

[0066] Symmetrically encrypt the user monthly settlement table using a third encryption key to obtain an encrypted user monthly settlement table;

[0067] The monthly settlement sheet of the power supplier is symmetrically encrypted using the fourth encryption key to obtain the encrypted monthly settlement sheet of the power supplier.

[0068] The first authorization object in the embodiment of the present application is the power supplier, and the second authorization object is the user. The specific process of the platform manager authorizing the first authorization object to access the encrypted power supplier device information table and authorizing the second authorization object to access the encrypted user power purchase record table is as follows:

[0069] Asymmetrically encrypting the encrypted power supply device information table through the public key of the first authorized object to authorize the first authorized object to have access rights to the encrypted power supply device information table;

[0070] The encrypted user electricity purchase record table is asymmetrically encrypted through the public key of the second authorization object to authorize the second authorization object to have access rights to the encrypted user electricity purchase record table.

[0071] The platform manager uses the public key of the first authorized object to asymmetrically encrypt the encrypted power supply device information table, so that the first authorized object can decrypt it with the private key to obtain the encrypted power supply device information table. Since the user does not have the private key of the first authorized object, he cannot decrypt it, and cannot access the encrypted power supply device information table. Since the platform manager uses the public key of the first authorized object to asymmetrically encrypt the first encryption key when encrypting the power supply device information table with the first encryption key and saves it on the blockchain, after the power supply obtains the encrypted power supply device information table through private key decryption, it can obtain the encrypted first encryption key on the blockchain, and decode the encrypted first encryption key with the private key to obtain the first encryption key, and then decrypt the encrypted power supply device information table with the first encryption password to access the power supply device information table, while unauthorized users cannot access the power supply device information table, thereby achieving the purpose of authority control.

[0072] The platform manager uses the public key of the second authorized object to asymmetrically encrypt the encrypted user electricity purchase record table, so that the second authorized object can decrypt it with the private key to obtain the encrypted user electricity purchase record table. The power supplier cannot decrypt it because it does not have the private key of the second authorized object, and cannot access the encrypted user electricity purchase record table. Since the platform manager uses the public key of the second authorized object to asymmetrically encrypt the second encryption key when encrypting the user electricity purchase record table with the second encryption key and saves it on the blockchain, after the user obtains the encrypted user electricity purchase record table through private key decryption, he can obtain the encrypted second encryption key on the blockchain, and decode the encrypted second encryption key with the private key to obtain the second encryption key, and then decrypt the encrypted user electricity purchase record table with the second encryption password to access the user electricity purchase record table, while the unauthorized power supplier cannot access the user electricity purchase record table, thereby achieving the purpose of authority control.

[0073] The embodiment of the present application performs symmetric algorithm encryption on each data table. For the symmetric key of the symmetric algorithm, the symmetric key is asymmetrically encrypted using the identity identification public key of the authorized object on the chain and then stored on the chain, thereby effectively solving the risk of database storage leakage and preventing intrusion and unauthorized access from inside and outside the organizational structure; implementing on-chain access permission control on the blockchain solves the problem that ordinary blockchains cannot achieve data privacy and access permission control, greatly simplifying the security problems of traditional data chaining.

[0074] Furthermore, when it is necessary to supervise electricity transactions, an on-chain account can be created for the regulator, and a node can be established as a supervision node. At the same time, the above table query can be authorized to the supervision account so that it can synchronize the above table data and realize data supervision.

[0075] In the embodiment of the present application, a blockchain network is constructed, and a traditional database is configured on the target node of the blockchain network for connection to synchronize the on-chain data to the traditional database. The power supplier equipment information table, user power purchase record table and monthly settlement table constructed based on the energy power purchase transaction data are encrypted and synchronized to the traditional database, thereby improving the security of the transaction data. The traditional database is decentralizedly maintained through blockchain technology, reducing the risk of data tampering, thereby improving the existing energy power purchase transaction system that uses a centralized database to store transaction data, resulting in a high risk of transaction data tampering and low data security. Technical problems.

[0076] The above is an embodiment of a blockchain-based energy purchase and electricity transaction data protection method provided by the present application, and the following is an embodiment of a blockchain-based energy purchase and electricity transaction data protection device provided by the present application.

[0077] Please refer to Figure 3 , an energy purchase and electricity transaction data protection device based on blockchain provided in an embodiment of the present application includes:

[0078] A construction unit is used to configure a traditional database on a target node of the blockchain network for connection after the blockchain network is built, so as to synchronize the on-chain data to the traditional database;

[0079] A broadcast unit, which is used to build a power supply equipment information table and a power supply product information table, and then broadcast the power supply product information table to the blockchain network for selection by users on the blockchain network;

[0080] The first recording unit is used to construct a user electricity purchase record table. When a user submits an electricity purchase request on the blockchain network, the electricity purchase calculation is performed through the smart contract, and the obtained electricity purchase information is recorded in the user electricity purchase record table corresponding to the user;

[0081] The second recording unit is used to construct the monthly settlement table, perform monthly settlement through the smart contract, and record the settlement information obtained in the monthly settlement table;

[0082] The encryption and synchronization unit is used to encrypt the power supply equipment information table, the user power purchase record table and the monthly settlement table, and synchronize the encrypted power supply equipment information table, the encrypted user power purchase record table and the encrypted monthly settlement table to the traditional database.

[0083] As a further improvement, the monthly settlement table includes the user monthly settlement table and the power supplier monthly settlement table.

[0084] As a further improvement, the encryption and synchronization unit is specifically used for:

[0085] The power supply party device information table is symmetrically encrypted using the first encryption key to obtain an encrypted power supply party device information table, and the first encryption key is asymmetrically encrypted using the public key of the first authorized object of the power supply party device information table and then stored on the blockchain;

[0086] The user's electricity purchase record table is symmetrically encrypted using the second encryption key to obtain an encrypted user's electricity purchase record table, and the second encryption key is asymmetrically encrypted using the public key of the second authorized object of the user's electricity purchase record table and then stored on the blockchain;

[0087] Symmetrically encrypt the user monthly settlement table using a third encryption key to obtain an encrypted user monthly settlement table;

[0088] Symmetrically encrypt the monthly settlement sheet of the power supplier by using the fourth encryption key to obtain the encrypted monthly settlement sheet of the power supplier;

[0089] The encrypted power supply equipment information table, encrypted user electricity purchase record table and encrypted monthly settlement table are synchronized to the traditional database.

[0090] As a further improvement, it further includes: a permission control unit, which is used to:

[0091] Asymmetrically encrypting the encrypted power supply device information table through the public key of the first authorized object to authorize the first authorized object to have access rights to the encrypted power supply device information table;

[0092] The encrypted user electricity purchase record table is asymmetrically encrypted through the public key of the second authorization object to authorize the second authorization object to have access rights to the encrypted user electricity purchase record table.

[0093] As a further improvement, the system further comprises: a supervision unit, configured to:

[0094] A supervision node is set up in the blockchain network, and access rights to the encrypted power supply equipment information table, the encrypted user electricity purchase record table and the encrypted monthly settlement table are authorized to the supervision node for data table supervision.

[0095] In the embodiment of the present application, a blockchain network is constructed, and a traditional database is configured on the target node of the blockchain network for connection to synchronize the on-chain data to the traditional database. The power supplier equipment information table, user power purchase record table and monthly settlement table constructed based on the energy power purchase transaction data are encrypted and synchronized to the traditional database, thereby improving the security of the transaction data. The traditional database is decentralizedly maintained through blockchain technology, reducing the risk of data tampering, thereby improving the existing energy power purchase transaction system that uses a centralized database to store transaction data, resulting in a high risk of transaction data tampering and low data security. Technical problems.

[0096] The embodiment of the present application also provides an electronic device, the device comprising a processor and a memory;

[0097] The memory is used to store the program code and transmit the program code to the processor;

[0098] The processor is used to execute the blockchain-based energy purchase and electricity transaction data protection method in the aforementioned method embodiment according to the instructions in the program code.

[0099] The embodiment of the present application also provides a computer-readable storage medium, which is used to store program code. When the program code is executed by a processor, the blockchain-based energy purchase and electricity transaction data protection method in the aforementioned method embodiment is implemented.

[0100] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0101] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein, for example. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0102] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0103] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

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

[0105] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0106] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for executing all or part of the steps of the method described in each embodiment of the present application through a computer device (which can be a personal computer, a server, or a network device, etc.). The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (full name in English: Read-Only Memory, English abbreviation: ROM), random access memory (full name in English: Random Access Memory, English abbreviation: RAM), disk or optical disk and other media that can store program codes.

[0107] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for protecting energy purchase and electricity transaction data based on blockchain, characterized in that: include: After building the blockchain network, configure a traditional database on the target node of the blockchain network for connection to synchronize the on-chain data to the traditional database; After constructing the power supply party equipment information table and the power supply party product information table, broadcasting the power supply party product information table to the blockchain network for selection by users on the blockchain network; After the user electricity purchase record table is constructed, when a user submits an electricity purchase request on the blockchain network, the electricity purchase calculation is performed through the smart contract, and the obtained electricity purchase information is recorded in the user electricity purchase record table corresponding to the user; After the monthly settlement table is constructed, monthly settlement is performed through the smart contract, and the settlement information obtained from the settlement is recorded in the monthly settlement table; the monthly settlement table includes the monthly settlement table for users and the monthly settlement table for power suppliers; Encrypting the power supply equipment information table, the user power purchase record table and the monthly settlement table, and synchronizing the encrypted power supply equipment information table, the encrypted user power purchase record table and the encrypted monthly settlement table to the traditional database; The specific process of encrypting the power supply equipment information table, the user power purchase record table and the monthly settlement table is as follows: Symmetrically encrypt the power supply device information table using a first encryption key to obtain an encrypted power supply device information table, and asymmetrically encrypt the first encryption key using a public key of a first authorized object of the power supply device information table and save the asymmetrically encrypted first encryption key on the blockchain; Symmetrically encrypt the user electricity purchase record table using a second encryption key to obtain an encrypted user electricity purchase record table, and asymmetrically encrypt the second encryption key using a public key of a second authorized object of the user electricity purchase record table and save the encrypted data on the blockchain; Symmetrically encrypting the user monthly settlement table by using a third encryption key to obtain an encrypted user monthly settlement table; Symmetrically encrypt the monthly settlement table of the power supplier by using a fourth encryption key to obtain an encrypted monthly settlement table of the power supplier; The method further comprises: Asymmetrically encrypting the encrypted power supply device information table by using the public key of the first authorized object to authorize the first authorized object to have access rights to the encrypted power supply device information table; The encrypted user electricity purchase record table is asymmetrically encrypted through the public key of the second authorization object to authorize the second authorization object to have access rights to the encrypted user electricity purchase record table.

2. The method for protecting energy purchase and electricity transaction data based on blockchain according to claim 1 is characterized in that: The method further comprises: A supervision node is set in the blockchain network, and the access rights to the encrypted power supply equipment information table, the encrypted user electricity purchase record table and the encrypted monthly settlement table are authorized to the supervision node to perform data table supervision.

3. A blockchain-based energy purchase and electricity transaction data protection device, characterized in that: include: A construction unit, configured to configure a traditional database on a target node of the blockchain network for connection after the blockchain network is constructed, so as to synchronize the on-chain data to the traditional database; A broadcast unit, configured to construct a power supply equipment information table and a power supply product information table, and then broadcast the power supply product information table to the blockchain network for selection by users on the blockchain network; The first recording unit is used to construct a user electricity purchase record table, and when a user submits an electricity purchase request on the blockchain network, the electricity purchase calculation is performed through the smart contract, and the obtained electricity purchase information is recorded in the user electricity purchase record table corresponding to the user; A second recording unit is used to construct a monthly settlement table, perform monthly settlement through a smart contract, and record the settlement information obtained in the monthly settlement table; the monthly settlement table includes a monthly settlement table for users and a monthly settlement table for power suppliers; An encryption and synchronization unit, used to encrypt the power supply party equipment information table, the user power purchase record table and the monthly settlement table, and synchronize the encrypted power supply party equipment information table, the encrypted user power purchase record table and the encrypted monthly settlement table to the traditional database; The encryption and synchronization unit is specifically used for: Symmetrically encrypt the power supply device information table using a first encryption key to obtain an encrypted power supply device information table, and asymmetrically encrypt the first encryption key using a public key of a first authorized object of the power supply device information table and save the asymmetrically encrypted first encryption key on the blockchain; Symmetrically encrypt the user electricity purchase record table using a second encryption key to obtain an encrypted user electricity purchase record table, and asymmetrically encrypt the second encryption key using a public key of a second authorized object of the user electricity purchase record table and save the encrypted data on the blockchain; Symmetrically encrypting the user monthly settlement table by using a third encryption key to obtain an encrypted user monthly settlement table; Symmetrically encrypt the monthly settlement table of the power supplier by using a fourth encryption key to obtain an encrypted monthly settlement table of the power supplier; Synchronizing the encrypted power supplier equipment information table, the encrypted user power purchase record table and the encrypted monthly settlement table to the traditional database; The device further comprises: a permission control unit, configured to: Asymmetrically encrypting the encrypted power supply device information table by using the public key of the first authorized object to authorize the first authorized object to have access rights to the encrypted power supply device information table; The encrypted user electricity purchase record table is asymmetrically encrypted through the public key of the second authorization object to authorize the second authorization object to have access rights to the encrypted user electricity purchase record table.

4. An electronic device, characterized in that: The device comprises a processor and a memory; The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the blockchain-based energy purchase and electricity transaction data protection method described in any one of claims 1-2 according to the instructions in the program code.

5. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store program code, and when the program code is executed by the processor, it implements the blockchain-based energy purchase and electricity transaction data protection method described in any one of claims 1-2.