Secure continuous data generation method and apparatus, and computer device
By initializing parameters, calculating errors, and dynamically adjusting the privacy budget, randomized perturbation values are generated, and data is released in layers. This solves the problem of excessive noise in continuous data sequences in differential privacy technology, and achieves more accurate data generation while maintaining privacy and security.
Patent Information
- Application Number
- CN202510239334.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-03
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2045-03-03
AI Technical Summary
Existing differential privacy technologies ignore temporal correlations when processing continuous data sequences, leading to excessive noise and reducing the accuracy of data analysis. How can we improve the accuracy of continuous data sequence analysis while ensuring data privacy and security?
By initializing public and local parameters, recording real data, calculating the error between the fitted dataset and the real dataset, dynamically adjusting the privacy budget, generating randomized perturbation values using a differential privacy mechanism, and releasing data in layers, noise injection is reduced and data accuracy is improved.
At the same level of privacy, reducing noise levels enables more accurate and secure continuous data generation, while differential privacy processing ensures data privacy and security.
Smart Images

Figure CN120257344B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a secure continuous data generation method, apparatus, and computer device. Background Technology
[0002] With the rapid development of mobile devices and IoT technologies, the collection and application of personal data has become a key force driving the intelligent transformation of society. Smartphones, wearable devices, and various IoT terminals can capture multi-dimensional information such as users' health status, geographical location, and activity trajectories in real time, providing rich data resources for personalized services, intelligent transportation, smart cities, and precision medicine. The continuity and high quality of these datasets are attributed to the continuous advancement of artificial intelligence and big data technologies, which has greatly promoted the progress of various industries towards intelligence and automation.
[0003] However, the widespread use of personal data is accompanied by increasingly serious privacy protection challenges. While enjoying the convenience and personalized experience brought by data-driven services, users' sensitive information, such as health status and daily habits, faces the risk of being leaked or misused. Once this data is misused, it may lead to serious consequences such as privacy violations and identity theft, severely undermining users' trust in data sharing and thus hindering the popularization and development of related services.
[0004] To address this challenge, various privacy protection techniques have been developed in current technologies. Differential privacy, as an effective privacy protection strategy, introduces random noise into the original data, making it impossible for external observers to accurately infer the original content of individual data points from the output, thus achieving quantitative control over data privacy. However, differential privacy also faces a series of challenges in its application, especially when processing continuous data sequences. Ignoring temporal correlations often leads to the introduction of excessive noise, reducing the accuracy of data analysis. Therefore, how to improve the accuracy of continuous data sequence analysis while ensuring data privacy and security has become a key issue that urgently needs to be addressed in the development of current data-driven applications. Summary of the Invention
[0005] Therefore, it is necessary to provide a safe and accurate method, apparatus, computer device, computer-readable storage medium, and computer program product for generating secure and continuous data, addressing the aforementioned technical problems.
[0006] Firstly, this application provides a method for generating secure continuous data. The method includes:
[0007] Initialize public and local parameters, and record the real data corresponding to the current moment; the public parameters include the current remaining privacy budget. rThe local parameters include the attenuation factor α, the similarity threshold β, the deviation threshold r, and the size of the fitted dataset l.
[0008] Based on the real dataset, the decay factor α, and the current remaining privacy budget ∈ r To obtain the privacy budget allocated at the current moment ∈ t The real dataset records the real data from the start time to the current time.
[0009] Calculate the error between the fitted dataset and the real dataset, and dynamically adjust the privacy budget based on the calculated error. t The adjusted privacy budget was obtained;
[0010] The adjusted privacy budget and the real data corresponding to the current moment are used as inputs to the differential privacy mechanism to obtain a randomized perturbation value;
[0011] Based on the randomized perturbation value and the deviation threshold r, the first layer of data is obtained. Second-level data Publish the first layer of data and the second layer of data
[0012] In one embodiment, the step of basing the data on the real dataset, the decay factor α, and the current remaining privacy budget ∈ r To obtain the privacy budget allocated at the current moment ∈ t include:
[0013] Based on the real dataset and the attenuation factor α, a fitted dataset of size l is obtained;
[0014] Based on the fitted dataset and the similarity threshold β, the maximum continuous similarity length is obtained as k+1;
[0015] Based on the maximum consecutive similarity length k+1 and the current remaining privacy budget ∈ r To obtain the privacy budget allocated at the current moment ∈ t .
[0016] In one embodiment, obtaining a fitted dataset of size l based on the real dataset and the attenuation factor α includes:
[0017] Using time series data as the X-axis and real data as the Y-axis, a dataset is constructed using real data released at different times in historical records as distributed samples.
[0018] Calculate the attenuation coefficient for each data point in the dataset based on the attenuation factor α;
[0019] Based on the dataset and the attenuation coefficient of each data point, calculate the parameters m and n that minimize the sum of squared errors corresponding to the dataset;
[0020] Using the parameters m and n as the slope and intercept respectively, construct a linear function in one variable;
[0021] Based on the constructed linear function, the fitted data for the next time step is obtained.
[0022] The fitted data at the next time step is combined with the dataset to form a new dataset;
[0023] The new dataset is used as the dataset again. The step of calculating the attenuation coefficient of each data point in the dataset according to the attenuation factor α is repeated l times to obtain a fitted dataset of size l.
[0024] In one embodiment, obtaining the maximum continuous similarity length of k+1 based on the fitted dataset and the similarity threshold β includes:
[0025] Extract a single fitted data point from the fitted dataset and calculate the absolute value of the difference between the extracted fitted data point and the real data.
[0026] If the absolute value of the difference is not greater than the similarity threshold β, then the next fitted data is extracted in an orderly manner, and the step of calculating the absolute value of the difference between the extracted fitted data and the real data is returned until the absolute value of the difference is greater than the similarity threshold β, or all fitted data in the fitted dataset is extracted, and fitted data that meets the conditions is obtained.
[0027] Calculate the total data length of the fitted data that meets the conditions and the real data at the current time, and obtain the maximum continuous similarity length as k+1.
[0028] In one embodiment, the step of basing the maximum consecutive similarity length k+1 on the current remaining privacy budget ∈ r To obtain the privacy budget allocated at the current moment ∈ t include:
[0029] The current remaining privacy budget ∈ r Divide into l+1 parts, and the remaining privacy budget size of each part is ∈ r / (l+1);
[0030] Based on the size of each remaining privacy budget ∈ r / (l+1) and the maximum continuous similarity length is k+1, calculate the pre-allocated privacy budget as ∈ r (k+1) / (l+1);
[0031] From the pre-allocated privacy budget ∈r Take ∈ from (k+1) / (l+1) r ·k / (2l+2), and distribute the extracted privacy budget evenly among the k fitted data that meet the conditions, determining the allocation ∈ for each fitted data. r Privacy budget of / (2l+2);
[0032] Initialize parameter c = 0, and initialize the privacy budget allocated at the current time ∈ t =∈ r / (l+1)+∈ r ·k / (2l+2), sequentially traverse the k fitted data points, and for each fitted data point, its privacy budget is denoted as ∈ c ;
[0033] Judgment∈ c Does +c exceed ∈ r / (2l+2);
[0034] If it exceeds, then update the privacy budget allocated at the current moment to ∈ t =∈ t +∈ r / (2l+2), and update c=∈ c -∈ r / (2l+2);
[0035] If not exceeded, update the privacy budget allocated at the current moment to ∈ t =∈ t +(c+∈ j-ω ), and update c=0.
[0036] In one embodiment, the error between the fitted dataset and the real dataset is calculated, and the privacy budget is dynamically adjusted based on the calculated error. t The adjusted privacy budget includes:
[0037] Calculate the mean absolute error between the fitted dataset and the real dataset;
[0038] The adjustment coefficient τ is obtained by calculating an exponential function based on the mean absolute error.
[0039] The privacy budget ∈ is adjusted based on the adjustment factor τ. t , thus obtaining the adjusted privacy budget.
[0040] In one embodiment, the step of using the adjusted privacy budget and the real data corresponding to the current moment as input to the differential privacy mechanism to obtain the randomized perturbation value includes:
[0041] The adjusted privacy budget is then processed using randomized real data.
[0042] The Square Wave random response mechanism is used to regulate the randomized real data processing process, so as to improve the output of the randomized real data processing. The relationship between the actual data d and the data satisfies The probability of is p, which does not satisfy the condition. Let q be the probability of , where b, p, and q are calculated using the following formulas:
[0043]
[0044] In one embodiment, the local parameter further includes b low and b up The first layer of data is obtained based on the randomized perturbation value and the deviation threshold r. Second-level data Publish the first layer of data and the second layer of data include:
[0045] Using the time series as the X-axis and the actual data as the Y-axis, let the coordinates of the actual data at the previous time point be (x, y). t-1 d t-1 );
[0046] Based on the deviation threshold r and the current real data coordinates (x) t d t Construct coordinate points (x) t d t+r ) and (x t d t -r), and calculate the coordinates (x) of the points respectively. t d t +r) and (x t d t The angle b1 between -r) and the coordinate point (x) t d t -r) and (x t-1 d t-1 The included angle b2 between them;
[0047] If b2 is greater than b up The output randomization interval is [b up [b2], and update b low =b2, b up =b1; if b1 is less than b low The output randomization interval is then [b1, b...]. low ], and update b low =b2, b up =b1;
[0048] If b2 is not greater than b up Or b1 is not less than b low The output randomization interval is [b low b up ], and update b low =max(b low b2), and b up =min(b up b1);
[0049] Select a random value b from the randomized interval. r As the slope, in the hierarchical data published at the previous moment... Starting with b, construct a linear function f(x) = b in one variable. r x+d;
[0050] Let the current time x t As a linear function in one variable, f(x) = b r Given x+d as input, randomized stratified data is obtained.
[0051] According to the randomized stratified data Calculate the hierarchical data using the randomized perturbation value.
[0052] Publish the first layer of data and the second layer of data
[0053] Secondly, this application also provides a secure continuous data generation apparatus. The apparatus includes:
[0054] An initialization module is used to initialize public and local parameters and record the real data corresponding to the current moment; the public parameters include the current remaining privacy budget. r The local parameters include the attenuation factor α, the similarity threshold β, the deviation threshold r, and the size of the fitted dataset l.
[0055] The privacy budget initial allocation module is used to allocate the privacy budget based on the real dataset, the decay factor α, and the current remaining privacy budget ∈ r To obtain the privacy budget allocated at the current moment ∈ t The real dataset records the real data from the start time to the current time.
[0056] The privacy budget adjustment module is used to calculate the error between the fitted dataset and the real dataset, and dynamically adjust the privacy budget based on the calculated error. t The adjusted privacy budget was obtained;
[0057] The random perturbation module is used to take the adjusted privacy budget and the real data corresponding to the current moment as input to the differential privacy mechanism to obtain a randomized perturbation value;
[0058] The data publishing module is used to obtain the first-level data based on the randomized perturbation value and the deviation threshold r. Second-level data Publish the first layer of data and the second layer of data
[0059] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:
[0060] Initialize public and local parameters, and record the real data corresponding to the current moment; the public parameters include the current remaining privacy budget. r The local parameters include the attenuation factor α, the similarity threshold β, the deviation threshold r, and the size of the fitted dataset l.
[0061] Based on the real dataset, the decay factor α, and the current remaining privacy budget ∈ r To obtain the privacy budget allocated at the current moment ∈ t The real dataset records the real data from the start time to the current time.
[0062] Calculate the error between the fitted dataset and the real dataset, and dynamically adjust the privacy budget based on the calculated error. t The adjusted privacy budget was obtained;
[0063] The adjusted privacy budget and the real data corresponding to the current moment are used as inputs to the differential privacy mechanism to obtain a randomized perturbation value;
[0064] Based on the randomized perturbation value and the deviation threshold r, the first layer of data is obtained. Second-level data Publish the first layer of data and the second layer of data
[0065] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:
[0066] Initialize public and local parameters, and record the real data corresponding to the current moment; the public parameters include the current remaining privacy budget.r The local parameters include the attenuation factor α, the similarity threshold β, the deviation threshold r, and the size of the fitted dataset l.
[0067] Based on the real dataset, the decay factor α, and the current remaining privacy budget ∈ r To obtain the privacy budget allocated at the current moment ∈ t The real dataset records the real data from the start time to the current time.
[0068] Calculate the error between the fitted dataset and the real dataset, and dynamically adjust the privacy budget based on the calculated error. t The adjusted privacy budget was obtained;
[0069] The adjusted privacy budget and the real data corresponding to the current moment are used as inputs to the differential privacy mechanism to obtain a randomized perturbation value;
[0070] Based on the randomized perturbation value and the deviation threshold r, the first layer of data is obtained. Second-level data Publish the first layer of data and the second layer of data
[0071] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:
[0072] Initialize public and local parameters, and record the real data corresponding to the current moment; the public parameters include the current remaining privacy budget. r The local parameters include the attenuation factor α, the similarity threshold β, the deviation threshold r, and the size of the fitted dataset l.
[0073] Based on the real dataset, the decay factor α, and the current remaining privacy budget ∈ r To obtain the privacy budget allocated at the current moment ∈ t The real dataset records the real data from the start time to the current time.
[0074] Calculate the error between the fitted dataset and the real dataset, and dynamically adjust the privacy budget based on the calculated error. t The adjusted privacy budget was obtained;
[0075] The adjusted privacy budget and the real data corresponding to the current moment are used as inputs to the differential privacy mechanism to obtain a randomized perturbation value;
[0076] Based on the randomized perturbation value and the deviation threshold r, the first layer of data is obtained. Second-level data Publish the first layer of data and the second layer of data
[0077] The aforementioned secure continuous data generation method, apparatus, computer equipment, storage medium, and computer program product initialize common parameters and local parameters, and record the real data corresponding to the current moment; the common parameters include the current remaining privacy budget ∈ r Local parameters include the decay factor α, similarity threshold β, deviation threshold r, and the size of the fitted dataset l; based on the real dataset, the decay factor α, and the current remaining privacy budget ∈ r To obtain the privacy budget allocated at the current moment ∈ t The real dataset records the actual data from the start time to the current time; the error between the fitted dataset and the real dataset is calculated, and the privacy budget is dynamically adjusted based on the calculated error. t The adjusted privacy budget is obtained; the adjusted privacy budget and the real data corresponding to the current moment are used as inputs to the differential privacy mechanism to obtain the randomization perturbation value; based on the randomization perturbation value and the bias threshold r, the first layer of data is obtained. Second-level data Release the first layer of data Second-level data Throughout the process, the dispersed privacy budget is used centrally to effectively reduce the scale of injected noise. Therefore, it can achieve more accurate numerical calculations at the same overall privacy level. Combined with differential privacy processing, it can achieve secure and accurate generation of secure continuous data. Attached Figure Description
[0078] Figure 1 This is an application environment diagram of a secure continuous data generation method in one embodiment;
[0079] Figure 2 This is a flowchart illustrating a secure continuous data generation method in one embodiment;
[0080] Figure 3 This is a flowchart illustrating a secure continuous data generation method in another embodiment;
[0081] Figure 4 This is a schematic diagram of a sub-process of S220 in one embodiment;
[0082] Figure 5 A flowchart illustrating a secure and continuous data generation method in a specific application example;
[0083] Figure 6 This is a structural block diagram of a secure continuous data generation device in one embodiment;
[0084] Figure 7 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0085] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0086] The secure continuous data generation method provided in this application embodiment can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or placed on a cloud or other network server. Terminal 102 sends a secure continuous data generation request to server 104. Server 104 responds to the request, initializes public and local parameters, and records the current real-time data; the public parameters include the current remaining privacy budget ∈ r Local parameters include the decay factor α, similarity threshold β, deviation threshold r, and the size of the fitted dataset l; based on the real dataset, the decay factor α, and the current remaining privacy budget ∈ r To obtain the privacy budget allocated at the current moment ∈ t The real dataset records the actual data from the start time to the current time; the error between the fitted dataset and the real dataset is calculated, and the privacy budget is dynamically adjusted based on the calculated error. t The adjusted privacy budget is obtained; the adjusted privacy budget and the real data corresponding to the current moment are used as inputs to the differential privacy mechanism to obtain the randomization perturbation value; based on the randomization perturbation value and the bias threshold r, the first layer of data is obtained. Second-level data Release the first layer of data Second-level data The terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, and smart in-vehicle systems. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted devices. The server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.
[0087] In one embodiment, such as Figure 2As shown, a secure continuous data generation method is provided, which can be applied to... Figure 1 Taking server 104 as an example, the following steps are included:
[0088] S100: Initialize public and local parameters, and record the real data corresponding to the current moment; public parameters include the current remaining privacy budget ∈ r Local parameters include attenuation factor α, similarity threshold β, deviation threshold r, and fitted dataset size l.
[0089] First, initialize public and local parameters. Public parameters include the current remaining privacy budget. r This parameter measures the acceptable level of privacy breaches during data publication. Local parameters include the decay factor α, similarity threshold β, deviation threshold r, and fitted dataset size l, which are set according to the actual application scenario and privacy protection requirements.
[0090] S200: Based on the real dataset, the decay factor, and the current remaining privacy budget, the privacy budget allocated at the current moment is obtained; the real dataset records the real data from the start moment to the current moment.
[0091] Based on the real dataset, the decay factor α, and the current remaining privacy budget ∈ r Calculate the privacy budget allocated at time t. t The allocation of the privacy budget can be based on a time decay model. The real-world dataset here contains real data from the start time (time 0) to the current time t.
[0092] S300: Calculate the error between the fitted dataset and the real dataset, and dynamically adjust the privacy budget based on the calculated error to obtain the adjusted privacy budget.
[0093] Calculate the error between the fitted dataset and the real dataset. Common methods for error calculation include mean squared error (MSE) and absolute error (MAE). Based on the calculated error, dynamically adjust the privacy budget. t This yields the adjusted privacy budget. The adjustment strategy can be tailored to the magnitude of the error; for example, when the error exceeds a certain threshold, the privacy budget is increased to improve data accuracy, while when the error is small, the privacy budget is decreased to enhance privacy protection.
[0094] S400: The adjusted privacy budget and the real data corresponding to the current moment are used as inputs to the differential privacy mechanism to obtain a randomized perturbation value.
[0095] The adjusted privacy budget and the real data corresponding to the current time t are used as inputs to the differential privacy mechanism, and randomized perturbation values are generated by adding randomized perturbations. Differential privacy is a commonly used privacy protection technique that hides sensitive information in the original data by adding noise to the data.
[0096] S500: Based on the randomized perturbation value and the deviation threshold, obtain the first-level data and the second-level data, and publish the first-level data and the second-level data.
[0097] Based on randomized perturbation values And the deviation threshold r divides the data into two layers: the first layer of data Second-level data The stratification strategy can be based on the degree of data deviation. For example, data with a deviation less than the deviation threshold r can be classified into the first stratum. Data with a deviation greater than or equal to the deviation threshold r are classified as second-level data. Finally, the first tier of data was released. Second-level data In this way, data privacy is protected while providing data with a certain degree of accuracy for external use.
[0098] The aforementioned secure continuous data generation method initializes public and local parameters and records the real data corresponding to the current moment; the public parameters include the current remaining privacy budget ∈ r Local parameters include the decay factor α, similarity threshold β, deviation threshold r, and the size of the fitted dataset l; based on the real dataset, the decay factor α, and the current remaining privacy budget ∈ r To obtain the privacy budget allocated at the current moment ∈ t The real dataset records the actual data from the start time to the current time; the error between the fitted dataset and the real dataset is calculated, and the privacy budget is dynamically adjusted based on the calculated error. t The adjusted privacy budget is obtained; the adjusted privacy budget and the real data corresponding to the current moment are used as inputs to the differential privacy mechanism to obtain the randomization perturbation value; based on the randomization perturbation value and the bias threshold r, the first layer of data is obtained. Second-level data Release the first layer of data Second-level data Throughout the process, the dispersed privacy budget is used centrally to effectively reduce the scale of injected noise. Therefore, it can achieve more accurate numerical calculations at the same overall privacy level. Combined with differential privacy processing, it can achieve secure and accurate generation of secure continuous data.
[0099] In one embodiment, such as Figure 3 As shown, S200 includes:
[0100] S220: Based on the real dataset and the attenuation factor, obtain a fitted dataset of size l.
[0101] First, a fitted dataset of size l is generated based on the real dataset and a decay factor α. The fitted dataset can be generated through analysis of historical data, predictions from machine learning models, or other statistical methods, aiming to reflect the trends and characteristics of the real data. During the generation process, the decay factor α can be used to adjust the fitted dataset's dependence on historical data to better adapt to changes in the data.
[0102] S240: Based on the fitted dataset and the similarity threshold, the maximum continuous similarity length is obtained as k+1.
[0103] Next, the maximum consecutive similarity length k+1 is calculated based on the fitted dataset and the similarity threshold β. The maximum consecutive similarity length k+1 refers to the maximum number of consecutively similar data points in the fitted dataset, where the similarity is determined by the similarity threshold β. Similarity can be calculated using distance metrics such as Euclidean distance or Manhattan distance. Two data points are considered similar when the distance between them is less than the similarity threshold β.
[0104] S260: Based on the maximum continuous similarity length k+1 and the current remaining privacy budget, obtain the privacy budget allocated at the current time.
[0105] Finally, based on the maximum continuous similarity length k+1 and the current remaining privacy budget ∈ r To allocate the privacy budget ∈ at the current time t t The allocation strategy for the privacy budget can be designed based on the actual application scenario and data characteristics. For example, when the maximum continuous similarity length k+1 is large, it indicates that the similarity between the fitted dataset and the real dataset is high, so the privacy budget can be appropriately reduced. t To improve data accuracy; conversely, when k+1 is small, a larger privacy budget is needed. t To enhance privacy protection. The specific allocation formula can be set according to the actual situation.
[0106] In one embodiment, such as Figure 4 As shown, S220 includes:
[0107] S221: Construct a dataset using time series data as the X-axis and real data as the Y-axis, with real data released at different times in historical records as distributed samples.
[0108] Using time series data as the X-axis and real data as the Y-axis, an initial dataset is constructed using real data released at different times in historical records as distributed samples. This dataset contains all real data points from the start time to the current time (or a selected time point), with each data point consisting of a time (X-axis) and the corresponding real data value (Y-axis).
[0109] Specifically, the time series can be used as the X-axis, the real data as the Y-axis, and the historical data as the distribution sample to construct a dataset {(x1, d1), (x2, d2), ..., (x t d t )}.
[0110] S222: Calculate the attenuation coefficient for each data point in the dataset based on the attenuation factor.
[0111] Based on the attenuation factor α, calculate the attenuation coefficient for each data point in the dataset. The attenuation coefficient reflects the degree to which a data point decays over time. The method for calculating the attenuation coefficient can be set according to the actual situation; for example, an exponential decay function can be used.
[0112] Calculate the attenuation coefficient for each data point in the dataset S221. The attenuation coefficient for the i-th element is calculated as follows:
[0113] ξ i =α(1-α) t-i .
[0114] S223: Based on the dataset and the attenuation coefficient of each data point, calculate the parameters m and n that minimize the sum of squared errors corresponding to the dataset.
[0115] Based on the dataset and the attenuation coefficient for each data point, the parameters (slope m) and (intercept n) that minimize the sum of squared errors corresponding to the dataset are calculated using the least squares method or other optimization methods. This process is an application of linear regression, aiming to find a straight line (a linear function in one variable) that approximates all points in the dataset as closely as possible. The specific calculation formula is as follows:
[0116]
[0117] S224: Construct a linear function in one variable using parameters m and n as the slope and intercept, respectively.
[0118] Using the calculated parameters m and n as the slope and intercept respectively, we construct a linear function f(x) = m·x + n.
[0119] S225: Based on the constructed linear function, fit the data for the next time step.
[0120] Based on the constructed linear function in one variable, predict the fitted data for the next time step (or some future time step). This can be achieved by substituting the time value of the next time step into the linear function in one variable. Let time x be an example. t+1 As input, the fitted data d is obtained using the function in S224. t+1 .
[0121] S226: Combine the fitted data at the next time step with the dataset to form a new dataset.
[0122] The fitted data for the next time step obtained from the prediction is combined with the original dataset to form a new dataset. This new dataset contains all points from the original dataset as well as the fitted data points from the new prediction. Specifically, the fitted data for the next time step obtained in S225 and the dataset in S221 are combined to form a new dataset {(x1, d1), (x2, d2), ..., (x... t+1 d t+1 )}.
[0123] S227: Use the new dataset as the dataset again, return to step S222, repeat the process l times to obtain a fitted dataset of size l.
[0124] The new dataset is used as the new dataset, and the process is repeated l times (assuming the initial dataset contains one data point, and a new fitted data point is predicted and added to the dataset in each iteration). Thus, through l iterations, a fitted dataset containing l data points is obtained. Specifically, the dataset in step S221 is replaced with the output dataset of step S226, and steps S222 to S226 are repeated a total of l times. Finally, the fitted dataset for the next l time steps is {(x... t+1 d t+1 ), (x t+2 d t+2 ), ..., (x t+l d t+l )}.
[0125] In one embodiment, obtaining the maximum continuous similarity length of k+1 based on the fitted dataset and the similarity threshold β includes:
[0126] Step 1: Extract a single fitted data point from the fitted dataset and calculate the absolute value of the difference between the extracted fitted data point and the true data.
[0127] First, initialize an empty list or array to store the fitted data that meets the criteria, and a variable to record the length of the current consecutive similar data (initialized to 0). Extract the first fitted data point from the fitted dataset and calculate the absolute value of the difference between this fitted data point and the corresponding real data point. Here, the corresponding real data point refers to the time point represented by the fitted data.
[0128] Step 2: If the absolute value of the difference is not greater than the similarity threshold β, then extract the next fitted data in order, and return to the step of calculating the absolute value of the difference between the extracted fitted data and the real data, until the absolute value of the difference is greater than the similarity threshold β, or all fitted data in the fitted dataset are extracted, and fitted data that meets the conditions is obtained.
[0129] Check if the absolute value of the difference is not greater than the similarity threshold β. If it is, proceed to the next step; otherwise, end. If the absolute value of the difference is not greater than the similarity threshold β, extract the next fitted data in order (i.e., in the order of the time series) and return to step 1 to continue calculating the absolute value of the difference between the fitted data and the real data at the corresponding time.
[0130] Step 3: Calculate the total length of the fitted data that meets the conditions and the real data at the current time, and obtain the maximum continuous similarity length as k+1.
[0131] Each time the absolute value of the difference is determined to be no greater than the similarity threshold β, the current fitted data is added to the list of fitted data that meet the condition, and the length of the current consecutive similar data is updated (incremented by 1).
[0132] In a specific embodiment, this refers to a process of traversing the entire fitted dataset, where the first fitted data d on the left... t+1 The process begins by calculating the absolute value of the difference between the fitted data and the real data. If the absolute value does not exceed the similarity threshold β, the next fitted data point is retrieved to the right. The process ends when the absolute value of the difference exceeds the similarity threshold or when all fitted data has been accessed. The total number of fitted data points that meet the criteria, along with the current real data, constitutes the maximum continuous similarity length, denoted as k+1.
[0133] In one embodiment, based on the maximum consecutive similarity length k+1 and the current remaining privacy budget ∈ r To obtain the privacy budget allocated at the current moment ∈ t include:
[0134] Step 1: Allocate the current remaining privacy budget to... r Divide into l+1 parts, and the remaining privacy budget size of each part is ∈ r / (l+1).
[0135] Using historical privacy budget expenditures as a sample, the current remaining privacy budget is calculated as follows:
[0136]
[0137] The current remaining privacy budget ∈ r Divide into l+1 parts, each part having a size of ∈ r / (l+1).
[0138] Step 2: Based on the remaining privacy budget size for each item ∈ r / (l+1) and the maximum continuous similarity length is k+1, calculate the pre-allocated privacy budget as ∈ r (k+1) / (l+1).
[0139] The pre-allocated privacy budget is calculated based on the obtained maximum continuous similarity length k+1. r (k+1) / (l+1).
[0140] Step 3: From the pre-allocated privacy budget ∈ r Take ∈ from (k+1) / (l+1) r ·k / (2l+2), and distribute the extracted privacy budget evenly among the k fitted data that meet the conditions, determining the allocation ∈ for each fitted data. r Privacy budget of / (2l+2).
[0141] Extract ∈ from the obtained data r ·k / (2l+2), evenly distributed among the k fitted data that meet the conditions, so that each data point receives ∈ r / (2l+2).
[0142] Step 4: Initialize parameter c = 0, and initialize the privacy budget allocated at the current time. t =∈ r / (l+1)+∈ r ·k / (2l+2), sequentially traverse the k fitted data points, and for each fitted data point, its privacy budget is denoted as ∈ c .
[0143] Initialize parameter c = 0, ∈ t =∈ r / (l+1)+∈ r ·k / (2l+2), iterating through k fitted data points from left to right, for each data point, its privacy budget is denoted as ∈ c .
[0144] Step 5: Determine ∈ c Does +c exceed ∈ r / (2l+2).
[0145] Step 6: If the limit is exceeded, update the privacy budget allocated at the current moment to ∈ t =∈ t +∈ r / (2l+2), and update c=∈ c -∈ r / (2l+2).
[0146] Step 7: If not exceeded, update the currently allocated privacy budget to ∈ t =∈ t +(c+∈ j-ω ), and update c=0.
[0147] In one embodiment, the error between the fitted dataset and the real dataset is calculated, and the privacy budget is dynamically adjusted based on the calculated error. t The adjusted privacy budget includes:
[0148] Step 1: Calculate the mean absolute error between the fitted dataset and the real dataset.
[0149] First, calculate the mean absolute error (MAE) between the fitted dataset and the real dataset. The mean absolute error is a commonly used method to measure the difference between predicted and actual values.
[0150] Step 2: Calculate the adjustment coefficient τ by performing an exponential function based on the mean absolute error.
[0151] Next, an adjustment coefficient k is obtained by calculating an exponential function based on the mean absolute error. This adjustment coefficient is used to dynamically adjust the privacy budget. The choice of the exponential function can be made according to the actual situation, but generally we want the adjustment coefficient to decrease accordingly when the error increases, so as to reduce the allocation of the privacy budget, and vice versa. Therefore, an exponential function f(x) = 1 - e^(-k / k) can be set. x Using the error as the input to the exponential function, the adjustment coefficient τ is obtained.
[0152] Step 3: Adjust the privacy budget ∈ based on the adjustment factor τ t , thus obtaining the adjusted privacy budget.
[0153] Finally, the privacy budget ∈ is dynamically adjusted based on the adjustment coefficient τ. t ∈, thus obtaining the adjusted privacy budget.
[0154] Specifically, in this embodiment, the mean absolute error between the obtained fitted data set and the real data is statistically analyzed, and then the error is used as an exponential function f(x) = 1 - e^(-1 / x). x The input yields the adjustment coefficient τ, and finally the privacy budget ∈ is dynamically adjusted. tWith the output privacy budget as ∈ t =(1-τ)∈ t This method allows for dynamic adjustment of the privacy budget based on the error between the fitted dataset and the real dataset, resulting in better privacy protection.
[0155] In one embodiment, the adjusted privacy budget and the real data corresponding to the current moment are used as inputs to the differential privacy mechanism to obtain randomized perturbation values including:
[0156] Step 1: Randomize the adjusted privacy budget using real data;
[0157] Step 2: Employ the Square Wave random response mechanism to adjust the randomized real data processing process, so that the output of the randomized real data processing... The relationship between the actual data d and the data satisfies The probability of is p, which does not satisfy the condition. Let q be the probability of , where b, p, and q are calculated using the following formulas:
[0158]
[0159] Preferably, the real data is randomized using a privacy budget as input, and the differential privacy mechanism employed is the SquareWave random response mechanism, which ensures the randomization of output values. The relationship between the actual data d and the data satisfies The probability of finding b is p, and the probability of finding q is q. The formulas for calculating b, p, and q are:
[0160]
[0161] In one embodiment, the local parameter also includes b low and b up Based on the randomized perturbation value and the bias threshold r, the first stratified data is obtained. Second-level data Release the first layer of data Second-level data include:
[0162] Step 1: Use the time series as the X-axis and the actual data as the Y-axis. Record the coordinates of the actual data at the previous time point as (x...). t-1 d t-1 ).
[0163] b low and b upThese are the upper and lower limits of the current boundary conditions set locally. In this embodiment, the purpose of splitting the perturbation data into layers is to allow a portion of the data to retain the temporal correlation of the real data through random perturbation, while b... low and b up This is used to determine whether there is temporal correlation between continuous data (this determination is affected by the deviation threshold r), and also to determine the distribution range of random disturbances. low and b up These two parameters are updated iteratively as data is released. In this embodiment, the randomized perturbation value is split into two parts based on the temporal correlation of the real data. According to the differential privacy theorem, post-processing of the perturbation data will not cause additional privacy loss, thus maintaining high security. Here, the time series is used as the X-axis, the real data as the Y-axis, and the coordinate point of the real data to be released at the previous moment is recorded as (x... t-1 ,d t-1 ).
[0164] Step 2: Based on the deviation threshold r and the actual data coordinates (x) at the current time t ,d t Construct coordinate points (x) t ,d t +r) and (x t d t -r), and calculate the coordinates (x) of the points respectively. t d t +r) and (x t d t The angle b1 between -r) and the coordinate point (x) t d t -r) and (x t-1 d t-1 The angle b2 between () and ().
[0165] Step 3: If b2 is greater than b up The output randomization interval is [b up [b2], and update b low =b2, b up =b1; if b1 is less than b low The output randomization interval is then [b1, b...]. low ], and update b low =b2, b up =b1.
[0166] Step 4: If b2 is not greater than b up Or b1 is not less than b low The output randomization interval is [b low b up ], and update b low =max(blow b2), and b up =min(b up b1).
[0167] Step 5: Select a random value b from the randomized interval. r As the slope, in the hierarchical data published at the previous moment... Starting with b, construct a linear function f(x) = b in one variable. r x+d.
[0168] Select a random value b from the randomized interval. r As the slope, in the hierarchical data published at the previous moment... Construct a linear function f(x) = b in one variable starting from the given point. r x+d.
[0169] Step 6: Set the current time x t As a linear function in one variable, f(x) = b r Given x+d as input, randomized stratified data is obtained.
[0170] Let the current time x t As input to the function in step 5, randomized stratified data are obtained.
[0171] Step 7: Stratify the data according to the randomization And randomized perturbation values, calculate stratified data
[0172] The randomized stratified data obtained in step 6 Using the randomized perturbation data from step 7 as input, calculate the stratified data.
[0173] Step 8: Publish the first tier of data Second-level data
[0174] To illustrate the technical solution of the secure continuous data generation method of this application in detail, specific application examples will be used below, combined with... Figure 5 Expand the explanation. For example... Figure 5 As shown, in one application example, the secure continuous data generation method of this application includes the following steps:
[0175] (1) Initialize the common parameters ∈ and ω and the local parameters α, β, r, l, b low and b up .
[0176] (2) Record the current time t as the starting time, and record the current real data d to be published. tThis is the starting data.
[0177] (3) Take the real dataset to be published from time 1 to time t and the decay factor α as input to obtain a fitted dataset of size l.
[0178] (4) Using the fitted dataset and similarity threshold β obtained in step (3) as input, the maximum continuous similarity length is k+1.
[0179] (5) Using the maximum continuous similarity length obtained in step (4) and the current remaining privacy budget as input, obtain the allocation privacy budget ∈ at the current time step. t .
[0180] (6) Calculate the error between the fitted dataset obtained in step (3) and the real dataset, and dynamically adjust the privacy budget obtained in step (5). t .
[0181] (7) Transfer the privacy budget obtained in step (6) to ∈ t and the selected real data d t As input to the differential privacy mechanism, a randomized perturbation value is obtained.
[0182] (8) Combine the deviation threshold γ and the randomized perturbation value in step (7). As input, we obtain hierarchical data. and
[0183] (9) Publish the hierarchical data obtained in step (8).
[0184] (10) Proceed to the next time step. If the time interval between the start time and the start time in step (2) exceeds k, re-enter step (2). Otherwise, determine whether the real data to be published matches the real data to be published d in step (2). t The absolute difference between them does not exceed the similarity threshold β. If it does, proceed to step (2); otherwise, proceed to step (8).
[0185] In summary, compared with the prior art, the above-described technical solutions conceived in this application can achieve the following beneficial effects:
[0186] (1) Since this application can guarantee that the sum of the privacy levels of any ω consecutive moments in the time series does not exceed ∈, it can guarantee that the overall privacy level of any published continuous dataset reaches the differential privacy level of ω events ∈.
[0187] (2) Since this application can concentrate the use of the dispersed privacy budget to effectively reduce the scale of injected noise, it can achieve more accurate numerical calculations at the same overall privacy level, that is, the numerical calculation results on the published continuous dataset are closer to the numerical calculation results on the real dataset.
[0188] (3) Since this application can preserve the temporal correlation of real datasets well, it can achieve more accurate temporal correlation analysis under the same overall privacy level. That is, the temporal correlation analysis results on the published continuous dataset are closer to the temporal correlation analysis results on the real dataset.
[0189] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0190] Based on the same inventive concept, this application also provides a secure continuous data generation apparatus for implementing the secure continuous data generation method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more embodiments of the secure continuous data generation apparatus provided below can be found in the limitations of the secure continuous data generation method described above, and will not be repeated here.
[0191] In one embodiment, such as Figure 6 As shown, a secure continuous data generation apparatus is provided, comprising:
[0192] Initialization module 100 is used to initialize public parameters and local parameters, and record the real data corresponding to the current moment; public parameters include the current remaining privacy budget ∈ r Local parameters include attenuation factor α, similarity threshold β, deviation threshold r, and the size of the fitted dataset l.
[0193] Privacy budget initial allocation module 200 is used to allocate the privacy budget based on the real dataset, the decay factor α, and the current remaining privacy budget ∈ r To obtain the privacy budget allocated at the current moment ∈ tThe real dataset records the actual data from the start time to the current time.
[0194] The privacy budget adjustment module 300 is used to calculate the error between the fitted dataset and the real dataset, and dynamically adjust the privacy budget based on the calculated error. t The adjusted privacy budget was obtained;
[0195] The random perturbation module 400 is used to take the adjusted privacy budget and the real data corresponding to the current moment as inputs to the differential privacy mechanism to obtain randomized perturbation values;
[0196] The data publishing module 500 is used to obtain the first-level data based on the randomized perturbation value and the deviation threshold r. Second-level data Release the first layer of data Second-level data
[0197] In one embodiment, the privacy budget initial allocation module 200 is further configured to obtain a fitted dataset of size l based on the real dataset and the decay factor α; obtain a maximum continuous similarity length of k+1 based on the fitted dataset and the similarity threshold β; and determine the maximum continuous similarity length of k+1 based on the maximum continuous similarity length k+1 and the current remaining privacy budget ∈ r To obtain the privacy budget allocated at the current moment ∈ t .
[0198] In one embodiment, the privacy budget initial allocation module 200 is further configured to construct a dataset using time series as the X-axis and real data as the Y-axis, with real data released at different times in historical records as distributed samples; calculate the decay coefficient of each data point in the dataset according to the decay factor α; calculate the parameters m and n that minimize the sum of squared errors corresponding to the dataset based on the dataset and the decay coefficient of each data point; construct a linear function in one variable using parameters m and n as the slope and intercept, respectively; fit the fitted data at the next time step according to the constructed linear function in one variable; combine the fitted data at the next time step with the dataset to form a new dataset; use the new dataset as the dataset again, and return to the step of calculating the decay coefficient of each data point in the dataset according to the decay factor α, repeating the process l times to obtain a fitted dataset of size l.
[0199] In one embodiment, the privacy budget initial allocation module 200 is further configured to extract a single fitted data from the fitted dataset, calculate the absolute value of the difference between the extracted fitted data and the real data; if the absolute value of the difference is not greater than the similarity threshold β, then the next fitted data is extracted in an orderly manner, and the step of calculating the absolute value of the difference between the extracted fitted data and the real data is returned until the absolute value of the difference is greater than the similarity threshold β, or all fitted data in the fitted dataset is extracted, and fitted data that meets the conditions is obtained; the total data length of the fitted data that meets the conditions and the real data at the current time is calculated, and the maximum continuous similarity length is k+1.
[0200] In one embodiment, the privacy budget initial allocation module 200 is further configured to allocate the current remaining privacy budget ∈ r Divide into l+1 parts, and the remaining privacy budget size of each part is ∈ r / (l+1); based on the size of each remaining privacy budget ∈ r / (l+1) and the maximum continuous similarity length is k+1, calculate the pre-allocated privacy budget as ∈ r (k+1) / (l+1); from the pre-allocated privacy budget ∈ r Take ∈ from (k+1) / (l+1) r ·k / (2l+2), and distribute the extracted privacy budget evenly among the k fitted data that meet the conditions, determining the allocation ∈ for each fitted data. r Privacy budget of / (2l+2); initialize parameter c=0, and initialize the privacy budget allocated at the current time ∈ t =∈ r / (l+1)+∈ r ·k / (2l+2), sequentially traverse the k fitted data points, and for each fitted data point, its privacy budget is denoted as ∈ c ;Judgment∈ c Does +c exceed ∈ r / (2l+2); if this is exceeded, update the privacy budget allocated at the current moment to ∈ t =∈ t +∈ r / (2l+2), and update c=∈ c -∈ r / (2l+2); if not exceeded, update the privacy budget allocated at the current moment to ∈ t =∈ t +(c+∈ j-ω ), and update c=0.
[0201] In one embodiment, the privacy budget adjustment module 300 is further configured to calculate the mean absolute error between the fitted dataset and the real dataset; calculate an adjustment coefficient τ based on the mean absolute error using an exponential function; and adjust the privacy budget ∈ based on the adjustment coefficient τ. t , thus obtaining the adjusted privacy budget.
[0202] In one embodiment, the random perturbation module 400 is further configured to perform randomized real data processing on the adjusted privacy budget; the Square Wave random response mechanism is used to adjust the randomized real data processing process so that the output of the randomized real data processing is optimized. The relationship between the actual data d and the data satisfies The probability of is p, which does not satisfy the condition. Let q be the probability of , where b, p, and q are calculated using the following formulas:
[0203]
[0204] In one embodiment, the local parameter also includes b low and b up The data publishing module 500 is also used to use the time series as the X-axis and the real data as the Y-axis, recording the coordinates of the real data at the previous moment as (x...). t-1 ,d t-1 Based on the deviation threshold r and the actual data coordinates (x) at the current time. t d t Construct coordinate points (x) t d t +r) and (x t ,d t -r), and calculate the coordinates (x) of the points respectively. t ,d t +r) and (x t ,d t The angle b1 between -r) and the coordinate point (x) t d t -r) and (x t-1 d t-1 The angle b2 between the two sides; if b2 is greater than b up The output randomization interval is [b up [b2], and update b low =b2, b up =b1; if b1 is less than b low The output randomization interval is then [b1, b...]. low ], and update b low =b2, b up =b1; if b2 is not greater than b up Or b1 is not less than b lowThe output randomization interval is [b low b up ], and update b low =max(b low b2), and b up =min(b up b1); Select a random value b from the randomized interval. r As the slope, in the hierarchical data published at the previous moment... Starting with b, construct a linear function f(x) = b in one variable. r x+d; Set the current time x t As a linear function in one variable, f(x) = b r Given x+d as input, randomized stratified data is obtained. Based on randomized stratified data And randomized perturbation values, calculate stratified data Release the first layer of data Second-level data
[0205] Each module in the aforementioned secure continuous data generation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0206] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 7 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores preset data. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements a secure and continuous data generation method.
[0207] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0208] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the above-described secure continuous data generation method.
[0209] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the above-described secure continuous data generation method.
[0210] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the above-described secure continuous data generation method.
[0211] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0212] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0213] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for generating secure continuous data, characterized in that, The method includes: Initialize public and local parameters, and record the real data corresponding to the current moment; the public parameters include the current remaining privacy budget. The local parameters include the attenuation factor. Similarity threshold Deviation threshold and the size of the fitted dataset ; Based on the real dataset and the attenuation factor and the current remaining privacy budget To obtain the privacy budget allocated at the current moment. The real dataset records the real data from the start time to the current time. Calculate the error between the fitted dataset and the real dataset, and dynamically adjust the privacy budget based on the calculated error. The adjusted privacy budget was obtained; The adjusted privacy budget and the real data corresponding to the current moment are used as inputs to the differential privacy mechanism to obtain a randomized perturbation value; Based on the randomized perturbation value and the deviation threshold The first layer of data was obtained. Second-level data Publish the first layer of data and the second layer of data ; The attenuation factor is based on the real dataset. and the current remaining privacy budget To obtain the privacy budget allocated at the current moment. Includes: based on real datasets and the stated decay factor The resulting size is The fitted dataset; based on the fitted dataset and the similarity threshold The maximum continuous similarity length is obtained as According to the maximum continuous similarity length and current remaining privacy budget To obtain the privacy budget allocated at the current moment. ; The error between the fitted dataset and the real dataset is calculated, and the privacy budget is dynamically adjusted based on the calculated error. The adjusted privacy budget includes: calculating the mean absolute error between the fitted dataset and the real dataset; and calculating an adjustment coefficient using an exponential function based on the mean absolute error. Based on the adjustment coefficient Adjust the privacy budget The adjusted privacy budget was obtained; The step of using the adjusted privacy budget and the real data corresponding to the current moment as input to the differential privacy mechanism to obtain the randomized perturbation value includes: randomizing the adjusted privacy budget using real data; and using the Square Wave random response mechanism to adjust the randomized real data processing process so that the output of the randomized real data processing... With real data Between The probability is Not satisfied The probability is ,in, , and The calculation formula is: ; The local parameters also include the locally set upper limit value for the current boundary conditions. and current boundary condition limit The step is based on the randomized perturbation value and the deviation threshold. The first layer of data was obtained. Second-level data Publish the first layer of data and the second layer of data This includes: using the time series as the X-axis, the actual data as the Y-axis, and recording the coordinates of the actual data at the previous moment as... Based on deviation threshold and the actual data coordinates at the current moment Construct coordinate points and And calculate the coordinates of the points respectively. and The angle between and coordinate points and The angle between ;like Greater than The output randomization interval is then... and update , ;like Less than The output randomization interval is then... and update , ;like Not greater than ,or Not less than The output randomization interval is then... and update ,and Select random values from the randomized interval. As the slope, in the hierarchical data published at the previous moment... Starting from this point, construct a linear function in one variable. ; the current moment As a linear function in one variable The input is used to obtain randomized stratified data. According to the randomized hierarchical data Calculate the hierarchical data using the randomized perturbation value. ; Publish the first layer of data and the second layer of data .
2. The method according to claim 1, characterized in that, The data is based on the real dataset and the attenuation factor. The resulting size is The fitted dataset includes: Using time series data as the X-axis and real data as the Y-axis, a dataset is constructed using real data released at different times in historical records as distributed samples. According to the attenuation factor Calculate the attenuation coefficient for each data point in the dataset; Based on the dataset and the attenuation coefficient of each data point, calculate the parameters m and n that minimize the sum of squared errors corresponding to the dataset; Using the parameters m and n as the slope and intercept respectively, construct a linear function in one variable; Based on the constructed linear function, the fitted data for the next time step is obtained. The fitted data at the next time step is combined with the dataset to form a new dataset; Reclaim the new dataset as a dataset and return it according to the decay factor. The step of calculating the attenuation coefficient for each data point in the dataset is repeated. Next, we obtain a size of The fitted dataset.
3. The method according to claim 1, characterized in that, The data based on the fitted dataset and the similarity threshold The maximum continuous similarity length is obtained as include: Extract a single fitted data point from the fitted dataset and calculate the absolute value of the difference between the extracted fitted data point and the real data. If the absolute value of the difference is not greater than the similarity threshold Then, the next set of fitted data is extracted in an orderly manner, and the step of calculating the absolute value of the difference between the extracted fitted data and the real data is returned, until the absolute value of the difference is greater than the similarity threshold. Alternatively, extract all fitted data from the fitted dataset to obtain fitted data that meets the conditions; Calculate the total data length of the fitted data that meets the conditions and the real data at the current time, and obtain the maximum continuous similarity length as follows: .
4. The method according to claim 3, characterized in that, The maximum consecutive similarity length and current remaining privacy budget To obtain the privacy budget allocated at the current moment. include: The current remaining privacy budget Divided into Each portion yields a remaining privacy budget of [amount]. ; Based on the size of each remaining privacy budget And the maximum continuous similarity length is Calculate the pre-allocated privacy budget as ; From the pre-allocated privacy budget Take out The extracted privacy budget will be distributed equally among eligible individuals. Given a set of fitted data, determine the score for each fitted data point. Privacy budget; Initialization parameters And initialize the privacy budget allocated at the current moment. Traverse in order For each fitted data point, the privacy budget is denoted as . ; judge Does it exceed ; If the limit is exceeded, the privacy budget allocated at the current moment will be updated to [a new budget]. and updates ; If the limit is not exceeded, update the privacy budget allocated at the current moment to [a new value]. and updates .
5. A secure continuous data generation device, characterized in that, The device includes: An initialization module is used to initialize public and local parameters and record the real data corresponding to the current moment; the public parameters include the current remaining privacy budget. The local parameters include the attenuation factor. Similarity threshold Deviation threshold and the size of the fitted dataset ; The privacy budget initial allocation module is used to allocate the budget based on the real dataset and the decay factor. and the current remaining privacy budget To obtain the privacy budget allocated at the current moment. The real dataset records the real data from the start time to the current time. The privacy budget adjustment module is used to calculate the error between the fitted dataset and the real dataset, and dynamically adjust the privacy budget based on the calculated error. The adjusted privacy budget was obtained; The random perturbation module is used to take the adjusted privacy budget and the real data corresponding to the current moment as input to the differential privacy mechanism to obtain a randomized perturbation value; The data publishing module is used to publish data based on the randomized perturbation value and the deviation threshold. The first layer of data was obtained. Second-level data Publish the first layer of data and the second layer of data ; The privacy budget initial allocation module is also used to allocate the privacy budget based on the real dataset and the decay factor. The resulting size is The fitted dataset; based on the fitted dataset and the similarity threshold The maximum continuous similarity length is obtained as According to the maximum continuous similarity length and current remaining privacy budget To obtain the privacy budget allocated at the current moment. ; The privacy budget adjustment module is also used to calculate the mean absolute error between the fitted dataset and the real dataset; and to calculate the adjustment coefficient by performing an exponential function based on the mean absolute error. Based on the adjustment coefficient Adjust the privacy budget The adjusted privacy budget was obtained; The random perturbation module is also used to randomize the adjusted privacy budget using real data processing; the Square Wave random response mechanism is used to adjust the randomization of the real data processing process so that the output of the randomization of the real data processing is optimized. With real data Between The probability is Not satisfied The probability is ,in, , and The calculation formula is: ; The local parameters also include the locally set upper limit value for the current boundary conditions. and current boundary condition limit The data publishing module is also used to use the time series as the X-axis and the real data as the Y-axis, and to record the coordinates of the real data at the previous moment as... Based on deviation threshold and the actual data coordinates at the current moment Construct coordinate points and And calculate the coordinates of the points respectively. and The angle between and coordinate points and The angle between ;like Greater than The output randomization interval is then... and update , ;like Less than The output randomization interval is then... and update , ;like Not greater than ,or Not less than The output randomization interval is then... and update ,and Select random values from the randomized interval. As the slope, in the hierarchical data published at the previous moment... Starting from this point, construct a linear function in one variable. ; the current moment As a linear function in one variable The input is used to obtain randomized stratified data. According to the randomized hierarchical data Calculate the hierarchical data using the randomized perturbation value. ; Publish the first layer of data and the second layer of data .
6. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Data synthesis method, device and equipment
CN111625523A
Mobile robot trajectory tracking method based on domain randomization
CN117874394A