An information protection method, apparatus, device, and storage medium
Patent Information
- Application Number
- CN202310701162.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-13
- Publication Date
- 2026-09-01
- Estimated Expiration
- 2043-06-13
AI Technical Summary
[0003]目前一部分应用程序在利用需要隐私定位的业务向系统申请定位隐私权限后,会将用户的隐私定位信息在其他业务里边使用,上传至服务端,使得用户的定位隐私信息无法得到有效的保护,有泄露的风险
Smart Images

Figure CN116846604B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data encryption transmission technology, and more specifically, to an information protection method, apparatus, device, and storage medium. Background Technology
[0002] When an application platform provides LBS (Location Based Services) to users, the client needs to collect the user's private location information and request the LBS service from the server. The server then uses the client's location information and the location information of the requested target to locate the target within a certain range of the client and returns the corresponding service information to the client. When obtaining location information, the application requests location privacy permissions from the system through services that require privacy-sensitive location access, thereby obtaining the user's location information.
[0003] Currently, some applications request location privacy permissions from the system for services that require location privacy, and then use the user's location information in other services and upload it to the server, making it impossible to effectively protect the user's location privacy information and posing a risk of leakage. Summary of the Invention
[0004] This application provides an information protection method, apparatus, device, and storage medium, which aims to protect users' privacy location information while providing users with location-based services.
[0005] The first aspect of this application provides an information protection method, the method being applied to a client, comprising:
[0006] In response to a user's request for location services, the system obtains the first location information of the user's device.
[0007] The first positioning information is converted into a first positioning code value using a preset encoding conversion rule;
[0008] The first location code value is homomorphically encrypted to obtain the first ciphertext data corresponding to the first location code value;
[0009] Based on the location range information in the location service request, a query string corresponding to the first encrypted data is determined. The query string is sent to the server so that the server can retrieve the second encrypted data that matches the first encrypted data from the database.
[0010] Send a location service request containing the query string to the server and receive return data containing the second encrypted data from the server;
[0011] Based on the returned data, determine the location service information corresponding to the location service request.
[0012] Optionally, the method further includes:
[0013] The location service information is displayed on the client interface of the user device.
[0014] Optionally, before homomorphically encrypting the location encoding value, the method further includes:
[0015] Log in to the key management server using the user's identity information;
[0016] The key used to encrypt and decrypt the location code value, as well as the homomorphic encryption algorithm, are obtained from the key management server. The key includes a public key and a private key.
[0017] Optionally, the step of homomorphically encrypting the location encoding value to obtain the first ciphertext data corresponding to the location encoding value includes:
[0018] The first ciphertext data is obtained by processing the first location code value and the public key using the homomorphic encryption algorithm.
[0019] Optionally, determining the location service information corresponding to the location service request based on the returned data includes:
[0020] The homomorphic encryption algorithm is used to process the second ciphertext data in the returned data and the private key to obtain the second location code value corresponding to the second ciphertext data.
[0021] The second positioning code value is converted into the second positioning information corresponding to the second positioning code value through the preset encoding conversion rule;
[0022] Based on the returned data containing the second location information, the location service information corresponding to the location service request is determined.
[0023] Optionally, determining the query string corresponding to the first encrypted data based on the location range information in the location service request includes:
[0024] Based on the location range information, determine the location range corresponding to the location service request;
[0025] Based on the location range, a string of corresponding length is selected from the first encrypted data to obtain the query string.
[0026] A second aspect of this application provides an information protection method, the method being applied to a server, comprising:
[0027] Receive a location service request containing a query string sent by the client;
[0028] Determine the second encrypted data corresponding to the query string in the database;
[0029] The return data containing the second encrypted data corresponding to the location service request is sent to the client.
[0030] A third aspect of this application provides an information protection device, the device comprising:
[0031] The first location information acquisition module is used to acquire the first location information of the user's user device in response to the user's location service request.
[0032] The information conversion module is used to convert the first positioning information into a first positioning code value according to a preset encoding conversion rule;
[0033] The homomorphic encryption module is used to homomorphically encrypt the first location encoding value to obtain the first ciphertext data corresponding to the first location encoding value.
[0034] The query string generation module is used to determine the query string corresponding to the first encrypted data based on the location range information in the location service request. The query string is used to send to the server so that the server can obtain the second encrypted data that matches the first encrypted data in the database.
[0035] The data sending and receiving module is used to send a location service request containing the query string to the server and receive return data containing the second encrypted data sent by the server.
[0036] The location service information acquisition module is used to determine the location service information corresponding to the location service request based on the returned data.
[0037] An information display module is used to display the location service information on the client interface of the user device.
[0038] Optionally, the device further includes:
[0039] The key management server login module is used to log in to the key management server using the user's identity information.
[0040] The key acquisition module is used to acquire from the key management server the key used to encrypt and decrypt the location code value, as well as the homomorphic encryption algorithm. The key includes a public key and a private key.
[0041] Optionally, the homomorphic encryption module includes:
[0042] The homomorphic encryption submodule is used to process the first location encoding value and the public key using the homomorphic encryption algorithm to obtain the first ciphertext data.
[0043] Optionally, the location service information acquisition module includes:
[0044] The second location encoding value acquisition submodule is used to process the second ciphertext data in the returned data and the private key through the homomorphic encryption algorithm to obtain the second location encoding value corresponding to the second ciphertext data.
[0045] The second location information acquisition submodule is used to convert the second location code value into the second location information corresponding to the second location code value through the preset encoding conversion rule;
[0046] The location service information acquisition submodule is used to determine the location service information corresponding to the location service request based on the returned data containing the second location information.
[0047] Optionally, the query string generation module includes:
[0048] The location range determination submodule is used to determine the location range corresponding to the location service request based on the location range information.
[0049] Based on the location range, a string of corresponding length is selected from the first encrypted data to obtain the query string.
[0050] A fourth aspect of this application provides an information protection device, the device comprising:
[0051] The location range determination submodule is used to determine the location range corresponding to the location service request based on the location range information.
[0052] Based on the location range, a string of corresponding length is selected from the first encrypted data to obtain the query string.
[0053] A fifth aspect of this application provides a readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps described in the first aspect of this application.
[0054] A sixth aspect of this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the method described in the first aspect of this application.
[0055] Using the information protection method provided in this application, when applied to a client, in response to a user initiating a location service request, the method obtains the first location information of the user's device; converts the first location information into a first location encoding value using a preset encoding conversion rule; homomorphically encrypts the first location encoding value to obtain first ciphertext data corresponding to the first location encoding value; determines a query string corresponding to the first ciphertext data based on the location range information in the location service request, the query string being sent to the server so that the server can retrieve second ciphertext data matching the first ciphertext data from the database; sends a location service request containing the query string to the server and receives return data containing the second ciphertext data sent by the server; and determines the location service information corresponding to the location service request based on the return data. When applied to a server, the method receives a location service request containing a query string sent by the client; determines the second ciphertext data corresponding to the query string in the database; and sends the return data containing the second ciphertext data corresponding to the location service request to the client.
[0056] This method collects the user's initial location information and converts it into a first location encoding value using a preset encoding conversion rule. The length of the encoded value represents the location range and accuracy, which helps reduce subsequent calculations and facilitates subsequent matching and searching. The first location encoding value is processed by homomorphic encryption, and the generated first ciphertext retains the character matching characteristics of the original text. That is, after homomorphic encryption, two data that match in the original text still have corresponding matching parts in the encrypted ciphertext. This allows the server to directly match the characters in the ciphertext to find the corresponding ciphertext with the same characters without decryption. The original text corresponding to the matched ciphertext also matches, enabling the server to perform efficient data retrieval. When the server receives the query string generated based on the first ciphertext, it can query the second ciphertext that matches the first ciphertext in the ciphertext stored in the database. Because the database only stores ciphertext, and the server does not know the specific meaning of the ciphertext and cannot decrypt it, the security of location privacy information is fundamentally protected. After retrieving the second ciphertext, the return data containing the second ciphertext is sent to the client. The client obtains the location service information corresponding to the location service request based on the return data. Data encryption and decryption are performed on the client side. The data received and stored by the server is ciphertext data, ensuring the security of the user's location privacy information when providing location-based services to the user. Attached Figure Description
[0057] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0058] Figure 1 This is a flowchart of an information protection method proposed in an embodiment of this application;
[0059] Figure 2 This is a flowchart of an information protection method proposed in an embodiment of this application;
[0060] Figure 3 This is a schematic diagram of an information protection device proposed in an embodiment of this application;
[0061] Figure 4 This is a schematic diagram of an information protection device proposed in an embodiment of this application. Detailed Implementation
[0062] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0063] refer to Figure 1 , Figure 1 This is a flowchart of an information protection method proposed in an embodiment of this application, wherein the method is applied to a client. Figure 1 As shown, the method includes the following steps:
[0064] S11: In response to the user's request for location services, obtain the first location information of the user's device.
[0065] In this embodiment, the location service request is an LBS service initiated by the user on the client. This type of service provides the user with location information of various targets within a certain range around the user, and calculates the distances between the user's location and each target location. When initiating a location request, the user selects a target and chooses the accuracy range for the location. The user device is the user terminal device that the user is currently using and has the client installed. The first location information is the latitude and longitude information of the user's specific location.
[0066] In this embodiment, when a user needs location-based services, the user initiates a service request to the server through the client on the user's device. When the client receives the user's operation to initiate a location service request, the client's backend system obtains the first location information of the user's device, namely the latitude and longitude of the user's current location, with the user's authorization.
[0067] For example, when a user uses a job search application and needs to find the distance between the user and the company where a certain job is located, the user opens the client, searches for the corresponding job, and the company where the job is located becomes the user's target for this request, thus initiating a location service request. When the client detects that the user has initiated a location service request, the background system reads the user's location data to obtain the longitude and latitude of the user's current location.
[0068] S12: Convert the first positioning information into a first positioning code value using a preset encoding conversion rule.
[0069] In this embodiment, the preset encoding conversion rule is a rule that converts the longitude and latitude of the user's location into corresponding codes to replace the actual longitude and latitude, thus simplifying the computational workload of distance calculation. The first positioning code value is the encoded value of the first positioning information after conversion according to the preset encoding conversion rule.
[0070] In this embodiment, after the client obtains the first positioning information, namely the longitude and latitude values of the user's location, it converts the longitude and latitude values of the user's location into a first positioning code value through a preset encoding conversion rule. The character length of the converted first code value corresponds to the precision of the location. The longer the character length, the more accurate the location, and the shorter the character length, the larger the range it covers.
[0071] For example, the default encoding conversion rule is the Geohash algorithm. The Geohash algorithm converts the user's latitude and longitude values into Geohash codes, which form the first location code. The length of the Geohash value represents the location range. For instance, if a user's latitude and longitude are (116.489485, 39.971122), the Geohash value is wx4g6u9. The user's destination's latitude and longitude are (116.505192, 39.986489), which is wx4g7pk. The longer the Geohash value, the smaller the location range and the higher the location accuracy. For example, wx4g6u9 has an accuracy range of 76 meters. The number of bits used in the conversion can be preset, meaning the conversion accuracy can be controlled; specific requirements are not specified here. The final converted first location code value is wx4g6u9. Each increase of one digit in the Geohash value reduces the positioning range and increases accuracy. For example, a length of 7 results in a positioning range of approximately 76 meters, while a length of 8 results in a positioning range of approximately 19 meters. Specific correspondences can be obtained by consulting relevant materials.
[0072] S13: Homomorphically encrypt the first location code value to obtain the first ciphertext data corresponding to the first location code value.
[0073] In this embodiment, homomorphic encryption is an encryption algorithm. Homomorphic encryption algorithms are divided into fully homomorphic encryption (FHE) and somewhat homomorphic encryption (SWHE) or partially homomorphic encryption (PHE). Fully homomorphic encryption supports arbitrary forms of computation on the ciphertext, while somewhat homomorphic encryption only supports addition and multiplication, or a finite number of additions and multiplications. The result calculated by the homomorphic encryption algorithm is the same as the result calculated on the original text after decryption. The first ciphertext data is obtained by homomorphically encrypting the first encoded value.
[0074] In this embodiment, after obtaining the first location code value, the first code value is encrypted using any homomorphic encryption algorithm to obtain the first ciphertext data corresponding to the first location code value.
[0075] For example, homomorphic encryption algorithms can use the SEAL encryption algorithm, a commonly used homomorphic encryption algorithm. For the two geohash values wx4g6u9 and wx4g7pk, the encrypted ciphertext contains a certain length of characters that match the same characters (wx4g) in the original text. For example:
[0076] The ciphertext encrypted with wx4g6u9 is: x\234+\2570I 7+\265d;
[0077] The ciphertext after encryption by wx4g7pk is: x\234+\2570I 7 / \310f.
[0078] In the first position encoding, the same part wx4g is represented as x\234+\2570I 7 in the ciphertext after homomorphic encryption.
[0079] S14: Based on the location range information in the location service request, determine the query string corresponding to the first encrypted data. The query string is sent to the server so that the server can retrieve the second encrypted data that matches the first encrypted data from the database.
[0080] In this embodiment, the location range information is the specific location range selected by the user when initiating a location service request, determining the area of the target's location information that the user needs to obtain. The query string is a portion of characters extracted from the first encrypted data. Since the first encrypted data consists of characters of a certain length, and different lengths of characters represent different location ranges, the number of characters to extract from the first encrypted data can be determined based on the location range information in the location service request. The extracted characters constitute the query string.
[0081] In this embodiment, when a user sends a location service request, they also include location range information. Based on the location range information in the location service request, characters of a corresponding length are extracted from the first encrypted data as a query string. This query string can be sent to the server. The server uses this query string to search the database for second encrypted data that matches the first encrypted data. The encrypted data in the database containing this query string is the second encrypted data that matches the first encrypted data.
[0082] In this embodiment, step S14 specifically includes:
[0083] S14-1: Determine the location range corresponding to the location service request based on the location range information.
[0084] In this embodiment, the location service request includes location range information, which includes the farthest range of the target location that the user needs to obtain. Once the farthest range of the target location that the user needs to obtain is determined, the location range corresponding to the location service request can be determined.
[0085] For example, when the furthest range of the target location that the user needs to obtain is 3 kilometers, the location range corresponding to the location service request is determined to be 3 kilometers.
[0086] S14-2: Based on the positioning range, select a string of corresponding length from the first encrypted data to obtain the query string.
[0087] In this embodiment, the first ciphertext data is obtained by homomorphic encryption of the first positioning code, and the number of characters in the first ciphertext data matches the specific positioning range.
[0088] For example, after homomorphic encryption, the ciphertext and the original text have the same character matching characteristics. The matched characters are selected according to a specific range. Taking the encrypted value calculated by the seal encryption algorithm as an example, the specific details are shown in the table below:
[0089]
[0090] For example, when the geohash value of a user's location is wx4g6u9, and the user requests LBS services within a 3-kilometer radius, the client determines the selected location range to be 3 kilometers based on the range information in the user's location service request. Therefore, it needs to obtain all geohash values containing the first five digits of the geohash value, i.e., wx4g6. The corresponding generated query string is the encrypted data corresponding to wx4g6, i.e., x\234+\2570I7+\.
[0091] S15: Send a location service request containing the query string to the server and receive return data containing the second encrypted data sent by the server.
[0092] In this embodiment, the second encrypted data is homomorphically encrypted data obtained by combining the encoded values of the latitude and longitude of the target location within a certain range of the user's location. This second encrypted data is pre-stored in a database in encrypted form. The location service request also includes the user's account information, information about the application being used, and the time the user initiated the request. The returned data contains the second encrypted data, as well as relevant data about the target requested by the user.
[0093] In this embodiment, after the client determines the query string, it sends a location service request containing the query string to the server. After the server obtains the second encrypted data, it sends the return data containing the second encrypted data to the client.
[0094] For example, when a user uses a job search application to find the location information of companies within a certain range of positions, the second encrypted data returned by the server is the encrypted data corresponding to the company's location code value. The returned data also includes the company's business hours, relevant company information, etc.
[0095] S16: Based on the returned data, determine the location service information corresponding to the location service request.
[0096] In this embodiment, the location service information is the information returned in the data corresponding to the location service request sent by the user.
[0097] In this embodiment, when the client receives the returned data, it decrypts the second encrypted data in the returned data to obtain the corresponding encoded value. Then, using the pre-set encoding conversion rules, the encoded value is converted into the corresponding latitude and longitude value, thus obtaining the location information of the target that the user needs to locate. The returned data also includes the relevant information of the target. The relevant information of the target and the location information of the target together constitute the location service information.
[0098] In another embodiment of this application, when the client needs to display the precise distance information between the user's location and the target location, it needs to calculate the precise information between the user's location and the target location using the latitude and longitude of the user's location and the target location.
[0099] In this embodiment, by converting the latitude and longitude of the user's location into corresponding location encoding values and performing homomorphic encryption based on these values, complex homomorphic calculations are avoided, making the entire service process simpler and faster. The server directly matches the homomorphically encrypted data without knowing the specific meaning of the decrypted text, fundamentally protecting the security of location privacy information. Furthermore, the encrypted result of homomorphic encryption has the same character matching characteristics as the original text, enabling efficient data retrieval based on the query string, resulting in faster service speeds and effectively improving the user experience. While providing users with fast location-based services, the security of users' location privacy information is guaranteed.
[0100] In another embodiment of this application, after step S16, the method further includes:
[0101] S21: Display the location service information on the client interface of the user device.
[0102] In this embodiment, the user's location service information includes the location information of all targets within the user's desired range, as well as related information about those targets. After obtaining the location service information, the client displays it on the user's device's client interface. The user can view the received location service information on the client interface.
[0103] For example, when a user uses a job search application, they need to query the location information of all companies with positions within a certain range. After obtaining the corresponding location service information, the application's client interface displays the corresponding job title, the address of the company with the job, the distance between the company and the user, the job description, and other job-related data.
[0104] In this embodiment, the client can directly display the obtained location service information on the client interface, allowing users to intuitively understand the location of the target and the distance relationship between the target, thus ensuring the user experience when using location-based services.
[0105] In another embodiment of this application, prior to step S13, the method further includes:
[0106] S31: Log in to the key management server using the user's identity information.
[0107] In this embodiment, the key management server is a third-party management server specifically used to manage the keys and encryption algorithms used for encryption. The key management server requires users to log in using unique identity information.
[0108] In this embodiment, when the client needs to encrypt the first location code, it first logs into the key management server using the user's identity information.
[0109] For example, users can log in to the key management server using a user account that has been linked to their identity information or by using facial recognition.
[0110] S32: Obtain from the key management server the key used to encrypt and decrypt the first location code value, as well as the homomorphic encryption algorithm, wherein the key includes a public key and a private key.
[0111] In this embodiment, the key is a parameter used to encrypt data. The public key is made public and used to encrypt data, while the private key is kept by the client and not made public, and is used to decrypt data.
[0112] In this embodiment, after the client logs into the key management server using the user's identity information, it obtains the key used to encrypt and decrypt the first location code value and the homomorphic encryption algorithm from the key management server. After obtaining the key and the homomorphic encryption algorithm, the client can use the shared key to encrypt the first location code using the homomorphic encryption algorithm.
[0113] In this embodiment, when the client obtains key information, it can also carry the information of the application it is currently using. When the user uses another application, the key management server will send the user a key that is different from the key used in the previous application. This ensures that the same user obtains different keys for different applications, thus better guaranteeing key security.
[0114] In this embodiment, by logging into a third-party key management server, the key used for encryption and the homomorphic encryption algorithm can be obtained, ensuring the real-time updating of the key and the homomorphic encryption algorithm, thus better protecting the user's privacy and location information.
[0115] In another embodiment of this application, step S13 includes:
[0116] S41: The first location encoding value and the public key are processed by the homomorphic encryption algorithm to obtain the first ciphertext data.
[0117] In this embodiment, after obtaining the key and homomorphic encryption algorithm from a third-party key management server, the public key and the first location code value are input into the homomorphic encryption algorithm as parameters. The first location code value and the public key are processed by the homomorphic encryption algorithm to obtain the first ciphertext data.
[0118] In another embodiment of this application, step S16 specifically includes:
[0119] S51: The second ciphertext data in the returned data and the private key are processed by the homomorphic encryption algorithm to obtain the second location code value corresponding to the second ciphertext data.
[0120] In this embodiment, the second location encoding value is the location encoding value obtained by converting the location information of the requested target corresponding to the user's location server request. The conversion rule for the second location encoding value is the same as the conversion rule for the first location encoding value.
[0121] In this embodiment, after the client receives the returned data containing the second ciphertext data, it runs the homomorphic encryption algorithm, inputting the second ciphertext data and the private key as parameters into the homomorphic encryption algorithm to obtain the second location code value corresponding to the second ciphertext data.
[0122] S52: Using the preset encoding conversion rule, the second positioning encoding value is converted into the second positioning information corresponding to the second positioning encoding value.
[0123] In this embodiment, the second location information is the longitude and latitude values of the requested target in the user's location service request.
[0124] In this embodiment, after obtaining the second positioning code value, the second positioning code value is converted into the second positioning information corresponding to the second code value through a preset encoding conversion rule.
[0125] S53: Determine the location service information corresponding to the location service request based on the returned data containing the second location information.
[0126] In this embodiment, after obtaining the second location information, the location service information corresponding to the user's location service request is determined based on the relevant information of the requested target contained in the returned data.
[0127] For example, when a user's location service request requests information about all restaurants within a certain range, the returned data includes encrypted data corresponding to the location codes of each restaurant and relevant information about each restaurant. Based on the specific locations and relevant information of each restaurant in the returned data, the client generates location service information corresponding to the user's location service request, such as: XX Restaurant, 3.0 km away, business hours 9:00-21:00, specializing in Sichuan cuisine, average cost per person 50.
[0128] refer to Figure 2 , Figure 2 This is a flowchart of an information protection method proposed in an embodiment of this application, wherein the method is applied to a server. Figure 2 As shown, the method includes the following steps:
[0129] S61: Receive a location service request containing a query string sent by the client.
[0130] In this embodiment, the server is the server corresponding to the application used by the user. The server receives the location service request containing the query string sent by the client.
[0131] S62: Determine the second encrypted data corresponding to the query string in the database.
[0132] In this embodiment, the database pre-stores ciphertext data corresponding to the location codes of targets within a certain area. This data is stored directly in the database in ciphertext form, and without the corresponding key and decryption algorithm, the specific content of the data cannot be known.
[0133] In this embodiment, after receiving a location service request containing a query string, the server searches for encrypted data containing the query string in the database based on the query string in the location service request, and uses the encrypted data containing the query string as the second encrypted data.
[0134] In this embodiment, the query method is not limited, and SQL (database) statements can be used for querying.
[0135] S63: Send the return data containing the second encrypted data corresponding to the location service request to the client.
[0136] In this embodiment, after receiving a location service request, the server obtains the second encrypted data corresponding to the query string, and also obtains relevant information about the target corresponding to the second encrypted data. This relevant information is relatively public and does not need to be kept confidential. The server then sends the second encrypted data corresponding to the location service request and the relevant information about the target corresponding to the second encrypted data as return data to the client.
[0137] For example, a user uses a rental application to view available rental properties within a certain range. The server obtains the second encrypted data corresponding to the properties within that range, as well as relevant information about the properties, such as rent and apartment type. The server then sends the second encrypted data and relevant information about the properties back to the client.
[0138] In this embodiment, when the server receives a location service request containing a query string, it directly determines the corresponding second encrypted data in the database through the query string and then sends it to the client. The client cannot know the specific content of the query string and the encrypted data, and therefore cannot directly obtain the user's specific location. This ensures the security of the user's location privacy information when providing location-based services to the user.
[0139] Based on the same inventive concept, one embodiment of this application provides an information protection device, which is applied to a client. (Reference) Figure 3 , Figure 3 This is a schematic diagram of an information protection device according to an embodiment of this application. Figure 3 As shown, the device includes:
[0140] The first location information acquisition module 300 is used to acquire the first location information of the user's user device in response to the user's operation of initiating a location service request;
[0141] The information conversion module 301 is used to convert the first positioning information into a first positioning code value according to a preset encoding conversion rule;
[0142] Homomorphic encryption module 302 is used to homomorphically encrypt the first location code value to obtain the first ciphertext data corresponding to the first location code value;
[0143] The query string generation module 303 is used to determine the query string corresponding to the first encrypted data based on the location range information in the location service request. The query string is used to send to the server so that the server can obtain the second encrypted data that matches the first encrypted data in the database.
[0144] The data sending and receiving module 304 is used to send a location service request containing the query string to the server and receive return data containing the second encrypted data sent by the server.
[0145] The location service information acquisition module 305 is used to determine the location service information corresponding to the location service request based on the returned data.
[0146] The information display module 306 is used to display the location service information on the client interface of the user device.
[0147] Optionally, the device further includes:
[0148] The key management server login module is used to log in to the key management server using the user's identity information.
[0149] The key acquisition module is used to acquire from the key management server the key used to encrypt and decrypt the location code value, as well as the homomorphic encryption algorithm. The key includes a public key and a private key.
[0150] Optionally, the homomorphic encryption module includes:
[0151] The homomorphic encryption submodule is used to process the first location encoding value and the public key using the homomorphic encryption algorithm to obtain the first ciphertext data.
[0152] Optionally, the location service information acquisition module includes:
[0153] The second location encoding value acquisition submodule is used to process the second ciphertext data in the returned data and the private key through the homomorphic encryption algorithm to obtain the second location encoding value corresponding to the second ciphertext data.
[0154] The second location information acquisition submodule is used to convert the second location code value into the second location information corresponding to the second location code value through the preset encoding conversion rule;
[0155] The location service information acquisition submodule is used to determine the location service information corresponding to the location service request based on the returned data containing the second location information.
[0156] Optionally, the query string generation module includes:
[0157] The location range determination submodule is used to determine the location range corresponding to the location service request based on the location range information.
[0158] Based on the location range, a string of corresponding length is selected from the first encrypted data to obtain the query string.
[0159] Based on the same inventive concept, one embodiment of this application provides an information protection device, which is applied to a server. (Reference) Figure 4 , Figure 4 This is a schematic diagram of an information protection device 400 according to an embodiment of this application. Figure 4 As shown, the device includes:
[0160] The location service request receiving module 401 is used to receive a location service request containing a query string sent by the client;
[0161] The encrypted data matching module 402 is used to determine the second encrypted data corresponding to the query string in the database;
[0162] The data sending module 403 is used to send the return data containing the second encrypted data corresponding to the location service request to the client.
[0163] Based on the same inventive concept, another embodiment of this application provides a readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the information protection method as described in any of the above embodiments of this application.
[0164] Based on the same inventive concept, another embodiment of this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the steps of the information protection method described in any of the above embodiments of this application.
[0165] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.
[0166] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0167] Those skilled in the art will understand that embodiments of this application can be provided as methods, apparatus, or computer program products. Therefore, embodiments of this application can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of this application can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0168] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0169] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0170] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0171] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.
[0172] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device 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 terminal device. 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 terminal device that includes said element.
[0173] The information protection methods, apparatus, devices, and storage media provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. An information protection method, characterized in that, The method is applied to the client and includes: In response to a user's request for location services, the system obtains the first location information of the user's device. The first positioning information is converted into a first positioning code value using a preset encoding conversion rule; The first location code value is homomorphically encrypted to obtain the first ciphertext data corresponding to the first location code value; Based on the location range information in the location service request, a query string corresponding to the first ciphertext data is determined. The query string is sent to the server so that the server can obtain second ciphertext data that matches the first ciphertext data from the database. The second ciphertext data is ciphertext data that is homomorphically encrypted with the encoding value of the latitude and longitude of the target location within a certain range of the user's location. The second ciphertext data is stored in the database in ciphertext form in advance. Send a location service request containing the query string to the server and receive return data containing the second encrypted data from the server; Based on the returned data, determine the location service information corresponding to the location service request.
2. The method according to claim 1, characterized in that, The method further includes: The location service information is displayed on the client interface of the user device.
3. The method according to claim 1, characterized in that, Before homomorphically encrypting the first location code value, the method further includes: Log in to the key management server using the user's identity information; The key used to encrypt and decrypt the first location code value and the homomorphic encryption algorithm are obtained from the key management server. The key includes a public key and a private key.
4. The method according to claim 3, characterized in that, The step of homomorphically encrypting the first location code value to obtain the first ciphertext data corresponding to the first location code value includes: The first ciphertext data is obtained by processing the first location code value and the public key using the homomorphic encryption algorithm.
5. The method according to claim 3, characterized in that, The step of determining the location service information corresponding to the location service request based on the returned data includes: The homomorphic encryption algorithm is used to process the second ciphertext data in the returned data and the private key to obtain the second location code value corresponding to the second ciphertext data. The second positioning code value is converted into the second positioning information corresponding to the second positioning code value through the preset encoding conversion rule; Based on the returned data containing the second location information, the location service information corresponding to the location service request is determined.
6. The method according to claim 1, characterized in that, The step of determining the query string corresponding to the first encrypted data based on the location range information in the location service request includes: Based on the location range information, determine the location range corresponding to the location service request; Based on the location range, a string of corresponding length is selected from the first encrypted data to obtain the query string.
7. An information protection method, characterized in that, The method is applied to the server side and includes: The system receives a location service request containing a query string sent by a client. The query string is the client's response to the user's location service request. The system obtains the first location information of the user's device, converts the first location information into a first location code value through a preset encoding conversion rule, performs homomorphic encryption on the first location code value, and determines the query string corresponding to the first ciphertext data corresponding to the first location code value based on the location range information in the location service request. The second ciphertext data corresponding to the query string is determined in the database. The second ciphertext data is ciphertext data that is homomorphically encrypted with the encoding value of the latitude and longitude of the target location within a certain range of the user's location. The second ciphertext data is pre-stored in the database in ciphertext form. The return data containing the second encrypted data corresponding to the location service request is sent to the client.
8. An information protection device, characterized in that, The device is applied to a client and includes: The first location information acquisition module is used to acquire the first location information of the user's user device in response to the user's location service request. The information conversion module is used to convert the first positioning information into a first positioning code value according to a preset encoding conversion rule; The homomorphic encryption module is used to homomorphically encrypt the first location encoding value to obtain the first ciphertext data corresponding to the first location encoding value. The query string generation module is used to determine the query string corresponding to the first encrypted data based on the location range information in the location service request. The query string is used to send to the server so that the server can obtain the second encrypted data that matches the first encrypted data in the database. The data sending and receiving module is used to send a location service request containing the query string to the server and receive return data containing the second ciphertext data sent by the server. The second ciphertext data is ciphertext data that is homomorphically encrypted with the encoding value of the latitude and longitude of the target location within a certain range of the user's location. The second ciphertext data is stored in the database in ciphertext form in advance. The location service information acquisition module is used to determine the location service information corresponding to the location service request based on the returned data.
9. An information protection device, characterized in that, The device is used on the server side and includes: The location service request receiving module is used to receive a location service request containing a query string sent by a client. The query string is the client's response to the user's location service request, which obtains the first location information of the user's device, converts the first location information into a first location code value through a preset encoding conversion rule, performs homomorphic encryption on the first location code value, and determines the query string corresponding to the first ciphertext data of the first location code value based on the location range information in the location service request. The encrypted data matching module is used to determine the second encrypted data corresponding to the query string in the database. The second encrypted data is encrypted data after homomorphic encryption with the encoding value of the latitude and longitude of the target location within a certain range of the user's location. The second encrypted data is pre-stored in the database in encrypted form. The data sending module is used to send the return data containing the second encrypted data corresponding to the location service request to the client.
10. The apparatus according to claim 8, characterized in that, The device further includes: An information display module is used to display the location service information on the client interface of the user device.
11. The apparatus according to claim 8, characterized in that, The device further includes: The key management server login module is used to log in to the key management server using the user's identity information. The key acquisition module is used to acquire from the key management server the key used to encrypt and decrypt the first location code value, as well as the homomorphic encryption algorithm. The key includes a public key and a private key.
12. The apparatus according to claim 11, characterized in that, The homomorphic encryption module includes: The homomorphic encryption submodule is used to process the first location encoding value and the public key using the homomorphic encryption algorithm to obtain the first ciphertext data.
13. The apparatus according to claim 11, characterized in that, The location service information acquisition module includes: The second location encoding value acquisition submodule is used to process the second ciphertext data in the returned data and the private key through the homomorphic encryption algorithm to obtain the second location encoding value corresponding to the second ciphertext data. The second location information acquisition submodule is used to convert the second location code value into the second location information corresponding to the second location code value through the preset encoding conversion rule; The location service information acquisition submodule is used to determine the location service information corresponding to the location service request based on the returned data containing the second location information.
14. The apparatus according to claim 8, characterized in that, The query string generation module includes: The location range determination submodule is used to determine the location range corresponding to the location service request based on the location range information. Based on the location range, a string of corresponding length is selected from the first encrypted data to obtain the query string.
15. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 6, or the steps of the method as described in claim 7.
16. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1 to 6, or the steps of the method as described in claim 7.
Citation Information
Patent Citations
Location based service (LBS) user location and identity privacy protection method
CN106792501A
Method and apparatus for encrypting information, computer device, and storage medium
CN107666479A