Data compression method, device, apparatus and storage medium
By using clustering and noise reduction methods on user trajectories, the privacy and usability issues in existing data compression are resolved, achieving efficient privacy protection and data compression.
Patent Information
- Application Number
- CN202111139422.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-26
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2041-09-26
AI Technical Summary
Existing data compression methods lack privacy protection, user data is easily leaked, and privacy is poor. In addition, the uncertainty of pre-set thresholds in existing algorithms leads to poor data availability.
By clustering user trajectories, a privacy budget is allocated to different user trajectories based on the clustering results. The compression threshold is determined by combining the points to be compressed, the starting point, and the ending point of the user trajectory. A vector data compression algorithm is used for compression, and noise perturbation is added to meet differential privacy requirements.
It improves the privacy and availability of data compression, effectively avoids the leakage of users' personal information, reduces the compression rate of the DP algorithm, and enhances the availability of trajectory data.
Smart Images

Figure CN113849471B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a data compression method, device, equipment and storage medium. Background Art
[0002] In recent years, crowd-sensing has emerged as a new data acquisition model that combines crowdsourcing with the perception capabilities of mobile devices. It uses existing mobile devices to form an interactive, participatory perception network and distributes perception tasks to individuals or groups within the network. This helps professionals or the public collect data, analyze information, and share knowledge. However, in order to obtain high-quality perception data, a large number of participants need to be recruited to perform perception tasks, resulting in excessive perception costs and hindering the expansion of mobile crowd-sensing applications. Therefore, the perception data needs to be compressed.
[0003] Currently, trajectory compression algorithms are mainly used to compress user trajectory perception data. The most widely used lossy compression algorithm is the Douglas-Peuker (DP) algorithm. The DP algorithm is a vector data compression algorithm that approximates the trajectory as a series of trajectory points. The DP algorithm calculates the vertical Euclidean distance of all trajectory points and compares it with a pre-set threshold to achieve the purpose of compression by reducing the number of trajectory points. Due to its simplicity and high performance, the algorithm is widely used in trajectory data compression.
[0004] However, the data compression methods in the existing technology lack privacy protection, user data is easily leaked and has poor privacy, and the uncertainty and irrationality of the pre-set thresholds in the existing algorithms lead to poor data availability. Summary of the Invention
[0005] The present application provides a data compression method, apparatus, device and storage medium, thereby solving the technical problems that the data compression methods in the prior art lack privacy protection, user data is easily leaked and has poor privacy, and the uncertainty and irrationality of the pre-set thresholds in the existing algorithms lead to poor data availability.
[0006] In a first aspect, the present application provides a data compression method, comprising:
[0007] Obtain user trajectories, cluster the user trajectories to obtain K user clusters, and determine a compression threshold corresponding to each user cluster, wherein each user cluster includes one or more user trajectories, and K is an arbitrary positive integer;
[0008] Determining a privacy budget corresponding to each user cluster based on a preset total privacy budget, the number of user trajectories in the user cluster, and the total number of user trajectories;
[0009] For each user trajectory, determining a compression threshold corresponding to the user trajectory according to the to-be-compressed point, the starting trajectory point, and the ending trajectory point of the user trajectory;
[0010] According to the compression threshold, each user trajectory is compressed by a vector data compression algorithm to obtain an approximate path corresponding to each user trajectory;
[0011] According to the privacy budget, noise perturbation is added to each of the approximate paths to obtain target compressed data of the user trajectory.
[0012] Here, the present application provides a data compression method, which is a user trajectory batch compression method that meets differential privacy. First, the user trajectories are clustered through clustering processing, and different privacy budgets are allocated to user trajectories of different clusters according to the clustering results. Therefore, noise can be added according to the privacy budgets of different clusters to improve the privacy of data compression, and ensure the availability of data and protect user personal information. Through clustering processing, different noise can be added according to different users and user trajectories, which can accurately and effectively avoid the leakage of user personal information. In addition, when compressing user trajectories through the DP algorithm, the present application combines the user trajectory's to-be-compressed point, the starting trajectory point, and the ending trajectory point to determine the compression threshold, avoiding the problem of high trajectory compression rate caused by randomly set compression thresholds and data unavailability after trajectory data compression. It can effectively reduce the compression rate of the DP algorithm, improve the availability of trajectory data after compression, and can well avoid the leakage of user sensitive information, thereby improving the privacy of data compression.
[0013] Optionally, clustering the user trajectories to obtain K user clusters includes:
[0014] Randomly initialize the number of clusters and the center point corresponding to each cluster;
[0015] The Euclidean distance from each user trajectory to all center points is calculated, and the user trajectories are clustered according to the closest distance criterion. The mean of all user trajectories in each divided cluster is determined as the updated center point of the cluster. The steps of randomly initializing the number of clusters and the center point corresponding to each cluster are repeated until the preset number of iterations is reached.
[0016] Here, the present application uses the K-means clustering (K-means) algorithm to classify user trajectories. Through the K-means algorithm, user trajectories with high user similarity can be divided into the same cluster, which facilitates the subsequent addition of noise processing for user trajectories with high similarity, further avoiding the leakage of user data and improving the accuracy of data compression.
[0017] Optionally, for each user trajectory, determining a compression threshold corresponding to the user trajectory according to the to-be-compressed point, the starting trajectory point, and the ending trajectory point of the user trajectory includes:
[0018] For each user trajectory, the average of the perpendicular Euclidean distances from all points to be compressed to the starting trajectory point and the ending trajectory point is calculated, and the average is determined as the compression threshold corresponding to the user trajectory.
[0019] Here, for each trajectory of the user, the present application calculates the vertical Euclidean distance of the straight line from the current point to be compressed to the starting trajectory point and the ending trajectory point, and the average of the vertical Euclidean distances of the straight lines from all the points to be compressed to the starting trajectory point and the ending trajectory point, and updates the preset compression threshold to this average value. The compression threshold of the user trajectory during compression is combined with the data of the user trajectory itself, avoiding the influence of the randomly set threshold on data compression. The user trajectory can be compressed more accurately, and the availability of the compressed data is guaranteed at the lowest possible trajectory compression rate, further reducing the data compression rate and increasing the amount of data contained in the compressed data.
[0020] Optionally, determining the privacy budget corresponding to each user cluster according to a preset total privacy budget, the number of user trajectories in the user cluster, and the total number of user trajectories includes:
[0021] Determining a ratio of the number of user trajectories in the user cluster to the total number of user trajectories;
[0022] The product of the ratio and a preset total privacy budget is determined as the privacy budget corresponding to the user cluster.
[0023] Specifically, given a total privacy budget, this application proportionally allocates different privacy budgets to different clusters to ensure data availability. During the user trajectory data compression process, different noises are added to the trajectory data to avoid the leakage of personal sensitive information, further ensuring the privacy and security of data compression.
[0024] Optionally, compressing each user trajectory using a vector data compression algorithm according to a compression threshold to obtain an approximate path corresponding to each user trajectory includes:
[0025] For each user trajectory, connect the first and last points of the user trajectory to obtain the user trajectory chord;
[0026] Traversing all the trajectory points to be compressed on the user trajectory, and determining the maximum value of the perpendicular Euclidean distance between the trajectory point to be compressed and the user trajectory chord, and obtaining the maximum value point on the user trajectory chord;
[0027] The maximum value of the vertical Euclidean distance is compared with a compression threshold corresponding to the user trajectory, and an approximate path corresponding to the user trajectory is determined according to the comparison result.
[0028] Optionally, comparing the maximum value of the vertical Euclidean distance with a compression threshold corresponding to the user trajectory, and determining an approximate path corresponding to the user trajectory according to the comparison result includes:
[0029] If the maximum value of the vertical Euclidean distance is less than or equal to the compression threshold, the user trajectory chord is determined to be the approximate path corresponding to the user trajectory.
[0030] Optionally, comparing the maximum value of the vertical Euclidean distance with a compression threshold and determining the approximate path corresponding to the user trajectory according to the comparison result includes:
[0031] If the maximum value of the vertical Euclidean distance is greater than the compression threshold, segmenting the user trajectory chord according to the maximum value point to obtain a segmented user trajectory chord;
[0032] For each segmented user trajectory chord, connect the first and last points of the segmented user trajectory chord to obtain the segmented user trajectory chord;
[0033] Traversing all trajectory points to be compressed on the segmented user trajectory, and determining the maximum value of the perpendicular Euclidean distance between the trajectory point to be compressed and the segmented user trajectory chord, and obtaining the maximum value point on the segmented user trajectory chord;
[0034] If the maximum value of the vertical Euclidean distance is less than or equal to the compression threshold, determining that the segmented user trajectory chord is an approximate segmented path;
[0035] If the maximum value of the vertical Euclidean distance is greater than the compression threshold, the step of segmenting the user trajectory chord according to the maximum value point to obtain segmented user trajectory chords is repeatedly performed until the requirement of the approximate segmented path is met;
[0036] All approximate segmented paths are connected in sequence to obtain an approximate path corresponding to the user trajectory.
[0037] Optionally, adding noise perturbation to each of the approximate paths according to the privacy budget to obtain target compressed data of the user trajectory includes:
[0038] According to the privacy budget, noise perturbation is added to each of the approximate paths through a Laplace noise mechanism to obtain target compressed data of the user trajectory.
[0039] Here, this application uses the Laplace noise mechanism to add noise to the compressed path. Laplace noise provides a good probabilistic method to ensure data validity and can ensure that modifying one individual record of the data will not have a significant impact on the statistical results, thereby meeting the requirements of privacy protection. In the specific implementation process, even if the attacker has all the data records except one piece of data, differential privacy can still prevent the attacker from analyzing the data information that he does not have, effectively avoiding the problem of privacy leakage caused by data release, and further improving the privacy of data compression.
[0040] In a second aspect, the present application provides a data compression device, comprising:
[0041] a first processing module, configured to obtain user trajectories, cluster the user trajectories to obtain K user clusters, and determine a compression threshold corresponding to each user cluster, wherein each user cluster includes one or more user trajectories, and K is an arbitrary positive integer;
[0042] A first determination module is configured to determine a privacy budget corresponding to each user cluster based on a preset total privacy budget, the number of user trajectories in the user cluster, and the total number of user trajectories;
[0043] A second determination module is configured to determine, for each user trajectory, a compression threshold corresponding to the user trajectory based on the to-be-compressed point, the starting trajectory point, and the ending trajectory point of the user trajectory;
[0044] A second processing module is configured to compress each user trajectory using a vector data compression algorithm according to a compression threshold to obtain an approximate path corresponding to each user trajectory;
[0045] The encryption module is used to add noise perturbation to each of the approximate paths according to the privacy budget to obtain target compressed data of the user trajectory.
[0046] Optionally, the first processing module is specifically configured to:
[0047] Randomly initialize the number of clusters and the center point corresponding to each cluster;
[0048] The Euclidean distance from each user trajectory to all center points is calculated, and the user trajectories are clustered according to the closest distance criterion. The mean of all user trajectories in each divided cluster is determined as the updated center point of the cluster. The steps of randomly initializing the number of clusters and the center point corresponding to each cluster are repeated until the preset number of iterations is reached.
[0049] Optionally, the second determining module is specifically configured to:
[0050] For each user trajectory, the average of the perpendicular Euclidean distances from all points to be compressed to the starting trajectory point and the ending trajectory point is calculated, and the average is determined as the compression threshold corresponding to the user trajectory.
[0051] Optionally, the first determining module is specifically configured to:
[0052] Determining a ratio of the number of user trajectories in the user cluster to the total number of user trajectories;
[0053] The product of the ratio and a preset total privacy budget is determined as the privacy budget corresponding to the user cluster.
[0054] Optionally, the second processing module is specifically configured to:
[0055] For each user trajectory, connect the first and last points of the user trajectory to obtain the user trajectory chord;
[0056] Traversing all the trajectory points to be compressed on the user trajectory, and determining the maximum value of the perpendicular Euclidean distance between the trajectory point to be compressed and the user trajectory chord, and obtaining the maximum value point on the user trajectory chord;
[0057] The maximum value of the vertical Euclidean distance is compared with a compression threshold corresponding to the user trajectory, and an approximate path corresponding to the user trajectory is determined according to the comparison result.
[0058] Optionally, the second processing module is specifically configured to:
[0059] If the maximum value of the vertical Euclidean distance is less than or equal to the compression threshold, the user trajectory chord is determined to be the approximate path corresponding to the user trajectory.
[0060] Optionally, the second processing module is further configured to:
[0061] If the maximum value of the vertical Euclidean distance is greater than the compression threshold, segmenting the user trajectory chord according to the maximum value point to obtain a segmented user trajectory chord;
[0062] For each segmented user trajectory chord, connect the first and last points of the segmented user trajectory chord to obtain the segmented user trajectory chord;
[0063] Traversing all trajectory points to be compressed on the segmented user trajectory, and determining the maximum value of the perpendicular Euclidean distance between the trajectory point to be compressed and the segmented user trajectory chord, and obtaining the maximum value point on the segmented user trajectory chord;
[0064] If the maximum value of the vertical Euclidean distance is less than or equal to the compression threshold, determining that the segmented user trajectory chord is an approximate segmented path;
[0065] If the maximum value of the vertical Euclidean distance is greater than the compression threshold, the step of segmenting the user trajectory chord according to the maximum value point to obtain segmented user trajectory chords is repeatedly performed until the requirement of the approximate segmented path is met;
[0066] All approximate segmented paths are connected in sequence to obtain an approximate path corresponding to the user trajectory.
[0067] Optionally, the encryption module is specifically used to:
[0068] According to the privacy budget, noise perturbation is added to each of the approximate paths through a Laplace noise mechanism to obtain target compressed data of the user trajectory.
[0069] In a third aspect, the present application provides a data compression device, comprising: at least one processor and a memory;
[0070] The memory stores computer-executable instructions;
[0071] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the data compression method described in the first aspect and various possible designs of the first aspect.
[0072] In a fourth aspect, the present invention provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the data compression method described in the first aspect and various possible designs of the first aspect is implemented.
[0073] In a fifth aspect, the present invention provides a computer program product, comprising a computer program, which, when executed by a processor, implements the data compression method described in the first aspect and various possible designs of the first aspect.
[0074] The data compression method, apparatus, device, and storage medium provided by the present application are a method for batch compression of user trajectories that meets differential privacy. First, user trajectories are clustered and divided through clustering processing. Different privacy budgets are allocated to user trajectories of different clusters based on the clustering results. Noise can be added according to the privacy budgets of different clusters to improve the privacy of data compression, ensure data availability, and protect user personal information. Through clustering processing, different noise can be added according to different users and user trajectories, which can accurately and effectively avoid the leakage of user personal information. In addition, when compressing user trajectories through the DP algorithm, the present application combines the to-be-compressed point, starting trajectory point, and ending trajectory point of the user trajectory to determine the compression threshold, avoiding the problem of high trajectory compression rate caused by randomly set compression thresholds and data unavailability after trajectory data compression. It can effectively reduce the compression rate of the DP algorithm, improve the availability of trajectory data after compression, and effectively avoid the leakage of user sensitive information, thereby improving the privacy of data compression. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0076] Figure 1 A schematic diagram of the architecture of a data compression device provided in an embodiment of the present application;
[0077] Figure 2 A flowchart of a data compression method provided in an embodiment of the present application;
[0078] Figure 3 A flowchart of another data compression method provided in an embodiment of the present application;
[0079] Figure 4 A schematic structural diagram of a data compression device provided in an embodiment of the present application;
[0080] Figure 5 A schematic diagram of the structure of a data compression device provided in an embodiment of the present application.
[0081] The above drawings illustrate specific embodiments of the present disclosure, which will be described in more detail below. These drawings and textual descriptions are not intended to limit the scope of the present disclosure in any way, but rather to illustrate the concepts of the present disclosure to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION
[0082] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all possible embodiments consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
[0083] The terms "first," "second," "third," and "fourth," etc., as used in the specification and claims of the present application and in the accompanying drawings, if any, are used to distinguish similar objects and are not necessarily used to describe a particular order or sequential sequence. It should be understood that the numbers used in this manner are interchangeable where appropriate so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions, e.g., a process, method, system, product, or apparatus comprising a series of steps or units need not be limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or that are inherent to these processes, methods, products, or apparatus.
[0084] While crowd sensing facilitates data sharing, it also poses privacy and security challenges. For example, statistical analysis of users' Global Positioning System (GPS) trajectory data can be used to infer their interests, hobbies, social connections, and other personal information. Therefore, protecting the privacy of user trajectory data has become a hot research topic. Trajectory compression algorithms are divided into two categories: lossless and lossy. Lossless compression algorithms primarily include Huffman coding, while lossy compression algorithms are further categorized into batch and online data compression methods. The Grass-Peucker (DP) algorithm is a type of lossy compression. The DP algorithm is a vector data compression algorithm that approximates a trajectory as a series of trajectory points. The algorithm reduces the number of trajectory points by calculating the perpendicular Euclidean distance of all trajectory points and comparing it with a pre-set threshold. Due to its simplicity and high performance, it is widely used in trajectory data compression. Differential privacy is a novel privacy protection model based on the principle of data distortion. It achieves privacy protection by adding random perturbations to the original real data without changing the overall trend of the real data.
[0085] However, existing technologies lack privacy protection during trajectory compression, making compressed user trajectory data susceptible to leaking sensitive personal information during data analysis and sharing. The uncertainty and irrationality of the pre-set threshold in the DP algorithm can easily lead to a high compression rate, which in turn reduces the amount of data contained in the trajectory data and reduces its usability.
[0086] In order to solve the above problems, the embodiments of the present application provide a data compression method, apparatus, device and storage medium, wherein the method is a user trajectory batch compression method that meets differential privacy. First, the user trajectories are clustered through clustering processing, and different privacy budgets are allocated to user trajectories of different clusters according to the clustering results. When compressing the user trajectory through the DP algorithm, the compression threshold is determined by combining the to-be-compressed point, starting trajectory point and ending trajectory point of the user trajectory. This can effectively reduce the compression rate of the DP algorithm, improve the availability of trajectory data after compression, and effectively avoid the leakage of user sensitive information.
[0087] Optional, Figure 1 A schematic diagram of a data compression system architecture provided in an embodiment of the present application. Figure 1 In the above architecture, the above architecture includes at least one of a receiving device 101, a processor 102 and a display device 103.
[0088] It is understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the data compression system architecture. In other feasible implementations of the present application, the above architecture may include more or fewer components than shown, or may combine or split certain components, or arrange the components differently. The specific configuration may be determined based on the actual application scenario and is not limited here. Figure 1 The components shown can be implemented in hardware, software, or a combination of software and hardware.
[0089] In a specific implementation process, the receiving device 101 may be an input / output interface or a communication interface.
[0090] The processor 102 can cluster the user trajectories through clustering processing, and allocate different privacy budgets to user trajectories in different clusters according to the clustering results. When compressing the user trajectories through the DP algorithm, the compression threshold is determined by combining the to-be-compressed point, the starting trajectory point, and the ending trajectory point of the user trajectory.
[0091] The display device 103 can be used to display the above results, etc., and can also interact with the user through the display device.
[0092] The display device may also be a touch screen display, which is used to receive user instructions while displaying the above content to achieve interaction with the user.
[0093] It should be understood that the above-mentioned processor can be implemented by the processor reading instructions in the memory and executing the instructions, or it can be implemented by a chip circuit.
[0094] In addition, the network architecture and business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Ordinary technicians in this field can know that with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0095] The technical solution of this application is described in detail below with reference to specific embodiments:
[0096] Optionally, Figure 2 A flow chart of a data compression method provided in an embodiment of the present application. The execution subject of the embodiment of the present application may be Figure 1 The specific execution subject of the processor 102 can be determined according to the actual application scenario. Figure 2 As shown, the method includes the following steps:
[0097] S201: Obtain user trajectories, perform clustering processing on the user trajectories to obtain K user clusters, and determine the compression threshold corresponding to each user cluster.
[0098] Each user cluster includes one or more user trajectories.
[0099] Wherein, K is any positive integer.
[0100] Optionally, cluster the user trajectories to obtain K user clusters, including:
[0101] Randomly initialize the number of clusters and the center point corresponding to each cluster; calculate the Euclidean distance from each user trajectory to all center points, and cluster the user trajectories according to the closest distance criterion. The mean of all user trajectories in each divided cluster is determined as the updated center point of the cluster. Repeat the steps of randomly initializing the number of clusters and the center point corresponding to each cluster until the preset number of iterations is reached.
[0102] Among them, the preset number of iterations here can be determined according to actual conditions, and the embodiments of the present application do not impose specific restrictions on this.
[0103] Specifically, the number of clusters {C1, C2, ...C k} and their respective center points And set the number of iterations T; calculate the distance from each user to all cluster centers The Euclidean distance D ed, and divide it into D ed In the smallest cluster; calculate C i The average value of all user locations in is C i The new center point is obtained; the above steps are repeated until the number of iterations T is reached.
[0104] In the embodiment of the present application, the K-means clustering (K-means) algorithm is used to classify user trajectories. The K-means algorithm can group user trajectories with high user similarity into the same cluster, making it easier to perform subsequent noise processing on user trajectories with high similarity, further avoiding the leakage of user data and improving the accuracy of data compression.
[0105] S202: Determine a privacy budget corresponding to each user cluster according to a preset total privacy budget, the number of user trajectories in the user cluster, and the total number of user trajectories.
[0106] Optionally, determining a privacy budget corresponding to each user cluster based on a preset total privacy budget, the number of user trajectories in the user cluster, and the total number of user trajectories includes:
[0107] Determine the ratio of the number of user trajectories in the user cluster to the total number of user trajectories; and determine the product of the ratio and the preset total privacy budget as the privacy budget corresponding to the user cluster.
[0108] Specifically, for different C i Allocate different privacy budgets, the same C i All users in the cluster are assigned the same privacy budget. Given the total privacy budget ε, different clusters C i The privacy budget ε i is calculated as follows:
[0109]
[0110] Among them, the embodiment of the present application, given a total privacy budget, allocates different privacy budgets to different clusters in proportion to ensure data availability. During the process of compressing user trajectory data, different noises are added to the trajectory data to avoid the leakage of personal sensitive information, further ensuring the privacy and security of data compression.
[0111] S203: For each user trajectory, determine a compression threshold corresponding to the user trajectory according to the to-be-compressed point, the starting trajectory point, and the ending trajectory point of the user trajectory.
[0112] Optionally, for each user trajectory, determining a compression threshold corresponding to the user trajectory according to the to-be-compressed point, the starting trajectory point, and the ending trajectory point of the user trajectory includes:
[0113] For each user trajectory, the average of the perpendicular Euclidean distances from all points to be compressed to the starting and ending trajectory points is calculated, and the average is determined as the compression threshold corresponding to the user trajectory.
[0114] Here, in an embodiment of the present application, for each trajectory of the user, the vertical Euclidean distance of the straight line from the current point to be compressed to the starting trajectory point and the ending trajectory point and the average of the vertical Euclidean distances of all the points to be compressed to the straight lines from the starting trajectory point and the ending trajectory point are calculated respectively, and the preset compression threshold is updated to this average value. The compression threshold of the user trajectory during compression is combined with the data of the user trajectory itself, avoiding the influence of the randomly set threshold on the data compression. The user trajectory can be compressed more accurately, and the availability of the compressed data is guaranteed at the lowest possible trajectory compression rate, further reducing the data compression rate and increasing the amount of data contained in the compressed data.
[0115] S204: Compress each user trajectory using a vector data compression algorithm according to a compression threshold to obtain an approximate path corresponding to each user trajectory.
[0116] Optionally, for each user trajectory, the first and last points of the user trajectory can be connected to obtain a user trajectory chord; all trajectory points to be compressed on the user trajectory are traversed, and the maximum value of the perpendicular Euclidean distance from the trajectory point to be compressed to the user trajectory chord is determined, and the maximum value point on the user trajectory chord is obtained; the maximum value of the perpendicular Euclidean distance is compared with the compression threshold corresponding to the user trajectory, and the approximate path corresponding to the user trajectory is determined based on the comparison result.
[0117] In a possible implementation, determining the approximate path corresponding to the user trajectory according to the comparison result is as follows:
[0118] If the maximum value of the vertical Euclidean distance is less than or equal to the compression threshold, the user trajectory chord is determined to be the approximate path corresponding to the user trajectory.
[0119] In another possible implementation, determining the approximate path corresponding to the user trajectory according to the comparison result is as follows:
[0120] Step 1: If the maximum value of the vertical Euclidean distance is greater than the compression threshold, the user trajectory chord is segmented according to the maximum value point to obtain the segmented user trajectory chord.
[0121] Step 2: For each segmented user trajectory chord, connect the first and last points of the segmented user trajectory chord to obtain the segmented user trajectory chord.
[0122] Step 3: Traverse all the trajectory points to be compressed on the segmented user trajectory, determine the maximum value of the perpendicular Euclidean distance between the trajectory point to be compressed and the segmented user trajectory chord, and obtain the maximum value point on the segmented user trajectory chord.
[0123] Step 4: Compare the maximum value of the vertical Euclidean distance with the compression threshold. If the maximum value of the vertical Euclidean distance is less than or equal to the compression threshold, the segmented user trajectory chord is determined to be an approximate segmented path. If the maximum value of the vertical Euclidean distance is greater than the compression threshold, the segmented user trajectory chord is segmented and steps 1 to 3 are repeated until the requirements for an approximate segmented path are met.
[0124] Step 5: Connect all approximate segmented paths in sequence to obtain the approximate path corresponding to the user trajectory.
[0125] Specifically, the method of compressing the user trajectory is as follows:
[0126] (1) For any trajectory of different users, at the beginning and end points T of the trajectory curve st With T en Connect a straight line T between st T en , T st T en A chord of the trajectory curve for the user;
[0127] (2) Traverse all the trajectory points to be compressed on the curve and calculate their distance to T st T en The perpendicular Euclidean distance AMP, find the point T with the maximum distance max , the maximum AMP is recorded as AMP max
[0128] (3) Comparison of AMP max ADT with pre-set threshold max Size, if AMP max Smaller than ADT max , then T st T en As an approximation of the trajectory, the trajectory is processed;
[0129] (4) If AMP max Greater than ADT max , then T max Point General T st T en Divided into T st T max and T max T en Two segments, and T st T max and T max T en Perform steps (1) to (3);
[0130] (5) When all the segments of a user's trajectory are processed, the broken line formed by connecting each segmentation point in sequence is the approximate path of the original trajectory.
[0131] S205: Add noise perturbation to each approximate path according to the privacy budget to obtain target compressed data of the user trajectory.
[0132] Optionally, different probabilistic noises can be added.
[0133] Optionally, based on the privacy budget, noise perturbation is added to each approximate path to obtain target compressed data of the user trajectory, including:
[0134] According to the privacy budget, noise perturbation is added to each approximate path through the Laplace noise mechanism to obtain the target compressed data of the user trajectory.
[0135] Here, the embodiment of the present application adopts the Laplace noise mechanism to add noise to the compressed path. Laplace noise provides a good probabilistic method to ensure data validity and can ensure that modifying one individual record of the data will not have a significant impact on the statistical results, thereby meeting the requirements of privacy protection. In the specific implementation process, even if the attacker has all the data records except one piece of data, differential privacy can still prevent the attacker from analyzing the data information that he does not have, effectively avoiding the problem of privacy leakage caused by data release, and further improving the privacy of data compression.
[0136] An embodiment of the present application provides a data compression method, which is a method for batch compressing user trajectories that meets differential privacy. First, user trajectories are clustered through clustering processing, and different privacy budgets are allocated to user trajectories of different clusters based on the clustering results. Noise can be added according to the privacy budgets of different clusters to improve the privacy of data compression, ensure data availability, and protect user personal information. Through clustering processing, different noise can be added according to different users and user trajectories, which can accurately and effectively prevent the leakage of user personal information. In addition, when compressing user trajectories through the DP algorithm, the embodiment of the present application combines the to-be-compressed point, the starting trajectory point, and the ending trajectory point of the user trajectory to determine the compression threshold, avoiding the problem of high trajectory compression rate caused by randomly set compression thresholds and data unavailability after trajectory data compression. It can effectively reduce the compression rate of the DP algorithm, improve the availability of trajectory data after compression, and effectively prevent the leakage of user sensitive information, thereby improving the privacy of data compression.
[0137] Optionally, Figure 3This is a flowchart of another data compression method provided in an embodiment of the present application. The DP algorithm is improved by adaptively optimizing a pre-set threshold. During the compression of user trajectory data, different Laplace noises are added to the trajectory data to prevent the leakage of personal sensitive information. The method includes:
[0138] S301: Randomly initialize the number of clusters {C1, C2, ...C k} and their respective center points The number of iterations T.
[0139] S302: Calculate the number of users to all The Euclidean distance D ed , and divide it into D ed Minimum C i middle.
[0140] S303: Update C i Center point.
[0141] Calculate C i The average value of all user locations in is C i New center point.
[0142] Repeat steps S302 and S303 until the number of iterations T is reached.
[0143] S304: Different C i Allocate different privacy budgets, the same C i All users of the same privacy budget are allocated the same amount.
[0144] The privacy budget determination method here is the same as that in S202 above and will not be described in detail here.
[0145] S305: Pre-setting distance threshold AMP max , the total number of trajectories N.
[0146] Here, the distance threshold AMP max That is, the compression threshold in the above S203 is determined in the same manner as S203 and will not be described in detail here.
[0147] S306: Traverse all trajectory points to be compressed and calculate their distance to T st T en The perpendicular Euclidean distance AMP, find AMP max Point T max .
[0148] Among them, T st T en For any trajectory of different users, at the beginning and end of the trajectory curve T st With T enA straight line T connecting st T en , T st T en It is the chord of a trajectory curve for the user.
[0149] S307:AMP max >ADT max .
[0150] Compare AMP max ADT with pre-set threshold max size.
[0151] If AMP max No more than ADT max , then S3081: T st T en As an approximation of the trajectory, the trajectory is processed.
[0152] If AMP max Greater than ADT max , then S3082: T max Point General T st T en Divided into T st T max and T max T en The two trajectories are executed sequentially.
[0153] Here, the execution jumps to S306 and loops S306-S307.
[0154] When all the segments of a user's trajectory are processed, the broken line formed by connecting each segmentation point in sequence is the approximate path of the original trajectory.
[0155] S309: Add Laplace noise to the trajectory data.
[0156] After processing one user trajectory, the above steps S306-S309 are repeated to compress all other trajectories.
[0157] The embodiments of the present application protect sensitive information in user trajectory data during the user trajectory data compression process, thereby preventing the leakage of user sensitive information during trajectory data sharing. The embodiments also improve the pre-set threshold in the DP algorithm, reduce the trajectory compression rate of the DP algorithm, and increase the amount of data contained in the trajectory data and the usability of the trajectory data after trajectory data compression.
[0158] Figure 4 A schematic diagram of the structure of a data compression device provided in an embodiment of the present application is shown in FIG. Figure 4As shown, the apparatus of the embodiment of the present application includes: a first processing module 401, a first determination module 402, a second determination module 403, a second processing module 404, and an encryption module 405. The data compression device here can be the client itself, or a chip or integrated circuit that implements the functions of the client. It should be noted that the division of the first processing module 401, the first determination module 402, the second determination module 403, the second processing module 404, and the encryption module 405 is only a logical division of functions. Physically, the two can be integrated or independent.
[0159] The first processing module is configured to obtain user trajectories, cluster the user trajectories to obtain K user clusters, and determine a compression threshold corresponding to each user cluster, wherein each user cluster includes one or more user trajectories, and K is an arbitrary positive integer;
[0160] A first determination module is configured to determine a privacy budget corresponding to each user cluster based on a preset total privacy budget, the number of user trajectories in the user cluster, and the total number of user trajectories;
[0161] A second determination module is configured to determine, for each user trajectory, a compression threshold corresponding to the user trajectory based on the to-be-compressed point, the starting trajectory point, and the ending trajectory point of the user trajectory;
[0162] The second processing module is used to compress each user trajectory using a vector data compression algorithm according to a compression threshold to obtain an approximate path corresponding to each user trajectory;
[0163] The encryption module is used to add noise perturbation to each approximate path according to the privacy budget to obtain the target compressed data of the user trajectory.
[0164] Optionally, the first processing module is specifically configured to:
[0165] Randomly initialize the number of clusters and the center point corresponding to each cluster;
[0166] Calculate the Euclidean distance from each user trajectory to all center points, and cluster the user trajectories according to the closest distance criterion. Determine the mean of all user trajectories in each divided cluster as the updated center point of the cluster. Repeat the steps of randomly initializing the number of clusters and the center point corresponding to each cluster until the preset number of iterations is reached.
[0167] Optionally, the second determining module is specifically configured to:
[0168] For each user trajectory, the average of the perpendicular Euclidean distances from all points to be compressed to the starting and ending trajectory points is calculated, and the average is determined as the compression threshold corresponding to the user trajectory.
[0169] Optionally, the first determining module is specifically configured to:
[0170] Determine the ratio of the number of user trajectories in the user cluster to the total number of user trajectories;
[0171] The product of the ratio and the preset total privacy budget is determined as the privacy budget corresponding to the user cluster.
[0172] Optionally, the second processing module is specifically configured to:
[0173] For each user trajectory, connect the first and last points of the user trajectory to obtain the user trajectory chord;
[0174] Traverse all the trajectory points to be compressed on the user's trajectory, determine the maximum value of the perpendicular Euclidean distance between the trajectory point to be compressed and the user's trajectory chord, and obtain the maximum value point on the user's trajectory chord;
[0175] The maximum value of the vertical Euclidean distance is compared with the compression threshold corresponding to the user trajectory, and the approximate path corresponding to the user trajectory is determined according to the comparison result.
[0176] Optionally, the second processing module is specifically configured to:
[0177] If the maximum value of the vertical Euclidean distance is less than or equal to the compression threshold, the user trajectory chord is determined to be the approximate path corresponding to the user trajectory.
[0178] Optionally, the second processing module is further configured to:
[0179] If the maximum value of the vertical Euclidean distance is greater than the compression threshold, the user trajectory chord is segmented according to the maximum value point to obtain the segmented user trajectory chord;
[0180] For each segmented user trajectory chord, connect the first and last points of the segmented user trajectory chord to obtain the segmented user trajectory chord;
[0181] Traverse all the trajectory points to be compressed on the segmented user trajectory, determine the maximum value of the perpendicular Euclidean distance between the trajectory point to be compressed and the segmented user trajectory chord, and obtain the maximum value point on the segmented user trajectory chord;
[0182] If the maximum value of the vertical Euclidean distance is less than or equal to the compression threshold, the segmented user trajectory chord is determined to be an approximate segmented path;
[0183] If the maximum value of the vertical Euclidean distance is greater than the compression threshold, the step of segmenting the user trajectory chord according to the maximum value point to obtain the segmented user trajectory chord is repeated until the requirements of the approximate segmented path are met;
[0184] Connect all approximate segmented paths in sequence to obtain the approximate path corresponding to the user trajectory.
[0185] Optionally, the encryption module is specifically used to:
[0186] According to the privacy budget, noise perturbation is added to each approximate path through the Laplace noise mechanism to obtain the target compressed data of the user trajectory.
[0187] Figure 5 This is a schematic diagram of the structure of a data compression device provided in an embodiment of the present application. The data compression device can be a client. The components shown herein, their connections and relationships, and their functions are provided for illustrative purposes only and do not limit the implementation of the present application as described and / or required herein.
[0188] like Figure 5 As shown, the data compression device includes a processor 501 and a memory 502. Each component is interconnected using different buses and can be mounted on a common motherboard or in other ways as needed. Processor 501 can process instructions executed within the data compression device, including instructions for storing graphical information in or on the memory for display on an external input / output device (such as a display device coupled to an interface). In other embodiments, multiple processors and / or multiple buses can be used with multiple memories and multiple storage devices, if desired. Figure 5 A processor 501 is taken as an example.
[0189] The memory 502 is a non-transient computer-readable storage medium that can be used to store non-transient software programs, non-transient computer executable programs and modules, such as the program instructions / modules corresponding to the method of the data compression device in the embodiment of the present application (for example, the attached Figure 4 As shown, the first processing module 401, the first determination module 402, the second determination module 403, the second processing module 404, and the encryption module 405. The processor 501 executes the non-transient software programs, instructions, and modules stored in the memory 502 to perform various functional applications and data processing of the authentication platform, that is, to implement the method of the data compression device in the above method embodiment.
[0190] The data compression device may further include: an input device 503 and an output device 504. The processor 501, the memory 502, the input device 503 and the output device 504 may be connected via a bus or other means. Figure 5 The bus connection is taken as an example.
[0191] The input device 503 can receive input digital or character information and generate key signal input related to user settings and function control of the data compression device, such as an input device such as a touch screen, a keypad, a mouse, or multiple mouse buttons, a trackball, a joystick, etc. The output device 504 can be an output device such as a display device of the data compression device. The display device can include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display, and a plasma display. In some embodiments, the display device can be a touch screen.
[0192] The data compression device of the embodiment of the present application can be used to execute the technical solutions in the above-mentioned method embodiments of the present application. Its implementation principles and technical effects are similar and will not be repeated here.
[0193] An embodiment of the present application further provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are executed by a processor, they are used to implement any of the above-mentioned data compression methods.
[0194] An embodiment of the present application also provides a computer program product, including a computer program, which is used to implement any of the above-mentioned data compression methods when executed by a processor.
[0195] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.
[0196] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0197] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the following claims.
[0198] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A data compression method, characterized in that: include: Obtain user trajectories, and cluster the user trajectories to obtain K user clusters, wherein each user cluster includes one or more user trajectories, where K is an arbitrary positive integer; Determine a privacy budget for each user cluster based on a preset total privacy budget, the number of user trajectories in the user cluster, and the total number of user trajectories. The privacy budget is the product of a quantity ratio and the preset total privacy budget. The quantity ratio is the ratio of the number of user trajectories in the user cluster to the total number of user trajectories. For each user trajectory, determine a compression threshold corresponding to the user trajectory based on the to-be-compressed point, the starting trajectory point, and the ending trajectory point of the user trajectory. The compression threshold is the average of the straight-line distances from all to-be-compressed points in the user trajectory to the starting trajectory point and the ending trajectory point. According to the compression threshold, each user trajectory is compressed by a vector data compression algorithm to obtain an approximate path corresponding to each user trajectory; According to the privacy budget, noise perturbation is added to each of the approximate paths to obtain target compressed data of the user trajectory.
2. The method according to claim 1, characterized in that The clustering process of the user trajectories to obtain K user clusters includes: Randomly initialize the number of clusters and the center point corresponding to each cluster; The Euclidean distance from each user trajectory to all center points is calculated, and the user trajectories are clustered according to the closest distance criterion. The mean of all user trajectories in each divided cluster is determined as the updated center point of the cluster. The steps of randomly initializing the number of clusters and the center point corresponding to each cluster are repeated until the preset number of iterations is reached.
3. The method according to claim 1, characterized in that The step of compressing each user trajectory using a vector data compression algorithm according to the compression threshold to obtain an approximate path corresponding to each user trajectory includes: For each user trajectory, connect the first and last points of the user trajectory to obtain the user trajectory chord; Traversing all the trajectory points to be compressed on the user trajectory, and determining the maximum value of the perpendicular Euclidean distance between the trajectory point to be compressed and the user trajectory chord, and obtaining the maximum value point on the user trajectory chord; The maximum value of the vertical Euclidean distance is compared with a compression threshold corresponding to the user trajectory, and an approximate path corresponding to the user trajectory is determined according to the comparison result.
4. The method according to claim 3, characterized in that The comparing the maximum value of the vertical Euclidean distance with a compression threshold corresponding to the user trajectory, and determining an approximate path corresponding to the user trajectory according to the comparison result, includes: If the maximum value of the vertical Euclidean distance is less than or equal to the compression threshold, the user trajectory chord is determined to be the approximate path corresponding to the user trajectory.
5. The method according to claim 3, characterized in that The comparing the maximum value of the vertical Euclidean distance with a compression threshold, and determining an approximate path corresponding to the user trajectory according to the comparison result, includes: If the maximum value of the vertical Euclidean distance is greater than the compression threshold, segmenting the user trajectory chord according to the maximum value point to obtain a segmented user trajectory chord; For each segmented user trajectory chord, connect the first and last points of the segmented user trajectory chord to obtain the segmented user trajectory chord; Traversing all trajectory points to be compressed on the segmented user trajectory, and determining the maximum value of the perpendicular Euclidean distance between the trajectory point to be compressed and the segmented user trajectory chord, and obtaining the maximum value point on the segmented user trajectory chord; If the maximum value of the vertical Euclidean distance is less than or equal to the compression threshold, determining that the segmented user trajectory chord is an approximate segmented path; If the maximum value of the vertical Euclidean distance is greater than the compression threshold, the step of segmenting the user trajectory chord according to the maximum value point to obtain segmented user trajectory chords is repeatedly performed until the requirement of the approximate segmented path is met; All approximate segmented paths are connected in sequence to obtain an approximate path corresponding to the user trajectory.
6. The method according to any one of claims 1 to 5, characterized in that Adding noise perturbation to each of the approximate paths according to the privacy budget to obtain target compressed data of the user trajectory includes: According to the privacy budget, noise perturbation is added to each of the approximate paths through a Laplace noise mechanism to obtain target compressed data of the user trajectory.
7. A data compression device, characterized in that: include: a first processing module, configured to obtain user trajectories, and cluster the user trajectories to obtain K user clusters, wherein each user cluster includes one or more user trajectories, and K is an arbitrary positive integer; a first determination module, configured to determine a privacy budget corresponding to each user cluster based on a preset total privacy budget, the number of user trajectories in the user cluster, and the total number of user trajectories, wherein the privacy budget is the product of a quantity ratio and the preset total privacy budget, wherein the quantity ratio is the ratio of the number of user trajectories in the user cluster to the total number of user trajectories; a second determination module, configured to determine, for each user trajectory, a compression threshold corresponding to the user trajectory based on the to-be-compressed point, the starting trajectory point, and the ending trajectory point of the user trajectory, wherein the compression threshold is the average of the straight-line distances from all the to-be-compressed points in the user trajectory to the starting trajectory point and the ending trajectory point; A second processing module is configured to compress each user trajectory using a vector data compression algorithm according to a compression threshold to obtain an approximate path corresponding to each user trajectory; The encryption module is used to add noise perturbation to each of the approximate paths according to the privacy budget to obtain target compressed data of the user trajectory.
8. A data compression device, characterized in that include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the data compression method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, which are used to implement the data compression method according to any one of claims 1 to 8 when executed by a processor.
10. A computer program product, characterized in that The invention comprises a computer program, which is used to implement the data compression method according to any one of claims 1 to 6 when the computer program is executed by a processor.
Citation Information
Patent Citations
Privacy protection clustering method for big data analysis and computer storage medium
CN110334757A
Track privacy protection method based on strength of relationship between users in social network
CN112800458A