A streaming histogram publishing method and system for weighted sliding windows under differential privacy

Through differential privacy technology and greedy clustering algorithm, the importance of distinguishing old and new elements in weighted sliding window histogram publishing is realized, and the computing and storage costs are reduced, solving the problems of insufficient efficiency and usability of histogram publishing in the existing technology. .

CN114969656BActive Publication Date: 2024-10-22ANHUI UNIVERSITY OF TECHNOLOGY +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210343677.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-31
Publication Date
2024-10-22
Estimated Expiration
2042-03-31

AI Technical Summary

Technical Problem

The existing technology lacks an effective mechanism to distinguish the importance of new and old elements in the release of weighted sliding window histograms, and the calculation overhead and storage burden are high, making it unsuitable for scenarios where the importance of data decays over time.

Method used

The streaming histogram publishing method of weighted sliding window under differential privacy is adopted. Through the new sketch data structure and greedy clustering algorithm, the interval count value and noise value are approximately estimated, and the difference between real data and noise data is adaptively controlled to reduce the calculation cost and Guarantee competitive availability of query data.

Benefits of technology

It significantly reduces computing costs and storage requirements, improves histogram publishing efficiency and data availability in a data flow environment, and is suitable for data scenarios where the importance changes over time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114969656B_ABST
    Figure CN114969656B_ABST
Patent Text Reader

Abstract

The present invention provides a streaming histogram publishing method and system of a weighted sliding window under differential privacy, which relates to the field of information security technology. The present invention first creates a new sketch structure to maintain the counting information of each histogram interval of each time instance. Then, the present invention proposes a selective publishing mechanism, which selects better counting information by using the difference between the interval count value and the noise value of each histogram interval approximation, and adopts greedy grouping for all interval counts in the weighted sliding window, thereby ensuring the competitive availability of query data in most cases. The present invention can quickly process data streams based on weighted sliding windows and ensure the competitive availability of published data in most cases.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information security technology, and in particular to a method and system for publishing a streaming histogram of a weighted sliding window under differential privacy. Background Art

[0002] With the rapid development of big data and the Internet of Things (IoT), streaming data (data streams) are ubiquitous in various real-world scenarios, such as real-time traffic flows and hospital patient information data streams. Histograms, as an important statistical method for capturing the distribution information of streaming data, play a vital role in real-time analysis applications in many such scenarios. However, if histograms are directly published without privacy protection, sensitive personal information may be exposed to malicious adversaries who may profit from the published data. Therefore, continuously building publicly available histograms on streaming data is becoming increasingly important for data privacy-sensitive analysis applications.

[0003] Generally speaking, people tend to be more interested in recent data than old data, because the importance of elements decreases as they age. Therefore, a weighted sliding window model is considered, which generalizes the traditional sliding window model by adding a weighting factor γ∈[0,1]. The weighted sliding window model has a wide range of applications in the prior art. For example, considering a monitoring system in a certain network scenario, recent data packets are considered to be more important than old data packets because they can reflect the network status more accurately and timely. Therefore, the weighted sliding window model is often used in the data streams of these online monitoring systems. Another application example is in the scenario of social networks, where recent data is greater than old data when building trust relationships between users.

[0004] Currently, there are many research works on data publishing, whether for static datasets or dynamic data streams. However, the methods proposed in the existing literature are not suitable for weighted sliding window models where the importance of data decays over time, because they always need to buffer all elements in each sliding window. In particular, in weighted sliding window histogram publishing, they have two shortcomings:

[0005] (1) Existing methods do not have an effective mechanism and attach more importance to new elements than old elements;

[0006] (2) When constructing a histogram, existing methods need to repeatedly scan each element contained in each sliding window, which results in high computational overhead and high storage burden. Summary of the invention

[0007] The purpose of the present invention is to provide a streaming histogram publishing method and system for weighted sliding windows under differential privacy. By using a series of weighted sliding windows to model the data stream, a new sketch data structure is creatively proposed to store each weighted sliding window. Specifically, in the weighted sliding window model, a weighting factor is used to characterize the importance of the data, and the weighting factor is specified by the user according to actual needs. The use of the new sketch data structure can not only significantly reduce the computational cost, but also adaptively control the difference between real data and noise data, thereby ensuring that the weighted sliding window model has competitive availability for query data in most cases.

[0008] To achieve the above objectives, the present invention proposes the following technical solution: a streaming histogram publishing method of a weighted sliding window under differential privacy, comprising:

[0009] Determine the interval of the noise histogram of the data to be released in the data stream;

[0010] Determine the optimal privacy budget allocation factor α, and allocate the overall privacy budget ε to the first privacy budget αε and the second privacy budget ε(1-α);

[0011] For each interval of the noisy histogram to be published, an approximate estimation sketch structure is constructed to approximate the data in the weighted sliding window to obtain the interval count values ​​of all intervals;

[0012] Add the first privacy budget αε to the noisy histogram to be published, and obtain the first part of the privacy budget noise value in each interval;

[0013] Determine the approximate statistical frequency of each interval according to the interval count value of any interval of the noisy histogram to be released and the corresponding first part of the privacy budget noise value, and construct the approximate statistical histogram at the current moment according to the approximate statistical frequency of each interval;

[0014] The second part of the privacy budget ε(1-α) is used to cluster the sorted intervals of the approximate statistical histogram at the current moment according to the greedy clustering algorithm to obtain the noisy histogram of the sliding window at the current moment;

[0015] Publishes the noisy histogram of the sliding window at the current moment.

[0016] Furthermore, the method for determining the privacy budget allocation factor α is as follows:

[0017] Small samples are used for preprocessing, and different values ​​are set for the privacy budget allocation factor α;

[0018] Calculate the mean square error between the noise value and the true value of each interval of the noise histogram to be released at each value;

[0019] The value of the privacy budget allocation factor corresponding to the minimum mean square error is selected as the optimal privacy budget allocation factor α.

[0020] Furthermore, the process of constructing the approximate estimation sketch structure to approximate the data in the weighted sliding window and obtain the interval count value is as follows:

[0021] Determine whether the current data entering the weighted sliding window data stream meets the interval of the noise histogram judgment statistics to be released; if the current data meets the current interval range, the current data is set to 1; if the current data does not meet the current interval range, the current data is set to 0;

[0022] The weighted sliding window is divided into blocks, and the approximate error threshold θ of the weighted sliding window and the weighted count value y of the current timestamp are calculated. The calculation formulas are: y=y×γ+x t ; Where W represents the size of the sliding window, γ represents the weighting factor, β represents the approximate error factor, S i [t-W+1,t] represents the sliding window of the i-th binary data stream, x t Represents the current sliding window S i An element instance in [t-W+1,t];

[0023] Determine the data flow S i [t-W+1,t] Whether there is an expired data element at the current timestamp;

[0024] Calculate the interval count value of the current timestamp When the data stream S i [t-W+1,t] generates an expired data element at the current timestamp, then When the data stream S i [t-W+1,t] has no expired data element at the current timestamp, then Where B represents a two-dimensional array for storing weighted sliding window count information, where B1(i) represents the first sub-array, recording the timestamp of the current element in the data stream, and B2(i) represents the second sub-array, storing the i-th binary data stream S i The interval count value of [t-W+1,t] old(B1(i)) represents the first subarray of the oldest block, and old(B2(i)) represents the second subarray of the oldest block;

[0025] Determine the interval count value of the current timestamp The size of the interval count value All results less than 0 are set to 0 to obtain the count values ​​of all intervals in the current weighted sliding window.

[0026] Furthermore, the process of determining the approximate statistical frequency of each interval according to the interval count value of any interval of the noisy histogram to be published and the corresponding first part of the privacy budget noise value is:

[0027] Determine the size of the approximate error and the noise threshold, and determine the approximate statistical frequency; the approximate error is the difference between the interval count value and the true value, and the noise threshold represents the maximum difference between the noise value of the first part of the privacy budget and the true value

[0028] When the approximate error threshold is less than the noise threshold, the approximate statistical frequency is the interval count value. When the noise threshold is less than the approximate error, the approximate statistical frequency is the noise-added value, that is, Among them, G i Indicates the true value of the noise histogram calculation interval to be released;

[0029] Determine the size of the approximate statistical frequency, set all the results whose approximate statistical frequency is less than 0 to 0, and obtain the approximate statistical frequency of all intervals in the current weighted sliding window.

[0030] Furthermore, the process of clustering the sorted intervals of the approximate statistical histogram at the current moment using the second part of the privacy budget ε(1-α) according to the greedy clustering algorithm is as follows:

[0031] Approximate statistical frequency of all intervals in the weighted sliding window according to the sorting algorithm Sort and calculate the error between each frequency and other frequencies when combined and when not combined;

[0032] Determining interval grouping includes: when the merging error of two intervals is less than the non-merging error, merging the two intervals and setting them as one group; when the merging error of two intervals is greater than the non-merging error, not merging the two intervals and setting them as two groups; wherein the merging error is the result of merging the intervals and the square difference between the average value of each interval and the current value of each interval; the non-merging error is the result of not merging the intervals and the square difference between the average value of each interval and the current value of each interval;

[0033] Regroup all intervals in the current weighted sliding window;

[0034] The approximate statistical frequency value of each group is replaced by the average value of each group, and the second part of the privacy budget of each interval is determined by the ratio of the approximate statistical frequency value in each group to the total number of data statistics in the entire weighted sliding window, so as to add Laplace noise to each group interval;

[0035] Calculate the approximate statistical frequency of each group after adding Laplace noise, determine the size of the approximate statistical frequency, and set all the results with approximate statistical frequency less than 0 to 0;

[0036] Get the noisy histogram of the sliding window at the current moment.

[0037] Furthermore, the specific process of the interval grouping is as follows:

[0038] The first interval of the sorted approximate statistical histogram is grouped by itself, and the size of the noise error introduced by the second interval after it is added to the current group and the noise error introduced by the new group re-established with the second interval as the starting point is determined; if the noise error introduced by adding the current group is smaller than that introduced by establishing a new group, then add the current group, otherwise establish a new group; until noise is added to all groups of the noisy histogram.

[0039] Another technical solution of the present invention discloses a streaming histogram publishing system of a weighted sliding window under differential privacy, the system comprising the following program modules:

[0040] A first determination module, used to determine the interval of the noise histogram of data to be released in the data stream;

[0041] The second determination module is used to determine the privacy budget allocation factor α, and allocate the overall privacy budget ε to the first part privacy budget αε and the second part privacy budget ε(1-α);

[0042] A construction module is used to construct an approximate estimation sketch structure for each interval of the noisy histogram to be released, to perform approximate estimation on the data in the weighted sliding window, and obtain interval count values ​​of all intervals;

[0043] The first processing module is used to add a first privacy budget αε to the noisy histogram to be published, and obtain a first part of the privacy budget noise value of each interval;

[0044] A third determination module is used to determine the approximate statistical frequency of each interval according to the interval count value of any interval of the noisy histogram to be released and the corresponding first part of the privacy budget noise value, and construct an approximate statistical histogram at the current moment according to the approximate statistical frequency of each interval;

[0045] The second processing module is used to use the second part of the privacy budget ε(1-α) to perform clustering processing on the sorted intervals of the approximate statistical histogram at the current moment according to the greedy clustering algorithm to obtain the noisy histogram of the sliding window at the current moment;

[0046] The publishing module is used to publish the noisy histogram of the sliding window at the current moment.

[0047] Furthermore, the construction module performs approximate estimation on the data in the weighted sliding window by constructing an approximate estimation sketch structure, and the process of obtaining the interval count value is as follows:

[0048] Determine whether the current data entering the weighted sliding window data stream meets the interval of the noise histogram judgment statistics to be released; if the current data meets the current interval range, the current data is set to 1; if the current data does not meet the current interval range, the current data is set to 0;

[0049] The weighted sliding window is divided into blocks, and the approximate error threshold θ of the weighted sliding window and the weighted count value y of the current timestamp are calculated. The calculation formulas are: y=y×γ+x t ; Where W represents the size of the sliding window, γ represents the weighting factor, β represents the approximate error factor, S i [t-W+1,t] represents the sliding window of the i-th binary data stream, x t Represents the current sliding window S i An element instance in [t-W+1,t];

[0050] Determine the data flow S i [t-W+1,t] Whether there is an expired data element at the current timestamp;

[0051] Calculate the interval count value of the current timestamp When the data stream S i [t-W+1,t] generates an expired data element at the current timestamp, then When the data stream S i [t-W+1,t] has no expired data element at the current timestamp, then Where B represents a two-dimensional array for storing weighted sliding window count information, where B1(i) represents the first sub-array, recording the timestamp of the current element in the data stream, and B2(i) represents the second sub-array, storing the i-th binary data stream S i The interval count value of [t-W+1,t] old(B1(i)) represents the first subarray of the oldest block, and old(B2(i)) represents the second subarray of the oldest block;

[0052] Determine the interval count value of the current timestamp The size of the interval count value All results less than 0 are set to 0 to obtain the count values ​​of all intervals in the current weighted sliding window.

[0053] Furthermore, the process of the third determination module determining the approximate statistical frequency of each interval is as follows:

[0054] Determine the size of the approximate error and the noise threshold, and determine the approximate statistical frequency; the approximate error is the difference between the interval count value and the true value, and the noise threshold represents the maximum difference between the noise value of the first part of the privacy budget and the true value

[0055] When the approximate error threshold is less than the noise threshold, the approximate statistical frequency is the interval count value. When the noise threshold is less than the approximate error, the approximate statistical frequency is the noise-added value, that is, Among them, G i Indicates the true value of the noise histogram calculation interval to be released;

[0056] Determine the size of the approximate statistical frequency, set all the results whose approximate statistical frequency is less than 0 to 0, and obtain the approximate statistical frequency of all intervals in the current weighted sliding window.

[0057] The present invention also discloses an electronic device, which includes a memory and a processor, wherein the memory is used to store at least one instruction, and the processor is used to execute the at least one instruction to implement the above-mentioned streaming histogram publishing method of the weighted sliding window under differential privacy.

[0058] It can be seen from the above technical solutions that the technical solutions of the present invention have the following beneficial effects:

[0059] (1) The method and system for publishing streaming histograms of weighted sliding windows under differential privacy disclosed in the present invention create a new sketch structure, denoted as AESketch, to maintain the count information of each histogram interval at each time instance; the sketch structure AESketch selectively compresses the count information of elements in the data stream D and their timestamps into a two-dimensional array, quickly processes the data stream data in the weighted sliding window model, effectively reduces the running time and memory consumption, and reduces the hardware conditions of the software, so that it can be used in places with harsh hardware conditions.

[0060] (2) The method and system for publishing streaming histograms of weighted sliding windows under differential privacy disclosed in the present invention propose a selective publishing mechanism; the mechanism uses the difference between the approximate statistical information and the noise value of each histogram interval to select better counting information, and adopts greedy grouping for all interval counts in the weighted sliding window. Therefore, the present invention can not only significantly reduce the computational cost, but also adaptively control the difference between real data and noise data by controlling the privacy allocation budget allocation factor α, ensuring that the weighted sliding window model has competitive availability of query data in most cases.

[0061] It should be appreciated that all combinations of the foregoing concepts, as well as additional concepts described in greater detail below, may be considered to be part of the inventive subject matter of the present disclosure, provided such concepts are not mutually inconsistent.

[0062] The foregoing and other aspects, embodiments and features of the present invention can be more fully understood from the following description in conjunction with the accompanying drawings. Other additional aspects of the present invention, such as the features and / or beneficial effects of the exemplary embodiments, will be apparent from the following description or learned from the practice of the specific embodiments according to the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] The drawings are not intended to be drawn to scale. In the drawings, each identical or nearly identical component shown in various figures may be represented by the same reference numeral. For clarity, not every component is labeled in every figure. Embodiments of various aspects of the present invention will now be described by way of example and with reference to the accompanying drawings, in which:

[0064] Figure 1 The schematic diagram of the weighted sliding window of the present invention;

[0065] Figure 2 Schematic diagram of the privacy budget allocation results for the efficient streaming histogram publishing algorithm;

[0066] Figure 3(a) shows the total running time of the UK car accident dataset under different window sizes when the privacy budget is 0.5 in Example 1;

[0067] Figure 3(b) shows the total running time of the UK car accident dataset under different window sizes when the privacy budget is 1 in Example 1;

[0068] Figure 3(c) shows the total running time of the UK car accident dataset under different window sizes when the privacy budget is 1.5 in Example 1;

[0069] Figure 4(a) shows the accuracy of the UK car accident dataset under different window sizes when the privacy budget is 0.5 in Example 1;

[0070] Figure 4(b) shows the accuracy of the UK car accident dataset under different window sizes when the privacy budget is 1 in Example 1;

[0071] Figure 4(c) shows the accuracy of the UK car accident dataset under different window sizes when the privacy budget is 1.5 in Example 1;

[0072] Figure 5(a) shows the accuracy of the New York yellow taxi travel dataset under different window sizes when the privacy budget is 0.5 in Example 2;

[0073] Figure 5(b) shows the accuracy of the New York yellow taxi travel dataset under different window sizes when the privacy budget is 1 in Example 2;

[0074] Figure 5(c) shows the accuracy of the New York yellow taxi travel dataset under different window sizes when the privacy budget is 1.5 in Example 2;

[0075] Figure 6(a) shows the accuracy of the UK car accident dataset under different weighting factors selected when the privacy budget is 0.5 in Example 1;

[0076] FIG6( b ) shows the accuracy of the UK car accident dataset under different weighting factors when the privacy budget is 1 in Example 1;

[0077] Figure 6(c) shows the accuracy of Example 1 under different weighting factors for the UK car accident dataset when the privacy budget is 1.5;

[0078] FIG7( a ) shows the accuracy of Example 2 under different weighting factors selected for the New York yellow taxi travel dataset when the privacy budget is 0.5;

[0079] FIG7( b ) shows the accuracy of Example 2 under different weighting factors selected for the New York yellow taxi travel dataset when the privacy budget is 1;

[0080] Figure 7(c) shows the accuracy of Example 2 under different weighting factors for the New York yellow taxi travel dataset when the privacy budget is 1.5;

[0081] Figure 8(a) shows the accuracy of the UK car accident dataset with different approximation error factors selected when the privacy budget is 0.5 in Example 1;

[0082] FIG8( b ) shows the accuracy of the UK car accident dataset with different approximation error factors selected when the privacy budget is 1 in Example 1;

[0083] Figure 8(c) shows the accuracy of the UK car accident dataset with different approximation error factors selected when the privacy budget is 1.5 in Example 1;

[0084] FIG9( a ) shows the accuracy of the New York yellow taxi travel dataset with different approximate error factors when the privacy budget is 0.5 in Example 2;

[0085] FIG9( b ) shows the accuracy of the New York yellow taxi travel dataset with different approximate error factors when the privacy budget is 1 in Example 2;

[0086] Figure 9(c) shows the accuracy of the New York yellow taxi travel dataset with different approximate error factors when the privacy budget is 1.5 in Example 2;

[0087] Fig.10This is a flow chart of the streaming histogram publishing method of the weighted sliding window under differential privacy of the present invention. DETAILED DESCRIPTION

[0088] In order to make the purpose, technical solution and advantages of the embodiment of the present invention clearer, the technical solution of the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings of the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all of the embodiments. Based on the described embodiment 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. Unless otherwise defined, the technical terms or scientific terms used herein should be the common meaning understood by people with general skills in the field to which the present invention belongs.

[0089] The words "first", "second" and similar words used in the patent application specification and claims of the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. Similarly, unless the context clearly indicates otherwise, the singular form of "a", "an" or "the" and other similar words do not indicate a quantitative limitation, but indicate the existence of at least one. "Include" or "comprises" and other similar words mean that the elements or objects appearing before "include" or "comprises" include the features, wholes, steps, operations, elements and / or components listed after "include" or "comprises", and do not exclude the existence or addition of one or more other features, wholes, steps, operations, elements, components and / or their collections.

[0090] In the prior art, although there are many methods for publishing histograms based on sliding windows in data stream environments, these methods cannot be directly applied to time-importance data, cannot protect weighted data, and face the problem of high histogram publishing errors. In view of this, this embodiment provides a streaming histogram publishing method and system for weighted sliding windows under differential privacy. This embodiment further optimizes the histogram publishing technology under differential privacy conditions by combining sliding windows and differential privacy technologies. In order to solve the problem that the importance of elements in data streams decreases over time, this paper uses a series of weighted sliding windows to model the data stream and studies how to continuously publish histograms on these windows to solve the problem.

[0091] The present invention performs a single-pass scan on a given data stream and uses a weighted sliding window model for statistical publishing. The efficient streaming histogram publishing (ESHP) algorithm adopted by the present invention first creates an approximate statistical sketch structure AESketch, which can store the key statistical information of each element in the data stream into an efficient memory sketch data structure; then, a selective publishing mechanism is used for publishing, which uses the difference between the approximate statistical information and the noise value of each histogram interval to select better counting information, and greedily groups all interval counts in a weighted sliding window, ensuring the competitive availability of query data in most cases.

[0092] Given a binary data stream D, D = {x1, x2, ···, x n ,···}, a sliding window of size W, a weighting factor γ, γ∈[0,1], a timestamp t, t>0, the weighted sliding window refers to the newer W elements in the data stream D; the weighted importance of each element in the weighted sliding window is controlled by its timestamp and γ, and the weighted importance of the weighted sliding window at timestamp t is composed of the following two parts:

[0093] (a) The sliding window at timestamp t is

[0094] (b) A weight array is <γ W-1 ,γ W-2 ,···,γ 0 >, assign each element in the sliding window With a different weight I(x i )=γ t-i i association, i represents element x i Located in sliding window The i-th position within .

[0095] The weighted sliding window principle diagram is as follows Figure 1 As shown in the figure. From the definition of weighted sliding window, we can see that the latest element The weight is the largest, which is 1, and the latest second element has the second largest weight, which is γ, and so on.

[0096] Combined with the above data stream D, the streaming histogram publishing method of weighted sliding window under differential privacy disclosed in the present invention is as follows: Fig.10 As shown, the specific steps include:

[0097] (1) determining the interval of the noise histogram of the data to be released in the data stream;

[0098] (2) The optimal privacy budget allocation factor α is determined by using small sample preprocessing, and the overall privacy budget ε is divided into two parts. The first part of the privacy budget is set to αε, denoted as ε1, which is used for the selective release mechanism. The second part of the privacy budget is set to ε(1-α), denoted as ε2, which is used for the greedy clustering part.

[0099] The calculation process of the optimal privacy budget allocation factor α is as follows: the optimal value is found by adjusting the privacy budget allocation factor α to control the availability of existing data. Since the published data has the highest availability, the mean square error between the noise value and the true value of each interval of the noisy histogram to be published is calculated under each value by setting different values ​​of the privacy budget allocation factor α; the value of the privacy budget allocation factor corresponding to the minimum mean square error is selected as the optimal privacy budget allocation factor α; the mean square error is calculated as the sum of the squares of the absolute values ​​of the differences between the true value and the noise value.

[0100] (3) For each interval of the noisy histogram to be published, an approximate estimation sketch structure is constructed to approximate the data in the weighted sliding window to obtain the interval count values ​​of all intervals; the details are as follows:

[0101] Determine whether the current data entering the weighted sliding window data stream meets the interval of the noise histogram judgment statistics to be released; if the current data meets the current interval range, the current data is set to 1; if the current data does not meet the current interval range, the current data is set to 0;

[0102] The weighted sliding window is divided into blocks, and the approximate error threshold θ of the weighted sliding window and the weighted count value y of the current timestamp are calculated. The calculation formulas are: y=y×γ+x t ; Where W represents the size of the sliding window, γ represents the weighting factor, β represents the approximate error factor, S i [t-W+1,t] represents the sliding window of the i-th binary data stream, x t Represents the current sliding window S i An element instance in [t-W+1,t];

[0103] Determine the data flow S i [t-W+1,t] Whether there is an expired data element at the current timestamp;

[0104] Calculate the interval count value of the current timestamp When the data stream S i [t-W+1,t] generates an expired data element at the current timestamp, then When the data stream S i [t-W+1,t] has no expired data element at the current timestamp, then Where B represents a two-dimensional array for storing weighted sliding window count information, where B1(i) represents the first sub-array, recording the timestamp of the current element in the data stream, and B2(i) represents the second sub-array, storing the i-th binary data stream S i The interval count value of [t-W+1,t] old(B1(i)) represents the first subarray of the oldest block, and old(B2(i)) represents the second subarray of the oldest block;

[0105] Determine the interval count value of the current timestamp The size of the interval count value All results less than 0 are set to 0 to obtain the count values ​​of all intervals in the current weighted sliding window.

[0106] (4) Add the first privacy budget αε to the noisy histogram to be published, and obtain the first part of the privacy budget noise value of each interval;

[0107] (5) Determine the approximate statistical frequency of each interval according to the interval count value of any interval of the noisy histogram to be released and its corresponding first part of the privacy budget noise value, and construct the approximate statistical histogram at the current moment according to the approximate statistical frequency of each interval;

[0108] That is, a selective release mechanism is proposed, which uses the difference between the interval count value of each histogram interval and the privacy budget noise value of the first part to select a better release value; specifically, comparing the difference between the interval count value and the true value to select a suitable approximate statistical frequency includes the following steps:

[0109] Determine whether the weighted count value of the weighted sliding window at the current timestamp exceeds the approximate error threshold of the weighted sliding window, that is, determine the size of the approximate error and the noise threshold, and determine the approximate statistical frequency; where the approximate error is the difference between the interval count value and the true value, and the noise threshold represents the maximum difference between the noise value of the first part of the privacy budget and the true value

[0110] When the approximate error threshold is less than the noise threshold, the approximate statistical frequency is the interval count value. When the noise threshold is less than the approximate error, the approximate statistical frequency is the noise-added value, that is, Among them, G i Indicates the true value of the noise histogram calculation interval to be released;

[0111] Determine the size of the approximate statistical frequency, set all the results whose approximate statistical frequency is less than 0 to 0, and obtain the approximate statistical frequency of all intervals in the current weighted sliding window.

[0112] (6) Use the second part of the privacy budget ε(1-α) to cluster the intervals of the sorted approximate statistical histogram at the current moment, and optimize the error of the data within the group to obtain the noisy histogram of the sliding window at the current moment;

[0113] The process includes the following:

[0114] Insert the approximate statistical frequency of each interval of the current sliding window after the screening in step (5) into the current histogram statistical data;

[0115] Sort the approximate statistical frequencies of all intervals in the weighted sliding window according to the sorting algorithm, and calculate the error between each frequency and other frequencies when combined and when not combined;

[0116] Determining interval grouping includes: when the error of merging two intervals is less than the error of not merging, merging the two intervals and setting them as one group; when the error of merging two intervals is greater than the error of not merging, not merging the two intervals and setting them as two groups; wherein the error of merging is the result of merging the intervals and the square difference between the average value of each interval and the current value of each interval; the error of not merging is the result of not merging the intervals and the square difference between the average value of each interval and the current value of each interval;

[0117] Regroup all intervals in the current weighted sliding window;

[0118] The approximate statistical frequency value of each group is replaced by the average value of each group, and the second part of the privacy budget of each interval is determined by the ratio of the approximate statistical frequency value in each group to the total number of data statistics in the entire weighted sliding window, so as to add Laplace noise to each group interval;

[0119] Calculate the approximate statistical frequency of each group after adding Laplace noise, determine the size of the approximate statistical frequency, and set all the results with approximate statistical frequencies less than 0 to 0 to reduce the error caused by approximate statistics;

[0120] Get the noisy histogram of the sliding window at the current moment.

[0121] (7) Publish the noisy histogram of the sliding window at the current moment.

[0122] The efficient streaming histogram publishing (ESHP) algorithm proposed in the present invention satisfies ε-differential privacy and is implemented as follows with the following two points.

[0123] (1) The ESHP algorithm proposed in this invention selects a suitable value by comparing the difference between the estimated value of the adaptively selected part and the noise value (the adaptively selected part satisfies ε1-differential privacy);

[0124] (2) The ESHP algorithm adopts a greedy grouping strategy and adds Laplace noise to the grouping part (so the grouping part satisfies ε2-differential privacy).

[0125] Based on the above two facts and ε=ε1+ε2, according to the combined properties of differential privacy, it is concluded that the ESHP algorithm satisfies ε-differential privacy.

[0126] Secondly, when considering the time complexity and space complexity of the ESHP algorithm and analyzing the computational cost and running time, the following prerequisites are first considered.

[0127] The condition is that the number of blocks k in the two-dimensional array B used by the approximate estimation sketch structure algorithm adopted by the present invention does not exceed

[0128] The reason is that, given the known facts: (1) by using the properties of the weighted sliding window, all windows are set to 1, thus obtaining the maximum count value (2) Approximately estimate the block threshold of each block in the sketch structure algorithm: From (1) and (2), we can get that the maximum number of blocks used in the two-dimensional array B is

[0129] The time complexity analysis of the ESHP algorithm of the present invention is as follows:

[0130] Assuming that the number of histogram intervals published in the ESHP algorithm is M, the time cost of the ESHP algorithm is

[0131] According to the prerequisites for the application of the approximate estimation sketch structure algorithm, AESketch needs to be in a time complexity of When querying the histogram of M intervals, the time complexity of AESketch is Since the ESHP algorithm uses a greedy grouping strategy, it needs to sort the M interval counts, so the time cost of greedy grouping is O(Mlog(M)); based on this, the time cost of the ESHP algorithm is

[0132] The space complexity analysis of the ESHP algorithm of the present invention is as follows:

[0133] Assuming that the number of histogram intervals in the ESHP algorithm is M, the ESHP algorithm requires bits of memory.

[0134] The space cost of the ESHP algorithm is mainly determined by the data structure formed by AESketch and the data structure formed by the greedy grouping part. According to the approximate estimation sketch structure algorithm, it is known that the binary array B requires bit, therefore, requires bits of memory to process M binary data streams. During the sorting process, the greedy grouping part occupies the main space memory, and the number of histogram intervals represents the memory usage size M. Therefore, the memory space used by the ESHP algorithm is

[0135] In the following, in combination with the accompanying drawings and specific embodiments, the method and system for publishing streaming histograms of weighted sliding windows under differential privacy disclosed in the present invention are further specifically introduced.

[0136] Example 1

[0137] The UK traffic accident dataset extracts detailed road safety data on personal injury road accidents in the UK from 2005 to 2014. Each record contains attributes such as the age, gender, severity, social class, and type of casualty, where the age range is [0, 100].

[0138] Example 2

[0139] The New York Yellow Taxi Trip Dataset extracts detailed trip data sets of New York yellow taxis in 2019. Each record includes attributes such as pick-up date / time, pick-up location, trip distance, rate type, and driver-reported passenger count. The passenger count interval is [0, 6], and a histogram is published over time.

[0140] The ESHP algorithm, FAST algorithm, RTP_DMM algorithm and APB algorithm are respectively used to process the data of Example 1 and Example 2, and histograms are published.

[0141] Combination Figure 2 In the comparative analysis of the privacy budget allocation implementation example of the ESHP algorithm shown in the figure, the results show that: in step (2), as the privacy budget allocation factor α increases, that is, the first part of the privacy budget ε1 increases, the mean square error of the published data will decrease; the reason is that the ESHP algorithm uses the difference between the approximate statistical value and the noise value to select the appropriate value, which leads to a reduction in the total error of ESHP.

[0142] Combination Figures 3(a) to 3(c) As shown in FIG. 1 , in the comparative analysis of the total running time of Example 1 under different weighted sliding window sizes, the results show that the total running time of the three algorithms FAST, APB and RTP_DMM increases with the increase of the sliding window, and the increase of the sliding window has little effect on the total running time of the ESHP algorithm; the reason is that the preprocessing time of the ESHP algorithm is The size of the sliding window affects the space complexity of the ESHP algorithm, but does not affect the total running time. The RTP_DMM algorithm uses a binary tree and requires O(log2 W) processing time. When the APB algorithm and the FAST algorithm need to publish the histogram in the window, they both need to spend the most time to cache all the data in the sliding window, and have a logarithmic linear relationship with the sliding window size.

[0143] Combination Figure 4(a) to Figure 5(c) In the comparative analysis of the accuracy of Example 1 and Example 2 under different sliding window sizes, the results show that as the weighted sliding window size increases, the ESHP algorithm has the smallest mean square error among the four algorithms; the FAST algorithm needs to add noise to each data, and its mean square error is relatively high; the RTP_DMM algorithm needs to add noise to the statistical information in the weighted sliding window, resulting in the RTP_DMM algorithm having a mean square error smaller than that of the FAST algorithm; due to the increase in the sliding window size in the ESHP algorithm, the approximate statistical error in the sliding window tends to a constant, resulting in the total error tending to a constant. The ESHP algorithm adopts an adaptive noise addition method to avoid the huge error caused by directly adding noise in the sliding window. When the weighted sliding window is small, the mean square error of the APB algorithm is smaller than that of the ESHP algorithm; as the window increases, the mean square error of the ESHP algorithm is smaller than that of the APB algorithm, the FAST algorithm and the RTP_DMM algorithm. In summary, in most cases, the ESHP algorithm ensures the competitive availability of published data.

[0144] Combination Figure 6(a) to Figure 7(c) In the comparative analysis of the accuracy under different weighting factors in the embodiment, the results show that the mean square error of the ESHP algorithm and the APB algorithm is positively correlated with the weighting coefficient, and the mean square error of the FAST algorithm and the RTP_DMM algorithm is a constant value and has nothing to do with the weighting factor. When the weighting factor is small, the mean square error of the ESHP algorithm is smaller than that of the FAST algorithm, the RTP_DMM algorithm and the APB algorithm. The reason for this phenomenon is that the increase in the weighting factor will change the global sensitivity and affect the increase in noise. As the weighting factor increases, the ESHP algorithm releases data to ensure competitive availability in most cases.

[0145] Combination Figure 8(a) to Figure 9(c)The comparative analysis of the accuracy of Example 1 and Example 2 under different approximate error factors shows that the query error of the ESHP and APB algorithms is positively correlated with the approximate error factor, while the mean square error of the FAST algorithm and the RTP_DMM algorithm is a constant value and has nothing to do with the approximate error coefficient. When the approximate error coefficient is small, the mean square error of the ESHP algorithm is significantly lower than that of the APB algorithm. There are two reasons for this: (1) The increase in the approximate error factor will change the global sensitivity and the increase in Laplace noise, resulting in an increase in the total error of the histogram; (2) The ESHP algorithm uses an adaptive selection algorithm to avoid directly adding Laplace noise to the weighted sliding window, resulting in an increase in the total error of the histogram. The mean square error of the RTP_DMM algorithm is independent of the approximate error factor, resulting in the same error. As the approximate error factor increases, the error of the ESHP algorithm will be greater than the error of the RTP_DMM algorithm. Therefore, the facts show that the ESHP algorithm is highly competitive in most cases.

[0146] The streaming histogram publishing method of the weighted sliding window under differential privacy disclosed in the embodiment of the present invention can quickly publish data of different importance in a data stream environment and is applicable to a weighted sliding window model. The present invention can quickly publish histogram data in a data stream environment at a low space cost. Theoretical analysis shows that the method can effectively improve data availability and reduce running time while reducing the privacy budget. The experimental results on two different real data sets in Example 1 and Example 2 also verify that the present invention is significantly superior to existing methods in terms of data availability and running time.

[0147] In an embodiment of the present invention, an electronic device is also provided, which includes a processor and a memory, and the memory is used to store at least one instruction; when the processor executes the at least one instruction, the streaming histogram publishing method of the weighted sliding window under differential privacy disclosed in the above embodiment is run.

[0148] The above-mentioned streaming histogram publishing method of weighted sliding window under differential privacy can be run in a processor, or can also be stored in a computer-readable storage medium, which includes permanent and non-permanent, removable and non-removable media. Information storage can be implemented by any method or technology. Information can be a computer-readable instruction, a data structure, a module of a program, or other data. Examples of storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined in this article, storage media does not include temporary computer-readable media, such as modulated data signals and carriers.

[0149] These computer programs can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps of the functions specified in one or more blocks can be implemented by different modules corresponding to different steps.

[0150] Exemplarily, this embodiment provides such a system, namely, a streaming histogram publishing system for weighted sliding windows under differential privacy, which includes the following program modules: a first determination module, used to determine the interval of the noisy histogram of data to be published in the data stream; a second determination module, used to determine the privacy budget allocation factor α, and allocate the overall privacy budget ε to the first part privacy budget αε and the second part privacy budget ε(1-α); a construction module, used to construct an approximate estimation sketch structure for each interval of the noisy histogram to be published, to approximate the data in the weighted sliding window, and obtain the interval count values ​​of all intervals; a first processing module, used to process the interval of the noisy histogram to be published. The first privacy budget αε is added to the noisy histogram to obtain the first part of the privacy budget noise value of each interval; the third determination module is used to determine the approximate statistical frequency of each interval according to the interval count value of any interval of the noisy histogram to be published and the corresponding first part of the privacy budget noise value, and construct the approximate statistical histogram at the current moment according to the approximate statistical frequency of each interval; the second processing module is used to cluster the sorted intervals of the approximate statistical histogram at the current moment according to the greedy clustering algorithm using the second part of the privacy budget ε(1-α) to obtain the noisy histogram of the sliding window at the current moment; the publishing module is used to publish the noisy histogram of the sliding window at the current moment.

[0151] The system is used to implement the functions of the method in the above-mentioned embodiment. Each module in the system corresponds to each step in the method. Those that have been explained in the method will not be repeated here.

[0152] For example, the construction module makes an approximate estimate of the data in the weighted sliding window by constructing an approximate estimation sketch structure, and the process of obtaining the interval count value is as follows:

[0153] Determine whether the current data entering the weighted sliding window data stream meets the interval of the noise histogram judgment statistics to be released; if the current data meets the current interval range, the current data is set to 1; if the current data does not meet the current interval range, the current data is set to 0;

[0154] The weighted sliding window is divided into blocks, and the approximate error threshold θ of the weighted sliding window and the weighted count value y of the current timestamp are calculated. The calculation formulas are: y=y×γ+x t ; Where W represents the size of the sliding window, γ represents the weighting factor, β represents the approximate error factor, S i [t-W+1,t] represents the sliding window of the i-th binary data stream, x t Represents the current sliding window S i An element instance in [t-W+1,t];

[0155] Determine the data flow S i[t-W+1,t] Whether there is an expired data element at the current timestamp;

[0156] Calculate the interval count value of the current timestamp When the data stream S i [t-W+1,t] generates an expired data element at the current timestamp, then When the data stream S i [t-W+1,t] has no expired data element at the current timestamp, then Where B represents a two-dimensional array for storing weighted sliding window count information, where B1(i) represents the first sub-array, recording the timestamp of the current element in the data stream, and B2(i) represents the second sub-array, storing the i-th binary data stream S i Count information of [t-W+1,t] old(B1(i)) represents the first subarray of the oldest block, and old(B2(i)) represents the second subarray of the oldest block;

[0157] Determine the interval count value of the current timestamp The size of the interval count value All results less than 0 are set to 0 to obtain the count values ​​of all intervals in the current weighted sliding window.

[0158] For another example, the process of the third determination module determining the approximate statistical frequency of each interval is:

[0159] Determine the size of the approximate error and the noise threshold, and determine the approximate statistical frequency; the approximate error is the difference between the interval count value and the true value, and the noise threshold represents the maximum difference between the noise value of the first part of the privacy budget and the true value

[0160] When the approximate error threshold is less than the noise threshold, the approximate statistical frequency is the interval count value. When the noise threshold is less than the approximate error, the approximate statistical frequency is the noise-added value, that is, Among them, G i Indicates the true value of the noise histogram calculation interval to be released;

[0161] Determine the size of the approximate statistical frequency, set all the results whose approximate statistical frequency is less than 0 to 0, and obtain the approximate statistical frequency of all intervals in the current weighted sliding window.

[0162] This embodiment fully solves the problems that the methods proposed in the prior art for publishing data for static data sets or dynamic data streams are not suitable for weighted sliding window models in which the importance of data decays over time, cannot consider the importance of new and old elements, and the existing methods have high computational overhead and high storage burden. It achieves the rapid release of histogram data in a data stream environment with low space cost, effectively improves data availability and shortens running time.

[0163] Although the present invention has been disclosed as above with preferred embodiments, it is not intended to limit the present invention. A person with ordinary knowledge in the technical field to which the present invention belongs may make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be determined by the definition of the claims.

Claims

1. A streaming histogram publishing method for weighted sliding windows under differential privacy, characterized in that: include: Determine the interval of the noise histogram of the data to be released in the data stream; Determine the optimal privacy budget allocation factor α, and allocate the overall privacy budget ε to the first privacy budget αε and the second privacy budget ε(1-α); For each interval of the noisy histogram to be published, an approximate estimation sketch structure is constructed to approximate the data in the weighted sliding window to obtain the interval count values ​​of all intervals; Add the first privacy budget αε to the noisy histogram to be published, and obtain the first part of the privacy budget noise value in each interval; Determine the approximate statistical frequency of each interval according to the interval count value of any interval of the noisy histogram to be released and the corresponding first part of the privacy budget noise value, and construct the approximate statistical histogram at the current moment according to the approximate statistical frequency of each interval; The second part of the privacy budget ε(1-α) is used to cluster the sorted intervals of the approximate statistical histogram at the current moment according to the greedy clustering algorithm to obtain the noisy histogram of the sliding window at the current moment; Publish the noisy histogram of the sliding window at the current moment; The process of constructing the approximate estimation sketch structure to approximate the data in the weighted sliding window and obtain the interval count value is as follows: Determine whether the current data entering the weighted sliding window data stream meets the interval of the noise histogram judgment statistics to be released; if the current data meets the current interval range, the current data is set to 1; if the current data does not meet the current interval range, the current data is set to 0; The weighted sliding window is divided into blocks, and the approximate error threshold θ of the weighted sliding window and the weighted count value y of the current timestamp are calculated. The calculation formulas are: y=y×γ+x t ; Where W represents the size of the sliding window, γ represents the weighting factor, β represents the approximate error factor, S i [t-W+1,t] represents the sliding window of the i-th binary data stream, x t Represents the current sliding window S i An element instance in [t-W+1,t]; Determine the data flow S i [t-W+1,t] Whether there is an expired data element at the current timestamp; Calculate the interval count value of the current timestamp When the data stream S i [t-W+1,t] generates an expired data element at the current timestamp, then When the data stream S i [t-W+1,t] has no expired data element at the current timestamp, then Where B represents a two-dimensional array for storing weighted sliding window count information, where B1(i) represents the first sub-array, recording the timestamp of the current element in the data stream, and B2(i) represents the second sub-array, storing the i-th binary data stream S i The interval count value of [t-W+1,t] old(B1(i)) represents the first subarray of the oldest block, and old(B2(i)) represents the second subarray of the oldest block; Determine the interval count value of the current timestamp The size of the interval count value All results less than 0 are set to 0 to obtain the count values ​​of all intervals in the current weighted sliding window.

2. The streaming histogram publishing method of weighted sliding window under differential privacy according to claim 1 is characterized in that: The method for determining the privacy budget allocation factor α is: Small samples are used for preprocessing, and different values ​​are set for the privacy budget allocation factor α; Calculate the mean square error between the noise value and the true value of each interval of the noise histogram to be released at each value; The value of the privacy budget allocation factor corresponding to the minimum mean square error is selected as the optimal privacy budget allocation factor α.

3. The streaming histogram publishing method of weighted sliding window under differential privacy according to claim 1 is characterized in that: The process of determining the approximate statistical frequency of each interval according to the interval count value of any interval of the noisy histogram to be published and the corresponding first part of the privacy budget noise value is: Determine the size of the approximate error and the noise threshold, and determine the approximate statistical frequency; the approximate error is the difference between the interval count value and the true value, and the noise threshold represents the maximum difference between the noise value of the first part of the privacy budget and the true value When the approximate error threshold is less than the noise threshold, the approximate statistical frequency is the interval count value. When the noise threshold is less than the approximate error, the approximate statistical frequency is the noise-added value, that is, Among them, G i Indicates the true value of the noise histogram calculation interval to be released; Determine the size of the approximate statistical frequency, set all the results whose approximate statistical frequency is less than 0 to 0, and obtain the approximate statistical frequency of all intervals in the current weighted sliding window.

4. The streaming histogram publishing method of weighted sliding window under differential privacy according to claim 3 is characterized in that: The process of clustering the sorted intervals of the approximate statistical histogram at the current moment using the second privacy budget ε(1-α) according to the greedy clustering algorithm is as follows: Approximate statistical frequency of all intervals in the weighted sliding window according to the sorting algorithm Sort and calculate the error between each frequency and other frequencies when combined and when not combined; Determining interval grouping includes: when the merging error of two intervals is less than the non-merging error, merging the two intervals and setting them as one group; when the merging error of two intervals is greater than the non-merging error, not merging the two intervals and setting them as two groups; wherein the merging error is the result of merging the intervals and the square difference between the average value of each interval and the current value of each interval; the non-merging error is the result of not merging the intervals and the square difference between the average value of each interval and the current value of each interval; Regroup all intervals in the current weighted sliding window; The approximate statistical frequency value of each group is replaced by the average value of each group, and the second part of the privacy budget of each interval is determined by the ratio of the approximate statistical frequency value in each group to the total number of data statistics in the entire weighted sliding window, so as to add Laplace noise to each group interval; Calculate the approximate statistical frequency of each group after adding Laplace noise, determine the size of the approximate statistical frequency, and set all the results with approximate statistical frequency less than 0 to 0; Get the noisy histogram of the sliding window at the current moment.

5. The streaming histogram publishing method of weighted sliding window under differential privacy according to claim 4 is characterized in that: The specific process of the interval grouping is as follows: The first interval of the sorted approximate statistical histogram is grouped by itself, and the size of the noise error introduced by the second interval after it is added to the current group and the noise error introduced by the new group re-established with the second interval as the starting point is determined; if the noise error introduced by adding the current group is smaller than that introduced by establishing a new group, then add the current group, otherwise establish a new group; until noise is added to all groups of the noisy histogram.

6. A streaming histogram publishing system with weighted sliding windows under differential privacy, characterized in that: include: A first determination module, used to determine the interval of the noise histogram of data to be released in the data stream; The second determination module is used to determine the privacy budget allocation factor α, and allocate the overall privacy budget ε to the first part privacy budget αε and the second part privacy budget ε(1-α); A construction module is used to construct an approximate estimation sketch structure for each interval of the noisy histogram to be released, to perform approximate estimation on the data in the weighted sliding window, and obtain interval count values ​​of all intervals; The first processing module is used to add a first privacy budget αε to the noisy histogram to be published, and obtain a first part of the privacy budget noise value of each interval; A third determination module is used to determine the approximate statistical frequency of each interval according to the interval count value of any interval of the noisy histogram to be released and the corresponding first part of the privacy budget noise value, and construct an approximate statistical histogram at the current moment according to the approximate statistical frequency of each interval; The second processing module is used to use the second part of the privacy budget ε(1-α) to perform clustering processing on the sorted intervals of the approximate statistical histogram at the current moment according to the greedy clustering algorithm to obtain the noisy histogram of the sliding window at the current moment; A publishing module is used to publish the noisy histogram of the sliding window at the current moment; The construction module performs approximate estimation on the data in the weighted sliding window by constructing an approximate estimation sketch structure, and the process of obtaining the interval count value is as follows: Determine whether the current data entering the weighted sliding window data stream meets the interval of the noise histogram judgment statistics to be released; if the current data meets the current interval range, the current data is set to 1; if the current data does not meet the current interval range, the current data is set to 0; The weighted sliding window is divided into blocks, and the approximate error threshold θ of the weighted sliding window and the weighted count value y of the current timestamp are calculated. The calculation formulas are: y=y×γ+x t ; Where W represents the size of the sliding window, γ represents the weighting factor, β represents the approximate error factor, S i [t-W+1,t] represents the sliding window of the i-th binary data stream, x t Represents the current sliding window S i An element instance in [t-W+1,t]; Determine the data flow S i [t-W+1,t] Whether there is an expired data element at the current timestamp; Calculate the interval count value of the current timestamp When the data stream S i [t-W+1,t] generates an expired data element at the current timestamp, then When the data stream S i [t-W+1,t] has no expired data element at the current timestamp, then Where B represents a two-dimensional array for storing weighted sliding window count information, where B1(i) represents the first sub-array, recording the timestamp of the current element in the data stream, and B2(i) represents the second sub-array, storing the i-th binary data stream S i Count information of [t-W+1,t] old(B1(i)) represents the first subarray of the oldest block, and old(B2(i)) represents the second subarray of the oldest block; Determine the interval count value of the current timestamp The size of the interval count value All results less than 0 are set to 0 to obtain the count values ​​of all intervals in the current weighted sliding window.

7. The streaming histogram publishing system of weighted sliding window under differential privacy according to claim 6, characterized in that: The process of the third determination module determining the approximate statistical frequency of each interval is as follows: Determine the size of the approximate error and the noise threshold, and determine the approximate statistical frequency; the approximate error is the difference between the interval count value and the true value, and the noise threshold represents the maximum difference between the noise value of the first part of the privacy budget and the true value When the approximate error threshold is less than the noise threshold, the approximate statistical frequency is the interval count value. When the noise threshold is less than the approximate error, the approximate statistical frequency is the noise-added value, that is, Among them, G i Indicates the true value of the noise histogram calculation interval to be released; Determine the size of the approximate statistical frequency, set all the results whose approximate statistical frequency is less than 0 to 0, and obtain the approximate statistical frequency of all intervals in the current weighted sliding window.

8. An electronic device, characterized in that the electronic device includes a memory and a processor, the memory is used to store at least one instruction, and the processor is used to execute the at least one instruction to implement the streaming histogram publishing method of the weighted sliding window under differential privacy as described in any one of claims 1 to 5.