A method and system for securely uploading power data to a blockchain based on smart contracts

Through smart contracts and custom confidential identification technology, combined with LSTM neural network and automated chain-winding detection templates, the problems of security control and privacy protection during the power data are solved, and efficient and secure data sharing and management are achieved.

CN116455550BActive Publication Date: 2024-12-31STATE GRID JIANGSU ELECTRIC POWER CO LTD NANJING POWER SUPPLY COMPANY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310291075.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-23
Publication Date
2024-12-31
Estimated Expiration
2043-03-23

AI Technical Summary

Technical Problem

In the prior art, power data cannot be effectively managed and controlled during the chaining process, resulting in massive sensitive data leakage, posing huge security risks. Homomorphic encryption of individual privacy fields requires sacrificing computing efficiency in exchange for privacy protection.

Method used

Using the smart contract-based power data security penetration method, the trusted core node is determined through the LSTM neural network, a blockchain data identification system is built based on custom confidential identification technology, and an automated data security penetration and detection smart contract template is built to realize data Source-side trustworthiness verification and full-process automated management.

Benefits of technology

It realizes efficient and secure sharing of power data in secure sharing, ensures the trustworthiness and privacy of the data source side, avoids sensitive data leakage, and improves computing efficiency and data access permission management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116455550B_ABST
    Figure CN116455550B_ABST
Patent Text Reader

Abstract

A method and system for securely uploading power data to a chain based on smart contracts, the method comprising: step 1, obtaining the expected reputation value of the node based on the LSTM neural network according to the initial reputation value, architecture reputation value and performance reputation value of the node in the alliance chain, and determining the trusted core node according to the expected reputation value; using the trusted core node, verifying the credibility of the identity of the power data sharing party based on the intra-organizational consensus method and the inter-organizational consensus method; step 2, building a blockchain data identification system based on the power data security level based on the custom confidentiality level identification technology; step 3, building an automated data security uploading detection smart contract template based on the custom data confidentiality level identification system. The present invention solves the problem of sensitive data uploading leakage and authority management in the secure sharing of power data, and promotes a more efficient and secure sharing method for business data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of power data security technology, and specifically, relates to a method and system for securely uploading power data to a blockchain based on smart contracts. Background Art

[0002] Blockchain will play a greater role in solving a series of challenges faced by power grid business, such as multi-subject collaboration, open data sharing, and environmental fairness and justice. Combining blockchain with power grid business will help promote the transformation of power grid production management and operation methods towards intelligence and networking, and use blockchain technology to integrate and share power grid data, reduce production and operation costs, and enhance the trust relationship between various business entities of the power grid.

[0003] Electricity data includes marketing, power grid, materials, finance, etc., and has the characteristics of large data volume, large user scale, multiple data collection points, and multiple data types. The combination of power data and blockchain technology ensures that data flow is reliable, transparent, open, and fair. The generation, transmission, distribution, and delivery of the power grid generate massive amounts of data at every link and every moment. These data can greatly promote the intelligent perception of the power grid, internal control capabilities, and user service efficiency. At the same time, these power data are related to the safe operation of the power grid.

[0004] In the prior art, the power data business department implements data classification and grading, asset management system, and a blockchain-based power terminal data security management method (CN111209334A). The power data is signed and verified by each blockchain node, and then the aggregated signature verification is performed by selecting the main blockchain node, so that the power data is not manually modified during the application and storage process, and the consistency and tamper-proof of the power data during the application and storage process are achieved. However, in the prior art, it is impossible to implement effective security management and control of power data during the chain-up process, which may cause massive sensitive data to be leaked on the chain, resulting in huge security risks in the operation of the power grid. The prior art also proposes a "smart contract + homomorphic encryption algorithm" to share the entire process of chain-up evidence, thereby ensuring the data security of both the supply and demand sides and preventing data leakage. This prior art only solves the security problem in the process of data chain-up, but homomorphic encryption of individual privacy fields of power data requires sacrificing computing efficiency in exchange for privacy protection. Summary of the invention

[0005] In order to solve the deficiencies in the prior art, the present invention provides a method and system for securely uploading power data to a chain based on smart contracts, which solves the problems of sensitive data leakage and permission management in the secure sharing of power data, and promotes a more efficient and secure sharing method for business data.

[0006] The present invention adopts the following technical solution.

[0007] The present invention proposes a method for securely uploading power data to a blockchain based on smart contracts, comprising:

[0008] Step 1: According to the initial reputation value, architecture reputation value and performance reputation value of the nodes in the alliance chain, the expected reputation value of the nodes is obtained based on the LSTM neural network, and the trusted core nodes are determined according to the expected reputation value; the trusted core nodes are used to verify the credibility of the identity of the power data sharing party based on the intra-organizational consensus method and the inter-organizational consensus method;

[0009] Step 2: Based on the custom confidentiality level identification technology, a blockchain data identification system based on the security level of power data is constructed;

[0010] Step 3: Build an automated data security chain detection smart contract template based on a custom data confidentiality identification system.

[0011] Preferably, step 1 comprises:

[0012] Step 1.1, import the identity information of each organization in the alliance chain; generate an initial reputation value for each organization based on the matching of the organization's identity information with the existing authentication information in the alliance chain;

[0013] Step 1.2, using the initial reputation value of the organization node as the initial reputation value of the member nodes within the organization, determining the architecture reputation value of each member node, and calculating the performance reputation value of each node during the working cycle;

[0014] Step 1.3: The initial reputation value, architecture reputation value, and performance reputation value of the member nodes constitute the source data of three dimensions, which are input into the LSTM neural network to obtain the expected reputation value of each member node; the expected reputation values ​​are sorted from large to small, and the member nodes with the expected reputation values ​​in the top 20% are regarded as trusted core nodes;

[0015] Step 1.4: Use the trusted core node to verify the credibility of the identity of the power data sharing party based on the intra-organizational consensus method and inter-organizational consensus method, and complete the blockchain transaction consensus.

[0016] Furthermore, in step 1.1, the organization node is initially created in the alliance chain. First, the identity information of the organization is matched with the authentication information of the existing CA center in the alliance chain. If the match is successful, the terminal is used to generate the corresponding public and private key pairs to realize the encryption and decryption of the sent and received information, and the initial reputation value of the organization node in the alliance chain is the current average value; if the match fails, the identity information of the organization is submitted to the existing organizations in the alliance chain for review. After obtaining the full approval of the existing organizations in the alliance chain, the initial reputation value of the organization node in the alliance chain is zero, and the generated public key will be broadcast and stored in the blockchain.

[0017] Further, step 1.2 includes:

[0018] Step 1.2.1, count the number of member nodes within each organization on the alliance chain;

[0019] Step 1.2.2: Use the initial reputation value of the organization node as the initial reputation value of the member nodes within the organization, and calculate the architecture reputation value of the member nodes using the following relationship:

[0020]

[0021] In the formula,

[0022] Df(i) is the architecture reputation value of member node i,

[0023] b ij If member node i has a relationship with member node j, b ij = 0 means that member node i has no relationship with member node j, b ij =1 means that member node i has a relationship with member node j.

[0024] g f is the number of member nodes within the organization;

[0025] Step 1.2.3, in the organization, sort the architecture reputation values ​​from large to small, and take the member nodes with architecture reputation values ​​in the top 20% as the architecture core nodes, and the other member nodes as the architecture edge nodes. Use the K-means clustering algorithm to classify the architecture edge nodes and obtain the architecture core node group within the organization;

[0026] Step 1.2.4, all architecture core nodes in the organization have the same architecture reputation value, which is the average of the architecture reputation values ​​corresponding to all architecture core nodes; at the same time, each architecture edge node in the architecture core node group in the organization also has the same architecture reputation value, which is the average of the architecture reputation values ​​corresponding to all architecture edge nodes in the architecture core node group;

[0027] Step 1.2.5, calculate the performance reputation value of the member node during the working cycle using the following relationship:

[0028] sh(i)=T+V+O

[0029] In the formula,

[0030] sh(i) is the performance reputation value of member node i,

[0031] T represents whether a member node has a single point failure. If a single point failure occurs, T = 0. If no single point failure occurs, T = the number of times the member node participates in and completes consensus during the working cycle.

[0032] V represents whether the member node has committed malicious or dishonest behavior. If malicious or dishonest behavior occurs, V = 0. If no malicious or dishonest behavior occurs, V = the number of times the member node participates in and completes consensus during the working cycle.

[0033] O represents the number of times a node participates in and completes consensus during a work cycle.

[0034] Among them, the working cycle is defined according to the amount of tasks executed by the system or the working hours.

[0035] Further, step 1.3 includes:

[0036] Step 1.3.1, the initial reputation value, architectural reputation value and performance reputation value of the member node constitute the source data of three dimensions, which are input into the LSTM neural network to obtain the expected reputation value of each member node;

[0037] Step 1.3.2, sort the expected reputation values ​​from large to small, and select the member nodes whose expected reputation values ​​are in the top 20% as trusted core nodes.

[0038] Further, step 1.4 includes:

[0039] Step 1.4.1: Use the trusted core nodes in the organization and adopt the improved Byzantine fault-tolerant consensus algorithm to reach organizational consensus. Any trusted core node in the organization transmits the change information stored in the terminal to other trusted core nodes in the organization for synchronization through the NWR protocol.

[0040] Step 1.4.2: Based on the consensus within the organization, the top 20% trusted core nodes in each organization are used as the consensus trusted core nodes between organizations;

[0041] Step 1.4.3, between organizations, the consensus optional core node of one organization initiates a consensus application to the consensus trusted core node of another organization and sends its own authentication identity. After the authentication is passed, the information is updated and maintained and stored.

[0042] In step 1.4.4, in the organizational consensus method, all improvement proposals are proposed by each trusted core node, which requires the full recognition of all other trusted core nodes, and the proposals are proposed as a one-way loop sequence, which can be expressed as the following relationship:

[0043] N=(QR)%C

[0044] In the formula, N is the node number that currently issues the improvement proposal application, Q is the existing height of the blockchain, R is the number of nodes that need to organize consensus, and C is the consensus round that has been completed.

[0045] Preferably, in step 2, a custom confidentiality level identification technology is proposed based on the State Grid Corporation of China's data security level specifications, data sharing technical specifications, and unified resource identification specifications.

[0046] In the blockchain data identification system, custom data identification includes: identity, semantics and custom confidentiality level symbols.

[0047] The custom security level symbol includes 7 identification bits, namely POC, COC, COI, AON, CON, and S. Each identification bit represents the following meanings:

[0048] POC: used to indicate the encryption status of the current data. 1 means that the current data has been encrypted, and 0 means that the current data is in plain text.

[0049] COC: Indicates whether the current data has been changed since it was published by the current data owner. 1 indicates that it has been changed, and 0 indicates that it has never been changed.

[0050] COI: Indicates whether the data owner can be changed after the confidentiality level is marked. 1 means it can be changed, and 0 means it cannot be changed.

[0051] AON: indicates whether the confidentiality level needs to be reviewed again if the data owner or semantics has changed. 1 indicates that it needs to be reviewed again, and 0 indicates that the original identification is maintained.

[0052] CON: Indicates whether the confidentiality level of the current data has been reviewed. 1 means that the confidentiality level has been reviewed and approved, and 0 means that the confidentiality level has not been reviewed.

[0053] S: Used to mark the confidentiality level of data.

[0054] Preferably, in step 3, an automated data security on-chain detection smart contract template is built, including defining the following three interfaces:

[0055] The first interface is instantiate(), which is the entry point for the smart contract to process the received MsgInstantiateContract message. It extracts instantiation data from the message to provide initialization state values ​​for smart contract template compilation and the initial running environment of the algorithm.

[0056] The second interface is execute(), which is called when the smart contract performs a write operation, provides parameters for variables, and is also the location where the smart contract template sets the security level on-chain boundary;

[0057] The third interface is query(), which is called when the smart contract queries data. It is a code compilation method for querying data flags. It defines the query of the current data owner, whether the data has been changed, and whether the data level has been reviewed.

[0058] The present invention also proposes a smart contract-based power data secure chain system for implementing the steps of the method.

[0059] A terminal includes a processor and a storage medium; the storage medium is used to store instructions; the processor is used to operate according to the instructions to execute the steps of the method.

[0060] A computer-readable storage medium stores a computer program, which implements the steps of the method when executed by a processor.

[0061] The beneficial effects of the present invention are as follows:

[0062] 1. It is proposed to use the initial reputation value, architecture reputation value and performance reputation value of blockchain nodes as the data basis, input them into the long short-term memory (LSTM) neural network to predict the node reputation, and use the member nodes with expected reputation values ​​greater than or equal to the reputation value threshold as trusted core nodes. Using trusted core nodes, the credibility of the identity of the power data sharing party is verified based on the intra-organizational consensus method and the inter-organizational consensus method, achieving an efficient and dynamic breakthrough in secure and trusted identity authentication technology to ensure the credibility of the data source end;

[0063] 2. Based on the State Grid Corporation of China's data security level specifications, data sharing technical specifications, and unified resource identification specifications, a custom confidentiality level identification technology was proposed, and a blockchain data identification system based on the power data security level was constructed, providing a data structure foundation for preventing privacy data from being uploaded to the chain and controlling data access rights;

[0064] 3. Build an automated data security chain detection smart contract template based on a custom data confidentiality identification system, convert the power data security classification management specifications and other alliance chain member data security management specifications into smart contract language, and trigger smart contracts to achieve full-process automated management of data security chain. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] Figure 1 It is a functional schematic diagram of a method and system for securely uploading power data to a blockchain based on smart contracts proposed by the present invention;

[0066] Figure 2 Schematic diagram of intra-organizational consensus and inter-organizational consensus in an embodiment of the present invention.

[0067] Figure 3 It is a smart contract template for automated data security on-chain detection. DETAILED DESCRIPTION

[0068] In order to make the purpose, technical scheme and advantages of the present invention clearer, the technical scheme of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. The embodiments described in this application are only embodiments of a part of the present invention, rather than all embodiments. Based on the spirit of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work belong to the protection scope of the present invention.

[0069] On the one hand, the present invention proposes a method and system for securely uploading power data to a blockchain based on smart contracts, such as Figure 1 As shown, including:

[0070] Step 1: According to the initial reputation value, architectural reputation value and performance reputation value of the nodes in the alliance chain, the expected reputation value of the node is obtained based on the LSTM neural network, and the trusted core node is determined according to the expected reputation value; using the trusted core node, the credibility of the identity of the power data sharing party is verified based on the intra-organizational consensus method and the inter-organizational consensus method.

[0071] Specifically, based on digital signatures and long short-term memory (LSTM) neural networks, the credibility of the identity of the power data sharing party is verified.

[0072] The authentication framework based on the traditional Public Key Infrastructure (PKI) usually implements two-way authentication with the secure hierarchical authentication protocol. This authentication framework is a great improvement over the authentication framework based on symmetric keys, such as the Kerberos network authorization protocol. However, since the two parties to the authentication communicate by issuing certificates or certificate chains to each other, the certificate maintenance process, such as certificate status query, has problems such as large computing and communication overhead, and the inability to dynamically adjust the reputation value. There is also a direct construction of the authentication path based on the existing PKI structure and topological relationship of each domain, but the authentication path is complex and the authentication efficiency is low. Therefore, the present invention first proposes an efficient and dynamic secure and trusted identity authentication and control method. The premise for realizing power data sharing is the authentication of identity credibility to ensure the credibility of the data source.

[0073] Specifically, step 1 includes:

[0074] Step 1.1, import the identity information of each organization in the alliance chain; generate an initial reputation value for each organization based on the matching of the organization's identity information with the existing authentication information in the alliance chain.

[0075] Specifically, all organizations are power data sharing parties, and they import the identity information of the State Grid Certificate Authority (CA) center and the CA centers of other organizations in the alliance chain. Among them, newly registered organizations need to be recognized by all organizations in the existing alliance chain, and new registrations of members within the organization need to be recognized by the CA center of the organization.

[0076] The organization applying for registration first initiates an authentication application at the terminal. The authentication center returns the organization specification document to the organization applying for registration, and the organization applying for registration provides identity proof materials and authentication requirements. When initially creating an organization node in the alliance chain, first match the organization's identity information with the authentication information of the existing CA center in the alliance chain. If the match is successful, the terminal generates a corresponding public and private key pair to encrypt and decrypt the sent and received information, and the initial reputation value of the organization node in the alliance chain is the current average value; if the match fails, the organization's identity information is submitted to the existing organizations in the alliance chain for review. After obtaining full approval from the existing organizations in the alliance chain, the initial reputation value of the organization node in the alliance chain is zero, and the generated public key will be broadcast and stored in the blockchain. For organizations with an initial reputation value of zero, they need to further demonstrate their integrity and improve the reputation value of the entire alliance to ensure the high security of the entire alliance chain.

[0077] The present invention continues to take advantage of the centralized CA organization's unified resources and easy management.

[0078] Step 1.2, using the initial reputation value of the organization node as the initial reputation value of the member nodes within the organization, determine the architecture reputation value of each member node, and count the performance reputation value of each node during its working cycle.

[0079] Step 1.2 includes:

[0080] Step 1.2.1, count the number of member nodes within each organization on the alliance chain.

[0081] Since the organizations in the alliance chain are all for specific organizational groups and limited third parties, each organization is naturally divided into regions. However, the number of member node registrations within each organization is different, and the number is set according to business needs and application scenarios, so it is necessary to first count the number of members within the organization.

[0082] Step 1.2.2: Use the initial reputation value of the organization node as the initial reputation value of the member nodes within the organization, and calculate the architecture reputation value of the member nodes using the following relationship:

[0083] Based on the initial reputation value, architectural reputation value and performance reputation value of the member node, the expected reputation value of each member node is obtained based on the LSTM neural network.

[0084] Among them, the initial reputation value of the organization node is used as the initial reputation value of the member nodes within the organization.

[0085] The architectural reputation value of a member node is determined by the degree of connection between member nodes in the same organization. If a member node has more connections with other member nodes, the reputation value of the member node in the organization is higher, and the importance of the member node in the organization is also higher. The present invention assumes that the relationship between member nodes is a directed graph, and the architectural reputation value of a member node can be expressed as the following relationship:

[0086]

[0087] In the formula,

[0088] Df(i) is the architecture reputation value of member node i,

[0089] b ij If member node i has a relationship with member node j, b ij = 0 means that member node i has no relationship with member node j, b ij =1 means that member node i has a relationship with member node j.

[0090] g f is the number of member nodes within the organization.

[0091] Step 1.2.3, in the organization, sort the architecture reputation values ​​from large to small, and take the member nodes with architecture reputation values ​​in the top 20% as the architecture core nodes, and the other member nodes as the architecture edge nodes. Use the K-means clustering algorithm to classify the architecture edge nodes and obtain the architecture core node group within the organization.

[0092] The nodes with the top 20% of architecture reputation values ​​are regarded as the core nodes of the architecture, and the other member nodes are regarded as the edge nodes of the architecture. The edge nodes of the architecture are classified by the K-means clustering algorithm as follows:

[0093] 1. Take the core node of the architecture as the cluster center, calculate the distance from each edge node of the architecture to the cluster center, and assign it to the cluster center corresponding to the minimum distance.

[0094] 2. Determine the architecture core node group within the organization through clustering iterative calculation. All architecture core nodes within the organization have the same architecture reputation value, which is unified as the average value among the architecture core nodes; at the same time, each architecture edge node within the architecture core node group within the organization also has the same architecture reputation value, which is unified as the average value of each architecture edge node within the group.

[0095] Step 1.2.4, all architecture core nodes in the organization have the same architecture reputation value, which is the average of the architecture reputation values ​​corresponding to all architecture core nodes; at the same time, each architecture edge node in the architecture core node group in the organization also has the same architecture reputation value, which is the average of the architecture reputation values ​​corresponding to all architecture edge nodes in the architecture core node group;

[0096] Step 1.2.5, calculate the performance reputation value of the member node during the working cycle using the following relationship:

[0097] The performance reputation value of a member node during its working cycle is calculated using the following relationship:

[0098] sh(i)=T+V+O

[0099] In the formula,

[0100] sh(i) is the performance reputation value of member node i,

[0101] T represents whether a member node has a single point failure. If a single point failure occurs, T = 0. If no single point failure occurs, T = the number of times the member node participates in and completes consensus during the working cycle.

[0102] V represents whether the member node has committed malicious or dishonest behavior. If malicious or dishonest behavior occurs, V = 0. If no malicious or dishonest behavior occurs, V = the number of times the member node participates in and completes consensus during the working cycle.

[0103] O represents the number of times a node participates in and completes consensus during a work cycle.

[0104] Among them, the working cycle is defined according to the amount of tasks executed by the system or the working hours.

[0105] The LSTM neural network memorizes information through Cell, and the network architecture includes: input gate, forget gate, and output gate. At the same time, the LSTM neural network introduces the sigmoid function and combines it with the tanh function to effectively solve the time series problem. The memory effect is more sensitive to the historical performance of the node and can accurately predict the future reputation value of the node.

[0106] The initial reputation value, architectural reputation value, and performance reputation value of member nodes constitute the source data of three dimensions, which are input into the LSTM neural network to obtain the expected reputation value of each member node.

[0107] In step 1.3, the initial reputation value, architecture reputation value and performance reputation value of the member node constitute the source data of three dimensions, which are input into the LSTM neural network to obtain the expected reputation value of each member node; the expected reputation values ​​are sorted from large to small, and the member nodes with expected reputation values ​​in the top 20% are regarded as trusted core nodes.

[0108] Based on the historical performance data of blockchain nodes, the present invention constructs a dynamic adjustment mechanism of integrity based on LSTM neural network to realize the "dynamic centralization" of identity information verification.

[0109] Specifically, step 1.3 includes:

[0110] Step 1.3.1, the initial reputation value, architectural reputation value and performance reputation value of the member node constitute the source data of three dimensions, which are input into the LSTM neural network to obtain the expected reputation value of each member node;

[0111] Step 1.3.2, sort the expected reputation values ​​from large to small, and select the member nodes whose expected reputation values ​​are in the top 20% as trusted core nodes.

[0112] Step 1.4: Use the trusted core node to verify the credibility of the identity of the power data sharing party based on the intra-organizational consensus method and inter-organizational consensus method, and complete the blockchain transaction consensus.

[0113] Specifically, in order to build a fair execution environment for the alliance chain, the reputation value threshold within the organization is set at 20%, such as Figure 2 As shown in the hollow circle, the member nodes in the organization whose expected reputation value is less than the reputation value threshold are treated as ordinary nodes.

[0114] Specifically, Figure 2 As shown, step 1.4 includes:

[0115] Step 1.4.1, using trusted core nodes within the organization, adopting the improved Byzantine fault-tolerant consensus algorithm for organizational consensus. Any trusted core node within the organization transmits the terminal's stored change information to other trusted core nodes within the organization for synchronization through the NWR protocol.

[0116] It solves the problem of synchronization of change information between nodes when the number of nodes within each organization of the alliance chain is different.

[0117] Specifically, assuming that α and β are both trusted core nodes within the organization, when the alliance chain is running, information changes will occur within the trusted core node groups of α and β, so there is a need for information synchronization; if α initiates an information update request, β agrees and compares the local database to update the difference information; β also sends the updated part of its own database to α, and α updates it against the local database.

[0118] Step 1.4.2: Based on the consensus within the organization, the top 20% of trusted core nodes in each organization are used as the consensus trusted core nodes between organizations.

[0119] The consensus between organizations is based on the consensus within organizations. When the trusted core nodes within an organization conduct security authentication with the trusted core nodes of other organizations, they also need to select the top 20% of the trusted core nodes within the organization as consensus trusted core nodes, and the other 80% of the trusted core nodes are ordinary trusted core nodes.

[0120] Step 1.4.3, between organizations, the consensus optional core node of one organization initiates a consensus application to the consensus trusted core node of another organization and sends its own authentication identity. After the authentication is passed, the information is updated and maintained and stored.

[0121] In step 1.4.4, in the organizational consensus method, all improvement proposals are proposed by each trusted core node, which requires the full recognition of all other trusted core nodes, and the proposals are proposed as a one-way loop sequence, which can be expressed as the following relationship:

[0122] N=(QR)%C

[0123] In the formula, N is the node number that currently issues the improvement proposal application, Q is the existing height of the blockchain, R is the number of nodes that need to organize consensus, and C is the consensus round that has been completed.

[0124] In the organizational consensus method, all improvement proposals are put forward by each trusted core node. For the sake of system reliability, the full recognition of all other trusted core nodes is required, and the proposals are put forward as a one-way circular sequence.

[0125] When a new member node applies to join, the trusted core node in the organization will update the public key information of the new member node and publish it on the chain. Other trusted core nodes in the same organization will reach a consensus to ensure the initial authentication consensus of the identity. At the same time, the authentication information is retrieved by Bloom filter, which further improves the verification efficiency of identity information.

[0126] During the operation of the alliance chain, when a consensus trusted core node fails to authenticate its identity to its organization, it also needs to send an authentication application to another connected organization. If all authentications fail, it proves that the identity is illegal. At the same time, the authentication between organizations is mutual authentication, thereby ensuring the high security of identity authentication.

[0127] In response to the frequent problem of privacy leakage in data sharing, the present invention combines traditional CA centralized authentication with dynamic adjustment of reputation value based on LSTM neural network to achieve "dynamic centralization" of identity information verification, and combines artificial intelligence to provide reliable protection for the data sharing identity authentication process of blockchain.

[0128] Step 2: Based on the custom confidentiality level identification technology, build a blockchain data identification system based on the security level of power data.

[0129] Based on the State Grid Corporation of China's data security level specifications, data sharing technical specifications, and unified resource identification specifications, a custom confidentiality level identification technology was proposed, and a blockchain data identification system based on the security level of power data was constructed.

[0130] The custom data confidentiality level identification technology proposed in the present invention first takes into account the existing specifications based on the State Grid Corporation of China's data security level specifications, data sharing technical specifications, unified resource identification specifications, etc., and at the same time has multi-level expansion functions such as business, data, security, and adaptation, which can achieve the uniqueness and uniformity of mapping multi-type and multi-security level data such as power grid marketing, operation and maintenance, law, and dispatch.

[0131] Specifically, in step 2, the custom data identifier includes: identity, semantics and custom confidentiality level symbol.

[0132] Among them, the identity is the identity ID printed by the data owner, indicating the ownership of the current data, and the legitimacy and uniqueness of the identity part are guaranteed by the consensus mechanism, and it is compatible with the current mainstream blockchain underlying chain platform; the semantics contains the information elements of the data, which is the main part of the data and represents the main value of the data; the custom confidentiality symbol includes the user-defined confidentiality level logo to prevent privacy data leakage.

[0133] In order to achieve multi-level data control, the custom confidentiality symbol contains 7 identification bits, namely POC, COC, COI, AON, CON, S, and each identification bit represents the following meanings:

[0134] POC: used to indicate the encryption status of the current data. 1 means that the current data has been encrypted, and 0 means that the current data is in plain text.

[0135] COC: Indicates whether the current data has been changed since it was released by the current data owner. 1 means it has been changed, and 0 means it has never been changed.

[0136] COI: Indicates whether the data owner can be changed after the confidentiality level is marked. 1 means it can be changed, and 0 means it cannot be changed.

[0137] AON: Indicates whether the confidentiality level needs to be reviewed if the data owner or semantics has changed. 1 indicates that it needs to be reviewed, and 0 indicates that the original identification is maintained.

[0138] CON: Indicates whether the confidentiality level of the current data has been reviewed. 1 means that the confidentiality level has been reviewed and approved, and 0 means that the confidentiality level has not been reviewed.

[0139] S: Used to mark the confidentiality level of data.

[0140] According to the data security management and control standards of the State Grid and other alliance chain members, data of different confidentiality levels are classified and managed to prevent the leakage of privacy-sensitive data. Violating nodes will be recorded and their reputation will be affected.

[0141] Step 3: Build an automated data security on-chain detection smart contract template based on a custom data classification identification system, such as Figure 3 shown.

[0142] In order to realize the full-process automated management of data security on the chain, the power data security classification management specifications and other alliance chain member data security management specifications are converted into smart contract language, and the chain management is automatically realized by triggering the smart contract.

[0143] Step 2 has established the data format for blockchain data confidentiality identification. Although different participating organizations in the alliance chain have different requirements for data confidentiality, resulting in different conditions for triggering smart contracts, the data security workload can be simplified and the data detection efficiency and security level can be improved by building a custom data security chain detection smart contract template.

[0144] Specifically, in step 3, the general part and the customized part of the document structure description are distinguished, and then the corresponding data on-chain detection smart contract framework code is generated, the function library environment and script file code required by this framework code are determined, and the customized part is determined based on the parsing results of the data service formalization file. Among them, the preparation of the smart contract template mainly defines the following three interfaces:

[0145] The first interface is instantiate(), which is the first entry point for smart contract messages and also the entry point for contract processing received MsgInstantiateContract messages. It extracts instantiation data from the message to provide initialization state values ​​for smart contract template compilation and the initial running environment for the algorithm.

[0146] The second interface is execute(), which is called when the smart contract is written. It provides parameters for variables and is also the location where the smart contract template sets the security level chain boundary. This location needs to be compiled according to the data security chain specifications of each organization.

[0147] The third interface is query(), which is called when the smart contract queries data. This position is the code compilation method for querying data flags, which defines the query of the current data owner, whether the data has been changed, whether the data level has been reviewed, etc.

[0148] Therefore, the entire custom data security on-chain detection smart contract template is as follows Figure 3As shown, first obtain the smart contract execution permission and configure the blockchain environment information. Then set the current security level to prevent data from being uploaded to the chain to prevent sensitive data from being accidentally uploaded to the chain. Finally, configure the method for querying the security level of the current data and the method for handling illegal operations.

[0149] After completing the code element supplement in the framework, the code framework is read into the memory according to the contract code storage path, compiled and generated, and the interface design of the Web service description language is completed. At the same time, after consensus within and between organizations of the alliance chain, the smart contract is completed on the chain. When there is an illegal operation of uploading sensitive data to the chain, the smart contract will be triggered to automatically block it.

[0150] In this embodiment, first, based on the dual protection mechanism of digital signature and LSTM neural network, the credibility of the identity of the power data sharing party is verified. In the network, the trusted core node is focused on according to the individual distribution of nodes, and the ordinary node obtains a unique identity ID through the security authentication of the trusted core node; secondly, the trusted core nodes in the same organization share and store all registered node data through a consensus protocol, and the registered nodes can be queried and verified through any trusted node in the alliance; finally, different organizations share and store the registered node data between organizations through a consensus protocol, and finally the authentication data can be unified across the entire network. On the basis that all nodes in the entire network can authenticate each other's identities through any trusted node in the entire network. The present invention constructs a blockchain data identification system based on the security level of power data, combines the custom level identification technology with the security level of power big data, realizes the uniqueness and knowability of the resource name of the coding mapping method, identifies the level of power data, and supports data security on the chain. Finally, the present invention proposes the construction of an intelligent contract template for automated data security chain detection, realizes the full-process automated management of data security chain, converts the power data security classification management specifications into intelligent contract language, and automatically realizes chain management by triggering intelligent contracts, providing strong security support for breaking through the "power data island".

[0151] The present invention also proposes a smart contract-based power data secure chain system for implementing the steps of the method.

[0152] A terminal comprises a processor and a storage medium; the storage medium is used to store instructions; the processor is used to operate according to the instructions to execute the steps of the method.

[0153] A computer-readable storage medium stores a computer program, which implements the steps of the method when executed by a processor.

[0154] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.

[0155] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.

[0156] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0157] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.

[0158] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents, and any modifications or equivalent replacements that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A method for securely uploading power data to a blockchain based on smart contracts, characterized in that: include: Step 1: According to the initial reputation value, architecture reputation value and performance reputation value of the nodes in the alliance chain, the expected reputation value of the nodes is obtained based on the LSTM neural network, and the trusted core nodes are determined according to the expected reputation value; the trusted core nodes are used to verify the credibility of the identity of the power data sharing party based on the intra-organizational consensus method and the inter-organizational consensus method; Among them, the architecture reputation value satisfies the following relationship: Where Df(i) is the architecture reputation value of member node i, b ij = 0 means that member node i has no relationship with member node j, b ij =1 means that member node i has a relationship with member node j, g f is the number of member nodes within the organization; The performance reputation value satisfies the following relationship: sh(i)=T+V+O Where sh(i) is the performance reputation value of member node i, T represents whether a single point failure occurs in the member node. If a single point failure occurs, T = 0. If no single point failure occurs, T = the number of times the member node participates in and completes consensus during the working cycle. V represents whether the member node has malicious or dishonest behavior. If malicious or dishonest behavior occurs, V = 0. If no malicious or dishonest behavior occurs, V = the number of times the member node participates in and completes consensus during the working cycle. O represents the number of times the node participates in and completes consensus during the working cycle. The working cycle is defined based on the amount of tasks executed by the system or the working time. Step 2: Based on the custom confidentiality level identification technology, a blockchain data identification system based on the security level of power data is constructed; Step 3: Build an automated data security on-chain detection smart contract template based on a custom data confidentiality identification system.

2. The method for securely uploading power data to a blockchain based on smart contracts according to claim 1 is characterized in that: Step 1 includes: Step 1.1, import the identity information of each organization in the alliance chain; generate an initial reputation value for each organization based on the matching of the organization's identity information with the existing authentication information in the alliance chain; Step 1.2, using the initial reputation value of the organization node as the initial reputation value of the member nodes within the organization, determining the architecture reputation value of each member node, and calculating the performance reputation value of each node during the working cycle; Step 1.3: The initial reputation value, architecture reputation value, and performance reputation value of the member nodes constitute the source data of three dimensions, which are input into the LSTM neural network to obtain the expected reputation value of each member node; the expected reputation values ​​are sorted from large to small, and the member nodes with the expected reputation values ​​in the top 20% are regarded as trusted core nodes; Step 1.4: Use the trusted core node to verify the credibility of the identity of the power data sharing party based on the intra-organizational consensus method and inter-organizational consensus method, and complete the blockchain transaction consensus.

3. The method for securely uploading power data to a blockchain based on smart contracts according to claim 2 is characterized in that: In step 1.1, the organization node is initially created in the alliance chain. First, the identity information of the organization is matched with the authentication information of the existing CA center in the alliance chain. If the match is successful, the terminal generates the corresponding public and private key pairs to implement encryption and decryption of sent and received information, and the initial reputation value of the organization node in the alliance chain is the current average value; If the match fails, the organization's identity information will be submitted to the existing organizations in the alliance chain for review. After obtaining full approval from the existing organizations in the alliance chain, the initial reputation value of the organization node in the alliance chain will be zero, and the generated public key will be broadcast and stored in the blockchain.

4. The method for securely uploading power data to a blockchain based on smart contracts according to claim 2 is characterized in that: Step 1.2 includes: Step 1.2.1, count the number of member nodes within each organization on the alliance chain; Step 1.2.2, using the initial reputation value of the organization node as the initial reputation value of the member node within the organization, calculate the architecture reputation value of the member node; Step 1.2.3, in the organization, sort the architecture reputation values ​​from large to small, and take the member nodes with architecture reputation values ​​in the top 20% as the architecture core nodes, and the other member nodes as the architecture edge nodes. Use the K-means clustering algorithm to classify the architecture edge nodes and obtain the architecture core node group within the organization; Step 1.2.4, all architecture core nodes in the organization have the same architecture reputation value, which is the average of the architecture reputation values ​​corresponding to all architecture core nodes; at the same time, each architecture edge node in the architecture core node group in the organization also has the same architecture reputation value, which is the average of the architecture reputation values ​​corresponding to all architecture edge nodes in the architecture core node group; Step 1.2.5, calculate the performance reputation value of the member node during the working cycle.

5. The method for securely uploading power data to a blockchain based on smart contracts according to claim 2 is characterized in that: Step 1.4 includes: Step 1.4.1: Use the trusted core nodes in the organization and adopt the improved Byzantine fault-tolerant consensus algorithm to reach organizational consensus. Any trusted core node in the organization transmits the change information stored in the terminal to other trusted core nodes in the organization for synchronization through the NWR protocol. Step 1.4.2: Based on the consensus within the organization, the top 20% trusted core nodes in each organization are used as the consensus trusted core nodes between organizations; Step 1.4.3, between organizations, the consensus trusted core node of one organization initiates a consensus application to the consensus trusted core node of another organization and sends its own authentication identity. After the authentication is passed, the information is updated and maintained and stored; In step 1.4.4, in the organizational consensus method, all improvement proposals are proposed by each trusted core node, which requires the full recognition of all other trusted core nodes, and the proposals are proposed as a one-way loop sequence, which can be expressed as the following relationship: N=(QR)%C In the formula, N is the node number that currently issues the improvement proposal application, Q is the existing height of the blockchain, R is the number of nodes that need to organize consensus, and c is the consensus round that has been completed.

6. The method for securely uploading power data to a blockchain based on smart contracts according to claim 1 is characterized in that: In step 2, based on the State Grid Corporation of China's data security level specifications, data sharing technical specifications, and unified resource identification specifications, a custom confidentiality level identification technology is proposed.

7. The method for securely uploading power data to a blockchain based on smart contracts according to claim 6 is characterized in that: In the blockchain data identification system, custom data identification includes: identity, semantics and custom confidentiality level symbols.

8. The method for securely uploading power data to a blockchain based on smart contracts according to claim 7 is characterized in that: The custom security level symbol includes 7 identification bits, namely POC, COC, COI, AON, CON, and S. Each identification bit represents the following meanings: POC: used to indicate the encryption status of the current data. 1 means that the current data has been encrypted, and 0 means that the current data is in plain text. COC: Indicates whether the current data has been changed since it was published by the current data owner. 1 indicates that it has been changed, and 0 indicates that it has never been changed. COI: Indicates whether the data owner can be changed after the confidentiality level is marked. 1 means it can be changed, and 0 means it cannot be changed. AON: indicates whether the confidentiality level needs to be reviewed again if the data owner or semantics has changed. 1 indicates that it needs to be reviewed again, and 0 indicates that the original identification is maintained. CON: Indicates whether the confidentiality level of the current data has been reviewed. 1 means that the confidentiality level has been reviewed and approved, and 0 means that the confidentiality level has not been reviewed. S: Used to mark the confidentiality level of data.

9. The method for securely uploading power data to a blockchain based on smart contracts according to claim 1 is characterized in that: In step 3, build an automated data security on-chain detection smart contract template, including defining the following three interfaces: The first interface is instantiate(), which is the entry point for the smart contract to process the received MsgInstantiateContract message. It extracts instantiation data from the message to provide initialization state values ​​for smart contract template compilation and the initial running environment of the algorithm. The second interface is execute(), which is called when the smart contract performs a write operation, provides parameters for variables, and is also the location where the smart contract template sets the security level on-chain boundary; The third interface is query(), which is called when the smart contract queries data. It is a code compilation method for querying data flags. It defines the query of the current data owner, whether the data has been changed, and whether the data level has been reviewed.

10. A terminal comprising a processor and a storage medium; characterized in that: The storage medium is used to store instructions; The processor is configured to operate according to the instructions to execute the steps of the method according to any one of claims 1-9.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.