A method and device for generating false positions based on improved K-Medoids clustering
Through the improved K-Medoids clustering algorithm, the time period is divided and false locations similar to the real location is generated, which solves the problem of failure to effectively consider the probability difference in querying within the time period in the prior art, and improves the security of user location privacy.
Patent Information
- Application Number
- CN202210684420.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2022-04-07
- Filing Date
- 2022-06-17
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2042-06-17
AI Technical Summary
The existing false location generation algorithm fails to effectively consider the query probability differences in different time periods, which makes it easy for attackers to rule out some false locations and increase the risk of user privacy exposure.
The improved K-Medoids clustering algorithm is used to divide the time period, and a query probability matrix that considers the time dimension is constructed, and false positions similar to the real position are generated to confuse the attacker.
By generating false locations similar to the real location, the probability of users being identified by attackers is reduced, effectively improving the security of user location privacy.
Smart Images

Figure CN114925296B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of privacy protection, and in particular relates to a method and device for generating a false location based on improved K-Medoids clustering. Background Art
[0002] With the rapid development of network technology and the widespread popularization of smart mobile terminals, various smart applications have penetrated into people's daily lives, among which location-based services (LBS) are the most commonly used services.
[0003] However, while people enjoy the convenience brought by LBS services, there is also the risk of privacy leakage. When requesting location services, users usually need to provide some information related to themselves, such as identity information, personal spatial location, query time, query content, etc. Attackers may collect sensitive information such as user request data and historical location data, and infer the user's activity range based on this information and association rules, and further infer detailed privacy information such as living habits, home address, and contact groups, which will endanger the user's property safety. In order to enable users to enjoy high-quality location services on the basis of personal information security, location privacy protection technology has emerged.
[0004] The location service system framework mainly includes four main bodies: mobile terminal, positioning system, communication network and service provider. The mobile device obtains its own location through the positioning system, and initiates an LBS request to the location service provider through the communication network. The result is returned to the mobile terminal through the communication network. Among the many location privacy protection methods, K anonymity is one of the most common methods. In the map grid, K-1 fake locations that are indistinguishable from the real location are selected, and the real location constitutes a location anonymity set that satisfies K anonymity. Together with the query information and identity information, they are sent to the location service provider as request information to obtain the corresponding service. Ideally, the fake location is similar to the real location, and the attacker cannot distinguish the fake location, making the probability of the real location being attacked 1 / K. However, the existing fake location generation algorithm only considers the query probability of the entire time period, and does not take into account the reality that the query probability of some areas in different time periods is quite different from the overall query probability, which causes attackers to easily exclude some fake locations, increasing the risk of user privacy exposure. Summary of the invention
[0005] The present invention proposes a fake location generation method and device based on improved K-Medoids clustering. When the query probability in different time periods is greatly different from the overall query probability, the time periods are divided by a clustering algorithm, and a query probability matrix considering the time dimension is constructed to generate a fake location similar to the real location to confuse the attacker, thereby reducing the probability of the user being identified by the attacker.
[0006] In order to achieve the above object, the technical solution adopted by the present invention is:
[0007] The present invention provides a pseudo position generation method based on improved K-Medoids clustering, comprising:
[0008] Obtaining historical query information of location service providers and preprocessing it, calculating the historical query probability at each time point, and forming a set of time series data; and dividing the map into grids;
[0009] Divide time into several non-overlapping time periods based on time series data;
[0010] According to the current query time and the divided time periods, the current time period is obtained; and according to the current position coordinates and the divided grids, the current grid is obtained;
[0011] Obtain the historical query probability of the current grid in the current time period and the historical query probability of the current grid in the overall time;
[0012] Based on the historical query probability obtained, k-1 pseudo locations are selected from the remaining grids to form a location anonymity set that satisfies k anonymity with the current grid, and request information containing user ID, current query time, location anonymity set and query content is generated.
[0013] Furthermore, the historical query probability at each time point is calculated to form a set of time series data, including:
[0014] According to the preset time unit interval, 24 hours a day is divided into 1440 / interval time points;
[0015] Based on the historical query information of the location service provider, the historical query frequency at each time point is counted, and the historical query probability at each time point is calculated:
[0016]
[0017] Among them, p j is time point t j The historical query probability, fre j is time point t j The historical query frequency, size is the number of time points;
[0018] Set the time point t j and the historical query probability p at the corresponding time point j As a data point j , forming a set of time series data Data.
[0019] Furthermore, the gridding of the map includes:
[0020] According to the preset grid side length l, the study area is divided into M×N grids of equal size, where M = the length of the horizontal coordinate of the study area / l, N = the length of the vertical coordinate of the study area / l, and the map grid information set is obtained.
[0021] Set grid = <grid 1,1 ,...,gird m,n ,...,grid M,N >,m=1,..,M,n=1,...,N.
[0022] Furthermore, the time is divided into a number of non-overlapping time periods based on the time series data, including:
[0023] Randomly select c data points from the time series data Data and sort them in ascending time order as the initial cluster centers;
[0024] Calculate the distance between each data point in the time series data and the cluster center of the previous data point and the cluster center of the next cluster, and divide the data points into clusters with closer distances;
[0025] According to the division results, the Manhattan distance between each data point in the cluster and all other data points in the cluster is calculated, and the absolute error is calculated to form an error matrix;
[0026] The cluster division is performed cyclically until the absolute value of each element of the error matrix is equal to 0 or the number of iterations exceeds the preset iteration threshold;
[0027] Calculate the max length of the time feature interval of each cluster (Set i (point.t))-min(Set i (point.t)), i∈[0,c-1], i.e., time period The time period set consisting of all time periods is expressed as: Set i (point.t) represents cluster i The time data set of all data points within .
[0028] Furthermore, the step of calculating the distance between each data point in the time series data and the cluster center of the cluster to which the previous data point belongs and the cluster center of the next cluster, and dividing the data points into clusters with closer distances, includes:
[0029] Calculate the center of the first cluster from the first data point point0 0 、The last cluster center is about the virtual point center of x=0 c-1 The Euclidean distance dis 0,center , divide the data point point0 into the cluster with the smallest Euclidean distance:
[0030]
[0031]
[0032] Among them, center represents the cluster center with the smallest Euclidean distance, center = center0 or center c-1 , point0.t and point0.p refer to the time and historical query probability of the 0th data point respectively, center.t and center.p refer to the time and historical query probability of the cluster center respectively;
[0033] Traverse all data points in order and calculate the data point point j To the previous data point j-1 Cluster Cluster of Heart Next cluster cluster i+1 The center of the cluster i+1 The Euclidean distance of the data point point j Divide it into clusters with the smallest Euclidean distance, as follows:
[0034]
[0035] Condition 1: When the cluster where the previous data point is located For the last cluster cluster c-1 And the data point j The time characteristics of the time series T=<t0,t1,...,t i ,...,t size-1 >When the first part is additionally calculated, the data point point j To the cluster center of the cluster where the previous data point is located i The cluster center mirror point symmetric about x=0 i 'Euclidean distance;
[0036] Condition 2: When the cluster center of the next cluster is the first cluster cluster0 and the data point is point j When the time feature of is at the tail of the time series T, additional data points are calculated j To the center of the next cluster i+1 The imaginary point center symmetric about x=size i+1 'Euclidean distance;
[0037] Among them, dis min Represents the minimum Euclidean distance, dis(point j ,center i ) represents the data point j Go to the cluster center of the previous data point i The Euclidean distance between points, dis(point j ,center i+1 ) represents the data point j To the center of the next cluster i+1 The Euclidean distance between points, dis(point j ,center i ') indicates the data point j Go to the cluster center of the previous data point i The cluster center mirror point center is symmetric about x=0 i 'Euclidean distance, dis(point j ,center i+1 ') indicates the data point j To the center of the next cluster i+1 The imaginary point center symmetric about x=size i +1 ', the superscript i represents the cluster number, and the subscript j represents the data point number.
[0038] Furthermore, the absolute error is calculated to form an error matrix, including:
[0039] The absolute error is calculated as follows:
[0040]
[0041] Among them, AbsoluteError represents the absolute error, t i Refers to the current data point i Time data, t j Refers to other data points in the cluster j Time data, p iRefers to the current data point i The historical query probability, p j Refers to other data points in the cluster j The historical query probability of
[0042] Select the data point with the smallest absolute error as the cluster center, and use the difference between the cluster center set of the old cluster and the cluster center set of the new cluster as the error matrix Metric error .
[0043] Furthermore, it also includes calculating the historical query probability of each grid in each time period and the historical query probability of each grid in the overall time as follows:
[0044]
[0045]
[0046] in, Represents a grid m,n In time period The historical query probability within, p m,n Represents grid m,n The historical query probability in the overall time, Represents a grid m,n In time period Internal historical query frequency, fre m,n Represents a grid m,n The historical query frequency within the overall time. M and N represent the number of grids divided by the horizontal and vertical axes.
[0047] Further, the selecting k-1 false positions in the remaining grids includes:
[0048] Using the DLS algorithm, 4k grids whose historical query probabilities in the overall time are closest to the historical query probabilities of the current grid in the overall time are selected as the candidate location pool;
[0049] From each grid in the candidate location pool, k-1 grids whose historical query probabilities in the current time period are closest to the historical query probability of the current grid in the current time period are selected as pseudo locations.
[0050] The present invention also provides a pseudo position generating device based on improved K-Medoids clustering, comprising:
[0051] An initialization module is used to obtain and preprocess the historical query information of the location service provider, calculate the historical query probability at each time point, and form a set of time series data; and divide the map into grids;
[0052] A partitioning module is used to divide time into several non-overlapping time periods based on time series data;
[0053] The positioning module is used to obtain the current time period according to the current query time and the divided time periods; and to obtain the current grid according to the current position coordinates and the divided grids;
[0054] as well as
[0055] The generation module is used to obtain the historical query probability of the current grid within the current time period and the historical query probability of the current grid within the overall time; and based on the obtained historical query probability, select k-1 pseudo locations from the remaining grids to form a location anonymity set that satisfies k anonymity with the current grid, and generate request information including user ID, current query time, location anonymity set and query content.
[0056] Furthermore, the division module is specifically used to:
[0057] Randomly select c data points from the time series data Data and sort them in ascending time order as the initial cluster centers;
[0058] Calculate the distance between each data point in the time series data and the cluster center of the previous data point and the cluster center of the next cluster, and divide the data points into clusters with closer distances;
[0059] According to the division results, the Manhattan distance between each data point in the cluster and all other data points in the cluster is calculated, and the absolute error is calculated to form an error matrix;
[0060] The cluster division is performed cyclically until the absolute value of each element of the error matrix is equal to 0 or the number of iterations exceeds the preset iteration threshold;
[0061] Calculate the max length of the time feature interval of each cluster (Set i (point.t))-min(Set i (point.t)), i∈[0,c-1], i.e., time period The time period set consisting of all time periods is expressed as: Set i (point.t) represents cluster i The time data set of all data points within .
[0062] Compared with the prior art, the beneficial effects achieved by the present invention are:
[0063] The present invention provides a K-Medoids clustering algorithm for time series to divide time periods. When initiating a request, k-1 grid locations with the same time period as the real location and similar query probability are selected as false locations to form a k anonymous set to initiate a location service request, thereby reducing the probability of users being identified by attackers and effectively improving the security of user location privacy. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] Figure 1 is a schematic diagram of the location service architecture of the present invention;
[0065] Figure 2 is a flow chart of a pseudo-position generation method based on improved K-Medoids clustering according to an embodiment of the present invention;
[0066] Figure 3 1 is a schematic diagram of calculating the first type of Euclidean distance in an embodiment of the present invention;
[0067] Figure 4 is a schematic diagram of calculating the second type of Euclidean distance in an embodiment of the present invention;
[0068] Figure 5 4 is a schematic diagram of calculating the third type of Euclidean distance in an embodiment of the present invention. DETAILED DESCRIPTION
[0069] The present invention is further described below. The following examples are only used to more clearly illustrate the technical solution of the present invention, and are not intended to limit the protection scope of the present invention.
[0070] See also Figure 1 In the location service system framework shown, a real user initiates an LBS request to a location service provider through a communication network, and the result is returned to the real user through the communication network. Those skilled in the art can understand that Figure 1 The architecture diagram in the figure may have more mobile terminals than the actual one, and all mobile terminals are the basic environment that can support location service requests and other related software operations. All devices have a communication module that connects to the Internet to complete the data transmission process.
[0071] The present invention provides a pseudo position generation method based on improved K-Medoids clustering, comprising:
[0072] Obtaining historical query information of location service providers and preprocessing it, calculating the historical query probability at each time point, and forming a set of time series data; and dividing the map into grids;
[0073] Divide time into several non-overlapping time periods based on time series data;
[0074] According to the current query time and the divided time periods, the current time period is obtained; and according to the current position coordinates and the divided grids, the current grid is obtained;
[0075] Obtain the historical query probability of the current grid in the current time period and the historical query probability of the current grid in the overall time;
[0076] Based on the historical query probability obtained, k-1 fake locations are selected from the remaining grids to form a location anonymity set that satisfies k anonymity with the current grid, and a request message containing the user ID, current query time, location anonymity set and query content is generated and sent to the service provider;
[0077] According to the request information, the service provider database is searched and the query result set is returned to the user.
[0078] As a preferred implementation, the time is divided into several non-overlapping time periods, and the specific implementation process is as follows:
[0079] Randomly select c data points and sort them in ascending time order as the cluster centers of the initial cluster Set center ;
[0080] Calculate the cluster center i The data point in the time series data j distance, and based on the previous data point point j-1 The division result to divide;
[0081] According to the division results Calculate any sample point separately l ,l∈[0,count(cluster i )) and cluster i The Manhattan distance of all other sample points in the same region is calculated, and the absolute error AbsoluteError is calculated using the following formula:
[0082]
[0083] Among them, t i Refers to the current data point i Time data; t j Refers to other data points in the cluster j Time data; p i Refers to the current data point i The historical query probability of p j Refers to other data points in the cluster j The historical query probability.
[0084] Select the sample point with the smallest absolute error as the cluster center, and set the cluster center set of the old cluster Set oldclu and the cluster center set Set of the new cluster newclu The difference is used as the error matrix Metric Error ;
[0085] Repeat the above steps until the error matrix Metric Error The absolute value of each element in is equal to 0 (that is, the cluster center of each cluster remains unchanged) or the number of iterations exceeds the iteration threshold threshold iteration ;
[0086] Calculate each cluster i The length of the time feature interval max(Set i (point.t))-min(Set i (point.t)), i∈[0,c), that is, the time period Among them, Set i (point.t) represents cluster i The time data set of all data points within .
[0087] An embodiment of the present invention provides a pseudo position generation method based on improved K-Medoids clustering, such as Figure 2 As shown, the specific implementation process is as follows:
[0088] (1) Service provider initialization steps
[0089] Step S1: Initialize map data and point of interest database;
[0090] Step S11: Initialize the interest point set, set the anonymity k, query radius r, grid side length l, time unit interval, and iteration threshold threshold iteration .
[0091] Step S2: Calculate the historical query probability at each time point according to the historical query information;
[0092] Step S21: Divide 24 hours into size=1440 / interval time points according to the preset time unit interval, where one day is 1440 minutes;
[0093] Step S22: Count the query frequency fre at each time point j , and the historical query probability p at each time point is obtained by calculation j :
[0094]
[0095] Step S23: Set the time point t j and the historical query probability p at the corresponding time point j As a data point j , forming a set of time series data Data.
[0096] Step S3: using a clustering algorithm for time series to perform statistical analysis on historical query information, dynamically dividing 24 hours into c time periods;
[0097] Step S31: randomly select c data points from the time series data Data and sort them in ascending time order as the initial cluster centers;
[0098] Step S32: Calculate the distance between each data point and the cluster center of the cluster to which the previous data point belongs and the cluster center of the next cluster, and divide the data points into clusters with closer distances;
[0099] Step S321: Calculate the distance from the first data point point0 to the center of the first cluster 0 、The last cluster center is about the virtual point center of x=0 c-1 The Euclidean distance dis 0,center , divide the data point point0 into the cluster cluster where the cluster center with the smallest Euclidean distance is located 0 :
[0100]
[0101] cluster 0 The cluster to which the 0th data point belongs is stored. The independent variable in the formula is the cluster center. 0 and center c-1 arg min refers to the independent variable that reaches the minimum value in the parentheses.
[0102] center=center 0 、center c-1 , point0.t refers to the time of the 0th data point, point0.p refers to the historical query probability of the 0th data point, center.t and center.p represent the time and historical query probability of the cluster center respectively.
[0103] Step S322: traverse other data points in order and calculate the data point point j To the previous data point j-1 Cluster Cluster of Heart Next cluster cluster i+1The center of the cluster i+1 The Euclidean distance dis i,center , the data point point j Assign to the cluster with the smallest Euclidean distance j ,like Figure 3 As shown;
[0104] When the cluster center of the cluster where the previous data point is located For the last cluster cluster c-1 And the time characteristics of the data points are in the time series T = <t0,t1,...,t i ,...,t size-1 >, if Figure 4 As shown, when the center of the last cluster is 22 and the data point is 02, an additional data point is calculated. i To the last cluster c-1 The center of the cluster i The cluster center mirror point symmetric to the straight line x = 0 is the virtual point center i 'Euclidean distance
[0105] dis min =min(dis(point j ,center i ),dis(point j ,center i+1 ),dis(point j ,center i '));
[0106] The cluster center of the current cluster (j+1)%c For the first cluster cluster 0 And the data point j When the time feature of is at the tail of the time series T, such as Figure 5 As shown in the figure, when the cluster center of the last cluster is 02 and the data point is 22, an additional data point is calculated. j To the center of the next cluster i+1 The imaginary point center symmetric about x=size i+1 'Euclidean distance
[0107] dis min =min(dis(point j ,center i ),dis(point j ,center i+1),dis(point j ,center i +1 '));
[0108] cluster=argdis min ;
[0109] Step S33: Based on the division result Calculate clusters separately i Any sample point within l ,l∈[0,count(cluster i )) and cluster i The Manhattan distance of all other sample points in the same region is calculated, and the absolute error AbsoluteError is calculated as follows:
[0110]
[0111] Among them, t i Refers to the current data point i Time data; t j Refers to other data points in the cluster j Time data; p i Refers to the current data point i The historical query probability of p j Refers to other data points in the cluster j The historical query probability.
[0112] Select the sample point with the smallest absolute error as the cluster center, and set the cluster center set of the old cluster Set oldclu and the cluster center set Set of the new cluster newclu The difference is used as the error matrix Metric error .
[0113] Step S34: Repeat steps S32 and S33 until the absolute value E of each element of the error matrix is error Equal to 0 or the number of iterations exceeds the iteration threshold threshold iteration ;
[0114] Step S35: Calculate the time feature interval length max (Set i (point.t))-min(Set i (point.t)), i∈[0,c-1], i.e., time period
[0115] Step S4: The system divides the map into grids. The area can be represented by the upper left corner coordinate (x a ,ya ) and the lower right corner coordinate (x b ,y b ) and divide it into M×N (M, N = map horizontal and vertical coordinate length / l) grids of equal size.
[0116] It should be noted that the area refers to the service area provided by the location service provider. In this embodiment, it is assumed that the service area is a rectangle.
[0117] Step S5: The system counts the historical query frequency of each grid over time m,n And the historical query frequency of each grid in each time period And calculate the historical query probability p of each grid overall time m,n And the historical query probability of each grid in each time period The historical query probability set Set that constitutes the overall time of the map grid p And the historical query probability set for each time period
[0118]
[0119]
[0120] (2) Service provider processing query request steps
[0121] Step S1: Receive anonymous query request q u =<UID,time,Set position ,poi>, where UID is the user ID, time is the query request time, Set position is the location anonymous set Set position = <position1,...,position k >, position j is one of the k locations, poi is the point of interest, i.e. the query content;
[0122] Step S2: According to the location anonymity set Set position and the point of interest poi to retrieve the corresponding query result set in the database
[0123] Step S3: Collect the query results Sent to the corresponding mobile terminal.
[0124] Specifically, the mobile terminal generates K-1 fake locations with similar query probabilities to the real location. The implementation process is as follows:
[0125] (1) Mobile terminal initialization system
[0126] Step S1: Initiate a request for time period information and map grid information;
[0127] Step S2: Receive a time period set
[0128] Map grid information set Set grid = <grid 1,1 ,...,gird m,n ,...,grid M,N >,m=1,..,M,n=1,...,N;
[0129] The historical query probability set of the map grid overall time p =<p 1,1 ,...,p m,n ,...,p M,N >,m=1,..,M,n=1,...,N,
[0130] Historical query probability set for each time period of the map grid
[0131]
[0132] (2) The mobile terminal initiates a POI query request q u ,q u =<UID,time,Set position ,poi>, as follows:
[0133] Step S21: Query the time and time period of the query Get the current time period
[0134] Step S22: According to the current position coordinates loc=<lng,lat> and the grid side length l, obtain the current grid grid m,n ;
[0135] Step S23: In the map grid information set Set grid In the query, the current grid grid m,n In the overall time and corresponding time period The query probability p within m,n and
[0136] Step S24: Use the DLS algorithm to select k-1 fake locations and construct k anonymous sets with the real locations
[0137] Set position = <position1,...,position k >
[0138] Specifically, the DLS algorithm is used to select the overall time history query probability and the user location overall time history query probability p m,n The closest 4k locations are used as the candidate location pool. The locations in the candidate location pool are sorted according to the historical query probability of the time period of the query time. The historical query probability of the corresponding time period and the historical query probability of the user location in the corresponding time period are selected from the candidate location pool. The closest k-1 locations are used as fake locations and k anonymity sets are constructed together with the real locations.
[0139] Step S25: Combine user information, query time, and query content to construct request information q u , initiate a request to the location service provider.
[0140] (3) The mobile terminal receives the query results
[0141] Step S31: Receive query result set
[0142] Step S32: Retrieve the real result r according to the grid position u .
[0143] Another embodiment of the present invention provides a pseudo position generation device based on improved K-Medoids clustering, comprising:
[0144] The present invention also provides a pseudo position generating device based on improved K-Medoids clustering, comprising:
[0145] An initialization module is used to obtain and preprocess the historical query information of the location service provider, calculate the historical query probability at each time point, and form a set of time series data; and divide the map into grids;
[0146] A partitioning module is used to divide time into several non-overlapping time periods based on time series data;
[0147] The positioning module is used to obtain the current time period according to the current query time and the divided time periods; and to obtain the current grid according to the current position coordinates and the divided grids;
[0148] as well as
[0149] The generation module is used to obtain the historical query probability of the current grid within the current time period and the historical query probability of the current grid within the overall time; and based on the obtained historical query probability, select k-1 pseudo locations from the remaining grids to form a location anonymity set that satisfies k anonymity with the current grid, and generate request information including user ID, current query time, location anonymity set and query content.
[0150] In this embodiment, the initialization module is specifically used to:
[0151] According to the preset time unit interval, 24 hours a day is divided into 1440 / interval time points;
[0152] Based on the historical query information of the location service provider, the historical query frequency at each time point is counted, and the historical query probability at each time point is calculated:
[0153]
[0154] Among them, p j is time point t j The historical query probability, fre j is time point t j The historical query frequency, size is the number of time points;
[0155] Set the time point t j and the historical query probability p at the corresponding time point j As a data point j , forming a set of time series data Data.
[0156] In this embodiment, the initialization module is also used to:
[0157] According to the preset grid side length l, the study area is divided into M×N grids of equal size, where M = the length of the horizontal coordinate of the study area / l, N = the length of the vertical coordinate of the study area / l, and the map grid information set is obtained.
[0158] Set grid = <grid 1,1 ,...,gird m,n ,...,grid M,N >,m=1,..,M,n=1,...,N.
[0159] In this embodiment, the partitioning module is specifically used to:
[0160] Randomly select c data points from the time series data Data and sort them in ascending time order as the initial cluster centers;
[0161] Calculate the distance between each data point in the time series data and the cluster center of the previous data point and the cluster center of the next cluster, and divide the data points into clusters with closer distances;
[0162] According to the division results, the Manhattan distance between each data point in the cluster and all other data points in the cluster is calculated, and the absolute error is calculated to form an error matrix;
[0163] The cluster division is performed cyclically until the absolute value of each element of the error matrix is equal to 0 or the number of iterations exceeds the preset iteration threshold;
[0164] Calculate the max length of the time feature interval of each cluster (Set i (point.t))-min(Set i (point.t)), i∈[0,c-1], i.e., time period The time period set consisting of all time periods is expressed as: Set i (point.t) represents cluster i The time data set of all data points within .
[0165] In this embodiment, the partitioning module calculates the distance between each data point in the time series data and the cluster center of the cluster to which the previous data point belongs and the cluster center of the next cluster, and partitions the data points into clusters with closer distances, including:
[0166] Calculate the center of the first cluster from the first data point point0 0 、The last cluster center is about the virtual point center of x=0 c-1 The Euclidean distance dis 0,center , divide the data point point0 into the cluster with the smallest Euclidean distance:
[0167]
[0168]
[0169] Among them, center represents the cluster center with the smallest Euclidean distance, center = center0 or center c-1 , point0.t and point0.p refer to the time and historical query probability of the 0th data point respectively, center.t and center.p refer to the time and historical query probability of the cluster center respectively;
[0170] Traverse all data points in order and calculate the data point point j To the previous data point j-1 Cluster Cluster of Heart Next cluster cluster i+1 The center of the cluster i+1 The Euclidean distance of the data point point j Divide it into the cluster with the smallest Euclidean distance, as follows:
[0171]
[0172] Condition 1: When the cluster where the previous data point is located For the last cluster cluster c-1 And the data point j The time characteristics of the time series T=<t0,t1,...,t i ,...,t size-1 >When the first part is additionally calculated, the data point point j To the cluster center of the cluster where the previous data point is located i The cluster center mirror point symmetric about x=0 i 'Euclidean distance;
[0173] Condition 2: When the cluster center of the next cluster is the first cluster cluster0 and the data point is point j When the time feature of is at the tail of the time series T, additional data points are calculated j To the center of the next cluster i+1 The imaginary point center symmetric about x=size i+1 'Euclidean distance;
[0174] Among them, dis min Indicates the minimum Euclidean distance, dis(point j ,center i ) represents the data point j Go to the cluster center of the previous data point i The Euclidean distance between points, dis(point j ,center i+1 ) represents the data point j To the center of the next cluster i+1 The Euclidean distance between points, dis(point j ,center i ') indicates the data point j Go to the cluster center of the previous data point i The cluster center mirror point symmetric about x=0 i 'Euclidean distance, dis(point j ,center i+1 ') indicates the data point j To the center of the next cluster i+1 The imaginary point center symmetric about x=size i +1', the superscript i represents the cluster number, and the subscript j represents the data point number.
[0175] In this embodiment, the division module calculates the absolute error to form an error matrix, including:
[0176] The absolute error is calculated as follows:
[0177]
[0178] Among them, AbsoluteError represents the absolute error, t i Refers to the current data point i Time data, t j Refers to other data points in the cluster j Time data, p i Refers to the current data point i The historical query probability, p j Refers to other data points in the cluster j The historical query probability of
[0179] Select the data point with the smallest absolute error as the cluster center, and use the difference between the cluster center set of the old cluster and the cluster center set of the new cluster as the error matrix Metric error .
[0180] In this embodiment, the initialization module is also used to:
[0181] The historical query probability of each grid in each time period and the historical query probability of each grid in the overall time are calculated as follows:
[0182]
[0183]
[0184] in, Represents a grid m,n In time period The historical query probability within, p m,n Represents grid m,n The historical query probability in the overall time, Represents a grid m,n In time period Internal historical query frequency, fre m,n Represents a grid m,n The historical query frequency within the overall time. M and N represent the number of grids divided by the horizontal and vertical axes.
[0185] In this embodiment, the generation module is specifically used to:
[0186] Using the DLS algorithm, 4k grids whose historical query probabilities in the overall time are closest to the historical query probabilities of the current grid in the overall time are selected as the candidate location pool;
[0187] From each grid in the candidate location pool, k-1 grids whose historical query probabilities in the current time period are closest to the historical query probability of the current grid in the current time period are selected as pseudo locations.
[0188] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0189] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0190] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0191] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A pseudo-position generation method based on improved K-Medoids clustering, characterized in that: include: Obtain historical query information from location service providers and perform preprocessing, calculate the historical query probability at each time point, and form a set of time series data; And, divide the map into grids; Divide time into several non-overlapping time periods based on time series data; According to the current query time and the divided time periods, get the current time period; And, according to the current position coordinates and the divided grids, the current grid is obtained; Obtain the historical query probability of the current grid in the current time period and the historical query probability of the current grid in the overall time; Based on the historical query probability obtained, k-1 fake locations are selected from the remaining grids to form a location anonymity set that satisfies k anonymity with the current grid, and a request message containing user ID, current query time, location anonymity set and query content is generated; The time is divided into several non-overlapping time periods based on the time series data, including: Randomly select c data points from the time series data Data and sort them in ascending time order as the initial cluster centers; Calculate the distance between each data point in the time series data and the cluster center of the previous data point and the cluster center of the next cluster, and divide the data points into clusters with closer distances, as follows: Calculate the center of the first cluster from the first data point point0 0 、The last cluster center is about the virtual point center of x=0 c-1 The Euclidean distance dis 0,center , divide the data point point0 into the cluster with the smallest Euclidean distance: Among them, center represents the cluster center with the smallest Euclidean distance, center = center 0 or center c-1 , point0.t and point0.p refer to the time and historical query probability of the 0th data point respectively, center.t and center.p refer to the time and historical query probability of the cluster center respectively; Traverse all data points in order and calculate the data point point j To the previous data point j-1 Cluster Cluster of Heart Next cluster cluster i+1 The center of the cluster i+1 The Euclidean distance of the data point point j Divide it into clusters with the smallest Euclidean distance, as follows: Condition 1: When the cluster where the previous data point is located For the last cluster cluster c-1 And the data point j The time characteristics of the time series T=<t0,t1,...,t i ,...,t size-1 >When the first part is additionally calculated, the data point point j To the cluster center of the cluster where the previous data point is located i The cluster center mirror point center is symmetric about x=0 i 'Euclidean distance; Condition 2: When the cluster center of the next cluster is the first cluster cluster0 and the data point is point j When the time feature of is at the tail of the time series T, additional data points are calculated j To the center of the next cluster i+1 The imaginary point center symmetric about x=size i+1 'Euclidean distance; Among them, dis min Indicates the minimum Euclidean distance, dis(point j ,center i ) represents the data point j Go to the cluster center of the previous data point i The Euclidean distance between points, dis(point j ,center i+1 ) represents the data point j To the center of the next cluster i+1 The Euclidean distance between points, dis(point j ,center i ') indicates the data point j Go to the cluster center of the previous data point i The cluster center mirror point symmetric about x=0 i 'Euclidean distance, dis(point j ,center i +1 ') indicates the data point j To the center of the next cluster i+1 The imaginary point center symmetric about x=size i+1 ', the superscript i represents the cluster number, and the subscript j represents the data point number; According to the division results, the Manhattan distance between each data point in the cluster and all other data points in the cluster is calculated, and the absolute error is calculated to form an error matrix, including: The absolute error is calculated as follows: Among them, AbsoluteError represents the absolute error, t i Refers to the current data point i Time data, t j Refers to other data points in the cluster j Time data, p i Refers to the current data point i The historical query probability, p j Refers to other data points in the cluster j The historical query probability of Select the data point with the smallest absolute error as the cluster center, and use the difference between the cluster center set of the old cluster and the cluster center set of the new cluster as the error matrix Metric error ; The cluster division is performed cyclically until the absolute value of each element of the error matrix is equal to 0 or the number of iterations exceeds the preset iteration threshold; Calculate the max length of the time feature interval of each cluster (Set i (point.t))-min(Set i (point.t)), i∈[0,c-1], i.e., time period The time period set consisting of all time periods is expressed as: Set i (point.t) represents cluster i The time data set of all data points within .
2. The method for generating pseudo positions based on improved K-Medoids clustering according to claim 1, characterized in that: The calculation of the historical query probability at each time point constitutes a set of time series data, including: According to the preset time unit interval, 24 hours a day is divided into 1440 / interval time points; Based on the historical query information of the location service provider, the historical query frequency at each time point is counted, and the historical query probability at each time point is calculated: Among them, p j is time point t j The historical query probability, fre j is time point t j The historical query frequency, size is the number of time points; Set the time point t j and the historical query probability p at the corresponding time point j As a data point j , forming a set of time series data Data.
3. The method for generating pseudo positions based on improved K-Medoids clustering according to claim 1, characterized in that: The gridding of the map comprises: According to the preset grid side length l, the study area is divided into M×N grids of equal size, where M = the length of the horizontal coordinate of the study area / l, N = the length of the vertical coordinate of the study area / l, and the map grid information set Set is obtained. grid = <grid 1,1 ,...,gird m,n ,...,grid M,N >,m=1,..,M,n=1,...,N.
4. The method for generating pseudo positions based on improved K-Medoids clustering according to claim 2, characterized in that: It also includes calculating the historical query probability of each grid in each time period and the historical query probability of each grid in the overall time as follows: in, Represents a grid m,n In time period The historical query probability within, p m,n Represents grid m,n The historical query probability in the overall time, Represents a grid m,n In time period Internal historical query frequency, fre m,n Represents a grid m,n The historical query frequency within the overall time. M and N represent the number of grids divided by the horizontal and vertical axes.
5. The method for generating pseudo positions based on improved K-Medoids clustering according to claim 4, characterized in that: The step of selecting k-1 false positions in the remaining grids comprises: Using the DLS algorithm, 4k grids whose historical query probabilities in the overall time are closest to the historical query probabilities of the current grid in the overall time are selected as the candidate location pool; From each grid in the candidate location pool, k-1 grids whose historical query probabilities in the current time period are closest to the historical query probability of the current grid in the current time period are selected as pseudo locations.
6. A pseudo-position generation device based on improved K-Medoids clustering, characterized in that: include: An initialization module is used to obtain and preprocess the historical query information of the location service provider, calculate the historical query probability at each time point, and form a set of time series data; and divide the map into grids; The partitioning module is used to divide time into several non-overlapping time periods based on time series data. The specific implementation process is as follows: Randomly select c data points from the time series data Data and sort them in ascending time order as the initial cluster centers; Calculate the distance between each data point in the time series data and the cluster center of the previous data point and the cluster center of the next cluster, and divide the data points into clusters with closer distances, as follows: Calculate the center of the first cluster from the first data point point0 0 、The last cluster center is about the virtual point center of x=0 c-1 The Euclidean distance dis 0,center , divide the data point point0 into the cluster with the smallest Euclidean distance: Among them, center represents the cluster center with the smallest Euclidean distance, center = center 0 or center c-1 , point0.t and point0.p refer to the time and historical query probability of the 0th data point respectively, center.t and center.p refer to the time and historical query probability of the cluster center respectively; Traverse all data points in order and calculate the data point point j To the previous data point j-1 Cluster Cluster of Heart Next cluster cluster i+1 The center of the cluster i+1 The Euclidean distance of the data point point j Divide it into clusters with the smallest Euclidean distance, as follows: Condition 1: When the cluster where the previous data point is located For the last cluster cluster c-1 And the data point j The time characteristics of the time series T=<t0,t1,...,t i ,...,t size-1 >When the first part is additionally calculated, the data point point j To the cluster center of the cluster where the previous data point is located i The cluster center mirror point symmetric about x=0 i 'Euclidean distance; Condition 2: When the cluster center of the next cluster is the first cluster cluster0 and the data point is point j When the time feature of is at the tail of the time series T, additional data points are calculated j To the center of the next cluster i+1 The imaginary point center symmetric about x=size i+1 'Euclidean distance; Among them, dis min Indicates the minimum Euclidean distance, dis(point j ,center i ) represents the data point j Go to the cluster center of the previous data point i The Euclidean distance between points, dis(point j ,center i+1 ) represents the data point j To the center of the next cluster i+1 The Euclidean distance between points, dis(point j ,center i ') indicates the data point j Go to the cluster center of the previous data point i The cluster center mirror point symmetric about x=0 i 'Euclidean distance, dis(point j ,center i +1 ') indicates the data point j To the center of the next cluster i+1 The imaginary point center symmetric about x=size i+1 ', the superscript i represents the cluster number, and the subscript j represents the data point number; According to the division results, the Manhattan distance between each data point in the cluster and all other data points in the cluster is calculated, and the absolute error is calculated to form an error matrix, including: The absolute error is calculated as follows: Among them, AbsoluteError represents the absolute error, t i Refers to the current data point i Time data, t j Refers to other data points in the cluster j Time data, p i Refers to the current data point i The historical query probability, p j Refers to other data points in the cluster j The historical query probability of Select the data point with the smallest absolute error as the cluster center, and use the difference between the cluster center set of the old cluster and the cluster center set of the new cluster as the error matrix Metric error ; The cluster division is performed cyclically until the absolute value of each element of the error matrix is equal to 0 or the number of iterations exceeds the preset iteration threshold; Calculate the max length of the time feature interval of each cluster (Set i (point.t))-min(Set i (point.t)), i∈[0,c-1], i.e., time period The time period set consisting of all time periods is expressed as: Set i (point.t) represents cluster i The time data set of all data points in ; The positioning module is used to obtain the current time period according to the current query time and the divided time periods; and to obtain the current grid according to the current position coordinates and the divided grids; as well as The generation module is used to obtain the historical query probability of the current grid within the current time period and the historical query probability of the current grid within the overall time; and based on the obtained historical query probability, select k-1 pseudo locations from the remaining grids to form a location anonymity set that satisfies k anonymity with the current grid, and generate request information including user ID, current query time, location anonymity set and query content.
Citation Information
Patent Citations
Location-based service anonymous query system based on random agents and application method thereof
CN104079659A
False location- and geometry-based location privacy protecting method in location service
CN104796858A