A high reliability recovery method for power data storage nodes based on blockchain
By using blockchain technology in the power data storage system, the nodes are divided into nodes to be restored, recovery nodes and other nodes, and the data recovery mechanism and verification mechanism are designed to solve the problem of low utilization of power data storage resources and achieve High reliability recovery and resource optimization of power data.
Patent Information
- Application Number
- CN202210713828.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-22
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2042-06-22
AI Technical Summary
When existing technologies improve the reliability of power data storage resources, network resources are wasted, backup resources and redundant resources are excessive, resulting in low resource utilization.
A high-reliability recovery method for power data storage nodes based on blockchain is adopted. By dividing the nodes into nodes to be restored, recovery nodes and other nodes, the data recovery mechanism and verification mechanism are designed, and blockchain technology is used for data block transmission. and md5 verification to achieve efficient recovery and verification of data.
It improves the reliability of power data, optimizes the redundant backup of data storage nodes and related link resources, reduces the waste of network resources, and improves resource utilization.
Smart Images

Figure CN115296812B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data management of electric power Internet of Things, and in particular to a high-reliability recovery method for electric power data storage nodes based on blockchain. Background Art
[0002] With the rapid development and application of power Internet of Things technology, the number and business types of power Internet of Things are increasing rapidly. In this context, power data is increasing rapidly. Since the reliability of power data is a prerequisite for the normal operation of the power Internet of Things, the reliable storage of power data is becoming more and more important. Data recovery methods generally include two technologies: local data recovery and distributed data recovery. Distributed data recovery has become the mainstream data recovery technology due to its high reliability and fast recovery performance. In order to reduce the problem of high computational overhead in the data recovery process, the literature [Yi M, Wei J, Song L. Efficient integrity verification of replicated data in cloud computing system [J]. computers & security, 2017, 65: 202-212.] proposed an algorithm for calculating data copies based on fully homomorphic encryption, which effectively reduced the computational overhead. In order to solve the problem of low data recovery efficiency in cloud computing environment, the literature [Shen Gang, Chen Bin, Mao Mingrong. Data storage disaster recovery backup simulation based on edge cloud collaborative network [J]. Computer Simulation, 2021, 38(05): 380-383+412] proposed a dynamic data backup mechanism by analyzing the characteristics of data life cycle and popularity, which effectively reduced the resource overhead of data recovery. In order to solve the problem of low data coding efficiency in data recovery, the literature [Liu C, Wang Q, Chu X, et al. G-crs: GPU accelerated cauchy reed-solomon coding [J]. IEEE Transactions on Parallel and Distributed Systems, 2018, 29(7): 1484-1498.] uses GPU technology to perform erasure coding and bit-by-bit storage on data, which effectively improves the coding efficiency in the data recovery process. In order to solve the problem of low accuracy in traffic flow data recovery, the literature [Zhang Jianzong, Tao Dan. Traffic flow speed missing data recovery algorithm under mobile crowd intelligence perception [J]. Small and Micro Computer Systems, 2021, 42(02): 225-230.] built a traffic network model based on grid density technology, proposed data recovery features based on data spatiotemporal characteristics, and effectively improved the accuracy of data recovery. In order to solve the problem of high computational complexity in data recovery, the literature [Liu Ge, Rui Guosheng, Tian Wenbiao. Missing data recovery based on dual regular matrix decomposition [J]. Systems Engineering and Electronics, 2021, 43(05): 1191-1197.] adopted the dual regular matrix theory and proposed a data recovery algorithm, which greatly improved the efficiency of the data recovery algorithm.Reference [OSIPOV D, CHOW J H. PMU missing data recovery using tensor decomposition [J]. IEEE Transactions on Power Systems, 2020, 35 (6): 4554-4563.] constructs a tensor decomposition model from the three aspects of time, location, and variables, which improves the accuracy of data recovery results. Reference [TAN M, YUAN SP, LI SH, et al. Ultra-short-term industrial power demand forecasting using LSTM based hybrid ensemble learning [J]. IEEE Transactions on Power Systems, 2020, 35 (4): 2937-2948.] constructs a data recovery model based on the LSTM network according to the time series relationship of the recovered data, analyzes the subsequent data features, and improves the accuracy of data recovery.
[0003] From existing research, it can be seen that in order to improve the reliability of power data, existing research has mainly optimized the redundant backup of data storage nodes and related link resources. Although the reliability of power data storage resources has been improved, the system requires more backup resources and redundant resources, resulting in a waste of network resources. To solve this problem, the present invention proposes a high-reliability recovery method for power data storage nodes based on blockchain. Summary of the invention
[0004] The purpose of the present invention is to provide a high-reliability recovery method for power data storage nodes based on blockchain to solve the problems raised in the above-mentioned background technology.
[0005] To achieve the above object, the present invention provides the following technical solutions:
[0006] A high-reliability recovery method for power data storage nodes based on blockchain, comprising the following steps:
[0007] S101, build a data recovery network environment;
[0008] S102, constructing a data recovery mechanism message;
[0009] S103. Construct a high-reliability recovery mechanism for power data storage nodes based on blockchain.
[0010] Preferably, the method for constructing the network environment in step S101 is specifically as follows:
[0011] The nodes of the power data storage system are divided into three categories: nodes to be restored, restored nodes, and other nodes:
[0012] Node to be restored: refers to a failed power data storage node that needs to be quickly restored to ensure the normal operation of related power services;
[0013] Recovery node: refers to a node that can quickly provide recovery data for the node to be recovered. In order to improve the efficiency of data recovery, a node that is close to the node to be recovered is generally selected;
[0014] Other nodes: refers to nodes other than the nodes to be restored and the restored nodes in the power data storage system.
[0015] Preferably, in step S102, the recovery mechanism message includes a data recovery basic message design, a data recovery request message design, a data block and overall data verification message design, and a data transmission message design:
[0016] The data recovery message design includes basic information, address information and block information;
[0017] The data recovery request message design includes recovery request, recovery verification request and recovery response;
[0018] The data block and overall data verification message design includes md5 request, md5 response, md5 overall verification request and md5 verification response;
[0019] The data transmission message design includes data transmission request and data transmission response.
[0020] Preferably, the recovery mechanism process in step S103 requires the participation of the node to be recovered, the recovery node, and other nodes, as follows:
[0021] S1031, the node to be restored sends a data recovery request and is verified;
[0022] S1032, the node to be restored and the restoration node adopt a mechanism of data block transmission and verification to transmit and verify the data block by block;
[0023] S1033. Verify the data as a whole: After the node to be restored obtains all the data from the recovery node, the md5 overall verification strategy is used to verify the data.
[0024] Preferably, the specific steps of step S1031 are as follows:
[0025] (a) Request for reinstatement:
[0026] The node to be restored detects that the node is damaged and starts the recovery process. First, the node to be restored obtains the number of healthy nodes on the chain m, sets the number of recovery nodes RecvNum to m / 3 and rounds down. The node to be restored calculates the physical distance to the m nodes, and can obtain the RecvNum nodes closest to itself through quick sort or mini-heap construction, and set them as recovery nodes;
[0027] (b) Reinstatement Request Verification:
[0028] The recovery node and other nodes receive the recovery request from the node to be recovered, verify whether the node type, request parameters, and trusted token are correct, and after verification, send the recovery verification information to all recovery nodes for verification;
[0029] (c) Restore request verification passed:
[0030] When the recovery node receives recovery verification information from more than 2m / 3 healthy nodes, it can determine that the request of the node to be recovered is legal. Here, the recovery verification only needs to meet 2 / 3. The purpose is to tolerate the existence of malicious nodes and ensure that the system can still perform effective verification and recovery in the presence of malicious nodes. After the recovery node determines that the recovery request of the node to be recovered is legal, it will send a response message to the node to be recovered, notifying that the verification has passed and indicating the available status of this node.
[0031] Preferably, the specific steps of step S1032 are as follows:
[0032] (a) Resume data transmission:
[0033] The node to be recovered processes the md5 response information of all recovery nodes, selects a reliable recovery node for each block, builds a gRPC message, executes the rpc remote call, and obtains data through streaming. The gRPC server, that is, the recovery node, identifies the block information transmitted by the node to be recovered, splits the block into 64KB data blocks again, and transmits the data through streaming. After the gRPC client, that is, the node to be recovered sends a request, it waits for the server's streaming transmission and performs splicing at the same time;
[0034] During the transmission process, for different blocks, different recovery nodes can adopt asynchronous acquisition and collaborative downloading, or synchronous acquisition and collaborative downloading. When the available bandwidth of the recovery node is greater than or equal to that of the node to be recovered, there is no need to use asynchronous collaborative downloading. When the available bandwidth of the recovery node is lower, collaborative downloading is used to start collaborative processing of each shard, which can effectively improve the bandwidth utilization of the node to be recovered.
[0035] Data transfer uses a map structure with offset as the key. Since the offset of each block is independent and there are no multiple blocks with the same offset, concurrent asynchronous data transmission will not cause concurrency problems in the map, so ordinary data storage structures can be used.
[0036] (b) MD5 data block verification:
[0037] The md5 request is the core of the entire strategy. When the node to be recovered receives the recovery responses from all m / 3 recovery nodes, it determines that the request is legal and all recovery nodes are currently available. If it times out without receiving enough recovery responses, it rebuilds the recovery request and skips the unresponsive recovery nodes.
[0038] The node to be recovered sets the number of shards to the number of recovery nodes, in order to ensure that each recovery node shares three data blocks. By randomly selecting a pool, three data blocks are assigned to each recovery node, and a request is sent to obtain the md5 value of the data block, thereby ensuring that each block md5 can receive three redundant data from three different recovery nodes. The node to be recovered compares the three data, selects the most reliable block md5, and selects the corresponding recovery node as the real data transmission node for the block;
[0039] The purpose of sending md5 is to avoid the existence of malicious data nodes, that is, the data of a recovery node is tampered, resulting in incorrect data after recovery. By comparing three copies of data, a fault tolerance rate of 1 / 3 malicious nodes is achieved, ensuring that when there is only one malicious node among the three nodes of the block request, it will not affect the reliability of the final recovery. At the same time, transmitting md5 effectively reduces the network cost. The recovery node does not need to transmit real data during the verification phase, but only needs to calculate the md5 of the corresponding block for verification by the node to be recovered.
[0040] The recovery node receives the md5 request sent by the node to be recovered, calculates the md5 value of the corresponding block and sends it back to the node to be recovered for verification.
[0041] Preferably, the specific method of step S1033 is:
[0042] After the node to be recovered completes data splicing and recovery, it sends a verification request to all nodes. All nodes verify the legitimacy of the request and send back the md5 value of the data stored in this node. The node to be recovered verifies whether the sent back md5 is the same as the spliced recovery data. If more than 2m+1 are the same, the recovery is considered successful.
[0043] Compared with the prior art, the present invention has the following beneficial effects:
[0044] The present invention realizes effective internal use of data by dividing the power data nodes into nodes to be restored, restoration nodes and other nodes, thereby ensuring the uniformity of the nodes after restoration. The design of the data recovery mechanism and the design of the verification mechanism solve the problem of low utilization of power data storage resources, improves the reliability of power data, and effectively optimizes the redundant backup of data storage nodes and related link resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 It is a flowchart of a high-reliability recovery method for power data storage nodes based on blockchain of the present invention;
[0046] Figure 2 Schematic diagram of a high-reliability recovery method for power data storage nodes based on blockchain. DETAILED DESCRIPTION
[0047] The technical solution will be described clearly and completely below in conjunction with the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0048] Example
[0049] like Figure 1 to Figure 2 As shown, a high reliability recovery method for power data storage nodes based on blockchain includes the following steps:
[0050] S101, build a data recovery network environment;
[0051] S102, constructing a data recovery mechanism message;
[0052] S103. Construct a high-reliability recovery mechanism for power data storage nodes based on blockchain.
[0053] Specifically, the method for constructing the network environment in step S101 is as follows:
[0054] The nodes of the power data storage system are divided into three categories: nodes to be restored, restored nodes, and other nodes:
[0055] Node to be restored: refers to a failed power data storage node that needs to be quickly restored to ensure the normal operation of related power services;
[0056] Recovery node: refers to a node that can quickly provide recovery data for the node to be recovered. In order to improve the efficiency of data recovery, a node that is close to the node to be recovered is generally selected;
[0057] Other nodes: refers to nodes other than the nodes to be restored and the restored nodes in the power data storage system.
[0058] Specifically, in step S102, the recovery mechanism message includes a data recovery basic message design, a data recovery request message design, a data block and overall data verification message design, and a data transmission message design:
[0059] The data recovery message design includes basic information, address information and block information;
[0060] The data recovery request message design includes recovery request, recovery verification request and recovery response;
[0061] The data block and overall data verification message design includes md5 request, md5 response, md5 overall verification request and md5 verification response;
[0062] The data transmission message design includes data transmission request and data transmission response.
[0063] Specifically, the recovery mechanism process in step S103 requires the participation of the node to be recovered, the recovery node, and other nodes, as follows:
[0064] S1031, the node to be restored sends a data recovery request and is verified;
[0065] S1032, the node to be restored and the restoration node adopt a mechanism of data block transmission and verification to transmit and verify the data block by block;
[0066] S1033. Verify the data as a whole: After the node to be restored obtains all the data from the recovery node, the md5 overall verification strategy is used to verify the data.
[0067] Specifically, the specific steps of step S1031 are as follows:
[0068] (a) Request for reinstatement:
[0069] The node to be restored detects that the node is damaged and starts the recovery process. First, the node to be restored obtains the number of healthy nodes on the chain m, sets the number of recovery nodes RecvNum to m / 3 and rounds down. The node to be restored calculates the physical distance to the m nodes, and can obtain the RecvNum nodes closest to itself through quick sort or mini-heap construction, and set them as recovery nodes;
[0070] (b) Reinstatement Request Verification:
[0071] The recovery node and other nodes receive the recovery request from the node to be recovered, verify whether the node type, request parameters, and trusted token are correct, and after verification, send the recovery verification information to all recovery nodes for verification;
[0072] (c) Restore request verification passed:
[0073] When the recovery node receives recovery verification information from more than 2m / 3 healthy nodes, it can determine that the request of the node to be recovered is legal. Here, the recovery verification only needs to meet 2 / 3. The purpose is to tolerate the existence of malicious nodes and ensure that the system can still perform effective verification and recovery in the presence of malicious nodes. After the recovery node determines that the recovery request of the node to be recovered is legal, it will send a response message to the node to be recovered, notifying that the verification has passed and indicating the available status of this node.
[0074] Specifically, the specific steps of step S1032 are as follows:
[0075] (a) Resume data transmission:
[0076] The node to be recovered processes the md5 response information of all recovery nodes, selects a reliable recovery node for each block, builds a gRPC message, executes the rpc remote call, and obtains data through streaming. The gRPC server, that is, the recovery node, identifies the block information transmitted by the node to be recovered, splits the block into 64KB data blocks again, and transmits the data through streaming. After the gRPC client, that is, the node to be recovered sends a request, it waits for the server's streaming transmission and performs splicing at the same time;
[0077] During the transmission process, for different blocks, different recovery nodes can adopt asynchronous acquisition and collaborative downloading, or synchronous acquisition and collaborative downloading. When the available bandwidth of the recovery node is greater than or equal to that of the node to be recovered, there is no need to use asynchronous collaborative downloading. When the available bandwidth of the recovery node is lower, collaborative downloading is used to start collaborative processing of each shard, which can effectively improve the bandwidth utilization of the node to be recovered.
[0078] Data transfer uses a map structure with offset as the key. Since the offset of each block is independent and there are no multiple blocks with the same offset, concurrent asynchronous data transmission will not cause concurrency problems in the map, so ordinary data storage structures can be used.
[0079] (b) MD5 data block verification:
[0080] The md5 request is the core of the entire strategy. When the node to be recovered receives the recovery responses from all m / 3 recovery nodes, it determines that the request is legal and all recovery nodes are currently available. If it times out without receiving enough recovery responses, it rebuilds the recovery request and skips the unresponsive recovery nodes.
[0081] The node to be recovered sets the number of shards to the number of recovery nodes, in order to ensure that each recovery node shares three data blocks. By randomly selecting a pool, three data blocks are assigned to each recovery node, and a request is sent to obtain the md5 value of the data block, thereby ensuring that each block md5 can receive three redundant data from three different recovery nodes. The node to be recovered compares the three data, selects the most reliable block md5, and selects the corresponding recovery node as the real data transmission node for the block;
[0082] The purpose of sending md5 is to avoid the existence of malicious data nodes, that is, the data of a recovery node is tampered, resulting in incorrect data after recovery. By comparing three copies of data, a fault tolerance rate of 1 / 3 malicious nodes is achieved, ensuring that when there is only one malicious node among the three nodes of the block request, it will not affect the reliability of the final recovery. At the same time, transmitting md5 effectively reduces the network cost. The recovery node does not need to transmit real data during the verification phase, but only needs to calculate the md5 of the corresponding block for verification by the node to be recovered.
[0083] The recovery node receives the md5 request sent by the node to be recovered, calculates the md5 value of the corresponding block and sends it back to the node to be recovered for verification.
[0084] Specifically, the specific method of step S1033 is:
[0085] After the node to be recovered completes data splicing and recovery, it sends a verification request to all nodes. All nodes verify the legitimacy of the request and send back the md5 value of the data stored in this node. The node to be recovered verifies whether the sent back md5 is the same as the spliced recovery data. If more than 2m+1 are the same, the recovery is considered successful.
[0086] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A high-reliability recovery method for power data storage nodes based on blockchain, characterized in that: The following steps are involved: S101, constructing a data recovery network environment, that is, dividing the nodes of the power data storage system into three categories: nodes to be recovered, recovery nodes, and other nodes: S102, construct data recovery mechanism message: Including data recovery basic message design, data recovery request message design, data block and overall data verification message design, data transmission message design: The basic message design for data recovery includes basic information, address information and block information; The data recovery request message design includes recovery request, recovery verification request and recovery response; The data block and overall data verification message design includes md5 request, md5 response, md5 overall verification request and md5 verification response; The data transmission message design includes data transmission request and data transmission response; S103. Construct a high-reliability recovery mechanism for power data storage nodes based on blockchain: The recovery mechanism process requires the participation of the node to be recovered, the recovery node, and other nodes, as follows: S1031, the node to be restored sends a data recovery request and is verified; S1032, the node to be restored and the restoration node adopt a mechanism of data block transmission and verification to transmit and verify the data block by block; S1033, verifying the data as a whole: after the node to be restored obtains all the data from the restoration node, the data is verified using the md5 overall verification strategy; The specific steps of step S1031 are as follows: (a) Request for reinstatement: The node to be restored detects that the node is damaged and starts the recovery process. First, the node to be restored obtains the number of healthy nodes on the chain m, sets the number of recovery nodes RecvNum to m / 3 and rounds down. The node to be restored calculates the physical distance to the m nodes, obtains the RecvNum nodes closest to itself through quick sort or mini-heap construction, and sets them as recovery nodes; (b) Reinstatement Request Verification: The recovery node and other nodes receive the recovery request from the node to be recovered, verify whether the node type, request parameters, and trusted token are correct, and after verification, send the recovery verification information to all recovery nodes for verification; (c) Restore request verification passed: When the recovery node receives the recovery verification information from more than 2m / 3 healthy nodes, it can determine that the request of the node to be recovered is legal. Here, the recovery verification only needs to meet 2 / 3. After the recovery node determines that the recovery request of the node to be recovered is legal, it will send a response message to the node to be recovered, notifying that the verification has passed and indicating the available status of this node; The specific steps of step S1032 are as follows: (a) Resume data transmission: The node to be recovered processes the md5 response information of all recovery nodes, selects a reliable recovery node for each block, builds a gRPC message, executes the rpc remote call, and obtains data through streaming. The gRPC server, that is, the recovery node, identifies the block information transmitted by the node to be recovered, splits the block into 64KB data blocks again, and transmits the data through streaming. After the gRPC client, that is, the node to be recovered sends a request, it waits for the server's streaming transmission and performs splicing at the same time; During the transmission process, for different blocks, when the available bandwidth of the recovery node is greater than or equal to the bandwidth of the node to be recovered, synchronous collaborative download is used; when the available bandwidth of the recovery node is less than the bandwidth of the node to be recovered, asynchronous collaborative download is used. Starting the system to process each shard can effectively improve the bandwidth utilization of the node to be recovered. Data transfer uses a map structure with offset as the key. The offset of each block is independent and different, ensuring that the common data storage structure will not cause concurrency problems in the map during asynchronous data transmission. (b) MD5 data block verification: The md5 request is the core of the entire strategy. When the node to be recovered receives the recovery responses from all m / 3 recovery nodes, it determines that the request is legal and all recovery nodes are currently available. If it times out without receiving enough recovery responses, it rebuilds the recovery request and skips the unresponsive recovery nodes. The node to be recovered sets the number of shards to the number of recovery nodes, in order to ensure that each recovery node shares three data blocks. By randomly selecting a pool, three data blocks are assigned to each recovery node, and a request is sent to obtain the md5 value of the data block, thereby ensuring that each block md5 can receive three redundant data from three different recovery nodes. The node to be recovered compares the three data, selects the most reliable block md5, and selects the corresponding recovery node as the real data transmission node for the block; By comparing the three redundant data in the block md5, a 1 / 3 malicious node fault tolerance rate is achieved. At the same time, the recovery node does not need to transmit real data during the verification phase, but only needs to calculate the md5 of the corresponding block for verification by the node to be recovered. The recovery node receives the md5 request sent by the node to be recovered, calculates the md5 value of the corresponding block and sends it back to the node to be recovered for verification; The specific method of step S1033 is: After the node to be recovered completes data splicing and recovery, it sends a verification request to all nodes. All nodes verify the legitimacy of the request and send back the md5 value of the data stored in this node. The node to be recovered verifies whether the sent back md5 is the same as the spliced recovery data. If more than 2m+1 are the same, the recovery is considered successful.
2. The high reliability recovery method of power data storage node based on blockchain according to claim 1 is characterized in that: The nodes to be restored, the restoration nodes, and other nodes in step S101 are specifically: Node to be restored: refers to a failed power data storage node that needs to be quickly restored to ensure the normal operation of related power services; Recovery node: refers to a node that can quickly provide recovery data for the node to be recovered. In order to improve the efficiency of data recovery, a node that is close to the node to be recovered is selected; Other nodes: refers to nodes other than the nodes to be restored and the restored nodes in the power data storage system.
