A method and device for publishing energy and power data based on differential privacy
Through targeted processing and adaptive sampling of energy and power data streams at the time stamp level, combined with noise injection and Kalman filters, the problem of increased data stream processing errors in the existing technology is solved, and the accuracy of energy and power data is improved. performance and availability.
Patent Information
- Application Number
- CN202311666554.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-06
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2043-12-06
AI Technical Summary
When existing technology processes energy and power data flows, errors caused by the overall processing of the data increase over time, resulting in reduced accuracy and availability of published data.
Through targeted processing of each timestamp, the sliding window and adaptive threshold sampling mechanism are used to determine the sampling points and inject noise to generate energy and power release data, and combine the Kalman filter to process non-sampling point data to improve the accuracy of the data. and availability.
It effectively solves the problem of errors increasing over time in data stream processing, improves the accuracy and availability of energy and power release data, and meets the needs of real-time and privacy protection.
Smart Images

Figure CN117744137B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data publishing, and in particular to a method and device for publishing energy power data based on differential privacy. Background Art
[0002] In the energy and power data publishing environment, facing the real-time and continuous characteristics of data streams, data processing and privacy protection have become a crucial challenge. Specifically, as time goes by, energy data continues to be generated, causing the data timestamp to continue to increase. Moreover, these data often come from many independent users and contain a large amount of sensitive information. In order to deal with the above privacy issues, the current strategy is to adopt differential privacy methods. The key concept is to inject random noise into sensitive data to protect user privacy. However, when this data publishing method is applied to data streams such as energy and power data, the continuous increase in the timestamp of continuous time data will cause the publishing error to accumulate over time, resulting in a decrease in the accuracy and availability of the published data obtained over time. Summary of the invention
[0003] The embodiments of the present invention provide a method and device for publishing energy and power data based on differential privacy, which can effectively solve the problem that the error increases over time due to the overall processing of data when processing data streams in the prior art, and improve the accuracy and availability of energy and power published data through targeted processing of each timestamp.
[0004] An embodiment of the present invention provides an energy and power data publishing method based on differential privacy, comprising:
[0005] Obtaining an energy power data stream containing a number of consecutive timestamps and a preset sampling rate;
[0006] For the energy and power data at each timestamp, obtain the current privacy budget, current sampling rate, energy and power release data at the previous timestamp, and current sampling control data when the sliding window moves to the current timestamp; wherein the sampling control data includes: proportional gain, integral gain, and differential gain;
[0007] Determine a current sampling threshold according to a preset privacy budget, a current privacy budget, a current sampling rate, a preset sampling rate, a proportional gain, an integral gain, and a differential gain;
[0008] Determine the release difference value of the current timestamp based on the energy and power data of the previous timestamp and the energy and power release data of the previous timestamp;
[0009] When the current sampling threshold is greater than the publishing difference value of the current timestamp, taking the current timestamp as the sampling point;
[0010] For each sampling point, the privacy budget allocated to the current sampling point is determined according to the current sampling rate and the preset sampling rate, and noise is injected into the energy and power data corresponding to the current sampling point according to the privacy budget of the current sampling point to generate energy and power release data.
[0011] Further, determining the current sampling threshold according to the preset privacy budget, the current privacy budget, the current sampling rate, the preset sampling rate, the proportional gain, the integral gain, and the differential gain includes:
[0012] Determine the current remaining privacy budget based on the preset privacy budget and the current privacy budget;
[0013] Determine a current sampling rate feedback error according to the current sampling rate and the preset sampling rate;
[0014] Determine the current sampling control error according to the proportional gain, the integral gain and the differential gain;
[0015] The current sampling threshold is determined according to the current remaining privacy budget, the current sampling rate feedback error, and the current sampling control error.
[0016] Furthermore, the step of determining the privacy budget allocated to the current sampling point according to the current sampling rate and the preset sampling rate includes:
[0017] Get the preset sampling rate difference measurement value;
[0018] Calculating a first difference between the current sampling rate and the preset sampling rate;
[0019] If the first difference is greater than a preset sampling rate difference, determining a current privacy budget allocation ratio according to the first difference;
[0020] Determine the privacy budget allocated to the current sampling point according to the current privacy budget allocation ratio;
[0021] If the first difference is not greater than the preset sampling rate difference, the privacy budget allocated to the current sampling point is determined according to the dichotomy method.
[0022] Furthermore, injecting noise into the energy and power data corresponding to the current sampling point according to the privacy budget of the current sampling point to generate energy and power release data includes:
[0023] Energy and power release data is generated by the following formula:
[0024]
[0025] Among them, D * Publish data for energy and electricity at the current timestamp; D i Energy and power data at the current timestamp; ε iis the privacy budget of the current sampling point; ΔQ is the global sensitivity; Indicates injection D i The scale of the Laplace noise.
[0026] Furthermore, it also includes:
[0027] When the current sampling threshold is not greater than the publishing difference value of the current timestamp, the current timestamp is used as a non-sampling point;
[0028] For each non-sampling point, obtain the Kalman gain of the current timestamp, the energy and power release data of the previous timestamp, the error covariance of the previous timestamp, and the preset white noise;
[0029] Determine the prediction error of the current timestamp based on the error covariance of the previous timestamp and the preset white noise;
[0030] Determine the energy and power forecast data at the current timestamp based on the energy and power release data at the previous timestamp;
[0031] The energy and power release data at the current timestamp is determined according to the Kalman gain, prediction error and energy and power prediction data at the current timestamp.
[0032] Based on the above method embodiment, the present invention provides a corresponding device embodiment;
[0033] An embodiment of the present invention provides an energy and power data publishing device based on differential privacy, including: a data acquisition module, a difference value determination module and a sampling point energy and power data publishing module;
[0034] The data acquisition module is used to acquire energy and power data streams containing several consecutive timestamps and a preset sampling rate; for the energy and power data of each timestamp, the current privacy budget, the current sampling rate, the energy and power release data of the previous timestamp, and the current sampling control data are acquired when the sliding window moves to the current timestamp; wherein the sampling control data includes: proportional gain, integral gain, and differential gain;
[0035] The difference value determination module is used to determine the current sampling threshold according to the preset privacy budget, the current privacy budget, the current sampling rate, the preset sampling rate, the proportional gain, the integral gain and the differential gain; determine the release difference value of the current timestamp according to the energy and power data of the previous timestamp and the energy and power release data of the previous timestamp;
[0036] The sampling point energy and power data publishing module is used to use the current timestamp as the sampling point when the current sampling threshold is greater than the publishing difference value of the current timestamp; for each sampling point, determine the privacy budget allocated to the current sampling point according to the current sampling rate and the preset sampling rate, and inject noise into the energy and power data corresponding to the current sampling point according to the privacy budget of the current sampling point to generate energy and power publishing data.
[0037] Further, determining the current sampling threshold according to the preset privacy budget, the current privacy budget, the current sampling rate, the preset sampling rate, the proportional gain, the integral gain, and the differential gain includes:
[0038] Determine the current remaining privacy budget based on the preset privacy budget and the current privacy budget;
[0039] Determine a current sampling rate feedback error according to the current sampling rate and the preset sampling rate;
[0040] Determine the current sampling control error according to the proportional gain, the integral gain and the differential gain;
[0041] The current sampling threshold is determined according to the current remaining privacy budget, the current sampling rate feedback error, and the current sampling control error.
[0042] Furthermore, the step of determining the privacy budget allocated to the current sampling point according to the current sampling rate and the preset sampling rate includes:
[0043] Get the preset sampling rate difference measurement value;
[0044] Calculating a first difference between the current sampling rate and the preset sampling rate;
[0045] If the first difference is greater than a preset sampling rate difference, determining a current privacy budget allocation ratio according to the first difference;
[0046] Determine the privacy budget allocated to the current sampling point according to the current privacy budget allocation ratio;
[0047] If the first difference is not greater than the preset sampling rate difference, the privacy budget allocated to the current sampling point is determined according to the dichotomy method.
[0048] Furthermore, injecting noise into the energy and power data corresponding to the current sampling point according to the privacy budget of the current sampling point to generate energy and power release data includes:
[0049] Energy and power release data is generated by the following formula:
[0050]
[0051] Among them, D *Publish data for energy and electricity at the current timestamp; D i Energy and power data at the current timestamp; ε i is the privacy budget of the current sampling point; ΔQ is the global sensitivity; Indicates injection D i The scale of the Laplace noise.
[0052] Furthermore, it also includes a non-sampling point energy and power data publishing module;
[0053] The non-sampling point energy and power data release module is used to use the current timestamp as a non-sampling point when the current sampling threshold is not greater than the release difference value of the current timestamp; for each non-sampling point, obtain the Kalman gain of the current timestamp, the energy and power release data of the previous timestamp, the error covariance of the previous timestamp and the preset white noise; determine the prediction error of the current timestamp according to the error covariance of the previous timestamp and the preset white noise; determine the energy and power prediction data of the current timestamp according to the energy and power release data of the previous timestamp; determine the energy and power release data of the current timestamp according to the Kalman gain, prediction error and energy and power prediction data of the current timestamp.
[0054] The following beneficial effects are achieved by implementing the present invention:
[0055] The present invention provides an energy and power data publishing method and device based on differential privacy. The energy and power data publishing method samples the energy and power data stream at a preset sampling rate, and processes the energy and power data of each timestamp in the energy and power data stream separately to determine whether to use the data of the timestamp as sampling data. For the energy and power data of each timestamp, the current privacy budget, the current sampling rate, the energy and power publishing data of the previous timestamp and the current sampling control data when the sliding window moves to the current timestamp when traversing the energy and power data stream are obtained, and then the current sampling threshold and the publishing difference value of the current timestamp are determined according to the above data; by comparing the sampling threshold and the publishing difference value, it is determined whether the current timestamp is used as a sampling point; for the timestamp used as a sampling point, the privacy budget allocated to the current sampling point is determined according to the current sampling rate and the preset sampling rate, and the energy and power publishing data is generated after the noise is injected into the energy and power data corresponding to the current sampling point according to the privacy budget of the current sampling point. The energy and power data stream is processed by timestamps, and the sampling threshold and publication difference value are determined when processing each timestamp. Whether the current timestamp needs to be used as a sampling point is determined based on the size relationship between the two. A privacy budget is allocated to the energy and power data of the timestamp used as the sampling point and noise is injected. This solves the problem of the error increasing over time due to the overall processing of data when processing data streams in the prior art. Through targeted processing of each timestamp, the accuracy and availability of energy and power publication data are improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Figure 1 It is a flow chart of a method for publishing energy and power data based on differential privacy provided in one embodiment of the present invention.
[0057] Figure 2 It is a framework diagram of an energy and power data publishing method based on differential privacy provided in one embodiment of the present invention.
[0058] Figure 3 It is a publication error comparison diagram of an energy and power data publishing method based on differential privacy provided by an embodiment of the present invention.
[0059] Figure 4 It is a structural diagram of an energy and power data publishing device based on differential privacy provided by one embodiment of the present invention. DETAILED DESCRIPTION
[0060] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0061] like Figure 1 As shown, a method for publishing energy and power data based on differential privacy is provided in one embodiment of the present invention, comprising:
[0062] Step S1: Obtaining an energy power data stream including a number of consecutive timestamps and a preset sampling rate;
[0063] Step S2: For the energy and power data at each timestamp, obtain the current privacy budget, current sampling rate, energy and power release data at the previous timestamp, and current sampling control data when the sliding window moves to the current timestamp; wherein the sampling control data includes: proportional gain, integral gain, and differential gain;
[0064] Step S3: determining a current sampling threshold according to a preset privacy budget, a current privacy budget, a current sampling rate, a preset sampling rate, a proportional gain, an integral gain, and a differential gain;
[0065] Step S4: determining the release difference value of the current timestamp according to the energy and power data of the previous timestamp and the energy and power release data of the previous timestamp;
[0066] Step S5: When the current sampling threshold is greater than the publication difference value of the current timestamp, the current timestamp is used as the sampling point; for each sampling point, the privacy budget allocated to the current sampling point is determined according to the current sampling rate and the preset sampling rate, and noise is injected into the energy and power data corresponding to the current sampling point according to the privacy budget of the current sampling point to generate energy and power publication data.
[0067] For step S1, obtain an energy and power data stream, which is composed of a cascade of energy and power data with several consecutive timestamps, and obtain a preset sampling rate; wherein, the preset sampling rate is set to make the actual sampling rate in the entire data publishing process fluctuate around the preset sampling rate.
[0068] It should be noted that if Figure 2 As shown, it is a framework diagram of an energy and power data publishing method based on differential privacy provided by an embodiment of the present invention. The present invention mainly includes four processing mechanisms for processing the input energy and power data stream, namely, an adaptive threshold sampling mechanism, an adaptive budget allocation mechanism, a perturbation mechanism and a filtering mechanism; it can be understood that the model constructed by using these four mechanisms as four modules is a data publishing model, then when the energy and power data stream is input into the data publishing model, the model processes the energy and power data of the latest timestamp through the adaptive threshold sampling mechanism to determine whether the energy and power data of the latest timestamp is a sampling point, for the sampling point, the adaptive budget allocation mechanism is used to allocate a privacy budget to the energy and power data of the sampling point, and the perturbation mechanism is used to add noise perturbation to the energy and power data of the sampling point to protect the privacy of the energy and power data, thereby improving the security of the energy and power publishing data of the sampling point; the timestamp data other than the sampling point that is not selected as the sampling point is a non-adopted point, and the energy and power data of the non-adopted point is processed through the filtering mechanism, so that the energy and power data of the non-sampling point is obtained through the filtering mechanism. The posterior estimate is used as the energy and power publishing data of the non-sampling point.
[0069] For step S2, the processing of the energy and power data stream is first processed using a sliding window model, so that the sliding window slides on the energy and power data of each timestamp, and the privacy budget is determined by the sliding window. For the energy and power data of each timestamp, it is necessary to obtain the current privacy budget, the current sampling rate, the energy and power release data of the previous timestamp and the current sampling control data when the sliding window moves to the current timestamp; wherein the sampling control data includes: proportional gain, integral gain and differential gain. It should be noted that when processing the energy and power data stream, the energy and power data stream can be understood as an infinite stream of continuously updated data. Therefore, when processing before data release, the energy and power data of the latest timestamp is usually processed, and the energy and power release data of the current latest timestamp is obtained by combining relevant parameters and the energy and power release data of the previous timestamp during the processing process. The processing of a single timestamp in the embodiments of the present invention can be understood as the processing process of the latest timestamp and its subsequent updated timestamps.
[0070] For step S3, in a preferred embodiment, determining the current sampling threshold based on the preset privacy budget, the current privacy budget, the current sampling rate, the preset sampling rate, the proportional gain, the integral gain and the differential gain includes: determining the current remaining privacy budget based on the preset privacy budget and the current privacy budget; determining the current sampling rate feedback error based on the current sampling rate and the preset sampling rate; determining the current sampling control error based on the proportional gain, the integral gain and the differential gain; determining the current sampling threshold based on the current remaining privacy budget, the current sampling rate feedback error and the current sampling control error.
[0071] Specifically, in the adaptive threshold sampling mechanism, the current sampling threshold is calculated by the current sampling rate feedback error and the current remaining privacy budget, so as to achieve the purpose of adaptive sampling and ensure the uniform distribution of sampling points and non-sampling points. First, the current remaining privacy budget of the sliding window is determined according to the preset privacy budget and current privacy budget of the sliding window. The corresponding calculation formula for the current remaining privacy budget is as follows:
[0072]
[0073] Among them, ε rm is the current remaining privacy budget; t is the current timestamp; ε is the preset privacy budget; where ε is manually specified. In differential privacy, the ratio between the probability of the algorithm generating the event on one data set and the probability of generating the event on another data set is limited to e ε When ε=0, it indicates perfect privacy, but a smaller value may reduce the practicality of the output data; a larger value may weaken privacy protection but improve the practicality of the data. Therefore, in this embodiment, ε=0.5 is set.
[0074] It should be noted that in the perturbation mechanism, a preset privacy budget ε is added to the energy and power release data corresponding to the first processed timestamp. w represents the sliding window size; in any sliding window w i There are w publication histograms and a set of differential privacy algorithms: A i-w+1 (D i-w+1 ),A i-w+1 (D i-w+1 ),A i-w+2 (D i-w+2 ),A i-w+3 (D i-w+3 ),…,A i (D i ); Algorithm A t (D t ) respectively satisfy ε-differential privacy and the random processes of any two algorithms are independent of each other. According to the combination property of differential privacy sequences, the perturbation mechanism satisfies ε-differential privacy. In the present invention, the only mechanism that accesses the original data is the perturbation mechanism, and other mechanisms only operate on the perturbed data. Therefore, the present invention satisfies ε-differential privacy.
[0075] Furthermore, the current sampling rate feedback error is determined by the following formula:
[0076] err=|RC|
[0077] Wherein, err is the current sampling rate feedback error; R is the current sampling rate; and C is the preset sampling rate.
[0078] The current sampled control error of the PID controller is determined by the following formula:
[0079]
[0080] Among them, u i is the current sampling control error; θ p is the current proportional gain; θ i is the current integral gain; θ d is the current differential gain; e τ Indicates t τ The difference between i Represents the current timestamp.
[0081] Combining the above calculations, the current sampling threshold can be calculated by the following formula:
[0082]
[0083] Among them, T iis the current sampling threshold; the parameter θ is used to determine the influence of the current sampling control error on the current sampling threshold.
[0084] It should be noted that the current sampling threshold is determined by the current remaining privacy budget and the current sampling rate feedback error. The combination of the two fully considers the dynamic nature of the data flow. i When RC ≥ 0, that is, the current sampling rate is greater than or equal to the preset sampling rate, it is necessary to increase the threshold and reduce the sampling frequency, and u i Itself is a number greater than 0, so u i The value of does not need to be changed; if RC<0, that is, the current sampling rate is less than the preset sampling rate, the threshold needs to be reduced to increase the sampling frequency, then u i :=-u i .
[0085] For step S4, after determining the current sampling threshold, determine the publication difference value of the current timestamp according to the energy and power data of the current timestamp and the energy and power publication data of the previous timestamp. The publication difference value of the current timestamp represents the average absolute distance between the energy and power data of the current timestamp and the energy and power publication data of the previous timestamp. The average absolute distance here is a statistical measure used to quantify the degree of difference between the data processed after privacy protection and the original data. After completing the calculation of the current sampling threshold and the publication difference value of the current timestamp, compare the two.
[0086] For step S5, when the current sampling threshold is greater than the publication difference value of the current timestamp, the current timestamp is used as the sampling point. For the energy and power data of the current timestamp as the sampling point, after allocating the privacy budget to the current timestamp through the adaptive budget allocation mechanism, the energy and power publication data corresponding to the sampling point is generated after injecting noise into the energy and power data of the current timestamp through the perturbation mechanism.
[0087] In a preferred embodiment, determining the privacy budget allocated to the current sampling point based on the current sampling rate and the preset sampling rate includes: obtaining a preset sampling rate difference measurement value; calculating a first difference between the current sampling rate and the preset sampling rate; if the first difference is greater than the preset sampling rate difference, determining the current privacy budget allocation ratio based on the first difference; determining the privacy budget allocated to the current sampling point based on the current privacy budget allocation ratio; if the first difference is not greater than the preset sampling rate difference, determining the privacy budget allocated to the current sampling point based on the dichotomy method.
[0088] Specifically, first calculate the first difference r between the current sampling rate R and the preset sampling rate C. If the first difference r is greater than the preset sampling rate difference s, determine the allocation ratio of the current privacy budget according to the first difference r, where the value range of the preset sampling rate difference s is 0 < s < 1. Determine the privacy budget allocated to the current sampling point according to the allocation ratio of the current privacy budget. The specific calculation formula is as follows:
[0089] ε i = min(ε max , ε temp )
[0090] Among them, ε i is the privacy budget allocated to the current timestamp; ε max is the maximum privacy budget that restricts the allocation of the current sampling point; ε temp is the budget allocation value calculated through the first difference r.
[0091] It should be noted that the reason for setting the maximum privacy budget for sampling point allocation is that when the perturbation error brought by the privacy budget allocated to the current timestamp is greater than the current sampling threshold, the improvement effect brought by increasing the privacy budget is relatively small. Therefore, it is not necessary to allocate more privacy budget than ε max at the current sampling point, so that the privacy budget can be used more reasonably and comprehensively.
[0092] In a preferred embodiment, injecting noise into the energy and power data corresponding to the current sampling point according to the privacy budget of the current sampling point to generate energy and power release data includes:
[0093] The embodiment of the present invention adopts the Laplace mechanism to inject Laplace noise into the statistical data of the sampling area to provide differential privacy protection. Specifically, the energy and power release data is generated through the following formula:
[0094]
[0095] Among them, D * is the energy and power release data of the current timestamp; D i is the energy and power data of the current timestamp; ε i is the privacy budget of the current sampling point; ΔQ is the global sensitivity; represents the scale of the Laplace noise injected into D i ; among them, since each user can appear in at most one area at each timestamp, the global sensitivity ΔQ = 1.
[0096] In a preferred embodiment, it also includes: when the current sampling threshold is not greater than the release difference value of the current timestamp, the current timestamp is used as a non-sampling point; for each non-sampling point, the Kalman gain of the current timestamp, the energy and power release data of the previous timestamp, the error covariance of the previous timestamp and the preset white noise are obtained; the prediction error of the current timestamp is determined according to the error covariance and the preset white noise of the previous timestamp; the energy and power prediction data of the current timestamp is determined according to the energy and power release data of the previous timestamp; the energy and power release data of the current timestamp is determined according to the Kalman gain, prediction error and energy and power prediction data of the current timestamp.
[0097] Specifically, for non-sampling points, a filtering mechanism is used to process the energy and power data of each non-sampling point. In the embodiment of the present invention, the main processing principle of the filtering mechanism is: use a Kalman filter to weigh and combine the predicted data and the observed data to maintain and update the best estimate; in the filtering mechanism, there are two stages: prediction and correction; in the prediction stage, the energy and power release data with the latest timestamp is used as a priori estimation and the internal module generates a predicted value, while in the correction stage, the energy and power data with the latest timestamp is used as the observed value, and the best estimate is obtained by correcting the predicted value with the observed value, and the energy and power data corresponding to the best estimate is used as the energy and power release data of the non-sampling point.
[0098] For example, the prediction stage first calculates the error covariance p at the previous time stamp i-1. i-1 and process white noise Q determine the prediction error at the current timestamp Among them, the prediction error of the current timestamp can be calculated by the following formula:
[0099]
[0100] According to the energy and power data released at the last timestamp i-1 Determine the energy and power forecast data r at the current timestamp i i .
[0101] It should be noted that in the prediction phase, each non-sampling timestamp needs to adjust the Kalman gain K of the current timestamp. i , to minimize the posterior error covariance.
[0102] In the correction phase, the energy and power release data at the current timestamp is determined according to the following formula:
[0103] D i * =r i +K i (D i -r i )
[0104] Among them, D i * The energy and power data released at the current timestamp i; r i Energy and power forecast data at the current time stamp i; K i is the Kalman gain at the current time stamp i; D i It is the energy and power data at the current timestamp i.
[0105] It should be added that in the correction stage, after obtaining the energy and power release data of the current timestamp, that is, the above-mentioned best estimate, it is necessary to iteratively update the optimal release value at the next timestamp i+1 by the following formula:
[0106]
[0107] Among them, P i is the error covariance of the current timestamp; is the prediction error of the previous timestamp; K i is the Kalman gain at the current timestamp i.
[0108] It should be noted that, in the filtering mechanism, the noise in the prediction process and the noise in the measurement process do not change with the change of the system in which the filtering mechanism is located in this embodiment.
[0109] It should be added that the embodiment of the present invention tests the energy and power data publishing method based on differential privacy provided by the embodiment of the present invention on two real data sets, including the Electricity data set and the Diabetes data set, and compares and analyzes the simulation results with the classic BA and BD algorithms. The analysis results are as follows: Figure 3 As shown. Figure 3In the figure, the horizontal axis is the sliding window size, ranging from 40 to 200. The publishing errors of the three algorithms all increase, but it can also be clearly seen that as the sliding window increases, the publishing error of the method proposed in the present invention increases at a slower rate than that of the BA and BD algorithms; this is due to the fact that the PID feedback error and the remaining privacy budget are considered simultaneously in the adaptive budget allocation mechanism, so that the budget obtained by each sampling point is as reasonable as possible, avoiding allocating too much budget to a certain sampling point, which leads to greater disturbances to other sampling points. Further, the description of the algorithm running time, the number of timestamps of the Electricity data set and the Diabetes data set are 528 and 478 respectively. When the number of timestamps increases, the time consumed by the four algorithms increases, and the time consumed by the scheme proposed in the present invention is slightly increased compared with other algorithms; however, the average time consumed per timestamp is still very small, which effectively reduces the deviation between the published data and the real data while meeting the requirements of the real-time processing system. The running time of each algorithm involved is shown in the following table:
[0110]
[0111] It can be further seen from the above experimental results that the energy and power data publishing method based on differential privacy proposed in the present invention is significantly superior to the existing data publishing method, has higher applicability and accuracy, and can effectively solve the real-time, accuracy and security requirements of the secure publication of energy and power data.
[0112] Based on the above method embodiment, the present invention provides a corresponding device embodiment.
[0113] like Figure 3 As shown, an embodiment of the present invention provides an energy and power data publishing device based on differential privacy, comprising: a data acquisition module, a difference value determination module and a sampling point energy and power data publishing module;
[0114] The data acquisition module is used to acquire energy and power data streams containing several consecutive timestamps and a preset sampling rate; for the energy and power data of each timestamp, the current privacy budget, the current sampling rate, the energy and power release data of the previous timestamp, and the current sampling control data are acquired when the sliding window moves to the current timestamp; wherein the sampling control data includes: proportional gain, integral gain, and differential gain;
[0115] The difference value determination module is used to determine the current sampling threshold according to the preset privacy budget, the current privacy budget, the current sampling rate, the preset sampling rate, the proportional gain, the integral gain and the differential gain; determine the release difference value of the current timestamp according to the energy and power data of the previous timestamp and the energy and power release data of the previous timestamp;
[0116] The sampling point energy and power data publishing module is used to use the current timestamp as the sampling point when the current sampling threshold is greater than the publishing difference value of the current timestamp; for each sampling point, determine the privacy budget allocated to the current sampling point according to the current sampling rate and the preset sampling rate, and inject noise into the energy and power data corresponding to the current sampling point according to the privacy budget of the current sampling point to generate energy and power publishing data.
[0117] In a preferred embodiment, determining the current sampling threshold according to the preset privacy budget, the current privacy budget, the current sampling rate, the preset sampling rate, the proportional gain, the integral gain and the differential gain includes:
[0118] Determine the current remaining privacy budget based on the preset privacy budget and the current privacy budget;
[0119] Determine a current sampling rate feedback error according to the current sampling rate and the preset sampling rate;
[0120] Determine the current sampling control error according to the proportional gain, the integral gain and the differential gain;
[0121] The current sampling threshold is determined according to the current remaining privacy budget, the current sampling rate feedback error, and the current sampling control error.
[0122] In a preferred embodiment, determining the privacy budget allocated to the current sampling point according to the current sampling rate and the preset sampling rate includes:
[0123] Get the preset sampling rate difference measurement value;
[0124] Calculating a first difference between the current sampling rate and the preset sampling rate;
[0125] If the first difference is greater than a preset sampling rate difference, determining a current privacy budget allocation ratio according to the first difference;
[0126] Determine the privacy budget allocated to the current sampling point according to the current privacy budget allocation ratio;
[0127] If the first difference is not greater than the preset sampling rate difference, the privacy budget allocated to the current sampling point is determined according to the dichotomy method.
[0128] In a preferred embodiment, injecting noise into the energy and power data corresponding to the current sampling point according to the privacy budget of the current sampling point to generate energy and power release data includes:
[0129] Energy and power release data is generated by the following formula:
[0130]
[0131] Among them, D* Publish data for energy and electricity at the current timestamp; D i Energy and power data at the current timestamp; ε i is the privacy budget of the current sampling point; ΔQ is the global sensitivity; Indicates injection D i The scale of the Laplace noise.
[0132] In a preferred embodiment, it also includes a non-sampling point energy and power data publishing module;
[0133] The non-sampling point energy and power data release module is used to use the current timestamp as a non-sampling point when the current sampling threshold is not greater than the release difference value of the current timestamp; for each non-sampling point, obtain the Kalman gain of the current timestamp, the energy and power release data of the previous timestamp, the error covariance of the previous timestamp and the preset white noise; determine the prediction error of the current timestamp according to the error covariance of the previous timestamp and the preset white noise; determine the energy and power prediction data of the current timestamp according to the energy and power release data of the previous timestamp; determine the energy and power release data of the current timestamp according to the Kalman gain, prediction error and energy and power prediction data of the current timestamp.
[0134] It should be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the accompanying drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines. A person of ordinary skill in the art may understand and implement it without paying any creative effort.
[0135] Those skilled in the art can clearly understand that for the sake of convenience and brevity, the specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0136] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A method for publishing energy and power data based on differential privacy, characterized in that: include: Obtaining an energy and power data stream containing several consecutive timestamps and a preset sampling rate; For each timestamp of energy and power data, obtain the current privacy budget, current sampling rate, energy and power release data at the previous timestamp, and current sampling control data when the sliding window moves to the current timestamp; wherein the sampling control data includes: proportional gain, integral gain, and differential gain; Determining a current sampling threshold based on a preset privacy budget, a current privacy budget, a current sampling rate, a preset sampling rate, a proportional gain, an integral gain, and a differential gain; wherein determining the current sampling threshold based on the preset privacy budget, the current privacy budget, the current sampling rate, the preset sampling rate, the proportional gain, the integral gain, and the differential gain includes: determining a current remaining privacy budget based on the preset privacy budget and the current privacy budget; determining a current sampling rate feedback error based on the current sampling rate and the preset sampling rate; determining a current sampling control error based on the proportional gain, the integral gain, and the differential gain; and determining the current sampling threshold based on the current remaining privacy budget, the current sampling rate feedback error, and the current sampling control error; Determine the release difference value of the current timestamp based on the energy and power data of the previous timestamp and the energy and power release data of the previous timestamp; When the current sampling threshold is greater than the publication difference value of the current timestamp, taking the current timestamp as the sampling point; For each sampling point, a privacy budget allocated to the current sampling point is determined based on the current sampling rate and the preset sampling rate, and noise is injected into the energy and power data corresponding to the current sampling point based on the privacy budget of the current sampling point to generate energy and power release data. The method of determining the privacy budget allocated to the current sampling point based on the current sampling rate and the preset sampling rate includes: obtaining a preset sampling rate difference measure; calculating a first difference between the current sampling rate and the preset sampling rate; if the first difference is greater than the preset sampling rate difference, determining the current privacy budget allocation ratio based on the first difference; determining the privacy budget allocated to the current sampling point based on the current privacy budget allocation ratio; and if the first difference is not greater than the preset sampling rate difference, determining the privacy budget allocated to the current sampling point based on a dichotomy method.
2. The energy and power data publishing method based on differential privacy according to claim 1, characterized in that: The step of injecting noise into the energy and power data corresponding to the current sampling point according to the privacy budget of the current sampling point to generate energy and power release data includes: Energy and power release data is generated using the following formula: Among them, D * Publish data for energy and electricity at the current timestamp; D i Energy and power data at the current timestamp; ε i is the privacy budget of the current sampling point; ΔQ is the global sensitivity; Indicates injection D i The scale of the Laplace noise.
3. The energy and power data publishing method based on differential privacy according to claim 1, characterized in that: Also includes: When the current sampling threshold is not greater than the publication difference value of the current timestamp, the current timestamp is used as a non-sampling point; For each non-sampling point, obtain the Kalman gain of the current timestamp, the energy and power release data of the previous timestamp, the error covariance of the previous timestamp, and the preset white noise; Determine the prediction error of the current timestamp based on the error covariance of the previous timestamp and the preset white noise; Determine the energy and power forecast data at the current timestamp based on the energy and power release data at the previous timestamp; The energy and power release data at the current timestamp is determined according to the Kalman gain, prediction error and energy and power prediction data at the current timestamp.
4. An energy and power data publishing device based on differential privacy, characterized in that: include: Data acquisition module, difference value determination module and sampling point energy and power data publishing module; The data acquisition module is configured to acquire an energy and power data stream containing a plurality of consecutive timestamps and a preset sampling rate; for each timestamp of energy and power data, the module acquires the current privacy budget, the current sampling rate, the energy and power release data at the previous timestamp, and the current sampling control data when the sliding window moves to the current timestamp; wherein the sampling control data includes: proportional gain, integral gain, and differential gain; The difference value determination module is used to determine the current sampling threshold based on the preset privacy budget, the current privacy budget, the current sampling rate, the preset sampling rate, the proportional term gain, the integral term gain, and the differential term gain; determine the release difference value of the current timestamp based on the energy and power data of the previous timestamp and the energy and power release data of the previous timestamp; wherein, the determination of the current sampling threshold based on the preset privacy budget, the current privacy budget, the current sampling rate, the preset sampling rate, the proportional term gain, the integral term gain, and the differential term gain includes: determining the current remaining privacy budget based on the preset privacy budget and the current privacy budget; determining the current sampling rate feedback error based on the current sampling rate and the preset sampling rate; determining the current sampling control error based on the proportional term gain, the integral term gain, and the differential term gain; and determining the current sampling threshold based on the current remaining privacy budget, the current sampling rate feedback error, and the current sampling control error; The sampling point energy and power data publishing module is configured to use the current timestamp as the sampling point when the current sampling threshold is greater than the publishing difference value of the current timestamp; for each sampling point, determine the privacy budget allocated to the current sampling point according to the current sampling rate and the preset sampling rate, and inject noise into the energy and power data corresponding to the current sampling point according to the privacy budget of the current sampling point to generate energy and power publishing data; wherein, determining the privacy budget allocated to the current sampling point according to the current sampling rate and the preset sampling rate includes: obtaining a preset sampling rate difference measure; calculating a first difference between the current sampling rate and the preset sampling rate; if the first difference is greater than the preset sampling rate difference, determining the current privacy budget allocation ratio according to the first difference; determining the privacy budget allocated to the current sampling point according to the current privacy budget allocation ratio; if the first difference is not greater than the preset sampling rate difference, determining the privacy budget allocated to the current sampling point according to the dichotomy method.
5. The energy and power data publishing device based on differential privacy according to claim 4, characterized in that: The step of injecting noise into the energy and power data corresponding to the current sampling point according to the privacy budget of the current sampling point to generate energy and power release data includes: Energy and power release data is generated using the following formula: Among them, D * Publish data for energy and electricity at the current timestamp; D i Energy and power data at the current timestamp; ε i is the privacy budget of the current sampling point; ΔQ is the global sensitivity; Indicates injection D i The scale of the Laplace noise.
6. The energy and power data publishing device based on differential privacy according to claim 4, characterized in that: It also includes a module for publishing energy and power data at non-sampling points; The non-sampling point energy and power data publishing module is configured to use the current timestamp as a non-sampling point when the current sampling threshold is not greater than the publishing difference value of the current timestamp; For each non-sampling point, obtain the Kalman gain of the current timestamp, the energy and power release data of the previous timestamp, the error covariance of the previous timestamp, and the preset white noise; Determine the prediction error of the current timestamp based on the error covariance of the previous timestamp and the preset white noise; Determine the energy and power forecast data at the current timestamp based on the energy and power release data at the previous timestamp; The energy and power release data at the current timestamp is determined according to the Kalman gain, prediction error and energy and power prediction data at the current timestamp.
