Spherical distance range privacy protection judgment method based on homomorphic encryption

By using a homomorphic encryption-based method to determine spherical distances within the ciphertext domain, the problems of large errors and low efficiency in existing technologies are solved. This achieves high-precision, low-error spherical distance determination, which is suitable for telecommunications base station planning and site selection, and ensures data privacy.

CN122348813APending Publication Date: 2026-07-07CHINA TOWER CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA TOWER CO LTD
Filing Date
2026-03-30
Publication Date
2026-07-07

AI Technical Summary

Technical Problem

Existing technologies cannot achieve high-precision spherical distance determination without disclosing sensitive information when collaborating on geographic coordinate data. In particular, the error is large in medium and long distance cases, and the calculation efficiency is low, making it difficult to meet the needs of telecommunications base station planning and site selection.

Method used

A homomorphic encryption-based method is adopted, which uses additive homomorphic encryption technology to encrypt the location coordinates, generate ciphertext data, and perform linear combination and mask comparison in the ciphertext domain. Finally, in the ciphertext state, it is determined whether the spherical distance meets the preset threshold to ensure that the location information is not leaked.

Benefits of technology

It achieves high-precision spherical distance determination with an error of less than 0.1%, significantly improves computational efficiency, is suitable for cross-enterprise data collaboration, reduces system integration difficulty and operation and maintenance costs, and ensures data privacy protection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122348813A_ABST
    Figure CN122348813A_ABST
Patent Text Reader

Abstract

The application discloses a kind of methods for judging spherical distance range privacy protection based on homomorphic encryption, belong to the field of privacy computing and geographic information technology, including service party obtains first position coordinate, first position coordinate is homomorphic encryption based on additive homomorphic encryption, generate first coordinate ciphertext data and send to inquirer party.Inquirer party obtains second position coordinate, calculate plaintext coefficient and carry out homomorphic linear combination encryption with first coordinate ciphertext, obtain second coordinate ciphertext data.Based on second coordinate ciphertext data and preset distance threshold, calculate mask comparison ciphertext and send to service party.Service party is decrypted to comparison plaintext by mask comparison ciphertext, and whether the spherical distance between service party and inquirer party meets preset distance threshold is judged according to comparison plaintext, and the judgment result is returned to inquirer party.The application realizes that the spherical distance between two points does not exceed preset threshold under the premise of not leaking user and service point plaintext coordinate, efficiently and accurately judges.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of privacy computing and geographic information technology, and specifically relates to a method for determining the privacy protection of spherical distance range based on homomorphic encryption. Background Technology

[0002] With the accelerated construction of 5G networks and the deepening of the co-construction and sharing mechanism for communication infrastructure, construction parties and telecom operators face increasingly frequent data collaboration needs in scenarios such as base station site selection, coverage assessment, and resource coordination. However, due to data security and commercial privacy considerations, parties are usually unwilling to directly exchange raw geographic coordinates (such as latitude and longitude) or sensitive site attributes. Therefore, it is urgent to accurately determine whether existing site locations meet actual needs without disclosing sensitive information. Currently, there are existing technical solutions that can solve this privacy distance judgment problem, but they all have certain limitations. For example: 1. A typical example is the existing solution CN202211273157.2 "A Spatial Distance Calculation Method and System Based on Homomorphic Encryption", which uses the Euclidean distance squared model and obtains the complete distance value through a salting-decryption-desalting process. The main drawback of this type of solution is that Euclidean distance is a planar distance model, which completely ignores the curvature of the Earth. When processing geographic coordinates, especially in medium to long distances (tens of kilometers or more), it will introduce significant errors and cannot meet the needs of high-precision distance assessment in scenarios such as telecom base station planning and site selection. 2. Other planar approximation models: Planar models such as Manhattan distance and Chebyshev distance also suffer from the problem of ignoring the curvature of the Earth, resulting in larger errors and unsuitability for precise geographic calculations. 3. Function approximation-based methods: To obtain more accurate spherical distances, some schemes attempt to approximate the nonlinear functions such as sine, cosine, and inverse cosine in the precise spherical distance formula (such as the Haversine formula) using polynomials, thereby enabling calculations under homomorphic encryption. The main drawback of this approach is that high-order polynomial approximation introduces uncontrollable model errors and significantly increases the computational overhead of homomorphic encryption, leading to low efficiency and making it difficult to apply in large-scale practical scenarios (such as batch site evaluation). In summary, existing technical solutions suffer from a difficulty in simultaneously achieving accuracy, efficiency, and practicality. Therefore, there is an urgent need in this field for a method that can efficiently and accurately determine the range of spherical distances without disclosing sensitive information. Summary of the Invention

[0003] To address the aforementioned issues, this invention provides a privacy-preserving judgment method for spherical distance range based on homomorphic encryption, thereby resolving the problems of low accuracy, low efficiency, and difficulty in applying existing privacy distance judgment methods in real-world large-scale scenarios.

[0004] A privacy protection judgment method for spherical distance range based on homomorphic encryption includes: The service provider obtains the first location coordinates, performs homomorphic encryption on the first location coordinates based on additive homomorphic encryption technology, generates the first coordinate ciphertext data, and sends it to the querying party. The querying party obtains the second location coordinates, calculates the plaintext coefficient based on the second location coordinates, and performs a homomorphic linear combination encryption with the ciphertext data at the first coordinate, resulting in the ciphertext data at the second coordinates. Based on the second coordinate ciphertext data and the preset distance threshold, a mask comparison ciphertext is calculated and sent to the service provider; The service provider decrypts the mask comparison ciphertext to obtain the comparison plaintext, and determines whether the spherical distance between the service provider and the querying party meets the preset distance threshold based on the comparison plaintext, and returns the determination result to the querying party.

[0005] According to a specific embodiment of the present invention, the service provider obtains first location coordinates, performs homomorphic encryption on the first location coordinates based on additive homomorphic encryption technology, generates first coordinate ciphertext data, and sends it to the querying party, further comprising: The service provider generates a key pair, including a public key and a private key, based on additive homomorphic encryption technology; Obtain the first location coordinates and use trigonometric functions to calculate its three characteristic components A, B, and C, where the first location coordinates are the latitude and longitude of the service provider's location. Homomorphic encryption is performed on the three feature components A, B, and C based on the public key to obtain the ciphertext triples [[A]], [[B]], [[C]], which are the first coordinate ciphertext data. The generated public key and ciphertext triples [[A]], [[B]], and [[C]] are simultaneously sent to the querying party.

[0006] According to a specific embodiment of the present invention, the calculation formulas for the three feature components A, B, and C are as follows: A = sin(lat1)

[0007]

[0008] Where lat1 and lon1 are the latitude and longitude of the first position coordinates, respectively.

[0009] According to a specific embodiment of the present invention, the querying party obtains the second location coordinates, calculates the plaintext coefficient based on the second location coordinates, and performs homomorphic linear combination encryption with the first coordinate ciphertext data to obtain the second coordinate ciphertext data, which further includes: The querying party obtains the second location coordinates and uses trigonometric functions to calculate its three plaintext coefficients s, cx, and cy, where the second location coordinates are the latitude and longitude of the querying party's location. Based on the public key, a homomorphic linear combination calculation is performed on the three plaintext coefficients s, cx, cy and the ciphertext triples [[A]], [[B]], [[C]] to obtain the second coordinate ciphertext data.

[0010] According to a specific embodiment of the present invention, the calculation formulas for the three plaintext coefficients s, cx, and cy are as follows: s = sin(lat2)

[0011]

[0012] Where lat2 and lon2 are the latitude and longitude of the second position coordinates, respectively.

[0013] According to a specific embodiment of the present invention, the formula for calculating the second coordinate encrypted data is as follows:

[0014] Wherein, [[S]] is the second coordinate ciphertext data, that is, the ciphertext of the cosine value of the angular distance between the service provider and the query provider, cosθ.

[0015] According to a specific embodiment of the present invention, calculating a mask comparison ciphertext based on second coordinate ciphertext data and a preset distance threshold, and sending it to the service provider further includes: Calculate the intermediate variable ciphertext in the Haversine formula based on the ciphertext data of the second coordinate. ; The upper limit value of plaintext is calculated based on a preset distance threshold and the Earth's radius. ; Calculate the intermediate variable ciphertext With plaintext upper limit The difference ciphertext; The mask is calculated based on the difference ciphertext, compared with the ciphertext, and then sent to the service provider.

[0016] According to a specific embodiment of the present invention, the intermediate variable ciphertext The calculation formula is:

[0017] Where [[S]] represents the encrypted data of the second coordinate.

[0018] According to a specific embodiment of the present invention, the plaintext upper limit value The calculation formula is:

[0019] Where D is the preset distance threshold and R is the Earth's radius.

[0020] According to a specific embodiment of the present invention, the formula for calculating the difference ciphertext is as follows:

[0021] in, This is the difference ciphertext.

[0022] According to a specific embodiment of the present invention, the formula for calculating the mask-compared ciphertext is as follows:

[0023] in, To compare the ciphertext with the mask, r is a random mask. This is the difference ciphertext.

[0024] According to a specific embodiment of the present invention, the service provider decrypts the mask comparison ciphertext to obtain the comparison plaintext, and determines whether the spherical distance between the service provider and the querying party meets a preset distance threshold based on the comparison plaintext, and returns the determination result to the querying party, further including: The service provider uses its private key to decrypt the masked comparison ciphertext, obtaining the comparison plaintext t, whose expression is: t=

[0025] Where r is a random mask, For the intermediate variable in the Haversine formula, This is the upper limit of the plaintext value; Based on the comparison of plaintext t, determine whether the spherical distance between the service provider and the query provider meets the preset distance threshold D. The determination condition is as follows: If t 0, then Determine the spherical distance D; If t≥0, then Determine if the spherical distance is greater than or equal to D; The service provider will return the judgment result to the querying party.

[0026] Compared with existing technologies, the spherical distance range privacy protection judgment method based on homomorphic encryption provided by this invention has the following advantages: 1. High precision: Strictly follows the spherical geometric model, with extremely low error.

[0027] This invention transforms the Haversine formula into a dot product of unit spherical vectors through mathematical reconstruction, enabling rigorous spherical distance calculations directly within the encrypted domain. This results in a method error of less than 0.1%, meeting the demands of highly accurate geographic scenarios such as tower site selection and base station coverage assessment.

[0028] 2. High efficiency: Low computational complexity and significantly improved performance.

[0029] The technical solution of this invention requires only a single linear combination of ciphertexts and simple post-processing, eliminating the need for complex function approximation calculations and high-overhead operations such as ciphertext-ciphertext multiplication. This method is perfectly compatible with mainstream additive homomorphic encryption libraries (such as Paillier). In practical applications, it can significantly reduce the evaluation time for a single thousand-site evaluation from hours using traditional methods to minutes, substantially improving the efficiency of cross-enterprise data collaboration.

[0030] 3. Strong privacy: The entire computation is encrypted, and the data is "usable but not visible".

[0031] Throughout the entire judgment process, the geographical coordinates of both the service provider and the querying party are always stored in encrypted form, ensuring that neither party can know the other's plaintext coordinates. By introducing a "symbol-preserving" result protection mechanism based on a random positive integer mask, this invention effectively prevents side-channel attacks that attempt to deduce specific distance values ​​from the decrypted results, while ensuring the correctness of the judgment result, thus achieving true privacy protection.

[0032] 4. Highly practical: Lightweight architecture, easy to deploy across enterprises.

[0033] This invention does not rely on any trusted third party (TTP), nor does it require complex multi-party secure computation (MPC) protocols or multiple rounds of interaction. Its communication process is extremely simple, involving only one transmission of encrypted features and one return of the mask comparison result. This end-to-end lightweight protocol greatly reduces the difficulty of system integration and operation and maintenance costs, making it very easy to deploy between different enterprise entities, and effectively reducing the risk of data leakage and legal compliance costs. Attached Figure Description

[0034] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0035] Figure 1 This is a flowchart of a privacy protection judgment method for spherical distance range based on homomorphic encryption according to an embodiment of the present invention.

[0036] Figure 2 This is a flowchart of a method provided by an embodiment of the present invention for a service provider to obtain first location coordinates, perform homomorphic encryption on the first location coordinates based on additive homomorphic encryption technology, and generate first coordinate ciphertext data.

[0037] Figure 3This is a flowchart of a method provided by an embodiment of the present invention to obtain second location coordinates, calculate plaintext coefficients based on the second location coordinates, and perform homomorphic linear combination encryption with the first coordinate ciphertext data to obtain second coordinate ciphertext data.

[0038] Figure 4 This is a flowchart of a method according to an embodiment of the present invention for calculating a mask comparison ciphertext based on second coordinate ciphertext data and a preset distance threshold, and sending it to a service provider.

[0039] Figure 5 This is a flowchart of a method provided by an embodiment of the present invention, in which a service provider decrypts a mask comparison ciphertext to obtain a comparison plaintext, determines whether the spherical distance between the service provider and the querying party meets a preset distance threshold based on the comparison plaintext, and returns the determination result to the querying party. Detailed Implementation

[0040] To enable those skilled in the art to more clearly understand the concepts and ideas of the present invention, the present invention is described in detail below with reference to specific embodiments. It should be understood that the embodiments given herein are only a part of all possible embodiments of the present invention. Those skilled in the art, after reading this specification, are capable of making improvements, modifications, or substitutions to parts or the entirety of the following embodiments, and such improvements, modifications, or substitutions are also included within the scope of protection claimed by the present invention.

[0041] In this document, the terms “announcement,” “arrival,” and other similar words are not intended to imply any order, quantity, or importance, but are merely used to distinguish different elements. The terms “one,” “a,” and other similar words are not intended to indicate the existence of only one thing, but rather that the description pertains to only one of the things, which may have one or more. The terms “contains,” “includes,” and other similar words are intended to indicate a logical relationship, not a spatial relationship. For example, “A includes B” means that logically B belongs to A, not that spatially B is located inside A. Furthermore, the meanings of the terms “contains,” “includes,” and other similar words should be considered open-ended, not closed. For example, “A includes B” means that B belongs to A, but B does not necessarily constitute all of A; A may also include other elements such as C, D, and E.

[0042] In this document, the terms "embodiment," "this embodiment," "an embodiment," and "one embodiment" do not imply that the description applies only to one specific embodiment, but rather that such description may also be applicable to one or more other embodiments. Those skilled in the art will understand that any description made herein with respect to one embodiment can be substituted, combined, or otherwise incorporated with the descriptions in one or more other embodiments. New embodiments resulting from such substitutions, combinations, or other incorporations are readily conceived by those skilled in the art and fall within the scope of protection of this invention.

[0043] Example 1 Additional aspects and advantages of embodiments of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of embodiments of the invention. Figures 1-5 This invention provides a method for protecting privacy across spherical distance ranges based on homomorphic encryption, comprising: S1: The service provider obtains the first location coordinates, performs homomorphic encryption on the first location coordinates based on additive homomorphic encryption technology, generates the first coordinate ciphertext data, and sends it to the querying party.

[0044] S2: The querying party obtains the second position coordinates, calculates the plaintext coefficient based on the second position coordinates, and performs homomorphic linear combination encryption with the first coordinate ciphertext data to obtain the second coordinate ciphertext data.

[0045] S3: Calculate the mask comparison ciphertext based on the second coordinate ciphertext data and the preset distance threshold, and send it to the service provider.

[0046] S4: The service provider decrypts the mask comparison ciphertext to obtain the comparison plaintext, and determines whether the spherical distance between the service provider and the querying party meets the preset distance threshold based on the comparison plaintext, and returns the judgment result to the querying party.

[0047] Specifically, step S1, where the service provider obtains the first location coordinates, performs homomorphic encryption on the first location coordinates using additive homomorphic encryption technology, generates ciphertext data of the first coordinates, and sends it to the querying party, further includes: S11: The service provider generates a key pair, including a public key and a private key, based on additive homomorphic encryption technology.

[0048] In one specific embodiment of the present invention, the service provider first selects an additive homomorphic encryption algorithm (e.g., the Paillier encryption algorithm) and calls the key generation function of the selected encryption algorithm to generate a key pair, including a public key pk and a private key sk. The public key is used to encrypt data. The service provider can distribute this public key to authorized querying parties, enabling them to perform scalar multiplication (plaintext multiplied by ciphertext) and ciphertext addition operations on the ciphertext without accessing the private key. The private key is used to decrypt data and is strictly kept confidential by the service provider, stored only in the service provider's secure environment, and not transmitted externally. The generated key pair will serve as the basis for all subsequent privacy-preserving computation processes.

[0049] S12: Obtain the first location coordinates and calculate its three characteristic components A, B, and C using trigonometric functions. The first location coordinates are the latitude and longitude of the service location. The calculation formulas for the three characteristic components A, B, and C are as follows: A=sin(lat1)(1) (2) (3) Where lat1 and lon1 are the latitude and longitude of the first position coordinates, respectively.

[0050] In a specific embodiment of the present invention, the service provider first obtains the first location coordinates, namely the service provider's own latitude and longitude (lat1, lon1). In order to transform the nonlinear Haversine spherical distance formula into a linear inner product form that supports homomorphic encryption, the service provider needs to calculate three specific trigonometric function feature components A, B, and C based on its latitude and longitude (lat1, lon1) using formulas (1) to (3). These three feature components A, B, and C essentially constitute the Cartesian coordinate components of a unit spherical vector. In the traditional Haversine formula, directly calculating the distance between two points involves complex inverse trigonometric functions. The present invention transforms the above coordinates into a vector dot product form through mathematical reconstruction to support subsequent homomorphic encryption.

[0051] S13: Homomorphically encrypt the three feature components A, B, and C based on the public key to obtain the ciphertext triples [[A]], [[B]], [[C]], which are the first coordinate ciphertext data.

[0052] S14: Simultaneously send the generated public key and ciphertext triples [[A]], [[B]], [[C]] to the querying party.

[0053] In a specific embodiment of the present invention, in order to convert the plaintext location features of the service provider into ciphertext form, so that the querying party can participate in subsequent distance calculations without decryption or access to the plaintext data, the service provider uses its locally generated public key (pk) to call the encryption function Enc(·) of the selected additive homomorphic encryption algorithm (such as the Paillier algorithm) to perform encryption operations on the three-dimensional feature components A, B, and C calculated in step S12, i.e., [[A]] = Enc(A), [[B]] = Enc(B), [[C]] = Enc(C). After encryption, the original plaintext features (A, B, C) are converted into corresponding ciphertext triples ([[A]], [[B]], [[C]]). These ciphertext triples carry all the geometric information of the service provider's location. However, in the ciphertext state, no external entity (including the querying party) can deduce the original latitude and longitude (lat1, (lon1) This ciphertext triple will be packaged together with the public key pk and sent to the querying party as the basis for subsequent homomorphic computation. Through the above encryption process, the location data of the service provider is made "usable but not visible". Although the querying party holds [[A]], [[B]], [[C]] and the public key pk, it cannot decrypt the plaintext due to the lack of the private key sk. At the same time, thanks to the additive homomorphic property, the querying party can still use the public key to perform scalar multiplication and addition operations on these ciphertexts, laying the foundation for subsequent spherical distance determination within the ciphertext domain.

[0054] Specifically, in step 2, the querying party obtains the second location coordinates, calculates the plaintext coefficient based on the second location coordinates, and performs homomorphic linear combination encryption with the first coordinate ciphertext data to obtain the second coordinate ciphertext data, which further includes: S21: The querying party obtains the second location coordinates and uses trigonometric functions to calculate its three plaintext coefficients s, cx, and cy, where the second location coordinates are the latitude and longitude of the querying party's location. The formulas for calculating the three plaintext coefficients s, cx, and cy are as follows: (4) (5) (6) in, , These are the latitude and longitude of the second location coordinates, respectively.

[0055] In a specific embodiment of the present invention, the querying party first obtains the second location coordinates, namely the querying party's own location latitude and longitude (lat2, lon2), and then generates three plaintext coefficients s, cx, and cy corresponding to its own geographical location through trigonometric function operations. These three plaintext coefficients correspond to the three feature components (A, B, C) of the service provider, constituting the Cartesian coordinate components of the querying party's unit vector. Since these coefficients are calculated locally by the querying party based on its own coordinates and do not involve any privacy data transmission, no encryption is required. They will be directly combined with the ciphertext triples ([[A]], [[B]], [[C]]) transmitted by the service provider to perform homomorphic linear combination operations, thereby completing the calculation of the core parameters of the spherical distance in the ciphertext domain.

[0056] S22: Based on the public key, perform homomorphic linear combination calculations on the three plaintext coefficients s, cx, cy and the ciphertext triples [[A]], [[B]], [[C]] to obtain the second coordinate ciphertext data, where the calculation formula for the second coordinate ciphertext data is: (7) Wherein, [[S]] is the second coordinate ciphertext data, that is, the ciphertext of the cosine value of the angular distance between the service provider and the query provider, cosθ.

[0057] In a specific embodiment of the present invention, the querying party uses three plaintext coefficients s, cx, and cy calculated in step S21. These coefficients are all plaintext values, representing the vector components of the querying party on the unit sphere. The querying party calls the public key pk received from the service provider and the encrypted ciphertext triples ([[A]], [[B]], [[C]]), and uses the public key pk to perform a weighted homomorphic linear combination (e.g., the Paillier algorithm, which supports the algebraic properties of plaintext scalar multiplication and ciphertext addition) on the above plaintext coefficients and ciphertext triples to obtain the second coordinate ciphertext data [[S]]. The second coordinate ciphertext data [[S]] is actually the ciphertext of the cosine value of the angular distance between two points, cosθ, i.e., [[S]] = Enc( Through this step, the querying party fuses its own location information (plaintext coefficients) with the service provider's location information (ciphertext features) for calculation. Throughout the process, the service provider's original coordinates remain in ciphertext and are not decrypted. The querying party cannot deduce the service provider's plaintext location from the ciphertext triples [[A]], [[B]], and [[C]]. The final generated second coordinate ciphertext data [[S]] contains both the distance correlation information between the two locations and remains completely encrypted. Distance calculation is completed without decrypting the service provider's data, laying a solid foundation for subsequent threshold comparison in the ciphertext domain.

[0058] Specifically, step S3, which calculates the mask comparison ciphertext based on the second coordinate ciphertext data and a preset distance threshold, and sends it to the service provider, further includes: S31: Calculate the intermediate variable ciphertext in the Haversine formula based on the second coordinate ciphertext data. The calculation formula is as follows: (8) Where [[S]] represents the encrypted data of the second coordinate.

[0059] S32: Calculate the upper limit of plaintext based on a preset distance threshold and the Earth's radius. The calculation formula is as follows: (9) Where D is the preset distance threshold and R is the Earth's radius, usually taken as 6,371,000 meters.

[0060] S33: Calculate the intermediate variable ciphertext With plaintext upper limit The difference ciphertext is calculated using the following formula: (10) in, This is the difference ciphertext.

[0061] S34: Calculate the mask comparison ciphertext based on the difference ciphertext and send it to the service provider. The formula for calculating the mask comparison ciphertext is: (11) in, To compare the ciphertext with the mask, r is a random mask, for example, r∈[1,99]. This is the difference ciphertext.

[0062] In a specific embodiment of the present invention, the querying party first constructs the ciphertext [[a]] of the key intermediate variable a in the Haversine formula directly in the ciphertext domain based on the second coordinate ciphertext data [[S]] (i.e., Enc(cosθ)) obtained in step S22. Since the Haversine formula contains nonlinear functions, the present invention transforms the problem of determining the spherical distance range into determining the intermediate variable... Threshold comparison, where v1 and v2 are the dot product of the unit vectors of the two locations. By defining the first-party location feature components, the nonlinear distance calculation is transformed into a linear expression that supports homomorphic operations, avoiding nonlinear function calculations. Then, based on the specific business requirements (e.g., "finding station locations within 5 kilometers"), a preset distance threshold D is determined, and using the Earth's radius R (usually 6,371,000 meters), the plaintext upper limit value corresponding to the preset distance threshold D is calculated locally. Plaintext upper limit This is the critical criterion for determining whether the distance has been exceeded; it is a plaintext value and does not require encryption. Subsequently, the querying party calculates the intermediate variable ciphertext within the ciphertext domain. With plaintext upper limit The difference is used to obtain the difference ciphertext [[Δ]]. Although the difference ciphertext [[Δ]] already contains all the information needed for subsequent judgment, its specific value still reveals details about the distance. In order to prevent the service provider from deducing the specific distance difference from the decryption result, the querying party introduces a random positive integer mask r (e.g., r∈[1,99]) to perform a homomorphic scalar multiplication on the difference ciphertext [[Δ]], generating the mask comparison ciphertext [[compare]]. Since r>0, this operation retains the sign information (positive, negative, or zero) of the difference ciphertext [[Δ]], but completely scrambles its specific value. Thus, the querying party achieves the generation of an encrypted result (i.e., the mask comparison ciphertext [[compare]]) that can be used for judgment and protects privacy without exposing the specific distance value. Finally, it is transmitted back to the service provider through the network.

[0063] Specifically, step S4 involves the service provider decrypting the masked comparison ciphertext to obtain the comparison plaintext, and determining whether the spherical distance between the service provider and the querying party meets a preset distance threshold based on the comparison plaintext, and returning the determination result to the querying party. This further includes: S41: The service provider uses its private key to decrypt the masked comparison ciphertext, obtaining the comparison plaintext t, whose expression is: t=Dec([[compare]])= (12) Where r is a random mask, For the intermediate variable in the Haversine formula, This represents the upper limit of the plaintext value.

[0064] S42: Based on the comparison of plaintext t, determine whether the spherical distance between the service provider and the query provider meets the preset distance threshold D. The determination condition is: If t 0, then Determine the spherical distance D.

[0065] If t≥0, then Determine if the spherical distance is greater than or equal to D.

[0066] S43: The service provider returns the judgment result to the querying party.

[0067] In a specific embodiment of the present invention, the service provider receives the mask comparison ciphertext [[compare]] returned by the querying party. Since this ciphertext is encrypted using the public key pk generated locally by the service provider, the service provider then calls its paired private key sk and decrypts it using the decryption function Dec(·) to obtain the comparison plaintext t. Since the random mask r is a positive integer greater than zero (r>0), according to mathematical principles, the sign (positive, negative, or zero) of t and the difference are related. The signs of t and t are completely identical. Therefore, the service provider only needs to determine the sign of the numerical value of t to deduce whether the spherical distance meets the threshold requirement. If t < 0, it means... If the actual distance to the sphere is less than the preset distance threshold D, then the determination result is: the threshold requirement is met. If t ≥ 0, it means... If the actual distance between two points is greater than or equal to a preset distance threshold D, the result is determined as: the threshold requirement is not met. After the judgment is completed, the service provider returns the Boolean judgment result (e.g., "yes / no") or a secure code that has been encrypted with order preservation and random perturbation to the querying party. Through this step, the service provider successfully achieves the secure determination of whether the spherical distance between two points is within the specified range without knowing the specific location coordinates of the querying party, and without the querying party decrypting the service provider's location ciphertext. This method outputs a high-precision business result through only one decryption and simple symbol judgment, combining computational efficiency with strong data privacy.

[0068] In summary, the spherical distance range privacy protection judgment method and system based on homomorphic encryption provided by this invention has the following advantages: 1. High precision: Strictly follows the spherical geometric model, with extremely low error.

[0069] This invention transforms the Haversine formula into a dot product of unit spherical vectors through mathematical reconstruction, enabling rigorous spherical distance calculations directly within the encrypted domain. This results in a method error of less than 0.1%, meeting the demands of highly accurate geographic scenarios such as tower site selection and base station coverage assessment.

[0070] 2. High efficiency: Low computational complexity and significantly improved performance.

[0071] The technical solution of this invention requires only a single linear combination of ciphertexts and simple post-processing, eliminating the need for complex function approximation calculations and high-overhead operations such as ciphertext-ciphertext multiplication. This method is perfectly compatible with mainstream additive homomorphic encryption libraries (such as Paillier). In practical applications, it can significantly reduce the evaluation time for a single thousand-site evaluation from hours using traditional methods to minutes, substantially improving the efficiency of cross-enterprise data collaboration.

[0072] 3. Strong privacy: The entire computation is encrypted, and the data is "usable but not visible".

[0073] Throughout the entire judgment process, the geographical coordinates of both the service provider and the querying party are always stored in encrypted form, ensuring that neither party can know the other's plaintext coordinates. By introducing a "symbol-preserving" result protection mechanism based on a random positive integer mask, this invention effectively prevents side-channel attacks that attempt to deduce specific distance values ​​from the decrypted results, while ensuring the correctness of the judgment result, thus achieving true privacy protection.

[0074] 4. Highly practical: Lightweight architecture, easy to deploy across enterprises.

[0075] This invention does not rely on any trusted third party (TTP), nor does it require complex multi-party secure computation (MPC) protocols or multiple rounds of interaction. Its communication process is extremely simple, involving only one transmission of encrypted features and one return of the mask comparison result. This end-to-end lightweight protocol greatly reduces the difficulty of system integration and operation and maintenance costs, making it very easy to deploy between different enterprise entities, and effectively reducing the risk of data leakage and legal compliance costs.

[0076] The concepts, principles, and ideas of the present invention have been described in detail above with reference to specific embodiments (including examples and instances). Those skilled in the art should understand that the embodiments of the present invention are not limited to those given above. After reading this application, those skilled in the art can make any possible improvements, substitutions, and equivalents to the steps, methods, systems, and components in the above embodiments. These improvements, substitutions, and equivalents should be considered to fall within the scope of the present invention, and the scope of protection of the present invention is limited to the claims.

Claims

1. A method for determining privacy protection of spherical distance range based on homomorphic encryption, characterized in that, include: The service provider obtains the first location coordinates, performs homomorphic encryption on the first location coordinates based on additive homomorphic encryption technology, generates the first coordinate ciphertext data, and sends it to the querying party. The querying party obtains the second location coordinates, calculates the plaintext coefficient based on the second location coordinates, and performs homomorphic linear combination encryption with the first coordinate ciphertext data to obtain the second coordinate ciphertext data. Based on the second coordinate ciphertext data and the preset distance threshold, a mask comparison ciphertext is calculated and sent to the service provider; The service provider decrypts the mask comparison ciphertext to obtain the comparison plaintext, and determines whether the spherical distance between the service provider and the querying party meets the preset distance threshold based on the comparison plaintext, and returns the determination result to the querying party.

2. The method for determining privacy protection of spherical distance range based on homomorphic encryption according to claim 1, characterized in that, The service provider obtains the first location coordinates, performs homomorphic encryption on the first location coordinates based on additive homomorphic encryption technology, generates first coordinate ciphertext data, and sends it to the querying party, further including: The service provider generates a key pair, including a public key and a private key, based on additive homomorphic encryption technology; Obtain the first location coordinates and use trigonometric functions to calculate its three characteristic components A, B, and C, where the first location coordinates are the latitude and longitude of the service provider's location. Homomorphic encryption is performed on three feature components A, B, and C based on the public key to obtain ciphertext triples [[A]], [[B]], [[C]], which are the first coordinate ciphertext data; The generated public key and ciphertext triples [[A]], [[B]], and [[C]] are simultaneously sent to the querying party.

3. The method for determining privacy protection of spherical distance range based on homomorphic encryption according to claim 2, characterized in that, The calculation formulas for the three characteristic components A, B, and C are as follows: A = sin (lat1) Where lat1 and lon1 are the latitude and longitude of the first position coordinates, respectively.

4. The method for determining privacy protection of spherical distance range based on homomorphic encryption according to claim 2, characterized in that, The querying party obtains the second location coordinates, calculates the plaintext coefficient based on the second location coordinates, and performs homomorphic linear combination encryption with the first coordinate ciphertext data to obtain the second coordinate ciphertext data, which further includes: The querying party obtains the second location coordinates and uses trigonometric functions to calculate its three plaintext coefficients s, cx, and cy, where the second location coordinates are the latitude and longitude of the querying party's location. Based on the public key, a homomorphic linear combination calculation is performed on the three plaintext coefficients s, cx, cy and the ciphertext triples [[A]], [[B]], [[C]] to obtain the second coordinate ciphertext data.

5. The method for determining privacy protection of spherical distance range based on homomorphic encryption according to claim 4, characterized in that, The formulas for calculating the three plaintext coefficients s, cx, and cy are as follows: s = sin(lat2) Where lat2 and lon2 are the latitude and longitude of the second position coordinates, respectively.

6. The method for determining privacy protection of spherical distance range based on homomorphic encryption according to claim 4, characterized in that, The formula for calculating the second coordinate encrypted data is: Wherein, [[S]] is the second coordinate ciphertext data, that is, the ciphertext of the cosine value of the angular distance between the service provider and the query provider, cosθ.

7. The method for determining privacy protection of spherical distance range based on homomorphic encryption according to claim 1, characterized in that, The step of calculating a mask comparison ciphertext based on the second coordinate ciphertext data and a preset distance threshold, and sending it to the service provider, further includes: The intermediate variable ciphertext in the Haversine formula is calculated based on the second coordinate ciphertext data. ; The upper limit value of plaintext is calculated based on a preset distance threshold and the Earth's radius. ; Calculate the intermediate variable ciphertext With plaintext upper limit The difference ciphertext; The mask is calculated based on the difference ciphertext, compared with the ciphertext, and then sent to the service provider.

8. The method for determining privacy protection of spherical distance range based on homomorphic encryption according to claim 7, characterized in that, The intermediate variable ciphertext The calculation formula is: Where [[S]] represents the encrypted data of the second coordinate.

9. The method for determining privacy protection of spherical distance range based on homomorphic encryption according to claim 7, characterized in that, The plaintext upper limit value The calculation formula is: Where D is the preset distance threshold and R is the Earth's radius.

10. The method for determining privacy protection of spherical distance range based on homomorphic encryption according to claim 7, characterized in that, The formula for calculating the difference ciphertext is: in, This is the difference ciphertext.

11. The method for determining privacy protection of spherical distance range based on homomorphic encryption according to claim 7, characterized in that, The formula for calculating the ciphertext by comparing the mask is as follows: in, To compare the ciphertext with the mask, r is a random mask. This is the difference ciphertext.

12. The method for determining privacy protection of spherical distance range based on homomorphic encryption according to claim 1, characterized in that, The service provider decrypts the mask comparison ciphertext to obtain the comparison plaintext, and determines whether the spherical distance between the service provider and the querying party meets a preset distance threshold based on the comparison plaintext, and returns the determination result to the querying party. This further includes: The service provider uses its private key to decrypt the masked ciphertext, obtaining the plaintext t, whose expression is: t= Where r is a random mask, For the intermediate variable in the Haversine formula, This is the upper limit of the plaintext value; Based on the comparison of plaintext t, determine whether the spherical distance between the service provider and the query provider meets the preset distance threshold D. The determination condition is as follows: If t 0, then Determine the spherical distance D; If t≥0, then Determine if the spherical distance is greater than or equal to D; The service provider will return the judgment result to the querying party.