Privacy-Cost Trade-offs in Smart Electricity Metering Systems

: Trade-offs between privacy and cost are studied for a smart grid consumer, whose electricity consumption is monitored in almost real time by the utility provider (UP) through smart meter (SM) readings. It is assumed that an electrical battery is available to the consumer, which can be utilized both to achieve privacy and to reduce the energy cost by demand shaping. Privacy is measured via the mean squared distance between the SM readings and a target load proﬁle, while time-of-use (ToU) pricing is considered to compute the cost incurred. The consumer can also sell electricity back to the UP to further improve the privacy-cost trade-off. Two privacy-preserving energy management policies (EMPs) are proposed, which differ in the way the target load proﬁle is characterized. A more practical EMP, which optimizes the energy management less frequently, is also considered. Numerical results are presented to compare the privacy-cost trade-off of these EMPs, considering various privacy indicators.


Introduction
Smart meters (SMs) are pivotal components of the smart grid, because they enable two-way communication between each household and the utility provider (UP), the entity that sells energy to consumers. Benefits include having more accurate electricity bills, detecting energy theft and outages faster, introducing time-of-use (ToU) tariffs to match demand with available resources, integrating microgeneration systems, e.g., photovoltaic panels and wind farms, and residential energy storage solutions, and the possibility for the consumers to sell energy to the grid. For these reasons, the SM rollout is proceeding rapidly and is attracting considerable investments. However, an SM's ability to monitor a user's electricity consumption in almost real-time entails serious implications about consumer privacy. In fact, non-intrusive appliance load monitoring techniques are able to distinguish the power signatures of specific appliances from aggregated household SM measurements, revealing sensitive information about a consumer's life, such as her presence at home, religious beliefs and disabilities [1,2]. SM privacy is also critical for businesses, e.g., factories and data centers, as power consumption data may reveal information about the state of their businesses.

Privacy-Aware SM Techniques
Privacy-preserving methods for SMs can be classified into two families. Firstly, the smart meter data manipulation (SMDM) family [3], encompasses methods that modify SM measurements before reporting them to the UP, and includes data obfuscation [4], aggregation [5], anonymization [6], down-sampling [7], and data-sharing prevention [8] approaches. However, these techniques suffer from several shortcomings [3]. First, obfuscation approaches add noise to the SM readings, causing a mismatch between the reported values and the real energy consumption, which prevents distribution systems operators (DSOs), i.e., the entities that operate and manage the grid, and UPs from accurately monitoring the grid state. Second, anonymization and aggregation techniques that include the presence of a trusted third party (TTP) only shift the problem of trust from one entity (UP/DSO) to another (TTP). Third, DSOs, UPs, or more generally any eavesdropper can embed additional sensors right outside a household or a business to monitor the energy consumption, without fully relying on SM readings. The second family of privacy-preserving approaches, called the user demand shaping (UDS) family [3], overcomes these issues by modifying the consumer's actual electricity consumption, called the user load, rather than the data sent to the UP. This is achieved by exploiting physical resources, e.g., rechargeable batteries (RBs) or renewable energy sources (RESs), making the user load as different as possible from the SM measurements, called the grid load [9][10][11]. However, UDS techniques may require an initial investment by the user as physical resources need to be installed at the user's premises. Using RBs for privacy preservation may also lead to a quicker physical degradation of RBs [12]. Moreover, cost of energy may increase when providing privacy via some UDS approaches. Hence, it is important to consider these aspects when considering UDS techniques for privacy preservation.
In this paper, we adopt UDS techniques because they report the energy taken from the grid accurately, and employ physical resources, e.g., RBs and RESs, which are becoming increasingly available to the consumers. Our aim is to jointly minimize the information leaked about a user and the cost of electricity. While a widely accepted definition of privacy is elusive, privacy is achieved when it is not possible to distinguish a specific appliance load from the aggregated household energy consumption [9]. Statistical techniques measure privacy loss by the mutual information between the user and the grid loads [10,11,[13][14][15][16][17], or by computing approximations of it [18]; however, this requires the knowledge of the underlying statistics, and the results are typically valid under various simplifications, e.g., assuming independent and identically distributed user load, and over sufficiently long time horizons. An alternative approach is based on the idea that a high degree of privacy can be achieved by flattening the power consumption around a target load profile, e.g., minimizing the distance from a completely private profile [10], [19][20][21]. The target load profile can be set to be a constant value over time, typically equal to the average consumption [10,19,20]. In this model, it is assumed that the energy management unit (EMU), i.e., the system that implements the privacy-preserving energy management policy (EMP) at the user's premises, knows, or, accurately predicts, the load profile for the time period of interest, and obtains the optimal EMP by solving an optimization problem. On the other hand, a completely constant consumption may not be practically viable or desirable, since the energy cost may vary greatly during the system operation due to ToU tariffs. Hence, in [21] the EMU is allowed to target a different fixed power value for each price period. The flexibility of the latter approach leads to a better overall privacy-cost trade-off; however, such a piecewise constant target profile implies also an inherent information leakage compared to a constant target profile. We follow up on [10] and [19][20][21], and measure the privacy leakage as the squared distance between the grid and target load profiles; however, differently from those works, we consider a more general target load profile, and assume that the consumer has only a partial knowledge of her future energy consumption and energy cost. We note that privacy leakage may be measured as the distance between grid and user loads. However, if the aim is to increase such distance, this might lead to a potentially deterministic strategy for the EMU, e.g., produce a low grid load when the user load is high and vice-versa. Since we also assume that the UP knows the optimal strategy implemented by the EMU, such a strategy would result in a better estimate of the user load by the UP. On the contrary, trying to match the grid load to a specific target profile would make it harder to estimate the user load, e.g., flattening the grid load independent of the user load reveals only the average energy consumption.
The main contributions of this paper are as follows: 1. While full information about the future electricity consumption is assumed to be available at the EMU in [10] and [21], which we call the long horizon model (LHM), here we consider a more realistic scenario whereby the consumer's future consumption profile is only partially known to the EMU in a receding horizon manner, which we call the short horizon model (SHM). The optimal solution at any time is computed only based on the currently available information within the prediction horizon by adopting a model predictive controller, recently implemented in an SM setting in [14]. We present a detailed comparison of the results for SHM and LHM. 2. We introduce a target load profile computed as a low-pass filtered version of the user load, since higher-frequency components of a user's consumption profile leak more information about her behaviour, compared to lower-frequency components. To the authors' knowledge, this is the first time that such a target profile has been studied in the SM privacy-preservation literature. 3. We propose a more practical EMP that updates the optimal strategy less frequently. The optimal solution is computed in batch, reducing the computational load at the expense of the privacy-cost trade-off. Finally, we compare the privacy-cost trade-offs for all the schemes using real consumption and pricing data.
The remainder of this paper is organized as follows. In Section 2 we present the system model, while in Sections 3 and 4 we consider the SHM for a constant and a filtered target load profile, respectively. A more practical EMP with less regular policy updates is analyzed in Section 5, while conclusions are drawn in Section 6.

Notation
1 . The positive part [x] + is equal to x if x > 0, and 0 otherwise. When solving optimization problems, we denote the optimal value of a variable with a star, e.g., G * denotes the optimal value of the parameter G.

System Model
We consider the discrete time system depicted in Fig. 1, where t represents one time slot (TS) of duration D seconds, for 1 ≤ t ≤ N , where N is the time horizon of interest. For TS t, the user load, i.e., the total power requested by all the household appliances within TS t, is denoted by U t ∈ U, while the grid load is G t ∈ G. We remark that the TSs in our model correspond to time instants when the electricity is actually requested by the user and drawn from the grid, rather than the typically longer sampling interval used for sending SM measurements to the UP. We assume that the SM measures and records the output power values at each TS because our aim is to protect consumers' privacy not only from the UP, but also from the DSO or any other attacker that may deploy a sensor on the consumer's power line recording the electricity consumption in almost real-time. An RB of capacity Bmax is installed at the user's premises, which is used to both filter the user load to provide privacy, and to shift energy intake from the grid to minimize electricity costs. The EMU computes the amount of energy to draw from the grid, G t , and to exchange with the RB, U t − G t . Let B t ∈ [0, Bmax] denote the amount of energy in the RB at the end of TS t, and we set B 0 = 0. The RB is charging if G t − U t ≥ 0, and discharging otherwise. The user's electricity consumption and the electricity price are assumed to be known for H F TSs beyond the current TS, naming H F as the prediction horizon. Additionally, we assume that the EMU keeps memory about the past H P TSs, which we call the past horizon. At each TS t, the EMU computes an EMP for the following H F TSs, using its knowledge of U t and the electricity cost within the prediction horizon, and its knowledge of the user load, grid load, and the RB level of energy within the past horizon. Instead of the LHM scenario, where full information about a consumer's future energy consumption is assumed to be known over the whole time period of interest, in this paper, we consider a more realistic scenario and assume that only partial knowledge of the consumer's future energy consumption is available to the EMU. The SHM assumption is motivated by the difficulty in obtaining reliable longer term predictions of a consumer's energy consumption.

System Constraints
Let t + H F min{t + H F , N }. We do not allow wasting grid energy; that is, there are no battery overflows, i.e., we impose B t−1 + (G t − U t )D ≤ Bmax, ∀t. This means that, at any time t and considering a prediction horizon of H F TSs, the EMU has to satisfy the following constraint: where t ≤ τ ≤ t + H F . While additional energy can be stored in the RB for future use, we do not allow demand rescheduling, so that user's energy demands are always satisfied at the time of request, i.e., we impose: This leads to the following constraint for the EMU at time t: where t ≤ τ ≤ t + H F . This constraint is also implicitly verified by the equation expressing the evolution of the energy level in the battery: The power the RB can be charged or discharged at is constrained byPc andP d , respectively. Thus, ∀t we have: The model could be made more accurate by introducing further constraints, e.g., battery charging and discharging efficiency parameters, which we leave for future research focusing on the practical implications of the proposed UDS techniques.
We study and compare the two scenarios in which energy can or cannot be sold to the UP. The price of energy sold to the grid is set equal to the price of energy bought from it, i.e., we adopt the net metering approach, in which the SM can measure bi-directional energy flows [22]. If energy cannot be sold, then whereas, if energy can be sold, we have: Given (U t , B t ) = (u t , b t ), Bmax and the constraints (4)- (6), the set of feasible energy requests at time t is given bȳ If selling energy to the UP is allowed, then the feasible set is as in Eq. (8), but without the [·] + operator.
The EMP computes the grid load at each TS while satisfying the above constraints. We consider a model predictive control approach, whereby the user load and the cost of energy are known beforehand within the prediction horizon [t + 1, . . . , t + H F ], and the goal is to jointly minimize the information leaked about a user's energy consumption as well as the cost the user incurs to purchase energy from the UP. While non-causal knowledge of the electricity price for the typical range of interest is a realistic assumption in today's energy networks, non-causal knowledge of power consumption is appropriate for appliances whose activity can be accurately predicted, e.g., refrigerators, boilers, heaters and electric vehicles. We note that the setting studied in [21], which assumes all future energy consumption and cost information to be known beforehand, is a lower bound on the setting studied in this paper, as more information leads to a better privacy-cost trade-off.
Let the target load at time t be denoted by W t . We measure the privacy leakage as the average variance of the grid load G N from the target load profile W N according to which, perfect privacy is achieved when G t = W t , ∀t. We adopt squared distance in (9) not to discriminate between negative and positive deviations of G t from W t . The average cost incurred by the user is given by where C t is the cost of energy at time t, which is determined by the specific ToU tariff employed by the UP.

Simulation Settings
We use real SM consumption traces from the UK Dale dataset [23]. We convert the original resolution of 6 to 10 minutes to reduce the computational complexity. We consider a Tesla Powerwall 2 [24] as RB, for which Bmax = 13.5kWh, andPc =P d = 5kW. We consider a ToU tariff that was offered in the UK [25], in which the off-peak price is 4.99p/kWh during 23:00 to 6:00, the medium price is 11.99p/kWh during 6:00 to 16:00 and during 19:00 to 23:00, and the peak price is 24.99p/kWh during 16:00 to 19:00. All the simulation results are obtained for a time interval spanning 14 consecutive days, to average over a considerably large amount of data. For simplicity, we will mostly present numerical results when selling energy to the grid is not allowed, unless energy selling leads to significantly different results.

Target Load as a Constant Value
In this section, following up on [9,20] and [10], we assume that the goal of the EMU is to keep the grid load as constant as possible.
In [11] it is assumed that all the future user load and energy cost values are known, and the EMU can fix a target value for the whole duration, e.g., one whole day. In our model the information available to the EMU on U t and C t is limited to the prediction horizon, and changes over time; thus, the target load cannot be constant, and its variability depends on the length of the past and prediction horizons. In this section, given the knowledge of the cost of energy and the user's power consumption, the aim is to characterize both the optimal target load W * and the optimal grid load G * so as to optimize the overall privacy-cost trade-off. Given the nature of the objective functions and the constraints, pairs of (P, C) form a convex region and the optimal points can be characterized by the Pareto boundary of this region. Hence, the objective can be cast as a weighted sum of privacy leakage (9) and cost (10): where 0 ≤ α ≤ 1 is the weighting parameter, i.e., if α = 0 only cost of energy is minimized, whereas if α = 1 only information leakage (a) α = 0. is minimized; and t − H P max{t − H P , 0}. We remark that setting the value of α is up to the consumer, who is in charge of deciding whether to focus more on protecting her privacy or on saving costs. The result of the minimization in Eq. (11) is the grid load for the current TS and the entire duration of the prediction horizon G t+H F t , and the target load W t . Eq. (11) characterizes the target load value W t for the finite prediction horizon, which leads to the optimal privacycost trade-off over this horizon, based on the available information. At TS t + 1, the minimization (11) is carried out again based on the additional information that becomes available, i.e., G t+H F +1 and C t+H F +1 , and G t+1 and W t+1 are determined. The past horizon is considered when optimizing for the privacy objective, since it ensures smoother variations of the overall target load profile. We note that, since privacy and cost in Eq. (11) may have significantly different magnitudes, they need to be further normalized to get the Pareto optimal solution consistent with α [26].
Remark 1. Differently from [21], here we do not impose the RB to be emptied at the end of each time window [t − H P , t + H F ], since here the end of the prediction horizon does not typically coincide with the end of the time horizon of interest, and the energy remaining in the RB can be utilized in the following TSs. Since the algorithm jointly minimizes privacy leakage and cost, the RB is normally emptied at the end of the time horizon of interest N , unless α is high. If α → 1 and the RB is large, a sustained demand of energy may take place in short term, which is ultimately constrained by Bmax and Pc. Fig. 2 shows the load profiles of SHM and LHM over one day. As expected, the LHM provides better performance as the resultant profile is much flatter and hides most of the consumption spikes, which typically reveal more information about user's behavior. However, also the SHM leads to a reasonable suppression of consumption peaks, despite relying on much less data. Also, the SHM reveals more information about the low-frequency variation of user's energy consumption, which, however, is common across households, and thus provides only a limited amount of personal information. Moreover, Figs. 2a and 2c show that the peaks of the grid load generated by SHM are not necessarily aligned with those of the user load.

Fig. 4:
Optimal grid and target load profiles, for Bmax = 20,Pc = P d = 10, when energy selling is allowed.

Solution to the Optimization Problem ( 11)
In the following we consider the optimization problem (11) for α = {0, 1}. We analyze first the optimal solution when selling of energy is allowed, i.e., (6) does not hold. Based on (11) and the constraints (1)- (2) and (4)- (5), we define the Lagrangian function in (12) at the bottom of this page, where λ (j) τ ≥ 0, for 1 ≤ j ≤ 4, are the Lagrange multipliers, and t ≤ τ ≤ t + H F . Denoting the vectors in bold, we have λ = [λ (1) , λ (2) , λ (3), , λ (4) ]. The slackness conditions are imposed on the inequality constraints, for τ = t, t + 1, . . . , t + H F : Let aτ D t+H F s=τ (λ 2α Cτ . Applying the Karush-Kuhn-Tucker (KKT) conditions and setting the gradient of the Lagrangian to zero, we obtain the following expressions: The optimal solution for the grid load given in (17) resembles the classical water-filling algorithm [27]. However, differently from the classical water-filling formulation, here the water level, G * τ +C t = aτ 2α + W * t , is not constant, but varies over time due to the instantaneous power constraints. The optimal solutions given by Eqs. (17) and (18) depend on the values of the Lagrangian multipliers and can be determined numerically.

Illustration of the Water-filling Solution
Here we present the solution for some simple scenarios to acquire an intuition on the solution of the optimization problem (11), and on its water-filling interpretation. Assume energy selling is not allowed, N = 6, and D = 1, i.e., power and energy can be used interchangeably. Consider u 6 = [1, 2, 6, 5, 2, 4] and c 6 = [1, 2, 5, 3, 1, 3], H P = H F = 2 TSs, and an RB with Bmax = 4 andPc =P d = 2. Fig. 3a shows the optimal solution for α = 0, G * ,6 = [3,4,4,3,4,2]. Since the electricity is cheaper for t = {1, 2}, more energy is requested from the grid at these TSs and stored in the RB to satisfy the demand at later TSs. However, such energy is limited by Bmax andPc. At t = 1,Pc limits the grid load, since G * 1 = u 1 +Pc = 3, and the level of energy in the RB at the end of the first TS is B 1 =Pc = 2. At t = 2, the grid load is limited byPc and Bmax simultaneously, and G * 2 = u 2 +Pc = 4, and B 2 = Bmax = 4. Note that, although the third TS is the most expensive, G * 3 = 4 because the RB cannot be discharged by more than 2 units of energy (P d = 2). For the same reason, G * 4 = 3, while the remaining energy was stored in the second TS. Similar considerations hold for the last two TSs. Fig. 3b illustrates the optimal solution for α = 1, G * ,6 = [3, 3.5, 4, 3.75, 3.88, 3.81]. In this scenario, the EMP tries to match G t to the target load W t , even at the cost of asking more energy than needed. The energy demand at t = 1 is the same as the case α = 0, whereas at t = 2 less energy is stored in the battery to be used at t = 4, so that the water level matches the target load in this TS (at the expense of a higher cost at t = 4). It is noteworthy that more energy than needed is requested at t = 4, and used to satisfy the demand during at t = 5, which is cheaper. Finally, more energy than needed is requested at t = {4, 5} (depicted in yellow), allowing the EMP to match the target and the grid load. Such energy is stored in the RB for future use.       4 shows the same scenario with Bmax = 20,Pc =P d = 10, and when energy can be sold. When α = 0, Fig. 4a shows that energy is bought when it is cheaper and sold back to the grid when it is more expensive, maximising user's profit.C 3 andC 4 are plotted as negative since energy is sold in these TSs. In fact, the RB is emptied of the energy stored during the first two TSs at the end of the fourth TS, and it is emptied again of the energy stored during the fifth TS at the end of the sixth TS. When α = 1, Fig. 4b shows (a) α = 0, H P = 2h.
(c) α = 1, H F = 2h.  that a larger RB permits greater flexibility but also boosts the amount of energy requested. This is not necessarily a disadvantage, as such energy can be used at a later TS.

Impact of the Duration of Prediction and Past Horizons
Fig . 5 shows the load profiles for various combinations of H F and H P . As expected, a larger H F produces flatter target and grid loads (see Fig. 5c), compared to a smaller H F (see Fig. 5a). However, when H F is larger the resulting grid load is more distant from the target load, thus resulting in a higher information leakage according to our definition of privacy leakage in Eq. (9). In fact, when H F is small, the grid load values that are compared to the target load are few, and the EMP is able to determine a target load that is close to the grid load within the analyzed time window. On the contrary, when H F is large, the EMP needs to find a single target load that matches a longer interval of grid load values; as a result, the target load may be less representative for some periods. A larger H P leads to a flatter target load (see Fig. 5b), however, the grid load is spikier compared to considering a larger H F . Fig. 6 shows the average information leakage P, average cost C, and average target load variance with respect to H F . The average target load variance, which can be considered as another privacy indicator, is defined as where µ W is the mean of W over time. When α is small, i.e., the main focus is to minimize the cost, a larger H F reduces the average cost up to a certain extent, beyond which it cannot be further reduced (see Fig. 6b); whereas for α = 1 the cost does not change  considerably with H F . Opposite considerations hold for the information leakage, which even slightly increases when α = 1 (see Fig.  6a). This is due to the fact that a longer prediction horizon generates a grid load that is more distant from the target load, except for α = 1, when the focus is on privacy only. Fig. 6c shows that increasing H F induces a smaller variance on the target load. Fig. 7, which shows P, C and V with respect to H P , exhibits similar behaviors to those in Fig. 6, with some notable differences. The y-axis ranges are more limited here, confirming that the knowledge of past consumption is less critical for the EMP compared to the knowledge of future consumption and costs. This explains the far smaller reduction in cost in Fig. 7b, as compared to Fig. 6b, and the increase in the information leakage when α = 1 in Fig. 7a. Fig.  7c shows that the target variance is higher and more variable when α = 1; however, this corresponds to the case in which the grid load is closer to the target load, i.e., the most private scenario according to our original privacy measure. This contradiction of the two privacy indicators shows that evaluating the variance of the target load does not fully reflect the level of privacy achieved, as defined in Eq. (9).

Alternative Privacy Measures
As opposed to the LHM studied in [10], where W t is fixed throughout the operation time, here W t is allowed to vary over time. Therefore, the squared distance between G t and W t may not be sufficient as a privacy measure on its own. Accordingly, we consider alternative measures of privacy to see the impact of the proposed model predictive control framework on those measures. One of the objectives of privacy-preserving algorithms for SM data is to mask the difference between successive power measurements, called features, which non-intrusive appliance load monitoring algorithms exploit to identify appliances' switch-on/off events [28]. Thus, it is possible to evaluate an EMP's performance against such algorithms (c) Practical EMP. by computing the number of features present in the grid load [20]. We classify as features those differences that are larger or equal to 50 W, which represent a typical household electricity consumption of lights. Fig. 8 shows the number of features with respect to H F and H P . A larger H F leads to a reduction in the number of features in the grid load (Fig. 8a); however, H P does not seem to have any influence on this (Fig. 8b).
Another way of assessing the performance of privacy-preserving algorithms is by analyzing the power spectrum of the resulting grid load. In fact, the higher-frequency components of the grid load spectrum correspond typically to more sensitive information about a user's energy consumption [29]. Fig. 9 shows the grid load spectra corresponding to using different values of H F and H P . Larger values of H F lead to better suppression of higher-frequency components when α = 1 (Fig. 9b), whereas for α = 0 even additional high-frequency components are introduced (Fig. 9a). When α = 1, increasing H P also attenuates the higher-frequency components (Fig. 9c), but less markedly compared to increasing H F . As the spectral analysis of the grid load better captures the information leaked, in the following section we consider a privacy-preserving approach whose aim is to filter out directly the higher-frequency components of the user load.

Target Load as Filtered User Load
When the target load is set to a constant value, one can consider this as the DC component of the Fourier transform of the user load profile. If the grid load can be maintained at the average value of the user load at all times, this is equivalent to filtering out all the positive frequency components of the user load profile. However, as shown in Section 3, this is not always possible due to the RB capacity and power constraints, and the information leakage is measured as average squared error distance from this constant DC component. In this section, we consider a more general target load profile, obtained by low-pass filtering the user load, which is equivalent to removing only the high-frequency variations. The motivation for this is twofold: Firstly, the EMU is able to better approximate the target load profile by keeping the low-frequency components; and secondly, the high-frequency components are the ones that leak more information about user behavior. Low-frequency devices are those that typically have continuous periodic operation, e.g., the fridge, and are not particularly privacy sensitive. We would like to remark that, differently from the previous section, here W is not an optimization variable but it is determined based only on the user load. The optimization problem is expressed as where W t , W t+1 , . . . , W t+H F are obtained as low-pass filtered versions of the user load, subject to the same constraints of the constant target scenario, i.e., (1)-(2) and (4)-(5). The target load at time t, W t , is computed as follows. The EMU selects the only available user load, i.e., that one within [t − H P , t + H F ], and computes its spectral representation by means of the discrete Fourier transform. Then, a low-pass filter with a predefined cut-off frequency is applied. Finally, the inverse transform provides the target load profile W t . We note that, although H P does not appear explicitly in (22), the target load computed at time t is determined by low-pass filtering the user load within the time window [t − H P , t + H F ] to prevent the target load from varying dramatically over different TSs. When α = 0, Eq. (22) reduces to the linear program of the previous section. The optimal solutions to (22) can be characterized by following the same steps of Section 3, apart from W t , which here is not an optimization variable. The optimal solutions are given in (17) and (19) for the scenarios where selling energy is allowed and not allowed, respectively. Fig. 10 compares the SHM and the LHM, showing that SHM generates profiles that are smooth and similar to that of the LHM, despite relying only the knowledge of 2 hours of future electricity consumption.

A More Practical EMP
In the previous sections it is assumed that the EMU solves the optimization problem at each TS. However, in practice it may not be feasible to obtain the future predictions at each TS, and may be impractical to compute the target profile so often. Thus, in this section we consider a more practical EMP where the optimization problem is solved once every T S TSs. The optimization problems at time t are still given by Eqs. (11) and (22) for the constant and filtered target load scenarios, respectively, such that the sequences G t+T S t and W t+T S t are obtained at time t on the basis of the available information for TSs [t − H P , t + H F ], where H F ≥ T S . Fig. 11 shows that the practical EMP for a constant and a filtered target load creates piecewise target and grid loads, similar to the piecewise target load profile approach [21]. Due to the discontinuities introduced in the grid load profile, spikes at high frequencies may appear in the spectrum of the grid load produced by this strategy, leading to a higher privacy loss. When α = 1, Fig. 12 shows that the practical EMP reaches virtually the same performance of the SHM, despite computing the grid load six times less often than the LHM.
Finally, in Fig. 13 we present the privacy-cost trade-offs for the various scenarios we have discussed when energy selling is allowed. This figure clearly highlights the increasing loss in performance due to the decreasing amount of information available to the EMU when moving from the LHM to the SHM and to the more practical EMP.

Conclusions
We have studied the joint optimization of privacy and cost for an SM system equipped with an RB. Privacy is measured via the mean squared-error between the SM measurements and a target load profile, which is set to be either a constant function or a low-pass filtered version of the user load. We assume that only partial information about the user's future electricity consumption and electricity cost is known to the EMU, and we cast the joint privacy and cost optimization as a model predictive control problem. The scenario in which the user is allowed to sell excess energy to the UP is studied, which is shown to achieve a better privacy-cost trade-off. The optimal solutions for the constant and filtered target load profiles have been characterized, highlighting their water-filling interpretation. The privacy-cost trade-off has been characterized for the various scenarios, and detailed numerical simulations and alternative privacy measures have been presented. As a future extension of this study, one can consider a generalization of the SHM and LHM models by introducing errors in the predictions of the future energy consumption profile at the EMU. It is reasonable to assume that the prediction error will increase gradually for more distant time instants in the future.