CN115292311A - Energy data management-oriented block chain data storage consensus method and system - Google Patents

Energy data management-oriented block chain data storage consensus method and system Download PDF

Info

Publication number
CN115292311A
CN115292311A CN202210820785.1A CN202210820785A CN115292311A CN 115292311 A CN115292311 A CN 115292311A CN 202210820785 A CN202210820785 A CN 202210820785A CN 115292311 A CN115292311 A CN 115292311A
Authority
CN
China
Prior art keywords
node
nodes
data
storage
accounting
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210820785.1A
Other languages
Chinese (zh)
Inventor
刘朝章
唐琳
张玉豹
邢宏伟
张建辉
李恩堂
薛念明
徐崇豪
李向阳
狄冠东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Dezhou Power Supply Co of State Grid Shandong Electric Power Co Ltd
Shandong Luruan Digital Technology Co Ltd
Original Assignee
Dezhou Power Supply Co of State Grid Shandong Electric Power Co Ltd
Shandong Luruan Digital Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Dezhou Power Supply Co of State Grid Shandong Electric Power Co Ltd, Shandong Luruan Digital Technology Co Ltd filed Critical Dezhou Power Supply Co of State Grid Shandong Electric Power Co Ltd
Priority to CN202210820785.1A priority Critical patent/CN115292311A/en
Publication of CN115292311A publication Critical patent/CN115292311A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2255Hash tables
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2246Trees, e.g. B+trees
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention belongs to the field of block chains, and provides a block chain data storage consensus method and a block chain data storage consensus system for energy data management, wherein the block chain data storage consensus method comprises the steps that an accounting node judges the connection state with all other common nodes, and updates a distributed hash table; based on the updated distributed hash table, the accounting node synchronizes the content data of all other common nodes according to the user requirement; and based on the synchronized content data of all other common nodes, the accounting node counts the storage variation information of each common node and broadcasts the information. The invention realizes a synchronization mechanism of the block chain account book and the data storage under the chain, thereby realizing a consensus method based on the block chain and the network attached storage.

Description

Energy data management-oriented block chain data storage consensus method and system
Technical Field
The invention belongs to the technical field of a block chain, and particularly relates to a block chain data storage consensus method and system for energy data management.
Background
The statements in this section merely provide background information related to the present disclosure and may not necessarily constitute prior art.
With the expansion of energy data market scale and the deepening of application fusion, the energy big data center accumulates massive and diverse data and brings the challenges of management efficiency and safety. The traditional centralized data storage management system cannot meet the requirements of distributed type, high availability and high credibility, and a credible distributed data storage system is urgently needed to adapt to the scene of energy data storage and management. The network attached storage based on the block chain has the characteristics of autonomous controllability, distribution, high reliability and the like, and well meets the requirements of energy data storage. Aiming at the problem, a consensus mechanism is introduced on the basis of the block chain and the network attached storage, so that the aim of safely and reliably managing data is fulfilled.
In the block chain consensus method based on the anonymous main node in the existing scheme, the consensus process of the nodes is mainly carried out through designing a preparation stage, a pre-submission stage, a pre-decision stage and a decision stage, so that expandable and efficient block chain data consensus is realized under the condition of hiding the identity of the main node, an identity authentication mechanism of the anonymous node is included, the block consensus under the anonymous main node is supported, and the possibility of attacking the main node is reduced.
However, the prior art still has some problems, the applicability of the method under the condition of more nodes is not considered in the above method, the consensus time is rapidly reduced under the condition of greatly increasing the number of nodes, and even the situation of being hardly usable is reached, and most consensus algorithms only consider the ledger layer but not the data storage layer, so that the method is not suitable for the network attached storage technology based on the block chain.
Disclosure of Invention
In order to solve the problems, the invention provides a block chain data storage consensus method and a block chain data storage consensus system for energy data management, which realize the routing and positioning functions of data storage by using a Merkle tree, a distributed hash table and consistent hash in a scene of combining a block chain and network attached storage, realize the synchronization mechanism of a block chain account book and data storage under the chain by using a method of using a position mapping algorithm and a bookkeeping node as management nodes, and further realize the consensus method based on the block chain and the network attached storage.
According to some embodiments, a first aspect of the present invention provides a block chain data storage consensus method for energy data management, which adopts the following technical solutions:
the energy data management-oriented block chain data storage consensus method comprises the following steps:
the accounting node packs the transaction book data in the block chain, generates blocks and broadcasts the blocks;
the accounting node judges the connection state with all other common nodes and updates a distributed hash table;
based on the updated distributed hash table, the accounting node synchronizes the content data of all other common nodes according to the user requirement;
and on the basis of the synchronized content data of all other common nodes, the accounting node counts the storage capacity variation information of each common node and broadcasts the storage capacity variation information.
Further, the determination process of the accounting node specifically includes:
initializing all common nodes in the system to obtain the ID of each common node and the corresponding common node storage capacity;
and generating random numbers by the common nodes with the storage capacity above a certain threshold value and broadcasting, carrying out XOR calculation according to the generated random numbers, carrying out position mapping based on the calculated XOR result, and determining the accounting nodes.
Further, initializing all nodes in the system to obtain the ID of each node and the corresponding node storage amount includes:
generating all node IDs in the system through all node IPs through Hash operation;
and counting the storage capacity of each node, and sequencing the nodes from small to large according to the node IDs to obtain the storage capacity information of all the nodes.
Further, the node with the storage amount above a certain threshold generates a random number and broadcasts the random number, performs exclusive or calculation according to the generated random number, performs position mapping based on the calculated exclusive or value result, and determines the accounting node, specifically:
the nodes with the storage capacity above a certain value generate random numbers and broadcast the random numbers;
after all the nodes finish broadcasting, calculating exclusive or values of all the generated random numbers;
based on the calculation, obtaining an exclusive-or value, arranging the nodes from small to large according to the distributed ID values, and sequentially mapping the numbers of the storage capacity of each node to the nodes according to the sequence;
and obtaining the accounting node.
Further, the accounting node determines connection states with all other common nodes, and updates the distributed hash table, specifically:
the accounting node judges the connection state with all other common nodes, and if the other common nodes do not respond, the accounting node is a lost node;
for the lost node, the accounting node updates the distributed hash table and deletes the ID and storage information of the distributed hash table;
the accounting node generates an ID for the newly added node and adds the ID into the distributed hash table;
further, based on the updated distributed hash table, the accounting node synchronizes content data of all other common nodes according to user requirements, specifically:
the accounting node acquires user requirements;
based on the acquired user requirements, the accounting node judges whether a data storage or data reading request exists or not, and if so, the accounting node processes the data storage or data reading request;
and if not, entering the next processing flow.
Further, the accounting node processes the data storage request, including:
verifying whether transaction information corresponding to the stored data exists on the block chain;
and after the verification is successful, calculating the hash value of the stored data, searching the hash value according to a consistent re-hash algorithm, positioning the node corresponding to the stored data for storage, and after the storage is finished, obtaining access excitation of the node corresponding to the stored data.
Further, the accounting node processes the data reading request, including:
verifying whether transaction information corresponding to the read data exists on the block chain;
and after the verification is successful, calculating the hash value of the read data, searching the hash value according to a consistent re-hash algorithm, and positioning the node corresponding to the read data for reading.
Further, the distributed hash table adopts a Merkle file tree, wherein each leaf node represents a file block, the value of the leaf node is the hash value of the file block, and the value of the non-leaf node is the hash operation after the values of the child nodes are spliced.
According to some embodiments, a second aspect of the present invention provides an energy data management-oriented blockchain data storage consensus system, which adopts the following technical solutions:
the energy data management-oriented block chain data storage consensus system comprises a user, a common node and an accounting node, wherein the accounting node is communicated with the common node and the user respectively;
the accounting node judges the connection state with all other common nodes and updates a distributed hash table;
based on the updated distributed hash table, the accounting node synchronizes the content data of all other common nodes according to the user requirement;
and based on the synchronized content data of all other common nodes, the accounting node counts the storage variation information of each common node and broadcasts the information.
Compared with the prior art, the invention has the following beneficial effects:
the invention uses the position mapping algorithm, solves the data synchronization problem of the account book layer; the method of using the accounting node to replace the management node solves the problem of storage layer data synchronization; an incentive mechanism is used to help maintain proper operation of the system.
Compared with other similar products and schemes, the method has richer use scenes, can be suitable for a network attached storage system based on the block chain, and is not available in other schemes.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, are included to provide a further understanding of the invention, and are incorporated in and constitute a part of this specification, illustrate exemplary embodiments of the invention and together with the description serve to explain the invention and not to limit the invention.
Fig. 1 is a flowchart of a blockchain data storage consensus method for energy data management according to an embodiment of the present invention;
fig. 2 is a flowchart of an ledger consensus module of the ledger layer according to an embodiment of the present invention;
FIG. 3 is a flow diagram of a storage tier storage consensus module according to an embodiment of the present invention;
fig. 4 is a system model diagram of a blockchain data storage consensus method for energy data management according to an embodiment of the present invention.
Detailed Description
The invention is further described with reference to the following figures and examples.
It is to be understood that the following detailed description is exemplary and is intended to provide further explanation of the invention as claimed. Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
It is noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of exemplary embodiments according to the invention. As used herein, the singular forms "a", "an", and "the" are intended to include the plural forms as well, and it should be understood that when the terms "comprises" and/or "comprising" are used in this specification, they specify the presence of stated features, steps, operations, devices, components, and/or combinations thereof, unless the context clearly indicates otherwise.
The embodiments and features of the embodiments of the present invention may be combined with each other without conflict.
Example one
As shown in fig. 1, the present embodiment provides a method for energy data management oriented blockchain data storage consensus, including the following steps:
the accounting node packs the transaction account book data in the block chain, generates blocks and broadcasts the blocks;
the accounting node judges the connection state with all other common nodes and updates a distributed hash table;
based on the updated distributed hash table, the accounting node synchronizes the content data of all other common nodes according to the user requirement;
and on the basis of the synchronized content data of all other common nodes, the accounting node counts the storage capacity variation information of each common node and broadcasts the storage capacity variation information.
Specifically, as shown in fig. 1, a specific process of the method according to this embodiment includes:
the method comprises the following steps: system initialization
And distributing IDs for all nodes in the system, wherein the IDs are generated through hash operation according to the ip of the nodes. Meanwhile, the system needs to count the storage capacity of each node, and performs sequencing according to the node IDs from small to large to complete the prepositive work of the position mapping algorithm.
Step two: generating accounting nodes
All nodes with storage above a certain value in the system generate random numbers and broadcast the random numbers. After the broadcasting of all the nodes is finished, the system calculates the exclusive OR value of all the random numbers, and uses a position mapping algorithm to calculate the nodes, namely the accounting nodes.
Step three: account book layer synchronization
And the accounting node packs the block chain account book data, generates a block and broadcasts the block.
Step four: storage tier synchronization
The accounting node is connected with all nodes, the distributed hash table is updated for the lost node, the ID and the memory space information of the lost node are deleted, and the ID is generated for the newly added node and added into the distributed hash table; meanwhile, the accounting node needs to process data storage and reading requests, and for the reading requests, the reading requests are positioned to specific nodes and then read; and for the storage request, after verifying that the corresponding transaction information exists in the block chain, positioning to a corresponding node for storage.
Step five: counting the memory space and obtaining the corresponding excitation value
And the accounting node counts the storage capacity of each node and the total storage capacity of the system, and calculates corresponding incentive according to the contribution size stored in the consensus at this time and an incentive formula in the module 3.
After the consensus process is finished, the next process is ready to be entered.
In the method described in this embodiment, the account book consensus module (1), the storage consensus module (2), and the excitation mechanism module (3) are all divided into three modules, where the module 1 and the module 2 are respectively responsible for data consensus and synchronization mechanisms of the account book layer and the storage layer, and the module 3 is in a unified relationship with the modules 1 and 2 and is responsible for maintaining normal operations of the two modules.
In the module 1, at the beginning of each time, all nodes with storage capacity above a certain threshold generate random numbers and broadcast, then the exclusive or value of the random numbers is calculated in a public mode, the position corresponding to the final result is the storage position in charge of the accounting node, and the node becomes the accounting node and is in charge of packing data. And finally, the bookkeeping node arranges the data volume stored by each node, reorders the storage position of each node, calculates the total data volume of the system, broadcasts information and enters the next moment.
Wherein the threshold is half of the average storage capacity of the nodes.
A position mapping algorithm is used in module 1.
The location mapping algorithm maps the numbers to specific nodes, denoted by g (-). And carrying out XOR processing on all random numbers, arranging the nodes from small to large according to the distributed ID values in a position mapping algorithm, and sequentially mapping the numbers of the memory space of each node to each node according to the sequence. For node n 1 Will be from 1 to C 1 Are all mapped to node n 1 I.e. g (x) = n 1 ,x∈[1,C 1 ]In which C is 1 Is the storage capacity of the node. By analogy, if the node n k Has a memory amount of C k Has been used up before
Figure BDA0003744288760000081
All the previous digits, and therefore all the following
Figure BDA0003744288760000082
Are all mapped to node n k . And realizing the selection of the accounting node by using a position mapping algorithm.
In the module 2, the accounting node determined in the accounting book consensus module needs to be responsible for the function of managing the nodes, and connects all the nodes. For the nodes with broken connections or overtime, after a certain number of attempts, the nodes are judged to exit the network, and the storage positions and the distributed hash table are redistributed. Meanwhile, processing the requests for storing and reading data, positioning the position of the read data through a distributed hash table, and requesting the stored node; after the transaction information of the stored data on the check block chain is stored, the data is subjected to hash calculation and positioning, and is sent to the corresponding node.
The Merkle file tree is used in the module 2, wherein each leaf node represents a file block, the value of the leaf node is the hash value of the file block, and the value of the non-leaf node is the hash operation after the values of the child nodes are spliced, that is:
V parent =H(V lchild ||V rchild )
by using the Merkle file tree, the dependency relationship of a certain file block can be quickly verified, and the quick reading and recovery of the file are facilitated. In addition, the Merkle file tree is constructed for the large file, the root hash is used as the hash value, and compared with the method of directly calculating the hash value, the time required by the method is greatly reduced. The distributed hash table is maintained by each node for routing and positioning to a file storage position, and the storage form is a table.
In module 2, a consistent hashing technique is used that can be used to locate multiple copies of a file: consistent re-hashing techniques.
The consistent re-hashing technology is a special consistent hashing technology, wherein a hash calculation part of a file is optimized, a hash value of the file is connected with a copy number, hash operation is performed again, and a result can be used for positioning a node where the copy with the number is located, namely:
V file =H(V origin ||rep),
wherein, V file Is the hash value, V, in the file redistribution type hash table of the file block origin Is the original hash value of the file block, rep is the copy number, embodied in the form of a number.
By the method, one distributed hash table can be used for positioning the node positions of the multiple different copies, and the storage space using the multiple hash tables is saved.
The Merkle file tree is used for storing file hash, the consistent re-hash technology is used as the consistent hash technology, and the distributed hash table is combined, so that the functions of storing and reading files can be realized.
Module 3 is the excitation mechanism. The excitation mechanism is a key technology in the blockchain network and is used for maintaining the normal operation of the blockchain network. The operation of the block chain needs to be autonomously maintained by the node, and if no direct benefit exists, the node is prone to maliciously attacking the network. Incentive mechanisms in blockchains encourage users to participate in maintaining network operation by using rewards, which may be beneficial for certain specific activities. The motivation is to better promote the aggressiveness of the storage nodes to store data.
There are two stimuli in the method, a consensus stimulus and an access stimulus. The consensus incentive awards the accounting nodes and encourages the nodes to be truthful and confident; the access incentives reward the node storing the data, encouraging the node to actively assist in storing the data.
In block 3, the access incentive decision formula is:
Figure BDA0003744288760000101
wherein,
Figure BDA0003744288760000102
representing the value of the reward that node j obtained on transaction i,
Figure BDA0003744288760000103
representing the amount of data on transaction i for the jth node, C j Representing the storage of node j, F i Representing the cost of transaction i.
The consensus method based on the block chain and the network attached storage comprises three roles of a common node, an accounting node and a user, wherein the accounting node is generated by the common node through calculation.
An embodiment of the present invention is provided below, taking the number of common nodes as an example of 4.
The provided embodiment comprises the following steps:
(1) Initialization
Each node in the system mutually confirms, assigns an ID and records storage information. A preparation of the position mapping algorithm is performed.
Assuming that the IDs of nodes a, B, C, D are aa072e, ac7714, 15112C, 237dac, respectively, and the storage amounts are 3, 4, 1, 2, respectively, then for numbers 1-10, number 1 is mapped to node C, numbers 2, 3 are mapped to node D, numbers 4, 5, 6 are mapped to node a, and numbers 7, 8, 9, 10 are mapped to node B.
(2) Generating and validating accounting nodes
And each node generates a random number and broadcasts the random number, receives the random numbers of other nodes, performs exclusive OR processing, and obtains the accounting node after position mapping. The accounting node sends an acknowledgment broadcast.
Assuming that the random numbers generated by the nodes a, B, C, D are 5, 4, 7, 3, respectively, the four numbers are xored to obtain a number 5, and according to the initialization process of the previous step, the position mapping result of the number 5 is the node a. And the node A broadcasts the message after confirming that the node A is the accounting node.
(3) Accounting node packaging block chain data and broadcasting
And the accounting node packs the transaction information in the period of time to form a block and broadcasts the block.
And the node A packages the transactions in the transaction pool of the node A, and broadcasts the block after forming the block.
(4) The accounting node is responsible for maintaining the stored data and the connection state
The accounting node is connected with other nodes, maintains the connection state information and synchronizes data.
Node A connects nodes B, C, D, checking the connection status. If the connection of the node D is lost, after the reconnection is tried for a certain number of times, the node A judges that the node D is disconnected and exits the network, and the storage capacity of the node A is cleared.
Meanwhile, the node a needs to be responsible for processing storage and reading requests of data. Assuming that a user E requests to read a file F, a node A firstly needs to verify that the user E submits a transaction for storing the file F from a block chain account book, calculates a hash value of the file F by using a hash algorithm after the verification is successful, and searches the hash value according to a consistency re-hash algorithm.
Assuming that the hash value of the file F is 11223F, according to the consistent hash algorithm, the corresponding storage node is node B (11223f = 4, corresponding to the fourth node whose ID is arranged from small to large), node a acquires data from node B and returns it to the user.
Similarly, assuming that the user E requests to store the file G, the node a first needs to verify that the user E submitted the transaction for storing the file G from the blockchain ledger, calculate the hash value of the file G using the hash algorithm after the verification is successful, and find it according to the consistent re-hash algorithm. Assuming that the hash value of the file F is 3d8a9C, according to the consistent re-hash algorithm, the corresponding storage node is node C (3 d8a9C = 4=0, corresponding to the first node whose ID is arranged from small to large), node a transmits data to node C, and after the node C completes storage, the user is notified of completion. After the transmission is complete, node C gets the stimulus.
(5) Accounting node statistics storage information
And the accounting node counts the storage variation information of each node and broadcasts the information.
The node a needs to count the information about the amount of memory change of each node and perform broadcasting. In the last step, the node D is disconnected, so the storage information of the node D needs to be cleared. In addition, in the previous step, the node C stores the file F, and the size of the file F needs to be added to the storage capacity of the node C. After the information is broadcasted, the process is finished and the next process is ready to be entered.
Example two
The embodiment provides a block chain data storage consensus system for energy data management, which comprises a user, a common node and an accounting node, wherein the accounting node is respectively communicated with the common node and the user;
the accounting node judges the connection state with all other common nodes and updates a distributed hash table;
based on the updated distributed hash table, the accounting node synchronizes the content data of all other common nodes according to the user requirement;
and based on the synchronized content data of all other common nodes, the accounting node counts the storage variation information of each common node and broadcasts the information.
The modules are the same as the corresponding steps in the implementation example and application scenarios, but are not limited to the disclosure of the first embodiment. It should be noted that the modules described above as part of a system may be implemented in a computer system such as a set of computer-executable instructions.
In the foregoing embodiments, the description of each embodiment has an emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions in other embodiments.
The proposed system can be implemented in other ways. For example, the above-described system embodiments are merely illustrative, and for example, the division of the above-described modules is merely a logical division, and in actual implementation, there may be other divisions, for example, multiple modules may be combined or integrated into another system, or some features may be omitted, or not executed.
Although the embodiments of the present invention have been described with reference to the accompanying drawings, it is not intended to limit the scope of the present invention, and it should be understood by those skilled in the art that various modifications and variations can be made without inventive efforts by those skilled in the art based on the technical solution of the present invention.

Claims (10)

1. The energy data management-oriented block chain data storage consensus method is characterized by comprising the following steps of:
the accounting node packs the transaction account book data in the block chain, generates blocks and broadcasts the blocks;
the accounting node judges the connection state with all other common nodes and updates a distributed hash table;
based on the updated distributed hash table, the accounting node synchronizes the content data of all other common nodes according to the user requirement;
and on the basis of the synchronized content data of all other common nodes, the accounting node counts the storage capacity variation information of each common node and broadcasts the storage capacity variation information.
2. The energy data management-oriented blockchain data storage consensus method according to claim 1, wherein the determination process of the accounting node is specifically as follows:
initializing all common nodes in the system to obtain the ID of each common node and the corresponding common node storage capacity;
and generating random numbers by the common nodes with the storage capacity above a certain threshold value and broadcasting, carrying out XOR calculation according to the generated random numbers, carrying out position mapping based on the calculated XOR result, and determining the accounting nodes.
3. The energy data management oriented blockchain data storage consensus method of claim 2, wherein initializing all nodes in the system to obtain an ID of each node and a corresponding node storage amount comprises:
generating all node IDs in the system through hash operation by all node IPs;
and counting the storage capacity of each node, and sequencing the nodes from small to large according to the node IDs to obtain the storage capacity information of all the nodes.
4. The energy data management oriented blockchain data storage consensus method as claimed in claim 2, wherein the nodes with storage amount above a certain threshold generate random numbers and broadcast, perform xor calculation according to the generated random numbers, perform position mapping based on the calculated xor value result, and determine the billing node, specifically:
the nodes with the storage capacity above a certain value generate random numbers and broadcast the random numbers;
after all the nodes finish broadcasting, calculating exclusive or values of all the generated random numbers;
based on the calculation, obtaining an exclusive-or value, arranging the nodes from small to large according to the distributed ID values, and sequentially mapping the numbers of the storage capacity of each node to the nodes according to the sequence;
and obtaining the accounting node.
5. The energy data management oriented block chain data storage consensus method as claimed in claim 1, wherein the accounting node determines connection states with all other common nodes and updates a distributed hash table, specifically:
the accounting node judges the connection state with all other common nodes, and if the other common nodes do not respond, the accounting node is a lost node;
for the lost node, the accounting node updates the distributed hash table and deletes the ID and storage information of the node;
and the accounting node generates an ID for the newly added node and adds the ID into the distributed hash table.
6. The energy data management oriented blockchain data storage consensus method according to claim 1, wherein based on the updated DHT, the accounting node synchronizes content data of all other common nodes according to user requirements, specifically:
the accounting node acquires user requirements;
based on the acquired user requirements, the accounting node judges whether a data storage or data reading request exists, and if so, the accounting node processes the data storage or data reading request;
if not, the next processing flow is entered.
7. The energy data management-oriented blockchain data storage consensus method of claim 6, wherein the accounting node processes data storage requests, comprising:
verifying whether transaction information corresponding to the stored data exists on the block chain;
and after the verification is successful, calculating the hash value of the stored data, searching the hash value according to a consistent re-hash algorithm, positioning the node corresponding to the stored data for storage, and after the storage is finished, obtaining access excitation of the node corresponding to the stored data.
8. The energy data management oriented blockchain data storage consensus method of claim 6, wherein the accounting node processes a data read request comprising:
verifying whether transaction information corresponding to the read data exists on the block chain;
and after the verification is successful, calculating the hash value of the read data, searching the hash value according to a consistent re-hash algorithm, and positioning the node corresponding to the read data for reading.
9. The energy data management oriented blockchain data storage consensus method as claimed in claim 5, wherein the distributed hash table employs a Merkle file tree, wherein each leaf node represents a file block, values of the leaf nodes are hash values of the file block, and values of non-leaf nodes are hash operations after concatenation of values of child nodes.
10. The energy data management-oriented block chain data storage consensus system is characterized by comprising a user, a common node and an accounting node, wherein the accounting node is respectively communicated with the common node and the user;
the accounting node judges the connection state with all other common nodes and updates a distributed hash table;
based on the updated distributed hash table, the accounting node synchronizes the content data of all other common nodes according to the user requirement;
and based on the synchronized content data of all other common nodes, the accounting node counts the storage variation information of each common node and broadcasts the information.
CN202210820785.1A 2022-07-13 2022-07-13 Energy data management-oriented block chain data storage consensus method and system Pending CN115292311A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210820785.1A CN115292311A (en) 2022-07-13 2022-07-13 Energy data management-oriented block chain data storage consensus method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210820785.1A CN115292311A (en) 2022-07-13 2022-07-13 Energy data management-oriented block chain data storage consensus method and system

Publications (1)

Publication Number Publication Date
CN115292311A true CN115292311A (en) 2022-11-04

Family

ID=83822969

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210820785.1A Pending CN115292311A (en) 2022-07-13 2022-07-13 Energy data management-oriented block chain data storage consensus method and system

Country Status (1)

Country Link
CN (1) CN115292311A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117132279A (en) * 2023-10-26 2023-11-28 山东大学 Block chain double-chain accounting method, system, equipment and medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117132279A (en) * 2023-10-26 2023-11-28 山东大学 Block chain double-chain accounting method, system, equipment and medium
CN117132279B (en) * 2023-10-26 2024-01-23 山东大学 Block chain double-chain accounting method, system, equipment and medium

Similar Documents

Publication Publication Date Title
CN108924092B (en) Public arbitration distributed cloud storage method and system based on block chain
Zamani et al. Rapidchain: Scaling blockchain via full sharding
TWI810411B (en) Computer implemented system and method for enabling access to data stored on a blockchain
Chen et al. Blockchain-based dynamic provable data possession for smart cities
Luu et al. A secure sharding protocol for open blockchains
US20200143366A1 (en) Methods for decentralized digital asset transfer and smart contract state transition
EP4184405A1 (en) Block awareness
CN113329031A (en) Method and device for generating state tree of block
CN111630826A (en) Consensus system and method
CN112235420B (en) Data synchronization method, system and related equipment based on block chain
CN111082943B (en) Efficient block chain consensus method
Esiner et al. Flexdpdp: Flexlist-based optimized dynamic provable data possession
CN112187866B (en) Novel block chain consensus method based on shared storage
CN111770149A (en) Novel alliance chain based on distributed storage
EP4226257A1 (en) Methods and apparatus for a distributed database within a network
CN109584071B (en) Block chain processing method and electronic equipment
CN115292311A (en) Energy data management-oriented block chain data storage consensus method and system
KR102349014B1 (en) Method and system for building fast synchronizable decentralized distributed database
CN110992182B (en) Transaction method and system of blockchain wallet
CN116896564A (en) Block generation method and device based on block chain network and computer equipment
CN114978893B (en) Block chain-based decentralization federation learning method and system
CN115065689A (en) History evaluation-based alliance link block data storage method and system
CN114710357A (en) Dynamic searchable encryption method supporting block verification in editable block chain
CN114745102A (en) Lightweight and extensible block chain system based on edge calculation
Himanshu An overview of blockchain technology: Architecture and consensus protocols

Legal Events

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