A privacy protection trajectory similarity range query method under a single cloud server

CN118170985BActive Publication Date: 2026-09-18UNIV OF ELECTRONICS SCI & TECH OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410355265.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-27
Publication Date
2026-09-18
Estimated Expiration
2044-03-27

AI Technical Summary

Technical Problem

一般来说,混淆方法更加高效,但在一定程度上损失了定位服务的准确性,而基于密码的方法与之相反

Benefits of technology

[0040] This invention is a privacy-preserving trajectory similarity range query method under a single cloud server. Compared with existing technologies, this invention achieves privacy protection of trajectory data during the trajectory similarity range query process through Hilbert curve encoding and homomorphic encryption. Its advantages include the following:

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118170985B_ABST
    Figure CN118170985B_ABST
Patent Text Reader

Abstract

A privacy protection trajectory similarity range query method under a single cloud server, comprising: a data owner establishing a mapping relationship of a query table and a corresponding ciphertext vector based on a Hilbert curve and a CKKS encryption algorithm, and uploading local trajectory data after encoding to a cloud server; a query user uploading query data to the cloud server after encoding and submitting a query request; the cloud server calculating a discrete synchronous Euclidean distance based on a Hilbert curve approximation, obtaining a part of trajectories as a preliminary screening result, then performing homomorphic operation on the trajectory data ciphertext, and finally performing a secure range verification to determine the final range query result; and the query user finally restores the range query result through a decoding and decryption algorithm. The application can effectively protect the privacy of trajectory data, query content and query result, ensure the query accuracy, and is very efficient for query processing of large-scale encrypted trajectory data, and is especially suitable for repeated queries and dynamic updating of trajectory data and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of computer science and communication technology, and in particular to a method for querying the similarity range of privacy-preserving trajectories under a single cloud server. Background Technology

[0002] With the development of location services and the widespread adoption of mobile applications, massive amounts of user trajectory data are generated and transmitted, ultimately stored on cloud servers. This data holds immense application value, serving as essential information for various location-based services. In-depth analysis and mining of this data can provide strong support for multiple fields, such as urban construction, traffic management, business planning, advertising recommendations, and epidemic prevention and control. In particular, trajectory similarity range queries, which return all trajectories in the database that meet a specific query range, have broad application prospects. On the other hand, user location and trajectory data also contain a large amount of sensitive information, such as home address, workplace, and shopping habits. Once this data is leaked, it will cause serious privacy problems for users and may even threaten their personal safety. Therefore, while utilizing this data to provide services, the requirements of data availability and privacy protection should be fully considered, and effective measures should be taken to provide comprehensive protection for personal trajectory privacy.

[0003] In recent years, several mature LBS trajectory privacy protection solutions have emerged, such as obfuscation-based and cryptographic-based methods. The main idea behind obfuscation-based location privacy protection methods is to hide the user's true location through techniques such as masking, fake locations, differential privacy, and hybrid zones. Cryptographic-based methods, on the other hand, protect location privacy using cryptographic tools such as spatial transformation, secure multi-party computation (SMC), and private information retrieval (PIR). Generally, obfuscation methods are more efficient but sacrifice some accuracy in location services, while cryptographic methods do the opposite. Currently, only a few works have investigated cryptographic-based trajectory similarity query methods. Since trajectory similarity measurements typically employ dynamic programming algorithms with extensive recursion, and encrypted trajectory data requires numerous comparisons and branching operations in ciphertext, this incurs significant computational and communication overhead. Therefore, in existing trajectory privacy protection query models, data availability and privacy remain a difficult balance to achieve. How to efficiently provide privacy-preserving trajectory similarity range query services is a pressing challenge for those skilled in the art. Summary of the Invention

[0004] This invention addresses the privacy protection issue of trajectory data similarity query in cloud computing environments. It proposes a solution that can both protect privacy and efficiently process trajectory similarity queries, balancing the relationship between privacy protection and query efficiency. This achieves effective protection of trajectory data privacy while maintaining the high efficiency of the query service.

[0005] To achieve the above objectives, the present invention is implemented according to the following technical solution:

[0006] The method described in this invention is executed by the data owner (DO), the cloud server (CS), and the query user (QU). The query user requests a trajectory similarity range query service from the data owner and the cloud server, including the following steps:

[0007] Step S1: System initialization; The data owner constructs a mapping relationship based on the CKKS encryption algorithm and Hilbert curve encoding, and outsources the trajectory data encoded by the Hilbert curve to the cloud server; When a querying user registers in the system, the data owner returns the ciphertext of the selected Hilbert curve parameters and generates a re-encryption key rk. dq Send to cloud server;

[0008] Step S2: Initiate the query; assuming the query user's query trajectory is Q = [(t1,q1),(t2,q2),…,(t…] m ,q m )], where t m It is the timestamp of the sample, q m It represents the location of the moving object at the corresponding time; the H value of each queried trajectory point is obtained by querying the same Hilbert curve parameter encoding used by the user. φ Value, to obtain H φ (Q), H φ (Q)=[(t1,H φ (q1),(t2,H φ (q2),…,(t m H φ (q m ))], where H φ (q m ) represents the spatial point q in the query trajectory. m Hilbert curve HC φ The encoded value under the rules; then, query the user's public key PK using the cloud server. c Encrypt H φ (Q) obtained query request Submitted to the cloud server, δ refers to the similarity threshold range in the user's query request;

[0009] Step S3: Preliminary filtering; The cloud server securely processes similarity queries in the encoding space based on the position-preserving property of the Hilbert curve, and calculates the similarity between trajectories by approximating the distance of the Hilbert curve based on fulcrum correction, thereby obtaining candidate trajectories. As preliminary screening results;

[0010] Step S4: Range verification; The cloud server performs similarity homomorphic calculation and security range verification on the encrypted candidate trajectory coordinates after initial screening to obtain the trajectory results and encrypted identity identifiers that meet the range requirements.

[0011] Step S5: Query Response; The cloud server re-encrypts the obtained trajectory results and identity identifiers and returns the ciphertext to the querying user. The querying user uses the CKKS decryption algorithm and the Hilbert curve decoding algorithm to recover the trajectory results and identity identifier information of the range query.

[0012] Furthermore, the mapping relationship includes a CKKS encrypted vector group for each coordinate within the map area, and a corresponding coded value table under a set of Hilbert curves. The specific construction method is as follows:

[0013] First, data preprocessing is performed; the data owner first simplifies the trajectories in the database using a trajectory thinning algorithm; assuming the positions in the trajectory are located at a resolution of 2... N ×2 N Within the square grid cells, the coordinates are integers; the preprocessed trajectory data is represented as... in, This represents the i-th trajectory in the database, and each trajectory has a corresponding identity identifier (ID). i , l i This indicates the number of sampling points contained in each trajectory. It is the timestamp of the sampling. It is the location of the moving object at a given time, i.e., a spatial point;

[0014] Then, the mapping relationship is constructed; first, the data owner generates a Hilbert curve parameter for the trajectory dataset. By changing the curve direction θ and the starting point P0 through rotation and translation transformations, a family of Hilbert curves is generated, namely... Where r is the number of curves transformed; for each coordinate point (x, y) in the target space, the Hilbert coding algorithm is executed. This point is generated on each curve HC. η The corresponding Hilbert value Where x, y ∈ [0, 2] N -1], Get query table H xy This includes the HC curve. ηThe corresponding Hilbert value

[0015] Then, the data owner DO will transfer the aforementioned HC φ All coded values ​​under the curve The corresponding x and y coordinates of the points are divided into indivual A long x-coordinate vector and d y-coordinate vectors, that is, {x (1) ,…,x (d)} and {y (1) ,…,y (d)},in, The data owner generates a public / private key pair {pk} using the CKKS algorithm. d ,sk d} and compute the key evk, using fully homomorphic encryption with single instruction multiple data stream encoding, to map each coordinate vector to a polynomial and then encrypt it. and The coordinate homomorphic ciphertext matrix and each of the above Hilbert values A mapping relationship is constructed based on the correspondence between the coordinates and the plaintext, that is...

[0016] Furthermore, the specific steps by which the data owner outsources the trajectory data encoded by the Hilbert curve to the cloud server are as follows:

[0017] The data owner runs the Hilbert coding algorithm on each trajectory point in the trajectory. This allows each trajectory to be encoded, i.e.

[0018]

[0019] Among them, H φ (T) represents the encoded trajectory. For spatial points Hilbert curve HC φ The encoded value under the rule.

[0020] At the same time, the data owner runs the CKKS encryption algorithm CKKS.Enc(ID, pk d The identity information is encrypted using a public key to obtain the identity information of the trajectory. Finally, the data owner will query table H. xy Ciphertext matrix [Ex, Ey], encoded trajectory H φ (T) Track Encrypted Identity Identifier The process is outsourced to a cloud server, and the computation key evk for the CKKS algorithm is distributed to the cloud server.

[0021] Furthermore, the specific steps for a user to register in the system are as follows:

[0022] When querying user registration, the CKKS.KeyGen algorithm is run to generate a public-private key pair {sk q ,pk q}, PK its public key q Send to the data owner; the data owner uses the public key to PK. q The Hilbert curve parameters selected for encryption get And run the CKKS re-encryption key generation algorithm CKKS.ReKey(pk q Generate a conversion key rk for querying user QU. dq Then, the data owner will encrypt the Hilbert curve parameters. Send to the querying user and the conversion key rk dq Send to cloud server CS to query user QU's received encrypted message Then, using the private key sk q Decryption to obtain Hilbert curve parameters

[0023] Furthermore, the specific process of step S3 is as follows:

[0024] First, perform approximate similarity calculation with fulcrum correction; upon receiving H φ (Q) After that, the cloud server queries table H. xy Calculate the query trajectory Q and each trajectory T i Approximate distance between The calculation formula is as follows:

[0025]

[0026] in For two spatial points p i With p j The distance between them is calculated using the Hilbert curve distance based on the pivot point correction. Calculated, that is

[0027]

[0028] Where w1,…,w m The fulcrum is randomly selected within the space. The distance along the Hilbert curve is expressed as... Representing spatial point p respectively i and p j Hilbert curve HC η Rule v η The encoded value under (·); v η (pj ) represent spatial point p respectively i and p j Hilbert curve HC η The encoded value under the rule.

[0029] Then, trajectory filtering is performed; the cloud server compares the queried trajectory Q with each trajectory T as described above. i Approximate distance between The trajectory dataset is initially filtered to exclude dissimilar trajectories, while retaining a portion of the original trajectories to obtain candidate trajectories. This serves as the initial filtering result for the range query.

[0030] Furthermore, the range verification specifically includes the following steps:

[0031] Step C1: Encrypted trajectory retrieval; the cloud server uses H points from the trajectory points. φ The candidate trajectory coordinates are obtained by performing an inner product operation on the ciphertext matrix [Ex, Ey]. The ciphertext E(Q) of the query trajectory coordinates is represented as

[0032]

[0033] E(Q)=E(Q)=[(t1,E(q1)),(t2,E(q2)),…,(t m ,E(q m ))]

[0034] Step C2: Homomorphic calculation of trajectory distance; for the candidate trajectory set Each candidate trajectory in The cloud server calculates trajectory similarity in encrypted form using homomorphic addition, homomorphic multiplication, approximate inversion, or other homomorphic operations to obtain the query trajectory Q and each candidate trajectory. The encrypted DSED similarity value between them is calculated using the following expression:

[0035]

[0036] Where, Δt i,j =t j -t i h = l a +l b -c-2,l a and l b The lengths of the two trajectories are represented by c, and the number of trajectory point pairs whose timestamps overlap is represented by e. k The ciphertext representing the distance between spatial points is calculated from the Hilbert curve distance based on the pivot correction;

[0037] Step C3: Secure and accurate range verification; The cloud server uses a secure comparison algorithm based on approximate sign functions to perform a secure range verification operation, obtaining the ciphertext of the trajectory that conforms to the range; Specifically, the cloud server uses a composite polynomial approximation calculation of the sign function to obtain the ciphertext of the arithmetic comparison result E(σ)=(E(μ)+1)·2 -1 Where μ∈{1,-1} represents the result of the symbolic function, and E(μ) represents its ciphertext; if querying trajectory Q and trajectory T i DSED similarity value d between i If ≤δ, then the comparison result E(σ) i The ciphertext E(1) is obtained if the ciphertext value is 1, otherwise the ciphertext E(0) is obtained if the ciphertext value is 0. Finally, the cloud server uses the above ciphertext value E(σ) to perform homomorphic multiplication on the trajectory code and identity information for further transformation. This hides dissimilar trajectory information in the candidate set, obtaining the encrypted trajectory that fits the range as the similarity query result. in, This represents the set of trajectory query results that meet the trajectory similarity range query criteria. Indicates the set The trajectory encoding set, Is this set The identity information corresponding to the trajectory in E pkd (·) indicates that the public key pk of the data owner is used. d Ciphertext that has been encrypted.

[0038] Furthermore, the proxy re-encryption steps are as follows:

[0039] The cloud server uses the proxy re-encryption key rk of the query user. dq Execute the CKKS re-encryption algorithm CKKS re-encryption algorithm Verification results Re-encrypt, and then the cloud server will send the ciphertext. The final range query result is returned to the querying user.

[0040] This invention is a privacy-preserving trajectory similarity range query method under a single cloud server. Compared with existing technologies, this invention achieves privacy protection of trajectory data during the trajectory similarity range query process through Hilbert curve encoding and homomorphic encryption. Its advantages include the following:

[0041] 1) Unlike existing password-based trajectory similarity query methods, this invention designs a filtering method based on Hilbert curves and fulcrum correction to perform preliminary screening of query trajectories, thereby improving query efficiency.

[0042] 2) This invention proposes a privacy-preserving trajectory similarity range query scheme under a single cloud server, which queries the trajectory in the dataset that meets the user's query range in a privacy-preserving manner.

[0043] 3) Experiments and analysis show that the proposed method performs well in terms of privacy protection and efficiency. Security analysis shows that this invention can protect the data privacy of DO, the query content privacy of QU, and the query result privacy. Experimental results show that the filtering algorithm based on Hilbert curves and fulcrum correction can achieve an accuracy of over 99%, and is computationally efficient in processing queries on large-scale encrypted trajectory data, achieving a second-level response time for queries on trajectory datasets containing tens of thousands of data points. Attached Figure Description

[0044] Figure 1 This is an example diagram illustrating the distance calculation between trajectories in this invention;

[0045] Figure 2 Example graph of the improved pivot-based Hilbert distance;

[0046] Figure 3 This is a system architecture diagram corresponding to the method described in this invention;

[0047] Figure 4 This is a system flowchart corresponding to the method described in this invention;

[0048] Figure 5 A diagram illustrating the query accuracy for different filtering ranges;

[0049] Figure 6 This is a schematic diagram illustrating the minimum initial screening range for selecting different query thresholds.

[0050] Figure 7 A schematic diagram illustrating the encoding time of Hilbert curves for different datasets;

[0051] Figure 8 This diagram illustrates the query processing time on different datasets. Detailed Implementation

[0052] The present invention will be further described below with reference to the accompanying drawings and specific embodiments. The illustrative embodiments and descriptions herein are used to explain the present invention, but are not intended to limit the present invention.

[0053] The embodiments of the present invention include the following definitions:

[0054] Definition 1: Discrete synchronous Euclidean distance [2]Discrete Synchronous Euclidean Distance (DSED) is a distance algorithm used to measure the similarity between two discrete trajectories. It is based on the synchronous Euclidean distance and is calculated using the complex trapezoidal numerical integral. Let the two trajectories be...

[0055]

[0056]

[0057] in, It is the timestamp of the sampling. It represents the location of the moving object at the corresponding time, i∈[1,l]. a ],j∈[1,l b To define DSED, we first define the trajectory points. To the discrete trajectory τ B The distance is

[0058]

[0059] in, Represents τ B Online segment Above and The time synchronization position, i.e., coefficients λ1 and λ2, are expressed as... and It is the trajectory τ B Time adjacent points, satisfying ‖·‖2 represents the Euclidean distance. When calculating DSED, we consider the two trajectories τ A ,τ B Merge them into a new sequence according to the order of timestamps, denoted as

[0060]

[0061] in, For τ A or τ B In the trajectory points, h is a coefficient, expressed as h = l a +l b -c-2,l a and l b Let represent the number of sampling points contained in the two trajectories, and c represent the number of trajectory point pairs whose timestamps overlap. According to formula (1), calculate for each k = 1, 2, ..., h. Distance to another trajectory As shown Figure 1 As shown, DSED can be calculated using the following formula:

[0062]

[0063] Where, Δt i,j =t j -t i h = l a +l b -c-2,l a and l b represents the length of the two trajectories, and c represents the number of trajectory point pairs whose timestamps overlap.

[0064] Definition 2: Hilbert curve distance based on pivot correction It is an approximate distance algorithm used to measure the distance between two points. Based on the position-preserving property of Hilbert curves, it combines multiple Hilbert curves and multiple pivot points, using optimization methods to represent the proximity of points in space. For any two points p in space... i and p j , Specifically, the calculation can be performed as follows: Assume the parameters of a Hilbert curve are... Where N, θ, P0, and γ represent the order, direction, starting point, and scaling factor of the Hilbert curve, respectively. By changing the curve direction θ and the starting point P0, the curve HC can be transformed. φ Generate a family of Hilbert curves to obtain Several pivot points are randomly selected in space as distances from the midpoint, and the set of pivot points is denoted as W = {w1, ..., w}. m}. With p i and p j Let the starting point and the ending point be the points mentioned above. A path is formed by passing through these points. Minimize the sum of the distances of the Hilbert curves of each segment in the path, and use this minimum value to represent the spatial point p. i and p j The degree of closeness, that is,

[0065]

[0066] Among them, the Hilbert curve distance Representing spatial point p respectively i and p j Hilbert curve HC η Rule v η The encoded value under (·). v η (p i ), v η (p j ) represent spatial point p respectively i and p j Hilbert curve HC η The encoded value under the rule. Figure 2An example graph is given to calculate the Hilbert curve distance based on the pivot correction. Without introducing the pivot, we have the Hilbert curve distance between the triangulation point pairs p1 = (1,6) and p2 = (4,7). Hilbert curve distance between circled point pairs p3 = (2,4) and p4 = (5,2) If we use the dashed lines in the diagram as fulcrums, i.e., w1 = (2,7) and w′1 = (5,4), then we can obtain the distance between the pairs of triangle points. Distance between circle pairs

[0067] In this example, the user (QU) requests a trajectory similarity range query service from the data owner (DO) and the cloud server (CS). For example... Figure 3 and Figure 4 As shown, an efficient privacy-preserving trajectory similarity range query method under a single cloud server mainly includes five main processes: system initialization, query initiation, preliminary filtering, range verification, and query response, as detailed below:

[0068] Step S1: System Initialization: The data owner DO constructs a mapping relationship using the CKKS (Cheon-Kim-Kim-Song) encryption algorithm and Hilbert curve encoding; then, the data owner DO outsources the trajectory data encoded with the Hilbert curve to the cloud server; when the query user QU registers in the system, the data owner DO returns the ciphertext of the selected Hilbert curve parameters and generates a re-encryption key rk. dq The specific steps for sending to the cloud server are as follows:

[0069] Step A1: Data Preprocessing; The data owner, DO, first simplifies the trajectories in the database using a trajectory thinning algorithm. We assume that the locations of the points in the trajectories are at a resolution of 2. N ×2 N Within a square grid cell, the coordinates are integers. The preprocessed trajectory data is represented as... in, This represents the i-th trajectory in the database, and each trajectory has a corresponding identity identifier (ID). i , l i This indicates the number of sampling points contained in each trajectory. It is the timestamp of the sampling. It is the location of the moving object at a given time, i.e., a spatial point;

[0070] Step A2: Mapping Relationship Construction; First, the data owner DO generates a Hilbert curve parameter for the trajectory dataset. By changing the curve direction θ and the starting point P0 through rotation and translation transformations, a family of Hilbert curves is generated, namely... Where r is the number of curves transformed. For each coordinate point (x, y) in the target space, the Hilbert coding algorithm is performed. This point is generated on each curve HC. η The corresponding H value (Hilbert value) Where x, y ∈ [0, 2] N -1], Get query table H xy This includes the HC curve. η The corresponding H value

[0071] Then, the data owner DO will transfer the aforementioned HC φ All coded values ​​under the curve The corresponding x and y coordinates of the points are divided into indivual A long x-coordinate vector and d y-coordinate vectors, that is, {x (1) ,…,x (d)} and {y (1) ,…,y (d)},in, Data owner DO generates a public / private key pair {pk} for CKKS. d ,sk d} and compute the key evk, using Single Instruction Multiple Data (SIMD) encoding with fully homomorphic encryption, each coordinate vector is mapped to a polynomial and then encrypted. and The coordinate homomorphic ciphertext matrix and each of the above Hilbert values A mapping relationship is constructed based on the correspondence between the coordinates and the plaintext, that is...

[0072] Step A3: Track Encoding and Encryption; The data owner, DO, runs the Hilbert coding algorithm on each track point in the track. This allows each trajectory to be encoded, i.e.

[0073]

[0074] Among them, H φ (T) represents the encoded trajectory. For spatial points Hilbert curve HC φ The encoded value under the rule.

[0075] At the same time, the data owner DO runs the CKKS encryption algorithm CKKS.Enc(ID, pkd The identity information is encrypted using a public key to obtain the identity information of the trajectory. Finally, the data owner DO will query table H. xy Ciphertext matrix [Ex, Ey], encoded trajectory H φ (T) Track Encrypted Identity Identifier The process is outsourced to a cloud server CS, and the computation key evk for the CKKS algorithm is distributed to the cloud server CS.

[0076] Step A4: Query user registration; when querying user QU's registration, run the CKKS.KeyGen algorithm to generate a public / private key pair {sk q ,pk q}, PK its public key q Send to the data owner DO. The data owner DO uses the public key pk. q The Hilbert curve parameters selected for encryption get And run the CKKS re-encryption key generation algorithm CKKS.ReKey(pk q Generate a conversion key rk for querying user QU. dq Then, the data owner, DO, will encrypt the Hilbert curve parameters. Send to query user QU, and transfer key rk dq Send to cloud server CS to query user QU's received encrypted message Then, using the private key sk q Decryption to obtain Hilbert curve parameters

[0077] Step S2: Query Initiation. Assume the query trajectory of user QU is Q = [(t1,q1),(t2,q2),…,(t…]. m ,q m )], where t m It is the timestamp of the sample, q m This refers to the location of the moving object at the corresponding time. The query query, performed by user QU, runs the Hilbert coding algorithm. The query trajectory point is obtained on the Hilbert curve HC φ Encoded H φ Value, i.e., H φ (Q)=[(t1,H φ (q1),(t2,H φ (q2),…,(t m H φ (q m ))], where H φ (q i ) represents the spatial point q in the query trajectory. iHilbert curve HC φ The encoded value under the rules. Then, query user QU using CS's public key pk. c Encrypt H φ (Q) obtained Finally, the query user QU will submit the query request. Submitted to the cloud server CS, δ refers to the similarity threshold range in the user's query request.

[0078] Step S3: Preliminary Filtering. CS securely processes similarity queries in the encoding space, approximating the similarity between trajectories using Hilbert curve distance based on pivot correction, thereby obtaining several trajectories as preliminary filtering results. This mainly includes the following steps:

[0079] Step B1: Calculate the approximate similarity based on the fulcrum correction; upon receiving H φ (Q) After that, the cloud server CS will query table H. xy Calculate the query trajectory Q and each trajectory T i Approximate distance between From formulas (2) and (3), the above similarity It can be calculated as follows:

[0080]

[0081] Among them, two spatial points p i With p j Distance between Hilbert curve distance based on pivot correction Calculated, that is

[0082]

[0083] Where w1,…,w m The pivots are randomly selected within the space, and the pivot set W = {w1, ..., w...} m}; The distance along the Hilbert curve is expressed as... Representing spatial point p respectively i and p j Hilbert curve HC η Rule v η The encoded value under (·); v η (p i ), v η (p j ) represent spatial point p respectively i and p j Hilbert curve HC η The encoded value under the rule.

[0084] Step B2: Trajectory Filtering; The cloud server CS filters the queried trajectory Q and each trajectory T based on the above query. i Approximate distance between The trajectory dataset is initially filtered to exclude dissimilar trajectories, while retaining a portion of the original number of trajectories to obtain candidate trajectories. (The percentage of the number of trajectories after initial screening in the original trajectory dataset is per) h This serves as the initial filtering result for the range query.

[0085] Step S4: Range Verification. The cloud server CS performs similarity homomorphic calculation and security range verification operations on the encrypted candidate trajectory coordinates after initial screening to obtain the trajectory results and encrypted identity identifiers that conform to the range. Furthermore, the range verification process mainly includes the following steps:

[0086] Step C1: Encrypted trajectory retrieval; the cloud server CS retrieves the trajectory points from H. φ The values ​​are obtained by performing inner product operations on the ciphertext matrix [Ex, Ey] to obtain the ciphertext coordinates of these candidate trajectories and the query trajectory, represented as follows:

[0087]

[0088] E(Q)=E(Q)=[(t1,E(q1)),(t2,E(q2)),…,(t m ,E(q m ))]

[0089] Step C2: Homomorphic calculation of trajectory distance; obtain the ciphertext coordinates of the above candidate trajectory and query trajectory. After E(Q), for the candidate trajectory set Each candidate trajectory in The cloud server CS calculates the trajectory similarity given by formula (2) in the encrypted state through homomorphic operations such as homomorphic addition, homomorphic multiplication, and approximate inversion, to obtain Q and each T. i The encrypted DSED similarity value between them is calculated using the following expression:

[0090]

[0091] Among them, e k The ciphertext representing the distance between spatial points is calculated using Hilbert curve distances based on pivot corrections.

[0092] Step C3: Secure and accurate range verification; The cloud server CS uses a secure comparison algorithm based on approximate sign functions to perform a secure range verification operation, obtaining the ciphertext of the trajectory that conforms to the range. Specifically, the cloud server CS obtains the ciphertext of the arithmetic comparison result E(σ)=(E(μ)+1)·2 through a composite polynomial approximation calculation of the sign function. -1 Where μ∈{1,-1} represents the result of the symbolic function, and E(μ) represents its ciphertext. For example [1] , When n=3, then Then there is If the trajectory similarity meets the threshold range δ in the query request, that is, the query trajectory Q and trajectory T i DSED similarity value d between i If ≤δ, then the comparison result E(σ) i The ciphertext E(1) is obtained if the ciphertext value is 1, otherwise the ciphertext E(0) is obtained if the ciphertext value is 0. Finally, the cloud server uses the above ciphertext value E(σ) to perform homomorphic multiplication on the trajectory encoding and identity information for further transformation. This hides dissimilar trajectory information in the candidate set, obtaining the encrypted trajectory that fits the range as the similarity query result. in, This represents the set of trajectory query results that meet the trajectory similarity range query criteria. Indicates the set The trajectory encoding set, Is this set The identity information corresponding to the trajectory in E pkd (·) indicates ciphertext encrypted using the data owner DO's public key.

[0093] Step S5: Query Response. CS re-encrypts the verified trajectory results and identity identifiers, and returns the ciphertext to the querying user QU. The user then uses decryption and decoding algorithms to recover the trajectory results and identity identifier information from the range query. This mainly includes the following steps:

[0094] Step D1: Proxy re-encryption of query results; After completing range verification, the cloud server CS uses the proxy re-encryption key rk of the query user. dq Execute the CKKS re-encryption algorithm CKKS re-encryption algorithm Verification results Re-encrypt. Then, the cloud server CS will... The final range query result is returned to the querying user QU.

[0095] Step D2: Recover query results; Finally, for those processed by rkdq Re-encrypted ciphertext User QU can be queried via private key sk q This is used to decrypt and obtain the trajectory query results and their identity information. Specifically, to obtain the trajectory results for a range query, the querying user can use the private key sk q It can be decrypted by running the CKKS decryption algorithm. To recover trajectory data encoding that conforms to the range, further Hilbert curve decoding algorithm is used. To recover trajectory data In addition, by running the CKKS decryption algorithm Query user QU using private key sk q Restore the identity information of the query results

[0096] This invention's security model assumes that all entities are honest but curious; that is, they honestly execute the protocol but may attempt to infer other parties' private information. Furthermore, the querying user QU does not collude with the cloud server CS. A semi-honest cloud server can launch cloud inference attacks to obtain plaintext trajectory data, identity identifiers, query requests, and results. Additionally, the querying user QU and the data owner DO attempt to spy on each other's trajectory data privacy. Specifically, this invention can achieve the following security objectives:

[0097] 1) The data privacy of data owner DO is protected. During the Hilbert curve-based filtering phase, DO's trajectory data is encoded using a selected Hilbert curve. This curve parameter is encrypted with the query user QU's public key and sent to QU as the conversion key. The cloud server is unaware of the curve parameter and therefore cannot deduce the plaintext of these trajectories from the Hilbert curve encoding value. During the CKKS encryption algorithm-based range verification phase, CS only stores the encrypted coordinates of all trajectory locations, without the private key sk. d Therefore, it is impossible to infer the original trajectory information. Furthermore, the trajectory's identity was determined by the data owner, DO, through a pk (push-key) process before uploading. d Encryption prevents the cloud server from recovering the plaintext. Furthermore, user QU does not collude with CS, so QU can only use sk after CS performs proxy re-encryption. q Restore query result trajectory and their identity information However, the remaining information cannot be deduced.

[0098] 2) The privacy of the user's query content (QU) is protected. Due to the properties of Hilbert curve encoding, the CS cannot infer the query request. Furthermore, the query request is transmitted via the CS's public key (pk). c The data is uploaded after encryption, so the data owner (DO) cannot know about the query request.

[0099] 3) The privacy of user QU's query results is protected. The query results include the returned trajectory results that match the query scope and their corresponding identity identifiers. This privacy information cannot be accessed by the cloud server CS or the data owner DO. Specifically, the returned trajectory results in plaintext are kept secret from the CS because the CS does not know the Hilbert curve conversion key. Furthermore, because the CS uses pk... q The H values ​​of these trajectories are encrypted, and these H values ​​can only be obtained through sk. q Decryption means that even the data owner, DO, cannot obtain the query trajectory results. Regarding identity privacy, CS... The security of the query result is ensured by re-encryption, which means that the ciphertext of the identity identifier in the query result can only be decrypted by the query user QU after re-encryption.

[0100] As can be seen from the above analysis, the data privacy of data owner DO, the query content privacy of query user QU, and the query result privacy are protected. Therefore, the method described in this invention can effectively achieve privacy protection.

[0101] This invention effectively solves the problem of privacy-preserving trajectory similarity range query on a single cloud, and its usability has been verified through experiments. We evaluated this implementation scheme using Python 3.8 on a Dell Precision 7920 Tower server, employing two real trajectory datasets, T-drive and Geolife, and two simulation datasets, Uniform and Normal, generated by a random walk algorithm. The number of trajectories in the above four datasets was set to n = 2000, 2000, 5000, and 5000, respectively, and the corresponding trajectory lengths were l = 100, 200, 100, and 200, respectively. In the evaluation, we set the query map to 2. N ×2 N The grid has orders N = 8, 9, 10, 11. Assume a Hilbert curve has the following parameters: Where N, θ, P0, and γ represent the order, direction, starting point, and scaling factor of the Hilbert curve, respectively. When N = 11 and γ = 5m, the entire map space can represent an area exceeding 100km². 2 The target map is a square area. Taking Geolife as an example, we extracted 2000 trajectories, each 200 meters long, passing through the east and west districts of Beijing, and then divided the target map into 2... 11 ×2 11In a grid where each trajectory point is represented by its corresponding grid cell, the selected curve parameters are φ = {11, a, (0, 0), 5m}. For the CKKS encryption system, we set the security parameters {Polynomial Modulus, Coefficient Modulus, Scale} to {8192, [60, 40, 40, 60], 2 40}

[0102] 1) Preliminary screening accuracy

[0103] To evaluate the effectiveness of the proposed filtering method, we simulated range queries on the Geolife dataset, which contains 5000 real-world trajectories. The initial screening performance was evaluated based on two aspects: accuracy and the minimum initial screening range required to achieve precision. The evaluation results are averaged out from 100. Figure 5 and Figure 6 As shown, per h The parameter represents the selected initial screening range ratio, per0 is the range threshold parameter of the query request, and Our-M2 and Our-M5 represent the filtering schemes of this invention under different parameter settings, that is, the schemes with the number of Hilbert curves r=2 and r=5, respectively. For comparison, we plotted the experimental results of the BASELINE, PTTSQ-M2 and PTTSQ-M5 filtering schemes in reference [2] under the same query scenario. It can be seen that when per h At a value of 0.04, our filtration method achieves an accuracy of over 99%; compared to the PTTSQ scheme, the filtration method of this invention has a smaller [value / percentage]. The value indicates that the proposed method can pre-exclude the vast majority of dissimilar trajectories in range queries. Furthermore, users can customize even smaller filter ranges per... h This allows for approximate range queries, resulting in higher query efficiency.

[0104] 2) Response time

[0105] The total space size and construction time of the lookup table and ciphertext vector for different curve orders N=8, 9, 10, 11 are shown in Tables 1 and 2, respectively. Our-M0 represents the basic lookup table construction scheme in this invention (r=0), and Our-M5 represents the lookup table construction scheme with added translation and rotation transformations (r=5); PTTSQ-M0 and PTTSQ-M5 represent the corresponding table construction schemes in reference [2]. The results show that constructing the query mapping relationship... The time and space required are mainly related to the order N of the selected Hilbert curve. The larger the order N, the higher the time and space complexity. Compared with the table construction scheme in reference [2], the present invention saves time and space in constructing the mapping relationship.

[0106] Table 1. Storage space (Mb) for Hilbert query mapping relationships under different curve orders.

[0107]

[0108] Table 2. Construction time (seconds) of Hilbert query mapping relationships under different curve orders.

[0109]

[0110] For four datasets—T-drive, Geolife, Uniform, and Normal—with different curve orders N = 8, 9, 10, and 11, the time consumption of Hilbert curve encoding is as follows: Figure 7 As shown in the figure. The results indicate that the encoding time of the Hilbert curve is linearly related to the size of the trajectory dataset and increases with the curve order.

[0111] We selected a cluster of Hilbert curves with N=11 and r=5 to construct a lookup table. We simulated similarity range query requests with four different threshold conditions on various datasets, where the percentage of trajectories meeting the query threshold in the datasets was {0.001, 0.002, 0.003, 0.004}. For different initial screening ranges per... h ={0.02,0.03,0.04,0.08}, we can obtain the range per unit of different precisions. h Query results show that a larger initial screening range may achieve higher accuracy, but it will also result in more computation, especially if per... h If the value is 100%, then the exact range query results without filtering will be returned. Figure 8 This displays the response time for a query performed by user QU after system initialization, which is the sum of the initial filtering time, range validation time, and query result recovery time. It can be seen that the query time increases with user... h Increases as well. Because the filtering operation quickly sifts through all trajectories, while the precise search only applies to those trajectories. h Part (per) h This solution allows for detailed querying of trajectories (<100%), and is highly efficient for querying large-scale trajectory data.

[0112] Finally, we compare the total response time with the recent literature STFSM[3] and PDRQ[4]. In the experiment, we randomly selected n=50 and l=50 data from four datasets for range queries. The results of the comparative experiment are listed in Table 3, from which we can verify the efficiency of the proposed range query system in retrieving similar trajectories. After the data owner DO generates the query mapping relationship and initializes the system, the subsequent queries are responded to quickly due to the proposed Hilbert curve filtering algorithm based on fulcrum correction.

[0113] Table 3 lists the comparison results of total response time for range queries on different datasets.

[0114]

[0115] References:

[0116] [1] Cheon JH, Kim D, Kim D. Efficient Homomorphic Comparison Methods with Optimal Complexity [C] / / International Conference on the Theory and Application of Cryptology and Information Security. Springer, Cham, 2020. DOI:10.1007 / 978-3-030-64834-3_8.

[0117] [2] K.Yi, Y.Chen, Y.Su, X.Li, H.Liu, H.Dai, X.Guo, and Y.Chen, "Towards Efficient Privacy-Preserving Top-k Trajectory Similarity Query", 2023 IEEE 20th International Conference on Mobile Ad Hoc and Smart Systems (MASS), Toronto, ON, Canada, 2023, pp.512-520, doi:10.1109 / MASS58611.2023.00070.

[0118] [3] Y. Teng, Z. Shi, F. Zhao, G. Ding, L. Xu, and C. Fan, “Signature-based secure trajectory similarity search” in 2021 IEEE 20th International Conference on Trust, Security and Privacy in Computing and Communications (TrustCom), 2021, pp. 196–206.

[0119] [4] Y.Guan, R.Lu, Y.Zheng, S.Zhang, J.Shao, and G.Wei, “Achieving privacy-preserving discrete frechet distancerange queries,” IEEE Transactions on Dependable and Secure Computing, pp.1–1, 2022.

[0120] The technical solutions of the present invention are not limited to the specific embodiments described above. Any technical modifications made in accordance with the technical solutions of the present invention fall within the protection scope of the present invention.

Claims

1. A method for querying the range of trajectory similarity under a single cloud server with privacy protection, wherein the querying user requests the trajectory similarity range query service from the data owner and the cloud server, characterized in that... Includes the following steps: Step S1: System initialization; The data owner constructs a mapping relationship based on the CKKS encryption algorithm and Hilbert curve encoding, and outsources the trajectory data encoded by the Hilbert curve to the cloud server; When a querying user registers in the system, the data owner returns the ciphertext of the selected Hilbert curve parameters and generates a re-encryption key. Send to cloud server; Step S2: Initiate the query; Assume the query user's query history is as follows ,in, It is the timestamp of the sampling. It represents the location of the moving object at the corresponding time; the query obtains each query trajectory point by querying the same Hilbert curve parameter encoding used by the user. Value, get , ,in, To query spatial points in the trajectory In Hilbert curve The encoded value under the rules; then, query the user's public key on the cloud server. encryption get , will query request Submitted to the cloud server This refers to the similarity threshold range in a user's query request; Step S3: Preliminary filtering; The cloud server securely processes similarity queries in the encoding space based on the position-preserving property of the Hilbert curve, and calculates the similarity between trajectories by approximating the distance of the Hilbert curve based on fulcrum correction, thereby obtaining candidate trajectories. As preliminary screening results; Step S4: Range verification; The cloud server performs similarity homomorphic calculation and security range verification on the encrypted candidate trajectory coordinates after initial screening to obtain the trajectory results and encrypted identity identifiers that meet the range requirements. Step S5: Query Response; The cloud server re-encrypts the obtained trajectory results and identity identifiers and returns the ciphertext to the querying user. The querying user uses the CKKS decryption algorithm and the Hilbert curve decoding algorithm to recover the trajectory results and identity identifier information of the range query. The specific process of step S3 is as follows: First, perform an approximate similarity calculation with fulcrum correction; upon receiving... Then, the cloud server uses the query table. Calculate query trajectory With each trajectory Approximate distance between The calculation formula is as follows: in For two spatial points and The distance between them is calculated using the Hilbert curve distance based on the pivot point correction. Calculated, that is in, The fulcrum is randomly selected within the space. The distance along the Hilbert curve is expressed as... ; , Representing spatial points and In Hilbert curve rule The encoded value below; , , Representing spatial points and In Hilbert curve Encoded values ​​under the rules; Then, trajectory filtering is performed; the cloud server then queries the trajectories as described above. With each trajectory Approximate distance between The trajectory dataset is initially filtered to exclude dissimilar trajectories, thus obtaining candidate trajectories. This serves as the initial filtering result for the range query.

2. The method for querying the similarity range of privacy-preserving trajectories under a single cloud server according to claim 1, characterized in that, The mapping relationship includes a CKKS encrypted vector group for each coordinate within the map area, and a corresponding coded value table under a set of Hilbert curves. The specific construction method is as follows: First, data preprocessing is performed; the data owner first simplifies the trajectories in the database using a trajectory thinning algorithm; assuming the positions of the points in the trajectory are located at a resolution of... Within the square grid cells, the coordinates are integers; the preprocessed trajectory data is represented as... ,in, Representing the first in the database Each trajectory has a corresponding identity identifier. , This indicates the number of sampling points contained in each trajectory. It is the timestamp of the sampling. It is the location of the moving object at a given time, i.e., a spatial point; Then, the mapping relationship is constructed; first, the data owner generates a Hilbert curve parameter for the trajectory dataset. And by changing the direction of the curve and starting point Perform rotation and translation transformations to generate a family of Hilbert curves, i.e. ,in It is the number of curves transformed; for each coordinate point in the target space Execute Hilbert coding algorithm Generate this point on each curve The corresponding Hilbert value ,in , Obtain the query table This includes curves The corresponding Hilbert value ; Then, the data owner will... All coded values ​​under the curve The corresponding x and y coordinates of the points are divided into indivual Long x-coordinate vector and A y-coordinate vector, that is, and ,in, , , The data owner generates a public / private key pair for the CKKS algorithm. and compute key Using fully homomorphic encryption and single-instruction multiple-data-stream coding, each coordinate vector is mapped to a polynomial and then encrypted. and The coordinate homomorphic ciphertext matrix and each of the above Hilbert values A mapping relationship is constructed based on the correspondence between the coordinates and the plaintext, that is... .

3. The method for querying the similarity range of privacy-preserving trajectories under a single cloud server according to claim 2, characterized in that, The specific steps by which the data owner outsources the trajectory data encoded with the Hilbert curve to the cloud server are as follows: The data owner, DO, runs the Hilbert coding algorithm on each trajectory point in the trajectory. This allows each trajectory to be encoded, i.e. in, For encoding the trajectory, For spatial points In Hilbert curve The encoded value follows the rules; simultaneously, the data owner runs the CKKS encryption algorithm. The identity information is encrypted using a public key to obtain the identity information of the trajectory. Finally, the data owner will query the table. Ciphertext Matrix , coding trajectory Tracking Encryption Identity Identification Outsourced to cloud server CS, and the calculation key of CKKS algorithm is used. Distribute to cloud server CS.

4. The method for querying the similarity range of privacy-preserving trajectories under a single cloud server according to claim 3, characterized in that, The specific steps for a user to register in the system are as follows: When querying user registration, run Algorithm generates public-private key pairs , and its public key Send to the data owner; the data owner uses the public key. The Hilbert curve parameters selected for encryption get And run the CKKS re-encryption key generation algorithm. Generate conversion key for query user QU Then, the data owner will encrypt the Hilbert curve parameters. Send to the querying user and the conversion key Send to cloud server CS to query user QU's received encrypted message Then, using the private key Decryption to obtain Hilbert curve parameters .

5. The method for querying the similarity range of privacy-preserving trajectories under a single cloud server according to claim 4, characterized in that, The range verification specifically includes the following steps: Step C1: Encrypted trajectory retrieval; the cloud server retrieves trajectory points. Values ​​in the ciphertext matrix Based on this, the ciphertext of candidate trajectory coordinates is obtained through inner product operation. And query trajectory coordinates encrypted text , represented as Step C2: Homomorphic calculation of trajectory distance; for the candidate trajectory set Each candidate trajectory in The cloud server calculates trajectory similarity in encrypted form using homomorphic addition, homomorphic multiplication, approximate inversion, or other homomorphic operations to obtain the query trajectory. and each candidate trajectory between The ciphertext of the similarity value is calculated using the following expression: in, , , and Indicates the length of the two trajectories. This represents the number of trajectory point pairs whose timestamps overlap. The ciphertext representing the distance between spatial points is calculated from the Hilbert curve distance based on the pivot correction; Step C3: Secure and accurate range verification; The cloud server uses a secure comparison algorithm based on approximate sign functions to perform secure range verification operations, obtaining ciphertext of the trajectory that conforms to the range; specifically, the cloud server obtains the ciphertext of the arithmetic comparison result through composite polynomial approximation calculation of sign functions. ,in, Represents the result of the symbolic function. This represents its ciphertext; if querying the trajectory and trajectory Between Similarity value The comparison result Ciphertext with a value of 1 Otherwise, you will get 0 in the ciphertext. Finally, the cloud server uses the aforementioned encrypted value. Homomorphic multiplication is performed on the trajectory code and identity information respectively for further transformation. , This hides dissimilar trajectory information in the candidate set, obtaining the ciphertext of the trajectory that meets the range as the similarity query result. ,in, This represents the set of trajectory query results that meet the trajectory similarity range query criteria. Indicates the set The trajectory encoding set, Is this set The identity information corresponding to the trajectory in the video. This indicates the use of the data owner's public key. Ciphertext that has been encrypted.

6. The method for querying the similarity range of privacy-preserving trajectories under a single cloud server according to claim 5, characterized in that, The steps for proxy re-encryption are as follows: The cloud server uses the queried user's proxy re-encryption key. Execute the CKKS re-encryption algorithm CKKS re-encryption algorithm Regarding the verification results Re-encrypt, and then the cloud server will send the ciphertext. The final range query result is returned to the querying user.

7. The method for querying the similarity range of privacy-preserving trajectories under a single cloud server according to claim 6, characterized in that, The decryption process for the querying user is as follows: Query user via private key To decrypt and obtain the trajectory query results and their identification information; specifically, by running the CKKS decryption algorithm. To recover trajectory data encoding that conforms to the range, further Hilbert curve decoding algorithm is used. To recover trajectory data Furthermore, by running the CKKS decryption algorithm... Query user using private key Restore the identity information of the query results .