A method and system for obtaining the shortest travel distance

By dividing geographical areas into grids and employing encrypted calculation methods in the spatial crowdsourcing system, the problems of large errors in shortest travel distance calculation and inaccurate reflection of road travel costs in existing technologies are solved, achieving accurate distance calculation under privacy protection.

CN121568102BActive Publication Date: 2026-04-21HUNAN KUANGAN NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUNAN KUANGAN NETWORK TECH CO LTD
Filing Date
2026-01-22
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Among existing methods for obtaining the shortest travel distance with privacy protection, those based on location perturbation or generalization have large calculation errors and low accuracy, while those based on encrypted calculation cannot accurately reflect the real road travel cost.

Method used

By dividing the geographical area into grids on a central server, the shortest travel distance between grid cells is calculated using the Dijkstra algorithm, and data processing is performed within an encrypted computing framework to avoid directly exposing the user's precise location information.

Benefits of technology

It enables accurate calculation of the shortest travel distance along the road network under privacy protection conditions, reduces calculation errors and improves accuracy, and truly reflects the cost of road travel.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121568102B_ABST
    Figure CN121568102B_ABST
Patent Text Reader

Abstract

This invention discloses a method for obtaining the shortest travel distance. First, the target service area is divided into grids, mapping continuous geographic space into discrete grid cells. This ensures that the user's precise location information only participates in subsequent calculations in the form of their respective grid cell, thus avoiding the direct exposure of precise coordinates. Based on this, the user terminal calculates restricted travel distance information based on its precise location and the road network structure associated with the grid cell. This distance information is then encrypted and uploaded to a central server. The central server performs combined calculations on the encrypted distance information from multiple users, generating a ciphertext set of candidate travel distances that meet the task allocation requirements. This ciphertext set is then sent to a decryption server. The decryption server decrypts the received ciphertext set and performs a minimum value selection operation in the plaintext space. The obtained minimum distance is taken as the actual shortest travel distance between the corresponding user and the task.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of privacy protection technology in spatial crowdsourcing, and more specifically, relates to a method and system for obtaining the shortest travel distance. Background Technology

[0002] Spatial crowdsourcing, as a new service model that matches geospatial tasks with mobile workers in real time, has become an important component of smart cities and the sharing economy. The core process of a classic spatial crowdsourcing task allocation begins with task posting: users submit a request with a clear geographical identifier via a mobile application, such as "pick up the item at point A and deliver it to point B." Next, the system enters the worker discovery and matching phase: based on real-time location, the platform filters candidates within a reasonable range of the task's starting point from the online worker pool. The next crucial step is cost calculation and optimization decision-making: the platform needs to estimate the predicted travel distance or time for each candidate worker to reach the task's starting point and then its destination, typically aiming to minimize global cost or maximize task completion rate. Using algorithms, the task is allocated to the most suitable individual, thus completing the task allocation. Spatial crowdsourcing is widely used in food delivery, instant logistics, city inspection, crowdsourced mapping, etc. Its core logic lies in aggregating massive, dynamic task demands with precise location attributes through the platform and dispatching widely distributed crowdsourcing workers to execute them. To maximize the efficiency of this process, the platform must continuously collect and process two types of key spatiotemporal data: the location of the task and the real-time location of the worker, in order to calculate the shortest travel distance and complete efficient task assignment and path planning.

[0003] Existing methods for obtaining the shortest travel distance with privacy protection can be mainly divided into two categories: one is based on location perturbation or generalization, which anonymizes, spatially generalizes, or introduces random noise into the user's precise location information to make the real location indistinguishable within a certain spatial range, and then calculates the distance based on the perturbated location or distance result; the other is based on encrypted computation, which uses secure multi-party computation or homomorphic encryption technology to encrypt the user's location data or distance calculation process, thereby achieving distance calculation without disclosing the user's precise location information.

[0004] However, both of the above methods have some drawbacks that cannot be ignored:

[0005] First, methods based on location perturbation or generalization introduce location uncertainty and can usually only make approximate calculations based on geometric distance or the distance between representative points in anonymous areas. This makes it difficult to accurately characterize the shortest travel distance of users under the constraints of real road networks, resulting in large errors between the calculated results and the actual travel distance, and low accuracy.

[0006] Second, although encryption-based methods can perform distance calculations under strong privacy protection, existing technologies often use geometric distance (such as Euclidean distance) to approximate the actual travel distance along the road network in order to reduce model complexity and computational burden. This ignores the road network topology, traffic rules, and path differences, making the calculated shortest distance infeasible in the actual road network and unable to truly reflect the cost of road travel. Summary of the Invention

[0007] To address the aforementioned deficiencies or improvement needs of existing technologies, this invention provides a method and system for obtaining the shortest travel distance. Its purpose is to solve the technical problems of existing methods based on location perturbation or generalization, which calculate distances by using only fuzzy locations or introducing random noise, resulting in large errors and low accuracy in the calculation of the shortest travel distance. It also addresses the technical problem of existing methods based on encrypted calculation, which use only geometric distances for spatial measurement and cannot accurately reflect the actual road travel costs.

[0008] To achieve the above objectives, according to one aspect of the present invention, a method for obtaining the shortest travel distance is provided, which is applied in a spatial crowdsourcing system including a central server, a decryption server, a first client, and a second client. The method includes the following steps:

[0009] (1) The central server divides the geographical area into grids to obtain multiple grid cells and the latitude and longitude ranges covered by each grid cell. And the set of intersection points consisting of all intersection points between the boundary of each grid cell and the road. All grid cells constitute a grid cell set. and set the grid cells Send to each client;

[0010] (2) The decryption server obtains security parameters from its system initialization configuration file. Maximum plaintext size And the number of encryption attempts supported And based on the obtained security parameters Maximum plaintext size And the number of encryption attempts supported Obtain the encryption key and decryption key ;

[0011] (3) The first client determines the latitude and longitude coordinates corresponding to its current location. and the set of grid cells from the central server Determine the first grid cell corresponding to the current position. ;

[0012] (4) The first client obtains the first grid cell obtained in step (3). The set of intersection points consisting of all intersection points between the boundary and the road Obtain the latitude and longitude coordinates of its current location. Set at the intersection point Find the shortest travel distance at each intersection point and use the encryption key obtained in step (2). Each shortest travel distance is encrypted to obtain a first travel distance ciphertext. All the obtained first travel distance ciphertexts constitute the first travel distance ciphertext set. ;

[0013] (5) The second client obtains the task and its location, and then uses the latitude and longitude coordinates of the location. and the set of grid cells from the central server Determine the second grid cell corresponding to this location. ;

[0014] (6) The second client obtains the second grid cell obtained in step (5). The set of intersection points consisting of all intersection points between the boundary and the road Obtain the latitude and longitude coordinates of the location of the task. Set at the intersection point Find the shortest travel distance at each intersection point and use the encryption key obtained in step (2). Each shortest travel distance is encrypted to obtain a second travel distance ciphertext. All the second travel distance ciphertexts constitute a second travel distance ciphertext set. ;

[0015] (7) The central server obtains the first grid cell obtained in step (3). The set of intersection points consisting of all intersection points between the boundary and the road and the second mesh element obtained in step (5) The set of intersection points consisting of all intersection points of the boundary and the road Obtain the set of intersection points. and the set of intersection points The shortest travel distance between every pair of intersections, and the encryption key obtained in step (2). Each shortest travel distance is encrypted to obtain the third travel distance ciphertext. All third travel distance ciphertexts constitute the third travel distance ciphertext set. ;

[0016] (8) The central server obtains the first travel distance ciphertext set in step (4). The second travel distance ciphertext set obtained in step (6) and the third travel distance ciphertext set obtained in step (7). Get the aggregated ciphertext distance set and aggregate the ciphertext distance set Send to the decryption server;

[0017] (9) The decryption server decrypts the aggregated ciphertext distance set obtained in step (8). and the decryption key obtained in step (2) Obtain multiple plaintext travel distances, and take the minimum value among all the obtained plaintext travel distances as the shortest travel distance between the first client and the second client. and the shortest travel distance Send to the central server.

[0018] Preferably, the first client refers to the worker client in the space crowdsourcing environment, which is used by the executor of the space task, and the second client refers to the requester client in the space crowdsourcing environment, which is used by the publisher of the space task.

[0019] Preferably, step (1) specifically includes the following sub-steps:

[0020] (1-1) Obtain the road network topology of the geographic region and divide the geographic region evenly with a pre-set fixed latitude and longitude interval to obtain multiple initial grid cells of the same size;

[0021] (1-2) For each initial grid cell obtained in step (1-1), obtain all intersection points between the boundary of the initial grid cell and the road, and all intersection points constitute the intersection point set corresponding to the initial grid cell;

[0022] (1-3) Mark the initial grid cells with a set of intersection points greater than a preset threshold (the value ranges from 5 to 20, preferably 10) as grid cells to be merged;

[0023] (1-4) For each grid cell to be merged marked in step (1-3), search for grid cells that are adjacent to the grid cell to be merged in the top, bottom, left and right from the initial grid cells. When the number of intersections between the boundary and the road of the new grid cell formed by merging the grid cell to be merged and its adjacent grid cells is less than the number of intersections corresponding to the grid cell to be merged, perform the grid merging operation between the grid cell to be merged and its adjacent grid cells to obtain the merged grid cell.

[0024] (1-5) Repeat steps (1-4) above until there are no more grid cells to be merged that meet the merging conditions, thereby obtaining multiple merged grid cells and obtaining the latitude and longitude intervals covered by each merged grid cell. And the set of intersection points consisting of all intersection points between the boundary of each merged grid cell and the road. All merged grid cells constitute a grid cell set. and set the grid cells Send to each client.

[0025] Preferably, step (2) specifically involves, firstly, based on safety parameters... Maximum plaintext size And the number of encryption attempts supported The bit length required for calculating the key and generating random numbers and noise growth control parameters Then, randomly generate a string of length . prime numbers And calculate the ciphertext scale parameters. Finally, based on the obtained safety parameters Maximum plaintext size Supported number of encryption attempts , prime numbers and encrypted scale parameters Obtain the encryption key and decryption key .

[0026] Preferably, step (4) specifically includes the following sub-steps:

[0027] (4-1) Set up the counter ;

[0028] (4-2) Determine whether i is greater than or equal to the first grid cell obtained in step (3). The set of intersection points consisting of all intersection points between the boundary and the road length If yes, proceed to step (4-6); otherwise, proceed to step (4-3).

[0029] (4-3) For this set of intersection points The first in Intersection points Specifically, Dijkstra's algorithm is used to obtain the latitude and longitude coordinates of the current location of the first client. To the Intersection points Shortest travel distance ;

[0030] (4-4) Use the encryption key obtained in step (2) The shortest travel distance obtained in step (4-3) Encryption to Ciphertext Distance :

[0031] ;

[0032] in Indicates a from The random number selected from the data. It is a dimension A random binary vector;

[0033] (4-5) Settings , and return to step (4-2);

[0034] (4-6) Merge all the obtained ciphertext distances to obtain the latitude and longitude coordinates corresponding to the current location of the first client. and the set of intersection points First travel distance ciphertext set between .

[0035] Preferably, step (7) specifically includes the following sub-steps:

[0036] (7-1) Set up the counter ;

[0037] (7-2) Judgment Is it greater than or equal to the first mesh cell obtained in step (3)? The set of intersection points consisting of all intersection points between the boundary and the road length If yes, proceed to step (7-9); otherwise, proceed to step (7-3).

[0038] (7-3) Set up the counter ;

[0039] (7-4) Judgment Is it greater than or equal to the second mesh cell obtained in step (5)? The set of intersection points consisting of all intersection points between the boundary and the road length If yes, proceed to step (7-8); otherwise, proceed to step (7-5).

[0040] (7-5) Based on the set of intersection points The first in Intersection points and the set of intersection points The Intersection points And use Dijkstra's algorithm to obtain the first... Intersection points and the Intersection points Shortest travel distance ;

[0041] (7-6) Use the encryption key obtained in step (2) The shortest travel distance obtained in step (7-5) Encryption to Ciphertext Distance ;

[0042] (7-7) Settings And return to step (7-4);

[0043] (7-8) Settings And return to step (7-2);

[0044] (7-9) Combine all the obtained ciphertext distances to obtain the first grid cell obtained in step (3). The set of intersections between the boundary and the road, and the second grid cell obtained in step (5). The third travel distance ciphertext set between the boundary and the set of all intersections of the road and the intersection points. .

[0045] Preferably, step (8) specifically includes the following sub-steps:

[0046] (8-1) Set up the counter ;

[0047] (8-2) Judgment Is it greater than or equal to the first ciphertext distance set obtained in step (4)? length If yes, proceed to step (8-11); otherwise, proceed to step (8-3).

[0048] (8-3) Set up the counter ;

[0049] (8-4) Judgment Is it greater than or equal to the second ciphertext distance set obtained in step (6)? length If yes, proceed to step (8-10); otherwise, proceed to step (8-5).

[0050] (8-5) Set the counter ;

[0051] (8-6) Judgment Is it greater than or equal to the third ciphertext distance set obtained in step (7)? length If yes, proceed to step (8-9); otherwise, proceed to step (8-7).

[0052] (8-7) The first ciphertext distance set obtained from step (4) The ciphertext distance The second ciphertext distance set obtained in step (6) The ciphertext distance and the third ciphertext distance set obtained in step (7). The ciphertext distance Obtain the distance of the aggregated ciphertext. ;

[0053] (8-8) Settings And return to step (8-6);

[0054] (8-9) Settings And return to step (8-4);

[0055] (8-10) Settings And return to step (8-2);

[0056] (8-11) Merge all the obtained aggregated ciphertext distances to obtain the first ciphertext distance set obtained in step (4). The second ciphertext distance set obtained in step (6) and the third ciphertext distance set obtained in step (7). The aggregate distance ciphertext set between And aggregate the distance ciphertext set Send to the decryption server.

[0057] Preferably, step (9) specifically includes the following sub-steps:

[0058] (9-1) Set up the counter ;

[0059] (9-2) Judgment Is it greater than or equal to the aggregated ciphertext distance set obtained in step (8)? length If yes, proceed to step (9-5); otherwise, proceed to step (9-3).

[0060] (9-3) Based on the aggregated ciphertext distance set obtained in step (8) The ciphertext distance and the decryption key obtained in step (2) The ciphertext distance Decryption to plaintext distance :

[0061] ;

[0062] (9-4) Settings And return to step (9-3);

[0063] (9-5) Merge all the plaintext travel distances obtained, and take the minimum value among all the plaintext travel distances as the shortest travel distance between the first client and the second client. and the shortest travel distance Send to the central server.

[0064] Preferably, the process of uniformly dividing the geographical area in step (1-1) with a pre-set fixed latitude and longitude interval is to divide the geographical area according to a fixed angular step size in both the longitude and latitude directions, and the actual geographical distance corresponding to the fixed angular step size is greater than or equal to 500 meters.

[0065] According to another aspect of the present invention, a system for obtaining the shortest travel distance is provided, which is applied in a spatial crowdsourcing system including a central server, a decryption server, a first client, and a second client, the system comprising:

[0066] The first module, located on the central server, is used to divide the geographical area into grids to obtain multiple grid cells and the latitude and longitude ranges covered by each grid cell. And the set of intersection points consisting of all intersection points between the boundary of each grid cell and the road. All grid cells constitute a grid cell set. and set the grid cells Send to each client;

[0067] The second module, located on the decryption server, is used to obtain security parameters from its system initialization configuration file. Maximum plaintext size And the number of encryption attempts supported And based on the obtained security parameters Maximum plaintext size And the number of encryption attempts supported Obtain the encryption key and decryption key ;

[0068] The third module, located on the first client, is used to determine the latitude and longitude coordinates of its current location. and the set of grid cells from the central server Determine the first grid cell corresponding to the current position. ;

[0069] The fourth module, located on the first client, is used to obtain the first mesh cell obtained by the third module. The set of intersection points consisting of all intersection points between the boundary and the road Obtain the latitude and longitude coordinates of its current location. Set at the intersection point The shortest travel distance at each intersection point, and based on the encryption key obtained from the second module. Each shortest travel distance is encrypted to obtain a first travel distance ciphertext. All the obtained first travel distance ciphertexts constitute the first travel distance ciphertext set. ;

[0070] The fifth module, located on the second client, is used to obtain the task and its location, based on the latitude and longitude coordinates of that location. and the set of grid cells from the central server Determine the second grid cell corresponding to this location. ;

[0071] The sixth module, located on the second client, is used to obtain the second mesh cell obtained from the fifth module. The set of intersection points consisting of all intersection points between the boundary and the road Obtain the latitude and longitude coordinates of the location of the task. Set at the intersection point The shortest travel distance at each intersection point, and based on the encryption key obtained from the second module. Each shortest travel distance is encrypted to obtain a second travel distance ciphertext. All the second travel distance ciphertexts constitute a second travel distance ciphertext set. ;

[0072] The seventh module, located on the central server, is used to obtain the first grid cell obtained by the third module. The set of intersection points consisting of all intersection points between the boundary and the road and the second grid cell obtained from the fifth module The set of intersection points consisting of all intersection points of the boundary and the road Obtain the set of intersection points. and the set of intersection points The shortest travel distance between every pair of intersections, and based on the encryption key obtained from the second module. Each shortest travel distance is encrypted to obtain the third travel distance ciphertext. All third travel distance ciphertexts constitute the third travel distance ciphertext set. ;

[0073] The eighth module, located on the central server, is used to process the first travel distance ciphertext set obtained from the fourth module. The second travel distance ciphertext set obtained from the sixth module and the third travel distance ciphertext set obtained from the seventh module. Get the aggregated ciphertext distance set and aggregate the ciphertext distance set Send to the decryption server;

[0074] The ninth module, located on the decryption server, is used to determine the aggregated ciphertext distance set obtained from the eighth module. and the decryption key obtained from the second module Obtain multiple plaintext travel distances, and take the minimum value among all the obtained plaintext travel distances as the shortest travel distance between the first client and the second client. and the shortest travel distance Send to the central server.

[0075] In summary, compared with the prior art, the above-described technical solutions conceived by this invention can achieve the following beneficial effects:

[0076] 1. By employing steps (7) to (9), this invention achieves secure calculation of the shortest travel distance along the road network under the encrypted calculation framework, thereby avoiding approximate distance calculation based solely on the disturbed or generalized location. Therefore, it can solve the technical problems of large error and low accuracy in the shortest travel distance calculation of existing methods based on location disturbance or generalization.

[0077] 2. Because the present invention adopts steps (1) to (6), it introduces a method for calculating the shortest travel distance based on the road network under the condition of privacy protection, so that the distance calculation process no longer depends on the geometric distance approximation model. Therefore, it can solve the technical problem that the existing method based on encrypted calculation only uses geometric distance for spatial measurement and cannot truly reflect the road travel cost. Attached Figure Description

[0078] Figure 1 This is a road map after the geographical area is divided into grids in step (1) of the present invention, where blue dots represent road endpoints or intersections of roads, red dots represent the intersections of grid cell boundaries and roads, and dashed lines represent the boundaries of grid cells.

[0079] Figure 2This is a flowchart of the method for obtaining the shortest travel distance according to the present invention. Detailed Implementation

[0080] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.

[0081] It should be noted that in the description of the embodiments of the present invention, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element. The terms "upper," "lower," etc., indicating orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings, are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the present invention. Those skilled in the art can understand the specific meaning of the above terms in the present invention according to the specific circumstances.

[0082] Furthermore, the technical solutions of the various embodiments of the present invention can be combined with each other, but only if they are based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such combination of technical solutions does not exist and is not within the scope of protection claimed by the present invention.

[0083] The basic idea of ​​this invention is to construct a method for obtaining the shortest travel distance, enabling secure calculation of travel distances along roads without exposing the user's precise location information. In the hierarchical collaborative computing framework, the target service area is first divided into grids, mapping continuous geographic space into discrete grid cells. This ensures that the user's precise location information participates in subsequent calculations only in the form of their respective grid cell, thus avoiding direct exposure of precise coordinates. Based on this, the user terminal calculates restricted travel distance information based on its precise location and the road network structure associated with the grid cell, and encrypts this distance information before uploading it to a central server. The central server, without obtaining the user's precise location information or decrypting the distance information, performs combined calculations on the encrypted distance information from multiple users, generating a candidate ciphertext set of travel distances that meets the task allocation requirements, and sends this ciphertext set to a decryption server. The decryption server decrypts the received ciphertext set and performs a minimum value selection operation in the plaintext space, using the obtained minimum distance as the actual shortest travel distance between the corresponding user and the task.

[0084] The technical terms used in this invention will be explained and described below:

[0085] Travel distance: In a space crowdsourcing scenario, the distance required to move between two points along a road path is called travel distance. In a space crowdsourcing scenario, calculating the travel distance between two points is a prerequisite for other services. For example, before assigning tasks, it is necessary to calculate the travel distance between the task and the user.

[0086] The first client refers to the worker client in the space crowdsourcing environment, which is used by the executor of the space task;

[0087] The second client refers to the requester client in the space crowdsourcing environment, which is used by the publisher of space tasks.

[0088] like Figure 2 As shown, this invention provides a method for obtaining the shortest travel distance, applied in a spatial crowdsourcing system including a central server, a decryption server, a first client, and a second client. The method includes the following steps:

[0089] (1) The central server divides the geographical area into grids (e.g., Figure 1 As shown), to obtain multiple grid cells, and the latitude and longitude intervals covered by each grid cell. And the set of intersection points consisting of all intersection points between the boundary of each grid cell and the road. All grid cells constitute a grid cell set. and set the grid cells Send to each client;

[0090] The advantage of this step (1) is that the client only needs to process the distance calculation based on the grid cell and its corresponding set of intersections, without having to directly use or upload precise location information. This effectively reduces the risk of location privacy leakage while ensuring the integrity of the road network structure information.

[0091] This step specifically includes the following sub-steps:

[0092] (1-1) Obtain the road network topology of the geographic region and divide the geographic region evenly with a pre-set fixed latitude and longitude interval to obtain multiple initial grid cells of the same size;

[0093] Specifically, in this step, uniformly dividing the geographical area with a pre-set fixed latitude and longitude interval means dividing the geographical area in both the longitude and latitude directions according to a fixed angle step (the value ranges from 0.005 degrees to 0.1 degrees, preferably 0.01 degrees), and the actual geographical distance corresponding to the angle step is not less than 500 meters.

[0094] (1-2) For each initial grid cell obtained in step (1-1), obtain all intersection points between the boundary of the initial grid cell and the road, and all intersection points constitute the intersection point set corresponding to the initial grid cell;

[0095] (1-3) Mark the initial grid cells with a set of intersection points greater than a preset threshold (the value ranges from 5 to 20, preferably 10) as grid cells to be merged;

[0096] (1-4) For each grid cell to be merged marked in step (1-3), search for grid cells that are adjacent to the grid cell to be merged in the top, bottom, left and right from the initial grid cells. When the number of intersections between the boundary and the road of the new grid cell formed by merging the grid cell to be merged and its adjacent grid cells is less than the number of intersections corresponding to the grid cell to be merged, perform the grid merging operation between the grid cell to be merged and its adjacent grid cells to obtain the merged grid cell.

[0097] (1-5) Repeat steps (1-4) above until there are no more grid cells to be merged that meet the merging conditions, thereby obtaining multiple merged grid cells and obtaining the latitude and longitude intervals covered by each merged grid cell. And the set of intersection points consisting of all intersection points between the boundary of each merged grid cell and the road. All merged grid cells constitute a grid cell set. and set the grid cells Send to each client;

[0098] (2) The decryption server obtains security parameters from its system initialization configuration file. Maximum plaintext size And the number of encryption attempts supported And based on the obtained security parameters Maximum plaintext size And the number of encryption attempts supported Obtain the encryption key and decryption key ;

[0099] Specifically, this step involves, firstly, based on the safety parameters... Maximum plaintext size And the number of encryption attempts supported The bit length required for calculating the key and generating random numbers and noise growth control parameters Then, randomly generate a string of length . prime numbers And calculate the ciphertext scale parameters. Finally, based on the obtained safety parameters Maximum plaintext size Supported number of encryption attempts , prime numbers and encrypted scale parameters Obtain the encryption key and decryption key ;

[0100] (3) The first client determines the latitude and longitude coordinates corresponding to its current location. and the set of grid cells from the central server Determine the first grid cell corresponding to the current position. ;

[0101] (4) The first client obtains the first grid cell obtained in step (3). The set of intersection points consisting of all intersection points between the boundary and the road Obtain the latitude and longitude coordinates of its current location. Set at the intersection point Find the shortest travel distance at each intersection point and use the encryption key obtained in step (2). Each shortest travel distance is encrypted to obtain a first travel distance ciphertext. All the obtained first travel distance ciphertexts constitute the first travel distance ciphertext set. ;

[0102] This step specifically includes the following sub-steps:

[0103] (4-1) Set up the counter ;

[0104] (4-2) Determine whether i is greater than or equal to the first grid cell obtained in step (3). The set of intersection points consisting of all intersection points between the boundary and the road length If yes, proceed to step (4-6); otherwise, proceed to step (4-3).

[0105] (4-3) For this set of intersection points The first in Intersection points Specifically, Dijkstra's algorithm is used to obtain the latitude and longitude coordinates of the current location of the first client. To the Intersection points Shortest travel distance ;

[0106] (4-4) Use the encryption key obtained in step (2) The shortest travel distance obtained in step (4-3) Encryption to Ciphertext Distance ;

[0107] This step specifically uses the following formula:

[0108] ;

[0109] in Indicates a from The random number selected from the data. It is a dimension A random binary vector.

[0110] (4-5) Settings , and return to step (4-2);

[0111] (4-6) Merge all the obtained ciphertext distances to obtain the latitude and longitude coordinates corresponding to the current location of the first client. and the set of intersection points First travel distance ciphertext set between ;

[0112] (5) The second client obtains the task and its location, and then uses the latitude and longitude coordinates of the location. and the set of grid cells from the central server Determine the second grid cell corresponding to this location. ;

[0113] (6) The second client obtains the second grid cell obtained in step (5). The set of intersection points consisting of all intersection points between the boundary and the road Obtain the latitude and longitude coordinates of the location of the task. Set at the intersection point Find the shortest travel distance at each intersection point and use the encryption key obtained in step (2). Each shortest travel distance is encrypted to obtain a second travel distance ciphertext. All the second travel distance ciphertexts constitute a second travel distance ciphertext set. ;

[0114] The sub-steps included in this step are exactly the same as those in step (4), and will not be repeated here.

[0115] (7) The central server obtains the first grid cell obtained in step (3). The set of intersection points consisting of all intersection points between the boundary and the road and the second mesh element obtained in step (5) The set of intersection points consisting of all intersection points of the boundary and the road Obtain the set of intersection points. and the set of intersection points The shortest travel distance between every pair of intersections, and the encryption key obtained in step (2). Each shortest travel distance is encrypted to obtain the third travel distance ciphertext. All third travel distance ciphertexts constitute the third travel distance ciphertext set. ;

[0116] The advantage of this step (7) is that since the central server only knows the grid cell information of the client and the set of intersections between the grid cell boundary and the road, it cannot obtain the client's precise location information within the grid cell. Therefore, even if the shortest travel distance between the intersections is calculated in advance on the central server side, it will not lead to the leakage of the user's precise location information, thereby avoiding the direct execution of the shortest path calculation in the encrypted state, significantly reducing the computational complexity and improving the overall computational efficiency.

[0117] This step specifically includes the following sub-steps:

[0118] (7-1) Set up the counter ;

[0119] (7-2) Judgment Is it greater than or equal to the first mesh cell obtained in step (3)? The set of intersection points consisting of all intersection points between the boundary and the road length If yes, proceed to step (7-9); otherwise, proceed to step (7-3).

[0120] (7-3) Set up the counter ;

[0121] (7-4) Judgment Is it greater than or equal to the second mesh cell obtained in step (5)? The set of intersection points consisting of all intersection points between the boundary and the road length If yes, proceed to step (7-8); otherwise, proceed to step (7-5).

[0122] (7-5) Based on the set of intersection points The first in Intersection points and the set of intersection points The Intersection points And use Dijkstra's algorithm to obtain the first... Intersection points and the Intersection points Shortest travel distance ;

[0123] (7-6) Use the encryption key obtained in step (2) The shortest travel distance obtained in step (7-5) Encryption to Ciphertext Distance ;

[0124] Specifically, the encryption formula in this step is exactly the same as that in step (4-4) above, and will not be repeated here.

[0125] (7-7) Settings And return to step (7-4);

[0126] (7-8) Settings And return to step (7-2);

[0127] (7-9) Combine all the obtained ciphertext distances to obtain the first grid cell obtained in step (3). The set of intersections between the boundary and the road, and the second grid cell obtained in step (5). The third travel distance ciphertext set between the boundary and the set of all intersections of the road and the intersection points. .

[0128] (8) The central server obtains the first travel distance ciphertext set in step (4). The second travel distance ciphertext set obtained in step (6) and the third travel distance ciphertext set obtained in step (7). Get the aggregated ciphertext distance set and aggregate the ciphertext distance set Send to the decryption server;

[0129] The advantage of this step (8) is that multiple sets of distance ciphertexts are merged into an aggregated ciphertext distance set before being sent to the decryption server. This allows the decryption server to perform decryption operations only on the aggregated ciphertext results, thereby reducing the number of decryption operations and the computational scale, and reducing the computational overhead of the decryption stage.

[0130] This step specifically includes the following sub-steps:

[0131] (8-1) Set up the counter ;

[0132] (8-2) Judgment Is it greater than or equal to the first ciphertext distance set obtained in step (4)? length If yes, proceed to step (8-11); otherwise, proceed to step (8-3).

[0133] (8-3) Set up the counter ;

[0134] (8-4) Judgment Is it greater than or equal to the second ciphertext distance set obtained in step (6)? length If yes, proceed to step (8-10); otherwise, proceed to step (8-5).

[0135] (8-5) Set the counter ;

[0136] (8-6) Judgment Is it greater than or equal to the third ciphertext distance set obtained in step (7)? length If yes, proceed to step (8-9); otherwise, proceed to step (8-7).

[0137] (8-7) The first ciphertext distance set obtained from step (4) The ciphertext distance The second ciphertext distance set obtained in step (6) The ciphertext distance and the third ciphertext distance set obtained in step (7). The ciphertext distance Obtain the distance of the aggregated ciphertext. ;

[0138] (8-8) Settings And return to step (8-6);

[0139] (8-9) Settings And return to step (8-4);

[0140] (8-10) Settings And return to step (8-2);

[0141] (8-11) Merge all the obtained aggregated ciphertext distances to obtain the first ciphertext distance set obtained in step (4). The second ciphertext distance set obtained in step (6) and the third ciphertext distance set obtained in step (7). The aggregate distance ciphertext set between And aggregate the distance ciphertext set Send to the decryption server.

[0142] (9) The decryption server decrypts the aggregated ciphertext distance set obtained in step (8). and the decryption key obtained in step (2) Obtain multiple plaintext travel distances, and take the minimum value among all the obtained plaintext travel distances as the shortest travel distance between the first client and the second client. and the shortest travel distance Send to the central server;

[0143] This step specifically includes the following sub-steps:

[0144] (9-1) Set up the counter ;

[0145] (9-2) Judgment Is it greater than or equal to the aggregated ciphertext distance set obtained in step (8)? length If yes, proceed to step (9-5); otherwise, proceed to step (9-3).

[0146] (9-3) Based on the aggregated ciphertext distance set obtained in step (8) The ciphertext distance and the decryption key obtained in step (2) The ciphertext distance Decryption to plaintext distance Specifically

[0147] ;

[0148] (9-4) Settings And return to step (9-3);

[0149] (9-5) Merge all the plaintext travel distances obtained, and take the minimum value among all the plaintext travel distances as the shortest travel distance between the first client and the second client. and the shortest travel distance Send to the central server.

[0150] Those skilled in the art will readily understand that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for obtaining the shortest travel distance, applied in a spatial crowdsourcing system including a central server, a decryption server, a first client, and a second client, characterized in that, The method includes the following steps: (1) The central server divides the geographical area into grids to obtain multiple grid cells and the latitude and longitude ranges covered by each grid cell. And the set of intersection points consisting of all intersection points between the boundary of each grid cell and the road. All grid cells constitute a grid cell set. and set the grid cells Send to each client; (2) The decryption server obtains security parameters from its system initialization configuration file. Maximum plaintext size And the number of encryption attempts supported And based on the obtained security parameters Maximum plaintext size And the number of encryption attempts supported Obtain the encryption key and decryption key ; (3) The first client determines the latitude and longitude coordinates corresponding to its current location. and the set of grid cells from the central server Determine the first grid cell corresponding to the current position. ; (4) The first client obtains the first grid cell obtained in step (3). The set of intersection points consisting of all intersection points between the boundary and the road Obtain the latitude and longitude coordinates of its current location. Set at the intersection point Find the shortest travel distance at each intersection point and use the encryption key obtained in step (2). Each shortest travel distance is encrypted to obtain a first travel distance ciphertext. All the obtained first travel distance ciphertexts constitute the first travel distance ciphertext set. ; (5) The second client obtains the task and its location, and then uses the latitude and longitude coordinates of the location. and the set of grid cells from the central server Determine the second grid cell corresponding to this location. ; (6) The second client obtains the second grid cell obtained in step (5). The set of intersection points consisting of all intersection points between the boundary and the road Obtain the latitude and longitude coordinates of the location of the task. Set at the intersection point Find the shortest travel distance at each intersection point and use the encryption key obtained in step (2). Each shortest travel distance is encrypted to obtain a second travel distance ciphertext. All the second travel distance ciphertexts constitute a second travel distance ciphertext set. ; (7) The central server obtains the first grid cell obtained in step (3). The set of intersection points consisting of all intersection points between the boundary and the road and the second mesh element obtained in step (5) The set of intersection points consisting of all intersection points of the boundary and the road Obtain the set of intersection points. and the set of intersection points The shortest travel distance between every pair of intersections, and the encryption key obtained in step (2). Each shortest travel distance is encrypted to obtain the third travel distance ciphertext. All third travel distance ciphertexts constitute the third travel distance ciphertext set. ; (8) The central server obtains the first travel distance ciphertext set in step (4). The second travel distance ciphertext set obtained in step (6) and the third travel distance ciphertext set obtained in step (7). Get the aggregated ciphertext distance set and aggregate the ciphertext distance set Send to the decryption server; (9) The decryption server decrypts the aggregated ciphertext distance set obtained in step (8). and the decryption key obtained in step (2) Obtain multiple plaintext travel distances, and take the minimum value among all the obtained plaintext travel distances as the shortest travel distance between the first client and the second client. and the shortest travel distance Send to the central server.

2. The method for obtaining the shortest travel distance according to claim 1, characterized in that, The first client refers to the worker client in the space crowdsourcing environment, used by the executor of the space task; the second client refers to the requester client in the space crowdsourcing environment, used by the publisher of the space task.

3. The method for obtaining the shortest travel distance according to claim 1 or 2, characterized in that, Step (1) specifically includes the following sub-steps: (1-1) Obtain the road network topology of the geographic region and divide the geographic region evenly with a pre-set fixed latitude and longitude interval to obtain multiple initial grid cells of the same size; (1-2) For each initial grid cell obtained in step (1-1), obtain all intersection points between the boundary of the initial grid cell and the road. All intersection points constitute the intersection point set corresponding to the initial grid cell. (1-3) Mark the initial grid cells with a set of intersection points greater than a preset threshold as grid cells to be merged. The preset threshold ranges from 5 to 20. (1-4) For each grid cell to be merged marked in step (1-3), search for grid cells that are adjacent to the grid cell to be merged in the top, bottom, left and right from the initial grid cells. When the number of intersections between the boundary and the road of the new grid cell formed by merging the grid cell to be merged and its adjacent grid cells is less than the number of intersections corresponding to the grid cell to be merged, perform the grid merging operation between the grid cell to be merged and its adjacent grid cells to obtain the merged grid cell. (1-5) Repeat steps (1-4) above until there are no more grid cells to be merged that meet the merging conditions, thereby obtaining multiple merged grid cells, and obtaining the latitude and longitude intervals covered by each merged grid cell. And the set of intersection points consisting of all intersection points between the boundary of each merged grid cell and the road. All merged grid cells constitute a grid cell set. and set the grid cells Send to each client.

4. The method for obtaining the shortest travel distance according to claim 3, characterized in that, Step (2) specifically involves, firstly, based on the safety parameters... Maximum plaintext size And the number of encryption attempts supported The bit length required for calculating the key and generating random numbers and noise growth control parameters Then, randomly generate a string of length . prime numbers And calculate the ciphertext scale parameters. Finally, based on the obtained safety parameters Maximum plaintext size Supported number of encryption attempts , prime numbers and encrypted scale parameters Obtain the encryption key and decryption key .

5. The method for obtaining the shortest travel distance according to claim 4, characterized in that, Step (4) specifically includes the following sub-steps: (4-1) Set up the counter ; (4-2) Determine whether i is greater than or equal to the first grid cell obtained in step (3). The set of intersection points consisting of all intersection points between the boundary and the road length If yes, proceed to step (4-6); otherwise, proceed to step (4-3). (4-3) For this set of intersection points The first in Intersection points Specifically, Dijkstra's algorithm is used to obtain the latitude and longitude coordinates of the current location of the first client. To the Intersection points Shortest travel distance ; (4-4) Use the encryption key obtained in step (2) The shortest travel distance obtained in step (4-3) Encryption to Ciphertext Distance : ; in Indicates a from The random number selected from the data. It is a dimension A random binary vector; (4-5) Settings , and return to step (4-2); (4-6) Merge all the obtained ciphertext distances to obtain the latitude and longitude coordinates corresponding to the current location of the first client. and the set of intersection points First travel distance ciphertext set between .

6. The method for obtaining the shortest travel distance according to claim 5, characterized in that, Step (7) specifically includes the following sub-steps: (7-1) Set up the counter ; (7-2) Judgment Is it greater than or equal to the first mesh cell obtained in step (3)? The set of intersection points consisting of all intersection points between the boundary and the road length If yes, proceed to step (7-9); otherwise, proceed to step (7-3). (7-3) Set up the counter ; (7-4) Judgment Is it greater than or equal to the second mesh cell obtained in step (5)? The set of intersection points consisting of all intersection points between the boundary and the road length If yes, proceed to step (7-8); otherwise, proceed to step (7-5). (7-5) Based on the set of intersection points The first in Intersection points and the set of intersection points The Intersection points And use Dijkstra's algorithm to obtain the first... Intersection points and the Intersection points Shortest travel distance ; (7-6) Use the encryption key obtained in step (2) The shortest travel distance obtained in step (7-5) Encryption to Ciphertext Distance ; (7-7) Settings And return to step (7-4); (7-8) Settings And return to step (7-2); (7-9) Combine all the obtained ciphertext distances to obtain the first grid cell obtained in step (3). The set of intersections between the boundary and the road, and the second grid cell obtained in step (5). The third travel distance ciphertext set between the boundary and the set of all intersections of the road and the intersection points. .

7. The method for obtaining the shortest travel distance according to claim 6, characterized in that, Step (8) specifically includes the following sub-steps: (8-1) Set up the counter ; (8-2) Judgment Is it greater than or equal to the first ciphertext distance set obtained in step (4)? length If yes, proceed to step (8-11); otherwise, proceed to step (8-3). (8-3) Set up the counter ; (8-4) Judgment Is it greater than or equal to the second ciphertext distance set obtained in step (6)? length If yes, proceed to step (8-10); otherwise, proceed to step (8-5). (8-5) Set the counter ; (8-6) Judgment Is it greater than or equal to the third ciphertext distance set obtained in step (7)? length If yes, proceed to step (8-9); otherwise, proceed to step (8-7). (8-7) The first ciphertext distance set obtained from step (4) The ciphertext distance The second ciphertext distance set obtained in step (6) The ciphertext distance and the third ciphertext distance set obtained in step (7). The ciphertext distance Obtain the distance of the aggregated ciphertext. ; (8-8) Settings And return to step (8-6); (8-9) Settings And return to step (8-4); (8-10) Settings And return to step (8-2); (8-11) Merge all the obtained aggregated ciphertext distances to obtain the first ciphertext distance set obtained in step (4). The second ciphertext distance set obtained in step (6) and the third ciphertext distance set obtained in step (7). The aggregate distance ciphertext set between And aggregate the distance ciphertext set Send to the decryption server.

8. The method for obtaining the shortest travel distance according to claim 7, characterized in that, Step (9) specifically includes the following sub-steps: (9-1) Set up the counter ; (9-2) Judgment Is it greater than or equal to the aggregated ciphertext distance set obtained in step (8)? length If yes, proceed to step (9-5); otherwise, proceed to step (9-3). (9-3) Based on the aggregated ciphertext distance set obtained in step (8) The ciphertext distance and the decryption key obtained in step (2) The ciphertext distance Decryption to plaintext distance : ; (9-4) Settings And return to step (9-3); (9-5) Merge all the plaintext travel distances obtained, and take the minimum value among all the plaintext travel distances as the shortest travel distance between the first client and the second client. and the shortest travel distance Send to the central server.

9. The method for obtaining the shortest travel distance according to claim 1, characterized in that, The process of uniformly dividing the geographical area in step (1-1) with a pre-set fixed latitude and longitude interval is to divide the geographical area according to a fixed angular step size in both the longitude and latitude directions, and the actual geographical distance corresponding to the fixed angular step size is greater than or equal to 500 meters.

10. A system for obtaining the shortest travel distance, applied in a spatial crowdsourcing system including a central server, a decryption server, a first client, and a second client, characterized in that, The system includes: The first module, located on the central server, is used to divide the geographical area into grids to obtain multiple grid cells and the latitude and longitude ranges covered by each grid cell. And the set of intersection points consisting of all intersection points between the boundary of each grid cell and the road. All grid cells constitute a grid cell set. and set the grid cells Send to each client; The second module, located on the decryption server, is used to obtain security parameters from its system initialization configuration file. Maximum plaintext size And the number of encryption attempts supported And based on the obtained security parameters Maximum plaintext size And the number of encryption attempts supported Obtain the encryption key and decryption key ; The third module, located on the first client, is used to determine the latitude and longitude coordinates of its current location. and the set of grid cells from the central server Determine the first grid cell corresponding to the current position. ; The fourth module, located on the first client, is used to obtain the first mesh cell obtained by the third module. The set of intersection points consisting of all intersection points between the boundary and the road Obtain the latitude and longitude coordinates of its current location. Set at the intersection point The shortest travel distance at each intersection point, and based on the encryption key obtained from the second module. Each shortest travel distance is encrypted to obtain a first travel distance ciphertext. All the obtained first travel distance ciphertexts constitute the first travel distance ciphertext set. ; The fifth module, located on the second client, is used to obtain the task and its location, based on the latitude and longitude coordinates of that location. and the set of grid cells from the central server Determine the second grid cell corresponding to this location. ; The sixth module, located on the second client, is used to obtain the second mesh cell obtained from the fifth module. The set of intersection points consisting of all intersection points between the boundary and the road Obtain the latitude and longitude coordinates of the location of the task. Set at the intersection point The shortest travel distance at each intersection point, and based on the encryption key obtained from the second module. Each shortest travel distance is encrypted to obtain a second travel distance ciphertext. All the second travel distance ciphertexts constitute a second travel distance ciphertext set. ; The seventh module, located on the central server, is used to obtain the first grid cell obtained by the third module. The set of intersection points consisting of all intersection points between the boundary and the road and the second grid cell obtained from the fifth module The set of intersection points consisting of all intersection points of the boundary and the road Obtain the set of intersection points. and the set of intersection points The shortest travel distance between every pair of intersections, and based on the encryption key obtained from the second module. Each shortest travel distance is encrypted to obtain the third travel distance ciphertext. All third travel distance ciphertexts constitute the third travel distance ciphertext set. ; The eighth module, located on the central server, is used to process the first travel distance ciphertext set obtained from the fourth module. The second travel distance ciphertext set obtained from the sixth module and the third travel distance ciphertext set obtained from the seventh module. Get the aggregated ciphertext distance set and aggregate the ciphertext distance set Send to the decryption server; The ninth module, located on the decryption server, is used to determine the aggregated ciphertext distance set obtained from the eighth module. and the decryption key obtained from the second module Obtain multiple plaintext travel distances, and take the minimum value among all the obtained plaintext travel distances as the shortest travel distance between the first client and the second client. and the shortest travel distance Send to the central server.

Citation Information

Patent Citations

  • Spatial crowdsourcing task allocation system and method constructed through utilization of partial homomorphic crypto scheme

    CN107222302A

  • Space crowdsourcing task allocation privacy protection method and system

    CN113905047A