Power grid data audit method, device, power grid system and storage medium
By receiving audit requests and smart contracts in the smart grid system, and using the elliptic curve encryption model and the zero-knowledge proof model to verify the integrity of the grid data, the problem that traditional secure transmission protocols cannot effectively ensure the security of data transmission in the smart grid system is solved, the privacy and auditability of the data transmission process are realized, and the overall security of the grid system is maintained.
Patent Information
- Application Number
- CN202111514675.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-13
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2041-12-13
AI Technical Summary
Traditional secure transmission protocols cannot effectively ensure the security of data transmission in smart grid systems, resulting in attackers that may access grid sensitive data without authorization or hinder the normal data acquisition and service use of legitimate users.
By receiving audit requests and smart contracts sent by the user terminal, the server sends the audit request to the target user, and encrypts the data based on the elliptic curve encryption model to generate the first ciphertext and the second ciphertext. The user terminal uses the zero-knowledge proof model to process the public key, private key, first ciphertext and second ciphertext to verify the integrity of the power grid data, and verify the validity of the zero-knowledge proof through a smart contract to judge whether the power grid data has been tampered with.
It realizes the reliability transmission of power grid data, ensures the security and trustworthy verification of data, and conducts integrity verification through concise zero-knowledge proofs to determine whether the power grid data has been tampered with, thereby maintaining the overall security of the power grid system.
Smart Images

Figure CN114239078B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data resource security management, and in particular to a power grid data auditing method, device, power grid system and storage medium. Background Art
[0002] In communication technology, a secure transmission protocol is a rule-based protocol that can achieve information transmission between two or more nodes in a communication system through a physical channel. This protocol defines the rules for data transmission, the strategy for synchronous communication, and possible error recovery methods. Its main goal is to provide secure and reliable communication in channels that cannot guarantee security. Various sub-protocols achieve goals such as user node authentication and data confidentiality integrity, thereby ensuring the realization of secure node communication. Faced with today's rapidly changing network technology, traditional secure transmission protocols can no longer achieve their original goals, especially the continuous development of various intelligent industrial control systems, which has put forward higher requirements for security in all aspects. That is, traditional secure transmission protocols can no longer provide secure and reliable communication for the rapidly developing power grid system, especially the smart grid system. When relevant personnel inside and outside the power grid interact, attackers often achieve unauthorized access to sensitive data or services of the power grid, or use certain means to prevent legitimate users from obtaining data or using services normally.
[0003] However, there is a problem of low security in the current power grid data transmission process. Summary of the invention
[0004] Based on this, it is necessary to provide a power grid data audit method, device, power grid system and storage medium to address the above technical problems.
[0005] In a first aspect, the present application provides a power grid data audit method, comprising:
[0006] Receiving an audit request and a smart contract sent by a user terminal; the audit request includes user identity information and a timestamp of the user terminal; the smart contract includes target user information of a target user requested to be audited by the user terminal;
[0007] The audit request is sent to the target user through the server; the audit request is used to instruct the target user to feedback the first ciphertext; the first ciphertext is obtained by encrypting the power grid data sent by the user terminal to the target user based on the elliptic curve encryption model and the public key of the user terminal when the target user receives the audit request; the public key is generated by the user terminal using the elliptic curve encryption model;
[0008] Receive the zero-knowledge proof sent by the user terminal; the zero-knowledge proof is obtained by processing the public key, the private key of the user terminal, the first ciphertext and the second ciphertext using the proof generation model when the user terminal obtains the second ciphertext and the first ciphertext from the blockchain node; the second ciphertext is obtained by the user terminal encrypting the power grid data based on the elliptic curve encryption model and the public key; the private key is generated by the user terminal using the elliptic curve encryption model;
[0009] The validity of the zero-knowledge proof is verified based on the smart contract, and the verification result is output; the verification result is used to determine whether the power grid data has been tampered with.
[0010] In one embodiment, before the step of receiving the audit request and the smart contract sent by the user terminal, the step further includes:
[0011] Receive and store the second ciphertext uploaded by the user terminal.
[0012] In one embodiment, the steps of verifying the validity of the zero-knowledge proof based on the smart contract and outputting the verification result include:
[0013] Based on the smart contract, the zero-knowledge decryption module is used to verify the zero-knowledge proof, obtain the verification result and output it.
[0014] In a second aspect, the present application also provides a power grid data audit method, comprising:
[0015] Sending an audit request and a smart contract to a blockchain node; the audit request includes user identity information and a timestamp; the smart contract includes target user information of the target user for which the audit is requested; the audit request is used to instruct the blockchain node to send the audit request to the target user through the server;
[0016] Obtaining a first ciphertext and a second ciphertext from a blockchain node; the first ciphertext is obtained by encrypting the power grid data sent to the target user based on the elliptic curve encryption model and the public key when the target user receives an audit request; the second ciphertext is obtained by encrypting the power grid data based on the elliptic curve encryption model and the public key; the public key is generated by using the elliptic curve encryption model;
[0017] The private key, the public key, the first ciphertext and the second ciphertext are processed by the proof generation model to obtain the zero-knowledge proof, and the zero-knowledge proof is sent to the blockchain node; the private key is generated by the elliptic curve encryption model; the zero-knowledge proof is used to instruct the blockchain node to verify the validity of the zero-knowledge proof based on the smart contract;
[0018] Receive the verification results output by the blockchain node, and determine whether the power grid data has been tampered with based on the verification results.
[0019] In one embodiment, before sending the audit request and the smart contract, the process further includes:
[0020] The elliptic curve encryption model is used to generate public and private keys;
[0021] The power grid data and the public key are sent to the target user, and the power grid data is encrypted based on the elliptic curve encryption model and the public key to obtain a second ciphertext;
[0022] Upload the second ciphertext to the blockchain node.
[0023] In one embodiment, the steps of using the proof generation model to process the private key, the public key, the first ciphertext and the second ciphertext to obtain the zero-knowledge proof include:
[0024] The public parameters and private key, public key, first ciphertext and second ciphertext of the proof generation model are input into the proof generation model to obtain a zero-knowledge proof.
[0025] In a third aspect, the present application also provides a power grid data auditing device, comprising:
[0026] The first receiving module is used to receive an audit request and a smart contract sent by a user terminal; the audit request includes user identity information and a timestamp of the user terminal; the smart contract includes target user information of a target user requested to be audited by the user terminal;
[0027] The first output module is used to send the audit request to the target user through the server; the audit request is used to instruct the target user to feedback the first ciphertext; the first ciphertext is obtained by encrypting the power grid data sent by the user terminal to the target user based on the elliptic curve encryption model and the public key of the user terminal when the target user receives the audit request; the public key is generated by the user terminal using the elliptic curve encryption model;
[0028] The second receiving module is used to receive the zero-knowledge proof sent by the user terminal; the zero-knowledge proof is obtained by processing the public key, the private key of the user terminal, the first ciphertext and the second ciphertext using the proof generation model when the user terminal obtains the second ciphertext and the first ciphertext from the blockchain node; the second ciphertext is obtained by the user terminal encrypting the power grid data based on the elliptic curve encryption model and the public key; the private key is generated by the user terminal using the elliptic curve encryption model;
[0029] The second output module is used to verify the validity of the zero-knowledge proof based on the smart contract and output the verification result; the verification result is used to determine whether the power grid data has been tampered with.
[0030] In a fourth aspect, the present application also provides a power grid data auditing device, including:
[0031] A data sending module is used to send an audit request and a smart contract to a blockchain node; the audit request includes user identity information and a timestamp; the smart contract includes target user information of a target user for which an audit is requested; the audit request is used to instruct the blockchain node to send the audit request to the target user through a server;
[0032] A data acquisition module is used to obtain a first ciphertext and a second ciphertext from a blockchain node; the first ciphertext is obtained by encrypting the power grid data sent to the target user based on the elliptic curve encryption model and the public key when the target user receives an audit request; the second ciphertext is obtained by encrypting the power grid data based on the elliptic curve encryption model and the public key; the public key is generated by using the elliptic curve encryption model;
[0033] A data processing module, used to process a private key, a public key, a first ciphertext, and a second ciphertext using a proof generation model to obtain a zero-knowledge proof, and send the zero-knowledge proof to a blockchain node; the private key is generated using an elliptic curve encryption model; the zero-knowledge proof is used to instruct the blockchain node to verify the validity of the zero-knowledge proof based on a smart contract;
[0034] The data receiving module is used to receive the verification results output by the blockchain node and determine whether the power grid data has been tampered with based on the verification results.
[0035] In a fifth aspect, the present application also provides a power grid system, including: a blockchain node and a user terminal;
[0036] The blockchain node is used to execute the above-mentioned power grid data audit method;
[0037] The user terminal is used to execute the above-mentioned power grid data auditing method.
[0038] In a sixth aspect, the present application further provides a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above method are implemented.
[0039] One of the above technical solutions has the following advantages and beneficial effects:
[0040] The present application receives an audit request including user identity information and a timestamp of the user terminal sent by a user terminal, and a smart contract including target user information of the target user requested to be audited by the user terminal, and sends an audit request for instructing the target user to feedback a first ciphertext to the target user through a server, so that when the target user receives the audit request, the target user encrypts the power grid data sent by the user terminal to the target user based on an elliptic curve encryption model and a public key of the user terminal, obtains a first ciphertext, and feeds it back; wherein the public key is generated by the user using an elliptic curve encryption model; when a zero-knowledge proof is received from the user terminal, the validity of the zero-knowledge proof is verified based on the smart contract; wherein the zero-knowledge proof is obtained by processing the public key of the user terminal, the private key of the user terminal, and the first ciphertext and the second ciphertext by a proof generation module when the user terminal obtains the first ciphertext and the second ciphertext from a blockchain node, the second ciphertext is obtained by encrypting the power grid data by the user terminal based on the elliptic curve encryption model and the public key, and the private key is generated by the user terminal using the elliptic curve encryption model; when the verification result is obtained, the verification result is output, and the verification result is used to determine whether the power grid data has been tampered with. This application can realize the reliable transmission of power grid data by encrypting the power grid data and using timestamps to ensure data security and trusted verification, thereby achieving the privacy and auditability of the data transmission process, and being supervised by smart contracts. It can also perform integrity verification through concise zero-knowledge proofs to determine whether the power grid data has been tampered with, thereby achieving the security of internal node information transmission and maintaining the overall security of the power grid system. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the conventional technology, the drawings required for use in the embodiments or the conventional technology descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0042] Figure 1 An application environment diagram of a power grid data audit method in one embodiment;
[0043] Figure 2 A schematic diagram of a flow chart of a power grid data audit method applied to a blockchain node in one embodiment;
[0044] Figure 3 A schematic diagram of a flow chart of a power grid data audit method applied to a user terminal in one embodiment;
[0045] Figure 4 A flowchart of steps before sending an audit request and a smart contract in one embodiment;
[0046] Figure 5 It is a structural block diagram of a power grid data auditing device applied to a blockchain node in one embodiment;
[0047] Figure 6 is a structural block diagram of a power grid data auditing device applied to a user terminal in one embodiment;
[0048] Figure 7 FIG. 4 is a diagram showing the internal structure of a user terminal in an embodiment. DETAILED DESCRIPTION
[0049] In order to facilitate understanding of the present application, the present application will be described more fully below with reference to the relevant drawings. Embodiments of the present application are provided in the drawings. However, the present application can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present application more thorough and comprehensive.
[0050] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.
[0051] It can be understood that the terms "first", "second", etc. used in the present application can be used in this article to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from another element.
[0052] It should be noted that when an element is considered to be "connected" to another element, it can be directly connected to the other element, or connected to the other element through an intermediate element. In addition, the "connection" in the following embodiments should be understood as "electrical connection", "communication connection", etc. if there is transmission of electrical signals or data between the connected objects.
[0053] When used herein, the singular forms "a", "an", and "said / the" may also include plural forms, unless the context clearly indicates otherwise. It should also be understood that the terms "include / comprise" or "have" and the like specify the presence of stated features, wholes, steps, operations, components, parts, or combinations thereof, but do not exclude the possibility of the presence or addition of one or more other features, wholes, steps, operations, components, parts, or combinations thereof. At the same time, the term "and / or" used in this specification includes any and all combinations of the relevant listed items.
[0054] The power grid data audit method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown in the figure, the user terminal communicates with the blockchain node through the network, the blockchain node communicates with the server, and the server can communicate with the user terminal. The user terminal can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers and other devices. The server can be implemented as an independent server or a server cluster composed of multiple servers.
[0055] In one embodiment, Figure 2 As shown, a power grid data audit method is provided, which may include:
[0056] Step 202, receiving an audit request and a smart contract sent by a user terminal; the audit request includes user identity information and a timestamp of the user terminal; the smart contract includes target user information of the target user requested to be audited by the user terminal;
[0057] Among them, the power grid data audit method is applied to blockchain nodes; the target user can be other user terminals; the user terminals can transmit power data to each other, and when a user terminal needs to audit the correctness and integrity of the power grid data output by itself, it can send an audit request to the blockchain node, so that the terminal user can perform a correctness audit on the target user who has sent the power grid data, check the correctness and integrity of the output power grid data, and determine whether the output power grid data has been tampered with; the audit request is the user terminal's request for integrity and correctness audit of the power grid data transmitted to other users (target users); the user identity information of the user terminal includes the one-time account address of the user terminal on the blockchain node, and each terminal user has a one-time account address on the blockchain node for auditing, and the user is recorded as U i , i∈{1, 2, ..., n}; the timestamp is used to mark the current time of the audit request; a smart contract is a protocol translated into program code and stored in the blockchain network. When the defined conditions are met, it will be automatically executed. When integrated into the blockchain, the smart contract inherits its characteristics of availability, transparency, immutability and integrity. Smart contracts are efficient, reduce costs, save time and can bypass any third party; the smart contract contains all information related to the audit and also clarifies the identity information of the contract participants, that is, the target users.
[0058] Specifically, when a user terminal interacts with other user terminals, if the user terminal needs to audit the power grid data transmitted to the target user in other user terminals, it can send an audit request and a smart contract to the blockchain node; the blockchain node receives the audit request and the smart contract, laying the foundation for data auditing.
[0059] In one embodiment, before the step of receiving the audit request and the smart contract sent by the user terminal, the following steps may also be included:
[0060] Receive and store the second ciphertext uploaded by the user terminal.
[0061] The second ciphertext is obtained by encrypting the power grid data by the user terminal based on the elliptic curve encryption model and the public key.
[0062] Specifically, the user terminal can use the elliptic curve encryption model to generate its own public key and private key; before the user terminal issues an audit request, the user terminal will use the elliptic curve encryption model and the public key to encrypt the power grid data, obtain the second ciphertext, and upload the second ciphertext to the blockchain node; thereby, the blockchain node receives and stores the second ciphertext uploaded by the user terminal.
[0063] Step 204, sending an audit request to the target user through the server; the audit request is used to instruct the target user to feedback a first ciphertext; the first ciphertext is obtained by encrypting the power grid data sent by the user terminal to the target user based on the elliptic curve encryption model and the public key of the user terminal when the target user receives the audit request; the public key is generated by the user terminal using the elliptic curve encryption model;
[0064] Specifically, when a blockchain node receives an audit request and a smart contract sent by a user terminal, it can send the audit request to the participant agreed in the smart contract (i.e., the target user) through the server; thereby, when the target user receives the audit request, it encrypts the power grid data sent by the user terminal to itself based on the elliptic curve encryption model and the public key of the user terminal, obtains the first ciphertext, and feeds the first ciphertext back to the blockchain node; the blockchain node can store the first ciphertext fed back by the target user.
[0065] Step 206, receiving a zero-knowledge proof sent by the user terminal; the zero-knowledge proof is obtained by processing the public key, the private key of the user terminal, the first ciphertext and the second ciphertext using the proof generation model when the user terminal obtains the second ciphertext and the first ciphertext from the blockchain node; the second ciphertext is obtained by encrypting the power grid data by the user terminal based on the elliptic curve encryption model and the public key; the private key is generated by the user terminal using the elliptic curve encryption model;
[0066] Among them, zero-knowledge proof means that the prover (target user) can convince the verifier (user terminal) that the assertion is correct without providing any useful information to the verifier (user terminal); zero-knowledge proof is essentially a protocol involving two or more parties, that is, a series of steps that two or more parties need to take to complete a task. The prover proves to the verifier and makes him believe that he knows or owns a certain message, but the proof process cannot leak any information about the proved message to the verifier.
[0067] Specifically, when the blockchain node receives the audit request sent by the user terminal and stores the first ciphertext and the second ciphertext, the user terminal can download the first ciphertext and the second ciphertext from the blockchain node, so that the user terminal can use the proof generation model to process the public key, the private key, the first ciphertext and the second ciphertext to obtain the zero-knowledge proof π i , and the zero-knowledge proof π i Sent to the blockchain node; so that the blockchain node can receive the zero-knowledge proof π sent by the user terminal i Conduct a correctness audit.
[0068] Step 208, verify the validity of the zero-knowledge proof based on the smart contract and output the verification result; the verification result is used to determine whether the power grid data has been tampered with.
[0069] Specifically, the blockchain node receives the zero-knowledge proof π sent by the user terminal. i In this case, the blockchain node verifies the zero-knowledge proof π based on the smart contract i , the consensus node verifies the zero-knowledge proof π through the code in the smart contract i If the verification result is passed, the audit result is recorded as "True" in the audit record; if the verification result is not passed, the audit result is recorded as "False" in the audit record. Otherwise, it will return i The verification result is also fed back to the user terminal, so that the user terminal can determine whether the power grid data has been tampered with according to the verification result.
[0070] In one example, the steps of verifying the validity of the zero-knowledge proof based on the smart contract and outputting the verification result may include:
[0071] Based on the smart contract, the zero-knowledge decryption module is used to verify the zero-knowledge proof, obtain the verification result and output it.
[0072] Specifically, blockchain nodes use the zero-knowledge verification model to verify zero-knowledge proof π based on smart contracts. i ; The zero-knowledge verification model may be a model based on a zk-SNARK (Zero-Knowledge Succinct Non-Interactive Argument of Knowledge) verification algorithm. The zero-knowledge verification model may be as follows:
[0073] Verify(π)→RESULT
[0074] zk-SNARK is a non-interactive zero-knowledge proof method that does not leak any useful information during the proof process. It can reduce the interaction process of the blockchain network and save proof costs. The validity of the zero-knowledge proof can be verified through the zero-knowledge verification model.
[0075] This application performs correct and effective auditing work under the premise of protecting user privacy. Specifically: blockchain is used to store encrypted power grid data. Due to the immutability of blockchain, when the data in the database is tampered with, the encrypted data can be used as an important basis for auditing. Using non-interactive zero-knowledge proofs for auditing can generate verifiable audit certificates without leaking user privacy (such as private keys and data). The nodes in the blockchain verify the authentication according to the smart contract and record the verification results. Since it is difficult for users to make verifiable false audit certificates, this method can effectively ensure the correctness of the audit results.
[0076] As mentioned above, this application receives the audit request and smart contract sent by the user terminal through the blockchain node, and sends the audit request to the target user through the server, so that the target user can feedback the first ciphertext; when the blockchain node receives the zero-knowledge proof sent by the user terminal, it verifies whether the zero-knowledge proof is valid based on the smart contract, and feeds back the verification result to the user terminal, so that the user terminal can judge whether the power grid data sent to the target user has been tampered with according to the verification result. This application has algorithm reliability, uses timestamp technology to ensure protocol security, realizes the privacy and auditability of the data transmission process, and is supervised by smart contracts, and performs integrity verification through concise zero-knowledge proofs, timely discovers tampered data, and traces back to the user who tampered with the data, and promptly handles tampered power grid data and malicious users to ensure the security of internal data of the power grid system.
[0077] In one embodiment, Figure 3 As shown, a power grid data audit method is provided, which may include:
[0078] Step 302, sending an audit request and a smart contract to a blockchain node; the audit request includes user identity information and a timestamp; the smart contract includes target user information of a target user for whom an audit is requested; the audit request is used to instruct the blockchain node to send the audit request to the target user through a server;
[0079] The power grid data audit method is applied to the user terminal; the target user is the user who receives the power grid data output by the user terminal; the user identity information includes the one-time account address of the user terminal in the blockchain node, the one-time account address is the data storage address of the blockchain node when the user terminal is audited, and the user is recorded as U i, i∈{1, 2, ..., n}; the timestamp is used to mark the current time of the audit request; a smart contract is a protocol translated into program code and stored in the blockchain network. When the defined conditions are met, it will be automatically executed. The smart contract contains all the information related to the audit and also clarifies the identity information of the contract participants, that is, the target users.
[0080] Specifically, when the user terminal interacts with other users, if the user terminal needs to audit the power grid data output to a certain user to verify whether the power grid data is complete and has not been tampered with, the user terminal first initiates the audit requirement User ID,TimeStamp , sends an audit request to the blockchain node, which includes two authentication information: the terminal user's identity information and timestamp. The terminal user's identity information includes the terminal user's one-time account address on the blockchain node; at the same time, the user terminal encodes a smart contract that includes all audit-related information ,The smart contract includes all audit-related information and requests for the target user information of the target user who has received the grid data sent by the user terminal, compiles it and sends the smart contract and the audit request to the blockchain node.
[0081] In one embodiment, if Figure 4 As shown, before sending the audit request and the smart contract step, the following steps may also be included:
[0082] Step 402, using an elliptic curve encryption model to generate a public key and a private key;
[0083] Step 404, sending the power grid data and the public key to the target user, and encrypting the power grid data based on the elliptic curve encryption model and the public key to obtain a second ciphertext;
[0084] Step 406, upload the second ciphertext to the blockchain node.
[0085] Specifically, the user terminal may use an elliptic curve encryption model to generate a public key and a private key. The elliptic curve encryption model is a model based on an ECC (Elliptic curve cryptography) algorithm. The ECC algorithm is based on an ElGamal cryptographic system, specifically:
[0086] Assume E is a finite field F q Elliptic curves on , where q is large enough for security; E contains a cyclic subgroup H = , which is not feasible for the discrete logarithm problem; more precisely, based on the Edwards curve, define B as an element of the set E and B≠(0,1), where:
[0087] E={(x,y)∈F q ×F q :-x 2 +y 2 =1+dx 2 y 2 }
[0088] Where d is The nonzero square elements in .
[0089] The public key and private key of the user terminal are obtained through the following model. The following addition, subtraction and multiplication are performed in E.
[0090] (1)KeyGen(1 λ )→A, a: The private key is a positive integer a, which determines the product of A=aB, and the public key is A.
[0091] (2) Enc(M, A) → (R, S): Let M be the plaintext and r be a randomly selected number. Using the public key A, we can calculate:
[0092] R=rB
[0093] S=M+rA
[0094] From this we can generate the ciphertext (R, S). Note that we cannot simply encode the plaintext as one of the coordinates of a point in E, because not all of these coordinates are in E.
[0095] (3) Dec((R, S), sk) → M: According to the encryption formula, the decryption formula can be derived:
[0096] M=S-rA=S-raB=S-aR
[0097] Therefore, knowing the private key a, the plaintext is restored to:
[0098] M=S-aR
[0099] Thus, the user terminal can use the elliptic curve encryption model to generate the public key pk i and private key sk i ,Right now:
[0100] KeyGen(1 λ )→sk i , pk i
[0101] In the process of data interaction between the user terminal and other users, the terminal user can send the public key to the target user while outputting the power grid data to the target user; and the user terminal also encrypts the power grid data sent to the target user based on the elliptic curve encryption model and the public key to obtain a second ciphertext, and uploads the second ciphertext to the blockchain node; the blockchain node receives and stores the second ciphertext uploaded by the user terminal; wherein the power grid data output by the user terminal can be recorded as D i , i∈{1, 2, ..., n}, the second ciphertext can be obtained by the following elliptic curve encryption model: Enc(D i , pk i )→C,pk i is the public key, and C is the second ciphertext.
[0102] This application uses the ECC encryption algorithm to encrypt user data and upload it to the blockchain. Since the ciphertext can only be decrypted with a private key, other nodes cannot obtain data from the blockchain. In addition, during the audit process, the user generates a one-time address for auditing. Therefore, others cannot link the ciphertext to the user through the content of the audit contract. In this way, user privacy is effectively protected and users are prevented from exposing their behavior.
[0103] Step 304, obtaining a first ciphertext and a second ciphertext from a blockchain node; the first ciphertext is obtained by encrypting the power grid data sent to the target user based on the elliptic curve encryption model and the public key when the target user receives the audit request; the second ciphertext is obtained by encrypting the power grid data based on the elliptic curve encryption model and the public key; the public key is generated by using the elliptic curve encryption model;
[0104] Specifically, when the blockchain node receives the audit request and the smart contract sent by the user terminal, it will forward the audit request to the target user agreed in the smart contract through the server, so that when the target user receives the audit request, it will encrypt the power grid data sent by the terminal user to the target user based on the elliptic curve encryption model and the public key sent by the user terminal to obtain the first ciphertext: Enc(D′ i , pk i )→C′; where D′ i The power grid data (tampered or not) encrypted for the target user, C′ is the first ciphertext; the target user feeds back the first ciphertext to the blockchain node; thus, after the user terminal sends the audit request and the smart contract to the blockchain node, the first ciphertext and the second ciphertext can be downloaded from the blockchain node.
[0105] Step 306, using the proof generation model to process the private key, the public key, the first ciphertext and the second ciphertext to obtain a zero-knowledge proof, and sending the zero-knowledge proof to the blockchain node; the private key is generated using the elliptic curve encryption model; the zero-knowledge proof is used to instruct the blockchain node to verify the validity of the zero-knowledge proof based on the smart contract;
[0106] Specifically, when the user terminal obtains the first ciphertext and the second ciphertext, it uses the proof generation model to process the private key, the public key, the first ciphertext and the second ciphertext to obtain the zero-knowledge proof, and sends the zero-knowledge proof to the blockchain node; thereby, when the blockchain node receives the zero-knowledge proof, it verifies whether the zero-knowledge proof is valid based on the smart contract sent by the user terminal to the blockchain.
[0107] In one example, the steps of using the proof generation model to process the private key, the public key, the first ciphertext, and the second ciphertext to obtain the zero-knowledge proof may include:
[0108] The public parameters and private key, public key, first ciphertext and second ciphertext of the proof generation model are input into the proof generation model to obtain a zero-knowledge proof.
[0109] Specifically, when the user terminal obtains the first ciphertext and the second ciphertext, it can use a model based on the zk-SNARK proof algorithm to process the public parameters of the zk-SNARK and the private key sk of the user terminal. i , the public key pk of the user terminal i , the first ciphertext C′ and the second ciphertext C, and we get the zero-knowledge proof π i :
[0110] ProofGen(sk i , pk i , C, C′)→π i
[0111] The user terminal will zero-knowledge proof π i Sent to the blockchain node, so that the blockchain node verifies the zero-knowledge proof π based on the smart contract i The validity of the verification result is fed back to the user terminal, that is, the private key of the user terminal is used to decrypt and verify Dec(C, sk i ) = Dec(C′, sk i ) is established to determine whether the power grid data has been tampered with.
[0112] Step 308, receiving the verification result output by the blockchain node, and determining whether the power grid data has been tampered with based on the verification result.
[0113] Specifically, when the user terminal receives the verification result output by the blockchain node, it determines whether the power grid data sent to the target user has been tampered with according to the verification result; when the verification result is verification passed, it is determined that the power grid data is complete and correct and has not been tampered with; when the verification result is verification failed, it is determined that the power grid data is incomplete or wrong, that is, the power grid data has been tampered with by the target user; it is determined whether the power grid data has been tampered with according to the received verification result, and if the power grid data has been tampered with, a corresponding processing plan is taken, and a corresponding punishment mechanism is taken against the target user who tampered with the data, thereby ensuring the security of the power grid system data.
[0114] As mentioned above, this application is based on a secure and trusted transmission scheme for decentralized data encryption and authentication. The system adopts a distributed architecture to distribute work or services to peer user nodes. In the power grid system, peer user nodes enjoy the same functions or services. This application uses the traceability, verifiability, and tamper-proof characteristics of blockchain technology to ensure the security, reliability, and auditability of data; this application uses the ECC algorithm to meet additive homomorphism and solve the privacy and auditability of data. Users can request data of other users stored in the server through smart contracts deployed on the blockchain, and verify the integrity through concise zero-knowledge proofs; smart contracts are efficient, reduce costs, save time, and bypass any third party; zk-SNARK does not leak any useful information during the proof process, which can reduce the interaction process of the blockchain network and save proof costs, thereby effectively improving the security of power grid data transmission in the power grid system.
[0115] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned 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 does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can 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 to be 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.
[0116] Based on the same inventive concept, the embodiment of the present application also provides a power grid data audit device for implementing the power grid data audit 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 one or more power grid data audit device embodiments provided below can refer to the limitations of the power grid data audit method above, and will not be repeated here.
[0117] In one embodiment, Figure 5 As shown, a power grid data auditing device is provided, which is applied to a blockchain node and may include:
[0118] The first receiving module 110 is used to receive an audit request and a smart contract sent by a user terminal; the audit request includes user identity information and a timestamp of the user terminal; the smart contract includes target user information of a target user requested to be audited by the user terminal;
[0119] The first output module 120 is used to send an audit request to a target user through a server; the audit request is used to instruct the target user to feedback a first ciphertext; the first ciphertext is obtained by encrypting the power grid data sent by the user terminal to the target user based on the elliptic curve encryption model and the public key of the user terminal when the target user receives the audit request; the public key is generated by the user terminal using the elliptic curve encryption model;
[0120] The second receiving module 130 is used to receive the zero-knowledge proof sent by the user terminal; the zero-knowledge proof is obtained by processing the public key, the private key of the user terminal, the first ciphertext and the second ciphertext using the proof generation model when the user terminal obtains the second ciphertext and the first ciphertext from the blockchain node; the second ciphertext is obtained by the user terminal encrypting the power grid data based on the elliptic curve encryption model and the public key; the private key is generated by the user terminal using the elliptic curve encryption model;
[0121] The second output module 140 is used to verify the validity of the zero-knowledge proof based on the smart contract and output the verification result; the verification result is used to determine whether the power grid data has been tampered with.
[0122] In one embodiment, the power grid data auditing device may further include:
[0123] The third receiving module is used to receive and store the second ciphertext uploaded by the user terminal.
[0124] In one embodiment, the second output module 140 is also used to verify the zero-knowledge proof based on the smart contract using a zero-knowledge decryption module to obtain and output the verification result.
[0125] In one embodiment, Figure 6 As shown, a power grid data auditing device is provided, which is applied to a user terminal and may include:
[0126] The data transmission module 210 is used to send an audit request and a smart contract to a blockchain node; the audit request includes user identity information and a timestamp; the smart contract includes target user information of the target user requested for audit; the audit request is used to instruct the blockchain node to send the audit request to the target user through the server;
[0127] The data acquisition module 220 is used to obtain a first ciphertext and a second ciphertext from a blockchain node; the first ciphertext is obtained by encrypting the power grid data sent to the target user based on the elliptic curve encryption model and the public key when the target user receives the audit request; the second ciphertext is obtained by encrypting the power grid data based on the elliptic curve encryption model and the public key; the public key is generated by using the elliptic curve encryption model;
[0128] The data processing module 230 is used to process the private key, the public key, the first ciphertext and the second ciphertext using the proof generation model to obtain the zero-knowledge proof, and send the zero-knowledge proof to the blockchain node; the private key is generated using the elliptic curve encryption model; the zero-knowledge proof is used to instruct the blockchain node to verify the validity of the zero-knowledge proof based on the smart contract;
[0129] The data receiving module 240 is used to receive the verification result output by the blockchain node and determine whether the power grid data has been tampered with based on the verification result.
[0130] In one embodiment, the power grid data auditing device may further include:
[0131] A key generation module, used to generate public and private keys using an elliptic curve encryption model;
[0132] A ciphertext generation module is used to send the power grid data and the public key to the target user, and encrypt the power grid data based on the elliptic curve encryption model and the public key to obtain a second ciphertext;
[0133] The data upload module is used to upload the second ciphertext to the blockchain node.
[0134] In one embodiment, the data processing module 230 is further configured to input the public parameters of the proof generation model and the private key, the public key, the first ciphertext, and the second ciphertext into the proof generation model to obtain the zero-knowledge proof.
[0135] Each module in the above-mentioned power grid data audit device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0136] In one embodiment, a power grid system is provided, which may include: a blockchain node and a user terminal;
[0137] The blockchain node is used to execute the above-mentioned power grid data audit method;
[0138] The user terminal is used to execute the above-mentioned power grid data auditing method.
[0139] Specifically, the blockchain node and the user terminal are communicated with each other; the power grid system may also include a server, which is communicated with the blockchain node and the user terminal respectively; the number of user terminals is several, and when a user terminal sends an audit request and a smart contract to the blockchain node, the user agreed to be audited in the smart contract in other user terminals is regarded as the target user. After the user terminal interacts with other users, the correctness and integrity of the output power grid data can be audited to verify whether the output power grid data has been tampered with by other users. The specific verification process has been described in detail above and will not be repeated here.
[0140] The internal structure diagram of the user terminal can be shown as Figure 7 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. 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 and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a power grid data audit method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0141] As mentioned above, the power grid system of the present application adopts a secure and trusted transmission solution based on decentralized data encryption and authentication, and uses the ECC algorithm to meet additive homomorphism and solve the privacy and auditability issues of power grid data. Users can request data of other users stored in the server through smart contracts deployed on the blockchain, and perform integrity verification through concise zero-knowledge proof. The power grid system of the present application can verify the power grid data and trace the source of the data, thereby ensuring the privacy and integrity of the power grid data and effectively improving the security of power grid data transmission.
[0142] Those skilled in the art will understand that Figure 7 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.
[0143] 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 in the above-mentioned method embodiments are implemented.
[0144] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0145] 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.
[0146] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods 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 the present application can include at least one of non-volatile 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), magnetoresistive 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, etc., but are not limited to this.
[0147] In the description of this specification, the description with reference to the terms "some embodiments", "other embodiments", "ideal embodiments", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic descriptions of the above terms do not necessarily refer to the same embodiment or example.
[0148] 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 specification.
[0149] 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 understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations 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 power grid data audit method, characterized in that: include: Receiving an audit request and a smart contract sent by a user terminal; the audit request includes user identity information and a timestamp of the user terminal; The smart contract includes target user information of the target user requested to be audited by the user terminal; Sending the audit request to the target user through the server; The audit request is used to instruct the target user to feedback a first ciphertext; the first ciphertext is obtained by encrypting the power grid data sent by the user terminal to the target user based on the elliptic curve encryption model and the public key of the user terminal when the target user receives the audit request; The public key is generated by the user terminal using the elliptic curve encryption model; Receiving a zero-knowledge proof sent by the user terminal; the zero-knowledge proof is obtained by using a proof generation model to process the public key, the private key of the user terminal, the first ciphertext, and the second ciphertext when the user terminal obtains the second ciphertext and the first ciphertext from the blockchain node; The second ciphertext is obtained by the user terminal encrypting the power grid data based on the elliptic curve encryption model and the public key; The private key is generated by the user terminal using the elliptic curve encryption model; The validity of the zero-knowledge proof is verified based on the smart contract, and a verification result is output; the verification result is used to determine whether the power grid data has been tampered with.
2. The power grid data audit method according to claim 1, characterized in that: Before the step of receiving the audit request and the smart contract sent by the user terminal, the method further includes: The second ciphertext uploaded by the user terminal is received and stored.
3. The power grid data audit method according to claim 1, characterized in that: The step of verifying the validity of the zero-knowledge proof based on the smart contract and outputting the verification result includes: Based on the smart contract, a zero-knowledge decryption module is used to verify the zero-knowledge proof, and a verification result is obtained and output.
4. A power grid data audit method, characterized in that: include: Sending an audit request and a smart contract to a blockchain node; the audit request includes user identity information and a timestamp; the smart contract includes target user information of a target user for which an audit is requested; The audit request is used to instruct the blockchain node to send the audit request to the target user through the server; Obtaining a first ciphertext and a second ciphertext from the blockchain node; the first ciphertext is obtained by encrypting the power grid data sent to the target user based on the elliptic curve encryption model and the public key when the target user receives the audit request; The second ciphertext is obtained by encrypting the power grid data based on the elliptic curve encryption model and the public key; the public key is generated by using the elliptic curve encryption model; Processing a private key, the public key, the first ciphertext, and the second ciphertext using a proof generation model to obtain a zero-knowledge proof, and sending the zero-knowledge proof to the blockchain node; The private key is generated using the elliptic curve encryption model; the zero-knowledge proof is used to instruct the blockchain node to verify the validity of the zero-knowledge proof based on the smart contract; Receive the verification result output by the blockchain node, and determine whether the power grid data has been tampered with according to the verification result.
5. The power grid data auditing method according to claim 4, characterized in that: Before the step of sending the audit request and the smart contract to the blockchain node, the step further includes: Generate a public key and a private key using the elliptic curve encryption model; Sending the power grid data and the public key to the target user, and encrypting the power grid data based on the elliptic curve encryption model and the public key to obtain the second ciphertext; Upload the second ciphertext to the blockchain node.
6. The power grid data audit method according to claim 4, characterized in that: The step of using the proof generation model to process the private key, the public key, the first ciphertext and the second ciphertext to obtain a zero-knowledge proof includes: The public parameters of the proof generation model and the private key, the public key, the first ciphertext and the second ciphertext are input into the proof generation model to obtain the zero-knowledge proof.
7. A power grid data auditing device, characterized in that: include: A first receiving module, configured to receive an audit request and a smart contract sent by a user terminal; the audit request includes user identity information and a timestamp of the user terminal; The smart contract includes target user information of the target user requested to be audited by the user terminal; A first output module, used to send the audit request to the target user through a server; The audit request is used to instruct the target user to feedback a first ciphertext; the first ciphertext is obtained by encrypting the power grid data sent by the user terminal to the target user based on the elliptic curve encryption model and the public key of the user terminal when the target user receives the audit request; The public key is generated by the user terminal using the elliptic curve encryption model; A second receiving module is configured to receive a zero-knowledge proof sent by the user terminal; the zero-knowledge proof is obtained by processing the public key, the private key of the user terminal, the first ciphertext and the second ciphertext using a proof generation model when the user terminal obtains the second ciphertext and the first ciphertext from the blockchain node; The second ciphertext is obtained by the user terminal encrypting the power grid data based on the elliptic curve encryption model and the public key; The private key is generated by the user terminal using the elliptic curve encryption model; A second output module, used to verify the validity of the zero-knowledge proof based on the smart contract and output the verification result; The verification result is used to determine whether the power grid data has been tampered with.
8. A power grid data auditing device, characterized in that: include: A data sending module, used to send an audit request and a smart contract to a blockchain node; the audit request includes user identity information and a timestamp; the smart contract includes target user information of a target user for which an audit is requested; The audit request is used to instruct the blockchain node to send the audit request to the target user through the server; A data acquisition module, used to acquire a first ciphertext and a second ciphertext from the blockchain node; the first ciphertext is obtained by encrypting the power grid data sent to the target user based on the elliptic curve encryption model and the public key when the target user receives the audit request; The second ciphertext is obtained by encrypting the power grid data based on the elliptic curve encryption model and the public key; the public key is generated by using the elliptic curve encryption model; A data processing module, configured to process a private key, the public key, the first ciphertext, and the second ciphertext using a proof generation model to obtain a zero-knowledge proof, and send the zero-knowledge proof to the blockchain node; The private key is generated using the elliptic curve encryption model; the zero-knowledge proof is used to instruct the blockchain node to verify the validity of the zero-knowledge proof based on the smart contract; The data receiving module is used to receive the verification result output by the blockchain node, and determine whether the power grid data has been tampered with according to the verification result.
9. A power grid system, characterized in that: include: Blockchain nodes and user terminals; The blockchain node is used to execute the power grid data audit method according to any one of claims 1 to 3; The user terminal is used to execute the power grid data audit method described in any one of claims 4 to 6.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Web3 Decentralized Blockchain Based NFT Framework... Applications
US20240185191A1