A blockchain-based power grid information security storage sharing method and system
By using blockchain technology and regular identity authentication, a power grid information security storage alliance chain was built, which solved the problems of power grid information security and privacy protection, realized information interconnection and tamper-proofing, and improved the security and credibility of power grid information.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- LANGFANG POWER SUPPLY COMPANY STATE GRID JIBEI ELECTRIC POWER COMPANY
- Filing Date
- 2024-05-20
- Publication Date
- 2026-07-24
AI Technical Summary
In modern power systems, the security and privacy protection of power grid information face enormous challenges. Traditional centralized data storage solutions are unable to meet the high security requirements, and frequent network attacks threaten the security and reliability of power grid information.
A power grid information security storage consortium chain is constructed using blockchain technology. Hyperledger Fabric is used to achieve information interconnection and tamper-proofing. The consortium chain nodes are periodically authenticated. The LSTM model and sparrow search algorithm are used to predict on-chain behavior and identify abnormal nodes.
It achieves the authenticity, transparency, traceability, and tamper-proof nature of power grid information, improves information security and credibility, and prevents abnormal nodes from affecting the secure storage of power grid information.
Smart Images

Figure CN118474138B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data security, specifically to a blockchain-based method and system for secure storage and sharing of power grid information. Background Technology
[0002] In modern power systems, the deep integration of information and communication technologies has become crucial for improving grid efficiency and reliability. Grid operators continuously collect and process massive amounts of data from smart meters, sensors, and other intelligent devices for real-time monitoring, fault diagnosis, load forecasting, and asset management. However, the security and privacy protection of this critical data face significant challenges. Data tampering or leakage will seriously threaten the safe operation of the grid and user trust. With the rapid development of cyberattack techniques, traditional centralized data storage solutions are no longer sufficient to meet the demands for high security. Summary of the Invention
[0003] The power grid information security storage consortium chain constructed using blockchain technology in this invention realizes the interconnection and interoperability of power grid information, ensuring the authenticity, transparency, traceability and tamper-proof nature of the information, and comprehensively protecting the security and accuracy of power grid information. This plays an important role in ensuring the secure interaction and sharing of power grid information. Furthermore, by regularly authenticating the identities of the consortium chain nodes, the credibility of the power grid information uploaded to the chain is ensured, further enhancing the security of power grid information.
[0004] A blockchain-based method for secure storage and sharing of power grid information includes:
[0005] The power grid information security storage alliance chain is built based on Hyperledger Fabric. The power grid information security storage alliance chain includes alliance chain nodes, transaction chaincode, shared chaincode and sorting service components.
[0006] The power grid information storage and sharing operation based on the power grid information security storage alliance chain specifically includes the following:
[0007] The power grid information upload request is obtained through consortium blockchain nodes. The power grid information upload request includes node information, power grid information operation instructions, and power grid information. Each time a consortium blockchain node is added, it needs to be registered in the power grid information secure storage consortium blockchain. During the registration period, all consortium blockchain nodes in the power grid information secure storage consortium blockchain execute the PBFT consensus mechanism to vote on the registration of the consortium blockchain node. If the vote is successful, the addition of the consortium blockchain node is completed; otherwise, the registration of the consortium blockchain node is rejected. In addition, each consortium blockchain node performs identity authentication periodically based on the power grid information upload behavior.
[0008] Consortium blockchain nodes distribute power grid information upload requests to the endorsing nodes specified in the corresponding transaction chaincode. Endorsing nodes are consortium blockchain nodes, and the transaction chaincode determines which consortium blockchain nodes are designated as endorsing nodes. For each endorsing node, the corresponding chaincode logic is executed to verify the power grid information upload request. When the endorsing node successfully verifies the power grid information upload request, it is recorded as a successful endorsement, and a corresponding endorsement signature is generated for the power grid information upload request. When the endorsing node fails to verify the power grid information upload request, it is recorded as a failed endorsement, and a report of failed endorsement is issued.
[0009] The consortium blockchain nodes obtain the endorsement results of all endorsing nodes for the power grid information upload request as specified in the transaction chaincode. The endorsement results include endorsement success and endorsement failure. It is then determined whether the endorsement results of all endorsing nodes comply with the endorsement policy specified in the transaction chaincode. If the endorsement results of all endorsing nodes do not comply with the endorsement policy specified in the transaction chaincode, the power grid information upload request is rejected. If the endorsement results of all endorsing nodes comply with the endorsement policy specified in the transaction chaincode, the power grid information upload request and the corresponding endorsement signature are combined to form transaction data.
[0010] The sorting service component determines the new block according to the transaction order, distributes the transaction data as block data to all consortium blockchain nodes, and conducts voting based on the PBFT consensus mechanism to verify the block data. If the vote is successful, for each consortium blockchain node, the corresponding power grid information upload request is executed locally on the consortium blockchain node, and the block data is added to the new block; if the vote fails, the power grid information upload request is rejected.
[0011] As a preferred aspect of the present invention, the on-chain behavior based on power grid information periodically verifies the identity of consortium blockchain nodes, specifically including the following steps:
[0012] The system acquires on-chain behavior data of consortium blockchain nodes within the current analysis period. This on-chain behavior data includes on-chain application frequency data and on-chain application rejection frequency data. The on-chain application frequency data represents the number of power grid information on-chain requests executed by consortium blockchain nodes within the current analysis period, while the on-chain application rejection frequency data represents the number of power grid information on-chain requests rejected by consortium blockchain nodes within the current analysis period. The analysis period is obtained through simulation calculation using a population optimization algorithm.
[0013] The on-chain behavior data obtained in the first N-1 times are combined into an on-chain behavior prediction dataset. The prediction dataset is then fed into the on-chain behavior prediction model for processing. The on-chain behavior prediction data corresponding to the current analysis period is output. The on-chain behavior prediction data includes on-chain application frequency prediction data and on-chain application rejection frequency prediction data.
[0014] The on-chain behavior data of the current analysis period is compared with the on-chain behavior prediction data of the corresponding analysis period. Specifically, the fluctuation value δ1 of the on-chain application frequency is calculated. The fluctuation value δ1 of the on-chain application frequency is |F t -F r | / F t F t For on-chain application frequency data, F r For on-chain application frequency prediction data; calculate the on-chain application rejection frequency fluctuation value δ2, where δ2 = |H t -H r | / H t H t H rejects application frequency data for on-chain processing. r The data is used to predict the frequency of rejected applications on the blockchain. The system checks whether the condition “δ1>μ1&δ2>μ2” is true, where μ1 is the fluctuation threshold of the frequency of applications on the blockchain and μ2 is the fluctuation threshold of the frequency of rejected applications on the blockchain. If “δ1>μ1&δ2>μ2” is true, the corresponding analysis period is marked as a suspicious time period. If “δ1>μ1&δ2>μ2” is not true, no action is taken.
[0015] If a single consortium blockchain node exhibits D consecutive suspicious time periods, it is marked as an abnormal node. All access requests from the abnormal node to the power grid information security storage consortium blockchain are denied. The abnormal node's information is broadcast to all consortium blockchain nodes, and an abnormal node report is generated and sent to maintenance personnel. If a single consortium blockchain node does not exhibit D consecutive suspicious time periods, no action is taken, and the suspicious time periods that do not reach the D consecutive suspicious time periods are deleted from the mark.
[0016] As a preferred aspect of the present invention, the training of the on-chain behavior prediction model specifically includes the following steps:
[0017] Acquire training samples of on-chain behavior data. The training samples of on-chain behavior data store N historical on-chain behavior data arranged in chronological order. The first N-1 on-chain behavior data in the training samples of on-chain behavior data are used as the input data of the on-chain behavior prediction model, and the last on-chain behavior data in the training samples of on-chain behavior data are used as the output data of the on-chain behavior prediction model. All on-chain behavior data training samples are combined into an on-chain behavior data training set. The on-chain behavior data training set is then fed into the parameter-initialized on-chain behavior prediction model for training. The loss value is calculated, and it is determined whether the loss value is within the confidence range. If the loss value is within the confidence range, the trained on-chain behavior prediction model is output; otherwise, the on-chain behavior prediction model is trained again using the on-chain behavior data training set.
[0018] As a preferred aspect of the present invention, the analysis period is obtained by simulation calculation using a population optimization algorithm, specifically including the following:
[0019] After sending the abnormal node report to the maintenance personnel, obtain their feedback, which includes whether the node is abnormal or not. If the feedback is abnormal, do not adjust the analysis cycle; if the feedback is not abnormal, perform the following operations:
[0020] After obtaining feedback from maintenance personnel, taking the unit period in which the abnormal node report was issued as the center point, the unit-time on-chain behavior data of the consortium blockchain nodes within several unit periods is continuously obtained from the unit-time on-chain behavior data repository. The unit-time on-chain behavior data includes unit-time on-chain application frequency data and unit-time on-chain application rejection frequency data. The unit-time on-chain application frequency data is the number of power grid information on-chain requests executed by the consortium blockchain node within the unit period, and the unit-time on-chain application rejection frequency data is the number of power grid information on-chain requests rejected by the consortium blockchain node within the unit period. The unit period is much shorter than the analysis period. The unit-time on-chain behavior data repository consists of continuously obtained unit-time on-chain behavior data.
[0021] Acquire several units of on-chain behavior data per unit time, and based on all the acquired on-chain behavior data per unit time, simulate and calculate the analysis period using a population optimization algorithm, and output the analysis period.
[0022] As a preferred aspect of the present invention, the analysis period is simulated and calculated using a population optimization algorithm, and the analysis period is output, specifically including the following steps:
[0023] Construct several simulated individuals and form a population set of all simulated individuals. Set the maximum number of iterations. The simulated individuals are constructed as follows: randomly generate a random integer ζ, and satisfy that the time length of ζ unit periods is within the interval of the period time length. Record the random integer ζ as a simulated individual.
[0024] Calculate the fitness of each simulated individual for all simulated individuals within the population set;
[0025] Based on the fitness of simulated individuals, the population set is iteratively updated using a population optimization algorithm;
[0026] When the number of iterations reaches the maximum number of iterations, output the simulated individual with the highest fitness, which is denoted as the optimal simulated individual. Take the random integer ζ stored in the optimal simulated individual, and output the ζ-unit period as the analysis period.
[0027] As a preferred aspect of the present invention, the fitness is calculated as follows:
[0028] Retrieve the random integer ζ stored in the simulated individual, and denote ζ unit periods as the simulation analysis period. Simultaneously, ζ unit time on-chain behavior data are used to form the simulated on-chain behavior data corresponding to the simulation analysis period. The simulated on-chain behavior data includes simulated on-chain application frequency data and simulated on-chain application rejection frequency data. Arrange all simulated on-chain behavior data in chronological order, and select several simulated on-chain behavior datasets through a sliding window of length N. Each simulated on-chain behavior dataset includes N simulated on-chain behavior data. For each simulated on-chain behavior dataset, perform the following operations: select the first N-1 simulated on-chain behavior data from the simulated on-chain behavior dataset and send them to the on-chain behavior prediction model for processing, outputting simulated on-chain behavior prediction data. Calculate the similarity between the simulated on-chain behavior prediction data and the last simulated on-chain behavior data in the simulated on-chain behavior dataset, and denote it as the target similarity. Calculate the average of the target similarities corresponding to all simulated on-chain behavior datasets, which is the fitness of the simulated individual.
[0029] As a preferred aspect of the present invention, the on-chain behavior prediction model is based on the LSTM model.
[0030] As a preferred aspect of the present invention, the swarm optimization algorithm employs the sparrow search algorithm.
[0031] As a preferred aspect of the present invention, a cosine similarity algorithm is used to calculate the similarity between the simulated on-chain behavior prediction data and the last simulated on-chain behavior data in the simulated on-chain behavior dataset.
[0032] A blockchain-based power grid information security storage and sharing system includes:
[0033] The power grid information security storage alliance chain construction module is used to build a power grid information security storage alliance chain based on Hyperledger Fabric. The power grid information security storage alliance chain includes alliance chain nodes, transaction chaincode, shared chaincode, and sorting service components.
[0034] The power grid information storage and sharing module is used for storing and sharing power grid information based on the power grid information security storage alliance chain;
[0035] The consortium blockchain node identity authentication module is used to periodically authenticate the identities of consortium blockchain nodes based on the on-chain behavior of power grid information.
[0036] The present invention has the following advantages:
[0037] 1. The power grid information security storage consortium chain constructed using blockchain technology in this invention realizes the interconnection and interoperability of power grid information, ensuring the authenticity, transparency, traceability and tamper-proof nature of the information, and comprehensively protecting the security and accuracy of power grid information. This plays an important role in ensuring the secure interaction and sharing of power grid information. Furthermore, by regularly authenticating the identities of the consortium chain nodes, the credibility of the power grid information uploaded to the chain is ensured, further enhancing the security of power grid information.
[0038] 2. This invention judges the fluctuation range of the actual acquired on-chain behavior data and the on-chain behavior prediction data through time-series prediction, and records the consortium chain nodes with large fluctuation ranges in a series of consecutive times as abnormal nodes, so as to prevent the corresponding consortium chain nodes from performing unsafe operation behaviors that affect the secure storage of power grid information.
[0039] 3. This invention adjusts the analysis period through the sparrow search algorithm, making the length of the analysis period adapt to the length of network fluctuations, thereby obtaining more accurate on-chain behavior prediction data during the identity authentication process of consortium blockchain nodes and improving the identity authentication of consortium blockchain nodes. Attached Figure Description
[0040] Figure 1 This is a schematic diagram of the structure of the blockchain-based power grid information security storage and sharing system used in an embodiment of the present invention. Detailed Implementation
[0041] To enable those skilled in the art to better understand the technical solutions of this invention, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of this invention.
[0042] Example 1
[0043] A blockchain-based method for secure storage and sharing of power grid information includes:
[0044] The power grid information security storage alliance chain is built based on Hyperledger Fabric. The power grid information security storage alliance chain includes alliance chain nodes, transaction chaincode, shared chaincode and sorting service components.
[0045] The power grid information storage and sharing operation based on the power grid information security storage alliance chain specifically includes the following:
[0046] The system obtains power grid information upload requests from the corresponding organizations of the consortium blockchain nodes. These consortium blockchain nodes are stakeholders related to power grid information security, such as the State Grid Corporation of China, energy regulatory agencies, and power trading platforms. The power grid information upload request includes node information, power grid information operation instructions, and power grid information itself. The node information is the information corresponding to the consortium blockchain node, including the node address and its organizational structure. The power grid information operation instructions include operations such as adding, deleting, and modifying power grid data. The power grid information is the power grid data that the consortium blockchain node needs to store. Each added consortium blockchain node needs to register on the power grid information security storage consortium blockchain. During the registration period, all consortium blockchain nodes in the power grid information security storage consortium blockchain execute the PBFT consensus mechanism to vote on the registration of the consortium blockchain node. If the vote is successful, the consortium blockchain node is added; otherwise, the registration is rejected. Each consortium blockchain node undergoes periodic identity authentication based on its power grid information upload behavior. The PBFT consensus mechanism is a practical Byzantine consensus mechanism, meaning that a 2 / 3 majority vote from the consortium blockchain nodes is required for approval of the proposal.
[0047] Consortium blockchain nodes distribute grid information upload requests to the endorsing nodes specified in the corresponding transaction chaincode. The transaction chaincode is a set of programs that implement business logic to process grid information upload requests, such as recognizing the format of grid data in the request. Endorsing nodes are consortium blockchain nodes, and the transaction chaincode determines which consortium blockchain nodes are set as endorsing nodes. For each endorsing node, the corresponding chaincode logic is executed to verify the grid information upload request. The chaincode logic is also determined by the transaction chaincode. For example, if the chaincode logic is to update grid information, the endorsing node will verify the validity of the provided grid information (e.g., checking data format, permissions, etc.) and generate a table. This indicates the "expected result" of this change; when the endorsing node successfully verifies the power grid information upload request, it is recorded as a successful endorsement, meaning that the transaction corresponding to the power grid information upload request meets the business rules defined by the chaincode and has no other errors (such as format errors or data inconsistencies). The endorsing node generates a corresponding endorsement signature for the power grid information upload request. Specifically, the endorsing node uses its private key to sign the power grid information upload request. This signature indicates that the endorsing node has verified and approved the transaction corresponding to the power grid information upload request. When the endorsing node fails to verify the power grid information upload request, it is recorded as a failed endorsement, meaning that the transaction corresponding to the power grid information upload request is found to be inconsistent with the business rules, or there are problems such as data inconsistency or format errors, and a report of failed endorsement is issued.
[0048] The system obtains the endorsement results of all endorsing nodes for the power grid information upload request as specified in the transaction chaincode through consortium blockchain nodes. Endorsement results include successful and unsuccessful endorsements. It then determines whether the endorsement results of all endorsing nodes conform to the endorsement strategy specified in the transaction chaincode. The endorsement strategy may be: single endorsement (requiring only one specific endorsing node's successful endorsement); multiple endorsements (requiring multiple endorsing nodes' successful endorsements, e.g., "AND(Org1.member,Org2.member)", meaning at least one endorsing node from Org1 and one from Org2 must successfully endorse); or composite endorsement. This may require complex logic, such as "OR(AND(Org1.member,Org2.member),Org3.member)", which means that either all the endorser nodes corresponding to the members of Org1 and Org2 must successfully endorse, or one of the corresponding endorser nodes of Org3 must successfully endorse. If the endorsement results of all the endorser nodes do not conform to the endorsement policy specified by the transaction chaincode, the request to upload the power grid information to the chain is rejected. If the endorsement results of all the endorser nodes conform to the endorsement policy specified by the transaction chaincode, the request to upload the power grid information to the chain is combined with the corresponding endorsement signature to form transaction data.
[0049] The sorting service component determines new blocks according to transaction order. During this process, a leader defined by the sorting service component proposes a new block and submits it to all consortium blockchain nodes for voting based on the PBFT consensus mechanism. If the vote fails, a new leader is selected, and the proposed new block is executed until the vote succeeds. Transaction data is then distributed as block data to all consortium blockchain nodes, and voting is conducted again based on the PBFT consensus mechanism to verify the block data, such as verifying the validity of endorsements. If the vote succeeds, for each consortium blockchain node, a request to add the corresponding power grid information to the blockchain is executed locally, such as adding, deleting, or modifying power grid information. The block data is then added to the new block, achieving power grid information storage. Since each consortium blockchain node stores power grid information locally, this also enables information sharing. If the vote fails, the request to add power grid information to the blockchain is rejected.
[0050] The power grid information security storage consortium chain constructed using blockchain technology in this application realizes the interconnection and interoperability of power grid information, ensuring the authenticity, transparency, traceability and tamper-proof nature of the information, and comprehensively protecting the security and accuracy of power grid information. This plays an important role in ensuring the secure interaction and sharing of power grid information. Furthermore, by regularly authenticating the identities of the consortium chain nodes, the credibility of power grid information uploaded to the chain is guaranteed, further enhancing the security of power grid information.
[0051] It should be noted that the following content is explained for any single consortium blockchain node. The same operation can be applied to all consortium blockchain nodes. Based on the on-chain behavior of power grid information, the identity of consortium blockchain nodes is periodically authenticated, specifically including the following steps:
[0052] The system acquires on-chain behavior data of consortium blockchain nodes within the current analysis period. This on-chain behavior data includes on-chain application frequency data and on-chain application rejection frequency data. The on-chain application frequency data represents the number of power grid information on-chain requests executed by consortium blockchain nodes within the current analysis period, while the on-chain application rejection frequency data represents the number of power grid information on-chain requests rejected by consortium blockchain nodes within the current analysis period. The analysis period is obtained through simulation calculation using a population optimization algorithm and is used to characterize the duration of network fluctuations under different environments.
[0053] The on-chain behavior data obtained in the first N-1 times are combined into an on-chain behavior prediction dataset. The prediction dataset is then fed into the on-chain behavior prediction model for processing, and the on-chain behavior prediction data corresponding to the current analysis period is output. The on-chain behavior prediction data includes on-chain application frequency prediction data and on-chain application rejection frequency prediction data. The on-chain behavior prediction model is built based on the LSTM model. Since various power institutions generally perform on-chain operations of power grid information regularly, the on-chain behavior data has certain temporal characteristics. Temporal analysis can be performed on the on-chain behavior data to obtain on-chain behavior prediction data.
[0054] The on-chain behavior data of the current analysis period is compared with the on-chain behavior prediction data of the corresponding analysis period. Specifically, the fluctuation value δ1 of the on-chain application frequency is calculated. The fluctuation value δ1 of the on-chain application frequency is |F t -F r | / F t F t For on-chain application frequency data, F r For on-chain application frequency prediction data; calculate the on-chain application rejection frequency fluctuation value δ2, where δ2 = |H t -H r | / H t H t H rejects application frequency data for on-chain processing. rThe system generates data for predicting the frequency of rejected on-chain applications. It then checks whether the condition "δ1 > μ1 & δ2 > μ2" holds true, where μ1 is the threshold for fluctuations in the frequency of on-chain applications and μ2 is the threshold for fluctuations in the frequency of rejected on-chain applications, both of which are manually set. If "δ1 > μ1 & δ2 > μ2" holds true, it indicates that the number of on-chain power grid information requests and the number of rejected on-chain power grid information requests in the current analysis period do not meet expectations, and the corresponding consortium blockchain node may be abnormal. The corresponding analysis period is then marked as a suspicious time period. If "δ1 > μ1 & δ2 > μ2" does not hold true, no action is taken.
[0055] The system determines whether a single consortium blockchain node exhibits D consecutive suspicious time periods. If so, it indicates that, aside from network fluctuations, the node's behavior is irrational and may be abnormal, leading to its loss of trust within the power grid information security storage consortium blockchain. In this case, the node is marked as an abnormal node, and all access requests from it to the blockchain are denied. The abnormal node's information is broadcast to all consortium blockchain nodes, and an abnormal node report is generated and sent to maintenance personnel. If a single consortium blockchain node does not exhibit D consecutive suspicious time periods, no action is taken, and any suspicious time periods that do not reach the D consecutive suspicious time periods are removed from the list.
[0056] This application determines the fluctuation range by analyzing the actual on-chain behavior data and the on-chain behavior prediction data obtained through time-series prediction, and records consortium blockchain nodes with large fluctuation ranges multiple times as abnormal nodes, in order to prevent the corresponding consortium blockchain nodes from performing unsafe operations that could affect the secure storage of power grid information.
[0057] The training of the on-chain behavior prediction model includes the following steps:
[0058] The process involves acquiring training samples of on-chain behavior data. These training samples contain N historical on-chain behavior data entries arranged chronologically. The operator retrieves these entries based on the historical records. The first N-1 entries of on-chain behavior data from the training samples serve as input data for the on-chain behavior prediction model, while the last entry serves as output data. All training samples are combined to form the on-chain behavior data training set. This training set is then fed into the parameter-initialized on-chain behavior prediction model for training. The loss value is calculated, and it is determined whether the loss value falls within the confidence range. The confidence range, set by the operator, is used to characterize on-chain behavior. If the accuracy of the prediction model is within the confidence range, the trained on-chain behavior prediction model is output; otherwise, the on-chain behavior prediction model is trained again using the on-chain behavior data training set. It should be noted that during the training process, the analysis period corresponding to the input on-chain behavior data varies. Therefore, the on-chain behavior prediction model learns more about the changing trends of the on-chain behavior data. During the use of the on-chain behavior prediction model, the analysis period will be adaptively adjusted in real time with network changes. Since the analysis period corresponding to the on-chain behavior data used in the training process varies, the on-chain behavior prediction model can guarantee a certain accuracy for on-chain behavior data obtained for analysis periods of different lengths.
[0059] The analysis period is calculated using a population optimization algorithm and includes the following:
[0060] After sending the abnormal node report to the maintenance personnel, feedback is obtained. Feedback includes "abnormal" and "no abnormality." "Abnormal" indicates that the corresponding consortium blockchain node did indeed experience an anomaly, while "no abnormality" indicates that the corresponding consortium blockchain node did not experience an anomaly. The actual issue is that network fluctuations caused the on-chain behavior data within the analysis period to deviate from expectations. Since the on-chain behavior prediction model is trained using on-chain behavior data obtained under different network conditions, and its application involves time-series analysis of the first N-1 on-chain behavior data acquisitions, any network fluctuations, especially if the duration of these fluctuations does not match the analysis period (e.g., the fluctuation duration is much longer than the analysis period), indicate a potential problem. The fluctuations will cover multiple analysis periods. Subsequent time-series analysis of the on-chain behavior data corresponding to these multiple analysis periods will result in continuous prediction errors due to network fluctuations. This indicates that the length of the analysis period no longer matches the length of the network fluctuations, and the length of the analysis period needs to be adjusted to match the length of the network fluctuations. In this case, the network fluctuations only cover one analysis period at a time, and the impact on time-series predictions is relatively small. Even if the network fluctuations do not overlap with the analysis periods, they will at most cover two analysis periods, and the impact on time-series predictions is still relatively small. If the feedback result is abnormal, no adjustment is made to the analysis period. If the feedback result is normal, the following operations are performed:
[0061] After obtaining feedback from maintenance personnel, the on-chain behavior data of consortium blockchain nodes within a unit period is retrieved from the unit period on-chain behavior data repository, taking the unit period when the abnormal node report was issued as the center point. It should be noted that the several unit periods are taken from the unit period when the abnormal node report was issued as the center point, 50 unit periods are retrieved backward, and then 50 unit periods are retrieved forward. The unit time on-chain behavior data includes the unit time on-chain application frequency data and the unit time on-chain application rejection frequency data. The unit time on-chain application frequency data is the number of power grid information on-chain requests executed by the consortium blockchain node within the unit period, and the unit time on-chain application rejection frequency data is the number of power grid information on-chain requests rejected by the consortium blockchain node within the unit period. The unit period is much shorter than the analysis period and is set by the operator. Generally, the analysis period is 10 times longer than the unit period. The unit period on-chain behavior data repository consists of continuously acquired unit period on-chain behavior data. That is, during the process of secure storage and sharing of power grid information, unit period on-chain behavior data will be continuously acquired for each unit period.
[0062] Acquire several units of on-chain behavior data per unit time, and based on all the acquired on-chain behavior data per unit time, simulate and calculate the analysis period using a population optimization algorithm, and output the analysis period.
[0063] It should be noted that the analysis period is adaptively adjusted in real time according to changes in network fluctuations, and the acquisition of on-chain behavior data is based on the adjusted analysis period after each adjustment. If there are no network fluctuations, the length of the analysis period does not affect the use of the chain behavior prediction model.
[0064] The analysis period is simulated and calculated using a population optimization algorithm, and the analysis period is output. The specific steps include the following:
[0065] Construct several simulated individuals and form a population set of all simulated individuals. Set the maximum number of iterations. The simulated individuals are constructed as follows: randomly generate a random integer ζ, and satisfy that the time length of ζ unit periods is within the period time length interval. The period time length interval is set manually. Record the random integer ζ as a simulated individual.
[0066] For all simulated individuals in the population set, calculate the fitness of each simulated individual. The fitness calculation method is as follows: Take out the random integer ζ stored in the simulated individual, and denote ζ units as the simulation analysis period. Simultaneously, ζ units of on-chain behavior data are used to form the simulated on-chain behavior data corresponding to the simulation analysis period. The simulated on-chain behavior data includes simulated on-chain request frequency data and simulated on-chain request rejection frequency data. Arrange all simulated on-chain behavior data in chronological order, and select several simulated on-chain behavior datasets using a sliding window of length N. Each simulated on-chain behavior dataset includes N simulated on-chain behavior data. For each simulated on-chain behavior dataset, perform the following operation: select the first N-1 simulated on-chain behavior data from the simulated on-chain behavior dataset and send them to the on-chain process. The prediction model is processed to output simulated on-chain behavior prediction data. The similarity between the simulated on-chain behavior prediction data and the last simulated on-chain behavior data in the dataset is calculated using a cosine similarity algorithm, denoted as the target similarity. The average of the target similarities across all simulated on-chain behavior datasets is the fitness of the simulated individual. A higher fitness indicates a more suitable analysis period for network fluctuations, minimizing the impact on time-series predictions and ensuring greater similarity between the simulated on-chain behavior prediction data and the actual simulated on-chain behavior data. By continuously adjusting the analysis period, its length can be adapted to network fluctuations, resulting in more accurate on-chain behavior prediction data during the authentication of consortium blockchain nodes.
[0067] Based on the fitness of simulated individuals, the population set is iteratively updated using the sparrow search algorithm, that is, the value of the random integer ζ in the simulated individuals is continuously adjusted so that the fitness of the simulated individuals is continuously improved, that is, they are more adapted to the network fluctuation length. Furthermore, the traditional sparrow search algorithm is used to handle continuous values, and it can also be used to iteratively update the population set using the floor function.
[0068] When the number of iterations reaches the maximum number of iterations, output the simulated individual with the highest fitness, which is denoted as the optimal simulated individual. Take the random integer ζ stored in the optimal simulated individual, and output the ζ-unit period as the analysis period.
[0069] This application adjusts the analysis period using a sparrow search algorithm, making the length of the analysis period adapt to the length of network fluctuations. This allows for obtaining more accurate on-chain behavior prediction data during the identity authentication process of consortium blockchain nodes, thereby improving the identity authentication of consortium blockchain nodes.
[0070] Example 2
[0071] A blockchain-based power grid information security storage and sharing system, such as Figure 1 As shown, it includes:
[0072] The power grid information security storage alliance chain construction module is used to build a power grid information security storage alliance chain based on Hyperledger Fabric. The power grid information security storage alliance chain includes alliance chain nodes, transaction chaincode, shared chaincode, and sorting service components.
[0073] The power grid information storage and sharing module is used for storing and sharing power grid information based on the power grid information security storage alliance chain;
[0074] The consortium blockchain node identity authentication module is used to periodically authenticate the identities of consortium blockchain nodes based on the on-chain behavior of power grid information.
[0075] It should be understood that those skilled in the art can make improvements or modifications based on the above description, and all such improvements and modifications should fall within the protection scope of the appended claims. Parts not described in detail in this specification are prior art known to those skilled in the art.
Claims
1. A blockchain-based method for secure storage and sharing of power grid information, characterized in that, include: The power grid information security storage alliance chain is built based on Hyperledger Fabric. The power grid information security storage alliance chain includes alliance chain nodes, transaction chaincode, shared chaincode and sorting service components. The power grid information storage and sharing operation based on the power grid information security storage alliance chain specifically includes the following: The power grid information upload request is obtained through consortium blockchain nodes. The power grid information upload request includes node information, power grid information operation instructions, and power grid information. Each time a consortium blockchain node is added, it needs to be registered in the power grid information secure storage consortium blockchain. During the registration period, all consortium blockchain nodes in the power grid information secure storage consortium blockchain execute the PBFT consensus mechanism to vote on the registration of the consortium blockchain node. If the vote is successful, the addition of the consortium blockchain node is completed; otherwise, the registration of the consortium blockchain node is rejected. In addition, each consortium blockchain node performs identity authentication periodically based on the power grid information upload behavior. Consortium blockchain nodes distribute power grid information upload requests to the endorsing nodes specified in the corresponding transaction chaincode. Endorsing nodes are consortium blockchain nodes, and the transaction chaincode determines which consortium blockchain nodes are designated as endorsing nodes. For each endorsing node, the corresponding chaincode logic is executed to verify the power grid information upload request. When the endorsing node successfully verifies the power grid information upload request, it is recorded as a successful endorsement, and a corresponding endorsement signature is generated for the power grid information upload request. When the endorsing node fails to verify the power grid information upload request, it is recorded as a failed endorsement, and a report of failed endorsement is issued. The consortium blockchain nodes obtain the endorsement results of all endorsing nodes for the power grid information upload request as specified in the transaction chaincode. The endorsement results include endorsement success and endorsement failure. It is then determined whether the endorsement results of all endorsing nodes comply with the endorsement policy specified in the transaction chaincode. If the endorsement results of all endorsing nodes do not comply with the endorsement policy specified in the transaction chaincode, the power grid information upload request is rejected. If the endorsement results of all endorsing nodes comply with the endorsement policy specified in the transaction chaincode, the power grid information upload request and the corresponding endorsement signature are combined to form transaction data. The sorting service component determines the new block according to the transaction order, distributes the transaction data as block data to all consortium blockchain nodes, and votes on the block data based on the PBFT consensus mechanism. If the vote is successful, for each consortium blockchain node, the corresponding power grid information on the blockchain is requested to be added to the new block locally. If the vote fails, the request to add the power grid information on the blockchain is rejected. The process of uploading power grid information to the blockchain periodically verifies the identity of consortium blockchain nodes, specifically including the following steps: The system acquires on-chain behavior data of consortium blockchain nodes within the current analysis period. This on-chain behavior data includes on-chain application frequency data and on-chain application rejection frequency data. The on-chain application frequency data represents the number of power grid information on-chain requests executed by consortium blockchain nodes within the current analysis period, while the on-chain application rejection frequency data represents the number of power grid information on-chain requests rejected by consortium blockchain nodes within the current analysis period. The analysis period is obtained through simulation calculation using a population optimization algorithm. The on-chain behavior data obtained in the first N-1 times are combined into an on-chain behavior prediction dataset. The prediction dataset is then fed into the on-chain behavior prediction model for processing. The on-chain behavior prediction data corresponding to the current analysis period is output. The on-chain behavior prediction data includes on-chain application frequency prediction data and on-chain application rejection frequency prediction data. The on-chain behavior data for the current analysis period is compared with the on-chain behavior prediction data for the corresponding analysis period. Specifically, the fluctuation value δ1 of the on-chain application frequency is calculated. The fluctuation value δ1 of the on-chain application frequency is |F t -F r | / F t , where F t For on-chain application frequency data, F r For predicting the frequency of on-chain application requests; calculate the fluctuation value δ2 of the frequency of on-chain application rejections, where δ2 = |H t -H r | / H t H t H rejects application frequency data for on-chain processing. r The data is used to predict the frequency of rejected applications on the blockchain. The system checks whether the condition "δ1 > μ1 and δ2 > μ2" is true, where μ1 is the fluctuation threshold of the frequency of applications on the blockchain and μ2 is the fluctuation threshold of the frequency of rejected applications on the blockchain. If "δ1 > μ1 and δ2 > μ2" is true, the corresponding analysis period is marked as a suspicious time period. If "δ1 > μ1 and δ2 > μ2" is not true, no action is taken. If a single consortium blockchain node exhibits D consecutive suspicious time periods, it is marked as an abnormal node. All access requests from the abnormal node to the power grid information security storage consortium blockchain are denied. The abnormal node's information is broadcast to all consortium blockchain nodes, and an abnormal node report is generated and sent to maintenance personnel. If a single consortium blockchain node does not exhibit D consecutive suspicious time periods, no action is taken, and the suspicious time periods that do not reach the D consecutive suspicious time periods are deleted from the mark.
2. The method for secure storage and sharing of power grid information based on blockchain according to claim 1, characterized in that, The training of the on-chain behavior prediction model includes the following steps: Acquire training samples of on-chain behavior data. The training samples of on-chain behavior data store N historical on-chain behavior data arranged in chronological order. The first N-1 on-chain behavior data in the training samples of on-chain behavior data are used as the input data of the on-chain behavior prediction model, and the last on-chain behavior data in the training samples of on-chain behavior data are used as the output data of the on-chain behavior prediction model. All on-chain behavior data training samples are combined into an on-chain behavior data training set. The on-chain behavior data training set is then fed into the parameter-initialized on-chain behavior prediction model for training. The loss value is calculated, and it is determined whether the loss value is within the confidence range. If the loss value is within the confidence range, the trained on-chain behavior prediction model is output; otherwise, the on-chain behavior prediction model is trained again using the on-chain behavior data training set.
3. The method for secure storage and sharing of power grid information based on blockchain according to claim 2, characterized in that, The analysis period is calculated using a population optimization algorithm and includes the following: After sending the abnormal node report to the maintenance personnel, obtain their feedback, which includes whether the node is abnormal or not. If the feedback is abnormal, do not adjust the analysis cycle; if the feedback is not abnormal, perform the following operations: After obtaining feedback from maintenance personnel, taking the unit period in which the abnormal node report was issued as the center point, the unit-time on-chain behavior data of the consortium blockchain nodes within several unit periods is continuously obtained from the unit-time on-chain behavior data repository. The unit-time on-chain behavior data includes unit-time on-chain application frequency data and unit-time on-chain application rejection frequency data. The unit-time on-chain application frequency data is the number of power grid information on-chain requests executed by the consortium blockchain node within the unit period, and the unit-time on-chain application rejection frequency data is the number of power grid information on-chain requests rejected by the consortium blockchain node within the unit period. The unit period is shorter than the analysis period. The unit-time on-chain behavior data repository consists of continuously obtained unit-time on-chain behavior data. Acquire several units of on-chain behavior data per unit time, and based on all the acquired on-chain behavior data per unit time, simulate and calculate the analysis period using a population optimization algorithm, and output the analysis period.
4. A blockchain-based method for secure storage and sharing of power grid information according to claim 3, characterized in that, The analysis period is simulated and calculated using a population optimization algorithm, and the analysis period is output. The specific steps include the following: Construct several simulated individuals and form a population set of all simulated individuals. Set the maximum number of iterations. The simulated individuals are constructed as follows: randomly generate a random integer ζ, and satisfy that the time length of ζ unit periods is within the period time length interval. Record the random integer ζ as a simulated individual. Calculate the fitness of each simulated individual for all simulated individuals within the population set; Based on the fitness of simulated individuals, the population set is iteratively updated using a population optimization algorithm; When the number of iterations reaches the maximum number of iterations, output the simulated individual with the highest fitness, which is denoted as the optimal simulated individual. Take the random integer ζ stored in the optimal simulated individual, and output the ζ-unit period as the analysis period.
5. A blockchain-based method for secure storage and sharing of power grid information according to claim 4, characterized in that, Fitness is calculated as follows: Retrieve the random integer ζ stored in the simulated individual, and denote ζ unit periods as the simulation analysis period. Simultaneously, ζ unit time on-chain behavior data are used to form the simulated on-chain behavior data corresponding to the simulation analysis period. The simulated on-chain behavior data includes simulated on-chain application frequency data and simulated on-chain application rejection frequency data. Arrange all simulated on-chain behavior data in chronological order, and select several simulated on-chain behavior datasets through a sliding window of length N. Each simulated on-chain behavior dataset includes N simulated on-chain behavior data. For each simulated on-chain behavior dataset, perform the following operations: select the first N-1 simulated on-chain behavior data from the simulated on-chain behavior dataset and send them to the on-chain behavior prediction model for processing, outputting simulated on-chain behavior prediction data. Calculate the similarity between the simulated on-chain behavior prediction data and the last simulated on-chain behavior data in the simulated on-chain behavior dataset, and denote it as the target similarity. Calculate the average of the target similarities corresponding to all simulated on-chain behavior datasets, which is the fitness of the simulated individual.
6. A method for secure storage and sharing of power grid information based on blockchain according to claim 1, characterized in that, The on-chain behavior prediction model is based on the LSTM model.
7. A blockchain-based method for secure storage and sharing of power grid information according to claim 4, characterized in that, The swarm optimization algorithm uses the sparrow search algorithm.
8. A blockchain-based method for secure storage and sharing of power grid information according to claim 5, characterized in that, The cosine similarity algorithm is used to calculate the similarity between the simulated on-chain behavior prediction data and the last simulated on-chain behavior data in the simulated on-chain behavior dataset.
9. A blockchain-based power grid information security storage and sharing system, characterized in that, The system employs a blockchain-based power grid information security storage and sharing method as described in any one of claims 1-8, comprising: The power grid information security storage alliance chain construction module is used to build a power grid information security storage alliance chain based on Hyperledger Fabric. The power grid information security storage alliance chain includes alliance chain nodes, transaction chaincode, shared chaincode, and sorting service components. The power grid information storage and sharing module is used for storing and sharing power grid information based on the power grid information security storage alliance chain; The consortium blockchain node identity authentication module is used to periodically authenticate the identities of consortium blockchain nodes based on the on-chain behavior of power grid information.
Citation Information
Patent Citations
CN111163165A