Energy transaction data privacy protection method and system based on block chain homomorphic encryption

Through the Okamoto-Uchiyama homomorphic encryption and multi-node verification mechanism on the blockchain, combined with data segmentation and hash calculation, the performance bottleneck and privacy exposure problems in energy transaction data privacy protection are solved, and efficient and secure transaction data protection is achieved.

CN120688090APending Publication Date: 2025-09-23SHANDONG COMP SCI CENTNAT SUPERCOMP CENT IN JINAN
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510810857.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-17
Publication Date
2025-09-23

AI Technical Summary

Technical Problem

Existing energy transaction data privacy protection methods have performance bottlenecks and privacy exposure risks on the blockchain, making it difficult to effectively protect the security of transaction data between new energy electric vehicles and charging stations.

Method used

It adopts the blockchain-based Okamoto-Uchiyama homomorphic encryption technology, combined with data segmentation and multi-node verification mechanism, to ensure the security and privacy of transaction data through hash calculation, homomorphic encryption and audit log generation.

Benefits of technology

It significantly improves the security and privacy of transaction data, reduces the time cost of encryption and decryption, prevents data tampering, enhances the credibility and stability of the system, and ensures the smoothness of the transaction process and legitimate rights and interests.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120688090A_ABST
    Figure CN120688090A_ABST
Patent Text Reader

Abstract

The invention provides an energy transaction data privacy protection method and system based on block chain homomorphic encryption, and belongs to the technical field of new energy transaction data privacy protection. Comprising the following steps: performing segmentation and Hash calculation on transaction data according to attributes to obtain Hash value data segments; performing homomorphic encryption on the hash value data segment by using a session key generated by a smart contract on the block chain; in the encryption state, verification calculation is completed at the edge node; determining whether the charging station continues to execute the charging operation according to the verification result; generating an audit log related to the transaction data at the edge node, and adding a timestamp; and verifying the audit log and the timestamp based on a multi-node verification mechanism. According to the invention, through an accurate and reliable homomorphic encryption mechanism, the transaction data privacy security between the new energy electric vehicle and the charging station can be significantly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of privacy protection of new energy transaction data, and in particular relates to a method and system for privacy protection of energy transaction data based on blockchain homomorphic encryption. Background Art

[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.

[0003] With the rapid growth of the new energy electric vehicle market, the privacy protection of transaction data between charging stations and electric vehicles has become a growing research focus. During the EV charging process, a large amount of sensitive user data, such as vehicle ID, charging requirements, and payment information, is collected. The leakage of this information not only threatens user privacy but also leads to risks such as data tampering and transaction fraud. Therefore, effectively protecting the privacy of transaction data has become a pressing issue.

[0004] Existing privacy protection methods for energy transaction data generally rely entirely on blockchain-based encrypted transmission and access control to achieve privacy protection. Although this method can provide a certain degree of security, it still faces performance bottlenecks and privacy exposure risks when processing transaction data. For example: (1) The open and transparent nature of blockchain improves the credibility of transactions, but it also brings the risk of transaction data privacy leakage. Therefore, in energy trading scenarios, this method is difficult to prevent the sensitive data of participants (such as vehicle ID, charging requirements, payment information, and energy usage data) from being obtained by unauthorized third parties.

[0005] (2) Although the anonymity and traceability of blockchain can provide anonymity protection to a certain extent, if transactions can be directly linked to personal data, an individual’s energy transaction history and behavior patterns may be tracked and analyzed, thereby threatening the security of transaction data privacy. Summary of the Invention

[0006] To overcome the shortcomings of the above-mentioned existing technologies, the present invention provides a method and system for protecting the privacy of energy transaction data based on blockchain homomorphic encryption. Through a precise and reliable homomorphic encryption mechanism, the privacy security of transaction data between new energy electric vehicles and charging stations can be significantly improved.

[0007] To achieve the above objectives, one or more embodiments of the present invention provide the following technical solutions: The first aspect of the present invention provides a method for protecting the privacy of energy transaction data based on blockchain homomorphic encryption.

[0008] The energy transaction data privacy protection method based on blockchain homomorphic encryption includes: Acquire transaction data of electric vehicles and segment the obtained transaction data according to attributes; perform hash calculation on the segmented transaction data to generate hash value data segments corresponding to the attributes, and transmit the obtained hash value data segments to edge nodes; A session key is automatically generated based on a smart contract on the blockchain, and the hash value data segment is homomorphically encrypted using the session key. Under the homomorphic encryption state, the charging confirmation calculation, payment verification calculation, and fee calculation of the electric vehicle are completed at the edge node, and the homomorphically encrypted calculation results are transmitted to the charging station. The received calculation result is decrypted to obtain the verification result; based on the obtained verification result, it is determined whether to continue the charging operation; at the same time, an audit log related to the transaction data is generated at the edge node, and a timestamp is attached to each generated audit log; finally, the audit log and timestamp are verified based on the multi-node verification mechanism.

[0009] Furthermore, the attributes of the transaction data include identity information, charging request, transaction and payment information; wherein, the identity information includes vehicle ID, user ID and authentication key, the charging request includes charging amount requirement, charging priority and estimated charging time, and the transaction and payment information includes account ID, pre-authorized amount and payment method.

[0010] Furthermore, the split transaction data is hashed, namely: ; ; ; in, Indicates hash calculation; A hash value data segment representing identity information, Indicates the vehicle ID, Indicates the user ID, Represents the authentication key; The hash value data segment representing the charging request, Indicates the charging demand. Indicates charging priority, Indicates the estimated charging time; A hash value data segment representing transaction and payment information, Indicates the account ID, Indicates the pre-authorized amount. Indicates the payment method.

[0011] Furthermore, the session key is used to perform Okamoto-Uchiyama homomorphic encryption on the hash value data segment, namely: ; ; ; in, A homomorphically encrypted value representing identity information, A hash value data segment representing identity information; The homomorphically encrypted value representing the charging request, A hash value data segment representing a charging request; Homomorphically encrypted values ​​representing transaction and payment information, A hash value data segment representing transaction and payment information; Indicates the use of session keys Perform homomorphic encryption on information.

[0012] Furthermore, the charging confirmation calculation is to calculate whether the charging requirements are met based on the homomorphically encrypted value of the charging request in the encrypted state; the payment verification calculation is to verify whether the payment authorization is passed based on the homomorphically encrypted value of the transaction and payment information in the encrypted state; the fee calculation is to calculate the estimated fee based on the homomorphically encrypted value of the charging request, transaction and payment information in the encrypted state.

[0013] Furthermore, whether to continue the charging operation is determined based on the verification results, including: the verification results include charging demand verification results, payment verification results and fee estimation results; if and only if all verification results are passed, the charging station will send a confirmation notification to the electric vehicle and authorize the start of the charging process; otherwise, the charging station will reject the transaction and notify the electric vehicle user.

[0014] Furthermore, the content of each audit log is hashed using a cryptographic hash function. The hash value serves as a unique identifier for the log content.

[0015] The second aspect of the present invention provides an energy transaction data privacy protection system based on blockchain homomorphic encryption.

[0016] The energy transaction data privacy protection system based on blockchain homomorphic encryption includes: The data segmentation module is configured to: obtain transaction data of electric vehicles and segment the obtained transaction data according to attributes; perform hash calculation on the segmented transaction data to generate hash value data segments corresponding to the attributes, and transmit the obtained hash value data segments to the edge node; The homomorphic encryption module is configured to automatically generate a session key based on a smart contract on the blockchain and perform Okamoto-Uchiyama homomorphic encryption on the hash value data segment using the session key; complete the charging confirmation calculation, payment verification calculation, and fee calculation of the electric vehicle at the edge node under the homomorphic encryption state, and transmit the homomorphically encrypted calculation results to the charging station; The encryption verification module is configured to: decrypt the received calculation results to obtain the verification results; determine whether to continue the charging operation based on the obtained verification results; at the same time, generate an audit log related to the transaction data at the edge node and attach a timestamp to each audit log generated; finally, verify the audit log and timestamp based on the multi-node verification mechanism. The third aspect of the present invention provides a computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements the steps in the energy transaction data privacy protection method based on blockchain homomorphic encryption as described in the first aspect of the present invention.

[0017] The fourth aspect of the present invention provides an electronic device, comprising a memory, a processor, and a program stored in the memory and executable on the processor. When the processor executes the program, the steps in the method for protecting energy transaction data privacy based on blockchain homomorphic encryption as described in the first aspect of the present invention are implemented.

[0018] One or more of the above technical solutions have the following beneficial effects: (1) The present invention constructs a multi-level security protection system by organically combining data segmentation with Okamoto-Uchiyama homomorphic encryption technology. In the energy trading scenario, compared with relying solely on blockchain or traditional homomorphic encryption algorithms, Okamoto-Uchiyama homomorphic encryption technology not only significantly improves the security of data encryption, but also reduces the time cost of encryption and decryption through a more efficient computing mechanism, ensuring the smoothness of the transaction process. At the same time, data segmentation technology further strengthens the privacy protection of transaction data by splitting the original data into multiple fragments for transmission. Even if part of the data is intercepted, the attacker cannot restore the complete information based on the obtained fragments alone. The two technologies complement each other. The present invention ensures the security and privacy of energy trading data from the two key links of encryption processing and data transmission.

[0019] (2) The present invention verifies the audit log and timestamp based on a multi-node verification mechanism. That is, through the multi-node verification mechanism, the risk of single point failure and malicious tampering is effectively avoided, thereby ensuring that every link of the audit log from generation to recording is accurate. The unchangeable nature of the hash value and timestamp after being uploaded to the chain gives the transaction data a unique and traceable identity. As a result, the present invention has the ability to promptly detect data tampering, which can significantly enhance the overall credibility and stability of the system and protect the legitimate rights and interests of all parties involved in energy transactions; personal energy transaction history and behavior patterns will not be tracked and analyzed.

[0020] Advantages of additional aspects of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The accompanying drawings, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0022] Figure 1 This is a flowchart of the energy transaction data privacy protection method based on blockchain homomorphic encryption in Example 1 of the present invention.

[0023] Figure 2 This is an architectural flowchart of the energy transaction data privacy protection method based on blockchain homomorphic encryption in Example 1 of the present invention.

[0024] Figure 3 This is a comparison chart of the time consumption for encrypting different amounts of data using the three homomorphic encryption algorithms in Example 1 of the present invention.

[0025] Figure 4 This is a comparison chart of the time consumption of performing homomorphic operations on different data amounts using three homomorphic encryption algorithms in Example 1 of the present invention.

[0026] Figure 5 This is a comparison chart of the total time required to perform homomorphic encryption operations on different amounts of data using the three homomorphic encryption algorithms in Example 1 of the present invention.

[0027] Figure 6 This is an architectural diagram of the energy transaction data privacy protection system based on blockchain homomorphic encryption in Example 2 of the present invention. DETAILED DESCRIPTION

[0028] It should be noted that the following detailed descriptions are exemplary and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which the present invention belongs.

[0029] It should be noted that the terms used herein are for describing particular embodiments only and are not intended to limit the exemplary embodiments according to the present invention.

[0030] In the absence of conflict, the embodiments of the present invention and the features thereof may be combined with each other.

[0031] Example 1 This embodiment discloses a method for protecting energy transaction data privacy based on blockchain homomorphic encryption.

[0032] like Figure 1 As shown in FIG, the energy transaction data privacy protection method based on blockchain homomorphic encryption includes: Step S1: Acquire transaction data of electric vehicles and segment the obtained transaction data according to attributes; perform hash calculation on the segmented transaction data to generate hash value data segments corresponding to the attributes, and transmit the obtained hash value data segments to edge nodes; Step S2: Automatically generate a session key based on the smart contract on the blockchain, and use the session key to perform Okamoto-Uchiyama homomorphic encryption on the hash value data segment; in the homomorphic encryption state, complete the charging confirmation calculation, payment verification calculation and fee calculation of the electric vehicle at the edge node, and transmit the homomorphically encrypted calculation results to the charging station; Step S3: Decrypt the received calculation result to obtain the verification result; determine whether to continue the charging operation based on the obtained verification result; at the same time, generate an audit log related to the transaction data at the edge node, and attach a timestamp to each generated audit log; finally, verify the audit log and timestamp based on the multi-node verification mechanism.

[0033] Based on the above process, the present invention can significantly improve the privacy and security of transaction data between new energy electric vehicles and charging stations through a precise and reliable homomorphic encryption mechanism. To facilitate understanding of the technical solution of the present invention, the specific implementation method of the technical solution of the present invention is further explained and illustrated below.

[0034] In step S1, the transaction data of electric vehicles is obtained and the obtained transaction data is segmented according to attributes; hash calculation is performed on the segmented transaction data to generate hash value data segments corresponding to the attributes, and the obtained hash value data segments are transmitted to the edge node. Figure 2 As shown, this can be achieved through the following methods: Step S1-1: data segmentation.

[0035] The electric vehicle initiates a connection request to the charging station, and the charging station verifies the identity of the electric vehicle and the user's authentication key to ensure the legitimacy and security of both parties. When segmenting new energy transaction data, the attributes of the transaction data include identity information, charging request, transaction and payment information, namely: Identity information: Vehicle ID (VID), User ID (UID), Authentication Key (AK); Charging request: Charging Demand (CD), Charging Priority (CP), Estimated Charging Duration (ECD); Transaction and payment information: Account ID (AID), Pre-authorization Amount (PA), Payment Method (PM).

[0036] Based on the above method, attribute segmentation of transaction data (identity information, charging requests, transaction and payment information) can minimize the attack surface. Attackers cannot directly obtain the complete transaction context, thereby reducing the risk of privacy leakage and enhancing security and privacy protection capabilities. In resource-constrained edge computing environments, attribute segmentation can improve computing efficiency and scalability, especially improving system throughput in high-concurrency scenarios. Reconnecting segmented data segments through identifiers can ensure that each group of attributes is correctly associated before encryption, ensuring data integrity and traceability. Attribute segmentation improves security, efficiency, and maintainability, provides structured input for homomorphic encryption, and avoids the risks of "one-size-fits-all" processing.

[0037] Step S1-2: Perform hash calculation on the segmented transaction data to generate hash value data segments corresponding to the attributes, and transmit the obtained hash value data segments to the edge node, that is: ; ; ; in, Indicates hash calculation; A hash value data segment representing identity information, Indicates the vehicle ID, Indicates the user ID, Represents the authentication key; The hash value data segment representing the charging request, Indicates the charging demand. Indicates charging priority, Indicates the estimated charging time; A hash value data segment representing transaction and payment information, Indicates the account ID, Indicates the pre-authorized amount. Indicates the payment method.

[0038] Based on the above method, a hash calculation is performed on each segmented attribute group. The final hash value cannot be reverse-derived from the original data, and any modification to the original data will result in a change in the hash value, ensuring data integrity and tamper-proofing, and ensuring that the data is not corrupted during transmission. During data transmission, the hash value is transmitted instead of the original data, minimizing the amount of data exposed to edge nodes and the network. Edge nodes only process hash values, and homomorphic encryption encrypts hash values, which can further enhance privacy and improve security and privacy. At the same time, the hash calculation results provide standardized input for homomorphic encryption, making the entire process more suitable for resource-constrained edge computing environments.

[0039] In step S2, a session key is automatically generated based on the smart contract on the blockchain, and the hash value data segment is encrypted using the session key. Under the homomorphic encryption state, the charging confirmation calculation, payment verification calculation and fee calculation of the electric vehicle are completed at the edge node, and the calculation results after homomorphic encryption are transmitted to the charging station. Figure 2 As shown, this can be achieved through the following methods: Step S2-1, Okamoto-Uchiyama homomorphic encryption.

[0040] Users of new energy electric vehicles need to set a specific identifier I to connect the segmented data segments for subsequent verification process.

[0041] After identity authentication is completed, the smart contract on the blockchain automatically generates a session key The session key is transmitted to the edge node via a secure channel for homomorphic encryption. Before performing the homomorphic encryption operation, the edge node reconnects the segmented data segments transmitted from the electric vehicle using a unique identifier I set by the user. This ensures the integrity and correct correspondence of the data in the subsequent homomorphic encryption calculation, accurately combining information such as identity, charging request, and transaction payment.

[0042] The edge node receives the session key generated by the smart contract Then, the session key is used to perform Okamoto-Uchiyama homomorphic encryption on the hash value data segment transmitted from the electric vehicle to the edge node, that is: ; ; ; in, A homomorphically encrypted value representing identity information, A hash value data segment representing identity information; The homomorphically encrypted value representing the charging request, A hash value data segment representing a charging request; Homomorphically encrypted values ​​representing transaction and payment information, A hash value data segment representing transaction and payment information; Indicates the use of session keys Perform homomorphic encryption on information.

[0043] Furthermore, the difference between Okamoto-Uchiyama homomorphic encryption technology and traditional homomorphic encryption technology (such as Paillier homomorphic encryption technology) is that: 1) In terms of modulus structure, the public key modulus of Okamoto-Uchiyama homomorphic encryption is , the public key modulus in traditional Paillier homomorphic encryption is ; where p and q are large prime numbers.

[0044] 2) In terms of ciphertext space and operations, the ciphertext of Okamoto-Uchiyama homomorphic encryption is defined on a specific multiplicative subgroup G under the module n, and homomorphic addition performs multiplication operations under the module n; while the ciphertext of traditional Paillier homomorphic encryption is defined on a specific multiplicative subgroup G under the module n. On the module, homomorphic addition Perform multiplication operation below.

[0045] 3) In the decryption process, Okamoto-Uchiyama homomorphic encryption uses p-adic logarithms and The core of the decryption is to calculate the L function; the traditional Paillier homomorphic encryption uses the Carmichael function and the module The L function under Okamoto-Uchiyama homomorphic encryption and traditional Paillier homomorphic encryption The formula is as follows: Okamoto-Uchiyama homomorphic encryption: ; Paillier homomorphic encryption: ; In order to further demonstrate the difference between the Okamoto-Uchiyama homomorphic encryption algorithm used in the present invention and the traditional homomorphic encryption algorithm, an experimental analysis was conducted in this embodiment, and the results are as follows: Figure 3 、 Figure 4 、 Figure 5 shown; among them, Figure 3 This is a comparison chart of the time consumption of three homomorphic encryption algorithms, Paillier, Damgard-Jurik, and Okamoto-Uchiyama, for encrypting different amounts of data. Figure 3 As can be seen from the figure, as the number of data continues to increase, the Okamoto-Uchiyama homomorphic encryption algorithm has always maintained its leading advantage in encryption time, that is, the time consumed during encryption is the least. Figure 4 This is a comparison chart of the time consumption of homomorphic operations on different data amounts by three homomorphic encryption algorithms: Paillier, Damgard-Jurik, and Okamoto-Uchiyama. Figure 4 As can be seen from the figure, as the number of data continues to increase, the Okamoto-Uchiyama homomorphic encryption algorithm has always maintained its leading advantage in homomorphic operation time, that is, it takes the least time to perform homomorphic operations. Figure 5 This is a comparison chart of the total time for homomorphic encryption operations of three homomorphic encryption algorithms, Paillier, Damgard-Jurik, and Okamoto-Uchiyama, on different amounts of data. Figure 5 As can be seen from the results, as the amount of data continues to increase, the Okamoto-Uchiyama homomorphic encryption algorithm maintains its leading advantage in total time, that is, the entire homomorphic encryption process takes the least total time. Experimental results show that the Okamoto-Uchiyama homomorphic encryption technology used in this invention has a strong advantage in processing large-scale data. That is, as the amount of data increases, the Okamoto-Uchiyama homomorphic encryption outperforms the traditional Paillier algorithm and Damgard-Jurik algorithm in terms of encryption time consumption, homomorphic operation time consumption, and total time consumption.

[0046] By introducing Okamoto-Uchiyama homomorphic encryption technology, we can effectively achieve the goals of improving time and throughput efficiency while reducing latency. This encryption technology features fast encryption and decryption speeds, maintaining low latency during data processing, and the latency growth trend is flat as the data volume increases. Furthermore, it boasts high throughput, enabling efficient processing of large amounts of energy trading data, providing reliable and efficient guarantees for data privacy protection in energy trading scenarios.

[0047] Step S2-2: Under homomorphic encryption, the charging confirmation calculation, payment verification calculation, and fee calculation of the electric vehicle are completed at the edge node, and the homomorphic encrypted calculation results are transmitted to the charging station.

[0048] Charging confirmation calculation: In the ciphertext state, the homomorphic encryption value of the charging request is calculated Calculates whether charging needs are met, including the required charge capacity and charging priority. Charging priority is a user-defined priority for their charging request, helping charging stations allocate resources appropriately during periods of high load. Typically, charging priorities are categorized as high priority and normal priority. High-priority users receive priority charging service when resources are limited, ensuring their charging needs are quickly responded to.

[0049] Payment verification calculation: In the ciphertext state, based on the homomorphic encryption value of transaction and payment information Verifying payment authorization primarily involves verifying that the account balance meets the pre-authorized amount. This amount is the upper limit of the amount pre-authorized in the user's account for charging fees. When a charging request is made, the system verifies the user's account balance to ensure they have the funds to pay for the charging. This process reduces the risk of transaction failure and ensures a smooth charging process.

[0050] Fee estimation: Calculate the estimated fee based on the homomorphically encrypted values ​​of the charging request, transaction, and payment information in a ciphertext state.

[0051] The edge node completes operations such as charging confirmation calculation, payment verification calculation, and cost estimation, and transmits the encrypted calculation results to the charging station.

[0052] In step S3, the received calculation result is decrypted to obtain the verification result; based on the obtained verification result, it is determined whether to continue the charging operation; at the same time, an audit log related to the transaction data is generated at the edge node, and a timestamp is attached to each generated audit log; finally, the audit log and timestamp are verified based on the multi-node verification mechanism. This can be achieved through the following methods: Step S3-1: When the charging station receives the encrypted data transmitted by the edge node, the charging station decrypts the encrypted data using the previously generated session key to obtain the information that needs to be verified.

[0053] The decrypted information consists of three main parts, namely: (1) Charging demand verification results: This part verifies whether the electric vehicle's charging request meets the requirements of the charging station. This includes factors such as charging capacity requirements, charging priority, and charging time. If the electric vehicle's charging request cannot be met within the charging station's resource configuration, the charging request will be rejected.

[0054] (2) Payment Verification Result: This part ensures that the EV has sufficient funds in its account and that payment authorization has been approved when initiating a charging request. The charging station needs to verify that the user's account balance meets the pre-authorized amount and that the payment method is valid. If payment authorization is not approved, the charging request will be canceled or postponed.

[0055] (3) Cost estimation: The charging station estimates the charging cost based on the EV's charging request. This estimate is calculated based on the charging duration, power, and the charging station's fee standards. This step helps EV users understand the cost in advance and avoid payment disputes during the charging process.

[0056] After decrypting this information and completing verification, the charging station decides whether to proceed with the charging operation based on the verification results. If all verification results are passed, the charging station sends a confirmation notification to the electric vehicle and authorizes the charging process to begin. If any verification fails, the charging station rejects the transaction and notifies the electric vehicle user, ensuring the reliability and fairness of the system. This step ensures transaction security and prevents erroneous charging requests or payment operations.

[0057] Step S3-2: Audit log generation and blockchain recording.

[0058] During the transaction process between electric vehicles and charging stations, an audit log generation and blockchain recording mechanism is adopted to ensure the transparency, integrity and non-tamperability of the transaction.

[0059] First, after the charging station confirms or rejects a transaction, the edge node is responsible for generating audit logs related to the transaction. These audit logs record key operations throughout the transaction process, including the requests initiated by the electric vehicle (such as charging requests and payment requests), the corresponding computations performed by the edge node (such as verifying charging requests and payment authorization), and the confirmation of transaction results (such as charging confirmation and payment authorization status). Each audit log entry is hashed using a cryptographic hash function. This hash value uniquely identifies the log content, ensuring its integrity and immutability. Once generated and recorded, it cannot be modified.

[0060] When generating the audit log's hash value, edge nodes also attach a timestamp to each audit log entry. This timestamp, generated by the blockchain node and stored alongside the audit log's hash value, ensures the storage time and immutability of each audit log entry. The timestamp provides an accurate time stamp for each audit log entry, guaranteeing the authenticity and reliability of the data.

[0061] Once the hash value and timestamp are generated, the edge node uploads this information to the blockchain via a smart contract. The execution of the smart contract is handled by multiple nodes in the blockchain, ensuring decentralization and trustworthiness throughout the process. The edge node initiates a request to submit the audit log's hash value and timestamp to the blockchain. Multiple nodes in the blockchain jointly confirm the request, and only when a majority of nodes reach consensus is the audit log's hash value finally recorded in the blockchain. This process fully leverages the blockchain's consensus mechanism to ensure the security and authenticity of data records.

[0062] To ensure the integrity and accuracy of audit logs, multiple nodes (at least three) in the blockchain verify each submitted hash value to confirm its consistency with the original log content. They also check the accuracy of the timestamp to ensure that the audit log was generated within the specified time and has not been tampered with. This multi-node verification mechanism effectively mitigates the risk of data tampering caused by operations by a single edge node. Once the audit log hash value and timestamp are recorded on the blockchain, they cannot be altered. These hash values ​​serve as unique identifiers of the log content, ensuring the integrity and immutability of transaction data, and any attempts to modify recorded data are promptly detected. Furthermore, the use of at least three nodes for verification ensures sufficient fault tolerance and decentralization for the integrity and tamper resistance of the audit log. In a blockchain system, individual nodes may fail or be attacked, and disagreements between two nodes can make it difficult to reach consensus. Introducing at least three nodes enables a majority consensus mechanism. Even if one node behaves abnormally, the remaining two nodes can still detect the anomaly or tampering through majority judgment, thereby enhancing the system's credibility and security.

[0063] By combining audit log generation, hash value calculation, timestamps, blockchain recording, and multi-node verification, this invention ensures data transparency, integrity, and immutability during transactions between electric vehicles and charging stations. The blockchain's decentralized storage and automated execution of smart contracts make audit log recording more secure and reliable, while also providing strong assurance for transaction compliance.

[0064] Example 2 This embodiment discloses an energy transaction data privacy protection system based on blockchain homomorphic encryption.

[0065] like Figure 6 As shown in the figure, the energy transaction data privacy protection system based on blockchain homomorphic encryption includes: The data segmentation module is configured to: obtain transaction data of electric vehicles and segment the obtained transaction data according to attributes; perform hash calculation on the segmented transaction data to generate hash value data segments corresponding to the attributes, and transmit the obtained hash value data segments to the edge node; The homomorphic encryption module is configured to automatically generate a session key based on a smart contract on the blockchain and perform Okamoto-Uchiyama homomorphic encryption on the hash value data segment using the session key; complete the charging confirmation calculation, payment verification calculation, and fee calculation of the electric vehicle at the edge node under the homomorphic encryption state, and transmit the homomorphically encrypted calculation results to the charging station; The encryption verification module is configured to: decrypt the received calculation results to obtain the verification results; determine whether to continue the charging operation based on the obtained verification results; at the same time, generate an audit log related to the transaction data at the edge node and attach a timestamp to each audit log generated; finally, verify the audit log and timestamp based on the multi-node verification mechanism. Example 3 The purpose of this embodiment is to provide a computer-readable storage medium.

[0066] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the method for protecting energy transaction data privacy based on blockchain homomorphic encryption as described in the first embodiment of the present disclosure.

[0067] Example 4 The purpose of this embodiment is to provide an electronic device.

[0068] An electronic device includes a memory, a processor, and a program stored in the memory and executable on the processor. When the processor executes the program, the steps of the energy transaction data privacy protection method based on blockchain homomorphic encryption as described in the first embodiment of the present disclosure are implemented.

[0069] The steps involved in the apparatuses of Examples 2, 3, and 4 above correspond to those of Method Example 1. For detailed implementations, please refer to the relevant description of Example 1. The term "computer-readable storage medium" should be understood to mean a single medium or multiple media containing one or more instruction sets; it should also be understood to include any medium capable of storing, encoding, or carrying an instruction set for execution by a processor and causing the processor to perform any method of the present invention.

[0070] Those skilled in the art will appreciate that the modules or steps of the present invention described above can be implemented using a general-purpose computer device. Alternatively, they can be implemented using program code executable by a computing device, which can then be stored in a storage device and executed by the computing device. Alternatively, they can be fabricated into separate integrated circuit modules, or multiple modules or steps can be fabricated into a single integrated circuit module for implementation. The present invention is not limited to any specific combination of hardware and software.

[0071] Although the above describes the specific embodiments of the present invention in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art on the basis of the technical solution of the present invention without any creative work are still within the scope of protection of the present invention.

Claims

1. The energy transaction data privacy protection method based on blockchain homomorphic encryption is characterized by: include: Obtaining transaction data of electric vehicles and segmenting the obtained transaction data according to attributes; Perform hash calculation on the segmented transaction data to generate hash value data segments corresponding to the attributes, and transmit the resulting hash value data segments to the edge node; A session key is automatically generated based on a smart contract on the blockchain, and the hash value data segment is homomorphically encrypted using the session key. Under the homomorphic encryption state, the charging confirmation calculation, payment verification calculation, and fee calculation of the electric vehicle are completed at the edge node, and the homomorphically encrypted calculation results are transmitted to the charging station. Decrypting the received calculation result to obtain a verification result; and determining whether to continue the charging operation based on the obtained verification result; At the same time, audit logs related to transaction data are generated at the edge node, and a timestamp is attached to each generated audit log; finally, the audit logs and timestamps are verified based on a multi-node verification mechanism.

2. The energy transaction data privacy protection method based on blockchain homomorphic encryption according to claim 1 is characterized in that: The attributes of the transaction data include identity information, charging request, transaction and payment information; wherein, the identity information includes vehicle ID, user ID and authentication key, the charging request includes charging amount requirement, charging priority and estimated charging time, and the transaction and payment information includes account ID, pre-authorized amount and payment method.

3. The energy transaction data privacy protection method based on blockchain homomorphic encryption as claimed in claim 1 is characterized in that: Perform hash calculation on the split transaction data, namely: ; ; ; in, Indicates hash calculation; A hash value data segment representing identity information, Indicates the vehicle ID, Indicates the user ID, Represents the authentication key; The hash value data segment representing the charging request, Indicates the charging demand. Indicates charging priority, Indicates the estimated charging time; A hash value data segment representing transaction and payment information, Indicates the account ID, Indicates the pre-authorized amount. Indicates the payment method.

4. The energy transaction data privacy protection method based on blockchain homomorphic encryption as claimed in claim 1 is characterized in that: The hash value data segment is encrypted using the session key using Okamoto-Uchiyama homomorphic encryption, namely: ; ; ; in, A homomorphically encrypted value representing identity information, A hash value data segment representing identity information; The homomorphically encrypted value representing the charging request, A hash value data segment representing a charging request; Homomorphically encrypted values ​​representing transaction and payment information, A hash value data segment representing transaction and payment information; Indicates the use of session keys Perform homomorphic encryption on information.

5. The energy transaction data privacy protection method based on blockchain homomorphic encryption as claimed in claim 1 is characterized in that: The charging confirmation calculation is to calculate whether the charging requirements are met based on the homomorphic encryption value of the charging request in the ciphertext state; The payment verification calculation is to verify whether the payment authorization is passed based on the homomorphic encryption value of the transaction and payment information in the encrypted state; the fee calculation is to calculate the estimated fee based on the homomorphic encryption value of the charging request, transaction and payment information in the encrypted state.

6. The energy transaction data privacy protection method based on blockchain homomorphic encryption according to claim 1 is characterized in that: Determine whether to continue the charging operation based on the verification results, including: the verification results include charging demand verification results, payment verification results and fee estimation results; if and only if all verification results are passed, the charging station will send a confirmation notification to the electric vehicle and authorize the start of the charging process; otherwise, the charging station will reject the transaction and notify the electric vehicle user.

7. The energy transaction data privacy protection method based on blockchain homomorphic encryption according to claim 1 is characterized in that: The content of each audit log is encrypted using a hash function to generate a hash value, which serves as the unique identifier of the log content.

8. The energy transaction data privacy protection system based on blockchain homomorphic encryption is characterized by: include: The data segmentation module is configured to: obtain transaction data of electric vehicles and segment the obtained transaction data according to attributes; Perform hash calculation on the segmented transaction data to generate hash value data segments corresponding to the attributes, and transmit the resulting hash value data segments to the edge node; The homomorphic encryption module is configured to automatically generate a session key based on a smart contract on the blockchain and perform Okamoto-Uchiyama homomorphic encryption on the hash value data segment using the session key; complete the charging confirmation calculation, payment verification calculation, and fee calculation of the electric vehicle at the edge node under the homomorphic encryption state, and transmit the homomorphically encrypted calculation results to the charging station; The encryption verification module is configured to: decrypt the received calculation result to obtain a verification result; and determine whether to continue the charging operation based on the obtained verification result; At the same time, audit logs related to transaction data are generated at the edge node, and a timestamp is attached to each generated audit log; finally, the audit logs and timestamps are verified based on a multi-node verification mechanism.

9. A computer-readable storage medium having a program stored thereon, characterized in that: When the program is executed by a processor, the steps in the energy transaction data privacy protection method based on blockchain homomorphic encryption are implemented as described in any one of claims 1 to 7.

10. An electronic device comprising a memory, a processor, and a program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps in the energy transaction data privacy protection method based on blockchain homomorphic encryption are implemented as described in any one of claims 1 to 7.