CN113987144A - Query method and device for space text - Google Patents

Query method and device for space text Download PDF

Info

Publication number
CN113987144A
CN113987144A CN202111210427.0A CN202111210427A CN113987144A CN 113987144 A CN113987144 A CN 113987144A CN 202111210427 A CN202111210427 A CN 202111210427A CN 113987144 A CN113987144 A CN 113987144A
Authority
CN
China
Prior art keywords
query
lower triangular
matrix
keyword
triangular matrix
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111210427.0A
Other languages
Chinese (zh)
Inventor
苗银宾
杨玉涛
童秋云
范瑞彬
张开翔
李辉忠
李成博
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xidian University
WeBank Co Ltd
Original Assignee
Xidian University
WeBank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xidian University, WeBank Co Ltd filed Critical Xidian University
Priority to CN202111210427.0A priority Critical patent/CN113987144A/en
Priority to PCT/CN2021/135363 priority patent/WO2023065477A1/en
Publication of CN113987144A publication Critical patent/CN113987144A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/31Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/36Creation of semantic tools, e.g. ontology or thesauri
    • G06F16/374Thesaurus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/38Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/387Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using geographical or spatial information, e.g. location

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Artificial Intelligence (AREA)
  • Human Computer Interaction (AREA)
  • Library & Information Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method and a device for querying a space text, wherein the method comprises the following steps: acquiring a query request; the query request comprises a query range and a query keyword set; the query range is a closed region formed by a query curve; coding the query keyword set to obtain a query keyword vector; performing polynomial fitting on the query curve to determine a query range vector; obtaining a first lower triangular matrix based on the query range vector and the query keyword vector; encrypting the first lower triangular matrix by the first encryption matrix to obtain a query sub trapdoor; determining the objects meeting preset conditions as query results based on the query subdata gates and the indexes of the objects in the spatial text data set; the index of any object is obtained by encrypting a second lower triangular matrix obtained according to the spatial position of the object and the keyword set by using a second encryption matrix. Therefore, the query range of the actual needs of the user is met, and the query accuracy is improved.

Description

Query method and device for space text
Technical Field
The invention relates to the field of financial technology (Fintech), in particular to a method and a device for querying a space text.
Background
With the development of computer technology, more and more technologies (such as block chains, cloud computing or big data) are applied to the financial field, the traditional financial industry is gradually changing to the financial technology, the big data technology is no exception, but higher requirements are provided for the space keyword query in the big data technology due to the requirements of the security and the real-time performance of the financial and payment industries.
In the prior art, when a user queries an object in a certain range, the selected query range is generally a preset range and a preset shape; specifically, a preset coding algorithm is used for generating Gray codes from the space geographic coordinates; fig. one is a gray code diagram of a spatial geographic coordinate exemplarily shown in the present invention, as shown in fig. 1, each cell (e.g., "0011") represents an area range, and each object in the spatial text data set (e.g., the object P is located in the "0011" area) is recorded in the gray code shown in fig. 1.
Based on the gray code, when a user determines a query range, the user determines the query range by taking a cell as a unit, for example, the query range is an area represented by '0011, 0010, 0111, 0110'; and then determining a query result in a query range of '0011, 0010, 0111 and 0110' according to the text keywords of the query request.
However, in the prior art, the query range in any shape cannot be queried, and the query range actually required by the user cannot be met, so that the determined query result includes an object which is not required by the user, and the query accuracy is reduced.
Disclosure of Invention
The embodiment of the invention provides a method and a device for querying a space text, which are used for querying a query range in any shape, meeting the query range actually required by a user, improving the query accuracy and improving the accuracy of determining a query result.
In a first aspect, an embodiment of the present invention provides a method for querying a spatial text, including:
acquiring a query request; the query request comprises a query scope and a query keyword set; the query range is a closed area formed by a query curve;
coding the query keyword set to obtain a query keyword vector;
aiming at any query curve, carrying out polynomial fitting on the query curve, and determining coefficients of each power term of the fitted polynomial as query range vectors; obtaining a first lower triangular matrix based on the query range vector and the query keyword vector; encrypting the first lower triangular matrix through a first encryption matrix to obtain a query sub trapdoor;
determining the objects meeting preset conditions as query results based on the query subdata gates and the indexes of the objects in the spatial text data set; and the index of any object is obtained by encrypting a second lower triangular matrix obtained according to the spatial position of the object and the keyword set by using a second encryption matrix.
In the above technical solution, the query range is a closed region formed by a query curve, that is, the query range in the present invention may be in any shape; the multidimensional keyword query is realized by determining the query keyword vector, and the accuracy of the keyword query is improved; then, determining an object which meets a preset condition through a fitting curve corresponding to the query curve, namely determining an object which corresponds to the query keyword set and is in a query range, so that the query range which is actually required by the user is met, namely the query result is in the query range which is actually required by the user, and therefore the query accuracy is improved; and the information of the query request and the object is encrypted through the encryption matrix, so that the query safety is ensured.
Optionally, encoding the query keyword set to obtain a query keyword vector, including:
establishing a first vector based on the number m of keywords in the keyword dictionary; the keyword dictionary is obtained by taking a union set of keyword sets of all objects in the spatial text data set;
if the j-th keyword in the keyword dictionary is determined to be recorded in the query keyword set, assigning the j-th dimension element of the first vector to be 1;
if the j-th keyword in the keyword dictionary is determined not to be recorded in the query keyword set, assigning the j-th dimension element of the first vector to be 0;
and determining the first vector after each dimension element is assigned as the query keyword vector.
In the technical scheme, the query keywords are represented in a vector form, so that multidimensional keyword query is realized, and query efficiency and query accuracy are improved.
Optionally, obtaining a first lower triangular matrix based on the query range vector and the query keyword vector, including:
determining a first random lower triangular matrix based on the degree n of the highest power term in the polynomial and the number m of keywords in a keyword dictionary;
assigning a diagonal line of the first random lower triangular matrix according to each dimension element in the query range vector and the query keyword vector to obtain a first lower triangular matrix;
the second lower triangular matrix is obtained by the following method comprising the following steps:
determining a second random lower triangular matrix based on the degree n of the highest power term in the polynomial and the number m of keywords in the keyword dictionary;
for any object, determining an index space vector by using n +1 items of latitude values of the object subjected to n +1 times of processing and longitude values of the object; coding the keyword set of the object to obtain an index keyword vector;
and assigning a diagonal line of the second random lower triangular matrix according to the index space vector and each dimensional element in the index keyword vector to obtain a second lower triangular matrix.
In the technical scheme, a query range and a query keyword set of a query request are represented by a first lower triangular matrix; representing the spatial position and the keyword set of the object through a second lower triangular matrix; therefore, the query result is determined in the query range actually required by the user according to the objects corresponding to the query keyword set and determined in the query range according to the first lower triangular matrix and the second lower triangular matrix, and the query accuracy is improved.
Optionally, assigning a value to a diagonal line of the first random lower triangular matrix according to each dimension element in the query range vector and the query keyword vector, including:
assigning the coefficient of the nth power item in the query range vector to the element of the r +1 th row and the r +1 th column in the first random lower triangular matrix; r is more than or equal to 0 and less than or equal to n;
assigning-1 to the element of the n +2 th row and the n +2 th column in the first random lower triangular matrix;
assigning the j-th dimension element in the query keyword vector to the n +2+ j-th row and column of the n +2+ j in the first random lower triangular matrix;
and assigning the number of the keywords in the query keyword set to the elements in the last row and the last column in the first random lower triangular matrix.
In the technical scheme, the query range and the query keyword set of the query request are expressed by one matrix, so that the calculation amount is reduced when the query result is determined, and the query efficiency is improved.
Optionally, assigning a value to a diagonal line of the second random lower triangular matrix according to the index space vector and each dimensional element in the index keyword vector, including:
assigning the weft value of the object after r times of processing to the element of the row (r + 1) and the column (r + 1) in the second random lower triangular matrix; r is more than or equal to 0 and less than or equal to n;
assigning the longitude value of the object to an element of the n +2 th row and the n +2 th column in the second random lower triangular matrix;
assigning the jth dimension element in the index key vector to the (n +3+ j) th row and column of the (n +3+ j) th row in the second random lower triangular matrix;
assigning-1 to the elements of the last row and the last column in the second random lower triangular matrix.
The spatial position of the object and the keyword set are expressed through a matrix, so that when a query result is determined, each object does not need to be repeatedly calculated, the calculation amount is reduced, and the query efficiency is improved.
Optionally, encrypting the first lower triangular matrix by using a first encryption matrix to obtain the query sub trapdoor, where the method includes:
encrypting the first lower triangular matrix according to an inverse matrix of at least one random reversible square matrix, a third lower triangular matrix with a diagonal value as a set value and a fourth lower triangular matrix with a diagonal value of 1 to obtain a query sub-trapdoor; the set value is that the value from the 1 st column of the 1 st row to the n +2 th row n +2 column is a preset positive real number, and the value from the n +3 th column of the n +3 th row to the n + m +3 th row n + m +3 is 1;
the index of any object is obtained by encrypting a second lower triangular matrix obtained according to the spatial position of the object and the keyword set by using a second encryption matrix, and comprises the following steps:
obtaining a second lower triangular matrix according to the spatial position of the object and the keyword set;
and encrypting the second lower triangular square matrix according to the at least one random reversible square matrix, the third random lower triangular matrix and the fourth random lower triangular matrix to obtain the index of the object.
In the technical scheme, the query request and the information of the object are encrypted through the random matrix, so that the query safety is ensured.
Optionally, the query curves include a first query curve and a second query curve; each inquiry sub trapdoor comprises a first inquiry sub trapdoor and a second inquiry sub trapdoor; determining the object meeting the preset condition as a query result based on the query subtleties and the indexes of the objects in the spatial text data set, wherein the query subtleties comprise:
for any object, determining a first result matrix based on the index of the object and the first query subglothes; determining a second result matrix based on the index of the object and the second query subglothes;
and determining the trace of the first result matrix and the trace of the second result matrix, and determining whether the object meets a preset condition according to the trace of the first result matrix and the trace of the second result matrix.
Optionally, the preset conditions include:
the absolute value of the trace of the first result matrix and the absolute value of the trace of the second result matrix are less than a first threshold; and the trace of the first result matrix is greater than a second threshold; traces of the second result matrix are less than a second threshold;
the first threshold is used to determine objects that meet the set of query keywords;
the second threshold is used to determine objects that fit the query range.
In the above technical solution, an object corresponding to a query keyword set is ensured by a first threshold, that is, a keyword set included in the object includes the query keyword set or is consistent with the query keyword set; the object is ensured to be in the query range through the first threshold, so that the query result is determined based on the threshold, the query accuracy is improved, and the accuracy of the determined query result is improved.
In a second aspect, an embodiment of the present invention provides an apparatus for querying a spatial text, including:
the acquisition module is used for acquiring the query request; the query request comprises a query scope and a query keyword set; the query range is a closed area formed by a query curve;
the processing module is used for coding the query keyword set to obtain a query keyword vector;
aiming at any query curve, carrying out polynomial fitting on the query curve, and determining coefficients of each power term of the fitted polynomial as query range vectors; obtaining a first lower triangular matrix based on the query range vector and the query keyword vector; encrypting the first lower triangular matrix through a first encryption matrix to obtain a query sub trapdoor;
determining the objects meeting preset conditions as query results based on the query subdata gates and the indexes of the objects in the spatial text data set; and the index of any object is obtained by encrypting a second lower triangular matrix obtained according to the spatial position of the object and the keyword set by using a second encryption matrix.
Optionally, the processing module is specifically configured to:
establishing a first vector based on the number m of keywords in the keyword dictionary; the keyword dictionary is obtained by taking a union set of keyword sets of all objects in the spatial text data set;
if the j-th keyword in the keyword dictionary is determined to be recorded in the query keyword set, assigning the j-th dimension element of the first vector to be 1;
if the j-th keyword in the keyword dictionary is determined not to be recorded in the query keyword set, assigning the j-th dimension element of the first vector to be 0;
and determining the first vector after each dimension element is assigned as the query keyword vector.
Optionally, the processing module is specifically configured to:
determining a first random lower triangular matrix based on the degree n of the highest power term in the polynomial and the number m of keywords in a keyword dictionary;
assigning a diagonal line of the first random lower triangular matrix according to each dimension element in the query range vector and the query keyword vector to obtain a first lower triangular matrix;
determining a second random lower triangular matrix based on the degree n of the highest power term in the polynomial and the number m of keywords in the keyword dictionary;
for any object, determining an index space vector by using n +1 items of latitude values of the object subjected to n +1 times of processing and longitude values of the object; coding the keyword set of the object to obtain an index keyword vector;
and assigning a diagonal line of the second random lower triangular matrix according to the index space vector and each dimensional element in the index keyword vector to obtain a second lower triangular matrix.
Optionally, the processing module is specifically configured to:
assigning the coefficient of the nth power item in the query range vector to the element of the r +1 th row and the r +1 th column in the first random lower triangular matrix; r is more than or equal to 0 and less than or equal to n;
assigning-1 to the element of the n +2 th row and the n +2 th column in the first random lower triangular matrix;
assigning the j-th dimension element in the query keyword vector to the n +2+ j-th row and column of the n +2+ j in the first random lower triangular matrix;
and assigning the number of the keywords in the query keyword set to the elements in the last row and the last column in the first random lower triangular matrix.
Optionally, the processing module is specifically configured to:
assigning the weft value of the object after r times of processing to the element of the row (r + 1) and the column (r + 1) in the second random lower triangular matrix; r is more than or equal to 0 and less than or equal to n;
assigning the longitude value of the object to an element of the r +2 th row and the r +2 th column in the second random lower triangular matrix;
assigning the jth dimension element in the index key vector to the (n +3+ j) th row and column of the (n +3+ j) th row in the second random lower triangular matrix;
assigning-1 to the elements of the last row and the last column in the second random lower triangular matrix.
Optionally, the processing module is specifically configured to:
encrypting the first lower triangular matrix according to an inverse matrix of at least one random reversible square matrix, a third lower triangular matrix with a diagonal value as a set value and a fourth lower triangular matrix with a diagonal value of 1 to obtain a query sub-trapdoor; the set value is that the value from the 1 st column of the 1 st row to the n +2 th row n +2 column is a preset positive real number, and the value from the n +3 th column of the n +3 th row to the n + m +3 th row n + m +3 is 1;
obtaining a second lower triangular matrix according to the spatial position of the object and the keyword set;
and encrypting the second lower triangular square matrix according to the at least one random reversible square matrix, the third random lower triangular matrix and the fourth random lower triangular matrix to obtain the index of the object.
Optionally, the query curves include a first query curve and a second query curve; each inquiry sub trapdoor comprises a first inquiry sub trapdoor and a second inquiry sub trapdoor; the processing module is specifically configured to:
for any object, determining a first result matrix based on the index of the object and the first query subglothes; determining a second result matrix based on the index of the object and the second query subglothes;
and determining the trace of the first result matrix and the trace of the second result matrix, and determining whether the object meets a preset condition according to the trace of the first result matrix and the trace of the second result matrix.
In a third aspect, an embodiment of the present invention further provides a computer device, including:
a memory for storing program instructions;
and the processor is used for calling the program instruction stored in the memory and executing the query method of the space text according to the obtained program.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium stores computer-executable instructions, where the computer-executable instructions are configured to cause a computer to execute the above query method for spatial text.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a gray code diagram of a spatial geographic coordinate according to an embodiment of the present invention;
FIG. 2 is a system architecture diagram according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of a method for querying a spatial text according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a query scope according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an application scenario provided in the embodiment of the present invention;
fig. 6 is a schematic structural diagram of an apparatus for querying a spatial text according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the prior art, the method for determining the query result based on the query scope includes the following four stages:
s1, initializing the system;
the data owner generates a master key msk.
S2, encrypting data;
the data owner codes the object in the spatial text data set according to a preset coding mode to obtain an object information vector; for example, the spatial text data set DB ═ { D1, D2, … …, Dz }, the ith object Di ═ { Dp, Dq }, where Dp is the spatial coordinates of object Di and Dq is the set of keywords for object Di; generating a gray code shown in fig. 1 by using a preset encoding algorithm for the spatial geographic coordinates, and then encoding the spatial coordinates of the object Di into the gray code in a preset encoding mode, wherein the object P is encoded into '0011', as shown in fig. 1; then, encoding the keyword set of the object Di into a bitmap by using a bitmap encoding mode; generating an object information vector based on the Gray code and the bitmap of the object;
and encrypting the object information vector according to the master key msk.
S3, generating a trap door;
after the query request is obtained, coding a query range of the query request according to a preset coding algorithm to obtain a query code; coding a query keyword set of the query request according to a bitmap coding algorithm to obtain a query bitmap; determining a query vector based on the query encoding and the query bitmap;
and encrypting the query vector according to the master key msk.
S4, inquiring;
and determining the object corresponding to the query keyword set in the query range according to the query vector and the object information vector.
However, in the above query method, because the preset encoding algorithm can only determine the query range as a rectangle, as shown in fig. 1, the query range of the rectangle is determined by using each cell (e.g., "0011") as a basic unit, and the query range of any shape cannot be queried, and the query range actually required by the user cannot be met. For example, a user wants to query how many banks are in common in a city, because most of the regions of cities are irregular regions, according to the prior art scheme, the determined rectangular query range needs to include the city, but the rectangular query range includes other regions, such as other cities, on the basis that the city is included in the rectangular query range, so that banks in the rectangular query range are not limited to the city, but also include banks in other cities, and the determined query result (bank) is not directed to the city, thereby causing the determined query result to include objects that are not needed by the user, reducing the accuracy of the query, and causing the accuracy of the determined query result to be low.
In another query mode, the query request includes a query location and a query keyword, for example, if the user a initiates the query request at a specific location, the location is the query location of the query request, and the query location is generally a longitude and latitude coordinate value, i.e., a query point.
When the query point is queried, the minimum spatial distance between the query point and each minimum outsourcing rectangle in an index tree constructed in advance according to plaintext spatial text data needs to be determined, and then the similarity between each spatial text and a keyword of a query request is determined according to the keyword corresponding to the spatial text existing in each minimum outsourcing rectangle and the keyword of the query request. And finally, determining a query value according to the preset weight, the spatial distance and the keyword similarity, and determining a query result according to the size of the query value, for example, taking the spatial text (equivalent to leaf nodes in the index tree) corresponding to the maximum query value as the query result. The index tree is constructed by a data owner according to a plaintext space text, and the minimum outsourcing rectangle is a space range of non-leaf nodes.
However, the above method has a problem that the query value is related to a preset weight, for example, when the preset weight for the spatial distance is small and the preset weight for the keyword similarity is large, nodes similar to the keywords in the query request are likely to appear in the query result, so that the determined query result including the ranking of the correlation values of the spatial text data is leaked, an attacker is likely to estimate information of each object according to the ranking of the correlation values, and the daily habits and preferences of the query user may be analyzed, which may result in potential safety hazards.
Therefore, there is a need for a method for querying a spatial text, which is used to satisfy the query range actually required by a user, that is, the query result is within the query range actually required by the user, so as to improve the accuracy of querying, improve the accuracy of determining the query result, and increase the query security.
Fig. 2 illustrates a system architecture to which an embodiment of the present invention is applicable, which includes a server 200, and the server 200 may include a processor 210, a communication interface 220, and a memory 230.
The communication interface 220 is used for receiving a query request and sending a query result.
The processor 210 is a control center of the server 200, connects various parts of the entire server 200 using various interfaces and routes, performs various functions of the server 200 and processes data by operating or executing software programs and/or modules stored in the memory 230 and calling data stored in the memory 230. Alternatively, processor 210 may include one or more processing units.
The memory 230 may be used to store software programs and modules, and the processor 210 executes various functional applications and data processing by operating the software programs and modules stored in the memory 230. The memory 230 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to a business process, and the like. Further, memory 230 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
It should be noted that the structure shown in fig. 3 is only an example, and the embodiment of the present invention is not limited thereto.
Based on the above description, fig. 3 exemplarily illustrates a flowchart of a method for querying a spatial text according to an embodiment of the present invention, where the flowchart may be executed by a device for querying a spatial text.
As shown in fig. 3, the process specifically includes:
at step 310, a query request is obtained.
In the embodiment of the invention, the query request comprises a query range and a query keyword set; the query range is a closed area formed by a query curve; for example, the query range is an elliptical region formed by two curves, and the query keyword set includes query keywords of "Sichuan" and "chafing dish".
And step 320, encoding the query keyword set to obtain a query keyword vector.
In the embodiment of the invention, the query keyword vector is obtained by determining whether the keywords recorded in the keyword dictionary exist in the query keyword set.
And 330, aiming at any query curve, carrying out polynomial fitting on the query curve, and determining coefficients of each power term of the fitted polynomial as query range vectors.
In the embodiment of the invention, the query curve can be represented in the matrix by fitting the query curve to a polynomial so as to participate in calculation.
Step 340, determining the object meeting the preset condition as the query result based on the query subtopic gate and the index of each object in the spatial text data set.
In the embodiment of the present invention, the preset condition includes a first threshold and a second threshold, where the first threshold is used to determine an object that meets the query keyword set; the second threshold is used to determine objects that fit the query range.
In step 310, the query range may be an area of any shape, and the query range may be a closed area formed by a plurality of query curves, where the number of the query curves is not limited; fig. 4 is a schematic diagram of an exemplary query range according to an embodiment of the present invention, as shown in fig. 4, the query range is a closed region formed according to two query curves, which are respectively a first query curve θ1(shown by the dashed line in FIG. 4) and a second query curve θ2(shown in solid lines in FIG. 4); the query curve may be a curve of any shape, and is not specifically limited herein.
In step 320, a query keyword vector is obtained by establishing a first vector and assigning values to each dimension element in the first vector according to the keyword dictionary and the query keyword set.
Specifically, a first vector is established based on the number m of keywords in a keyword dictionary; if the j-th keyword in the keyword dictionary is determined to be recorded in the query keyword set, assigning the j-th dimension element of the first vector to be 1; if the j-th keyword in the keyword dictionary is determined not to be recorded in the query keyword set, assigning the j-th dimension element of the first vector to be 0; and determining the first vector after each dimension element is assigned as the query keyword vector.
The keyword dictionary is obtained by taking a union set of keyword sets of all objects in the spatial text data set; for example, given a spatial text data set D, the spatial text data set D includes information (spatial positions and keyword sets) of a plurality of objects, e.g., the spatial text data set D includes a plurality of objects in common, taking the 1 st object as an example; the spatial position coordinate of the 1 st object is (x)1,y1) The key words include "Sichuan", "spicy" and "chafing dish". Wherein x is1Representing the latitude value, y, of the 1 st object1Indicating the longitude value of the 1 st object.
Then, determining a keyword dictionary W aiming at the keyword sets of all objects in the spatial text data set D; for example, the spatial text data set D includes two objects in common, the keyword set of the 1 st object includes keywords "sikawa", "spicy" and "hot pot", and the keyword set of the 2 nd object includes keywords "spicy" and "barbecue", then the keyword dictionary W is a union of the keyword set of the 1 st object and the keyword set of the 2 nd object, and specifically includes the keywords "sikawa", "spicy", "barbecue" and "hot pot"; i.e. m is 4.
For example, based on the above example, based on m ═ 4, a first vector is established as { m1, m2, m3, m4 }; suppose the query keyword set includes the keywords "Sichuan" and "chafing dish"; when j is 1, the 1 st keyword in the keyword dictionary W is "sichuan", and if the 1 st keyword is determined to exist in the query keyword set, the 1 st-dimensional element (m1) in the first vector is assigned as 1; by analogy, the 2 nd dimension element (m2) is assigned a value of 0; the 3 rd dimension element (m3) is assigned a value of 0; the 4 th-dimensional element (m4) is assigned a value of 1; thus, the query key vector is determined to be {1, 0, 0, 1 }.
In step 330, when performing polynomial fitting on the query curve, the greater the degree of polynomial fitting, the higher the fitting accuracy, and the calculation amount is relatively large, for example, n represents the degree of polynomial fitting, the greater n, the higher the fitting accuracy, and when n is 10, the fitting accuracy exceeds 99%, in the embodiment of the present invention, n is 10 for example, but is not limited to n is 10.
Based on the above step 310, the first query curve θ1And a second query curve theta2Obtaining a corresponding first fitting curve after polynomial fitting
Figure BDA0003308737960000131
And a second fitted curve
Figure BDA0003308737960000132
Such as
Figure BDA0003308737960000133
Figure BDA0003308737960000134
After the fitted curve is obtained, a query range vector is determined from a polynomial of the fitted curve, such as the fitted curve
Figure BDA0003308737960000135
The query range vector of is { a }0,a1,……,a10}; fitting curve
Figure BDA0003308737960000136
The query range vector of is { b }0,b1,……,b10}。
And aiming at any fitting curve, assigning a value to the constructed random lower triangular matrix based on the query range vector and the query keyword vector so as to obtain a first lower triangular matrix representing the query range information and the query keyword set of the fitting curve. It should be noted that, in the embodiment of the present invention, the matrices are all square matrices.
Specifically, a first random lower triangular matrix is determined based on the degree n of the highest power term in the polynomial and the number m of keywords in a keyword dictionary; and assigning a diagonal line of the first random lower triangular matrix according to the query range vector and each dimensional element in the query keyword vector to obtain a first lower triangular matrix. The lower triangular matrix is a matrix in which all elements above the diagonal are 0.
For example, a lower triangular matrix E of (n + m +3) × (n + m +3) dimensions is randomly generated1(the first random lower triangular matrix),
Figure BDA0003308737960000141
and then assigning a value to the diagonal line of the first random lower triangular matrix according to each dimension element in the query range vector and the query keyword vector.
Further, assigning the coefficient of the r-th power item in the query range vector to the element of the r +1 th row and the r +1 th column in the first random lower triangular matrix; r is more than or equal to 0 and less than or equal to n; assigning-1 to the element of the n +2 th row and the n +2 th column in the first random lower triangular matrix; assigning the j-th dimension element in the query keyword vector to the n +2+ j-th row and column of the n +2+ j in the first random lower triangular matrix; and assigning the number of the keywords in the query keyword set to the elements in the last row and the last column in the first random lower triangular matrix.
Using the first fitted curve
Figure BDA0003308737960000142
For example, when r is 0, the coefficient of the 0 th power term in the query range vector is a0A is to0Assign to the first random lower triangular matrix E1Row r +1 and column r +1 of (1)
Figure BDA0003308737960000143
In the same way, the value corresponding to each dimension element in the query range vector is assigned to the first random lower triangular matrix E1Performing the following steps;
assign-1 to the first random lower triangular matrix E1Row r +1 and column r +1 of (1)
Figure BDA0003308737960000144
Assigning the j-th dimension element in the query keyword vector to a first random lower triangular matrixThe (n +2+ j) th row and the (n +2+ j) th column; if j is 1, determining that the value of the j-th dimension element in the query keyword vector is 1, assigning '1' to the first random lower triangular matrix E1The (n +2+ j) th row and the (n +2+ j) th column;
assigning the number of keywords in the query keyword set (e.g. 2 for the number of keywords in the query keyword set) to the first random lower triangular matrix E1Last row and last column of the element
Figure BDA0003308737960000145
In conclusion, a first fitting curve is obtained
Figure BDA0003308737960000146
First lower triangular matrix of
Figure BDA0003308737960000147
Figure BDA0003308737960000148
Similarly, the second fitted curve
Figure BDA0003308737960000149
A first lower triangular matrix of
Figure BDA00033087379600001410
Based on the description, a second lower triangular matrix which represents the spatial position and the keyword set of the object is stored for any object in the spatial text data set; specifically, the second lower triangular matrix is obtained by: determining a second random lower triangular matrix based on the degree n of the highest power term in the polynomial and the number m of keywords in the keyword dictionary; for any object, determining an index space vector by using n +1 items of latitude values of the object subjected to n +1 times of processing and longitude values of the object; coding the keyword set of the object to obtain an index keyword vector; and assigning a diagonal line of the second random lower triangular matrix according to the index space vector and each dimensional element in the index keyword vector to obtain a second lower triangular matrix.
For example, the ith object oiThe keyword set comprises keywords 'spicy' and 'barbecue', and the index keyword vector of the object is determined to be {0, 0, 0, 0} according to the method for determining the query keyword vector.
Suppose object oiIs (x)i,yi) (ii) a Wherein x isiObject o ofiLatitude value of, yiObject o ofiA longitude value of (d); then determine the index space vector as
Figure BDA0003308737960000151
At the acquisition of the object oiAfter indexing the space vector and indexing the key vector, for diagonal E of the second random lower triangular matrix2Carrying out assignment; specifically, the latitude values of the object after r times of processing are assigned to the elements of the row r +1 and the column r +1 in the second random lower triangular matrix; r is more than or equal to 0 and less than or equal to n; assigning the longitude value of the object to an element of the r +2 th row and the r +2 th column in the second random lower triangular matrix; assigning the jth dimension element in the index key vector to the (n +3+ j) th row and column of the (n +3+ j) th row in the second random lower triangular matrix; assigning-1 to the elements of the last row and the last column in the second random lower triangular matrix.
Based on the above-described example of determining the first lower triangular matrix, a (n + m +3) × (n + m +3) -dimensional lower triangular matrix F is randomly generated1(a second random lower triangular matrix),
Figure BDA0003308737960000152
then according to the 1 st object o1And assigning the diagonal line of the second random lower triangular matrix by each dimension element in the index space vector and the index key word vector.
When r is 0, the latitude value of 0 th time in the index space vector is
Figure BDA0003308737960000153
Will be provided with
Figure BDA0003308737960000154
Is assigned to a second random lower triangular matrix F1Row 1, column 1 element of (1)
Figure BDA0003308737960000155
In the same way, the corresponding assignment of each dimension element in the index space vector is assigned to a second random lower triangular matrix F1Performing the following steps;
will yiIs assigned to a second random lower triangular matrix E2Row r +1 and column r +1 of (1)
Figure BDA0003308737960000161
Assigning the jth dimension element in the index key word vector to the (n +2+ j) th row and column of the (n +2+ j) th row in the second random lower triangular matrix; if j is 1, determining that the value of the jth dimension element in the index key vector is 0, then assigning "0" to the second random lower triangular matrix F1The element of the (n +2+ j) th row and the (n +2+ j) th column
Figure BDA0003308737960000162
Assigning-1 to the second random lower triangular matrix E2Last row and last column of the element
Figure BDA0003308737960000163
To sum up, a second lower triangular matrix is obtained
Figure BDA0003308737960000164
Figure BDA0003308737960000165
After the first lower triangular matrix and the second lower triangular matrix are obtained, in order to ensure the query security, the first lower triangular matrix and the second lower triangular matrix need to be encrypted.
Specifically, the first lower triangular matrix is encrypted according to an inverse matrix of at least one random reversible square matrix, a third random lower triangular matrix with a diagonal value as a set value and a fourth lower triangular matrix with a diagonal value of 1 to obtain a query trapdoor; the set value is that the value from the 1 st column in the 1 st row to the n +2 th row and the n +2 th column in the n +3 th row to the n + m +3 th row and the value from the n +3 th column in the n +3 th row to the n + m +3 th column in the n +3 th row is 1.
In the embodiment of the present invention, the random reversible square matrix, the third random lower triangular matrix, the third lower triangular matrix, the fourth random lower triangular matrix, and the fourth lower triangular matrix are generated in advance, and are used as key components for encrypting information.
For example, two (n + M +3) × (n + M +3) -dimensional invertible block matrices M are randomly generated1And M2
Figure BDA0003308737960000166
Randomly generating a random lower triangular matrix D with dimensions of (n + m +3) × (n + m +3)1D is1As a third random lower triangular matrix; based on a third random lower triangular matrix D1A third random lower triangular matrix D1The value of the 1 st row, the 1 st column to the n +2 nd row, the n +2 th column is set to 0.001 (preset positive real number), the value of the n +3 th row, the n +3 th column to the n + m +3 th row, the n + m +3 th column is set to 1, and thus a third lower triangular matrix D is obtained2
Figure BDA0003308737960000171
Randomly generating a random lower four-corner matrix S with (n + m +3) × (n + m +3) dimensions1Will S1As a fourth random lower triangular matrix; based on the fourth random lower triangular matrix S1A fourth random lower triangular matrix S1The diagonal of (1) is assigned to obtain a fourth lower triangular matrix S2
Figure BDA0003308737960000172
Reversible block matrix M1And M2Inverse matrix of (D), third lower triangular matrix of (D)2And a fourth lower triangular matrix S2With a first lower triangular momentMultiplying arrays to obtain a query sub trap door; such as the query curve theta1The first look-up sub-trapdoor of
Figure BDA0003308737960000173
Query curve theta2The second look-up sub-trapdoor of
Figure BDA0003308737960000174
Figure BDA0003308737960000175
For a second lower triangular matrix of any object, encrypting the second lower triangular square matrix according to the at least one random reversible square matrix, the third random lower triangular matrix and the fourth lower triangular matrix to obtain an index of the object; such as object oiIs indexed by
Figure BDA0003308737960000176
In step 340, for any object, by respectively matching the index of the object with the first query child trapdoor R1And a second look-up sub-trapdoor R2And multiplying to determine whether the object meets a preset condition.
Specifically, for any object, determining a first result matrix based on the index of the object and the first query sub-trapdoor; determining a second result matrix based on the index of the object and the second query subglothes; and determining the trace of the first result matrix and the trace of the second result matrix, and determining whether the object meets a preset condition according to the trace of the first result matrix and the trace of the second result matrix. Wherein, the trace of the matrix is the sum of each element on the diagonal line in the matrix.
For example, the first result matrix is tr (C)iR1);
Figure BDA0003308737960000177
The second result matrix is tr (C)iR2);
Figure BDA0003308737960000181
Wherein, K may be the number of query keywords included in the keyword set of the ith object; if the keyword set of the ith object comprises 'hot pot', 'Sichuan' and 'spicy', the keywords included in the query keyword set are 'hot pot' and 'Sichuan', and K is 2; k may also be the number of keywords of the keyword set of the ith object; δ is the number of query keys in the query key set.
Further, the preset conditions include:
the absolute value of the trace of the first result matrix and the absolute value of the trace of the second result matrix are less than a first threshold; and the trace of the first result matrix is greater than a second threshold; traces of the second result matrix are less than a second threshold; wherein the first threshold is used to determine objects that meet the set of query keywords; the second threshold is used to determine objects that fit the query range.
For example, the first threshold is 0.1; because the triangular matrix D is under the third2In the third embodiment, the value of the (n +3) th column from the (n +3) th row to the (n + m +3) th row is 1, and the (n +3) th column from the (n +3) th row to the (n + m +3) th row of the first lower triangular matrix and the second lower triangular matrix are used for representing the keyword;
at the third lower triangular matrix D2In the above description, the value of the 1 st row, the 1 st column to the n +2 th row, the n +2 th column is set to 0.001 (preset positive real number), and the elements of the 1 st row, the 1 st column to the n +2 th row, the n +2 th column of the first lower triangular matrix and the second lower triangular matrix are used to characterize the query range.
If K is δ, the trace of the result matrix is small because a preset positive real number (0.001) is set, and therefore, if the absolute value of the trace of the first result matrix and the absolute value of the trace of the second result matrix are not less than the first threshold, it is proved that K is not equal to δ, the keyword of the object does not correspond to the query keyword, that is, the object cannot be used as the query result; instead, the object has prerequisite requirements as a query result.
In an embodiment of the present invention, the first result matrix is used to characterize the first query sub-trapdoor, and the first query sub-trapdoor corresponds to the first query curve θ1(shown in dashed lines in FIG. 4), the first query curve θ1Is located in the upper half, and therefore, if the trace of the first resulting matrix is greater than 0 (the second threshold), it indicates that the object is located on the first query curve θ1Below (1); if the trace of the second result matrix is less than 0 (second threshold), it indicates that the object is located on the second query curve θ1Above (b).
Thus, for any object's first result matrix and second result matrix, if the absolute value of the trace of the first result matrix and the absolute value of the trace of the second result matrix are less than a first threshold, and the trace of the first result matrix is greater than a second threshold, and the trace of the second result matrix is less than a second threshold, then it is determined that the object's set of keywords corresponds to the set of query keywords, and that the object is within the query range, and thus the object is determined to be the query result.
Fig. 5 is a schematic structural diagram illustrating an application scenario, as shown in fig. 5, including a data owner 510, a cloud server 520, and a user end 530;
determining, by the data owner 510, at least one random reversible block matrix, a third lower triangular matrix, a fourth lower triangular matrix, a third random lower triangular matrix, and a fourth random lower triangular matrix, and taking the at least one random reversible block matrix, the third lower triangular matrix, the fourth lower triangular matrix, the third random lower triangular matrix, and the fourth random lower triangular matrix as key components; the data owner 510 sends the inverse matrix of at least one random invertible square matrix, the third lower triangular matrix, and the fourth lower triangular matrix to the user end 530;
the data owner 510 determines a second lower triangular matrix for each object in the spatial text dataset, and encrypts the second lower triangular matrix for each object based on at least one random invertible square matrix, a third random lower triangular matrix, and a fourth random lower triangular matrix to obtain an index for each object; and sends the index to cloud server 520;
the user side 530 determines a first lower triangular matrix of the first query curve and the second query curve based on the query range and the query keyword set of the query request, encrypts the first lower triangular matrix according to the inverse matrix of the at least one random reversible square matrix, the third lower triangular matrix and the fourth lower triangular matrix sent by the data owner 510, determines query sub-trapdoors of the first query curve and the second query curve, and sends the query sub-trapdoors of the first query curve and the second query curve to the cloud server 520.
The cloud server 520 determines an object satisfying a preset condition as a query result based on the query subglothes and the index of each object in the spatial text data set, and returns the query result to the user side 530.
Based on the same technical concept, fig. 6 exemplarily shows a schematic structural diagram of a spatial text query apparatus according to an embodiment of the present invention, and the apparatus can execute a flow of a spatial text query method.
As shown in fig. 6, the apparatus specifically includes:
an obtaining module 610, configured to obtain a query request; the query request comprises a query scope and a query keyword set; the query range is a closed area formed by a query curve;
a processing module 620, configured to encode the query keyword set to obtain a query keyword vector;
aiming at any query curve, carrying out polynomial fitting on the query curve, and determining coefficients of each power term of the fitted polynomial as query range vectors; obtaining a first lower triangular matrix based on the query range vector and the query keyword vector; encrypting the first lower triangular matrix through a first encryption matrix to obtain a query sub trapdoor;
determining the objects meeting preset conditions as query results based on the query subdata gates and the indexes of the objects in the spatial text data set; and the index of any object is obtained by encrypting a second lower triangular matrix obtained according to the spatial position of the object and the keyword set by using a second encryption matrix.
Optionally, the processing module 620 is specifically configured to:
establishing a first vector based on the number m of keywords in the keyword dictionary; the keyword dictionary is obtained by taking a union set of keyword sets of all objects in the spatial text data set;
if the j-th keyword in the keyword dictionary is determined to be recorded in the query keyword set, assigning the j-th dimension element of the first vector to be 1;
if the j-th keyword in the keyword dictionary is determined not to be recorded in the query keyword set, assigning the j-th dimension element of the first vector to be 0;
and determining the first vector after each dimension element is assigned as the query keyword vector.
Optionally, the processing module 620 is specifically configured to:
determining a first random lower triangular matrix based on the degree n of the highest power term in the polynomial and the number m of keywords in a keyword dictionary;
assigning a diagonal line of the first random lower triangular matrix according to each dimension element in the query range vector and the query keyword vector to obtain a first lower triangular matrix;
determining a second random lower triangular matrix based on the degree n of the highest power term in the polynomial and the number m of keywords in the keyword dictionary;
for any object, determining an index space vector by using n +1 items of latitude values of the object subjected to n +1 times of processing and longitude values of the object; coding the keyword set of the object to obtain an index keyword vector;
and assigning a diagonal line of the second random lower triangular matrix according to the index space vector and each dimensional element in the index keyword vector to obtain a second lower triangular matrix.
Optionally, the processing module 620 is specifically configured to:
assigning the coefficient of the nth power item in the query range vector to the element of the r +1 th row and the r +1 th column in the first random lower triangular matrix; r is more than or equal to 0 and less than or equal to n;
assigning-1 to the element of the n +2 th row and the n +2 th column in the first random lower triangular matrix;
assigning the j-th dimension element in the query keyword vector to the n +2+ j-th row and column of the n +2+ j in the first random lower triangular matrix;
and assigning the number of the keywords in the query keyword set to the elements in the last row and the last column in the first random lower triangular matrix.
Optionally, the processing module 620 is specifically configured to:
assigning the weft value of the object after r times of processing to the element of the row (r + 1) and the column (r + 1) in the second random lower triangular matrix; r is more than or equal to 0 and less than or equal to n;
assigning the longitude value of the object to an element of the r +2 th row and the r +2 th column in the second random lower triangular matrix;
assigning the jth dimension element in the index key vector to the (n +3+ j) th row and column of the (n +3+ j) th row in the second random lower triangular matrix;
assigning-1 to the elements of the last row and the last column in the second random lower triangular matrix.
Optionally, the processing module 620 is specifically configured to:
encrypting the first lower triangular matrix according to an inverse matrix of at least one random reversible square matrix, a third lower triangular matrix with a diagonal value as a set value and a fourth lower triangular matrix with a diagonal value of 1 to obtain a query sub-trapdoor; the set value is that the value from the 1 st column of the 1 st row to the n +2 th row n +2 column is a preset positive real number, and the value from the n +3 th column of the n +3 th row to the n + m +3 th row n + m +3 is 1;
obtaining a second lower triangular matrix according to the spatial position of the object and the keyword set;
and encrypting the second lower triangular square matrix according to the at least one random reversible square matrix, the third random lower triangular matrix and the fourth random lower triangular matrix to obtain the index of the object.
Optionally, the query curves include a first query curve and a second query curve; each inquiry sub trapdoor comprises a first inquiry sub trapdoor and a second inquiry sub trapdoor; the processing module 620 is specifically configured to:
for any object, determining a first result matrix based on the index of the object and the first query subglothes; determining a second result matrix based on the index of the object and the second query subglothes;
and determining the trace of the first result matrix and the trace of the second result matrix, and determining whether the object meets a preset condition according to the trace of the first result matrix and the trace of the second result matrix.
Based on the same technical concept, an embodiment of the present invention further provides a computer device, including:
a memory for storing program instructions;
and the processor is used for calling the program instruction stored in the memory and executing the query method of the space text according to the obtained program.
Based on the same technical concept, the embodiment of the invention also provides a computer-readable storage medium, in which computer-executable instructions are stored, and the computer-executable instructions are used for enabling a computer to execute the query method of the spatial text.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (10)

1. A method for querying a spatial text, comprising:
acquiring a query request; the query request comprises a query scope and a query keyword set; the query range is a closed area formed by a query curve;
coding the query keyword set to obtain a query keyword vector;
aiming at any query curve, carrying out polynomial fitting on the query curve, and determining coefficients of each power term of the fitted polynomial as query range vectors; obtaining a first lower triangular matrix based on the query range vector and the query keyword vector; encrypting the first lower triangular matrix through a first encryption matrix to obtain a query sub trapdoor;
determining the objects meeting preset conditions as query results based on the query subdata gates and the indexes of the objects in the spatial text data set; and the index of any object is obtained by encrypting a second lower triangular matrix obtained according to the spatial position of the object and the keyword set by using a second encryption matrix.
2. The method of claim 1, wherein encoding the set of query keywords to obtain a query keyword vector comprises:
establishing a first vector based on the number m of keywords in the keyword dictionary; the keyword dictionary is obtained by taking a union set of keyword sets of all objects in the spatial text data set;
if the j-th keyword in the keyword dictionary is determined to be recorded in the query keyword set, assigning the j-th dimension element of the first vector to be 1;
if the j-th keyword in the keyword dictionary is determined not to be recorded in the query keyword set, assigning the j-th dimension element of the first vector to be 0;
and determining the first vector after each dimension element is assigned as the query keyword vector.
3. The method of claim 1, wherein deriving a first lower triangular matrix based on the query range vector and the query keyword vector comprises:
determining a first random lower triangular matrix based on the degree n of the highest power term in the polynomial and the number m of keywords in a keyword dictionary;
assigning a diagonal line of the first random lower triangular matrix according to each dimension element in the query range vector and the query keyword vector to obtain a first lower triangular matrix;
the second lower triangular matrix is obtained by the following method comprising the following steps:
determining a second random lower triangular matrix based on the degree n of the highest power term in the polynomial and the number m of keywords in the keyword dictionary;
for any object, determining an index space vector by using n +1 items of latitude values of the object subjected to n +1 times of processing and longitude values of the object; coding the keyword set of the object to obtain an index keyword vector;
and assigning a diagonal line of the second random lower triangular matrix according to the index space vector and each dimensional element in the index keyword vector to obtain a second lower triangular matrix.
4. The method of claim 3, wherein assigning a diagonal of the first random lower triangular matrix according to each dimension element in the query range vector and the query key vector comprises:
assigning the coefficient of the nth power item in the query range vector to the element of the r +1 th row and the r +1 th column in the first random lower triangular matrix; r is more than or equal to 0 and less than or equal to n;
assigning-1 to the element of the n +2 th row and the n +2 th column in the first random lower triangular matrix;
assigning the j-th dimension element in the query keyword vector to the n +2+ j-th row and column of the n +2+ j in the first random lower triangular matrix;
and assigning the number of the keywords in the query keyword set to the elements in the last row and the last column in the first random lower triangular matrix.
5. The method of claim 3, wherein assigning a diagonal of the second random lower triangular matrix according to each dimension element in the indexed spatial vector and the indexed key vector comprises:
assigning the weft value of the object after r times of processing to the element of the row (r + 1) and the column (r + 1) in the second random lower triangular matrix; r is more than or equal to 0 and less than or equal to n;
assigning the longitude value of the object to an element of the r +2 th row and the r +2 th column in the second random lower triangular matrix;
assigning the jth dimension element in the index key vector to the (n +3+ j) th row and column of the (n +3+ j) th row in the second random lower triangular matrix;
assigning-1 to the elements of the last row and the last column in the second random lower triangular matrix.
6. The method of claim 1, wherein encrypting the first lower triangular matrix with a first encryption matrix to obtain a queried subglotter comprises:
encrypting the first lower triangular matrix according to an inverse matrix of at least one random reversible square matrix, a third lower triangular matrix with a diagonal value as a set value and a fourth lower triangular matrix with a diagonal value of 1 to obtain a query sub-trapdoor; the set value is that the value from the 1 st column of the 1 st row to the n +2 th row n +2 column is a preset positive real number, and the value from the n +3 th column of the n +3 th row to the n + m +3 th row n + m +3 is 1;
the index of any object is obtained by encrypting a second lower triangular matrix obtained according to the spatial position of the object and the keyword set by using a second encryption matrix, and comprises the following steps:
obtaining a second lower triangular matrix according to the spatial position of the object and the keyword set;
and encrypting the second lower triangular square matrix according to the at least one random reversible square matrix, the third random lower triangular matrix and the fourth random lower triangular matrix to obtain the index of the object.
7. The method of any one of claims 1 to 6, wherein the query curve comprises a first query curve and a second query curve; each inquiry sub trapdoor comprises a first inquiry sub trapdoor and a second inquiry sub trapdoor; determining the object meeting the preset condition as a query result based on the query subtleties and the indexes of the objects in the spatial text data set, wherein the query subtleties comprise:
for any object, determining a first result matrix based on the index of the object and the first query subglothes; determining a second result matrix based on the index of the object and the second query subglothes;
and determining the trace of the first result matrix and the trace of the second result matrix, and determining whether the object meets a preset condition according to the trace of the first result matrix and the trace of the second result matrix.
8. The method of claim 7, wherein the preset conditions include:
the absolute value of the trace of the first result matrix and the absolute value of the trace of the second result matrix are less than a first threshold; and the trace of the first result matrix is greater than a second threshold; traces of the second result matrix are less than a second threshold;
the first threshold is used to determine objects that meet the set of query keywords;
the second threshold is used to determine objects that fit the query range.
9. An apparatus for querying a spatial text, comprising:
the acquisition module is used for acquiring the query request; the query request comprises a query scope and a query keyword set; the query range is a closed area formed by a query curve;
the processing module is used for coding the query keyword set to obtain a query keyword vector;
aiming at any query curve, carrying out polynomial fitting on the query curve, and determining coefficients of each power term of the fitted polynomial as query range vectors; obtaining a first lower triangular matrix based on the query range vector and the query keyword vector; encrypting the first lower triangular matrix through a first encryption matrix to obtain a query sub trapdoor;
determining the objects meeting preset conditions as query results based on the query subdata gates and the indexes of the objects in the spatial text data set; and the index of any object is obtained by encrypting a second lower triangular matrix obtained according to the spatial position of the object and the keyword set by using a second encryption matrix.
10. A computer device, comprising:
a memory for storing program instructions;
a processor for calling program instructions stored in said memory to execute the method of any one of claims 1 to 8 in accordance with the obtained program.
CN202111210427.0A 2021-10-18 2021-10-18 Query method and device for space text Pending CN113987144A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202111210427.0A CN113987144A (en) 2021-10-18 2021-10-18 Query method and device for space text
PCT/CN2021/135363 WO2023065477A1 (en) 2021-10-18 2021-12-03 Spatial text query method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111210427.0A CN113987144A (en) 2021-10-18 2021-10-18 Query method and device for space text

Publications (1)

Publication Number Publication Date
CN113987144A true CN113987144A (en) 2022-01-28

Family

ID=79739168

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111210427.0A Pending CN113987144A (en) 2021-10-18 2021-10-18 Query method and device for space text

Country Status (2)

Country Link
CN (1) CN113987144A (en)
WO (1) WO2023065477A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116821279B (en) * 2023-06-06 2024-06-07 哈尔滨理工大学 Space keyword query method and system with exclusion keywords

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101673307B (en) * 2009-10-21 2012-07-18 中国农业大学 Space data index method and system
EP2709306B1 (en) * 2012-09-14 2019-03-06 Alcatel Lucent Method and system to perform secure boolean search over encrypted documents
CN108710698B (en) * 2018-05-23 2021-10-15 湖南大学 Multi-keyword fuzzy query method based on ciphertext under cloud environment
CN108985094B (en) * 2018-06-28 2020-07-21 电子科技大学 Method for realizing access control and range query of ciphertext spatial data in cloud environment
CN110222012B (en) * 2019-06-08 2022-04-19 西安电子科技大学 Data ciphertext query method based on fine-grained sequencing in single user environment
CN110222081B (en) * 2019-06-08 2022-04-19 西安电子科技大学 Data ciphertext query method based on fine-grained sequencing in multi-user environment
CN112257455B (en) * 2020-10-21 2024-04-30 西安电子科技大学 Semantic understanding ciphertext space keyword retrieval method and system
CN112528064B (en) * 2020-12-10 2022-12-13 西安电子科技大学 Privacy-protecting encrypted image retrieval method and system
CN112948848A (en) * 2021-02-05 2021-06-11 杭州师范大学 Improved knn-based spatio-temporal data range query method
CN113177167A (en) * 2021-04-28 2021-07-27 湖南大学 Space keyword searching method based on cloud computing privacy protection
CN113221140A (en) * 2021-04-30 2021-08-06 杭州师范大学 Ciphertext space-time data query method based on access control

Also Published As

Publication number Publication date
WO2023065477A1 (en) 2023-04-27

Similar Documents

Publication Publication Date Title
Wang et al. Searchable encryption over feature-rich data
Zhang et al. PIC: Enable large-scale privacy preserving content-based image search on cloud
TWI740891B (en) Method and training system for training model using training data
CN106649346B (en) Data repeatability checking method and device
Fujiwara et al. Efficient search algorithm for SimRank
CN104424254B (en) Obtain analogical object set, the method and device that analogical object information is provided
Zou et al. Efficient and secure encrypted image search in mobile cloud computing
CN111552849B (en) Searchable encryption method, system, storage medium, vehicle-mounted network and smart grid
CN104731860B (en) The spatial key querying method of secret protection
US20170364517A1 (en) Hash value generation through projection vector split
CN104750784A (en) Merkle tree structure-based space inquiring integrity verification method
CN114003744A (en) Image retrieval method and system based on convolutional neural network and vector homomorphic encryption
CN116522019A (en) Forward safe space-time data retrieval method, system, equipment and medium
Lin et al. Computing the diffusion state distance on graphs via algebraic multigrid and random projections
CN113987144A (en) Query method and device for space text
CN115310125A (en) Encrypted data retrieval system, method, computer equipment and storage medium
CN117194418A (en) Verifiable multi-mode space-time data index structure and space-time range query verification method
Anagnostopoulos et al. Randomized embeddings with slack and high-dimensional approximate nearest neighbor
Hong et al. Augmented Rotation‐Based Transformation for Privacy‐Preserving Data Clustering
Peng et al. Towards Secure Approximate ${k} $-Nearest Neighbor Query Over Encrypted High-Dimensional Data
CN114912140A (en) Method, device, equipment and medium for processing data to be shared based on differential privacy
Zhu et al. Parallelization of skyline probability computation over uncertain preferences
Blanton et al. Secure and oblivious maximum bipartite matching size algorithm with applications to secure fingerprint identification
Becker et al. Counting solutions of a polynomial system locally and exactly
Liu et al. K-nearest neighbor queries over encrypted data

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination