A blockchain-based energy storage data management method and related devices
By obtaining energy storage data on the blockchain and encrypting and comparing it, the problem of errors in the upload process of energy storage data is solved, and the reliability and accuracy of data management are improved.
Patent Information
- Application Number
- CN202011374871.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-30
- Publication Date
- 2025-07-01
- Estimated Expiration
- 2040-11-30
AI Technical Summary
In the prior art, unexpected changes may occur in the process of uploading the energy storage data in the blockchain process, resulting in errors in the data after being on-chain, affecting the reliability of energy storage data management based on blockchain technology.
By obtaining the energy storage data to be put on and storing it into the first database of the middleware, encrypting it, then rolling it into the transaction ID, and then saving the corresponding data into the second database of the middleware, comparing it to determine whether the data is consistent, and outputting exception prompt information to ensure data accuracy.
The reliability of blockchain energy storage data management is improved, and the accuracy and completeness of the data are determined by comparing data changes is ensured.
Smart Images

Figure CN112560052B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of blockchain technology, and in particular to a method for managing energy storage data based on blockchain and related devices. Background Art
[0002] With the development of the times, the scale of renewable energy in China has been continuously expanding, and the trading volume in the energy market is also increasing. To ensure the credibility of the energy market, blockchain technology is usually introduced to manage the data involved in the energy market (such as energy storage data).
[0003] Research has found that during the process of uploading energy storage data to the blockchain (i.e., the on-chain process), the energy storage data may unexpectedly change for some reason, resulting in errors in the energy storage data after being on the chain from the very beginning. Currently, there is no good method for users to detect whether the energy storage data on the blockchain has changed compared with that before being on the chain, which seriously affects the reliability of managing energy storage data based on blockchain technology. Summary of the Invention
[0004] This application provides a method for managing energy storage data based on blockchain and related devices, which can effectively improve the reliability of managing energy storage data based on blockchain.
[0005] To achieve the above technical effects, the first aspect of this application provides a method for managing energy storage data based on blockchain, including:
[0006] Obtain the energy storage data to be on the chain;
[0007] Store the above energy storage data to be on the chain in the first database of the middleware;
[0008] Perform an on-chain operation on the above energy storage data to be on the chain, so as to store the above energy storage data to be on the chain in the blockchain and obtain the corresponding transaction ID;
[0009] Based on the obtained transaction ID, obtain the corresponding data from the above blockchain and store it in the second database of the middleware.
[0010] Based on the first aspect of this application, in the first possible implementation manner, the above obtaining the energy storage data to be on the chain includes:
[0011] Identify the input energy storage data to determine the data that needs to be encrypted and the data that does not need to be encrypted;
[0012] Encrypt the above data that needs to be encrypted;
[0013] Use the encrypted above data that needs to be encrypted and the above data that does not need to be encrypted as the energy storage data to be on the chain.
[0014] Based on the first possible implementation of the first aspect of the present application, in the second possible implementation, the above-mentioned identification of the input energy storage data to determine the data to be encrypted and the data not to be encrypted includes:
[0015] Identifying the target fields of the input energy storage data;
[0016] Based on the target fields identified in the above-mentioned input energy storage data, determining the data to be encrypted in the above-mentioned input energy storage data.
[0017] Based on the second possible implementation of the first aspect of the present application, in the third possible implementation, the above-mentioned target fields include more than one category of fields;
[0018] The above-mentioned encryption of the above-mentioned data to be encrypted includes:
[0019] Based on the above-mentioned more than one category of fields, determining the importance of each part of the data in the above-mentioned data to be encrypted;
[0020] Based on the encryption methods corresponding to the importance of each of the above-mentioned parts of the data, encrypting each of the above-mentioned parts of the data separately.
[0021] Based on the first aspect of the present application or the first, second, or third possible implementation of the first aspect of the present application, in the fourth possible implementation, the above-mentioned energy storage data management method further includes:
[0022] When receiving a blockchain energy storage data request instruction, determining whether the user sending the above-mentioned blockchain energy storage data request instruction has the corresponding permission;
[0023] If the above-mentioned user has the corresponding permission, outputting the decrypted corresponding energy storage data to the above-mentioned user based on the energy storage data requested by the above-mentioned blockchain energy storage data request instruction;
[0024] If the above-mentioned user does not have the corresponding permission, prompting that the above-mentioned user does not have the corresponding permission.
[0025] Based on the first aspect of the present application or the first, second, or third possible implementation of the first aspect of the present application, in the fifth possible implementation, after obtaining the corresponding data from the above-mentioned blockchain based on the obtained transaction ID and storing it in the second database of the above-mentioned middleware, the above-mentioned energy storage data management method further includes:
[0026] Determining whether the energy storage data to be uploaded to the blockchain in the above-mentioned first database is consistent with the obtained corresponding data;
[0027] If the energy storage data to be uploaded to the blockchain in the above-mentioned first database is inconsistent with the obtained corresponding data, outputting an exception prompt message.
[0028] The second aspect of the present application provides a blockchain-based energy storage data management device, including:
[0029] An acquisition unit, configured to acquire energy storage data to be uploaded to the blockchain;
[0030] A first storage unit, configured to store the energy storage data to be uploaded to the blockchain in a first database of the middleware;
[0031] An uploading unit, configured to perform an uploading operation on the energy storage data to be uploaded to the blockchain, so as to store the energy storage data to be uploaded to the blockchain and obtain a corresponding transaction ID;
[0032] A second storage unit, configured to obtain corresponding data from the blockchain based on the obtained transaction ID and store the data in a second database of the middleware.
[0033] Based on the second aspect of the present application, in a first possible implementation manner, the acquisition unit is specifically configured to:
[0034] Identify the input energy storage data to determine encrypted data and unencrypted data therefrom;
[0035] Encrypt the encrypted data;
[0036] Use the encrypted encrypted data and the unencrypted data as the energy storage data to be uploaded to the blockchain.
[0037] The third aspect of the present application provides a blockchain-based energy storage data management device, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the steps of the energy storage data management method mentioned in the first aspect or any possible implementation manner of the first aspect are implemented.
[0038] The fourth aspect of the present application provides a computer-readable storage medium. The computer-readable storage medium has a computer program, and when the computer program is executed by a processor, the steps of the energy storage data management method mentioned in the first aspect or any possible implementation manner of the first aspect are implemented.
[0039] As can be seen from the above, the technical solution of this application obtains the energy storage data to be uploaded to the blockchain; stores the energy storage data to be uploaded in the first database of the middleware; performs an operation to upload the energy storage data to be uploaded, so as to store the energy storage data to be uploaded in the blockchain and obtain the corresponding transaction ID; based on the obtained transaction ID, obtains the corresponding data from the blockchain and stores it in the second database of the middleware, so that the user can compare the energy storage data to be uploaded with the obtained corresponding data to determine whether the obtained corresponding data has changed compared with the energy storage data to be uploaded, and further determine whether there is an error in the energy storage data on the blockchain, which can effectively improve the reliability of energy storage data management based on the blockchain. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0041] Figure 1 FIG. is a schematic flowchart of an embodiment of a method for managing energy storage data based on a blockchain provided by the present application;
[0042] Figure 2 FIG. is a schematic structural diagram of an embodiment of a device for managing energy storage data based on a blockchain provided by the present application;
[0043] Figure 3 FIG. is a schematic structural diagram of another embodiment of a device for managing energy storage data based on a blockchain provided by the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0044] In the following description, specific details such as specific system structures and technologies are proposed for the purpose of illustration rather than limitation, so as to thoroughly understand the embodiments of the present application. However, those skilled in the art should clearly understand that the present application can also be implemented in other embodiments without these specific details. In other cases, the detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid unnecessary details from interfering with the description of the present application.
[0045] It should be understood that when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, wholes, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.
[0046] It should also be understood that the terms used in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. As used in the specification of this application and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include the plural forms.
[0047] Next, in conjunction with the accompanying drawings in the embodiments of this application, the technical solutions in the embodiments of this application will be clearly and completely described. Obviously, the described embodiments are only a part of the embodiments of this application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of this application.
[0048] In the following description, many specific details are set forth in order to fully understand this application. However, this application can also be implemented in other ways different from those described herein. Those skilled in the art can make similar generalizations without departing from the connotation of this application. Therefore, this application is not limited by the specific embodiments disclosed below.
[0049] Embodiment 1
[0050] This application provides a blockchain-based energy storage data management method, as Figure 1 shown, including:
[0051] Step 101, obtaining energy storage data to be uploaded to the blockchain;
[0052] In the embodiments of this application, the input energy storage data from the user is received, and then the energy storage data can be further processed such as identification and / or encryption to obtain the energy storage data to be uploaded to the blockchain.
[0053] Optionally, the above-mentioned obtaining of the energy storage data to be uploaded to the blockchain includes:
[0054] Identifying the input energy storage data to determine the data to be encrypted and the data not to be encrypted therefrom;
[0055] Encrypting the above-mentioned data to be encrypted;
[0056] Taking the encrypted above-mentioned data to be encrypted and the above-mentioned data not to be encrypted as the energy storage data to be uploaded to the blockchain.
[0057] In an application scenario, an interface for uploading energy storage data is preset in advance. When the user inputs energy storage data, the corresponding interface can be called to input the corresponding energy storage data or specify an encryption method. For example, an interface as shown in Table 1 can be preset in advance:
[0058] Table 1
[0059]
[0060]
[0061] Users can input corresponding data into the interfaces shown in Table 1 above according to their needs, and the data input from different interfaces will be subject to corresponding data processing.
[0062] In another application scenario, when a user inputs energy storage data, the user can divide each piece of data in the energy storage data to determine the data that needs to be encrypted and the data that does not need to be encrypted in the energy storage data. For example: the energy storage data input by the user includes a first part of data and a second part of data. The user can, according to their own needs, divide the first part of data into data that does not need to be encrypted and attach a corresponding label (such as a label indicating that it does not need to be encrypted), and divide the second part of data into data that needs to be encrypted and attach a corresponding label (such as a label indicating that it needs to be encrypted), so as to subsequently identify and / or encrypt the corresponding data in the energy storage data input by the user to obtain the energy storage data to be uploaded to the chain.
[0063] Furthermore, the above-mentioned label can be manifested as a specific field. Identifying the input energy storage data to determine the data that needs to be encrypted and the data that does not need to be encrypted includes:
[0064] Identifying the target field of the input energy storage data;
[0065] Based on the target field identified in the above-mentioned input energy storage data, determining the data that needs to be encrypted in the above-mentioned input energy storage data.
[0066] Specifically, the data containing the target field can be determined as the data that needs to be encrypted, and the data not containing the target field can be determined as the data that does not need to be encrypted; alternatively, the data containing one type of target field can be determined as the data that needs to be encrypted, and the data containing another type of target field can be determined as the data that does not need to be encrypted.
[0067] Even further, the above-mentioned target field contains more than one category of fields;
[0068] The above-mentioned encrypting of the above-mentioned data that needs to be encrypted includes:
[0069] Based on the above-mentioned more than one category of fields, determining the importance of each part of the data in the above-mentioned data that needs to be encrypted;
[0070] Based on the encryption method corresponding to the importance of each of the above-mentioned parts of the data, encrypting each of the above-mentioned parts of the data separately.
[0071] Specifically, different partial data corresponding to different fields in the target field can be preset, with different degrees of importance; when encrypting each of the above partial data, an encryption algorithm with high complexity can be used to encrypt the partial data whose importance is higher than the preset value, while an encryption algorithm with low complexity can be used to encrypt the partial data whose importance is not higher than the preset value, so that the partial data with importance higher than the preset value after encryption is more difficult to be cracked by outsiders, and the partial data with importance not higher than the preset value after encryption is more convenient for users to decrypt;
[0072] Among them, the above target field can be one or more fields among date, energy storage ID, moment point number, actual active power value of energy storage, upper limit of energy storage charging power, and other types of data, which can be specifically set according to the user's needs. The importance of different fields can also be set according to the user's needs, and no limitations are made here; the above encryption method can be any one of AES encryption algorithm, DES encryption algorithm, and other types of encryption algorithms, and no limitations are made here.
[0073] Optionally, after the above encrypted data to be encrypted and the above non-encrypted data are used as the energy storage data to be uploaded to the blockchain, the above energy storage data management method further includes:
[0074] Compress the above energy storage data to be uploaded to the blockchain to speed up the subsequent process of storing the above energy storage data to be uploaded to the blockchain and save the storage space of the blockchain.
[0075] Specifically, the above compression process of the above energy storage data to be uploaded to the blockchain includes:
[0076] Compress the above energy storage data to be uploaded to the blockchain based on a preset compression algorithm, and then encode the compressed energy storage data to be uploaded to the blockchain based on a preset encoding algorithm. Among them, the above preset compression algorithm is a lossless compression algorithm or other types of compression algorithms, and the above preset encoding algorithm can be a base64 encoding algorithm or other types of encoding algorithms, and no limitations are made here.
[0077] Step 102, store the above energy storage data to be uploaded to the blockchain in the first database of the middleware;
[0078] In the embodiment of the present application, the energy storage data to be uploaded to the blockchain obtained in step 101 is stored in the first database of the middleware, and then the deposit ID returned by the middleware after storing the above energy storage data to be uploaded to the blockchain is obtained and sent to the user. The deposit ID is used for the user to query the corresponding energy storage data to be uploaded to the blockchain in the middleware.
[0079] Step 103, perform an operation to upload the above energy storage data to the blockchain to store the above energy storage data to be uploaded to the blockchain in the blockchain and obtain the corresponding transaction ID;
[0080] In the embodiment of the present application, the energy storage data to be chained obtained in step 101 is chained, that is, the energy storage data to be chained is stored in the blockchain, and the transaction ID returned by the blockchain after storing the energy storage data to be chained is obtained. The transaction ID is data with an identification function unique to each energy storage data to be chained, and the transaction IDs of different energy storage data to be chained are different. In addition, the transaction ID can be data included in the energy storage data to be chained or data generated by the blockchain based on the energy storage data to be chained.
[0081] Step 104, based on the obtained transaction ID, obtain the corresponding data from the above blockchain and store it in the second database of the above middleware.
[0082] In the embodiment of the present application, the transaction ID can be queried in the blockchain to obtain the corresponding data. After finding the corresponding data, the corresponding data is unchained, that is, the corresponding data is obtained from the blockchain, and then the corresponding data is stored in the second database of the middleware, so that the user can compare the energy storage data to be chained in the first database with the corresponding data in the second database (the corresponding data is the data corresponding to the energy storage data to be chained obtained from the blockchain based on the transaction ID), and then it can be determined whether there is an error in the energy storage data on the blockchain.
[0083] Optionally, after obtaining the corresponding data from the above blockchain based on the obtained transaction ID and storing it in the second database of the above middleware, the above energy storage data management method further includes:
[0084] Determine whether the energy storage data to be chained in the first database is consistent with the obtained corresponding data;
[0085] If the energy storage data to be chained in the first database is inconsistent with the obtained corresponding data, an exception prompt message is output.
[0086] Specifically, the transaction ID can be first queried on the blockchain to determine whether the data corresponding to the transaction ID has been stored in the blockchain;
[0087] If the data corresponding to the transaction ID has not been stored in the blockchain, this step ends;
[0088] If the data corresponding to the transaction ID has been stored in the blockchain, determine whether the type of the data corresponding to the transaction ID is one of the preset specified types. If not, end this step. If so, parse the data corresponding to the transaction ID, and then extract the data corresponding to the above-mentioned energy storage data to be uploaded to the blockchain from the parsed data corresponding to the transaction ID, and store the data corresponding to the above-mentioned energy storage data to be uploaded to the blockchain in the second database of the middleware. It should be noted that the data obtained after parsing the data corresponding to the transaction ID not only includes the data corresponding to the above-mentioned energy storage data to be uploaded to the blockchain, but also includes some information automatically added by the blockchain to this information (such as various tags for easy management, or associated smart contract information). Therefore, it is necessary to extract the data corresponding to the transaction ID after parsing to obtain the data corresponding to the above-mentioned energy storage data to be uploaded to the blockchain.
[0089] Among them, the above-mentioned querying on the blockchain based on the transaction ID to determine whether the data corresponding to the transaction ID has been stored in the blockchain may include:
[0090] Determine the specified block height based on the transaction ID, and then determine the target block based on the hash value included in the block with the above-mentioned specified block height;
[0091] Detect whether the transaction ID list of the above-mentioned target block contains the above-mentioned transaction ID. If it contains, it is determined that the data corresponding to the transaction ID has been stored in the blockchain. If it does not contain, it is determined that the data corresponding to the transaction ID has not been stored in the blockchain.
[0092] Specifically, after obtaining the corresponding data from the above-mentioned blockchain based on the obtained transaction ID and storing the transaction ID and the above-mentioned corresponding data in the second database of the above-mentioned middleware, output a corresponding prompt to inform the user that the energy storage data to be uploaded to the blockchain and the corresponding data of the transaction ID obtained after storing the energy storage data to be uploaded to the blockchain have been respectively stored in the first database and the second database.
[0093] Optionally, the above-mentioned energy storage data management method further includes:
[0094] When receiving a blockchain energy storage data request instruction, determine whether the user who sent the above-mentioned blockchain energy storage data request instruction has the corresponding permission;
[0095] If the above-mentioned user has the corresponding permission, output the decrypted corresponding energy storage data to the above-mentioned user based on the energy storage data requested by the above-mentioned blockchain energy storage data request instruction;
[0096] If the above-mentioned user does not have the corresponding permission, prompt the above-mentioned user that they do not have the corresponding permission.
[0097] Specifically, the user who stores the energy storage data to be chained has the highest level of the above corresponding permissions. The user with the highest level of the above corresponding permissions can fully authorize, partially authorize, or revoke permissions for any other user at will. Fully authorizing a user means granting the user the corresponding permissions to obtain all the data of the above corresponding data. Partially authorizing a user means granting the user the corresponding permissions to obtain some of the data of the above corresponding data. Revoking permissions from a user means taking back the corresponding permissions granted to the user. For example, if an energy storage center uploads an energy storage data to be chained to the blockchain, the energy storage center can perform the above full authorization, partial authorization, or revocation of permissions on nodes or users such as the trading center, the finance department, and the marketing department. Among them, full authorization can be directly sending the above transaction ID to the corresponding user, so that the user who obtains the transaction ID can obtain the corresponding data from the blockchain.
[0098] Specifically, for the energy storage data requested based on the above blockchain energy storage data request instruction, outputting the decrypted corresponding energy storage data to the above user specifically is as follows:
[0099] Query and obtain the corresponding blockchain energy storage data from the blockchain based on the above blockchain energy storage data request instruction, decrypt the above blockchain energy storage data, and then output the decrypted above blockchain energy storage data to the above user.
[0100] As can be seen from the above, the technical solution of the present application obtains the energy storage data to be chained; stores the energy storage data to be chained in the first database of the middleware; performs a chaining operation on the energy storage data to be chained to store the energy storage data to be chained in the blockchain and obtain the corresponding transaction ID; based on the obtained transaction ID, obtains the corresponding data from the blockchain and stores it in the second database of the middleware, so that the user can compare the energy storage data to be chained with the obtained corresponding data to determine whether the obtained corresponding data has changed compared with the energy storage data to be chained, and further determine whether there is an error in the energy storage data on the blockchain, which can effectively improve the reliability of energy storage data management based on the blockchain.
[0101] Embodiment 2
[0102] The present application provides an energy storage data management device based on a blockchain, as Figure 2 shown. The energy storage data management device 20 includes:
[0103] An acquisition unit 201, configured to acquire energy storage data to be chained;
[0104] A first storage unit 202, configured to store the above energy storage data to be chained in the first database of the middleware;
[0105] A chaining unit 203, configured to perform a chaining operation on the above energy storage data to be chained to store the above energy storage data to be chained in the blockchain and obtain the corresponding transaction ID;
[0106] A second storage unit 204, configured to obtain corresponding data from the blockchain based on the obtained transaction ID and store the data in the second database of the middleware.
[0107] Optionally, the obtaining unit 201 is specifically configured to:
[0108] Identify the input energy storage data to determine encrypted data and non-encrypted data therefrom;
[0109] Encrypt the encrypted data;
[0110] Use the encrypted encrypted data and the non-encrypted data as the energy storage data to be uploaded to the blockchain.
[0111] Furthermore, the obtaining unit 201 is specifically further configured to:
[0112] Identify target fields in the input energy storage data;
[0113] Based on the target fields identified in the input energy storage data, determine the encrypted data in the input energy storage data.
[0114] Furthermore, the target fields include fields of more than one category;
[0115] The obtaining unit 201 is specifically further configured to:
[0116] Based on the fields of more than one category, determine the importance of each part of the encrypted data;
[0117] Encrypt each part of the data based on an encryption method corresponding to the importance of each part of the data.
[0118] Optionally, the energy storage data management device 20 further includes:
[0119] A downlink unit 205, configured to:
[0120] When receiving a blockchain energy storage data request instruction, determine whether the user sending the blockchain energy storage data request instruction has corresponding permissions;
[0121] When the user has corresponding permissions, output the decrypted corresponding energy storage data to the user based on the energy storage data requested by the blockchain energy storage data request instruction;
[0122] When the user does not have corresponding permissions, prompt the user that they do not have corresponding permissions.
[0123] Optionally, the second storage unit 204 is further configured to:
[0124] Determine whether the energy storage data to be chained in the first database is consistent with the corresponding data obtained;
[0125] When the energy storage data to be chained in the first database is inconsistent with the corresponding data obtained, an exception prompt message is output.
[0126] As can be seen from the above, the technical solution of this application obtains the energy storage data to be chained; stores the energy storage data to be chained in the first database of the middleware; performs a chaining operation on the energy storage data to be chained to store the energy storage data to be chained in the blockchain and obtain the corresponding transaction ID; based on the obtained transaction ID, obtains the corresponding data from the blockchain and stores it in the second database of the middleware, so that the user can compare the energy storage data to be chained with the corresponding data obtained to determine whether the corresponding data obtained has changed compared with the energy storage data to be chained, and further determine whether there is an error in the energy storage data on the blockchain, which can effectively improve the reliability of energy storage data management based on the blockchain.
[0127] Embodiment III
[0128] This application also provides another energy storage data management device based on the blockchain, as Figure 3 shown, the energy storage data management device in the embodiment of this application includes: a memory 301, a processor 302, and a computer program stored in the memory 301 and operable on the processor 302, where: the memory 301 is used to store software programs and modules, and the processor 302 executes various functional applications and data processing by running the software programs and modules stored in the memory 301, and the memory 301 and the processor 302 are connected through a bus 303.
[0129] Specifically, when the processor 302 runs the above computer program, the following steps are implemented:
[0130] Obtain the energy storage data to be chained;
[0131] Store the above energy storage data to be chained in the first database of the middleware;
[0132] Perform a chaining operation on the above energy storage data to be chained to store the above energy storage data to be chained in the blockchain and obtain the corresponding transaction ID;
[0133] Based on the obtained transaction ID, obtain the corresponding data from the above blockchain and store it in the above second database of the middleware.
[0134] Assume the above is the first possible implementation manner, then in the second possible implementation manner based on the first possible implementation manner above, the above obtaining the energy storage data to be chained includes:
[0135] Identify the input energy storage data to determine the data to be encrypted and the data not to be encrypted therefrom;
[0136] Encrypt the above data to be encrypted;
[0137] Use the encrypted data to be encrypted and the data not to be encrypted as the energy storage data to be uploaded to the blockchain.
[0138] In the third possible implementation mode based on the above second possible implementation mode, the above identification of the input energy storage data to determine the data to be encrypted and the data not to be encrypted includes:
[0139] Identify the target fields of the input energy storage data;
[0140] Based on the target fields identified in the above input energy storage data, determine the data to be encrypted in the above input energy storage data.
[0141] In the fourth possible implementation mode based on the above third possible implementation mode, the above target fields include more than one category of fields;
[0142] The above encryption of the above data to be encrypted includes:
[0143] Based on the above more than one category of fields, determine the importance of each part of the data to be encrypted;
[0144] Based on the encryption methods corresponding to the importance of each part of the data, encrypt each part of the data respectively.
[0145] In the fifth possible implementation mode based on the above first or second or third or fourth possible implementation mode, the above energy storage data management method further includes:
[0146] When receiving a blockchain energy storage data request instruction, determine whether the user sending the above blockchain energy storage data request instruction has the corresponding permission;
[0147] If the above user has the corresponding permission, output the decrypted corresponding energy storage data to the above user based on the energy storage data requested by the above blockchain energy storage data request instruction;
[0148] If the above user does not have the corresponding permission, prompt the above user that they do not have the corresponding permission.
[0149] In the sixth possible implementation mode based on the above first or second or third or fourth possible implementation mode, after obtaining the corresponding data from the above blockchain based on the obtained transaction ID and storing it in the second database of the above middleware, the above energy storage data management method further includes:
[0150] Determine whether the energy storage data to be chained in the first database is consistent with the corresponding data obtained;
[0151] If the energy storage data to be chained in the first database is inconsistent with the corresponding data obtained, an exception prompt message is output.
[0152] As can be seen from the above, the technical solution of the present application obtains the energy storage data to be chained; stores the energy storage data to be chained in the first database of the middleware; performs a chaining operation on the energy storage data to be chained to store the energy storage data to be chained in the blockchain and obtain a corresponding transaction ID; based on the obtained transaction ID, obtains the corresponding data from the blockchain and stores it in the second database of the middleware, so that the user can compare the energy storage data to be chained with the obtained corresponding data to determine whether the obtained corresponding data has changed compared with the energy storage data to be chained, and further determine whether there is an error in the energy storage data on the blockchain, which can effectively improve the reliability of energy storage data management based on the blockchain.
[0153] Embodiment 4
[0154] The present application further provides a computer-readable storage medium with a computer program stored thereon, and when the computer program is executed, the steps provided in the above embodiments can be implemented. Specifically, the computer program includes computer program code, and the computer program code can be in one of the forms of source code, object code, executable file or some intermediate forms, which is not limited herein; the computer-readable storage medium can be any entity or device, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal, and software distribution medium that can carry the above computer program code, which is not limited herein. It should be noted that the content included in the above computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction.
[0155] As can be seen from the above, the technical solution of the present application obtains the energy storage data to be chained; stores the energy storage data to be chained in the first database of the middleware; performs a chaining operation on the energy storage data to be chained to store the energy storage data to be chained in the blockchain and obtain a corresponding transaction ID; based on the obtained transaction ID, obtains the corresponding data from the blockchain and stores it in the second database of the middleware, so that the user can compare the energy storage data to be chained with the obtained corresponding data to determine whether the obtained corresponding data has changed compared with the energy storage data to be chained, and further determine whether there is an error in the energy storage data on the blockchain, which can effectively improve the reliability of energy storage data management based on the blockchain.
[0156] The foregoing description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
[0157] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above division of each functional unit and module is used as an example. In actual applications, the above functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the above device can be divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiments can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit. In addition, the specific names of each functional unit and module are only for the convenience of mutual distinction and do not limit the protection scope of the present application. The specific working processes of the units and modules in the above system can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.
[0158] It should be noted that the methods and their detailed examples provided in the above embodiments can be combined with the devices and equipment provided in the embodiments for mutual reference and will not be elaborated herein.
[0159] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or by a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods for each specific application to implement the described functions, but such implementation should not be considered to exceed the scope of the present application.
[0160] In the embodiments provided in the present application, it should be understood that the disclosed device / terminal device and method can be implemented in other ways. For example, the device / equipment embodiments described above are only illustrative. For example, the above division of modules or units is only a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0161] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A blockchain-based energy storage data management method, characterized in that, Including: Obtain the energy storage data to be chained; Store the energy storage data to be chained in the first database of the middleware; Perform a chaining operation on the energy storage data to be chained, so as to store the energy storage data to be chained in the blockchain and obtain a corresponding transaction ID; Based on the obtained transaction ID, obtain the corresponding data from the blockchain and store it in the second database of the middleware; the corresponding data is the data corresponding to the energy storage data to be chained obtained from the blockchain based on the transaction ID; Judge whether the energy storage data to be chained in the first database is consistent with the obtained corresponding data; If the energy storage data to be chained in the first database is inconsistent with the obtained corresponding data, output an exception prompt message; The obtaining of the energy storage data to be chained includes: Identify the input energy storage data to determine the data to be encrypted and the data not to be encrypted; Encrypt the data to be encrypted; Use the encrypted data to be encrypted and the data not to be encrypted as the energy storage data to be chained; The identifying of the input energy storage data to determine the data to be encrypted and the data not to be encrypted includes: Identify the target fields of the input energy storage data; the target fields are one or more fields among date, energy storage ID, time point number, actual active power value of the energy storage, energy storage power limit, and other types of data; Based on the target fields identified in the input energy storage data, determine the data to be encrypted in the input energy storage data; The target fields include more than one category of fields; The encrypting of the data to be encrypted includes: Based on the more than one category of fields, determine the importance of each part of the data to be encrypted; Encrypt each part of the data respectively based on the encryption method corresponding to the importance of each part of the data.
2. The energy storage data management method according to claim 1, wherein The energy storage data management method further includes: When receiving a blockchain energy storage data request instruction, judge whether the user sending the blockchain energy storage data request instruction has the corresponding permission; If the user has the corresponding permission, output the decrypted corresponding energy storage data to the user based on the energy storage data requested by the blockchain energy storage data request instruction; If the user does not have the corresponding permission, prompt the user that they do not have the corresponding permission.
3. An energy storage data management device based on blockchain, characterized in that, Including: An obtaining unit for obtaining the energy storage data to be chained; A first storage unit for storing the energy storage data to be chained in the first database of the middleware; A chaining unit for performing a chaining operation on the energy storage data to be chained, so as to store the energy storage data to be chained in the blockchain and obtain a corresponding transaction ID; A second storage unit for obtaining the corresponding data from the blockchain based on the obtained transaction ID and storing it in the second database of the middleware; the corresponding data is the data corresponding to the energy storage data to be chained obtained from the blockchain based on the transaction ID; The second storage unit is further used to judge whether the energy storage data to be chained in the first database is consistent with the obtained corresponding data; If the energy storage data to be chained in the first database is inconsistent with the corresponding data obtained, an abnormal prompt message is output; The acquisition unit is specifically configured to: Identify the input energy storage data to determine the data to be encrypted and the data not to be encrypted therefrom; Encrypt the data to be encrypted; Use the encrypted data to be encrypted and the data not to be encrypted as the energy storage data to be chained; The identifying the input energy storage data to determine the data to be encrypted and the data not to be encrypted therefrom includes: Identifying target fields in the input energy storage data; the target fields are one or more fields among date, energy storage ID, time point number, actual active power value of the energy storage, energy storage power upper limit, and other types of data; Based on the target fields identified in the input energy storage data, determine the data to be encrypted in the input energy storage data; The target fields include more than one category of fields; The encrypting the data to be encrypted includes: Based on the more than one category of fields, determine the importance of each part of the data to be encrypted; Based on the encryption methods corresponding to the importance of each part of the data, encrypt each part of the data respectively.
4. An energy storage data management device based on blockchain, characterized in that, It includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the steps of the method according to any one of claims 1 to 2 are implemented.
5. A computer-readable storage medium having a computer program, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 2 are implemented.
Citation Information
Patent Citations
Data synchronization method based on blockchain application system, middleware and system based on blockchain application system
CN107657059A
Data processing method and device
CN108573381A
Receipt storage method and node in combination with user type and transaction typecombining user type and transaction type
CN110264193A