Online car-hailing geographical privacy protection method based on generalization method and storage medium
By setting the initial privacy budget, real-time encryption and time-space clustering in online car-hailing, the problems of data leakage of online car-hailing trajectory and poor service quality are solved, and efficient privacy protection and service availability are achieved.
Patent Information
- Application Number
- CN202510527367.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-25
- Publication Date
- 2025-08-15
AI Technical Summary
Existing online ride-hailing track data is easily leaked during real-time uploads, and traditional encryption methods lead to poor location service quality and cannot be targeted protection at different stages.
The online ride-hailing geographical privacy protection method is adopted based on the generalization method, including setting the initial privacy budget range before the vehicle is driving, encrypting the trajectory points in real time during driving, and performing spatiotemporal clustering and generalization processing after the driving is finished.
It improves the security and location service quality of online car-hailing trajectory data, ensures user privacy protection and service availability, and makes up for the shortcomings of traditional methods.
Smart Images

Figure CN120493294A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of geographic privacy protection for online ride-hailing services, and specifically relates to a geographic privacy protection method and storage medium for online ride-hailing services based on a generalization method. Background Art
[0002] Existing technologies are still insufficient in adaptability to privacy protection in ride-hailing services:
[0003] (1) Traditional methods for encrypting online ride-hailing trajectory mainly encrypt data during the data release process, while online ride-hailing trajectory data is also at risk of being leaked during real-time upload. If the real-time trajectory data of online ride-hailing is not encrypted, the trajectory data closely related to the user's real identity, interests, behavior, and habits, if not protected, may be illegally used by online ride-hailing companies, such as for monitoring or stealing personal identity information, thereby leaking personal privacy information.
[0004] (2) Traditional online car-hailing encryption methods, when encrypting the real-time trajectory of online car-hailing vehicles, have too strong an encryption level, resulting in poor service quality for passengers. When providing services to passengers, if passengers want to enjoy better location service quality, the location information obtained by the location server before processing the location information needs to be more accurate. However, when the encryption level of the real-time trajectory of online car-hailing vehicles is too high, the location data obtained by the location server is too noisy, making it difficult for users to obtain high-quality location services, resulting in a poor user experience.
[0005] A new geographic privacy protection method for online ride-hailing travel is needed, which can provide targeted protection at different stages of online ride-hailing order execution. Summary of the Invention
[0006] The purpose of the present invention is to provide a geographic privacy protection method for online ride-hailing vehicles based on a generalization method, which is used to solve the technical problems in the existing technology that online ride-hailing vehicle trajectory data is easily leaked, has low security, and has a poor user experience.
[0007] An object of the present invention is to provide a computer-readable storage medium.
[0008] The technical solution of the present invention to solve the technical problem is:
[0009] A geographic privacy protection method for online ride-hailing based on a generalization method includes the following steps:
[0010] S1: Before the vehicle starts driving, the initial privacy budget range is obtained by comparing and calculating the user's riding data with the set privacy data. The driving data of vehicles in the database that fall within the initial privacy budget range is read and the initial privacy budget is calculated using similar samples.
[0011] S2: While the vehicle is driving, the driving trajectory points are encrypted in real time according to the acquired vehicle driving conditions;
[0012] S3: After the vehicle has finished traveling, the vehicle's driving trajectory data is subjected to spatiotemporal clustering. The sampling points of the driving trajectory data that do not meet the protection requirements are generalized, and the encrypted trajectory is subjected to fuzzy start and end point processing.
[0013] S4: The vehicle's driving trajectory data processed in step S3 is stored in a database, and the vehicle's driving trajectory data is published.
[0014] Preferably, the step S1 is specifically as follows:
[0015] S1.1: Obtain the user's ride origin, destination, expected route, and departure time. Combined with geographic semantics, this data is analyzed using the corresponding classification dimensions, quantification methods, and weights to determine the total score. Based on the pre-defined score mapping table, the initial privacy budget corresponding to the total score is determined.
[0016] S1.2: Read the vehicle driving data in the database within the initial privacy budget, filter out sample data that is similar to the current trip in the three dimensions of space, time, and semantics, select the privacy budget value of a set number of samples based on the similarity, calculate the average, and use the average as the initial privacy budget value.
[0017] Preferably, in step S1.1:
[0018] The total score of the current ride data = ∑(score of each dimension × weight);
[0019] Among them, the classification dimensions include: sensitive area coverage, trip length, time period, and user privacy preferences; the quantification method is: 0 points, 1 point, and 2 points; specifically: 0 point: no sensitive area; 1 point: coverage of 1 sensitive area; 2 points: coverage of ≥2 sensitive areas; sensitive areas generally refer to areas involving personal privacy such as hospitals, government units, and residential communities; 2 points: short distance, trip length <5km; 1 point: medium, trip length between 5-20km; 0 point: long distance, trip length >20km; 2 points: night; 1 point: morning and evening rush hours; 0 point: daytime; the privacy level set by the user in history (such as: high, medium, and low), 2 points: high; 1 point: medium; 0 point: low; the weights are: 40%, 20%, 20%, and 20% respectively.
[0020] Preferably, in step S1.2:
[0021] Similarity = w1 × spatial score + w2 × temporal score + w1 × semantic score;
[0022] Among them, w1, w2, and w3 are the weights of each dimension.
[0023] Preferably, the step S2 specifically comprises: encrypting the driving trajectory points in real time according to the acquired vehicle driving conditions, ensuring that the abnormal values of the encrypted data and the original data are at the same level;
[0024] S2.1: Obtain real-time trajectory data of the vehicle based on the vehicle's positioning device;
[0025] T={t1,t2,…,t i ,…,t n},
[0026] Where T represents the set of real-time vehicle trajectory data, t i represents the i-th trajectory point, with the latitude and longitude coordinates of the trajectory point;
[0027] S2.2: Calculate the comprehensive outlier value of the current trajectory point;
[0028] anomaly original =q1·d(t i ,D)+q2·Δ(t i ,P);
[0029] Among them, anomaly original represents the comprehensive outlier value, d(t i ,D) represents the distance from the current trajectory point to the destination; Δ(t i ,P) represents the offset distance between the current trajectory point and the planned trajectory; q1 represents the weight coefficient of the distance from the current trajectory point to the destination; q2 represents the weight coefficient of the offset distance between the current trajectory point and the planned trajectory;
[0030] S2.3: Calculate the noise scale parameter based on the differential privacy mechanism;
[0031]
[0032] Where scale represents the noise scale parameter; sensitivity represents the sensitivity, that is, the maximum range of change of the trajectory coordinates; when the value is set to 0.001, it corresponds to a displacement of 100 meters; ε represents the privacy budget;
[0033] S2.4: Use Laplace noise to perturb the trajectory points and generate encrypted trajectory data; T′={t′1,t′2,…,t′ i ,…,t′ n},
[0034] The current encrypted trajectory point t′ i The calculation formula is:
[0035] x i ′=x i +Laplace(0,scale)
[0036] y i ′=y i +Laplace(0,scale);
[0037] Where T′ represents the set of encrypted vehicle real-time trajectory data; t′ i Indicates the current encrypted trajectory point; (x i ′,y i ′) represents t′ i The longitude and latitude coordinates of , Laplace(0,scale) is a Laplace distributed random variable centered at 0 and with a scale of scale;
[0038] S2.5: Calculate the comprehensive outlier value of the current encrypted trajectory point;
[0039] anomaly encrypted =w1·d(t i ′,D)+w2·Δ(t i ′,P);
[0040] Among them, anomaly encrypted represents the comprehensive outlier value, d(t i ′,D) represents the distance from the current encrypted trajectory point to the destination; Δ(t i ′, P) represents the offset distance between the current encrypted trajectory point and the planned trajectory; w1 represents the weight coefficient of the distance from the current encrypted trajectory point to the destination; w2 represents the weight coefficient of the offset distance between the current encrypted trajectory point and the planned trajectory;
[0041] S2.6: Calculate the difference between the current trajectory point and the current encrypted trajectory point.
[0042] diff=|anomaly original -anomaly encrypted |;
[0043] Using the segmented mapping method, a new privacy budget value is obtained based on the difference.
[0044]
[0045] The new privacy budget value is used to encrypt the next trajectory point and execute step S2.2. Repeat the above steps until the vehicle trip ends.
[0046] Where diff represents the difference in the comprehensive anomaly value between the current trajectory point and the current encrypted trajectory point; τ1 and τ2 are the thresholds of the difference; k1, k2, c1, and c2 are the parameters of the piecewise function, which are determined by experimental fitting.
[0047] The geographic privacy protection method for online ride-hailing based on generalization method according to claim 6 is characterized in that step S2 further includes:
[0048] S2.7: Correct the encrypted trajectory data by calculating the Euclidean distance between adjacent points. The specific formula is:
[0049]
[0050] Among them, (x i ′,y i ′) and (x i+1 ′,y i+1 ′) represent the latitude and longitude coordinates of two adjacent track points; the distance d(t i ′,t i+1 ′) exceeds the preset threshold, the trajectory point is removed and a new trajectory point is generated by linear interpolation; the specific formula is: t i-1 , t i+1 are the two adjacent trajectory points of the current trajectory point;
[0051] S2.8: Calculate each trajectory point t by obtaining road network data i ′ to the shortest distance of all candidate road segments for map matching. The specific formula is:
[0052]
[0053] Among them, R j represents the jth road segment, p is any point on the road segment; that is, the trajectory point t i ′ is mapped to the road segment R with the smallest distance j and record the position of the projection point; by updating the coordinates of the trajectory point, the coordinates of the original trajectory point are replaced by the projection coordinates.
[0054] Preferably, the step S3 is specifically as follows:
[0055] S3.1: Use the K-Means clustering algorithm to group the trajectories with high spatiotemporal similarity in the real-time encrypted trajectory data into the same category, with each category containing K trajectories. Extract the spatiotemporal features of each trajectory and use a feature vector to represent the spatiotemporal features of each trajectory. Specifically,
[0056] F T =[t start ,tend ,x center ,y center ,x start ,y start ,x end ,y end ];
[0057] Among them, F T Represents the feature vector of each trajectory, t start Indicates the starting time of each trajectory; t end Indicates the end time of each trajectory; (x center ,y center ) represents the coordinates of the center point of each trajectory;
[0058] (x start ,y start ) represents the starting coordinates of each trajectory; (x end ,y end ) represents the coordinates of the end point of each trajectory; K represents the set number of trajectories contained in each category;
[0059] S3.2: Initialize the cluster center. The specific formula is:
[0060]
[0061] Among them, C j represents the jth cluster center, S j represents the set of trajectories belonging to the jth cluster, F Ti Represents the trajectory T i The eigenvector of
[0062] Assign the trajectory to the nearest cluster center, specifically:
[0063]
[0064] Among them, Cluster(T i ) represents the cluster center, The feature vector representing the trajectory and cluster center C j The Euclidean distance between the eigenvectors of , argmin means finding the cluster center that minimizes the Euclidean distance among all cluster centers, and iterating continuously until the cluster center no longer changes significantly;
[0065] S3.3: Determine whether the number of trajectories after spatiotemporal clustering is not less than K. If so, perform fuzzy start and end point processing on the encrypted trajectories; if not, proceed to step S3.4;
[0066] S3.4: Determine whether the number of trajectories is greater than MinK. If so, generalize the coordinates of the trajectory points in the trajectory, expanding them from a certain point to a two-dimensional plane area; perform fuzzy start and end point processing on the encrypted trajectory; the generalization formula is as follows:
[0067]
[0068] If not, the cluster is deleted directly, and the encrypted trajectory is fuzzy processed with the starting and ending points;
[0069] Where r is the generalization radius, which is set according to the privacy requirements of data release and is generally set to 50m; Mink is the minimum threshold of the number of trajectories in the set cluster.
[0070] A computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the device where the computer-readable storage medium is located executes a geographic privacy protection method for online ride-hailing based on a generalization method.
[0071] The beneficial effects of the present invention are as follows: through step S1: before the vehicle travels, based on the acquired user riding data, the riding data is compared and calculated with the set privacy data to obtain an initial privacy budget range; the vehicle driving data of the vehicle in the database within the initial privacy budget range is read, and the initial privacy budget is calculated using similar samples; thus, security is improved. S2: while the vehicle is traveling, the driving trajectory points are encrypted in real time based on the acquired vehicle driving conditions; it is ensured that the outliers of the encrypted data and the original data are at the same level, thus ensuring that the user obtains high-quality location services. S3: after the vehicle travels, the vehicle driving trajectory data is spatiotemporally clustered, the sampling points of the driving trajectory data that do not meet the protection requirements are generalized, and the encrypted trajectory is fuzzy with the starting and ending points. The purpose of protecting user privacy and providing good services is achieved, and the defects of being unable to encrypt trajectory data in real time, being unable to adjust the privacy budget according to user needs, and being more susceptible to attacks and cracking are compensated, thereby effectively improving the performance of real-time encryption of trajectory data and the usability after encryption. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] Figure 1 It is a flow chart of the geographic privacy protection method of online car-hailing based on the generalization method of the present invention;
[0073] Figure 2 This is a data table of the three aspects of classification dimension, quantification method and weight corresponding to the ride data of the present invention;
[0074] Figure 3 is a score mapping table set by the present invention;
[0075] Figure 4It is a data table of the present invention regarding the current itinerary in three dimensions: space, time, and semantics;
[0076] Figure 5 This is the correspondence table between scale and privacy budget in Example 1 of the present invention;
[0077] Figure 6 is a graph showing the maximum difference between outliers before and after encryption in Example 1 of the present invention;
[0078] Figure 7 This is an outlier difference analysis chart when the privacy budget is 1 in Example 1 of the present invention;
[0079] Figure 8 This is a vehicle warning transition status table when the privacy budget is 1 in Example 1 of the present invention;
[0080] Figure 9 This is an outlier difference analysis chart when the privacy budget is 2 in Example 1 of the present invention;
[0081] Figure 10 This is a vehicle warning transition status table when the privacy budget is 2 in Example 1 of the present invention;
[0082] Figure 11 The present invention encrypts the DTW similarity graph of the before and after trajectories after the vehicle trip order is completed;
[0083] Figure 12 This is a graph showing the percentage of protected trajectories after a vehicle travel order is completed. DETAILED DESCRIPTION
[0084] The technical solutions in the embodiments of the present invention will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present invention.
[0085] like Figure 1 As shown, the present invention discloses a geographic privacy protection method for online ride-hailing based on a generalization method, comprising the following steps:
[0086] S1: Before the vehicle starts driving, the initial privacy budget range is obtained by comparing and calculating the user's riding data with the set privacy data. The driving data of vehicles in the database that fall within the initial privacy budget range is read and the initial privacy budget is calculated using similar samples.
[0087] S2: While the vehicle is driving, the driving trajectory points are encrypted in real time according to the acquired vehicle driving conditions;
[0088] S3: After the vehicle has finished traveling, the vehicle's driving trajectory data is subjected to spatiotemporal clustering, the sampling points of the driving trajectory data that do not meet the protection requirements are generalized, and the encrypted trajectory is subjected to fuzzy start and end point processing.
[0089] S4: The vehicle's driving trajectory data processed in step S3 is stored in a database, and the vehicle's driving trajectory data is published.
[0090] Step S1 is specifically as follows:
[0091] like Figure 2 、 Figure 3 As shown, S1.1: Obtain the user's ride origin, ride destination, expected route, and departure time. Combined with geographic semantics, a comprehensive analysis of the corresponding classification dimensions, quantification methods, and weights in the ride data is performed to obtain the total score of the current ride data. Based on the set score mapping table, the initial privacy budget range corresponding to the total score of the current ride data is obtained.
[0092] The total score of the current ride data = ∑(score of each dimension × weight);
[0093] Among them, the classification dimensions include: sensitive area coverage, trip length, time period, and user privacy preferences; the quantification method is: 0 points, 1 point, and 2 points; specifically: 0 point: no sensitive area; 1 point: coverage of 1 sensitive area; 2 points: coverage of ≥2 sensitive areas; sensitive areas generally refer to areas involving personal privacy such as hospitals, government units, and residential communities; 2 points: short distance, trip length <5km; 1 point: medium, trip length between 5-20km; 0 point: long distance, trip length >20km; 2 points: night; 1 point: morning and evening rush hours; 0 point: daytime; the privacy level set by the user in history (such as: high, medium, and low), 2 points: high; 1 point: medium; 0 point: low; the weights are: 40%, 20%, 20%, and 20% respectively.
[0094] like Figure 4 As shown, S1.2: Read the vehicle driving data in the database within the initial privacy budget, filter out sample data that are similar to the current trip in three dimensions: space, time, and semantics, select the privacy budget values of a set number of samples based on the similarity, calculate the average value, and use the average value as the initial privacy budget value.
[0095] Similarity = w1 × spatial score + w2 × temporal score + w1 × semantic score;
[0096] Among them, w1, w2, and w3 are the weights of each dimension.
[0097] Step S2 specifically includes: encrypting the driving trajectory points in real time according to the acquired vehicle driving conditions to ensure that the outliers of the encrypted data are at the same level as those of the original data;
[0098] S2.1: Obtain real-time trajectory data of the vehicle based on the vehicle's positioning device;
[0099] T={t1,t2,…,ti ,…,t n},
[0100] Where T represents the set of real-time vehicle trajectory data, t i represents the i-th trajectory point, with the latitude and longitude coordinates of the trajectory point;
[0101] S2.2: Calculate the comprehensive outlier value of the current trajectory point;
[0102] anomaly original =q1·d(t i ,D)+q2·Δ(t i ,P);
[0103] Among them, anomaly original represents the comprehensive outlier value, d(t i ,D) represents the distance from the current trajectory point to the destination; Δ(t i ,P) represents the offset distance between the current trajectory point and the planned trajectory; q1 represents the weight coefficient of the distance from the current trajectory point to the destination; q2 represents the weight coefficient of the offset distance between the current trajectory point and the planned trajectory;
[0104] S2.3: Calculate the noise scale parameter based on the differential privacy mechanism;
[0105]
[0106] Where scale represents the noise scale parameter; sensitivity represents the sensitivity, that is, the maximum range of change of the trajectory coordinates; when the value is set to 0.001, it corresponds to a displacement of 100 meters; ε represents the privacy budget;
[0107] S2.4: Use Laplace noise to perturb the trajectory points and generate encrypted trajectory data; T′={t′1,t′2,…,t′ i ,…,t′ n},
[0108] The current encrypted trajectory point t′ i The calculation formula is:
[0109] x i ′=x i +Laplace(0,scale)
[0110] y i ′=y i +Laplace(0,scale);
[0111] Where T′ represents the set of encrypted vehicle real-time trajectory data; t′ iIndicates the current encrypted trajectory point; (x i ′,y i ′) represents t′ i The longitude and latitude coordinates of , Laplace(0,scale) is a Laplace distributed random variable centered at 0 and with a scale of scale;
[0112] S2.5: Calculate the comprehensive outlier value of the current encrypted trajectory point;
[0113] anomaly encrypted =w1·d(t i ′,D)+w2·Δ(t i ′,P);
[0114] Among them, anomaly encrypted represents the comprehensive outlier value, d(t i ′,D) represents the distance from the current encrypted trajectory point to the destination; Δ(t i ′, P) represents the offset distance between the current encrypted trajectory point and the planned trajectory; w1 represents the weight coefficient of the distance from the current encrypted trajectory point to the destination; w2 represents the weight coefficient of the offset distance between the current encrypted trajectory point and the planned trajectory;
[0115] S2.6: Calculate the difference between the current trajectory point and the current encrypted trajectory point.
[0116] diff=|anomaly original -anomaly encrypted |;
[0117] Using the segmented mapping method, a new privacy budget value is obtained based on the difference.
[0118]
[0119] The new privacy budget value is used to encrypt the next trajectory point and execute step S2.2. Repeat the above steps until the vehicle trip ends.
[0120] Where diff represents the difference in the comprehensive anomaly value between the current trajectory point and the current encrypted trajectory point; τ1 and τ2 are the thresholds of the difference; k1, k2, c1, and c2 are the parameters of the piecewise function, which are determined by experimental fitting.
[0121] S2.7: Correct the encrypted trajectory data by calculating the Euclidean distance between adjacent points. The specific formula is:
[0122]
[0123] Among them, (x i ′,yi ′) and (x i+1 ′,y i+1 ′) represent the latitude and longitude coordinates of two adjacent track points; the distance d(t i ′,t i+1 ′) exceeds the preset threshold, the trajectory point is removed and a new trajectory point is generated by linear interpolation; the specific formula is: t i-1 , t i+1 are the two adjacent trajectory points of the current trajectory point;
[0124] S2.8: Calculate each trajectory point t by obtaining road network data i ′ to the shortest distance of all candidate road segments for map matching. The specific formula is:
[0125]
[0126] Among them, R j represents the jth road segment, p is any point on the road segment; that is, the trajectory point t i ′ is mapped to the road segment R with the smallest distance j and record the position of the projection point; by updating the coordinates of the trajectory point, the coordinates of the original trajectory point are replaced by the projection coordinates.
[0127] Step S3 is specifically as follows:
[0128] S3.1: Use the K-Means clustering algorithm to group the trajectories with high spatiotemporal similarity in the real-time encrypted trajectory data into the same category, with each category containing K trajectories. Extract the spatiotemporal features of each trajectory and use a feature vector to represent the spatiotemporal features of each trajectory. Specifically,
[0129] F T =[t start ,t end ,x center ,y center ,x start ,y start ,x end ,y end ];
[0130] Among them, F T Represents the feature vector of each trajectory, t start Indicates the starting time of each trajectory; t end Indicates the end time of each trajectory; (x center ,y center ) represents the coordinates of the center point of each trajectory;
[0131] (x start ,y start) represents the starting coordinates of each trajectory; (x end ,y end ) represents the coordinates of the end point of each trajectory; K represents the set number of trajectories contained in each category;
[0132] S3.2: Initialize the cluster center. The specific formula is:
[0133]
[0134] Among them, C j represents the jth cluster center, S j represents the set of trajectories belonging to the jth cluster, Represents the trajectory T i The eigenvector of
[0135] Assign the trajectory to the nearest cluster center, specifically:
[0136]
[0137] Among them, Cluster(T i ) represents the cluster center, The feature vector representing the trajectory and cluster center C j The Euclidean distance between the eigenvectors of , arg min means finding the cluster center that minimizes the Euclidean distance among all cluster centers, and iterating continuously until the cluster center no longer changes significantly;
[0138] S3.3: Determine whether the number of trajectories after spatiotemporal clustering is not less than K. If so, perform fuzzy start and end point processing on the encrypted trajectories; if not, proceed to step S3.4;
[0139] S3.4: Determine whether the number of trajectories is greater than MinK. If so, generalize the coordinates of the trajectory points in the trajectory, expanding them from a certain point to a two-dimensional plane area; perform fuzzy start and end point processing on the encrypted trajectory; the generalization formula is as follows:
[0140]
[0141] If not, the cluster is deleted directly, and the encrypted trajectory is fuzzy processed with the starting and ending points;
[0142] Where r is the generalization radius, which is set according to the privacy requirements of data release and is generally set to 50m; Mink is the minimum threshold of the number of trajectories in the set cluster.
[0143] Example 1:
[0144] Taking the online ride-hailing trajectory dataset containing 152 trajectories and nearly 60,000 trajectory points as an example, the specific processing steps are as follows:
[0145] The privacy budget ε in the differential privacy mechanism measures the degree of privacy protection between individuals in the dataset. For the differential privacy mechanism with Laplace noise, the privacy budget ε is calculated as follows:
[0146]
[0147] Sensitivity refers to the range of the maximum possible sensitivity values in the original data set. For position data, this can be determined based on the specific characteristics of the data. Scale is the noise scale parameter, indicating the amplitude of the added noise.
[0148] To encrypt real-time trajectories, data availability must be prioritized to ensure that the trajectory information does not deviate significantly due to encryption while the vehicle is driving, thereby triggering a ride-hailing violation warning. Therefore, the privacy encryption strength must be determined first. The data sensitivity is 0.0001. By setting the scale value, the privacy budget is adjusted, and thus the encryption strength is adjusted. During vehicle driving, the corresponding relationship between scale and privacy budget is as follows: Figure 5 As shown;
[0149] To ensure the usability of encrypted real-time trajectory data, vehicle trajectory outliers are used as a criterion. Real-time encrypted trajectory points can cause deviations in the original trajectory points, which in turn changes the vehicle trajectory outliers. Therefore, to ensure usability, it is necessary to ensure that the outliers in the encrypted trajectory are not significantly different from those in the original trajectory. This allows us to find the appropriate encryption parameters to balance encryption strength and the usability of real-time trajectory data.
[0150] To achieve this goal, the following steps can be taken: First, calculate the outliers of the original trajectory data. Then, when performing real-time trajectory encryption, encrypt the trajectory points according to preset encryption parameters. Encryption parameters include encryption strength, encryption algorithm, and noise addition method. After encryption, calculate the outliers of the encrypted trajectory data and compare them with the outliers of the original trajectory data. The suitability of the encryption parameters is evaluated based on the size of the difference. If the outliers of the encrypted trajectory data are not significantly different from those of the original trajectory data, the encryption parameters are considered appropriate, ensuring the usability of the encrypted real-time trajectory data.
[0151] Through the above steps, encryption parameters can be adjusted to find the optimal encryption strength, which protects the privacy of trajectory data while ensuring data availability. In this way, the requirements of data protection and data availability can be balanced during the encryption process.
[0152] like Figure 6 ,The image shows the vehicle in the process of driving, and after calculating the vehicle anomaly value of the original trajectory and the vehicle anomaly value of the encrypted trajectory, the corresponding difference is calculated.
[0153] During vehicle driving, in order to ensure data availability as much as possible, the privacy budget is selected to be as small as possible.
[0154] When the privacy budget is 1, Figure 7 As shown in the outlier difference analysis chart, after natural breakpoint classification, the internal breakpoints for vehicle outlier differences are 0.031 and 0.094. The percentages between 0 and 0.031 are 84.71%, and between 0 and 0.094 are 93.01%. The maximum difference is 0.161. Vehicle warning levels are divided into four levels based on the magnitude of the trajectory outliers: 1. Low warning, 2. Level 1 warning, 3. Level 2 warning, and 4. Level 3 warning.
[0155] If the abnormal value of the original trajectory is a low warning, but the abnormal value of the encrypted trajectory is a level one warning, this change in the warning level caused by trajectory encryption is called a warning transition.
[0156] When the privacy budget is 1, Figure 7 As shown in the abnormal value difference analysis diagram, by selecting the difference segment with the largest proportion: [0.031, 0.094], the maximum transition of the vehicle warning transition is obtained. The vehicle warning transition is as follows Figure 8 As shown in, when the privacy budget is 2, Figure 9 As shown in the outlier difference analysis chart, the vehicle outlier difference, after classification by the natural breakpoint method, has internal breakpoints of 0.022 and 0.055. The percentage between 0 and 0.022 is 75.86%, the percentage between 0 and 0.055 is 93.55%, and the maximum difference is 0.087.
[0157] By selecting the difference segment with the largest proportion: [0.022, 0.055], the maximum transition of the vehicle warning transition is obtained. The vehicle warning transition is as follows: Figure 10 As shown, when the privacy budget is 2, the probability of alarm transition is lower, which can well ensure that the outliers will not have huge differences and effectively ensure the availability of data.
[0158] For the generalized trajectory data, the following steps are used to measure the similarity with the original trajectory to measure the usability of the trajectory data processed by this method. The steps are as follows:
[0159] Enter two tracks before and after encryption:
[0160] Original trajectory: T={(x1,y1,t1),(x2,y2,t2),…,(x n ,y n ,t n )};
[0161] Encrypted trajectory: T′={(x′1,y′1,t′1),(x′2,y′2,t′2),…,(x′ m ,y′ m ,t′ m )};
[0162] Construct a dynamic programming matrix D, where each element D[i,j] of the matrix D represents the cumulative distance when aligning the first i points of T with the first j points of T′.
[0163] Recursively calculate the minimum distance:
[0164]
[0165] Where distance represents the Euclidean distance between two trajectory points, and finally the DTW distance of the trajectory before and after encryption is obtained:
[0166] DTW(T,T′)=min(D[i,j]);
[0167] By calculating the DTW distance, we can evaluate the similarity or difference between two trajectory datasets. A smaller DTW distance means that the two trajectories are more similar, while a larger DTW distance means that they are more different.
[0168] DTW is calculated for the data set before and after encryption, and the results are as follows Figure 11 and Figure 12 As shown in the figure, the average similarity of processed trajectories increases with the amount of underlying data. We can confidently assume that, given the millions of data points available at our current company and the increased k in the algorithm, our processed trajectories will achieve extremely high availability. The algorithm's k selection also ensures enhanced data protection. The number of protected trajectories also increases with data volume, ensuring that virtually all users are protected.
[0169] A computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the device where the computer-readable storage medium is located executes a geographic privacy protection method for online ride-hailing based on a generalization method.
[0170] Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative work shall fall within the scope of protection of the present invention.
Claims
1. A geographic privacy protection method for online ride-hailing based on generalization method, characterized by: The following steps are involved: S1: Before the vehicle starts driving, the initial privacy budget range is obtained by comparing and calculating the user's riding data with the set privacy data. The driving data of vehicles in the database that fall within the initial privacy budget range is read and the initial privacy budget is calculated using similar samples. S2: While the vehicle is driving, the driving trajectory points are encrypted in real time according to the acquired vehicle driving conditions; S3: After the vehicle has finished traveling, the vehicle's driving trajectory data is subjected to spatiotemporal clustering. The sampling points of the driving trajectory data that do not meet the protection requirements are generalized, and the encrypted trajectory is subjected to fuzzy start and end point processing. S4: The vehicle's driving trajectory data processed in step S3 is stored in a database, and the vehicle's driving trajectory data is published.
2. The geographic privacy protection method for online ride-hailing based on generalization method according to claim 1 is characterized in that: The step S1 is specifically as follows: S1.1: Obtain the user's ride origin, destination, expected route, and departure time. Combined with geographic semantics, this data is analyzed using the corresponding classification dimensions, quantification methods, and weights to determine the total score. Based on the pre-defined score mapping table, the initial privacy budget corresponding to the total score is determined. S1.2: Read the vehicle driving data in the database within the initial privacy budget, filter out sample data that is similar to the current trip in the three dimensions of space, time, and semantics, select the privacy budget value of a set number of samples based on the similarity, calculate the average, and use the average as the initial privacy budget value.
3. The geographic privacy protection method for online ride-hailing based on generalization method according to claim 1 is characterized in that: In step S1.1: The total score of the current ride data = ∑(score of each dimension × weight); Among them, the classification dimensions include: sensitive area coverage, trip length, time period, and user privacy preferences; the quantification method is: 0 points, 1 point, and 2 points; specifically: 0 point: no sensitive area; 1 point: coverage of 1 sensitive area; 2 points: coverage of ≥2 sensitive areas; sensitive areas generally refer to areas involving personal privacy such as hospitals, government units, and residential communities; 2 points: short distance, trip length <5km; 1 point: medium, trip length between 5-20km; 0 point: long distance, trip length >20km; 2 points: night; 1 point: morning and evening rush hours; 0 point: daytime; the privacy level set by the user in history (such as: high, medium, and low), 2 points: high; 1 point: medium; 0 point: low; the weights are: 40%, 20%, 20%, and 20% respectively.
4. The geographic privacy protection method for online ride-hailing based on generalization method according to claim 2 is characterized in that: In step S1.2: Similarity = w1 × spatial score + w2 × temporal score + w1 × semantic score; Among them, w1, w2, and w3 are the weights of each dimension.
5. The geographic privacy protection method for online ride-hailing based on generalization method according to claim 2 is characterized in that: The step S2 specifically includes: encrypting the driving trajectory points in real time according to the acquired vehicle driving conditions, ensuring that the abnormal values of the encrypted data and the original data are at the same level; S2.1: Obtain real-time trajectory data of the vehicle based on the vehicle's positioning device; T={t1,t2,…,t i ,…,t n }, Where T represents the set of real-time vehicle trajectory data, t i represents the i-th trajectory point, with the latitude and longitude coordinates of the trajectory point; S2.2: Calculate the comprehensive outlier value of the current trajectory point; anomaly original =q1·d(t i ,D)+q2·Δ(t i ,P); Among them, anomaly original represents the comprehensive outlier value, d(t i ,D) represents the distance from the current trajectory point to the destination; Δ(t i ,P) represents the offset distance between the current trajectory point and the planned trajectory; q1 represents the weight coefficient of the distance from the current trajectory point to the destination; q2 represents the weight coefficient of the offset distance between the current trajectory point and the planned trajectory; S2.3: Calculate the noise scale parameter based on the differential privacy mechanism; Where scale represents the noise scale parameter; sensitivity represents the sensitivity, that is, the maximum range of change of the trajectory coordinates; when the value is set to 0.001, it corresponds to a displacement of 100 meters; ε represents the privacy budget; S2.4: Use Laplace noise to perturb the trajectory points and generate encrypted trajectory data; T′={t′1,t′2,…,t′ i ,…,t′ n }, The current encrypted trajectory point t′ i The calculation formula is: Where T′ represents the set of encrypted vehicle real-time trajectory data; t′ i Indicates the current encrypted trajectory point; (x i ′,y i ′) represents t′ i The longitude and latitude coordinates of , Laplace(0,scale) is a Laplace distributed random variable centered at 0 and with a scale of scale; S2.5: Calculate the comprehensive outlier value of the current encrypted trajectory point; anomaly encrypted =w1·d(t i ′,D)+w2·Δ(t i ′,P); Among them, anomaly encrypted represents the comprehensive outlier value, d(t i ′,D) represents the distance from the current encrypted trajectory point to the destination; Δ(t i ′, P) represents the offset distance between the current encrypted trajectory point and the planned trajectory; w1 represents the weight coefficient of the distance from the current encrypted trajectory point to the destination; w2 represents the weight coefficient of the offset distance between the current encrypted trajectory point and the planned trajectory; S2.6: Calculate the difference between the current trajectory point and the current encrypted trajectory point. diff=|anomaly original -anomaly encrypted |; Using the segmented mapping method, a new privacy budget value is obtained based on the difference. The new privacy budget value is used to encrypt the next trajectory point and execute step S2.
2. Repeat the above steps until the vehicle trip ends. Where diff represents the difference in the comprehensive anomaly value between the current trajectory point and the current encrypted trajectory point; τ1 and τ2 are the thresholds of the difference; k1, k2, c1, and c2 are the parameters of the piecewise function, which are determined by experimental fitting.
6. The geographic privacy protection method for online ride-hailing based on generalization method according to claim 1 is characterized in that: The step S2 further includes: S2.7: Correct the encrypted trajectory data by calculating the Euclidean distance between adjacent points; The specific formula is: Among them, (x i ′,y i ′) and (x i+1 ′,y i+1 ′) represent the latitude and longitude coordinates of two adjacent track points; the distance d(t i ′,t i+1 ′) exceeds the preset threshold, the trajectory point is removed and a new trajectory point is generated by linear interpolation; the specific formula is: t i-1 , t i+1 are the two adjacent trajectory points of the current trajectory point; S2.8: Calculate each trajectory point t by obtaining road network data i ′ to the shortest distance of all candidate road segments for map matching. The specific formula is: Among them, R j represents the jth road segment, p is any point on the road segment; that is, the trajectory point t i ′ is mapped to the road segment R with the smallest distance j and record the position of the projection point; by updating the coordinates of the trajectory point, the coordinates of the original trajectory point are replaced by the projection coordinates.
7. The geographic privacy protection method for online ride-hailing based on generalization method according to claim 5 is characterized in that: The step S3 is specifically as follows: S3.1: Use the K-Means clustering algorithm to group the trajectories with high spatiotemporal similarity in the real-time encrypted trajectory data into the same category, with each category containing K trajectories. Extract the spatiotemporal features of each trajectory and use a feature vector to represent the spatiotemporal features of each trajectory. Specifically, F T =[t start ,t end ,x center ,y center ,x start ,y start ,x end ,y end ]; Among them, F T Represents the feature vector of each trajectory, t start Indicates the starting time of each trajectory; t end Indicates the end time of each trajectory; (x center ,y center ) represents the coordinates of the center point of each trajectory; (x start ,y start ) represents the starting coordinates of each trajectory; (x end ,y end ) represents the coordinates of the end point of each trajectory; K represents the set number of trajectories contained in each category; S3.2: Initialize the cluster center. The specific formula is: Among them, C j represents the jth cluster center, S j represents the set of trajectories belonging to the jth cluster, Represents the trajectory T i The eigenvector of Assign the trajectory to the nearest cluster center, specifically: Among them, Cluster(T i ) represents the cluster center, The feature vector representing the trajectory and cluster center C j The Euclidean distance between the eigenvectors of , argmin means finding the cluster center that minimizes the Euclidean distance among all cluster centers, and iterating continuously until the cluster center no longer changes significantly; S3.3: Determine whether the number of trajectories after spatiotemporal clustering is not less than K. If so, perform fuzzy start and end point processing on the encrypted trajectories; if not, proceed to step S3.4; S3.4: Determine whether the number of trajectories is greater than MinK. If so, generalize the coordinates of the trajectory points in the trajectory, expanding them from a certain point to a two-dimensional plane area; perform fuzzy start and end point processing on the encrypted trajectory; the generalization formula is as follows: If not, the cluster is deleted directly, and the encrypted trajectory is fuzzy processed with the starting and ending points; Where r is the generalization radius, which is set according to the privacy requirements of data release and is generally set to 50m; Mink is the minimum threshold of the number of trajectories in the set cluster.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the device where the computer-readable storage medium is located executes the method according to any one of claims 1 to 7.