Charging transaction data processing method, device and storage medium based on V2G

By introducing encryption verification mechanism and zero-knowledge proof technology into the charging transaction smart contract of V2G network, the issues of transaction fairness and user privacy protection are solved, and higher transaction security and fairness are achieved.

CN118982353BActive Publication Date: 2025-04-01WUHU WANWAN TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411026938.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2025-04-01
Estimated Expiration
2044-07-30

AI Technical Summary

Technical Problem

The payment mechanism of the existing V2G network has shortcomings in transaction fairness and user privacy protection, and has failed to effectively guarantee the fairness of transactions and the security of user sensitive data.

Method used

By introducing an encrypted verification mechanism of payment data proof and charging data proof in the charging transaction smart contract, zero-knowledge proof technology ensures the privacy and integrity of transaction data, and automatically executes or interrupts transactions through randomly selected execution witness monitoring verification results.

Benefits of technology

It improves the fairness and security of charging transactions, ensures the protection of user privacy information, reduces the risk of data leakage during the transaction process, and enhances the overall security of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118982353B_ABST
    Figure CN118982353B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of V2G networks, and to a charging transaction data processing method based on V2G, which includes: receiving a payment data certificate and a first verification key issued by a charging user; the charging transaction smart contract verifies the payment data certificate using the first verification key, and outputs a first verification result; receiving a charging data certificate and a second verification key issued by a charging station; the charging transaction smart contract verifies the charging data certificate using the second verification key, and outputs a second verification result; randomly selecting an execution witness from a witness pool to monitor the types of the first verification result and the second verification result, and controlling the continued execution or interruption of the charging transaction according to the types of the first verification result and the second verification result. The present invention also proposes a charging transaction data processing device and a storage medium based on V2G. The present invention can improve the fairness of charging transactions and the overall security of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of V2G networks, and in particular to a charging transaction data processing method, device and storage medium based on V2G. Background Art

[0002] At present, most of the payment transaction mechanisms for electric vehicles are based on blockchain. Electric vehicles are connected to the V2G network (Vehicle-to-Grid) through dedicated parking facilities and provide auxiliary services to the smart grid under the control of local aggregators. Electric vehicles have three states: charging, discharging, and distributed discharging. Charging is initiated by electric vehicles, and electricity is transmitted from the smart grid to electric vehicles. Electric vehicles need to pay electricity bills to the smart grid. Discharging is initiated by the smart grid when the grid is overloaded during peak user demand hours. Electric vehicles can alleviate power shortages by discharging to the grid and receive economic rewards from the smart grid. Distributed discharging is initiated by one or more electric vehicles when the battery capacity is below a certain threshold. Unlike the charging state, electric vehicles with sufficient power will temporarily act as energy suppliers for electric vehicles with insufficient power, and the latter need to pay electricity bills to the supplier.

[0003] In the actual payment mechanism system of the V2G network, the account registration process is to submit the user-generated account to the RA (Registration Authority) for authentication and registration. The user creates a pair of keys and then sends the key and identity information to the RA. After verifying the identity, the RA generates a signature based on the private key and replies to the user; then the RA will generate a legal account for the user, and each user can use the RA's public key to verify the account. The payment execution process is a blockchain transaction, that is, verifying the transaction and writing the transaction to the global ledger. The payee can use a different account for each transaction, and then send the registered account and unit price to the payer. The payer checks the global ledger, verifies the calculated total price, and sends the transaction id to the payee after payment; if the transaction is confirmed to be correct, the payee starts to supply power.

[0004] The existing scheme introduces blockchain and asymmetric encryption algorithms in the payment and user authentication process to protect information security. Although it provides transaction transparency and data immutability, it does not take into account transaction fairness in depth. In addition, it does not consider the potential risks of user sensitive data during the transaction process. Therefore, it is necessary to integrate more advanced privacy protection technology into the system to ensure that even when trading in a public blockchain network, the user's privacy information can be effectively protected, so as to achieve true security and privacy. Summary of the invention

[0005] In order to improve the fairness of system charging transactions and the overall security of the system, a charging transaction data processing method, device and storage medium based on V2G are provided.

[0006] In order to achieve the above-mentioned objective of the present invention, according to a first aspect of the present invention, the present invention provides a charging transaction data processing method based on V2G.

[0007] The present invention provides a V2G-based charging transaction data processing method, comprising:

[0008] Receiving a payment data certificate and a first verification key sent by a charging user;

[0009] Input the payment data certificate and the first verification key into the charging transaction smart contract, and the charging transaction smart contract verifies the payment data certificate using the first verification key and outputs a first verification result;

[0010] Receiving the charging data certificate and the second verification key issued by the charging station;

[0011] Input the charging data certificate and the second verification key into the charging transaction smart contract, and the charging transaction smart contract verifies the charging data certificate using the second verification key and outputs the second verification result;

[0012] Randomly select witnesses from the witness pool to monitor the type of the first verification result and the type of the second verification result. The types of smart contract output results include TRUE, FLASE and the third output;

[0013] When the type of the first verification result and the type of the second verification result are both TRUE, the smart contract automatically executes the transaction operation;

[0014] When the type of the first verification result and / or the type of the second verification result is FLASE, the smart contract automatically terminates the transaction;

[0015] When the type of the first verification result and / or the type of the second verification result is the third output, the execution witness reports the content of the third output to the smart contract, and the smart contract interrupts the transaction.

[0016] Optionally, the method further comprises:

[0017] Obtaining usage data information of charging users, inputting the usage data information into a credit scoring model, and obtaining a credit scoring result for each charging user;

[0018] The credit score results of each charging user are compared with the preset screening conditions. If the credit score results of the charging user meet the screening conditions, the charging user who meets the screening conditions will be added to the witness pool.

[0019] Optionally, the method further comprises constructing a credit scoring model, comprising:

[0020] Obtaining evaluation indicators for credit assessment, including payment timeliness, participation and integrity value;

[0021] Obtaining the initial weights and scoring rules of each evaluation indicator, constructing a credit scoring calculation formula based on the initial weights and scoring rules of each evaluation indicator, and obtaining a credit scoring model;

[0022] The calculation formula of credit score is: S = ω1*S1+ω2*S2+ω3*S3, where S1 is the payment timeliness score, ω1 is the weight of the payment timeliness score; S2 is the participation score, ω2 is the weight of the participation score; S3 is the integrity score, ω3 is the weight of the integrity score;

[0023] Among them, i is the payment behavior frequency index, S 1i is the original score of the ith payment behavior, is the decay function of the payment timeliness score, λ1 is the decay rate of the payment timeliness score, t i is the time from the ith payment behavior to the present, and n1 is the total statistical time of the payment behavior;

[0024] Among them, j is the index of the number of participation behaviors, S 2j is the raw score of the jth participation behavior, is the decay function of the engagement score, t j is the time from the jth participation behavior to the present; λ2 is the decay rate of the participation score, and n2 is the total statistical time of the participation behavior;

[0025] Among them, k is the index of the number of honest behaviors, S 3k is the original score of the k-th honest behavior, is the decay function of the integrity score, λ3 is the decay rate of the integrity score, t k is the time from the kth honest behavior to the present, and n3 is the total statistical time of honest behavior.

[0026] Optionally, the step of randomly selecting an execution witness from a witness pool includes:

[0027] S200: Obtain the registered witness set RW, the execution witness set SW, and the subsequent sequential block K of the witness pool s and the current timestamp;

[0028] S201: Initialize the seed value to 0, and generate a new block K according to the current timestamp and the subsequent sequence block K. sGenerate a random seed from the hash value of each block in the blockchain;

[0029] S202: Using the random seed to modulo the list length of the registered witness set RW, obtain a random witness index value, and determine a random witness based on the index value;

[0030] S203: Check whether the random witness corresponding to the index value is online. If the random witness is not online, reselect a random witness. If the random witness is online, add the random witness to the execution witness set SW.

[0031] Repeat steps S201 to S203 until the number of witnesses in the execution witness set SW reaches a preset value N, and set all witnesses in the execution witness set SW as execution witnesses.

[0032] Optionally, the using of the random seed to modulo the list length of the registered witness set RW to obtain a random witness index value, and determining the random witness based on the index value includes:

[0033] S210: Initialize the execution witness set SW to be an empty set, initialize the counter to 0, and record the value of the timer as J;

[0034] S220: Initialize the loop counter to 0, and record the value of the loop counter as loopCount;

[0035] S230: Determine the size of the value J and the value N. When J is less than N, calculate the index value index=(seed+J)%len(RW), where seed is the seed value, len(RW) is the list length of the registered witness set RW, and % represents a modulo operation;

[0036] S240: Determine whether the witness corresponding to the index value index is online. If the random witness is online, add the witness to the execution witness set SW and increase the counter J by 1; if the random witness is not online, directly increase the counter J by 1;

[0037] S250: Update the seed value seed=hash(seed+index+loopCount), and increase the loop counter loopCount by 1;

[0038] Repeat steps S230 to S250 until the number of witnesses in the witness set SW reaches a preset value N.

[0039] Optionally, before executing step S230, the method further includes:

[0040] Set the maximum number of loops of the loop counter loopCount, and record the maximum number of loops as maxLoops. The value of maxLoops is e, where e is a positive integer.

[0041] The step S230 includes:

[0042] When J is less than N and loopCount is less than maxLoops, calculate the index value index = (seed + J)% len(RW);

[0043] When loopCount is greater than maxLoops, determine whether J is less than N. If J is less than N, an abnormal warning is issued.

[0044] Optionally, the charging user encrypts the payment data or charging data before generating the payment data proof;

[0045] Before the charging station generates charging data proof, the charging data is encrypted;

[0046] The payment data and charging data are both regarded as the audit data of the smart contract, and the method for encrypting the audit data includes:

[0047] Randomly select two prime numbers m and n, satisfying gcd(mn,(m-1)(n-1))=1 and m and n are relatively prime, where gcd(mn,(m-1)(n-1)) represents the greatest common divisor of mn and (m-1)(n-1), let ε=m*n, ε is the first intermediate value;

[0048] From the Euler function ψ(ε)=ψ(m)*ψ(n)=(m-1)(n-1), we get η=lcm(m-1,n-1), where η is the second intermediate value and lcm(m-1,n-1) represents the least common multiple of m-1 and n-1.

[0049] Take a prime number α that is coprime with η, satisfying: 1<α<η and gcd(α,η)=1, gcd(α,η) represents the greatest common divisor of α and η;

[0050] The private key exponent δ satisfies: 1<δ<η and α*δmodη≡1, and is a random integer. calculate Among them, λ is the third intermediate value,

[0051] Create a key thread pool ThreadPoolExecutor key , generate two pairs of keys in parallel,

[0052] The first key pair is pk1 = (α, ε), sk1 = (δ, ε),

[0053] The second key pair is sk2=(η,λ);

[0054] Sign the public key of the second key pair with the private key of the first key pair, and obtain σ=sign(pk2,sk1);

[0055] Generate a salt value salt randomly, and use HKDF to derive a key. The key is expressed as key = HKDF (salt, IKM, info, len (key)), where salt is the salt value, IKM represents the input key material, info represents the context information, and len (key) represents the length of the output key;

[0056] The ε value of the second pair of public keys pk2 is encrypted using the key key. The encrypted ε value is expressed as (nounce, data, tag) = E key (key,pk2.ε), where nonce is a random number, data is the encrypted data, tag is the verification tag, and pk2.ε means that ε belongs to pk2;

[0057] Use the first pair of keys to encrypt key and salt, and get Among them, key encrypted Indicates the encrypted key, salt encrypted Indicates the encrypted salt value;

[0058] Create a message thread pool ThreadPoolExecutor message , put the audit data that needs smart contract audit in the message list messages, use the processed pk2 multi-threaded encryption message list messages, randomly select ρ to satisfy 0≤ρ<ε and have Where 0≤P<ε, C represents the encrypted message list messages.

[0059] Optionally, the charging user generates a payment data certificate and a first verification key through zero-knowledge proof;

[0060] The charging station generates charging data proof and a second verification key through zero-knowledge proof.

[0061] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:

[0062] at least one processor; and,

[0063] a memory communicatively connected to the at least one processor; wherein,

[0064] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the above-mentioned V2G-based charging transaction data processing method.

[0065] In order to solve the above problems, the present invention also provides a computer-readable storage medium, in which at least one computer program is stored. The at least one computer program is executed by a processor in an electronic device to implement the above-mentioned V2G-based charging transaction data processing method.

[0066] In summary, this application includes the following beneficial technical effects:

[0067] 1. Use payment data proof to encrypt and display the behavior of charging users who have completed effective payment, and use charging data proof to encrypt and display the charging data of charging stations without leaking specific details, thereby improving the privacy of charging users and the security of the system; when the charging data and payment data are verified to be correct, the smart contract automatically executes the transaction, and automatically stops the transaction when there is a problem with the charging data or payment data, so as to ensure the fairness and security of charging transactions; transactions are carried out only after the charging data and payment data are verified to be correct, which can improve the fairness and transparency of transactions;

[0068] 2. A hybrid multi-threaded encryption method is used to protect audit data. The key after multiple hybrid encryptions is used for the final data encryption, making it difficult for malicious intruders to attack and obtain the encrypted data content, thereby improving data security and reducing the possibility of data leakage during the smart contract audit process, thereby improving the security of the overall system. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] Figure 1 A schematic diagram of a flow chart of a method for processing charging transaction data based on V2G provided in one embodiment of the present invention;

[0070] Figure 2 A flowchart of the steps of screening witnesses from historical charging users according to the user credit mechanism provided in one embodiment of the present invention;

[0071] Figure 3 A schematic diagram of the process of constructing a credit scoring model provided by an embodiment of the present invention;

[0072] Figure 4 A schematic diagram of a process for randomly selecting an execution witness provided by an embodiment of the present invention;

[0073] Figure 5 The steps of determining a random witness using a random seed provided in one embodiment of the present invention;

[0074] Figure 6 A schematic diagram of an audit data encryption process provided by another embodiment of the present invention;

[0075] Figure 7 A schematic diagram of the structure of an electronic device for implementing the V2G-based charging transaction data processing method provided in one embodiment of the present invention.

[0076] Reference numerals: 10, processor; 11, memory; 12, communication bus; 13, communication interface.

[0077] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0078] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.

[0079] In the description of the present invention, it is necessary to understand that the terms "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating the orientation or position relationship, are based on the orientation or position relationship shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention.

[0080] In the description of the present invention, unless otherwise specified and limited, it should be noted that the terms "installed", "connected" and "connected" should be understood in a broad sense. For example, it can be a mechanical connection or an electrical connection, or it can be the internal connection between two components. It can be a direct connection or an indirect connection through an intermediate medium. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to the specific circumstances.

[0081] Example 1

[0082] Reference Figure 1 FIG. 1 is a flow chart of a method for processing charging transaction data based on V2G according to an embodiment of the present invention. In this embodiment, the method for processing charging transaction data based on V2G includes:

[0083] S1: Receive the payment data certificate and the first verification key sent by the charging user.

[0084] In this embodiment, the charging user is an electric vehicle, such as an electric car, an electric bus, or a battery car; the charging user generates a payment data proof and a first verification key through zero-knowledge proof technology (such as interactive or non-interactive zero-knowledge proof, zk-SNARKs, zk-STARKs);

[0085] Specifically, the building blocks of payment data proof include the correctness of the payment amount (proving that the charging user paid enough to complete the transaction), the validity of the source of funds (proving that there are enough funds in the charging user's account to make the payment), and the privacy protection of the payment (ensuring that the specific details of the payment, such as the charging user's identity and account balance, remain private);

[0086] In the preferred implementation of this embodiment, the charging user uses private data (such as account balance) and a proof key to generate a ZKP proof locally as a payment data proof; the full name of ZKP is Zero Knowledge Protocols, which means zero-knowledge protocol. The payment data proof is used to encrypt and display the behavior of the charging user who has completed a valid payment without revealing specific details, which can improve the privacy of the charging user.

[0087] S2: Input the payment data certificate and the first verification key into the charging transaction smart contract. The charging transaction smart contract verifies the payment data certificate using the first verification key and outputs a first verification result.

[0088] In this embodiment, the charging transaction smart contract is deployed on the Ethereum Virtual Machine (EVM) or EOS, which stands for Enterprise Operation System and is a blockchain operating system designed for commercial distributed applications. The charging transaction smart contract is pre-stored on the blockchain and is jointly verified and executed by all blockchain network nodes (i.e., devices, computers, and systems that store a complete copy of the blockchain data).

[0089] S3: receiving the charging data certificate and the second verification key issued by the charging station;

[0090] In this embodiment, the charging station generates a charging data certificate and a second verification key through zero-knowledge proof technology;

[0091] Specifically, the building blocks of charging data proof include the accuracy of metering data (i.e., proving that the submitted metering data, such as the amount of electricity used, service time, etc., matches the actual resources consumed, ensuring the authenticity of the data), data compliance (i.e., proving that the submitted data complies with relevant regulations and industry standards; for example, proving that the metering data has not been tampered with and complies with energy efficiency and safety standards) and data privacy protection (through zero-knowledge proof, the compliance and accuracy of the data can be proved without revealing the associated user identity or specific consumption details).

[0092] In a preferred implementation of this embodiment, the charging station uses the encrypted charging data (such as charging measurement value) and the certification key to generate a ZKP certification as the charging data certification.

[0093] S4: Input the charging data certificate and the second verification key into the charging transaction smart contract. The charging transaction smart contract uses the second verification key to verify the charging data certificate and outputs the second verification result.

[0094] S5: Randomly select from the witness pool the type of the first verification result and the type of the second verification result to be monitored by the witness;

[0095] When the type of the first verification result and the type of the second verification result are both TRUE, the smart contract automatically executes the transaction operation;

[0096] When the type of the first verification result and / or the type of the second verification result is FLASE, the smart contract automatically terminates the transaction;

[0097] When the type of the first verification result and / or the type of the second verification result is the third output, the execution witness reports the content of the third output to the smart contract, and the smart contract interrupts the transaction.

[0098] The types of smart contract output results include TRUE, FLASE and a third type of output. In this embodiment, outputs other than TRUE or FALSE are collectively referred to as the third type of output. Since the third type of output may be of any type, such as output generated by external attacks or output generated by unexpected interruptions, and since we cannot predict all output types in advance, the outputs of smart contracts other than TRUE and FALSE are collectively referred to as the third type of output.

[0099] When the charging data and payment data are verified to be correct, the smart contract automatically executes the transaction. When there is a problem with the charging data or payment data, the transaction is automatically stopped to ensure the fairness and security of the charging transaction. Only after the charging data and payment data are verified to be correct can the fairness and transparency of the transaction be improved.

[0100] Since there are many types of third-type output, the designer cannot predict all output types in advance, and therefore cannot make an automatic execution program so that the smart contract automatically interrupts the transaction when encountering the third-type output; the execution witness monitors the type of the first verification result and / or the second verification result. When the output result is the third-type output, the execution witness reports the content of the third output to the smart contract to control the smart contract to terminate the transaction.

[0101] Reference Figure 2In this embodiment, the witnesses in the witness pool are pre-screened from historical charging users according to the user credit mechanism; the specific screening steps are:

[0102] S110: Obtain usage data information of charging users, input the usage data information into a credit scoring model, and obtain credit scoring results for each charging user.

[0103] The credit scoring model may adopt a trained mathematical model or neural network model, or may be designed and trained according to actual conditions. In a preferred implementation of this embodiment, before inputting the usage data information into the credit scoring model, a credit scoring model is constructed based on the transaction history records and actual conditions between the charging user and the charging station.

[0104] Specifically, the construction method of the credit scoring model includes:

[0105] Obtain evaluation indicators for credit assessment;

[0106] Specifically, the evaluation indicators include payment timeliness, participation, and integrity value;

[0107] Timely payment can indicate whether the user can complete the payment of charging fees in a timely manner as stipulated in the agreement; participation is used to measure the user's activity on the charging platform, including the frequency of use of charging stations and service feedback of charging stations; integrity value is used to indicate the honesty and reliability of charging users in the supervision of charging transactions, for example, judging the integrity value of charging users based on the authenticity of the report results of the execution witness (charging user) on the violation of the charging station. In other examples of this embodiment, the designer can add other evaluation indicators or delete some evaluation indicators according to actual conditions, and this embodiment does not limit it.

[0108] Obtaining the initial weights and scoring rules of each evaluation indicator, constructing a credit scoring calculation formula based on the initial weights and scoring rules of each evaluation indicator, and obtaining a credit scoring model;

[0109] The calculation formula of credit score is S=ω1*S1+ω2*S2+ω3*S3, where S1 is the payment timeliness score, ω1 is the weight of the payment timeliness score; S2 is the participation score, ω2 is the weight of the participation score; S3 is the integrity score, ω3 is the weight of the integrity score;

[0110] Among them, i is the payment behavior frequency index, S 1i is the original score of the ith payment behavior, is the decay function of payment timeliness score, t iis the time from the ith payment behavior to the present, n1 is the total statistical time of the payment behavior. In this embodiment, the time from the ith payment behavior to the present and the total statistical time of the payment behavior can be counted in months; for example, if the total statistical time of the payment behavior n1 is 8 months, the payment behavior of the charging user within 8 months is counted to calculate the payment timeliness score of the user within these 8 months;

[0111] Among them, j is the index of the number of participation behaviors, S 2j is the raw score of the jth participation behavior, is the decay function of the engagement score, t j is the time from the jth participation behavior to the present, and n2 is the total statistical time of the participation behavior; in this embodiment, the time from the jth participation behavior to the present and the total statistical time of the participation behavior can be counted in months;

[0112] Among them, k is the index of the number of honest behaviors, S 3k is the original score of the k-th honest behavior, is the decay function of the integrity score, t k is the time from the kth honest behavior to the present, and n3 is the total statistical time of the honest behavior; in this embodiment, the time from the kth honest behavior to the present and the total statistical time of the honest behavior can be counted in units of "months";.

[0113] S120: Compare the credit score result of each charging user with the preset screening conditions. If the credit score result of the charging user meets the screening conditions, the charging user who meets the screening conditions is added to the witness pool.

[0114] Reference Figure 3 To facilitate the understanding of those skilled in the art, the construction rules of the credit scoring model are described below with reference to specific examples:

[0115] Step 101: Setting initial weights for each evaluation indicator;

[0116] For example, in some examples of this embodiment, the weight ω1 of payment timeliness is set to 0.3, the weight ω2 of participation is set to 0.3, and the weight ω3 of integrity value is set to 0.4; in other examples of this embodiment, ω1, ω2 and ω3 can be set to any positive values ​​according to actual conditions, as long as ω1+ω2+ω3=1 is satisfied, and this embodiment does not impose any restrictions.

[0117] Step 102: Setting scoring rules for evaluation indicators;

[0118] First, set an initial score and a maximum score threshold S for each evaluation indicator.max (For example, the initial scores of the three evaluation indicators can be set to 60 points, and the maximum score threshold can be set to 100 points);

[0119] For the payment timeliness score S1, the scoring rule is that the charging user will receive x1 points for each on-time payment and x2 points will be deducted for overdue payment, where x1 and x2 are both positive integers, until the payment timeliness score S1 reaches 0 points or reaches the maximum score threshold S max ; The values ​​of x1 and x2 can be set according to actual conditions, and this embodiment does not impose any restrictions.

[0120] For the participation score S2, the scoring rule is that each time a charging user uses a charging station, he / she gets y1 points, each time he / she reports a problem with the charging station, he / she gets y2 points, and a charging user who does not use the charging service for a long time (more than 1 month) will be deducted y3 points every day, where y1, y2 and y3 are all positive integers, until the participation score S2 reaches 0 points, or reaches the maximum score threshold S max ; The numerical values ​​of y1, y2 and y3 can be set according to actual conditions, and this embodiment does not impose any restrictions.

[0121] For the integrity score S3, when the charging user acts as an enforcement witness to monitor the illegal behavior of the charging station, each honest reporting behavior will be awarded z1 points, and dishonest reporting behavior will be deducted z2 points, where z1 and z2 are both positive integers, until the integrity score S3 reaches 0 points, or reaches the maximum score threshold S max ; For example, when the charging transaction smart contract uses the first verification key to verify the submitted payment data proof, if the payment data proof is valid, the smart contract executes payment-related operations; if the payment data proof is invalid, the transaction will be rejected, and the charging user will be recorded as dishonest behavior, that is, the integrity score S3 = S3-z2; the values ​​of z1 and z2 can be set according to actual conditions, and this embodiment does not impose any restrictions.

[0122] Step 103: Define the time decay function; in the preferred implementation of this embodiment, the decay factor λ is introduced so that the influence of older behaviors on the current credit score of the charging user gradually decreases, so that the credit score can fully reflect the current behavior of the charging user and improve the accuracy of the current credit score result. Each evaluation indicator has its own decay rate, among which the decay rate of the payment timeliness score is λ1, the decay rate of the participation score is λ2, and the decay rate of the integrity score is λ3. The decay rate reflects the information retention period of the behavior type corresponding to each evaluation indicator.

[0123] The general time decay function is ω(t) = e -λt , where ω(t) refers to the weight at time t; λ is the decay rate; t is the time interval from the occurrence of the charging user behavior to the present, and t is usually measured in months.

[0124] Step 104: Define the decay rate λ i In some examples of this embodiment, the following rule is adopted: With respect to payment timeliness, it is hoped that the impact of payment timeliness is reduced to 50% of the previous month, that is, Regarding engagement, the impact of engagement is reduced to 50% of the original after two months, i.e. Regarding the integrity value, we hope that the impact of the integrity value will be reduced to 50% of the original value after three months, that is, The above is just an example explanation based on a currently set scoring standard to facilitate the understanding of those skilled in the art; in the specific implementation process, the user can adjust the scoring standard according to the actual situation, thereby adjusting the values ​​of λ1, λ2 and λ3, and this embodiment does not limit it.

[0125] Step 105: Calculate the weighted score. According to the calculation formula of the credit score, in this embodiment, the calculation formula of the total credit score of the charging user is:

[0126]

[0127] Since the meaning of each parameter in the above formula has been explained before, it will not be repeated here for the sake of brevity. When the S value is greater than or equal to the preset reference value, it means that the charging user has a good credit, and the charging user is added to the witness pool as an alternative execution witness. When the S value is less than the preset reference value, the behavior of the charging user will continue to be monitored in the next cycle.

[0128] In a preferred implementation of this embodiment, the method for constructing a credit scoring model further includes:

[0129] Step 106: A dynamic adjustment mechanism is set to dynamically adjust the weight of each charging user evaluation index based on the behavior of the charging user in a preset period.

[0130] Specifically, when the user participation score increases continuously for a long time or the score reaches the maximum score threshold and is maintained for a long time, the user participation is considered to be high, and the weight ω2 of the charging user's participation score is increased, and the weight ω1 of the charging user's payment timeliness score is decreased until the preset standard is reached; in the specific implementation process, the weight of the charging user scoring index can be adjusted every month according to the behavior of the charging user; the weight adjustment cycle of each charging user scoring index in the credit scoring model can also be set according to actual needs.

[0131] The weight of each evaluation indicator is adjusted individually for each charging user, that is, the behavior weight of each charging user is different, so that the scoring result of each charging user output by the credit scoring model is more accurate.

[0132] Reference Figure 4Further, in this embodiment, the step of randomly selecting an execution witness from the witness pool includes:

[0133] S200: Obtain the registered witness set RW, the execution witness set SW, and the subsequent sequence block K of the witness pool s and the current timestamp.

[0134] S201: Initialize the seed value to 0, and generate a new block K according to the current timestamp and the subsequent sequence block K. s Generate a random seed from the hash value of each block in the blockchain;

[0135] First, make sure the current block index Id>b+K s +K c And oc≥10*N;

[0136] Among them, Id is the current block index, b is the current block, and the hash value of the current block is K s is the subsequent sequential block, i.e. K after the current block b s Blocks; K c To confirm the block, K c The number of blocks used to confirm and verify the validity and authenticity of the current block b; that is, when selecting the witness set, the current block b must have been verified by at least K c subsequent blocks have been confirmed; oc is the number of online witnesses, N is the number of required execution witness members, and the number of online witnesses oc is greater than or equal to ten times the required number of witnesses N.

[0137] By Id>b+K s +K c This condition ensures that the current block b has been confirmed by a sufficient number of subsequent blocks before generating the random seed.

[0138] Afterwards, the seed value is initialized to 0.

[0139] Then, the current timestamp currentTime is obtained and added when the seed value is initialized, which can increase the unpredictability of the seed value and thus reduce the effect of attacks.

[0140] For the subsequent sequential block K s For each block in the chain, add the hash value of each block to the seed value.

[0141] Finally, the current seed value is added to the timestamp and hashed to get a new seed value.

[0142] S202: Use the random seed to modulo the list length of the registered witness set RW to obtain a random witness index value, and determine the random witness based on the index value.

[0143] Reference Figure 5 , using the random seed to modulo the length of the list of registered witnesses RW, to obtain a random witness index value, and the steps of determining a random witness based on the index value include:

[0144] S210: Initialize the execution witness set SW to be an empty set, initialize the counter to 0, and record the value of the timer as J;

[0145] S220 initializes the loop counter to 0, and records the value of the loop counter as loopCount;

[0146] S230: Determine the size of the value J and the value N. When J is less than N, calculate the index value index=(seed+J)%len(RW), where seed is the seed value and len(RW) is the list length of the registered witness set RW;

[0147] “%” indicates the modulo operation, which uses the modulo of the seed value seed and the list length len(RW) to calculate a random index;

[0148] S240: Determine whether the witness corresponding to the index value index is online. If the random witness is online, add the witness to the execution witness set SW, increase the counter J by 1, and update the number of online witnesses oc; if the random witness is not online, directly increase the counter J by 1;

[0149] S250: Update the seed value seed=hash(seed+index+loopCount), and increase the loop counter loopCount by 1; hash(seed+index+loopCount) means performing a hash operation after adding the current seed value, index value and loop counter loopCount value;

[0150] Repeat steps S230 to S250 until the number of witnesses in the witness set SW reaches a preset value N. 。

[0151] In a preferred implementation of this embodiment, the following steps are also included before executing step S230:

[0152] Set the maximum number of loops of the loop counter loopCount, and record the maximum number of loops as maxLoops. The value of maxLoops is e, where e is a positive integer.

[0153] In this embodiment, the maximum number of loops maxLoops is set to 1000; correspondingly, step S230 includes:

[0154] When J is less than N and loopCount is less than maxLoops, calculate the index value index = (seed + J)% len(RW);

[0155] When loopCount is greater than maxLoops, it is determined whether J is less than N. If J is less than N, an abnormal warning is issued.

[0156] When updating the seed value, adding a loop counter loopCount can increase the complexity of the random seed and reduce the possibility of generating a fixed random seed.

[0157] By setting the maximum number of loops maxLoops, the number of executions of the loop from step S230 to step S250 is limited. If not enough witnesses are found within the maximum number of loops, an exception is thrown so that the user can deal with the abnormal state of the system in time and reduce the possibility of an infinite loop caused by insufficient online witnesses.

[0158] S203: Check whether the random witness corresponding to the index value is online. If the random witness is not online, reselect the random witness. If the random witness is online, add the random witness to the execution witness set SW.

[0159] Repeat steps S201 to S203 until the number of witnesses in the execution witness set SW reaches a preset value N, and set all witnesses in the execution witness set SW as execution witnesses.

[0160] Reference Figure 6 In another embodiment of the present application, the charging user encrypts the payment data before generating the payment data certificate; the charging station encrypts the charging data before generating the charging data certificate; the payment data and the charging data are both regarded as the audit data of the smart contract, and the method for encrypting the audit data includes:

[0161] Step 401: Randomly select two prime numbers m and n, satisfying gcd(mn, (m-1)(n-1)) = 1 and m and n are relatively prime, where gcd(mn, (m-1)(n-1)) represents the greatest common divisor of mn and (m-1)(n-1); let ε = m*n, ε is the first intermediate value; m and n are large prime numbers. In this embodiment, large prime numbers are prime numbers with larger exponent values.

[0162] Step 402: From the Euler function ψ(ε)=ψ(m)*ψ(n)=(m-1)(n-1), η=lcm(m-1,n-1) is obtained, where η is the second intermediate value, and lcm(m-1,n-1) represents the least common multiple of m-1 and n-1;

[0163] Step 403: Take a prime number α that is relatively prime to η, satisfying: 1<α<η and gcd(α,η)=1, where gcd(α,η) represents the greatest common divisor of α and η.

[0164] Step 404: The private key exponent δ satisfies: 1<δ<η and α*δmodη≡1, and a random integer is selected calculate Among them, λ is the third intermediate value,

[0165] Step 405: Create a key thread pool ThreadPoolExecutor key , generate two pairs of keys in parallel:

[0166] The first key pair is pk1 = (α, ε), sk1 = (δ, ε),

[0167] The second key pair is sk2=(η,λ);

[0168] Step 406: Use the private key of the first key pair to sign the public key of the second key pair to obtain σ=sign(pk2,sk1);

[0169] Step 407: randomly generate a salt value salt, and use HKDF to derive a key, the key is expressed as key = HKDF (salt, IKM, info, len (key));

[0170] Where salt is the salt value, which can be any random value or a predefined value;

[0171] HKDF is a key derivation function. HKDF is the abbreviation of HMAC-based Extract-and-Expand KeyDerivation Function, which means HMAC-based extraction and expansion key derivation function; HMAC is the abbreviation of Hash-based Message Authentication Code, which means hash message authentication code;

[0172] IKM represents the input key material, which is usually a random or pre-shared key;

[0173] info represents context information. In other examples of this implementation, info may also be application-specific information. info may be any value, even an empty string;

[0174] len(key) indicates the length of the output key.

[0175] Step 408: Use the key key to encrypt the ε value of the second pair of public keys pk2 to obtain (nounce, data, tag) = E key (key,pk2.ε);

[0176] Among them, nonce is a random number, data represents the encrypted data, tag represents the verification tag, and pk2.ε means that ε belongs to pk2.

[0177] Step 409: Use the first key pair to encrypt key and salt to obtain

[0178] Among them, key encrypted Indicates the encrypted key, salt encrypted Indicates the encrypted salt value.

[0179] Step 410: Create a message thread pool ThreadPoolExecutor message , put the audit data that needs smart contract audit in the message list messages, and use the pk2 multi-threaded encryption message list messages processed by steps 406 to 408,

[0180] Randomly select ρ to satisfy 0≤ρ<ε and have Where 0≤P<ε, C represents the encrypted message list messages.

[0181] A hybrid multi-threaded encryption method is used to protect audit data. PK2 after multiple hybrid encryptions is used for the final data encryption, making it difficult for malicious intruders to attack and obtain the encrypted data content, improving data security and reducing the possibility of data leakage during the smart contract audit process, thereby improving the security of the overall system.

[0182] In another embodiment of the present application, the V2G-based charging transaction data processing method further includes: monitoring the service behavior of the charging station.

[0183] Specifically, the execution witness monitors the service behavior of the charging station, and reports any possible violations of the charging station to the charging transaction smart contract;

[0184] According to the disclosed content of Example 1, it is known that the execution witness set SW has a total of N witnesses, and SW is divided into a reported witness set R and an unreported witness set Q, where R has M witnesses and Q has NM (ie, N minus M) witnesses.

[0185] According to Nash equilibrium analysis (witnesses only report violations when they actually detect violations, witnesses will not misreport or maliciously report violations for personal gain, and if there are no violations, the best strategy is not to report any violations) we can get:

[0186] like The charging service is confirmed to be in violation of the rules. The witnesses in the witness set R receive an economic reward P(R,Y), and each person is recorded as having committed an honest act, that is, the integrity score of the witnesses in the witness set R is S3=S3+z1. The witnesses in the witness set Q receive an economic reward P(Q,Y), and each person is recorded as having committed a dishonest act, that is, the integrity score of the witnesses in the witness set Q is S3=S3-z2.

[0187] If not satisfied Under this condition, the charging station is deemed to have not violated any regulations. The witnesses in the witness set Q receive an economic reward P(Q,N), and each person is recorded as having acted in good faith once, that is, the integrity score of the witnesses in the witness set Q is S3=S3+z1. The witnesses in the witness set R need to pay a penalty fee and receive P(R,N), and each person is recorded as having acted in bad faith once, that is, the integrity score of the witnesses in the witness set R is S3=S3-z2.

[0188] Define the revenue function: The charging station sets its own witness fee (basic income for participation), penalty fee (penalty fee for false alarms or malicious reports) and reward fee (reward for successfully reporting violations or abnormal behaviors); the witness fee is recorded as F w , and the penalty fee is recorded as F p , and the reward fee is recorded as F b ;

[0189] but

[0190]

[0191] Where S is the credit score of the current witness, S max is the maximum score threshold,

[0192] P(R,Y) means that the witness chooses to report and the violation does occur, in which case the witness receives the witness fee plus the reward fee;

[0193] P(Q,Y) means that the witness chooses not to report but the violation is confirmed, and the witness only receives the witness fee;

[0194] P(R,N) means that the witness chooses to report but the violation is not confirmed, and the witness needs to pay a penalty fee;

[0195] P(Q,N) means that the witness chooses not to report and the violation is not confirmed, and the witness only receives the witness fee.

[0196] By setting up a reward and punishment mechanism and executing a witness mechanism, witnesses are randomly selected to supervise transactions and penalties are imposed when violations are discovered, thereby maintaining the fairness and integrity of charging transactions and ensuring that the rights and responsibilities of all parties in the transaction process are balanced.

[0197] The present application also discloses an electronic device, such as Figure 7 , which is a schematic diagram of the structure of an electronic device of a method for processing charging transaction data based on V2G provided by an embodiment of the present invention. The electronic device may include at least one processor 10, a memory 11 connected to the at least one processor in communication, a communication bus 12, and a communication interface 13, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as a method program for processing charging transaction data based on V2G.

[0198] Among them, the processor 10 can be composed of an integrated circuit in some embodiments, for example, it can be composed of a single packaged integrated circuit, or it can be composed of multiple integrated circuits with the same function or different functions, including one or more central processing units (CPU), microprocessors, digital processing chips, graphics processors and various control chips. The processor 10 is the control core (Control Unit) of the electronic device, which uses various interfaces and lines to connect various components of the entire electronic device, and executes or executes the program or module stored in the memory 11 (for example, executes the charging transaction data processing method based on V2G, etc.), and calls the data stored in the memory 11 to execute various functions of the electronic device and process data.

[0199] The memory 11 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (for example, SD or DX memory, etc.), a magnetic memory, a disk, an optical disk, etc. In some embodiments, the memory 11 may be an internal storage unit of an electronic device, such as a mobile hard disk of the electronic device. In other embodiments, the memory 11 may also be an external storage device of an electronic device, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device. Furthermore, the memory 11 may also include both an internal storage unit of the electronic device and an external storage device. The memory 11 can not only be used to store application software and various types of data installed in the electronic device, such as the code of the charging transaction data processing method program based on V2G, but also can be used to temporarily store data that has been output or is to be output.

[0200] The communication bus 12 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to realize connection and communication between the memory 11 and at least one processor 10, etc.

[0201] The communication interface 13 is used for communication between the above-mentioned electronic device and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a display (Display), an input unit (such as a keyboard (Keyboard)), and optionally, the user interface may also be a standard wired interface, a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emi tt ing Diode, organic light-emitting diode) touch device, etc. Among them, the display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visualized user interface.

[0202] Figure 7 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 7 The structure shown does not constitute a limitation on the electronic device, and may include fewer or more components than shown, or combine certain components, or arrange the components differently. For example, although not shown, the electronic device may also include a power supply (such as a battery) for supplying power to each component. Preferably, the power supply may be logically connected to at least one processor 10 through a power management device, so that functions such as charging management, discharging management, and power consumption management are implemented through the power management device. The power supply may also include any components such as one or more DC or AC power supplies, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, etc. The electronic device may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.

[0203] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited by this structure.

[0204] Furthermore, if the module / unit integrated in the electronic device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile.

[0205] The embodiment of the present application provides a computer-readable storage medium, for example, including: any entity or device, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM) that can carry the computer program code. The computer-readable storage medium stores a computer program that can be loaded by a processor and execute the V2G-based charging transaction data processing method of the above embodiment.

[0206] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", "an implementation", "a preferred implementation" or "some examples" 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 representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0207] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.

Claims

1. A charging transaction data processing method based on V2G, characterized in that: Receiving a payment data certificate and a first verification key sent by a charging user; Input the payment data certificate and the first verification key into the charging transaction smart contract, and the charging transaction smart contract verifies the payment data certificate using the first verification key and outputs a first verification result; Receiving the charging data certificate and the second verification key issued by the charging station; Input the charging data certificate and the second verification key into the charging transaction smart contract, and the charging transaction smart contract verifies the charging data certificate using the second verification key and outputs the second verification result; Randomly select witnesses from the witness pool to monitor the type of the first verification result and the type of the second verification result. The types of smart contract output results include TRUE, FLASE and the third output; When the type of the first verification result and the type of the second verification result are both TRUE, the smart contract automatically executes the transaction operation; When the type of the first verification result and / or the type of the second verification result is FLASE, the smart contract automatically terminates the transaction; When the type of the first verification result and / or the type of the second verification result is the third type of output, the execution witness reports the content of the third type of output to the smart contract, and the smart contract interrupts the transaction; The steps to randomly select an execution witness from the witness pool include: S200: Obtain the registered witness set RW, the execution witness set SW, and the subsequent sequential block K of the witness pool s and the current timestamp; S201: Initialize the seed value to 0, and generate a new block K according to the current timestamp and the subsequent sequence block K. s Generate a random seed from the hash value of each block in the blockchain; S202: Using the random seed to modulo the list length of the registered witness set RW, obtain a random witness index value, and determine a random witness based on the index value; S203: Check whether the random witness corresponding to the index value is online. If the random witness is not online, reselect a random witness. If the random witness is online, add the random witness to the execution witness set SW. Repeat steps S201 to S203 until the number of witnesses in the execution witness set SW reaches a preset value N, and set all witnesses in the execution witness set SW as execution witnesses.

2. The V2G-based charging transaction data processing method according to claim 1, characterized in that: The method further comprises: Obtaining usage data information of charging users, inputting the usage data information into a credit scoring model, and obtaining a credit scoring result for each charging user; The credit score results of each charging user are compared with the preset screening conditions. If the credit score results of the charging user meet the screening conditions, the charging user who meets the screening conditions will be added to the witness pool.

3. The V2G-based charging transaction data processing method according to claim 2, characterized in that: The method also includes constructing a credit scoring model, including: Obtaining evaluation indicators for credit assessment, including payment timeliness, participation and integrity value; Obtaining the initial weights and scoring rules of each evaluation indicator, constructing a credit scoring calculation formula based on the initial weights and scoring rules of each evaluation indicator, and obtaining a credit scoring model; The calculation formula of credit score is: S = ω1*S1+ω2*S2+ω3*S3, where S1 is the payment timeliness score, ω1 is the weight of the payment timeliness score; S2 is the participation score, ω2 is the weight of the participation score; S3 is the integrity score, ω3 is the weight of the integrity score; Among them, i is the payment behavior frequency index, S 1i is the original score of the ith payment behavior, is the decay function of the payment timeliness score, λ1 is the decay rate of the payment timeliness score, t i is the time from the ith payment behavior to the present, and n1 is the total statistical time of the payment behavior; Among them, j is the index of the number of participation behaviors, S 2j is the raw score of the jth participation behavior, is the decay function of the engagement score, t j is the time from the jth participation behavior to the present; λ2 is the decay rate of the participation score, and n2 is the total statistical time of the participation behavior; Among them, k is the index of the number of honest behaviors, S 3k is the original score of the k-th honest behavior, is the decay function of the integrity score, λ3 is the decay rate of the integrity score, t k is the time from the kth honest behavior to the present, and n3 is the total statistical time of honest behavior.

4. The V2G-based charging transaction data processing method according to claim 1, characterized in that: The random seed is used to modulo the list length of the registered witness set RW to obtain a random witness index value, and the random witness is determined based on the index value, including: S210: Initialize the execution witness set SW to be an empty set, initialize the counter to 0, and record the value of the counter as J; S220: Initialize the loop counter to 0, and record the value of the loop counter as loopCount; S230: Determine the value J and the preset value N. When J is less than N, calculate the index value index=(seed+J)%len(RW), where seed is the seed value, len(RW) is the list length of the registered witness set RW, and % represents a modulo operation; S240: Determine whether the witness corresponding to the index value index is online. If the random witness is online, add the witness to the execution witness set SW and increase the counter J by 1; if the random witness is not online, directly increase the counter J by 1; S250: Update the seed value seed=hash(seed+index+loopCount), and increase the loop counter loopCount by 1; Repeat steps S230 to S250 until the number of witnesses in the witness set SW reaches a preset value N.

5. The V2G-based charging transaction data processing method according to claim 4, characterized in that: Before executing step S230, the method further includes: Set the maximum number of loops of the loop counter loopCount, and record the maximum number of loops as maxLoops. The value of maxLoops is e, where e is a positive integer. The step S230 includes: When J is less than N and loopCount is less than maxLoops, calculate the index value index = (seed + J)% len(RW); When loopCount is greater than maxLoops, determine whether J is less than N. If J is less than N, an abnormal warning is issued.

6. The V2G-based charging transaction data processing method according to any one of claims 1 to 5, characterized in that: Before generating payment data proof, the charging user encrypts the payment data or charging data; Before the charging station generates the charging data certificate, the charging data is encrypted; The payment data and charging data are both regarded as the audit data of the smart contract. The methods for encrypting the audit data include: Randomly select two prime numbers m and n, satisfying gcd(mn, (m-1)(n-1))=1 and m and n are relatively prime, where gcd(mn, (m-1)(n-1)) represents the greatest common divisor of mn and (m-1)(n-1), and let ε=m*n, where ε is the first intermediate value; From the Euler function ψ(ε)=ψ(m)*ψ(n)=(m-1)(n-1), η=lcm(m-1,n-1) is obtained, where η is the second intermediate value, and lcm(m-1,n-1) represents the least common multiple of m-1 and n-1; Take a prime number α that is relatively prime to η, satisfying: 1<α<η and gcd(α,η)=1, gcd(α,η) represents the greatest common divisor of α and η; The private key exponent δ satisfies: 1<δ<η and α*δmodη≡1, and is a random integer calculate Among them, λ is the third intermediate value, Create a key thread pool ThreadPoolExecutor key , generate two pairs of keys in parallel, The first pair of keys is pk1 = (α, ε), sk1 = (δ, ε), The second key pair is sk2=(η,λ); Sign the public key of the second key pair with the private key of the first key pair, and obtain σ=sign(pk2,sk1); Generate a salt value salt randomly, and use HKDF to derive a key. The key is expressed as key = HKDF (salt, IKM, info, len(key)), where salt is the salt value, IKM represents the input key material, info represents the context information, and len(key) represents the length of the output key; The ε value of the second pair of public keys pk2 is encrypted using the key key. The encrypted ε value is expressed as (nounce, data, tag) = E key (key,pk2.ε), where nonce is a random number, data is the encrypted data, tag is the verification tag, and pk2.ε means that ε belongs to pk2; Use the first pair of keys to encrypt key and salt, and get in, key encrypted Indicates the encrypted key, salt encrypted Indicates the encrypted salt value; Create a message thread pool ThreadPoolExecutor message , put the audit data that needs smart contract audit in the message list messages, use the processed pk2 multi-threaded encryption message list messages, randomly select ρ to satisfy 0≤ρ<ε and have Where 0≤P<ε, C represents the encrypted message list messages.

7. The V2G-based charging transaction data processing method according to claim 6, characterized in that: The charging user generates payment data proof and the first verification key through zero-knowledge proof; The charging station generates charging data proof and a second verification key through zero-knowledge proof.

8. An electronic device, characterized in that: The electronic device comprises: at least one processor (10); and, a memory (11) communicatively connected to the at least one processor (10); The memory (11) stores a computer program executable by the at least one processor (10), and the computer program is executed by the at least one processor (10) so that the at least one processor (10) can execute the V2G-based charging transaction data processing method as described in any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program; when the computer program is executed by a processor, the V2G-based charging transaction data processing method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Block chain-based V2G transaction privacy protection method, device and system

    CN111428268A

  • Consensus algorithm for delegation rights and interests certification with dynamic trust

    CN112541821A