Method for protecting energy blockchain transaction privacy using account mapping and virtual electronic stored-value cards

Through account mapping and virtual electronic stored value card technology, combined with dynamic allocation and noise addition, the problem of privacy leakage and high cost in blockchain energy transactions is solved, efficient and low-cost data privacy protection is achieved, and the blockchain is enhanced. Security and privacy of transactions.

CN113761575BActive Publication Date: 2024-08-27CHINA UNIV OF MINING & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111024828.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-02
Publication Date
2024-08-27
Estimated Expiration
2041-09-02

AI Technical Summary

Technical Problem

Traditional centralized energy trading systems have problems such as low efficiency, single points of failure and lack of privacy. Blockchain distributed trading systems are vulnerable to connection attacks and differential attacks, leading to user privacy leaks. Existing privacy protection solutions are costly and Low efficiency.

Method used

Account mapping technology and virtual electronic stored value cards are used to protect the privacy of energy transaction data on the blockchain through dynamic allocation algorithms and noise addition technology. The alliance chain HyperLedger Fabric is used to build a network to achieve account mapping and distribution of electronic stored value cards, combined with Time series analysis and Laplacian noise preserving data privacy.

Benefits of technology

Effectively prevent data mining, connection attacks and differential attacks, improve transaction efficiency, reduce transaction costs, reduce account resource consumption, enhance data privacy protection, and improve the flexibility and efficiency of privacy protection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113761575B
    Figure CN113761575B
Patent Text Reader

Abstract

The present invention discloses a method for protecting the transaction privacy of energy blockchain using account mapping electronic stored-value cards. First, the present invention uses account mapping technology to hide the transaction details and transaction trends of active users on the blockchain. The technology uses a time series analysis algorithm to dynamically generate new accounts and uses a mixture of new accounts and original accounts to achieve the purpose of hiding the association between active accounts and users and transaction details, thereby hiding the transaction trends of active users and avoiding connection attacks. Secondly, the present invention designs a virtual electronic stored-value card algorithm to hide the transaction privacy of inactive users on the blockchain. The algorithm achieves the effect of differential privacy by filling virtual electronic stored-value cards and adding Laplace noise, thereby hiding the transaction details and transaction trends of inactive users on the blockchain. The present invention effectively prevents data mining, connection attacks and differential attacks in practical applications, and protects the privacy of data stored on the blockchain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to privacy protection technology, and in particular to a method for protecting the privacy of energy blockchain transactions by using account mapping technology and electronic stored-value card algorithm. Background Art

[0002] With the maturity of renewable energy technology, energy storage technology and information technology, in order to reduce electricity costs, a self-sufficient power generation model based on communities and families has gradually been formed, and a distributed point-to-point neighboring energy trading model has also been formed. The new energy trading model has greatly expanded users' demand for energy trading and also put forward higher requirements for energy trading systems.

[0003] The traditional energy trading system manages and provides energy transactions through a centralized control center. Although the traditional centralized energy trading system is convenient for internal management and updating, it has inevitable defects: low efficiency, single point failure, lack of privacy and anonymity, etc. Using blockchain to build a distributed peer-to-peer trading system can effectively solve the shortcomings of the centralized energy trading system. Blockchain technology has the characteristics of decentralization, autonomy, traceability, and immutability. It is very suitable for distributed energy trading models with many participants, complex transaction mechanisms, and difficult transaction management. However, the open and transparent characteristics of blockchain also make the distributed energy trading system based on blockchain extremely vulnerable to connection attacks, differential attacks or data mining attacks, resulting in user privacy leakage. For example, the underlying blockchain technology only separates the association between the transaction address and the address holder. The attacker can still analyze the user's IP / ID address and the association between the public information recorded on the blockchain and the user's identity through connection attacks. In addition, based on the public information recorded in the block and other data set records, many data mining algorithms can detect the user's identity or analyze the difference in energy consumption, and use differential attack algorithms to infer the user's behavior pattern and transaction allocation pattern. Therefore, there is an urgent need to design a privacy protection scheme for energy trading systems.

[0004] Privacy protection schemes in blockchain-based transaction scenarios are mainly divided into two categories, and there are three main privacy protection technologies. Specifically, privacy protection schemes mainly focus on achieving secure and private communication and ensuring the privacy of data stored on the blockchain. In addition, the three technologies for implementing the above two types of privacy protection schemes include: elliptic curve encryption algorithm, zero-knowledge proof and noise addition technology. Among them, the use of elliptic curve encryption algorithm and zero-knowledge proof for encrypted communication in the energy transaction process can effectively prevent privacy leakage. However, in the process of information transmission, real-time and high-resolution energy usage data contains a large amount of personal sensitive information. The energy transaction trend and user energy distribution can be inferred from daily energy usage data. For the privacy protection of data stored on the blockchain, recent studies have proposed a new scheme to prevent adversarial activities by adding noise. It uses account mapping technology and electronic stored-value card methods to hide the data of energy transactions stored on the blockchain, while ensuring its performance in the blockchain system. However, this scheme will generate a large number of accounts, which will cause certain waste and increase the cost of later supervision and management. Therefore, there is still an urgent need for a feasible data privacy protection scheme with both high efficiency and low overhead. Summary of the invention

[0005] Purpose of the invention: The purpose of the present invention is to provide a method for protecting the privacy of energy blockchain transactions using account mapping and virtual electronic stored-value cards, thereby effectively preventing data mining, connection attacks and differential attacks, and protecting the privacy of data stored on the blockchain.

[0006] Technical solution: The method for protecting the privacy of energy blockchain transactions using account mapping and virtual electronic stored-value cards described in the present invention comprises the following steps:

[0007] (1) System initialization;

[0008] (2) Using a dynamic allocation algorithm to determine the stored value allocation ratio;

[0009] (3) Active data privacy protection in blockchain;

[0010] (4) Privacy protection of inactive account data in blockchain.

[0011] The step (1) is specifically:

[0012] (1.1) Electronic Stored Value Card Management Center and energy transfer stations Use the consortium chain HyperLedger Fabric to build a network;

[0013] (1.2) Energy suppliers and energy consumers Apply to join the Fabric system and The network constructed and the corresponding account information applied for;

[0014] (1.3) The Fabric system generates relevant account information and sends the Fabric account address and Sent separately to energy suppliers and energy consumers at this time and The registration is successful and you can join the target network.

[0015] The step (2) is specifically:

[0016] (2.1) Energy suppliers To energy transfer station Send a service request:

[0017]

[0018] in, for Fabric account address, for Information on energy to be sold, including the unit price of energy sold and the total amount of energy sold;

[0019] (2.2) Energy transfer station After agreeing, the energy supplier Energy to be sold Save to

[0020] (2.3) Receiving energy After that, the energy transfer station Amount of energy to be sold and the current energy exchange rate r i Electronic Stored Value Card Management Center report:

[0021]

[0022] (2.4) Electronic Stored Value Card Management Center According to the energy exchange rate i Calculate the amount of money that needs to be transferred to the target account Distribute M deposit:

[0023]

[0024] in, It is the conversion formula between energy and stored value. M is the amount of stored value, and the stored value here is used to exchange for energy. Therefore, the remaining stored value in the account actually represents the amount of energy owned by the account;

[0025] (2.5) Set each element in the inactive account with a neighboring data set and and through the operation function f, and map to the l-dimensional space: and

[0026] (2.6) Set the data sensitivity of f on to be

[0027]

[0028] where ||·|| represents the Manhattan distance, and |f| < K, where K is a data sensitivity threshold;

[0029] (2.7) Set where ave is the average monthly energy sales of all users in the most recent year. Then the algorithm for dynamically allocating energy e-stored value cards is as follows;

[0030] When W1 > 1, Randomly select δ1 ∈ (0.1, 0.5);

[0031] When W1 ≤ 1, Randomly select δ1 ∈ (0.5, 1);

[0032] When W2 > K, Randomly select δ2 ∈ (0.5, 1);

[0033] When W2 ≤ K, Randomly select δ2 ∈ (0.1, 0.5);

[0034] When W1 ≤ 1 && W2 ≤ K, Randomly select δ1 ∈ (0.5, 1), δ2 = 1 - δ1;

[0035] When W1 > 1 && W2 > K, Randomly select δ1 ∈ (0.1, 0.5), δ2 = 1 - δ1;

[0036] (2.8) Let M1 = M×δ1, M2 = M×δ2, where M1 is the stored value amount applied to the account mapping technology, and M2 is the stored value amount applied to the electronic stored value card algorithm.

[0037] The step (3) is specifically:

[0038] (3.1) Electronic Stored Value Card Management Center Accounts whose balances are in the top 30% of all user account balances this month are called active accounts. The other accounts are called inactive accounts.

[0039] (3.2) Calculate the average energy sales for the buyer's active account in the most recent month:

[0040]

[0041] Among them, Num(A a ) indicates the total number of active accounts of all buyers in the past month. Represents the total energy sales of all active buyers in the most recent month;

[0042] (3.3) calculate Average energy sales for the account in the most recent month:

[0043]

[0044] (3.4) Calculation time period Among them, m is a constant parameter related to the month;

[0045] (3.5) Introduce boundary parameter λ, maximum approximation estimate MAE and fixed constant ρ; use exponential smoothing method in time series analysis to set the distribution function for calculating boundary parameter λ

[0046]

[0047] Among them, the boundary parameter λ represents The energy upper limit value of the i-th transaction, ESP(·) is the exponential smoothing prediction function, express The energy forecast value of the ith transaction, express The actual energy value of the ith transaction, κ represents the smoothing weight and κ∈(0,1);

[0048] (3.6) calculate Total energy sales in the last i times:

[0049]

[0050] when Distribute M1 Energy Electronic Stored Value Cards to Existing accounts;

[0051] when Create a new account and randomly divide the M1 Energy e-recharge card into two parts, and then distribute them to new and existing accounts.

[0052] The step (4) is specifically:

[0053] (4.1) Electronic Stored Value Card Management Center Convert M2 Energy Electronic Stored Value Card into Virtual Electronic Stored Value Card Virtual electronic stored-value cards cannot be exchanged for energy and are only used to distribute to user accounts as energy electronic stored-value cards to increase account balances;

[0054] (4.2) Will The electronic stored-value card is randomly divided into N parts and randomly distributed to N inactive accounts A. in , where N is a random integer and N is less than A in Total number of;

[0055] (4.3) set up Accumulate the electronic stored value card, when VT≥ave, Introduce the uniform distribution function; assuming that x is uniformly distributed in the interval [a, b], the probability density function of x can be expressed as:

[0056]

[0057] (4.4) Randomly generate a set of uniformly distributed sequences ud i ={ud1,ud2,...,ud l}and

[0058] (4.5) Will ud i ={ud1,ud2,...,ud l} Arrange in ascending order into t i ={t1,t2,...,t l};

[0059] (4.6) Inactive accounts Sort by account balance in descending order

[0060] (4.7) t i ={t1,t2,...,t l} corresponds to the energy electronic stored value card sequence distributed to the account in order middle;

[0061] (4.8) Laplace noise is introduced to construct the data protection effect of differential privacy technology to achieve the purpose of protecting account data privacy. The probability density function of Laplace distribution is as follows:

[0062]

[0063] (4.9) Inactive accounts Each element in sets the neighboring dataset and And will and Mapping to l-dimensional space: and

[0064] (4.10) To the dataset and Add Laplace noise:

[0065]

[0066]

[0067] Where △f and △f' are data sensitivities and ε and ε′ are preset thresholds and T is the matrix transpose symbol, RA(·) is the random algorithm function, and Lap(·) is the Laplace distribution function;

[0068] (4.11) Use the RA(·) function to process the data set

[0069]

[0070] (4.12) set up |=(|p1-x1|,|p2-x2|,...,|p l-x l |) and convert the sequence n into an electronic stored-value card sequence

[0071] (4.13) Virtual electronic stored-value card serial number Distribute to Inactive accounts Fill the account amount in;

[0072] (4.14) Finally, the transaction account details are packaged and sent to the blockchain:

[0073]

[0074] A system for protecting the privacy of energy blockchain transactions using account mapping and electronic stored-value cards, including the following modules:

[0075] Energy Suppliers To energy transfer station Apply to sell energy and store the sold energy in an energy transfer station

[0076] Energy Consumers Electronic Stored Value Card Management Center Apply to purchase an energy electronic stored-value card that can be redeemed for energy and submit it to the energy transfer station Apply for energy redemption;

[0077] Energy transfer station Process service requests, estimate energy rates, store energy, and send credit cards to the electronic stored value card management center Reporting of energy storage and current energy exchange rates;

[0078] Electronic Stored Value Card Management Center Sell ​​and distribute energy electronic stored-value cards to users for redeeming energy.

[0079] A computer storage medium stores a computer program, which, when executed by a processor, implements the above-mentioned method of protecting the privacy of energy blockchain transactions using account mapping and electronic stored-value cards.

[0080] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the method for protecting the privacy of energy blockchain transactions using account mapping and electronic stored-value cards is implemented.

[0081] Beneficial effects: Compared with the prior art, the present invention has the following advantages:

[0082] 1. In order to solve the problems of low efficiency and single point failure of centralized trading systems, the alliance chain technology is applied to the energy trading system. The alliance chain has the characteristics of fast transaction speed, strong controllability and low transaction cost, which effectively improves the transaction efficiency and handles transaction problems more flexibly;

[0083] 2. In order to protect the data privacy of active accounts stored on the blockchain and prevent attackers from launching connection attacks to analyze and infer private information related to transaction data, the present invention predicts the boundary value through a time series analysis algorithm, and uses account mapping technology to hide the user's real transaction data based on the predicted value to protect the user's privacy;

[0084] 3. In order to protect the data privacy of inactive accounts stored on the blockchain and prevent data mining and differential attacks, this method uses the electronic stored-value card algorithm to fill data and add noise to the data to achieve differential privacy effects, protecting real transaction data while reducing account consumption costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0085] Figure 1 The following is a schematic diagram of the program flow;

[0086] Figure 2 It is the system structure diagram;

[0087] Figure 3 Schematic diagram of energy produced for solar panels;

[0088] Figure 4 It is a schematic diagram of the energy consumption of users;

[0089] Figure 5 This is a schematic diagram of the energy distribution of the initial account;

[0090] Figure 6 It is a comparison diagram of the energy distribution of the PBT scheme and the scheme of the present invention (N=20);

[0091] Figure 7 It is a comparison diagram of the energy distribution of the PBT scheme and the scheme of the present invention (N=50);

[0092] Figure 8 It is a comparison diagram of the energy distribution of the PBT scheme and the scheme of the present invention (N=200);

[0093] Fig. 9 A schematic diagram of the computational overhead of the solution described in the present invention;

[0094] Fig.10 Schematic diagram of the computational overhead of the PBT scheme. DETAILED DESCRIPTION

[0095] The technical solution of the present invention is further described below in conjunction with the accompanying drawings.

[0096] like Figure 1 As shown, the present invention discloses a method for protecting the privacy of energy blockchain transactions using account mapping and virtual electronic stored-value cards, comprising the following steps:

[0097] (1) System initialization;

[0098] (1.1) Electronic Stored Value Card Management Center and energy transfer stations Use the consortium chain HyperLedger Fabric to build a network;

[0099] (1.2) Energy suppliers and energy consumers Apply to join the Fabric system and The network constructed and the corresponding account information applied for;

[0100] (1.3) The Fabric system generates relevant account information and sends the Fabric account address and Sent separately to energy suppliers and energy consumers at this time and The registration is successful and you can join the target network.

[0101] (2) Using a dynamic allocation algorithm to determine the stored value allocation ratio;

[0102] (2.1) Energy suppliers To energy transfer station Send a service request:

[0103]

[0104] in, for Fabric account address, for Information on energy to be sold, including the unit price of energy sold and the total amount of energy sold;

[0105] (2.2) Energy transfer station After agreeing, the energy supplier Energy to be sold Save to

[0106] (2.3) Receiving energy Energy transfer station Amount of energy to be sold and the current energy exchange rate r i Report to the electronic stored value card management center :

[0107]

[0108] (2.4) Electronic stored value card management center Calculate the M stored value that needs to be distributed to the target account according to the energy exchange rate r i : Distribute M stored value:

[0109]

[0110] Among them, is the conversion formula between energy and stored value, M is the amount of stored value, and the stored value here is used to exchange energy, so the remaining stored value in the account actually represents the amount of energy owned by the account;

[0111] (2.5) Set each element in the inactive account to the adjacent data set and and map and to the l-dimensional space through the operation function f: and

[0112] (2.6) Set the data sensitivity of f on to

[0113]

[0114] Among them, ||·|| represents the Manhattan distance, and |f| < K, where K is a data sensitivity threshold;

[0115] (2.7) Set where ave is the average monthly energy sales of all users in the most recent year, and the algorithm for dynamically allocating energy electronic stored value cards is as follows;

[0116] When W1 > 1, Randomly select δ1 ∈ (0.1, 0.5);

[0117] When W1 ≤ 1, Randomly select δ1 ∈ (0.5, 1);

[0118] When W2 > K, Randomly select δ2 ∈ (0.5, 1);

[0119] When W2≤K, Randomly select δ2∈(0.1,0.5);

[0120] When W1≤1&&W2≤K, Randomly select δ1∈(0.5,1), δ2=1-δ1;

[0121] When W1>1&&W2>K, Randomly select δ1∈(0.1,0.5), δ2=1-δ1;

[0122] (2.8) Let M1 = M×δ1, M2 = M×δ2, where M1 is the stored value amount applied to the account mapping technology, and M2 is the stored value amount applied to the electronic stored value card algorithm.

[0123] (3) Active data privacy protection in blockchain;

[0124] (3.1) Electronic Stored Value Card Management Center Accounts whose balances are in the top 30% of all user account balances this month are called active accounts. The other accounts are called inactive accounts.

[0125] (3.2) Calculate the average energy sales for the buyer's active account in the most recent month:

[0126]

[0127] Among them, Num(A a ) indicates the total number of active accounts of all buyers in the past month. Represents the total energy sales of all active buyers in the most recent month;

[0128] (3.3) calculate Average energy sales for the account in the most recent month:

[0129]

[0130] (3.4) Calculation time period Among them, m is a constant parameter related to the month;

[0131] (3.5) Introduce boundary parameter λ, maximum approximation estimate MAE and fixed constant ρ; use exponential smoothing method in time series analysis to set the distribution function for calculating boundary parameter λ

[0132]

[0133] Among them, the boundary parameter λ represents The energy upper limit value of the i-th transaction, ESP(·) is the exponential smoothing prediction function, express The energy forecast value of the ith transaction, express The actual energy value of the ith transaction, κ represents the smoothing weight and κ∈(0,1);

[0134] (3.6) calculate Total energy sales in the last i times:

[0135]

[0136] when Distribute M1 Energy Electronic Stored Value Cards to Existing accounts;

[0137] when Create a new account and randomly divide the M1 Energy e-recharge card into two parts, and then distribute them to new and existing accounts.

[0138] (4) Privacy protection of inactive account data in blockchain.

[0139] (4.1) Electronic Stored Value Card Management Center Convert M2 Energy Electronic Initial Value Card into Virtual Electronic Stored Value Card Virtual electronic stored-value cards cannot be exchanged for energy and are only used to distribute to user accounts as energy electronic stored-value cards to increase account balances;

[0140] (4.2) Will The virtual electronic stored-value card is randomly divided into N parts and randomly assigned to N inactive accounts A. in , where N is a random integer and N is less than A in Total number of;

[0141] (4.3) set up Accumulate the virtual electronic stored value cards, when VT≥ave, Introduce the uniform distribution function; assuming that x is uniformly distributed in the interval [a, b], the probability density function of x can be expressed as:

[0142]

[0143] (4.4) Randomly generate a set of uniformly distributed sequences ud i ={ud1,ud2,...,ud l}and

[0144] (4.5) Will ud i ={ud1,ud2,...,ud l} Arrange in ascending order into t i ={t1,t2,...,t l};

[0145] (4.6) Inactive accounts Sort by account balance in descending order

[0146] (4.7) t i ={t1,t2,...,t l} corresponds to the energy electronic stored value card sequence distributed to the account in order middle;

[0147] (4.8) Laplace noise is introduced to construct the data protection effect of differential privacy technology to achieve the purpose of protecting account data privacy. The probability density function of Laplace distribution is as follows:

[0148]

[0149] (4.9) Inactive accounts Each element in sets the neighboring dataset and And will and Mapping to l-dimensional space: and

[0150] (4.10) To the dataset and Add Laplace noise:

[0151]

[0152]

[0153] Where △f and △f' are data sensitivities and ε and ε′ are preset thresholds and T is the matrix transpose symbol, RA(·) is the random algorithm function, and Lap(·) is the Laplace distribution function;

[0154] (4.11) Use the RA(·) function to process the data set

[0155]

[0156] (4.12) set up |=(|p1-x1|,|p2-x2|,...,|p l -x l |) and convert the sequence n into an electronic stored-value card sequence

[0157] (4.13) Virtual electronic stored-value card serial number Distribute to Inactive accounts Fill the account amount in;

[0158] (4.14) Finally, the transaction account details are packaged and sent to the blockchain:

[0159]

[0160] Embodiment 1:

[0161] The solution of the present invention is implemented on the Hyperledger Fabric 2.0 consortium chain platform. The experimental code runs on a PC with the following configuration: 3.70GHz Intel(R)Core(TM)i5-10400 CPU, 16GB memory, Ubuntu18.04. The experimental analysis mainly quantifies the performance of the security strategy through three aspects: implementation efficiency, account consumption, and whether the privacy of data stored on the blockchain can be guaranteed.

[0162] In this embodiment, the specific performance analysis is as follows:

[0163] First, we observed the energy consumption and energy production distribution of multiple neighboring users within a month. On this basis, we randomly generated three sets of data within a reasonable range for user energy production and user energy consumption as the initial data of the experiment. Figure 3-4As shown in the figure, in order to increase data diversity, three ranges are set: 20 people, 50 people and 200 people; each group of data generates data that obeys normal distribution (ND), exponential distribution (ED) and uniform distribution (UD). Among them, production data refers to the energy produced by users using solar panels, while consumption data refers to the data consumed by users to meet their daily electricity expenses. Then, according to Figure 3-4 The generated initial data sets the distribution of the original accounts, and the results are as follows Figure 5 shown.

[0164] The present invention designs two groups of comparative experiments, namely the PBT scheme in Gai's paper and the scheme proposed in the present invention. Figure 5 The energy distribution curve in the initial account is used as the comparison data of the two sets of comparative experiments. Figure 6-9 A schematic diagram showing the comparison between the account distribution curve of the scheme of the present invention and the account distribution curve of the PBT scheme. In the figure, N represents the number of users in each group, UD-our, ED-our and ND-our are the account distribution curves of the scheme of the present invention under three groups of mathematical distributions (UD, ED, ND), and UD-PBT, ED-PBT and ND-PBT represent the account distribution curves of the PBT scheme under three groups of mathematical distributions (UD, ED, ND).

[0165] The account mapping and noise adding method of the scheme of the present invention is applied to Figure 5 From the initial data, we get Figure 6 (a)-(c), Figure 7 (a)-(c), Figure 8 (a)-(c). It can be seen from the figure Figure 5 The trend of the initial data distribution curve has been completely covered, so this scheme effectively hides the specific situation of the distribution trend of the data in the blockchain account, thereby ensuring the privacy of the data stored on the blockchain to a certain extent. Figure 5 From the initial data, we get Figure 6 (d)-(f), Figure 7 (d)-(f), Figure 8 (d)-(f). It can be found from the figure Figure 5 The trend of the initial data distribution curve is also covered, so this solution can also effectively hide the distribution trend of data in the blockchain account and other specific situations, thereby ensuring the privacy of data stored on the blockchain to a certain extent.

[0166] Compare Figure 6-8 From the data distribution of the two schemes in , we can find that although both schemes hide the trend of the account energy sales distribution curve to a certain extent. Figure 8 (a)-(c) and Figure 8 (d)-(f) can be seen Figure 8 The approximate floating range of the curves (a)-(c) is: [2, 89], [1, 99], [0, 87], while the approximate floating range of the curves (d)-(f) is: [0, 100°], [0, 102], [0, 158]. This shows that this scheme makes the curve smoother and more stable, making it more difficult for attackers to infer and analyze the actual distribution curve trend through data mining algorithms, thus having a higher privacy protection effect. In addition, compared Figure 6-8 , we can see that when N=20, this scheme needs to consume 28, 25 and 25 accounts under the three distributions, while the PBT scheme needs to consume 36, 33 and 39 accounts respectively; when N=50, this scheme needs to consume 62, 63 and 61 accounts respectively, while the PBT scheme needs 85, 84 and 84 accounts respectively; when N=200, this scheme needs to consume 260, 275 and 250 accounts respectively, while the PBT scheme needs to consume 349, 381 and 360 accounts respectively. The PBT scheme consumes much more accounts than this scheme, so this scheme effectively reduces the consumption of account resources.

[0167] Fig. 9 and Fig.10 The computational cost of the scheme described in the present invention and the computational cost of the PBT scheme under three mathematical distributions are described. Fig. 9 As shown in the figure, when N=20, the average computational overhead of this scheme in the case of uniform distribution, exponential distribution and normal distribution is 74.88ms, 63.65ms, and 85.65ms respectively; when N=50, the average computational overhead of this scheme in the three mathematical distributions (UD, ED, ND) is 64.51ms, 62.29ms, and 76.82ms respectively; when N=200, the average computational overhead of this scheme in the three mathematical distributions (UD, ED, ND) is 78.01ms, 57.41ms, and 67.84ms respectively. Fig.10 As shown, the average computational overhead of the PBT scheme under uniform distribution, exponential distribution and normal distribution are: when N=20, the computational overhead is: 13.66ms, 15.37ms, 13.51ms; when N=50, the computational overhead is: 14.98ms, 16.13ms, 15.89ms; when N=200, the computational overhead is: 15.97ms, 16.06ms, 15.82ms.

[0168] From the above data, it can be seen that compared with the PBT solution, this solution actually consumes more time. This is because in order to improve the strength of data privacy protection and reduce the consumption of account resources, this solution adds an additional dynamic allocation of energy electronic stored-value card algorithm and noise addition scheme to achieve the effect of differential privacy, thereby realizing the privacy protection of data stored on the blockchain and curbing the waste of more account resources, so it consumes more time.

[0169] Embodiment 2:

[0170] like Figure 2 As shown, the present invention discloses a system for protecting the privacy of energy blockchain transactions using account mapping and electronic stored-value cards, comprising the following modules:

[0171] Energy Suppliers To energy transfer station Apply to sell energy and store the sold energy in an energy transfer station

[0172] Energy Consumers Electronic Stored Value Card Management Center Apply to purchase an energy electronic stored-value card that can be redeemed for energy and submit it to the energy transfer station Apply for energy redemption;

[0173] Energy transfer station Process service requests, estimate energy rates, store energy, and send credit cards to the electronic stored value card management center Reporting of energy storage and current energy exchange rates;

[0174] Electronic Stored Value Card Management Center Sell ​​and distribute energy electronic stored-value cards to users for redeeming energy.

[0175] Embodiment 3:

[0176] The present invention discloses a computer storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for protecting the privacy of energy blockchain transactions using account mapping and an electronic stored-value card is implemented.

[0177] Embodiment 4:

[0178] The present invention discloses a computer device, including a storage, a processor, and a computer program stored in the storage and executable on the processor. When the processor executes the computer program, the method for protecting the privacy of energy blockchain transactions using account mapping and electronic stored-value cards is implemented.

Claims

1. A method for protecting the privacy of energy blockchain transactions using account mapping and virtual electronic stored-value cards, characterized in that: The following steps are involved: (1) System initialization; specifically: (1.1) Electronic Stored Value Card Management Center and energy transfer stations Use the consortium chain HyperLedger Fabric to build a network; (1.2) Energy suppliers and energy consumers Apply to join the Fabric system and The network constructed and the corresponding account information applied for; (1.3) The Fabric system generates relevant account information and sends the Fabric account address and Sent separately to energy suppliers and energy consumers at this time and The registration is successful and you can join the target network; (2) Use a dynamic allocation algorithm to determine the stored value allocation ratio; specifically: (2.1) Energy suppliers To energy transfer station Send a service request: in, for Fabric account address, for Information on energy to be sold, including the unit price of energy sold and the total amount of energy sold; (2.2) Energy transfer station After agreeing, the energy supplier Energy to be sold Save to (2.3) Receiving energy After that, the energy transfer station Amount of energy to be sold and the current energy exchange rate r i Electronic Stored Value Card Management Center report: (2.4) Electronic Stored Value Card Management Center According to the energy exchange rate i Calculate the amount of money that needs to be transferred to the target account Distribute M deposit: in, It is the conversion formula between energy and stored value, M is the stored value amount. The stored value here is used to exchange for energy, so the stored value balance in the account actually also represents the total amount of energy in the account; (2.5) Inactive accounts Each element in sets the neighboring dataset and And through the operation function f and Mapping to l-dimensional space: and (2.6) Set f in The data sensitivity on Among them, ||·|| represents the Manhattan distance, and |f| < K, where K is a data sensitivity threshold; (2.7) set up Where ave is the average monthly energy sales of all users in the past year, the algorithm for dynamically allocating energy electronic stored-value cards is as follows; When W1>1, Randomly select δ1∈(0.1,0.5); When W1≤1, Randomly select δ1∈(0.5,1); When W2>K, Randomly select δ2∈(0.5,1); When W2≤K, Randomly select δ2∈(0.1,0.5); When W1≤1&&W2≤K, Randomly select δ1∈(0.5,1), δ2=1-δ1; When W1>1&&W2>K, Randomly select δ1∈(0.1,0.5), δ2=1-δ1; (2.8) Let M1 = M × δ1, M2 = M × δ2, M1 is the amount of stored value applied to the account mapping technology, and M2 is the amount of stored value applied to the electronic stored value card algorithm; (3) Privacy protection of active account data in the blockchain; specifically: (3.1) Electronic Stored Value Card Management Center Accounts whose balances are in the top 30% of all user account balances this month are called active accounts. The other accounts are called inactive accounts. (3.2) Calculate the average energy sales for the buyer's active account in the most recent month: Among them, Num(A a ) indicates the total number of active accounts of all buyers in the past month. Represents the total energy sales of all active buyers in the most recent month; (3.3) calculate Average energy sales for the account in the most recent month: (3.4) Calculation time period Among them, m is a constant parameter related to the month; (3.5) Introduce boundary parameter λ, maximum approximation estimate MAE and fixed constant ρ; use exponential smoothing method in time series analysis to set the distribution function for calculating boundary parameter λ Among them, the boundary parameter λ represents The energy upper limit value of the i-th transaction, ESP(·) is the exponential smoothing prediction function, express The energy forecast value of the ith transaction, express The actual energy value of the ith transaction, κ represents the smoothing weight and κ∈(0,1); (3.6) calculate Total energy sales in the last i times: when Distribute M1 Energy Electronic Stored Value Cards to Existing accounts; when Create a new account and randomly divide the M1 Energy e-recharge card into two parts. Then distribute them to new and existing accounts; (4) Privacy protection of inactive account data in the blockchain; specifically: (4.1) Electronic Stored Value Card Management Center Convert M2 Energy Electronic Stored Value Card into Virtual Electronic Stored Value Card Virtual electronic stored-value cards cannot be exchanged for energy and are only used to distribute to user accounts as energy electronic stored-value cards to increase account balances; (4.2) Will The virtual electronic stored-value card is randomly divided into N parts and randomly assigned to N inactive accounts A. in , where N is a random integer and N is less than A in Total number of; (4.3) set up Accumulate the virtual electronic stored value cards, when VT≥ave, Introduce the uniform distribution function; assuming that x is uniformly distributed in the interval [a, b], the probability density function of x can be expressed as: (4.4) Randomly generate a set of uniformly distributed sequences ud i ={ud1,ud2,...,ud l }and (4.5) Will ud i ={ud1,ud2,...,ud l } Arrange in ascending order into t i ={t1,t2,...,t l }; (4.6) Inactive accounts Sort by account balance in descending order (4.7) t i ={t1,t2,...,t l } corresponds to the energy electronic stored value card sequence distributed to the account in order middle; (4.8) Laplace noise is introduced to construct the data protection effect of differential privacy technology to achieve the purpose of protecting account data privacy. The probability density function of Laplace distribution is as follows: (4.9) Inactive accounts Each element in sets the neighboring dataset and And will and Mapping to l-dimensional space: and (4.10) To the dataset and Add Laplace noise: Where △f and △f' are data sensitivities and ε and ε′ are preset thresholds and T is the matrix transpose symbol, RA(·) is the random algorithm function, and Lap(·) is the Laplace distribution function; (4.11) Use the RA(·) function to process the data set (4.12) set up And convert the sequence n into an electronic stored-value card sequence (4.13) Serialize the virtual electronic stored-value card Distribute to Inactive accounts Fill the account amount in; (4.14) Finally, the transaction account details are packaged and sent to the blockchain: L→*:

2. A system for protecting energy blockchain transaction privacy using account mapping and virtual electronic stored-value cards, characterized in that: The system is used for a method for protecting the privacy of energy blockchain transactions using account mapping and virtual electronic stored-value cards as claimed in claim 1, comprising the following modules: Energy Suppliers To energy transfer station Apply to sell energy and store the sold energy in an energy transfer station Energy Consumers Electronic Stored Value Card Management Center Apply to purchase energy electronic deposits that can be converted into energy and pay to energy transfer stations Apply for energy redemption; Energy transfer station Process service requests, estimate energy rates, store energy, and send credit cards to the electronic stored value card management center Reporting of energy storage and current energy exchange rates; Electronic Stored Value Card Management Center Sell ​​and distribute energy electronic stored value to users for redemption of energy.

3. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements a method for protecting the privacy of energy blockchain transactions using account mapping and virtual electronic stored-value cards as described in claim 1.

4. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, it implements a method for protecting the privacy of energy blockchain transactions using account mapping and virtual electronic stored-value cards as described in claim 1.