Block chain-based power data traceability system and power data processing method
By using multiple encryption technologies of blockchain and encryption proxy nodes in the power data traceability system, the problems of single point of failure and data leakage in traditional power data security protection are solved, and high security storage and traceability of power data are achieved.
Patent Information
- Application Number
- CN202411386464.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2044-09-30
AI Technical Summary
In traditional power data security protection solutions, central databases are easily targeted, with the risk of data leakage and single point of failure, making it difficult to ensure privacy and security of power data during transmission and storage.
Using a blockchain-based power data traceability system, the original power data is initially encrypted through the blockchain node, and the authorized encryption proxy node is re-encrypted to generate a re-encrypted cipher text, stored on the blockchain, and combined with Centralized distributed ledger technology reduces the risk of single point of failure and authenticates and traces through digital signatures and smart contracts.
It improves the security of the storage and traceability process of power data, reduces the risks of data leakage and tampering, enhances the transparency and immutability of data, and ensures high security of data in traceability and sharing.
Smart Images

Figure CN119299150A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data security technology, and in particular to a blockchain-based power data tracing system, a power data processing method, a power data tracing method, an apparatus, a computer device, a computer-readable storage medium, and a computer program product. Background Art
[0002] With the continuous development and intelligence of the power system, the types and quantities of power data are also increasing rapidly. These power data include privacy information such as users' electricity usage habits and behavior patterns. The leakage or tampering of power data can easily affect the stable operation of the power system. Therefore, the security protection of power data has become an important issue to be solved.
[0003] In traditional solutions, the security protection of power data mainly relies on centralized databases and traditional public key encryption technologies. For example, power data is stored in a central database. When a third party has data traceability requirements, the central database sends the power data encrypted by traditional public key encryption technology to the third party, thereby reducing the risk of leakage in the power data sharing process.
[0004] However, the central database in the above scheme is easy to become an attack target, and there is a risk of data leakage in itself. Once the central database fails, the entire system will be affected. As a result, the privacy of power data cannot be fully guaranteed during transmission and storage, resulting in certain security risks in data traceability and data sharing, that is, the security of the data traceability process is low. Summary of the invention
[0005] Based on this, it is necessary to provide a blockchain-based power data traceability system, power data processing method, power data traceability method, device, computer equipment, computer-readable storage medium and computer program product that can improve the security of data traceability in response to the above-mentioned technical problems.
[0006] In a first aspect, the present application provides a blockchain-based power data traceability system, the system comprising a blockchain node, a data traceability party, and a plurality of encryption proxy nodes authorized by the blockchain node, the encryption proxy nodes being respectively connected to the blockchain node and the data traceability party in communication;
[0007] The blockchain node is used to initially encrypt the received original power data by using the key stored in the local end to obtain the initial encrypted data, determine the re-encryption key based on the key and the key of the data traceability party, generate a plurality of re-encryption key fragments according to the number of encryption proxy nodes and the re-encryption key, and send the plurality of re-encryption key fragments to the encryption proxy node, wherein the re-encryption key fragments correspond to the encryption proxy node one by one;
[0008] The encryption proxy node is used to re-encrypt the initial encrypted data according to the re-encryption key fragment to obtain a re-encrypted ciphertext, and feed the re-encrypted ciphertext back to the blockchain node;
[0009] The data traceability party is used to send a power data traceability request to the blockchain node, wherein the power data traceability request carries the digital signature of the data traceability party; and when the identity authentication is passed, a rich query is performed in the blockchain through a preset smart contract to obtain the power data traceability result;
[0010] The blockchain node is also used to authenticate the data traceability party based on the digital signature when receiving a power data traceability request sent by the data traceability party.
[0011] In one of the embodiments, the data traceability party is also used to obtain the identity information of the blockchain node corresponding to the power data traceability result, authenticate the identity of the blockchain node based on the identity information, and verify the validity of the power data traceability result to obtain the identity authentication result and the validity verification result.
[0012] In one of the embodiments, the data traceability party is also used to determine whether the number of re-encrypted ciphertexts contained in the power data traceability result is greater than a preset threshold value when the blockchain node passes identity authentication and the power data traceability result passes validity verification; when the number of re-encrypted ciphertexts is greater than the preset threshold value, merge the re-encrypted ciphertexts in the power data traceability result to obtain merged re-encrypted ciphertexts, and decrypt the merged re-encrypted ciphertexts based on a preset private key to obtain target power data.
[0013] In one of the embodiments, the system also includes a verification node, which is used to obtain the re-encrypted ciphertext, and when the re-encrypted ciphertext meets the preset block packaging and uploading conditions, the re-encrypted ciphertext is packaged to generate a block, and the block packaging and uploading conditions are determined based on the generation time of the re-encrypted ciphertext, a data processing quantity threshold preset in the blockchain, and a block size threshold preset in the blockchain. When it is determined that the blockchain nodes in the blockchain have reached a consensus according to a preset consensus mechanism, the block is stored on the chain.
[0014] In a second aspect, the present application provides a method for processing electric power data, which is applied to a blockchain node in an embodiment of an electric power data traceability system of a blockchain as described in any one of the above, and the method includes:
[0015] Initially encrypting the received original power data using the key stored in the local end to obtain initial encrypted data;
[0016] Sending a data re-encryption message carrying the initial encrypted data and a preset re-encryption key to an authorized encryption proxy node, wherein the data re-encryption message is used to instruct the encryption proxy node to re-encrypt the initial encrypted data using the re-encryption key to obtain a re-encrypted ciphertext, wherein the re-encryption key is determined based on the key stored on the local end and the key of the data tracing party;
[0017] Receive the re-encrypted ciphertext fed back by the encryption proxy node.
[0018] In one of the embodiments, the initially encrypting the received original power data by using the key stored in the local end to obtain the initial encrypted data includes:
[0019] The received original power data is symmetrically encrypted by using the public key stored in the local end to obtain initial encrypted data, wherein the public key stored in the local end is determined based on an elliptic curve cryptography key generation algorithm.
[0020] In one of the embodiments, the number of the encryption proxy nodes is multiple, and the re-encryption key is determined based on the following steps:
[0021] A re-encryption key is generated according to the private key stored in the local end, the public key of the data traceability party, and the number of the encryption proxy nodes.
[0022] In a third aspect, the present application also provides a power data processing device, including:
[0023] An initial encryption module, used to perform initial encryption on the received original power data using a key stored in the local end to obtain initial encrypted data;
[0024] A re-encryption module, used to send a data re-encryption message carrying the initial encrypted data and a preset re-encryption key to an authorized encryption proxy node, wherein the data re-encryption message is used to instruct the encryption proxy node to re-encrypt the initial encrypted data using the re-encryption key to obtain a re-encrypted ciphertext, wherein the re-encryption key is determined based on a key stored on the local end and a key of a data tracing party;
[0025] The data receiving module is used to receive the re-encrypted ciphertext fed back by the encryption proxy node.
[0026] In a fourth aspect, the present application further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps in any one of the above-mentioned power data processing method embodiments when executing the computer program.
[0027] In a fifth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps in any one of the above-mentioned power data processing method embodiments are implemented.
[0028] In a sixth aspect, the present application further provides a computer program product, including a computer program, which, when executed by a processor, implements the steps in any one of the above-mentioned power data processing method embodiments.
[0029] In a seventh aspect, the present application provides a power data tracing method, which is applied to the data tracing method of the power data tracing system embodiment of the blockchain described in any one of the above, and the method includes:
[0030] Sending a power data traceability request carrying the digital signature of the data traceability party to a blockchain node, so that the verification node in the blockchain authenticates the data traceability party based on the digital signature;
[0031] When the data traceability party passes the identity authentication, a rich query is performed in the blockchain through a preset smart contract to obtain the power data traceability result.
[0032] In one of the embodiments, after obtaining the power data tracing result, the power data tracing method further includes:
[0033] Obtain the identity information of the blockchain node corresponding to the power data traceability result;
[0034] The blockchain node is authenticated based on the identity information, and the power data traceability result is validated to obtain an identity authentication result and a validity verification result.
[0035] In one embodiment, after obtaining the identity authentication result and the validity verification result, the power data tracing method further includes:
[0036] When the blockchain node passes the identity authentication and the power data traceability result passes the validity verification, determining whether the number of re-encrypted ciphertexts included in the power data traceability result is greater than a preset threshold value;
[0037] When the number of re-encrypted ciphertexts is greater than the preset threshold value, merging the re-encrypted ciphertexts in the power data tracing result to obtain a merged re-encrypted ciphertext;
[0038] Based on a preset private key, the combined re-encrypted ciphertext is decrypted to obtain target power data.
[0039] In an eighth aspect, the present application further provides a power data tracing device, comprising:
[0040] A request sending module, used to send a power data tracing request to a blockchain node through a blockchain interface, wherein the power data tracing request carries a digital signature of the data tracing party, and the digital signature is used by the blockchain node to authenticate the data tracing party;
[0041] The data tracing module is used to perform rich query in the blockchain through a preset smart contract to obtain the power data tracing result when the data tracing party passes the identity authentication.
[0042] In a ninth aspect, the present application further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps in any one of the above-mentioned power data traceability embodiments when executing the computer program.
[0043] In the tenth aspect, the present application also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps in any one of the above-mentioned power data tracing method embodiments are implemented.
[0044] In the eleventh aspect, the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps in any one of the above-mentioned power data tracing method embodiments.
[0045] The above-mentioned blockchain-based power data traceability system, power data processing method, power data traceability method, device, computer equipment, computer-readable storage medium and computer program product are different from traditional solutions. During the power data processing process, each blockchain node will initially encrypt the received original power data through the key stored on the local end to obtain the initial encrypted data, and then the encryption proxy node authorized by the blockchain node will further re-encrypt the initial encryption result to obtain the re-encrypted ciphertext. Combined with the decentralized distributed ledger technology of the blockchain, the re-encrypted ciphertext is stored in the blockchain, which can greatly reduce the risk of single point failure and improve the security of the power data storage process. Furthermore, in the process of power data traceability, when the data traceability party initiates a power data traceability request, the blockchain node first authenticates the data requester through the digital signature carried in the power data traceability request. Only when the identity authentication is passed, the power data traceability will be carried out in the blockchain through the preset smart contract, thereby improving the security of the data traceability process; and, the power data stored in the blockchain has been initially encrypted and re-encrypted, so that in the process of data interaction with the data traceability party, the power data traceability results are not easily tampered with or leaked, thereby improving the security of the data traceability process. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0047] Figure 1 An application environment diagram of a power data processing method and a power data tracing method in an embodiment;
[0048] Figure 2 is a flow chart of a power data processing method in one embodiment;
[0049] Figure 3 A schematic diagram of a flow chart of a power data processing method in a detailed embodiment;
[0050] Figure 4 A schematic diagram of a flow chart of a power data tracing method in one embodiment;
[0051] Figure 5 A schematic diagram of a flow chart of a power data tracing method in a detailed embodiment;
[0052] Figure 6 is a structural block diagram of a power data processing device in one embodiment;
[0053] Figure 7 is a structural block diagram of a power data processing device in one embodiment;
[0054] Figure 8 It is a structural block diagram of a power data traceability system based on blockchain in one embodiment;
[0055] Fig. 9 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0056] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0057] The power data processing method provided in the embodiment of the present application can be applied to Figure 1 In the blockchain-based power data traceability system shown, the blockchain node 110 is respectively connected to the encryption proxy node 120 and the data traceability party 130 for communication.
[0058] Specifically, the blockchain node 110 initially encrypts the received original power data using the key stored on the local end to obtain the initial encrypted data, and then determines the re-encryption key based on the key stored on the local end and the key of the data traceability party, and generates multiple re-encryption key fragments according to the number of encryption proxy nodes 120 and the re-encryption key, and sends the multiple re-encryption key fragments to the encryption proxy node 120, and the re-encryption key fragments correspond to the encryption proxy node one by one. Then, the encryption proxy node 120 re-encrypts the initial encrypted data according to the re-encryption key fragments to obtain the re-encrypted ciphertext, and feeds the re-encrypted ciphertext back to the blockchain node 110, and the blockchain node 110 stores the re-encrypted ciphertext fed back by the encryption proxy node on the chain.
[0059] When the data traceability party 130 sends a power data traceability request carrying the digital signature of the data traceability party 130 to the blockchain node 110, the blockchain node 110 authenticates the data traceability party based on the digital signature. If the identity authentication is passed, the data traceability party 130 performs a rich query in the blockchain through a preset smart contract to obtain the power data traceability result. Among them, the blockchain node 110 can be a data node through which the power data flows, including but not limited to a terminal, an edge server, a master station, a data development department, etc.
[0060] In an exemplary embodiment, Figure 2 As shown, a method for processing power data is provided, and the method is applied to Figure 1 Taking the blockchain node 110 in FIG. 1 as an example, the following steps are included:
[0061] S100, initially encrypting the received original power data using the key stored in the local end to obtain initial encrypted data.
[0062] Among them, the key stored in the blockchain node can be used to encrypt the received original power data, which includes but is not limited to power consumption, power consumption time, data type, device identification and other data. The initial encryption method can be symmetric encryption or asymmetric encryption.
[0063] Specifically, for the original power data that needs to be protected and shared, the blockchain node that owns the data initiates a request, and encrypts the original power data through the key stored on the blockchain node itself. The original power data is encrypted into ciphertext to obtain the initial encrypted data, thereby protecting the original power data from being directly exposed.
[0064] S200, sending a data re-encryption message carrying initial encrypted data and a preset re-encryption key to an authorized encryption proxy node.
[0065] Among them, the data re-encryption message is used to instruct the encryption proxy node to re-encrypt the initial encrypted data through the re-encryption key to obtain the re-encrypted ciphertext. The re-encryption key is determined based on the key stored on the local end and the key of the data traceability party.
[0066] The encryption proxy node is a trusted entity between the sender and the receiver. In this embodiment, there are multiple encryption proxy nodes. The threshold proxy re-encryption scheme is used to form a proxy. After receiving the data re-encryption message and the re-encryption key, the multiple encryption proxy nodes cooperate to send the initial encryption result of the blockchain node, re-encrypt it into a form that can be decrypted by the receiver, and obtain the re-encrypted ciphertext. Re-encryption is different from initial encryption. On the basis of not decrypting the initial encryption result, multiple encryption proxy nodes encrypt the initial encryption result again.
[0067] S300, receiving the re-encrypted ciphertext fed back by the encryption proxy node.
[0068] Among them, the re-encrypted ciphertext refers to the final encryption result after being processed by the encryption proxy node. The encryption proxy node feeds the re-encrypted ciphertext back to the blockchain node, and the blockchain node stores the re-encrypted ciphertext on the chain. Since blockchain is a distributed ledger technology, once the data is on the chain, it has the characteristics of immutability and traceability, so that the re-encrypted ciphertext cannot be tampered with during storage. At the same time, the decentralized characteristics of blockchain increase the transparency and security of data.
[0069] In this embodiment, by combining multi-layer encryption and blockchain technology, the security and immutability of the original power data from collection to storage are improved. Among them, the initial encryption protects the basic security of the original power data, the re-encryption further enhances the security and access control of the original power data, and the on-chain storage provides complete traceability and anti-tampering capabilities for the original power data. This combination of multiple mechanisms improves the privacy and data security of users in the power industry.
[0070] In an exemplary embodiment, Figure 3 As shown, S100 includes:
[0071] S110, symmetrically encrypting the received original power data by using the public key stored in the local end to obtain initial encrypted data, wherein the public key stored in the local end is determined based on an elliptic curve cryptography key generation algorithm.
[0072] Among them, the blockchain node in this embodiment uses the public key stored on the local end to encrypt the original power data. The public key is part of a pair of keys in the encryption process, and the other part is the corresponding private key. The public key can be used publicly to encrypt data, but decryption can only be completed by the corresponding private key. Symmetric encryption is an encryption method that uses the same key to encrypt and decrypt data. The elliptic curve cryptography key generation algorithm is a public key encryption technology that generates a key pair, namely a public key and a private key, through point operations on an elliptic curve.
[0073] For example, before the initial encryption of the raw power data, the identity of the blockchain node needs to be verified. For example, the node API of Hyperledger Fabric is called to connect to the blockchain, the blockchain address node_address of the blockchain node is used as a parameter, and the query function is used to query and return the blockchain node information. The query process can be expressed by formula (1):
[0074] (1)
[0075] In formula (1), Represents the query result, including but not limited to digital certificates, transaction history records, organizational information, and identity confirmation information. Further, identity comparison and verification are performed based on the query results, including but not limited to: verifying whether the digital certificate is valid (by verifying its signature), checking whether there are any abnormal or illegal activities in the transaction history records, confirming whether the organizational information is consistent with expectations, and checking whether the identity confirmation information matches. After confirming the identity, the encryption proxy node needs to set the identity of the client, and the setting method is shown in formula (2):
[0076] (2)
[0077] in Indicates the client identity settings. is the client object, is the identity information of the node, and then use the function Get the client's identification information:
[0078] (3)
[0079] in Is the client identification information, Is the client object.
[0080] After verifying the identity information of the blockchain node, it is necessary to generate a key for initial encryption. The specific key generation process is as follows: set the security parameter sec, select a prime number q to be used as the generator of the cyclic group G, is the generator of the group. Define a set of hash functions ,in , key derivation function , where parameter l is derived from the security parameter sec. These parameters constitute the public parameter set of the system Then, using the elliptic curve cryptography key generation algorithm, select a random number ,calculate , the public key and private key of the blockchain node are calculated as , and the public key and private key of the data traceability party are .
[0081] Then, the blockchain node uses its own public key The original power data is initially encrypted. The initial encryption process is: select a random value ,calculate , and then calculate , , , and finally Use it as the key to symmetric encrypt the original power data and get the initial encryption result , Plain text representing raw power data.
[0082] In this embodiment, public key symmetric encryption is used so that only the person (or device) holding the corresponding private key can decrypt and read the data, which can effectively reduce the risk of data tampering or theft. The introduction of the elliptic curve cryptography key generation algorithm further improves encryption efficiency and security.
[0083] In an exemplary embodiment, the number of encryption proxy nodes is multiple, and the re-encryption key is determined based on the following steps: a re-encryption key is generated according to a private key stored on the local end, a public key of the data traceability party, and the number of encryption proxy nodes.
[0084] The private key stored in this terminal is a pair with the public key stored in this section in the above embodiment, and can be used to decrypt data encrypted by the public key. In this embodiment, the specific process of generating the re-encryption key is: , where the parameter N is the number of re-encryption key fragments generated by re-encryption (that is, the number of participating encryption proxy nodes), and a random number is selected ,calculate , , since the re-encryption scheme is non-interactive, It is the key and temporary key pair of the data traceability party Then, choose a random value ,calculate , and construct the series as The polynomial ,For example , further, calculate ,set up And repeat N times. Select random value ,in is the node number of the encryption agent, and is calculated , , , , as well as , define the re-encrypted fragment as , , output the re-encryption key The re-encryption process is as follows: multiple encryption proxy nodes determine Is it established? Calculate , , output ,in To re-encrypt the ciphertext.
[0085] In this embodiment, multiple encryption proxy nodes participate in the re-encryption process. Even if the key of a certain encryption proxy node is leaked or other data security issues arise, the participation of other encryption proxy nodes can ensure that the data security of the overall system is as unaffected as possible, further improving the data security of the power data processing process.
[0086] In order to make a clearer description of the power data processing method provided by the present application, the following is a detailed embodiment and attached Figure 3 The power data processing method is explained and described, and the detailed embodiment includes the following steps:
[0087] S110, symmetrically encrypting the received original power data by using the public key stored in the local end to obtain initial encrypted data, wherein the public key stored in the local end is determined based on an elliptic curve cryptography key generation algorithm.
[0088] S200, sending a data re-encryption message carrying the initial encrypted data and a preset re-encryption key to an authorized encryption proxy node. The data re-encryption message is used to instruct the encryption proxy node to re-encrypt the initial encrypted data using the re-encryption key to obtain a re-encrypted ciphertext. The re-encryption key is determined based on the key stored on this end and the key of the data traceability party.
[0089] S300, receiving the re-encrypted ciphertext fed back by the encryption proxy node.
[0090] In an exemplary embodiment, Figure 4 As shown, a method for processing power data is provided, and the method is applied to Figure 1The data tracing method 130 in the example is used as an example to illustrate, including the following steps:
[0091] S400, sending a power data traceability request carrying the digital signature of the data traceability party to the blockchain node.
[0092] S500, when the data traceability party passes identity authentication, a rich query is performed in the blockchain through a preset smart contract to obtain the power data traceability result.
[0093] Among them, the blockchain interface refers to an interface for the data traceability party to interact with the blockchain network. The data traceability party can send a power data traceability request to the blockchain node through the blockchain interface. The power data traceability request is used to track specific target power data. Smart contracts are automated, code-based protocols that can automatically execute operations according to preset conditions. In this embodiment, the data query process can be automatically managed by smart contracts. Rich query means that the query process not only retrieves a single data point, but retrieves complex and comprehensive information. For example, rich queries can query power data flow records including multiple time periods and between different nodes, thereby providing richer and more detailed traceability information.
[0094] For example, the data traceability party can be a regulatory department or a data trading center. When the two send a data traceability request to the blockchain, the blockchain node in the blockchain confirms the identity of the data traceability party. The identity information of the regulatory department or the data trading center can be stored in the certificate authority (CA) provided by the member service of the Fabric network. Each organization has its own CA, which is responsible for managing and issuing digital certificates for members: , where Indicates organization, Indicates a member of an organization. The power data traceability request carries the digital signature of the data traceability party. The blockchain node will first use the digital signature based on the elliptic curve encryption algorithm to verify the identity of the data traceability method. The specific verification process is as follows: , The digital signature of the data traceability party. When the digital signature is verified, the data traceability party passes the identity verification. Further, the access control list (ACL) of the Fabric network or the access control logic in the smart contract is used to check whether the data traceability party has access rights. The access control list is verified by the formula Sure, Indicates the role, Indicates permissions, , only authorized data traceability parties can perform specific traceability operations.
[0095] When the data traceability party has the traceability authority, the traceability information can be automatically queried through the smart contract in the blockchain: ,The smart contract performs rich query on the information stored in each block in the blockchain, that is ,a query method that uses complex conditions, sorting, paging and full-text search and other advanced ,functions to retrieve and filter data, and obtains relevant information by querying the primary key ,information using key-value pairs, and obtains the power data tracing ,results, and the power data tracing results are sent to the data tracing ,party.
[0096] Specifically, the authorized data traceability party first sets the user identity to the client's current identity so that it can connect to the blockchain network and perform query operations: ,in Represents the client's identity setting operation. is the client instance, It is the user's identity information. Further, the data traceability party connects to the gateway and obtains the specified channel and chain code. The specific process is as follows: ,in is the network channel instance to which the client connects; , is the chaincode contract instance in the network channel, is the channel name, is the chain code name. Finally, the power data traceability result containing the re-encrypted ciphertext is obtained according to the query function in the chain code:
[0097]
[0098] in, is the re-encrypted ciphertext obtained from the query, is the chaincode contract instance, is the name of the chaincode query function, Is the key used to identify a specific re-encrypted ciphertext.
[0099] In this embodiment, through digital signature and identity authentication mechanism, the power data traceability request can be legal and secure, and only authorized data traceability can query and trace the data. Combined with smart contracts, the data query process is more automated. Through rich queries, the flow process of power data can be more comprehensively understood, and more accurate power data traceability results can be obtained.
[0100] In one embodiment, Figure 5 As shown, after S500, the power data tracing method further includes:
[0101] S600, obtain the identity information of the blockchain node corresponding to the power data traceability result, authenticate the identity of the blockchain node based on the identity information, and verify the validity of the power data traceability result to obtain the identity authentication result and the validity verification result.
[0102] Following the above embodiment, after receiving the power data tracing result, the data traceability party also needs to verify the identity of the blockchain node to determine whether the power data tracing result is from an authorized blockchain node. First, the information of the transaction creator corresponding to the power data tracing result is obtained, and the identity of the obtained identity information is authenticated to verify that the transaction creator is an authorized blockchain node. , , It is the verification result, which indicates whether the transaction creator is authorized and obtains the identity verification result. Furthermore, it is also necessary to verify the validity of the power data traceability result. The data traceability party first verifies Whether the signature is correct, so as to determine The authenticity and integrity of the , specifically, the calculation of the hash coefficient in the generation verification equation can be as follows:
[0103] in, and is the original encrypted value, are the public parameters used to generate the proof, , , is the intermediate value in the re-encryption process, where , , , It is the preset auxiliary information used to verify the validity of the power data traceability results. After verification:
[0104] , ,
[0105] The validity verification result of the power data traceability result can be obtained.
[0106] In this embodiment, the security of the data sharing process between the blockchain nodes and the data traceability parties is improved through double verification of the blockchain nodes and the power data traceability results.
[0107] In one embodiment, Figure 5 As shown, after S600, the power data tracing method further includes:
[0108] S700, when the blockchain node passes the identity authentication and the power data traceability result passes the validity verification, determine whether the number of re-encrypted ciphertexts contained in the power data traceability result is greater than the preset threshold value.
[0109] S800, when the number of re-encrypted ciphertexts is greater than a preset threshold value, merging the re-encrypted ciphertexts in the power data traceability result to obtain a merged re-encrypted ciphertext.
[0110] S900, based on the preset private key, decrypt the combined re-encrypted ciphertext to obtain the target power data.
[0111] Continuing from the above embodiment, when the blockchain node passes the identity authentication and the power data traceability result passes the validity verification, the data traceability party decrypts the power data traceability result. Since there are multiple encryption proxy nodes, the power data traceability result also includes multiple re-encrypted ciphertexts obtained by re-encrypting multiple encryption proxy nodes. Only when the data traceability party obtains a number of re-encrypted ciphertexts exceeding a preset threshold value, can the data traceability party decrypt it through the private key to obtain the target power data.
[0112] Specifically, when the number of re-encrypted ciphertexts is greater than the preset threshold value, the data traceability party merges the re-encrypted ciphertexts in the power data traceability results, and uses the private key to decrypt the merged re-encrypted ciphertexts, that is, ,in , the specific decryption process is: ,calculate , ,in ,calculate, , , , , output symmetric key , and then the data traceability party uses the key The combined re-encrypted ciphertext is decrypted to obtain the target power data.
[0113] In this embodiment, through the threshold proxy re-encryption algorithm, the encrypted content can be converted from one key to another key while maintaining the encrypted state, and only when the data traceability party obtains a certain number (exceeding the threshold value) of re-encrypted ciphertexts can it use its own private key to decrypt the data and obtain the target power data without knowing the key of the blockchain node, thereby improving the data security of the data traceability and data sharing process.
[0114] In order to make a clearer description of the power data tracing method provided by this application, the following is a detailed embodiment and attached Figure 5The power data tracing method is explained and described, and the detailed embodiment includes the following steps:
[0115] S400, sending a power data traceability request carrying the digital signature of the data traceability party to the blockchain node.
[0116] S500, when the data traceability party passes identity authentication, a rich query is performed in the blockchain through a preset smart contract to obtain the power data traceability result.
[0117] S600, obtain the identity information of the blockchain node corresponding to the power data traceability result, authenticate the identity of the blockchain node based on the identity information, and verify the validity of the power data traceability result to obtain the identity authentication result and the validity verification result.
[0118] S700, when the blockchain node passes the identity authentication and the power data traceability result passes the validity verification, determine whether the number of re-encrypted ciphertexts contained in the power data traceability result is greater than the preset threshold value.
[0119] S800, when the number of re-encrypted ciphertexts is greater than a preset threshold value, merging the re-encrypted ciphertexts in the power data traceability result to obtain a merged re-encrypted ciphertext.
[0120] S900, based on the preset private key, decrypt the combined re-encrypted ciphertext to obtain the target power data.
[0121] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0122] Based on the same inventive concept, the embodiment of the present application also provides a power data processing device for implementing the power data processing method involved above, and a power data tracing device for implementing the power data tracing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments of one or more power data processing devices and power data tracing devices provided below can refer to the limitations of the power data processing method and the power data tracing method above, and will not be repeated here.
[0123] In an exemplary embodiment, Figure 6 As shown, a power data processing device 600 is provided, comprising: an initial encryption module 610, a re-encryption module 620 and a data storage module 630, wherein:
[0124] The initial encryption module 610 is used to perform initial encryption on the received original power data using the key stored in the local end to obtain initial encrypted data;
[0125] The re-encryption module 620 is used to send a data re-encryption message carrying the initial encrypted data and a preset re-encryption key to the authorized encryption proxy node, the data re-encryption message is used to instruct the encryption proxy node to re-encrypt the initial encrypted data using the re-encryption key to obtain a re-encrypted ciphertext, and the re-encryption key is determined based on the key stored on the local end and the key of the data traceability party;
[0126] The data receiving module 630 is used to receive the re-encrypted ciphertext fed back by the encryption proxy node.
[0127] In one embodiment, the initial encryption module 610 is also used to symmetrically encrypt the received original power data using the public key stored on the local end to obtain initial encrypted data. The public key stored on the local end is determined based on an elliptic curve cryptography key generation algorithm.
[0128] In one embodiment, the power data processing device 600 is further used to generate a re-encryption key according to the private key stored on the local end, the public key of the data traceability party, and the number of encryption proxy nodes.
[0129] In an exemplary embodiment, Figure 7 As shown, a power data tracing device 700 is provided, including: a request sending module 710 and a data tracing module 720, wherein:
[0130] The request sending module 710 is used to send an electric power data traceability request carrying the digital signature of the data traceability party to the blockchain node, so that the verification node in the blockchain can authenticate the data traceability party based on the digital signature.
[0131] The data tracing module 720 is used to perform a rich query in the blockchain through a preset smart contract to obtain the power data tracing result when the data tracing party passes the identity authentication.
[0132] In one instance, the power data traceability device 700 is also used to obtain the identity information of the blockchain node corresponding to the power data traceability result, authenticate the blockchain node based on the identity information, and verify the validity of the power data traceability result to obtain the identity authentication result and the validity verification result.
[0133] In one example, the power data traceability device 700 is also used to determine whether the number of re-encrypted ciphertexts contained in the power data traceability results is greater than a preset threshold value when the blockchain node passes identity authentication and the power data traceability results pass validity verification. When the number of re-encrypted ciphertexts is greater than the preset threshold value, the re-encrypted ciphertexts in the power data traceability results are merged to obtain merged re-encrypted ciphertexts, and the merged re-encrypted ciphertexts are decrypted based on the private key of the data traceability party to obtain the target power data.
[0134] Each module in the above-mentioned power data processing device and power data tracing device can be implemented in whole or in part by software, hardware and their combination. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the corresponding operations of each of the above modules.
[0135] Based on the same inventive concept, the embodiment of the present application also provides a blockchain-based power data traceability system 800 for implementing the above-mentioned power data processing method and the above-mentioned power data traceability method 820, such as Figure 8 As shown, the blockchain-based power data traceability system 800 includes a blockchain node 810, a data traceability party 820, and multiple encryption proxy nodes 830 authorized by the blockchain node 810. The blockchain node 810 is communicated with the encryption proxy node 830 and the data traceability party 820 respectively.
[0136] The blockchain node 810 is used to initially encrypt the received original power data using the key stored on the local end to obtain the initial encrypted data, determine the re-encryption key based on the key and the key of the data traceability party 820, generate multiple re-encryption key fragments according to the number of encryption proxy nodes 830 and the re-encryption key, and send the multiple re-encryption key fragments to the encryption proxy node 830, and the re-encryption key fragments correspond to the encryption proxy node 830 one by one.
[0137] The encryption proxy node 830 is used to re-encrypt the initial encrypted data according to the re-encryption key fragment to obtain the re-encrypted ciphertext, and feed the re-encrypted ciphertext back to the blockchain node 810.
[0138] The data traceability party 820 is used to send a power data traceability request to the blockchain node 810, and the power data traceability request carries the digital signature of the data traceability party 820; and when the identity authentication is passed, a rich query is performed in the blockchain through a preset smart contract to obtain the power data traceability result.
[0139] The blockchain node 810 is also used to authenticate the data traceability party 820 based on the digital signature when receiving an electric power data traceability request sent by the data traceability party 820 and carrying the digital signature of the data traceability party 820.
[0140] Among them, the blockchain node 810 mainly includes terminals, edge servers, main stations, and data development centers. In the process of power data collection, sensors are mainly basic hardware such as electric meters. Since they do not have intelligent characteristics, they are not used as blockchain nodes 810. Specifically, the terminal can be an intelligent terminal, which is generally used for data collection. The data involved includes but is not limited to power consumption, power consumption time, data type, device identification, terminal operation status, and collection timestamp; the edge server is generally used for data processing, and the data involved includes but is not limited to power consumption, data processing log, data processing results, server status, device label, and data transmission information; the main station is generally used for data aggregation, and the data involved includes but is not limited to data volume, data quality, data storage location, server information, main station status, main station identification, and data transmission information; the data development department is generally used for data development, and the data involved includes but is not limited to data volume, development process, development results, and development department information. Smart terminals, edge servers, main stations, and data development departments are used as blockchain nodes 810 to record each step of the data collection, processing, aggregation, and development process. Through the blockchain's data chain structure, when it is necessary to trace data processing information and data transmission information, all nodes involved in the data processing can be queried in a timely manner to obtain detailed information on the operations performed on the data and the equipment.
[0141] The blockchain in this embodiment is built on the Hyperledger Fabric architecture, and automatically executes and verifies data processing operations through the PBFT (Practical Byzantine Fault Tolerance) consensus mechanism and smart contracts written in Javascript. Hyperledger Fabric is an open source blockchain platform hosted by the Linux Foundation and designed for enterprise-level applications. It is part of the Hyperledger project and aims to provide a modular architecture to facilitate the development and deployment of blockchain solutions. Smart contracts improve the authenticity and consistency of each data operation and realize the automation and transparency of data operations. In addition, smart contracts are also convenient for storing various types of data, including the identity information of the blockchain node 810, shared data information, and operation information, etc., which improves the data management capabilities and convenience of the system. In the initialization phase of the blockchain network, the system undergoes processes such as container startup, smart chain code loading, database initialization, authorization certificate generation, initial public key pair generation, initial account book update, and confirms all nodes participating in the blockchain, and registers node identity information (such as device identification, location information, category, etc.).
[0142] In the system of this embodiment, when it comes to data tracing and data sharing, the encryption algorithm used is a threshold proxy re-encryption algorithm, which provides security for data sharing between blockchain nodes 810 and between blockchain nodes 810 and other data nodes. Specifically, for blockchain nodes 810 that need to share data, after blockchain identity confirmation and security authentication, multiple encryption proxy nodes 830 map ciphertexts to re-encrypted ciphertext fragments without decrypting the original text and store them on the blockchain. The data tracing party 820130 can obtain the original text after collecting the re-encrypted ciphertext that exceeds the threshold value.
[0143] The data traceability party 820 in this embodiment can be a power data monitoring department and a data trading center. The power data monitoring department is responsible for real-time monitoring of the collection and transmission process of power data, as well as forward tracing through the data recorded in the blockchain. The power data monitoring department can monitor the operation of each blockchain node 810 in real time, improve the accuracy and reliability of the data, and respond quickly when an abnormal situation occurs. Through these real-time monitoring and recording functions, the power data monitoring department can effectively manage the entire life cycle of power data. The data trading center is a platform for data exchange and trading. It communicates and trades with the data development department, records the detailed information of each data transaction, and realizes the automated processing of data transactions through smart contracts, improves the fairness, justice and traceability of data transactions, and when there is a problem with power data, the data trading center can reversely trace the source through the services provided by the blockchain background, quickly locate and solve the problem. In addition, the data trading center also facilitates the delineation of task volume and workload assessment, and improves data management and operational efficiency.
[0144] It should be noted that, in this embodiment, the data processing process of the blockchain node 810, the encryption proxy node 830 and the data traceability party 820 in the blockchain-based power data traceability system 800 has been introduced in detail in the power data processing method embodiment and the power data traceability method embodiment above, and will not be repeated here.
[0145] The above-mentioned blockchain-based power data traceability system is different from the traditional solution. In the process of power data processing, each blockchain node will initially encrypt the received original power data through the key stored on the local end to obtain the initial encrypted data, and then the encryption proxy node authorized by the blockchain node will further re-encrypt the initial encryption result to obtain the re-encrypted ciphertext, and then combine the decentralized distributed ledger technology of the blockchain to store the re-encrypted ciphertext in the blockchain, which can well reduce the risk of single point failure and improve the security of the power data storage process. Further, in the process of power data traceability, when the data traceability party initiates a power data traceability request, the blockchain node first authenticates the data requester through the digital signature carried by the power data traceability request. Only when the identity authentication is passed, the power data will be traced in the blockchain through the preset smart contract, which improves the security of the data traceability process; and the power data stored in the blockchain has been initially encrypted and re-encrypted, so that in the process of data interaction with the data traceability party, the power data traceability result is not easy to be tampered with and leaked, which improves the security of the data traceability process.
[0146] In one embodiment, the data traceability party 820 is also used to obtain the identity information of the blockchain node corresponding to the power data traceability result, authenticate the identity of the blockchain node 810 based on the identity information, and verify the validity of the power data traceability result to obtain the identity authentication result and the validity verification result.
[0147] The specific limitations of this embodiment can be found in the above limitations on the power data tracing method, which will not be repeated here.
[0148] In one embodiment, the data traceability party 820 is also used to determine whether the number of re-encrypted ciphertexts contained in the power data traceability result is greater than a preset threshold value when the blockchain node 810 passes identity authentication and the power data traceability result passes validity verification; when the number of re-encrypted ciphertexts is greater than the preset threshold value, merge the re-encrypted ciphertexts in the power data traceability result to obtain merged re-encrypted ciphertexts, and decrypt the merged re-encrypted ciphertexts based on a preset private key to obtain target power data.
[0149] The specific limitations of this embodiment can be found in the above limitations on the power data tracing method, which will not be repeated here.
[0150] In an exemplary embodiment, the system also includes a verification node for obtaining re-encrypted ciphertext, and packaging the re-encrypted ciphertext to generate a block when the re-encrypted ciphertext meets the preset block packaging and uploading conditions. The block packaging and uploading conditions are determined based on the generation time of the re-encrypted ciphertext, the data processing quantity threshold preset in the blockchain, and the block size threshold preset in the blockchain. When it is determined that the blockchain nodes 810 in the blockchain have reached a consensus according to the preset consensus mechanism, the block is stored on the chain.
[0151] The re-encrypted ciphertext refers to the final encryption result after being processed by the encryption proxy node 830. The encryption proxy node 830 feeds the re-encrypted ciphertext back to the blockchain node 810, and the blockchain node 810 stores the re-encrypted ciphertext on the chain. Since the blockchain is a distributed ledger technology, once the data is on the chain, it has the characteristics of immutability and traceability, so that the re-encrypted ciphertext cannot be tampered with during storage. At the same time, the decentralized characteristics of the blockchain increase the transparency and security of the data.
[0152] Block packaging refers to the blockchain system storing data in the form of blocks. Blocks are the basic unit for storing data in blockchains. Each block can contain multiple data entries. The packaging process is to combine these data together according to certain rules and conditions. For example, the blockchain system will determine whether to package based on the time when the ciphertext is generated. For example, if the time since the last block was generated exceeds the preset batch timeout, the block generation will be triggered. A threshold is usually set in the blockchain. When the amount of data accumulated on the chain reaches this threshold, the data is packaged to generate a block. For example, when the number of transactions in a batch reaches the preset maximum number of transactions, the block generation is triggered. In addition, in order to prevent the block from becoming too large, the blockchain system will limit the size of each block. For example, when the total size of the transaction data in the batch reaches the preset maximum block size (in bytes), the block generation is triggered.
[0153] The consensus mechanism means that in the blockchain, the storage of blocks must be verified and agreed upon by multiple blockchain nodes 810. In this embodiment, the consensus mechanism used can be the PBFT consensus mechanism. The verification node is a special node in the blockchain, responsible for verifying the authenticity and integrity of the data. The blockchain node 810 will be allowed to store the block in the blockchain only when the verification node determines through the consensus mechanism that the majority of the blockchain nodes 810 (for example, more than two-thirds of the blockchain nodes 810) in the blockchain can reach an agreement on the correctness of the data. In addition, each blockchain node 810 of the blockchain retains a complete copy of the blockchain. When a new block is verified, it will be added to the local copy of each blockchain node 810, so that the data in the blockchain is synchronized.
[0154] Specifically, when judging whether the re-encrypted ciphertext meets the preset block packaging and uploading conditions, it is necessary to consider the influence of the block generation time interval and the computing power of the blockchain node 810, including the accumulated number of transactions, the block size, etc. When the block packaging and uploading conditions are met, it is also necessary to go through a series of operations such as endorsement, packaging, distribution, and consensus, and finally the verification node reaches a consensus and submits the new block to the local blockchain copy. The new block will be added to the blockchain and broadcast to the entire network. After verifying the validity of the block, other blockchain nodes 810 in the blockchain also add it to the local blockchain, so that the blockchain data maintains consistency and integrity.
[0155] In this embodiment, through the packaging and consensus mechanism, reasonable packaging conditions are set, and the re-encrypted ciphertext is dynamically packaged to improve the efficiency and security of data storage. The consensus mechanism further enhances the security of the system, allowing data to reach a consensus among multiple blockchain nodes. Ultimately, the re-encrypted ciphertext is not only fully protected, but also can achieve cross-node synchronization and efficient storage, thereby improving the security and integrity of the data.
[0156] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Fig. 9 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as re-encrypted ciphertext. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for processing power data or a method for tracing power data is implemented.
[0157] Those skilled in the art will understand that Fig. 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0158] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps of any power data processing method embodiment when executing the computer program.
[0159] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of any power data processing method embodiment are implemented.
[0160] In one embodiment, a computer program product is provided, comprising a computer program, which implements the steps of any power data processing method embodiment when executed by a processor.
[0161] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps of any power data tracing method embodiment are implemented.
[0162] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of any power data tracing method embodiment are implemented.
[0163] In one embodiment, a computer program product is provided, including a computer program, which implements the steps of any power data tracing method embodiment when executed by a processor.
[0164] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0165] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0166] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0167] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A blockchain-based power data traceability system, characterized in that: The system includes a blockchain node, a data traceability party, and a plurality of encryption proxy nodes authorized by the blockchain node, wherein the blockchain node is respectively connected to the encryption proxy node and the data traceability party in communication; The blockchain node is used to initially encrypt the received original power data by using the key stored in the local end to obtain the initial encrypted data, determine the re-encryption key based on the key and the key of the data traceability party, generate a plurality of re-encryption key fragments according to the number of encryption proxy nodes and the re-encryption key, and send the plurality of re-encryption key fragments to the encryption proxy node, wherein the re-encryption key fragments correspond to the encryption proxy node one by one; The encryption proxy node is used to re-encrypt the initial encrypted data according to the re-encryption key fragment to obtain a re-encrypted ciphertext, and feed the re-encrypted ciphertext back to the blockchain node; The data traceability party is used to send a power data traceability request to the blockchain node, and the power data traceability request carries the digital signature of the data traceability party; And when the identity verification is passed, a rich query is performed in the blockchain through the preset smart contract to obtain the power data traceability results; The blockchain node is also used to authenticate the data traceability party based on the digital signature when receiving an electric power data traceability request sent by the data traceability party and carrying the digital signature of the data traceability party.
2. The system according to claim 1, characterized in that The data tracing party is also used to obtain the identity information of the blockchain node corresponding to the power data tracing result, authenticate the identity of the blockchain node based on the identity information, and verify the validity of the power data tracing result to obtain the identity authentication result and the validity verification result.
3. The system according to claim 2, characterized in that The data traceability party is also used to determine whether the number of re-encrypted ciphertexts contained in the power data traceability result is greater than a preset threshold value when the blockchain node passes the identity authentication and the power data traceability result passes the validity verification; when the number of re-encrypted ciphertexts is greater than the preset threshold value, merge the re-encrypted ciphertexts in the power data traceability result to obtain the merged re-encrypted ciphertext, and decrypt the merged re-encrypted ciphertext based on a preset private key to obtain the target power data.
4. The system according to claim 1, characterized in that The system also includes a verification node, which is used to obtain the re-encrypted ciphertext, and package the re-encrypted ciphertext to generate a block when the re-encrypted ciphertext meets a preset block packaging and uploading condition. The block packaging and uploading condition is determined based on the generation time of the re-encrypted ciphertext, a data processing quantity threshold preset in the blockchain, and a block size threshold preset in the blockchain. When it is determined that the blockchain nodes in the blockchain reach a consensus according to a preset consensus mechanism, the block is stored on the chain.
5. A method for processing power data, characterized in that: In a blockchain node of a power data traceability system of a blockchain as described in any one of claims 1 to 4, the method comprises: Initially encrypting the received original power data using the key stored in the local end to obtain initial encrypted data; Sending a data re-encryption message carrying the initial encrypted data and a preset re-encryption key to an authorized encryption proxy node, wherein the data re-encryption message is used to instruct the encryption proxy node to re-encrypt the initial encrypted data using the re-encryption key to obtain a re-encrypted ciphertext, wherein the re-encryption key is determined based on the key stored on the local end and the key of the data tracing party; Receive the re-encrypted ciphertext fed back by the encryption proxy node.
6. The power data processing method according to claim 5, characterized in that: The initial encryption of the received original power data by using the key stored in the local end to obtain the initial encrypted data includes: The received original power data is symmetrically encrypted by using the public key stored in the local end to obtain initial encrypted data, wherein the public key stored in the local end is determined based on an elliptic curve cryptography key generation algorithm.
7. The power data processing method according to claim 5, characterized in that: The number of the encryption proxy nodes is multiple, and the re-encryption key is determined based on the following steps: A re-encryption key is generated according to the private key stored in the local end, the public key of the data traceability party, and the number of the encryption proxy nodes.
8. A method for tracing the source of power data, characterized in that: In the data tracing method of the blockchain-based power data tracing system according to any one of claims 1 to 4, the power data tracing method comprises: Sending a power data traceability request carrying the digital signature of the data traceability party to a blockchain node, so that the verification node in the blockchain authenticates the data traceability party based on the digital signature; When the data traceability party passes the identity authentication, a rich query is performed in the blockchain through a preset smart contract to obtain the power data traceability result.
9. The power data tracing method according to claim 8, characterized in that: After obtaining the power data tracing result, the method further includes: Obtain the identity information of the blockchain node corresponding to the power data traceability result; The blockchain node is authenticated based on the identity information, and the power data traceability result is verified for validity to obtain an identity authentication result and a validity verification result.
10. The power data tracing method according to claim 8, characterized in that: After obtaining the identity authentication result and the validity verification result, the method further includes: When the blockchain node passes the identity authentication and the power data traceability result passes the validity verification, determining whether the number of re-encrypted ciphertexts included in the power data traceability result is greater than a preset threshold value; When the number of re-encrypted ciphertexts is greater than the preset threshold value, merging the re-encrypted ciphertexts in the power data tracing result to obtain a merged re-encrypted ciphertext; Based on a preset private key, the combined re-encrypted ciphertext is decrypted to obtain target power data.
Citation Information
Patent Citations
Tracing data access control method based on improved proxy re-encryption
CN111008855A
Product data chaining method based on blockchain and smart contract and medium
CN113098876A
Supply chain secret state data efficient traceability method and system
CN116418582A
Supply chain product traceability system and method based on proxy re-encryption
CN116827573A
Ciphertext data security sharing and access control method based on zero knowledge proof
CN118264398A