Electric swap station energy transaction method based on smart contract and multi-party security computing

Through the combination of smart contracts and multi-party security calculations, the problem of energy management stability and data privacy protection in the face of the volatility of renewable energy in power swap stations is solved, efficient energy trading and management are achieved, and renewable energy is optimized. Utilization improves the security and scalability of the system.

CN118735520AActive Publication Date: 2024-10-01THE CHINESE UNIV OF HONG KONG (SHENZHEN)
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410738625.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-07
Publication Date
2024-10-01
Estimated Expiration
2044-06-07

AI Technical Summary

Technical Problem

When power swapping stations face the volatility and uncertainty of renewable energy, it is difficult to achieve the stability and efficiency of energy management, and the centralized system of existing technologies leads to data security and privacy protection issues, limiting the reliability and efficiency of the system. Scalability.

Method used

Using a method that combines smart contracts with multi-party secure calculations, and through the decentralized nature of blockchain technology, independent energy transactions between power swap stations are realized, the transparency and privacy of the transaction process are guaranteed, and the transaction amount is calculated through multi-party secure calculations. Ensure data privacy and transaction security.

Benefits of technology

It improves energy transaction efficiency and management efficiency between power swap stations, optimizes the use of renewable energy, reduces dependence on centralized management, protects operational data privacy, and achieves energy complementarity and green and efficient management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118735520A_ABST
    Figure CN118735520A_ABST
Patent Text Reader

Abstract

The invention discloses a battery swap station energy transaction method based on an intelligent contract and multi-party security calculation. The method comprises the following steps: S1, establishing a decision model and a solving method of a single battery swap station; s2, according to the decision model of the single battery swap station, designing a battery swap station energy transaction model, designing a distributed energy transaction solving algorithm, and realizing a corresponding intelligent contract; and S3, designing a solution algorithm based on the smart contract and multi-party security calculation. According to the battery replacing station energy transaction method based on the intelligent contract and the multi-party security calculation, the transaction efficiency and the privacy protection of the operation data of the battery replacing station are ensured, the transparency and the fairness of the transaction process are ensured, the operation privacy of the battery replacing station is effectively protected, and the user experience is improved. Therefore, transaction and payment settlement can be completed without directly sharing sensitive information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of battery swap stations, and in particular to an energy trading method for battery swap stations based on smart contracts and multi-party secure computing. Background Art

[0002] As electric vehicles become more popular as a green mode of transportation, electric vehicle battery swap stations have become a key infrastructure to support the sustainable use of electric vehicles. These stations not only provide fast battery swap services, but also reduce dependence on traditional fossil fuels, promote efficient and environmentally friendly energy utilization. However, as the number of electric vehicles increases, battery swap stations face many challenges, especially in terms of energy management and supply. Battery swap stations that combine renewable energy sources such as wind and solar are of particular interest because they help further reduce the carbon footprint of electric vehicles. Although battery swap stations combined with renewable energy sources provide an opportunity to transition to more sustainable energy consumption, this also brings new challenges.

[0003] First, the volatility and uncertainty of renewable energy bring complexity to the energy management of battery swap stations, making it difficult to accurately predict and balance energy supply and demand. Second, as the battery swap station network expands, how to effectively conduct energy trading to achieve energy complementarity and optimize costs has become an urgent problem to be solved. In addition, ensuring the security and privacy protection of the operational data of the battery swap station during energy trading is crucial to promoting trust and cooperation between battery swap stations. Existing technologies have obvious shortcomings in dealing with these challenges. Centralized energy management and trading systems are prone to data security and privacy leakage issues, limiting the reliability and scalability of the system.

[0004] The existing energy trading framework fails to fully leverage the synergy between battery swap stations, resulting in the potential of renewable energy not being fully utilized. The means to deal with the volatility and uncertainty of renewable energy are still limited, making it difficult to ensure the stability and efficiency of battery swap stations in providing high-quality battery swap services in the face of renewable energy fluctuations.

[0005] Therefore, a new solution is urgently needed to improve the efficiency of energy management of battery swap stations, ensure the stability of energy supply, and protect the privacy of the operation data of battery swap stations. The present invention proposes a battery swap station energy trading method combining smart contracts and multi-party secure computing, which aims to optimize the energy trading and management between battery swap stations. Through the collaborative work of smart contracts and multi-party secure computing, independent and efficient energy trading between battery swap stations is realized, while the privacy of the transaction process and the operation data of the battery swap station is guaranteed. The method is divided into two main stages: first, the battery swap station makes independent energy trading decisions based on its own energy demand and supply; second, the energy transaction is completed under the guidance of the smart contract. With the decentralized characteristics of blockchain technology and the immutability of data, the present invention reduces the dependence on centralized management, improves the security and fairness of energy trading, and effectively protects the operation privacy of the battery swap station. In addition, by adopting multi-party secure computing technology, the privacy of the data of all parties to the transaction is ensured without directly sharing sensitive information, and the amount to be paid by each battery swap station is accurately calculated, which ensures the security and efficiency of the transaction. The present invention can promote energy complementarity between battery swap stations, optimize the use of renewable energy, and provide an effective new solution for achieving green and efficient energy management. Summary of the invention

[0006] In order to solve the above problems, the present invention provides an energy trading method for battery swap stations based on smart contracts and multi-party secure computing. First, the energy trading method for battery swap stations combining smart contracts and multi-party secure computing: the smart contracts and multi-party secure computing are combined and applied to the energy trading and management process between battery swap stations, ensuring the efficiency of the transaction and the privacy protection of the operating data of the battery swap stations. Second, the deep integration of block chain technology: through the decentralized and tamper-proof characteristics of blockchain technology, not only the transparency and fairness of the transaction process are ensured, but also the operational privacy of the battery swap station is effectively protected, reducing the dependence on centralized management. Third, the application of advanced multi-party secure computing technology: using multi-party secure computing technology, while protecting the privacy of each battery swap station's operating data, the amount to be paid by each party is calculated, and the transaction and payment settlement are completed without directly sharing sensitive information.

[0007] To achieve the above objectives, the present invention provides a power station energy trading method based on smart contracts and multi-party secure computing, comprising the following steps:

[0008] S1. Decision model and solution method of a single battery swap station;

[0009] S2. Design the energy trading model of the power swap station based on the decision model and solution method of a single power swap station, design a distributed solution algorithm for energy trading, and implement the corresponding smart contract;

[0010] S3. Design of solution algorithm based on smart contracts and multi-party secure computing.

[0011] In step S1: the decision model and solution method of a single battery swap station include the charging and discharging management of the battery swap station, the power management of the battery swap station, the power schedule optimization problem of the battery swap station, and the transformation of the convex optimization problem. The charging and discharging management of the battery swap station includes the battery set, the charging and discharging decision variables of the battery swap station, the battery allocation decision variables of the battery swap station, the battery power constraint, the dynamic process of battery swapping, entering the battery swap station, leaving the battery swap station, the income of the battery swap station, the discharge loss and the electric vehicle compensation;

[0012] Battery Collection: For Battery Swap Stations Define that at time t, the battery of swap station i is a set In the battery swap station n, each battery is described by a vector: in represents the time when battery j arrives at the battery swap station n, Represents the time when battery j leaves the battery swap station n.

[0013] The charging and discharging decision variables of the battery swap station: The battery swap station n needs to decide the charging amount of each battery j at each time t Discharge Then the charging decision variables of battery swap station n are the set The discharge decision variables are the set When battery j is at battery swap station n, the amount of charge and discharge at each moment t cannot exceed the upper limit of charge and discharge:

[0014]

[0015] Moreover, battery j cannot be charged and discharged at the same time at each time t, so there will be the following non-convex constraints:

[0016]

[0017] Battery allocation decision variables at swap stations: At each time t, swap station n needs to decide how to allocate batteries to electric vehicles that come to swap batteries. The set of electric vehicles arriving at swap station n is To indicate that for each battery The battery swap station n decides whether to swap battery j to electric vehicle i, that is,

[0018]

[0019] in represents that battery j is replaced by electric vehicle i, otherwise battery j is not replaced by electric vehicle i. The battery allocation decision variables of the battery swap station n are the set:

[0020]

[0021] Battery capacity constraint: The efficiency of battery charging and discharging is defined as η∈(0,1). Therefore, the amount of power increased by charging battery j is The amount of electricity reduced by discharge is Then the formula for the change of battery j's charge is:

[0022]

[0023] And the power of battery j should be within the capacity of the battery at each moment:

[0024]

[0025] Dynamic battery replacement process: The dynamic battery replacement process means that the battery needs to go through the process of entering and leaving the charging station;

[0026] Entering the battery swap station: When an electric vehicle arrives at the battery swap station n for battery swap, the battery swap station n will receive the battery of the electric vehicle and use it represents the battery received by the battery swap station n at time t, then satisfy:

[0027]

[0028] In the model, when the battery arrives at the next moment of the battery swap station n, the battery starts charging and discharging operations. Therefore, the arrival time of the battery is defined as

[0029]

[0030] The battery power at the battery swap station n is equal to the power of electric vehicle i Determined

[0031]

[0032] Leaving the battery swap station: When a battery is swapped to an electric vehicle, it is defined as leaving the battery swap station. For a battery swap station n, the set of batteries leaving the battery swap station is:

[0033]

[0034] Define the battery leave time:

[0035]

[0036] The dynamic change process of the battery collection is:

[0037]

[0038] Revenue from battery swapping stations: The revenue from battery swapping stations n during the battery swapping process includes three parts: battery swapping charges, discharge losses, and compensation for electric vehicles. The battery swapping charges of battery swapping stations n are the product of the battery swapping price P and the total number of battery swapping times:

[0039]

[0040] Discharge loss: When discharging battery j When , there will be loss, the specific loss form is

[0041]

[0042] Where a1, a2>0 is the loss coefficient;

[0043] Electric vehicle compensation: Since the replaced batteries may have different capacities, the battery swap station n will compensate for the replaced batteries with insufficient capacities, defining the fully charged battery as E max , the battery capacity when replaced is The compensation form for electric vehicles is:

[0044]

[0045] Among them, a3, a4>0 are compensation coefficients.

[0046] Preferably, in step S1, the power management of the battery swap station includes the interaction between new energy and the power grid.

[0047] Preferably, in step S1, the revenue definition of the battery swap station in the power schedule optimization problem of the battery swap station includes the charging and discharging revenue, the battery compensation, and the net cost of interactively buying and selling electricity with the power grid.

[0048]

[0049] Preferably, in step S1, a greedy battery allocation strategy is defined in the convex optimization problem transformation.

[0050] Preferably, in step S2, the trading model is subject to three constraints: market clearing constraint, post-trading energy balance constraint, and incentive constraint;

[0051] Market clearing constraint: Market clearing constraint ensures that energy transactions and payment amounts between swap stations are balanced. Specifically, between any swap stations n and l, the amount of electricity purchased by n is equal to the amount of electricity sold by l.

[0052]

[0053] And the total amount paid by all the battery swap stations offset each other:

[0054]

[0055] Energy balance constraint after transaction: During the power management and transaction process of the power swap station, it is necessary to ensure the balance of power, that is, the balance between the power demand and the power obtained by all batteries;

[0056]

[0057] Incentive constraint: When the battery swap station n participates in energy trading, its profit should be higher than that when it does not participate in the transaction.

[0058] Preferably, in step S3, the smart contract is deployed using the Remix integrated development environment.

[0059] The present invention has the following beneficial effects: a model compression method is designed according to the characteristics of unsupervised domain adaptation. First, a method for energy trading in battery swap stations that combines smart contracts and multi-party secure computing: smart contracts and multi-party secure computing are combined and applied to the energy trading and management process between battery swap stations, ensuring the efficiency of the transaction and the privacy protection of the operating data of the battery swap stations. Second, deep integration of blockchain technology: through the decentralized and tamper-proof characteristics of blockchain technology, not only the transparency and fairness of the transaction process are ensured, but also the operational privacy of the battery swap stations is effectively protected, reducing dependence on centralized management. Third, the application of advanced multi-party secure computing technology: using multi-party secure computing technology, while protecting the privacy of each battery swap station's operating data, the amount to be paid by each party is calculated, and transactions and payment settlements are completed without directly sharing sensitive information.

[0060] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] Figure 1 This is an overall flow chart of an energy trading method for a power swap station based on smart contracts and multi-party secure computing according to the present invention;

[0062] Figure 2 A schematic diagram of a smart contract for a power station energy transaction method based on smart contracts and multi-party secure computing according to the present invention;

[0063] Figure 3 A schematic diagram of a smart contract for an energy trading method for a battery swap station based on smart contracts and multi-party secure computing according to the present invention. DETAILED DESCRIPTION

[0064] The technical solution of the present invention is further described below through the accompanying drawings and embodiments.

[0065] Unless otherwise defined, technical or scientific terms used in the present invention shall have the common meanings understood by one having ordinary skills in the field to which the present invention belongs.

[0066] Embodiment 1

[0067] like Figure 1-2 As shown, the present invention provides a power station energy transaction method based on smart contracts and multi-party secure computing, comprising the following steps:

[0068] S1. Decision model and solution method for a single battery swap station;

[0069] The decision-making model and solution method of a single battery swap station include the charging and discharging management of the battery swap station, the power management of the battery swap station, the power schedule optimization problem of the battery swap station, and the transformation of convex optimization problems;

[0070] Charging and discharging management of battery swap stations:

[0071] Battery Collection:

[0072] There are T moments, and the set of all moments is

[0073] There are N battery swap stations, and the corresponding set is

[0074] For battery swap stations We define the battery j of the battery swap station n as the set at time t.

[0075] In the battery swap station n, each battery is described by a vector:

[0076] in, represents the time when battery j arrives at the battery swap station n, Represents the time when battery j leaves the battery swap station n.

[0077] Battery swap station charging and discharging decision variables:

[0078] The battery swap station n needs to determine the charge level of each battery j at each time t Discharge Then the charging decision variables of battery swap station n are the set The discharge decision variables are the set

[0079] When battery j is at battery swap station n, the amount of charge and discharge at each moment t cannot exceed the upper limit of charge and discharge:

[0080]

[0081] Moreover, battery j cannot be charged and discharged at the same time at each time t, so there will be the following non-convex constraints:

[0082]

[0083] Battery allocation decision variables for battery swap stations:

[0084] At each time t, the battery swap station n needs to decide how to allocate batteries to the electric vehicles that come to swap batteries. To express.

[0085] Specifically, for each battery The battery swap station n decides whether to swap battery j with electric vehicle i.

[0086] Right now

[0087]

[0088] in, represents that battery j is replaced by electric vehicle i, otherwise battery j is not replaced by electric vehicle i. The battery allocation decision variables of battery swap station n are the set Battery allocation needs to satisfy the following two constraints:

[0089] Battery allocation exclusivity: Each battery can only be allocated to no more than one electric vehicle:

[0090]

[0091] Battery replacement service guarantee: Each electric vehicle that arrives will be assigned a battery:

[0092]

[0093] Battery power limit:

[0094] Define the efficiency of battery charging and discharging as η∈(0,1), so the amount of electricity increased by charging battery j is The amount of electricity reduced by discharge is Then the formula for the change of battery j's charge is:

[0095]

[0096] And the power of battery j should be within the capacity of the battery at each moment:

[0097]

[0098] Dynamic process of battery replacement:

[0099] The dynamic battery replacement process means that the battery needs to go through the process of entering and leaving the charging station.

[0100] Entering the battery swap station: When the electric vehicle arrives at the battery swap station n for battery swap, the battery swap station n will receive the battery of the electric vehicle. represents the battery received by the battery swap station n at time t, then satisfy:

[0101]

[0102] In the model, when the battery arrives at the next moment of the battery swap station n, the battery starts charging and discharging. Therefore, we define the arrival time of the battery as

[0103]

[0104] The battery power at the battery swap station n is equal to the power of electric vehicle i determined;

[0105]

[0106] Leaving the battery swap station: When a battery is swapped to an electric vehicle, it is defined as leaving the battery swap station. For a battery swap station n, the set of batteries leaving the battery swap station is:

[0107]

[0108] Therefore, the battery leave time is defined as follows:

[0109]

[0110] The dynamic change process of the battery collection is:

[0111]

[0112] Revenue from battery swapping stations: The revenue from battery swapping stations n in the process of providing battery swapping includes three parts: battery swapping fees, discharge losses, and compensation for electric vehicles. The battery swapping fees of battery swapping stations n are the product of the battery swapping price P and the total number of battery swapping times:

[0113]

[0114] Discharge loss:

[0115] Discharging the battery When , there will be loss. The specific loss form is

[0116]

[0117] Among them, a1, a2>0 are loss coefficients.

[0118] Electric vehicle compensation:

[0119] Since the replaced batteries may have different capacities, the swap station n will compensate for the replaced batteries with insufficient capacities. We define the fully charged battery as E max, the battery capacity when replaced is The compensation form for electric vehicles is:

[0120]

[0121] Among them, a3, a4>0 are compensation coefficients.

[0122] Power management of battery swap stations:

[0123] The energy for the battery swap station comes from both new energy and the power grid.

[0124] New energy: Each battery swap station n is equipped with either solar power generation or wind power generation. The power generation of new energy at time t is and is a random variable and is not controlled by the battery swap station n.

[0125] Solar power generation: We use α n ≥0 represents the solar power installed capacity of the battery swap station n, represents the solar power generation per unit installed capacity, and is a random variable. Then the solar power generation is:

[0126]

[0127] Wind power generation: We use β n ≥0 represents the wind power installed capacity of the battery swap station n. represents the wind power generation per unit installed capacity, and is a random variable. Then the wind power generation is:

[0128]

[0129] Then the total amount of new energy power generation of each battery swap station n is the sum of solar power generation and wind power generation:

[0130]

[0131] Grid interaction: Each battery swap station n needs to decide how much power to purchase from the grid at each time t and the amount of electricity sold The amount of electricity purchased and sold needs to satisfy the following non-negative constraints:

[0132]

[0133] In addition, during the power management process of the battery swap station, it is necessary to ensure the balance of power, that is, the balance between the power demand and the power obtained by all batteries:

[0134]

[0135] Define the purchase decision variables of the power swap station n as a set The decision variables for selling electricity are the set At each time t, the electricity price is defined as The electricity price is defined as The net cost of electricity exchange between power station n and the power grid is:

[0136]

[0137] Electricity schedule optimization problem of battery swap station:

[0138] The battery swap station n needs to optimize its electricity schedule to maximize its profits.

[0139] The revenue definition of battery swap station n includes charging and discharging revenue, battery compensation, and the net cost of interactively buying and selling electricity with the power grid.

[0140]

[0141] Then the power schedule optimization of the battery swap station n is:

[0142]

[0143] Since the battery allocation decision variable z n , Problem (25) is an integer programming problem, which is difficult to solve directly. And due to the existence of non-convex constraint (3), the difficulty of solving Problem (25) is further increased. Therefore, we need to transform this problem into a convex optimization problem for solution.

[0144] Convex optimization problem transformation:

[0145] To solve problem (25), we define a greedy battery allocation strategy and remove constraint (3), thus simplifying the problem:

[0146] Greedy battery allocation strategy: We consider allocating the battery with the largest power to the electric vehicle that comes to replace the battery. The specific strategy is as follows:

[0147] Maximizing battery capacity: For each battery j, we calculate its maximum capacity, that is, from the time of arrival Start by charging the battery at the maximum charge rate until the battery reaches the maximum charge level. The specific formula is as follows:

[0148]

[0149] High-capacity battery selection: We select a high-capacity battery collection The battery with the largest capacity is included. The number of batteries selected is equal to the number of electric vehicles that arrive, so that these batteries can meet the needs of electric vehicle battery replacement.

[0150]

[0151] Power Constraint: We need to ensure that the power of the selected battery can reach its maximum level. This constraint is expressed as:

[0152]

[0153] Battery allocation: We allocate high-power batteries to electric vehicles that arrive at the battery swap station for battery swapping in order. We represent the high-power battery set and the electric vehicle set as:

[0154]

[0155] Then the battery allocation decision variables satisfy the following constraints:

[0156]

[0157] In addition, we remove the non-convex constraint (3), and the optimization problem is:

[0158]

[0159] And we prove the following theorem: The optimal solutions of Problem (25) and Problem (32) are the same.

[0160] Therefore, we can obtain the optimal solution to the original problem (18) by solving the convex optimization problem (19).

[0161] S2. Design the energy trading model of the power swap station based on the decision-making model of a single power swap station, design a distributed algorithm for solving energy transactions, and implement the corresponding smart contract;

[0162] Energy trading model of battery swap station:

[0163] We consider trading energy between battery swap stations to maximize the total revenue of all battery swap stations.

[0164] Trading variables: At time t, each battery swap station n trades energy with battery swap station l, and the energy trading volume is expressed as Indicates. represents that the power swap station n buys energy from l, and vice versa, it sells energy. Therefore, the energy transaction variable set of power swap station n is After the energy transaction, the amount paid by the exchange station n to the system is π n It means that when π n >0 represents the amount paid by battery swap station n to the system.

[0165] Transaction constraints: The transaction model is subject to three constraints: market clearing constraints, post-transaction energy balance constraints, and incentive constraints.

[0166] Market clearing constraint: Market clearing constraint ensures that energy transactions and payment amounts between swap stations are balanced. Specifically, between any swap stations n and l, the amount of electricity purchased by n is equal to the amount of electricity sold by l:

[0167]

[0168] And the total amount paid by all the battery swap stations offset each other:

[0169]

[0170] Energy balance constraint after transaction: During the power management and transaction process of the power swap station, it is necessary to ensure the balance of power, that is, the balance of power demand and power obtained by all batteries:

[0171]

[0172] Incentive constraint: When the battery swap station n participates in energy trading, its income should be higher than that when it does not participate in the transaction. We define the income of the battery swap station n after participating in energy trading as:

[0173] V n (x n ,y n ,z n ,b n ,q n ,β n ,π n )=U n (x n ,y n ,z n ,b n ,q n )-π n . (36)

[0174] Therefore, the incentive constraint can be defined as:

[0175]

[0176] in, Satisfies the following relationship:

[0177]

[0178] Trading mechanism design: The goal of the trading mechanism is to maximize the total revenue of all battery swap stations:

[0179]

[0180] in Then the transaction mechanism design problem can be modeled as follows:

[0181]

[0182] S3. Design of solution algorithm based on smart contracts and multi-party secure computing:

[0183] Design an algorithm based on smart contracts and multi-party secure computing to solve problem (39), so as to maximize the total revenue of all battery swap stations under the premise of privacy protection.

[0184] Solution for energy transaction volume β based on smart contracts: We define auxiliary variables:

[0185] The auxiliary variables transform the original market clearing constraint (20) into the following two constraints:

[0186]

[0187] Furthermore, we introduce the dual variable and the penalty variable ρ>0.

[0188] An iterative distributed algorithm is proposed to solve the energy trading volume β. In each iteration, given the auxiliary variables and dual variables, each battery swap station first solves its own trading problem, and then each battery swap station submits the solution of its own trading problem to the algorithm, and the algorithm then uniformly optimizes the auxiliary variables and dual variables. The process of the kth iteration is as follows:

[0189] Solving the transaction problem of battery swap stations: the algorithm provides auxiliary variables from the previous iteration and the dual variable λ(k-1), then each swap station i solves the following problem:

[0190]

[0191] After solving problem (42), the swap station i submits the result of its transaction variable β n (k) Give the algorithm.

[0192] The algorithm updates the auxiliary variables and dual variables: The algorithm updates the auxiliary variables and dual variables according to the following formula:

[0193]

[0194] Algorithm 1 outlines the solution to the energy trading volume β based on smart contracts.

[0195] Algorithm 1 Solution of energy transaction volume β based on smart contract

[0196] 1: Solution initialization: Initialize the number of iterations k = 0, the error tolerance ∈ = 0.01, the penalty term ρ = 1, and initialize the auxiliary variables and the dual variable λ(0)=0

[0197] 2: repeat

[0198] 3: Update the number of iterations: k = k + 1.

[0199] 4: for all battery swap stations n:

[0200] 5: Let the swap station n solve problem (31) and convert the result β n (k) Submit to this algorithm

[0201] 6: end for

[0202] 7: Update according to formulas (32) and (33) and the dual variable λ(k)

[0203] 8: until the termination condition is met:

[0204] 9: Termination iteration number k * =k.

[0205] The running result of Algorithm 1 is expressed as

[0206]

[0207] Solution of the payment amount π based on multi-party secure computing: We propose Algorithm 2 to calculate the payment amount of the battery swap station. In the operation of Algorithm 2, multi-party secure computing algorithm 3 is applied to ensure that the privacy information of the battery swap station is not leaked.

[0208] Algorithm 2 outlines the solution for the payment amount π:

[0209] Algorithm 2: Solution of payment amount π based on multi-party secure computation

[0210] 1: The exchange station n calculates the amount of its revenue reduction during the energy trading process With the increase in

[0211]

[0212] 2: All battery swap stations use the multi-party secure computing algorithm 3 to calculate the amount of reduction in the total revenue of all battery swap stations ψ dec (k * ) and the increase in inc (k * ):

[0213]

[0214] 3: for all battery swap stations n:

[0215] 4: Payment amount π of battery swap station n n (k * )for:

[0216]

[0217] 5: end for

[0218] Define p as a large prime number (generally 160 bits), and Algorithm 3 outlines the multi-party secure computation algorithm:

[0219] Algorithm 3 Multi-party secure computing algorithm

[0220] 1: Input: (all battery swap stations are known), (ψ n ) Only the battery swap station n is known)

[0221] Output:

[0222] 2: for all battery swap stations n:

[0223] 3: The swap station n generates N integers, expressed as where π n,1 =ψ n , the remaining integers are random integers. These integers are used as polynomials h n The coefficients of (ξ), the polynomial h n The number of (ξ) is N-1 times, and its formula is:

[0224] h n (ξ)=(π n,1 +π n,2 ξ+π n,3 ξ 2 +...+π n,N ξ N-1 )mod p. (50)

[0225] 4: The swap station n calculates the share ψ of each swap station l n,l , calculated as ψ n,l =h n (l).

[0226] 5: Station n sends a copy of station l’s ψ through a point-to-point communication channel n,l , to ensure that other swap stations do not know ψ n,l .

[0227] 6: end for

[0228] 7: for all battery swap stations n:

[0229] 8: The swap station n sums all the shares it has received and the shares it holds:

[0230]

[0231] 9: end for

[0232] 10: Calculate ψ of all battery swap stations n The sum of:

[0233]

[0234] Smart contract design:

[0235] According to the proposed algorithm, a blockchain-based smart contract is designed. We use the Remix integrated development environment to deploy smart contracts, which is a platform widely used for Ethereum development. Figure 3 As shown in Figure 2, our smart contract user interface on the Remix platform is designed to simplify the process of solving problem P1 for the power swap station. In each iteration k of solving P1, each power swap station submits its energy trading decision through the “energyTradingDecision” function, as Figure 3 As shown. Next, the smart contract updates the auxiliary variables and dual variables. Each battery swap station can use the "getAuxiliaryVariables" and "getDualVariables" functions to obtain the updated values ​​of these variables, respectively, as shown in the figure. After iteration k is completed, each battery swap station can verify whether the iteration has reached convergence by accessing the "isIterationComplete" function. This structured process enables the smart contract to effectively help the battery swap station solve problem P1 without leaking the privacy information of the battery swap station. After solving P1, the battery swap station can use the "SMPCsubmission" function to run the multi-party secure computing algorithm to solve the payment amount.

[0236] Therefore, the present invention adopts the above-mentioned energy trading method for battery swap stations based on smart contracts and multi-party secure computing, and designs a model compression method based on the characteristics of unsupervised domain adaptation. First, the energy trading method for battery swap stations combining smart contracts and multi-party secure computing: combining smart contracts with multi-party secure computing and applying them to the energy trading and management process between battery swap stations, ensuring the efficiency of the transaction and the privacy protection of the battery swap station operation data.

[0237] Second, the deep integration of blockchain technology: Through the decentralized and tamper-proof characteristics of blockchain technology, not only the transparency and fairness of the transaction process are ensured, but also the operational privacy of the battery swap station is effectively protected, reducing dependence on centralized management.

[0238] Third, the application of advanced multi-party secure computing technology: Utilizing multi-party secure computing technology, while protecting the privacy of each battery swap station’s operating data, the amount that each party needs to pay is calculated, enabling transactions and payment settlements to be completed without directly sharing sensitive information.

[0239] In order to make the purpose, technical scheme and advantages disclosed in the embodiments of the present invention clearer, the embodiments of the present invention are further described in detail in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the embodiments of the present invention and are not intended to limit the embodiments of the present invention. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application. Examples of the embodiments are shown in the accompanying drawings, where the same or similar reference numerals throughout represent the same or similar elements or elements with the same or similar functions.

[0240] It should be noted that the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or server that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or inherent to these processes, methods, products or devices.

[0241] Like reference numerals and letters denote similar items in the following drawings, and thus, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

Claims

1. A method for energy trading in power stations based on smart contracts and multi-party secure computing. It is characterized in that The following steps are involved: S1. Decision model and solution method of a single battery swap station; S2. Design the energy trading model of the power swap station based on the decision model and solution method of a single power swap station, design a distributed solution algorithm for energy trading, and implement the corresponding smart contract; S3. Design of solution algorithm based on smart contracts and multi-party secure computing. In step S1: the decision model and solution method of a single battery swap station include the charging and discharging management of the battery swap station, the power management of the battery swap station, the power schedule optimization problem of the battery swap station, and the transformation of the convex optimization problem. The charging and discharging management of the battery swap station includes the battery set, the charging and discharging decision variables of the battery swap station, the battery allocation decision variables of the battery swap station, the battery power constraint, the dynamic process of battery swapping, entering the battery swap station, leaving the battery swap station, the income of the battery swap station, the discharge loss and the electric vehicle compensation; Battery Collection: For Battery Swap Stations Define that at time t, the battery of swap station i is a set In the battery swap station n, each battery is described by a vector: in represents the time when battery j arrives at the battery swap station n, Represents the time when battery j leaves the battery swap station n. The charging and discharging decision variables of the battery swap station: The battery swap station n needs to decide the charging amount of each battery j at each time t Discharge Then the charging decision variables of battery swap station n are the set The discharge decision variables are the set When battery j is at battery swap station n, the amount of charge and discharge at each moment t cannot exceed the upper limit of charge and discharge: Moreover, battery j cannot be charged and discharged at the same time at each time t, so there will be the following non-convex constraints: Battery allocation decision variables at swap stations: At each time t, swap station n needs to decide how to allocate batteries to electric vehicles that come to swap batteries. The set of electric vehicles arriving at swap station n is To indicate that for each battery The battery swap station n decides whether to swap battery j to electric vehicle i, that is, in represents that battery j is replaced by electric vehicle i, otherwise battery j is not replaced by electric vehicle i. The battery allocation decision variables of the battery swap station n are the set: Battery capacity constraint: The efficiency of battery charging and discharging is defined as η∈(0,1). Therefore, the amount of power increased by charging battery j is The amount of electricity reduced by discharge is Then the formula for the change of battery j's charge is: And the power of battery j should be within the capacity of the battery at each moment: Dynamic battery replacement process: The dynamic battery replacement process means that the battery needs to go through the process of entering and leaving the charging station; Entering the battery swap station: When an electric vehicle arrives at the battery swap station n for battery swap, the battery swap station n will receive the battery of the electric vehicle and use it represents the battery received by the battery swap station n at time t, then satisfy: In the model, when the battery arrives at the next moment of the battery swap station n, the battery starts charging and discharging operations. Therefore, the arrival time of the battery is defined as The battery power at the battery swap station n is equal to the power of electric vehicle i Determined Leaving the battery swap station: When a battery is swapped to an electric vehicle, it is defined as leaving the battery swap station. For a battery swap station n, the set of batteries leaving the battery swap station is: Define the battery leave time: The dynamic change process of the battery collection is: Revenue from battery swapping stations: The revenue from battery swapping stations n during the battery swapping process includes three parts: battery swapping charges, discharge losses, and compensation for electric vehicles. The battery swapping charges of battery swapping stations n are the product of the battery swapping price P and the total number of battery swapping times: Discharge loss: When discharging battery j When , there will be loss, the specific loss form is where a 1 , a 2 >0 is the loss coefficient; Electric vehicle compensation: Since the replaced batteries may have different capacities, the battery swap station n will compensate for the replaced batteries with insufficient capacities, defining the fully charged battery as E max , the battery capacity when replaced is The compensation form for electric vehicles is: where a 3 , a 4 >0 is the compensation coefficient.

2. According to claim 1, a power station energy trading method based on smart contracts and multi-party secure computing, It is characterized in that In step S1, the power management of the battery swap station includes the interaction between new energy and the power grid.

3. According to claim 1, a power station energy trading method based on smart contracts and multi-party secure computing, It is characterized in that In step S1, the revenue definition of the battery swap station in the power schedule optimization problem of the battery swap station includes the charging and discharging revenue, battery compensation, and the net cost of interactively buying and selling electricity with the power grid.

4. According to claim 1, a method for energy trading in a power station based on smart contracts and multi-party secure computing, It is characterized in that In step S1, a greedy battery allocation strategy is defined in the convex optimization problem transformation.

5. According to claim 1, a power station energy trading method based on smart contracts and multi-party secure computing, It is characterized in that In step S2, the trading model is subject to three constraints: market clearing constraint, post-trading energy balance constraint, and incentive constraint; Market clearing constraint: Market clearing constraint ensures that energy transactions and payment amounts between swap stations are balanced. Specifically, between any swap stations n and l, the amount of electricity purchased by n is equal to the amount of electricity sold by l: And the total amount paid by all the battery swap stations offset each other: Energy balance constraint after transaction: During the power management and transaction process of the power swap station, it is necessary to ensure the balance of power, that is, the balance between the power demand and the power obtained by all batteries; Incentive constraint: When the battery swap station n participates in energy trading, its profit should be higher than that when it does not participate in the transaction.

6. According to claim 1, a method for energy trading in a power station based on smart contracts and multi-party secure computing, It is characterized in that In step S3, the smart contract is deployed using the Remix integrated development environment.

Citation Information

Patent Citations

  • Electric vehicle charging electric energy transaction method based on block chain technology

    CN111091224A

  • Hierarchical contract model construction method and device for virtual power plant value network

    CN115689091A

  • Multi-agent transaction method considering generalized energy storage of charging station

    CN117522441A

  • Charging and discharging and battery swap optimization method of battery swap station, storage medium and terminal equipment

    CN117829881A

  • Electronic device including housing and manufacturing method of housing

    KR1020240154405A