CN113779428A - Data query method, device, server and storage medium - Google Patents

Data query method, device, server and storage medium Download PDF

Info

Publication number
CN113779428A
CN113779428A CN202111076751.8A CN202111076751A CN113779428A CN 113779428 A CN113779428 A CN 113779428A CN 202111076751 A CN202111076751 A CN 202111076751A CN 113779428 A CN113779428 A CN 113779428A
Authority
CN
China
Prior art keywords
dimensional
data
query
condition
time
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
CN202111076751.8A
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.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital Technology 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 Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN202111076751.8A priority Critical patent/CN113779428A/en
Publication of CN113779428A publication Critical patent/CN113779428A/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/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9537Spatial or temporal dependent retrieval, e.g. spatiotemporal queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • G06F16/244Grouping and aggregation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • G06F16/24534Query rewriting; Transformation

Abstract

The embodiment of the invention provides a data query method, a data query device, a server and a storage medium, wherein the method comprises the following steps: the method comprises the steps of obtaining a data query request, wherein the data query request comprises a one-dimensional query condition and a high-dimensional query condition, determining a query condition set based on the one-dimensional query condition and the high-dimensional query condition, determining target high-dimensional data meeting the query condition set according to a row label of stored high-dimensional data, and using the target high-dimensional data as a query result, wherein the row label comprises a one-dimensional time label and a high-dimensional space label, and the high-dimensional space label is used for identifying the one-dimensional data corresponding to the row of stored space data. The high-dimensional space tag is used for identifying the one-dimensional data corresponding to the row of stored space data, so that the effect of reducing the dimension of the high-dimensional space data into the one-dimensional data is realized, the target high-dimensional space data meeting the one-dimensional query condition and the high-dimensional query condition can be determined according to the one-dimensional data, and the query efficiency of the high-dimensional data can be greatly improved.

Description

Data query method, device, server and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a data query method, apparatus, server, and storage medium.
Background
With the advent of the big data era, data storage systems are more and more widely applied, and common databases include HBase-based time sequence databases, Influxdb and the like, which can store a large amount of data and provide data bases for data query, data processing, data analysis and the like. Some databases store data in high-dimensional form, such as two-dimensional position information, three-dimensional spatial information, and the like. For data query of high-dimensional data, the data query is more complex than one-dimensional data, and an accurate result cannot be queried simply according to a label of the data.
Because the current label of the high-dimensional data can only identify one-dimensional information, such as license plate number, vehicle color, restaurant name, etc., after the high-dimensional data meeting the one-dimensional query requirement is found according to the label, the traditional high-dimensional data query mode needs to find accurate high-dimensional data by adopting a one-to-one comparison mode. For example, the database stores position coordinates (x, y) of each restaurant, where x is longitude information and y is latitude information, and when a user wants to query all western-style restaurants within 20 km from the current position, all western-style restaurants need to be found from the database first, but the accurate western-style restaurants to be queried by the user can be found by further comparing the position coordinates of the western-style restaurants with the range within 20 km of the position where the user is located. Therefore, the traditional method has low query efficiency.
In order to solve the problem of low query efficiency in the traditional mode, a high-dimensional data query mode based on R tree indexes is provided. The R tree node comprises a plurality of pointers pointing to different data, when a user wants to perform data query, the pointers contained in the leaf nodes in the R tree need to be traversed, and whether the pointer pointing meets the condition is judged. The R tree construction process is very complex, and the high-dimensional data query efficiency is still low.
Disclosure of Invention
The embodiment of the invention aims to provide a data query method, a data query device, a server and a storage medium, so as to improve the query efficiency of high-dimensional data. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a data query method, which is applied to a server of a time sequence database, where the method includes:
acquiring a data query request, wherein the data query request comprises a one-dimensional query condition and a high-dimensional query condition, the one-dimensional query condition comprises a time condition, and the high-dimensional query condition comprises a space condition;
determining a query condition set composed of the time condition and the space condition based on the one-dimensional query condition and the high-dimensional query condition;
and determining target high-dimensional data meeting the query condition set as a query result according to the line tag of the stored high-dimensional data, wherein the high-dimensional data comprises spatial data of each line arranged according to a time sequence, each line of spatial data is provided with a line tag, the line tag comprises a one-dimensional time tag and a high-dimensional space tag, and the high-dimensional space tag is one-dimensional data and is used for identifying the stored spatial data of the line.
Optionally, the determining method of the high-dimensional spatial tag includes:
acquiring stored high-dimensional data corresponding to the previous time slice as data to be encoded;
coding each row of data to be coded according to a preset space filling curve coding rule to obtain one-dimensional data corresponding to the row of data to be coded;
and determining the one-dimensional data as a high-dimensional space tag corresponding to the row of data to be encoded.
Optionally, the step of acquiring stored high-dimensional data corresponding to a previous time slice as data to be encoded includes:
acquiring stored high-dimensional data corresponding to the previous time slice;
and arranging the acquired high-dimensional data stored in each line according to a time sequence to obtain spatial data on a time line as data to be encoded.
Optionally, the step of determining a query condition set composed of the temporal condition and the spatial condition based on the one-dimensional query condition and the high-dimensional query condition includes:
dividing the time condition into a plurality of one-dimensional time sub-conditions according to time according to the time condition included by the one-dimensional query condition and the setting mode of the one-dimensional time tag to obtain a one-dimensional time condition set;
converting the high-dimensional query condition into a plurality of one-dimensional data ranges as a high-dimensional space condition set according to the space filling curve coding rule;
and carrying out Cartesian product combination on the one-dimensional time condition set and the high-dimensional space condition set to obtain a query condition set.
Optionally, the step of determining, according to the line tag of the stored high-dimensional data, target high-dimensional data that satisfies the query condition set includes:
aiming at each query condition in the query condition set, searching a row label meeting the query condition from the row labels of the stored high-dimensional data to serve as a target label;
and determining the stored high-dimensional data corresponding to the target label as the target high-dimensional data meeting the query condition set.
Optionally, the method further includes:
and filtering the query result based on the spatial condition, and removing the query result which is not in the range represented by the spatial condition to obtain a final query result.
In a second aspect, an embodiment of the present invention provides a data query apparatus, which is applied to a server of a time sequence database, where the apparatus includes:
the query request acquisition module is used for acquiring a data query request, wherein the data query request comprises a one-dimensional query condition and a high-dimensional query condition, the one-dimensional query condition comprises a time condition, and the high-dimensional query condition comprises a space condition;
a condition set determining module, configured to determine a query condition set composed of the time condition and the space condition based on the one-dimensional query condition and the high-dimensional query condition;
and the high-dimensional data query module is used for determining target high-dimensional data meeting the query condition set as a query result according to the row label of the stored high-dimensional data, wherein the high-dimensional data comprises spatial data of rows arranged according to a time sequence, each row of spatial data is provided with a row label, each row label comprises a one-dimensional time label and a high-dimensional space label, and the high-dimensional space label is one-dimensional data and is used for identifying the stored spatial data of the row.
Optionally, the apparatus further comprises:
the data acquisition module is used for acquiring stored high-dimensional data corresponding to the previous time slice as data to be encoded;
the data coding module is used for coding each row of data to be coded according to a preset space filling curve coding rule to obtain one-dimensional data corresponding to the row of data to be coded;
and the label construction module is used for determining the one-dimensional data as a high-dimensional space label corresponding to the row of data to be encoded.
Optionally, the data obtaining module includes:
the acquisition unit is used for acquiring stored high-dimensional data corresponding to the previous time slice;
and the arrangement unit is used for arranging the acquired high-dimensional data stored in each line according to a time sequence to obtain spatial data on a time line as data to be encoded.
Optionally, the condition set determining module includes:
the dividing unit is used for dividing the time condition into a plurality of one-dimensional time sub-conditions according to the time condition included by the one-dimensional query condition and the setting mode of the one-dimensional time label to obtain a one-dimensional time condition set;
the conversion unit is used for converting the high-dimensional query condition into a plurality of one-dimensional data ranges as a high-dimensional space condition set according to the space filling curve coding rule;
and the merging unit is used for carrying out Cartesian product merging on the one-dimensional time condition set and the high-dimensional space condition set to obtain an inquiry condition set.
Optionally, the high-dimensional data query module includes:
the searching unit is used for searching a row label meeting the query condition from the stored row labels of the high-dimensional data as a target label aiming at each query condition in the query condition set;
and the determining unit is used for determining the stored high-dimensional data corresponding to the target label as the target high-dimensional data meeting the query condition set.
Optionally, the apparatus further comprises:
and the removing module is used for filtering the query result based on the spatial condition, removing the query result which is not in the range represented by the spatial condition and obtaining a final query result.
In a third aspect, an embodiment of the present invention provides a server, including a processor, a communication interface, a memory, and a communication bus, where the processor and the communication interface complete communication between the memory and the processor through the communication bus;
a memory for storing a computer program;
a processor adapted to perform the method steps of any of the above first aspects when executing a program stored in the memory.
In a fourth aspect, the present invention provides a computer-readable storage medium, in which a computer program is stored, and the computer program, when executed by a processor, implements the method steps of any one of the above first aspects.
The embodiment of the invention has the following beneficial effects:
in the scheme provided by the embodiment of the invention, a server can obtain a data query request, wherein the data query request comprises a one-dimensional query condition and a high-dimensional query condition, the one-dimensional query condition comprises a time condition, the high-dimensional query condition comprises a space condition, a query condition set consisting of the time condition and the space condition is determined based on the one-dimensional query condition and the high-dimensional query condition, and target high-dimensional data meeting the query condition set is determined as a query result according to a row tag of stored high-dimensional data, wherein the high-dimensional data comprises various rows of spatial data arranged according to a time sequence, each row of spatial data is provided with a row tag, the row tag comprises a one-dimensional time tag and a high-dimensional spatial tag, and the high-dimensional spatial tag is one-dimensional data and is used for identifying the spatial data stored in the row. Because the high-dimensional space tag is one-dimensional data capable of identifying the row of stored space data, the effect of reducing the dimension of the high-dimensional space data into one-dimensional data is realized, and then the server can determine target high-dimensional data meeting one-dimensional query conditions and high-dimensional query conditions according to the row tag of the stored high-dimensional data, namely the one-dimensional data, rather than querying the target high-dimensional data by a one-to-one comparison mode or an R tree index with a complex process, so that the query efficiency of the high-dimensional data can be greatly improved. Of course, not all of the advantages described above need to be achieved at the same time in the practice of any one product or method of the invention.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described 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 that other embodiments can be obtained by using the drawings without creative efforts.
FIG. 1 is a flowchart of a data query method according to an embodiment of the present invention;
FIG. 2 is another flow chart of a data query according to an embodiment of the present invention;
FIG. 3 is a specific flowchart based on step S201 in the embodiment shown in FIG. 2;
FIG. 4 is a specific flowchart based on step S102 in the embodiment shown in FIG. 1;
FIG. 5 is a specific flowchart based on step S103 in the embodiment shown in FIG. 1;
FIG. 6 is a schematic structural diagram of a data query device according to an embodiment of the present invention;
FIG. 7 is a schematic structural diagram of a data query device according to the embodiment shown in FIG. 6;
FIG. 8 is a schematic structural diagram of a data query device according to the embodiment shown in FIG. 6;
fig. 9 is a schematic structural diagram of a server according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived from the embodiments given herein by one of ordinary skill in the art, are within the scope of the invention.
In order to improve the query efficiency of high-dimensional data, embodiments of the present invention provide a data query method, apparatus, server, computer-readable storage medium, and computer program product. First, a data query method provided by an embodiment of the present invention is described below.
The data query method provided by the embodiment of the invention can be applied to a server of a time sequence database. For convenience of understanding, a manner of storing data in the time sequence database is first described, the time sequence database stores a plurality of rows of data, each row of data has a row tag, the row tag at least comprises a time tag, each row of data generally comprises data in a time slice with the time tag as a starting point, and the data are arranged according to a time sequence. For example, for a vehicle with a license plate number of Zhe A125XX and a white color, the location information of the vehicle is obtained every other minute within ten minutes of the time slice, and the time sequence database stores the data as shown in the following table:
Figure BDA0003262517820000061
wherein 1576119600 is the time stamp corresponding to the starting time point of the time slice, plateon 125XX is the license plate number, color 1 indicates that the color of the vehicle is white, and the three form a row label. Data corresponding to each time point in the row: the Point (12030) and the Point (12130) … Point (13530) are the position information of the vehicle at the corresponding time Point.
A data query method provided by an embodiment of the present invention is introduced based on the time sequence database. As shown in FIG. 1, a data query method is applied to a server of a time sequence database, and the method comprises the following steps
S101, acquiring a data query request;
the data query request comprises a one-dimensional query condition and a high-dimensional query condition, wherein the one-dimensional query condition comprises a time condition, and the high-dimensional query condition comprises a space condition.
S102, determining a query condition set composed of the time condition and the space condition based on the one-dimensional query condition and the high-dimensional query condition;
s103, determining target high-dimensional data meeting the query condition set according to the line label of the stored high-dimensional data as a query result;
the high-dimensional data comprises spatial data of each line arranged according to a time sequence, each line of spatial data is provided with a line label, each line label comprises a one-dimensional time label and a high-dimensional space label, and the high-dimensional space label is one-dimensional data and is used for identifying the stored spatial data of the line.
It can be seen that in the scheme provided in the embodiment of the present invention, a server may obtain a data query request, where the data query request includes a one-dimensional query condition and a high-dimensional query condition, the one-dimensional query condition includes a time condition, the high-dimensional query condition includes a space condition, a query condition set composed of the time condition and the space condition is determined based on the one-dimensional query condition and the high-dimensional query condition, and target high-dimensional data satisfying the query condition set is determined as a query result according to a row tag of stored high-dimensional data, where the high-dimensional data includes row spatial data arranged in a time sequence, each row spatial data has a row tag, the row tag includes a one-dimensional time tag and a high-dimensional spatial tag, and the high-dimensional spatial tag is one-dimensional data and is used to identify the row of stored spatial data. Because the high-dimensional space tag is one-dimensional data capable of identifying the row of stored space data, the effect of reducing the dimension of the high-dimensional space data into one-dimensional data is realized, and then the server can determine target high-dimensional data meeting one-dimensional query conditions and high-dimensional query conditions according to the row tag of the stored high-dimensional data, namely the one-dimensional data, rather than querying the target high-dimensional data by a one-to-one comparison mode or an R tree index with a complex process, so that the query efficiency of the high-dimensional data can be greatly improved.
When a user wants to perform a high-dimensional data query, the user may issue a data query request, for example, a query condition corresponding to the high-dimensional data that the user wants to query may be input in a data query interface of the server to issue the data query request. Then, in step S101, the server may obtain the data query request, which generally includes a one-dimensional query condition and a high-dimensional query condition because the data to be queried is high-dimensional data.
The one-dimensional query condition represents a one-dimensional condition that the high-dimensional data to be queried needs to satisfy, and may include a time condition and some identification information corresponding to the high-dimensional data, for example, for a query scene of a geographic location of a vehicle, the one-dimensional query condition may include a time range to be queried, a color of the vehicle, a license plate number, and the like. The high-dimensional query condition represents a high-dimensional condition that needs to be satisfied by the high-dimensional data to be queried, and may include a spatial condition, which may be, for example, a geographical location range, a spatial range, and the like, and is not specifically limited herein.
For example, the high-dimensional data indicated by the data query request is that the vehicle is white in color, and 10 nights are 12 months and 15 months in 2020: 00-11: 00, the traveling position data of the vehicle in the rectangular areas having diagonal points a (15.36471, 50.65736) and B (20.15378, 62.53724), then based on the data query request, it can be determined that the one-dimensional query condition is that the license plate is white in color and the time is 10 in 12-15-th evening in 2020: 00-11: 00, the high-dimensional query condition is a rectangular region with diagonal points of A (15.36471, 50.65736) and B (20.15378, 62.53724). Wherein, 12 months in 2020, 15 days in evening 10: 00-11: 00 is the time condition, and the rectangular regions with diagonal points of A (15.36471, 50.65736) and B (20.15378, 62.53724) are the space conditions.
After obtaining the one-dimensional query condition and the high-dimensional query condition, the server may execute step S102, that is, determine a query condition set composed of the time condition and the space condition based on the one-dimensional query condition and the high-dimensional query condition.
In an implementation manner, the server may divide the one-dimensional query conditions according to a preset division rule, form a set with the divided one-dimensional query sub-conditions, perform dimension reduction on the high-dimensional query conditions according to a preset dimension reduction rule to obtain corresponding one-dimensional data, and further form a set with the one-dimensional query sub-conditions and form a query condition set with the one-dimensional data.
The preset division rule can be division according to time, the preset dimension reduction rule can be a space filling curve coding rule, a space filling curve is an important approximate representation method, a data space is divided into grids with the same size, the grids are coded according to a certain method, each grid corresponds to a unique code, the space proximity is kept to a certain extent, namely the codes corresponding to the adjacent grids are also adjacent, and the purpose that a space object is composed of a group of grids is achieved. This allows the high dimensional data to be represented as one dimensional data in a reduced dimension.
For example, the server may divide the one-dimensional query condition into a plurality of one-dimensional query sub-conditions according to a preset time range, and the plurality of one-dimensional query sub-conditions form a set a. For the high-dimensional query condition, the dimension reduction processing can be performed according to the space filling curve coding rule to obtain a plurality of corresponding codes, and the plurality of codes form another set B. Further, the set A and the set B can form a query condition set.
After the query condition set is determined, the server may execute step S103, that is, the target high-dimensional data meeting the query condition set is determined according to the row tags of the stored high-dimensional data, as a query result, where the high-dimensional data includes row spatial data arranged in a time sequence, each row spatial data has a row tag, and the row tags of the stored high-dimensional data may include a one-dimensional time tag and a high-dimensional space tag, and may further include tags capable of identifying one-dimensional features of the corresponding spatial data, for example, a license plate color, a license plate number, and the like, which are not specifically limited herein.
The high-dimensional space tag is one-dimensional data for identifying the row of stored space data. In one embodiment, the high-dimensional space tag may be one-dimensional data obtained by performing dimension reduction on the line of stored space data, and in another embodiment, the high-dimensional space tag may be an identifier of one-dimensional data obtained by performing dimension reduction on the line of stored space data, which is reasonable.
In this way, the high-dimensional space tag is one-dimensional data, but it may represent the stored space data of the row, and when a high-dimensional data query is performed, the server may determine whether the row space data satisfies the high-dimensional query condition in the query condition set based on the high-dimensional space tag. The one-dimensional label based on the spatial data can determine whether the one-dimensional label meets the one-dimensional query condition in the query condition set, so that the target high-dimensional data meeting the high-dimensional query condition and the one-dimensional query condition at the same time can be queried, and the query of the high-dimensional data is completed as a query result.
In the embodiment provided by the embodiment of the invention, because the high-dimensional space tag is one-dimensional data, the high-dimensional space tag can be used for identifying the stored high-dimensional data of the row, and the effect of reducing the dimension of the high-dimensional space data into the one-dimensional data is realized, further, the server can determine the target high-dimensional data meeting the one-dimensional query condition and the high-dimensional query condition according to the row tag of the stored high-dimensional data, namely the one-dimensional data, instead of querying the target high-dimensional data through a one-to-one comparison mode or an R tree index with a complex process, and the query efficiency of the high-dimensional data can be greatly improved.
As an implementation manner of the embodiment of the present invention, as shown in fig. 2, the determining manner of the high-dimensional space tag may include:
s201, acquiring stored high-dimensional data corresponding to a previous time slice as data to be encoded;
in the process of storing the high-dimensional data, the server can construct a high-dimensional space tag of the stored high-dimensional data in order to facilitate subsequent data query operations. The server may obtain stored high-dimensional data corresponding to a previous time slice as data to be encoded, where the time slice is a time slice determined according to a preset division manner, and one time slice may be ten minutes, one hour, one day, and the like, which is not limited specifically herein.
The stored high-dimensional data corresponding to the previous time slice is the stored high-dimensional data corresponding to the time slice before the current time. That is to say, after the high-dimensional data of each time slice is stored, that is, after each line of spatial data is stored, the server may construct a high-dimensional spatial tag for each line of spatial data corresponding to the time slice, so that each high-dimensional spatial tag may be used to identify a line of spatial data corresponding to the time slice.
For example, the time slices are divided by one hour for one time slice, and if the current time is 2019-12-1212: 05:00, the server may obtain the spatial data stored in the OpenTSDB time series database of the HBase in the time range of 2019-12-1211: 00:00-12:00:00 as the data to be encoded.
S202, coding each row of data to be coded according to a preset space filling curve coding rule to obtain one-dimensional data corresponding to the row of data to be coded;
after the data to be encoded is obtained, because the space filling curve can represent the high-dimensional space data in a dimensionality reduction manner as one-dimensional data, the server can encode each row of data to be encoded according to a preset space filling curve encoding rule to obtain the one-dimensional data corresponding to the row of data to be encoded. The preset space filling curve coding rule may be Xz-ordering curve coding, Z-ordering coding, morton coding, hilbert coding, gray coding, and the like, and is not limited herein.
S203, determining the one-dimensional data as a high-dimensional space tag corresponding to the row of data to be encoded.
After the one-dimensional data corresponding to the row of data to be encoded is obtained, the server may determine the one-dimensional data as the high-dimensional spatial tag corresponding to the row of data to be encoded. For example, if the server encodes a certain row of data to be encoded according to the Xz-ordering curve to obtain 53698710 as one-dimensional data, 53698710 may be determined as the high-dimensional spatial tag corresponding to the row of data to be encoded.
After obtaining the high-dimensional space tag, the server may add the high-dimensional space tag to the one-dimensional line tag corresponding to the line space data, and form the line tag of the line space data together with the one-dimensional time tag and other one-dimensional information of the line space tag. In order to reduce the occupation of the storage space, the server may also delete the stored high-dimensional data corresponding to the last acquired time slice.
For example, for an OpenTSDB time-series database based on HBase, a time slice is divided into time slices according to one hour, and a server may obtain stored high-dimensional data corresponding to the previous hour as data to be encoded. The stored high-dimensional data can be position coordinates of a vehicle, the OpenTSDB metric value only supports numerical values, in order to obtain the stored high-dimensional data corresponding to the previous time slice, the OpenTSDB can be modified to support the character string metric value, and the position coordinates can be represented in a WKT (Well-known text) mode, wherein the WKT is a text markup language and is used for representing conversion among a vector geometric object, a spatial reference system and a spatial reference system.
The server can encode each row of data to be encoded by adopting Xz-ordering curve encoding to obtain corresponding one-dimensional data, namely encode the position coordinates of the vehicle within the hour to obtain corresponding one-dimensional data, and the one-dimensional data is used as the high-dimensional space tag corresponding to the row of data to be encoded. After obtaining the high-dimensional space tag, the server may add the high-dimensional space tag to an existing one-dimensional line tag of the line of data to be encoded, to obtain a line tag of the line space data.
For example, the stored high-dimensional data is stored in a manner that each row corresponds to spatial data of a time slice, and the row label (RowKey) includes a one-dimensional time label corresponding to the row spatial data, specifically, a starting time point of the time slice, and further includes an index attribute, a license plate color, and a license plate number, for example, as shown in the following table.
RowKey
Local |1576119600| color ═ 1| plateau ═ Zhe A123XX
Here, Local is an index attribute, 1576119600 is a timestamp corresponding to the start time point of the time slice, color 1 indicates that the license plate color is white, and plateon 123XX indicates the license plate number. Then the server may add the high-dimensional space tag to the existing line tag of the line space data, and the line tag added to obtain the line space data is as shown in the following table:
RowKey
local |1576119600| color ═ 1| xzcode | -place no ═ zhe a123XX
And the xzcode is a high-dimensional space tag corresponding to the line space data. The specific adding position of the high-dimensional space tag is not limited, and the high-dimensional space tag can be added to a common one-dimensional tag, for example, the mode with higher data query frequency is based on time + license plate color + space range for query, so that the high-dimensional space tag can be added to the one-dimensional tag after the license plate color is added, and data query is facilitated.
Therefore, in this embodiment, the server may obtain the stored high-dimensional data corresponding to the previous time slice as the data to be encoded, encode each row of data to be encoded according to a preset space filling curve encoding rule to obtain the one-dimensional data corresponding to the row of data to be encoded, and determine the one-dimensional data as the high-dimensional space tag corresponding to the row of data to be encoded, so that the process of generating the high-dimensional space tag is simple and convenient, and the high-dimensional space tag may accurately represent the row of space data, thereby improving the data query efficiency and accuracy.
As an implementation manner of the embodiment of the present invention, as shown in fig. 3, the step of acquiring stored high-dimensional data corresponding to a previous time slice as data to be encoded may include:
s301, acquiring stored high-dimensional data corresponding to the previous time slice;
s302, arranging the acquired high-dimensional data stored in each row according to a time sequence to obtain spatial data on a time line as data to be encoded.
The stored high-dimensional data corresponding to the previous time slice comprises spatial data corresponding to a plurality of time points in the time slice, and the spatial data on a line or a plane can be encoded by using a space filling curve encoding rule, so that the corresponding one-dimensional data is obtained by dimension reduction. Therefore, the server can acquire the stored high-dimensional data corresponding to the previous time slice, scan the acquired stored spatial data of the row, and determine the spatial data corresponding to each time point in the spatial data of the row.
And further, arranging the stored high-dimensional data in each row according to a time sequence to obtain spatial data on a line or a plane corresponding to a time line as data to be encoded, where the time sequence may be from early to late or from late to early, and is not specifically limited herein.
For example, the stored high-dimensional data corresponding to the last time slice obtained by the server is shown in the following table:
Figure BDA0003262517820000121
the server may arrange the acquired stored high-dimensional data of the line in order from morning to evening to obtain spatial data on a timeline as the data to be encoded of the line, which is shown in the following table.
Figure BDA0003262517820000131
It can be seen that the spatial data on the timeline form spatial data on the surface, and the server can encode the spatial data on the surface according to a preset space filling curve encoding rule to obtain corresponding one-dimensional data.
As can be seen, in this embodiment, the server may obtain the stored high-dimensional data corresponding to the previous time slice, and arrange each row of the obtained stored high-dimensional data according to the time sequence to obtain the spatial data on a timeline as the data to be encoded. Therefore, the spatial data on the line or the plane can be obtained, and the spatial index is conveniently constructed, namely the high-dimensional spatial label is established.
As an implementation manner of the embodiment of the present invention, as shown in fig. 4, the step of determining the query condition set composed of the time condition and the space condition based on the one-dimensional query condition and the high-dimensional query condition may include:
s401, dividing the time condition into a plurality of one-dimensional time sub-conditions according to time according to the time condition included by the one-dimensional query condition and the setting mode of the time label in the one-dimensional time label to obtain a one-dimensional time condition set;
since the setting modes of the one-dimensional time tags in the row tags of different high-dimensional data may be different, in order to accurately determine the one-dimensional time condition set, the server may divide the time condition into a plurality of one-dimensional time sub-conditions according to the time condition included in the one-dimensional query condition and the setting mode of the one-dimensional time tag, so as to obtain the one-dimensional time condition set. The time condition included in each one-dimensional time sub-condition is different, and other conditions may be the same.
In one embodiment, since the one-dimensional time tag generally corresponds to a division manner of the time slice, for example, the one-dimensional time tag may be a time stamp of a starting time point of the corresponding time slice, the server may divide the time condition into a plurality of one-dimensional time sub-conditions according to the division manner of the time slice of the high-dimensional data.
For example, for the OpenTSDB time series database based on HBase, the query condition is BBOX (120.223, 30215179; 120.323, 30.31533), color is 1, and the query time is 2019-12-1310:00: 00-2019-12-1312: 00: 00. Among them, BBOX (120.223, 30215179; 120.323, 30.31533) is a high-dimensional query condition, and represents rectangular regions with diagonal point coordinates of (120.223, 30215179) and (120.323, 30.31533), and color ═ 1 represents that the license plate color is white.
If the setting mode of the one-dimensional time tag of the stored high-dimensional data is the time stamp of the starting time point of the time slice, the time slice is divided into one hour and one time slice. The query time 2019-12-1310:00: 00-2019-12-1312: 00:00 comprises two time slices, one time slice with the starting time point of 2019-12-1310:00:00 and the duration of one hour, and the other time slice with the starting time point of 2019-12-1311:00:00 and the duration of one hour.
The server may divide the one-dimensional query condition into two one-dimensional time sub-conditions according to the starting time points of the two time slices, that is, Local | 2019-12-1310:00:00 | color ═ 1 and Local |2019-12-1311:00:00| color ═ 1, and the two one-dimensional time sub-conditions constitute a one-dimensional time condition set a.
S402, converting the high-dimensional query condition into a plurality of one-dimensional data ranges as a high-dimensional space condition set according to the space filling curve coding rule;
since one-dimensional data is obtained by performing dimensionality reduction processing on high-dimensional data on a timeline corresponding to a certain target, one-dimensional data can identify the high-dimensional data on the timeline corresponding to the target, namely, a line of spatial data on the timeline. However, the high-dimensional query condition often corresponds to multi-line spatial data of a plurality of targets in a period of time, so that a plurality of one-dimensional data ranges are often obtained when the high-dimensional query condition is converted into one-dimensional data according to a space filling curve coding rule.
The server converts the high-dimensional query condition into a plurality of one-dimensional data ranges according to a space filling curve coding rule, and then the plurality of one-dimensional data ranges can be used as a high-dimensional space condition set. The specific number of the one-dimensional data ranges is determined by the space filling curve encoding rule and the size of the query range corresponding to the high-dimensional query condition, and is not specifically limited herein.
For example, the server converts the high-dimensional query condition into one-dimensional data according to the xz encoding rule to obtain two one-dimensional data ranges, which are [1234111 + 1234222] and [1234888 + 1234999], respectively, and then [1234111 + 1234222] and [1234888 + 1234999] constitute the high-dimensional space condition set B.
And S403, carrying out Cartesian product combination on the one-dimensional time condition set and the high-dimensional space condition set to obtain a query condition set.
Because the query result needs to satisfy the one-dimensional time condition set and the high-dimensional space condition set at the same time, and Cartesian products (also called direct products) of the two sets X and Y, which are denoted as X × Y, the first object is a member of the set X, and the second object is a member of all possible ordered pairs of the set Y, the Cartesian products of the two sets can represent the merged result of the two sets, so the server can merge the one-dimensional time condition set and the high-dimensional space condition set to obtain the query condition set composed of the time condition and the space condition.
For example, if the one-dimensional set of time conditions is Local | 2019-12-1310:00:00 | color ═ 1, Local |2019-12-1311:00:00| color ═ 1; the high dimensional space condition sets are [1234111 + 1234222], [1234888 + 1234999], then the server performs cartesian product merging on the two sets to obtain the query condition set as shown in the following table:
Figure BDA0003262517820000151
the StartKey represents a start label of a corresponding query condition, the EndKey represents an end label of a corresponding query condition range, each pair of StartKey and EndKey identifies one query condition, 4 query conditions are obtained in total, each query condition corresponds to one query range, and the 4 query conditions form a query condition set.
As can be seen, in this embodiment, the server may divide the time condition into a plurality of one-dimensional time sub-conditions according to time according to the time condition included in the one-dimensional time condition and the setting mode of the one-dimensional time tag to obtain a one-dimensional time condition set, convert the high-dimensional query condition into a plurality of one-dimensional data ranges according to a space filling curve coding rule to serve as a high-dimensional space condition set, and perform cartesian product merging on the one-dimensional time condition set and the high-dimensional space condition set to obtain a query condition set. Therefore, an accurate query condition set can be obtained, and the data query efficiency and accuracy can be further improved.
As an implementation manner of the embodiment of the present invention, as shown in fig. 5, the step of determining, according to the row tag of the stored high-dimensional data, the target high-dimensional data that satisfies the query condition set may include:
s501, aiming at each query condition in the query condition set, searching a row label meeting the query condition from the stored row labels of the high-dimensional data to serve as a target label;
the server may, for each query condition in the set of query conditions, look up a row tag that satisfies the query condition from the row tags of the stored high-dimensional data. The row tags of the stored high-dimensional data comprise one-dimensional time tags and high-dimensional space tags, and each query condition can identify the range of the one-dimensional time tags and the high-dimensional space tags, so that the server can search the row tags belonging to the range from the row tags of the stored high-dimensional data, namely the row tags are target tags.
For example, for the query condition 1, its StartKey is Local | 2019-12-1310:00:00 | color ═ 1|1234111, and its EndKey is Local | 2019-12-1310:00:00 | color ═ 1|1234222, and the query range is represented as: the one-dimensional label is Local | 2019-12-1310:00:00 | color ═ 1, and the high-dimensional space label is from 12341111234222. The server may find a line tag from Local | 2019-12-1310:00:00 | color ═ 1|1234111 to Local | 2019-12-1310:00:00 | color ═ 1|1234222 from the line tags of the stored high-dimensional data as a target tag.
S502, determining the stored high-dimensional data corresponding to the target label as the target high-dimensional data meeting the query condition set.
After the server obtains the target tag, the server may determine the stored high-dimensional data corresponding to the target tag as the target high-dimensional data satisfying the query condition set. For example, for the above 4 query conditions, the server may query target tags that satisfy the 4 query conditions, and determine stored high-dimensional data corresponding to all the target tags as target high-dimensional data.
As can be seen, in this embodiment, the server may search, for each query condition in the query condition set, a row tag that meets the query condition from row tags of stored high-dimensional data, and determine, as a target tag, the stored high-dimensional data corresponding to the target tag as the target high-dimensional data that meets the query condition set. Therefore, the server can obtain the target high-dimensional data meeting the query condition set, can quickly and accurately find the target high-dimensional data meeting the query condition set, and improves the data query efficiency.
As an implementation manner of the embodiment of the present invention, the method may further include:
and filtering the query result based on the spatial condition, and removing the query result which is not in the range represented by the spatial condition to obtain a final query result.
The spatial data corresponding to the high-dimensional spatial label determined by the space filling curve coding rule is spatial data of a plurality of time points within a period of time, that is, one high-dimensional spatial label corresponds to spatial data of a plurality of time points. Since in some cases the range of spatial data indicated by the query condition set may not exactly coincide with the range of spatial data corresponding to one or more high-dimensional spatial labels, it may result in spatial data that is not within the range of high-dimensional query conditions being present in the target high-dimensional data determined according to the row labels of the stored high-dimensional data.
For example, for the spatial data shown in the following table, the high-dimensional space tag xzcode1 is used to identify the first row of spatial data within the time slice corresponding to the high-dimensional space tag xzcode2 is used to identify the second row of spatial data within the time slice corresponding to the high-dimensional space tag.
Figure BDA0003262517820000171
When the server queries the target high-dimensional data, the high-dimensional spatial tag xzcode1 may be in the range represented by the query condition set, but part of the spatial data in the first row of spatial data may not be in the range represented by the spatial condition actually.
Therefore, in order to make the query result more accurate, the server may filter the query result based on the spatial condition, and remove the query result that is not within the range represented by the spatial condition, so as to obtain a final query result. In one embodiment, the server may compare the spatial data included in the query result with the range represented by the spatial condition to determine whether the spatial data is within the range represented by the spatial condition, and if the spatial data is not within the range represented by the spatial condition, remove the spatial data, so as to obtain a final query result.
Therefore, in this embodiment, the server may filter the query result based on the spatial condition, remove the query result that is not within the range represented by the spatial condition, and obtain the final query result, so that the final query result is more accurate, and the accuracy of the query result is improved.
Corresponding to the above data query method, an embodiment of the present invention further provides a data query device, and a description is provided below for the data query device provided in the embodiment of the present invention.
As shown in fig. 6, a data query apparatus applied to a server of a time series database, the apparatus includes:
a query request obtaining module 610, configured to obtain a data query request;
the data query request comprises a one-dimensional query condition and a high-dimensional query condition, wherein the one-dimensional query condition comprises a time condition, and the high-dimensional query condition comprises a space condition.
A condition set determining module 620, configured to determine a query condition set composed of the temporal condition and the spatial condition based on the one-dimensional query condition and the high-dimensional query condition;
and the high-dimensional data query module 630 is configured to determine, according to the row label of the stored high-dimensional data, target high-dimensional data that meets the query condition set as a query result.
The high-dimensional data comprises spatial data of each line arranged according to a time sequence, each line of spatial data is provided with a line label, each line label comprises a one-dimensional time label and a high-dimensional space label, and the high-dimensional space label is one-dimensional data and is used for identifying the stored spatial data of the line.
It can be seen that in the scheme provided in the embodiment of the present invention, a server may obtain a data query request, where the data query request includes a one-dimensional query condition and a high-dimensional query condition, the one-dimensional query condition includes a time condition, the high-dimensional query condition includes a space condition, a query condition set composed of the time condition and the space condition is determined based on the one-dimensional query condition and the high-dimensional query condition, and target high-dimensional data satisfying the query condition set is determined as a query result according to a row tag of stored high-dimensional data, where the high-dimensional data includes row spatial data arranged in a time sequence, each row spatial data has a row tag, the row tag includes a one-dimensional time tag and a high-dimensional spatial tag, and the high-dimensional spatial tag is one-dimensional data and is used to identify the row of stored spatial data. Because the high-dimensional space tag is one-dimensional data capable of identifying the row of stored space data, the effect of reducing the dimension of the high-dimensional space data into one-dimensional data is realized, and then the server can determine target high-dimensional data meeting one-dimensional query conditions and high-dimensional query conditions according to the row tag of the stored high-dimensional data, namely the one-dimensional data, rather than querying the target high-dimensional data by a one-to-one comparison mode or an R tree index with a complex process, so that the query efficiency of the high-dimensional data can be greatly improved.
As an implementation manner of the embodiment of the present invention, as shown in fig. 7, the apparatus may further include:
the data obtaining module 640 is configured to obtain stored high-dimensional data corresponding to a previous time slice as data to be coded;
the data encoding module 650 is configured to encode each row of data to be encoded according to a preset space filling curve encoding rule to obtain one-dimensional data corresponding to the row of data to be encoded;
and the tag constructing module 660 is configured to determine the one-dimensional data as a high-dimensional spatial tag corresponding to the row of data to be encoded.
As an implementation manner of the embodiment of the present invention, the data obtaining module 640 may include:
the acquisition unit is used for acquiring stored high-dimensional data corresponding to the previous time slice;
and the arrangement unit is used for arranging the acquired high-dimensional data stored in each line according to a time sequence to obtain spatial data on a time line as data to be encoded.
As an implementation manner of the embodiment of the present invention, the condition set determining module 620 may include:
the dividing unit is used for dividing the time condition into a plurality of one-dimensional time sub-conditions according to the time condition included by the one-dimensional query condition and the setting mode of the one-dimensional time label to obtain a one-dimensional time condition set;
the conversion unit is used for converting the high-dimensional query condition into a plurality of one-dimensional data ranges as a high-dimensional space condition set according to the space filling curve coding rule;
and the merging unit is used for carrying out Cartesian product merging on the one-dimensional time condition set and the high-dimensional space condition set to obtain an inquiry condition set.
As an implementation manner of the embodiment of the present invention, the high-dimensional data query module 630 includes:
the searching unit is used for searching a row label meeting the query condition from the stored row labels of the high-dimensional data as a target label aiming at each query condition in the query condition set;
and the determining unit is used for determining the stored high-dimensional data corresponding to the target label as the target high-dimensional data meeting the query condition set.
As an implementation manner of the embodiment of the present invention, as shown in fig. 8, the apparatus may further include:
a removing module 670, configured to filter the query result based on the spatial condition, and remove the query result that is not within the range represented by the spatial condition, so as to obtain a final query result.
The embodiment of the present invention further provides a server, as shown in fig. 9, including a processor 901, a communication interface 902, a memory 903 and a communication bus 904, where the processor 901, the communication interface 902, and the memory 903 complete mutual communication through the communication bus 904,
a memory 903 for storing computer programs;
the processor 901 is configured to implement a data query method according to any of the above embodiments when executing the program stored in the memory 903.
It can be seen that in the scheme provided in the embodiment of the present invention, a server may obtain a data query request, where the data query request includes a one-dimensional query condition and a high-dimensional query condition, the one-dimensional query condition includes a time condition, the high-dimensional query condition includes a space condition, a query condition set composed of the time condition and the space condition is determined based on the one-dimensional query condition and the high-dimensional query condition, and target high-dimensional data satisfying the query condition set is determined as a query result according to a row tag of stored high-dimensional data, where the high-dimensional data includes row spatial data arranged in a time sequence, each row spatial data has a row tag, the row tag includes a one-dimensional time tag and a high-dimensional spatial tag, and the high-dimensional spatial tag is one-dimensional data and is used to identify the row of stored spatial data. Because the high-dimensional space tag is one-dimensional data capable of identifying the row of stored space data, the effect of reducing the dimension of the high-dimensional space data into one-dimensional data is realized, and then the server can determine target high-dimensional data meeting one-dimensional query conditions and high-dimensional query conditions according to the row tag of the stored high-dimensional data, namely the one-dimensional data, rather than querying the target high-dimensional data by a one-to-one comparison mode or an R tree index with a complex process, so that the query efficiency of the high-dimensional data can be greatly improved.
The communication bus mentioned in the above server may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the server and other devices.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
In another embodiment of the present invention, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of the data query method according to any one of the above embodiments.
In yet another embodiment, the present invention further provides a computer program product containing instructions, which when run on a computer, causes the computer to execute the data query method described in any of the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the method, the apparatus, the server, the computer-readable storage medium and the computer program product, since they are substantially similar to the method embodiments, the description is simple, and the relevant points can be referred to the partial description of the method embodiments.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (14)

1. A data query method, which is applied to a server of a time-series database, the method comprising:
acquiring a data query request, wherein the data query request comprises a one-dimensional query condition and a high-dimensional query condition, the one-dimensional query condition comprises a time condition, and the high-dimensional query condition comprises a space condition;
determining a query condition set composed of the time condition and the space condition based on the one-dimensional query condition and the high-dimensional query condition;
and determining target high-dimensional data meeting the query condition set as a query result according to the line tag of the stored high-dimensional data, wherein the high-dimensional data comprises spatial data of each line arranged according to a time sequence, each line of spatial data is provided with a line tag, the line tag comprises a one-dimensional time tag and a high-dimensional space tag, and the high-dimensional space tag is one-dimensional data and is used for identifying the stored spatial data of the line.
2. The method of claim 1, wherein the determining the high-dimensional spatial label comprises:
acquiring stored high-dimensional data corresponding to the previous time slice as data to be encoded;
coding each row of data to be coded according to a preset space filling curve coding rule to obtain one-dimensional data corresponding to the row of data to be coded;
and determining the one-dimensional data as a high-dimensional space tag corresponding to the row of data to be encoded.
3. The method according to claim 2, wherein the step of obtaining the stored high-dimensional data corresponding to the previous time slice as the data to be encoded comprises:
acquiring stored high-dimensional data corresponding to the previous time slice;
and arranging the acquired high-dimensional data stored in each line according to a time sequence to obtain spatial data on a time line as data to be encoded.
4. The method of claim 2, wherein the step of determining the set of query conditions consisting of the temporal condition and the spatial condition based on the one-dimensional query condition and the high-dimensional query condition comprises:
dividing the time condition into a plurality of one-dimensional time sub-conditions according to time according to the time condition included by the one-dimensional query condition and the setting mode of the one-dimensional time tag to obtain a one-dimensional time condition set;
converting the high-dimensional query condition into a plurality of one-dimensional data ranges as a high-dimensional space condition set according to the space filling curve coding rule;
and carrying out Cartesian product combination on the one-dimensional time condition set and the high-dimensional space condition set to obtain a query condition set.
5. The method according to claim 1, wherein the step of determining the target high-dimensional data satisfying the query condition set according to the row tag of the stored high-dimensional data comprises:
aiming at each query condition in the query condition set, searching a row label meeting the query condition from the row labels of the stored high-dimensional data to serve as a target label;
and determining the stored high-dimensional data corresponding to the target label as the target high-dimensional data meeting the query condition set.
6. The method according to any one of claims 1-5, further comprising:
and filtering the query result based on the spatial condition, and removing the query result which is not in the range represented by the spatial condition to obtain a final query result.
7. A data query apparatus, applied to a server of a time-series database, the apparatus comprising:
the query request acquisition module is used for acquiring a data query request, wherein the data query request comprises a one-dimensional query condition and a high-dimensional query condition, the one-dimensional query condition comprises a time condition, and the high-dimensional query condition comprises a space condition;
a condition set determining module, configured to determine a query condition set composed of the time condition and the space condition based on the one-dimensional query condition and the high-dimensional query condition;
and the high-dimensional data query module is used for determining target high-dimensional data meeting the query condition set as a query result according to the row label of the stored high-dimensional data, wherein the high-dimensional data comprises spatial data of rows arranged according to a time sequence, each row of spatial data is provided with a row label, each row label comprises a one-dimensional time label and a high-dimensional space label, and the high-dimensional space label is one-dimensional data and is used for identifying the stored spatial data of the row.
8. The apparatus of claim 7, further comprising:
the data acquisition module is used for acquiring stored high-dimensional data corresponding to the previous time slice as data to be encoded;
the data coding module is used for coding each row of data to be coded according to a preset space filling curve coding rule to obtain one-dimensional data corresponding to the row of data to be coded;
and the label construction module is used for determining the one-dimensional data as a high-dimensional space label corresponding to the row of data to be encoded.
9. The apparatus of claim 8, wherein the data acquisition module comprises:
the acquisition unit is used for acquiring stored high-dimensional data corresponding to the previous time slice;
and the arrangement unit is used for arranging the acquired high-dimensional data stored in each line according to a time sequence to obtain spatial data on a time line as data to be encoded.
10. The apparatus of claim 8, wherein the condition set determination module comprises:
the dividing unit is used for dividing the time condition into a plurality of one-dimensional time sub-conditions according to the time condition included by the one-dimensional query condition and the setting mode of the one-dimensional time label to obtain a one-dimensional time condition set;
the conversion unit is used for converting the high-dimensional query condition into a plurality of one-dimensional data ranges as a high-dimensional space condition set according to the space filling curve coding rule;
and the merging unit is used for carrying out Cartesian product merging on the one-dimensional time condition set and the high-dimensional space condition set to obtain an inquiry condition set.
11. The apparatus of claim 7, wherein the high-dimensional data query module comprises:
the searching unit is used for searching a row label meeting the query condition from the stored row labels of the high-dimensional data as a target label aiming at each query condition in the query condition set;
and the determining unit is used for determining the stored high-dimensional data corresponding to the target label as the target high-dimensional data meeting the query condition set.
12. The apparatus according to any one of claims 7-11, further comprising:
and the removing module is used for filtering the query result based on the spatial condition, removing the query result which is not in the range represented by the spatial condition and obtaining a final query result.
13. A server is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing the communication between the processor and the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1-6 when executing a program stored in the memory.
14. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of claims 1 to 6.
CN202111076751.8A 2021-09-14 2021-09-14 Data query method, device, server and storage medium Pending CN113779428A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111076751.8A CN113779428A (en) 2021-09-14 2021-09-14 Data query method, device, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111076751.8A CN113779428A (en) 2021-09-14 2021-09-14 Data query method, device, server and storage medium

Publications (1)

Publication Number Publication Date
CN113779428A true CN113779428A (en) 2021-12-10

Family

ID=78843844

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111076751.8A Pending CN113779428A (en) 2021-09-14 2021-09-14 Data query method, device, server and storage medium

Country Status (1)

Country Link
CN (1) CN113779428A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130225201A1 (en) * 2012-02-29 2013-08-29 Aeris Communications System and method for large-scale and near-real-time search of mobile device locations in arbitrary geographical boundaries
CN103514243A (en) * 2012-06-18 2014-01-15 株式会社日立制作所 Spatio-temporal data management system, spatio-temporal data management method, and program thereof
CN113051264A (en) * 2019-12-26 2021-06-29 阿里巴巴集团控股有限公司 Data storage and query method and device, electronic equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130225201A1 (en) * 2012-02-29 2013-08-29 Aeris Communications System and method for large-scale and near-real-time search of mobile device locations in arbitrary geographical boundaries
CN103514243A (en) * 2012-06-18 2014-01-15 株式会社日立制作所 Spatio-temporal data management system, spatio-temporal data management method, and program thereof
CN113051264A (en) * 2019-12-26 2021-06-29 阿里巴巴集团控股有限公司 Data storage and query method and device, electronic equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
侯海耀;钱育蓉;英昌甜;张晗;卢学远;赵D;: "基于Hilbert-R树分级索引的时空查询算法", 计算机应用, no. 10 *

Similar Documents

Publication Publication Date Title
US9098591B2 (en) Spatio-temporal data management system, spatio-temporal data management method, and machine-readable storage medium thereof
CN108932236B (en) File management method and device
CN106528787B (en) query method and device based on multidimensional analysis of mass data
US8924373B2 (en) Query plans with parameter markers in place of object identifiers
CN108958959B (en) Method and device for detecting hive data table
US20220156255A1 (en) System and method for subset searching and associated search operators
CN109815240B (en) Method, apparatus, device and storage medium for managing index
CN114461603A (en) Multi-source heterogeneous data fusion method and device
CN113094340A (en) Data query method, device and equipment based on Hudi and storage medium
CN112883125A (en) Entity data processing method, device, equipment and storage medium
CN115145871A (en) File query method and device and electronic equipment
CN111258819A (en) Data acquisition method, device and system for MySQL database backup file
CN111090669A (en) Data query method and device based on space-time collision
CN113722600A (en) Data query method, device, equipment and product applied to big data
Shen et al. A Generic Framework for Top-${\schmi k} $ Pairs and Top-${\schmi k} $ Objects Queries over Sliding Windows
CN113779428A (en) Data query method, device, server and storage medium
CN113722415B (en) Point cloud data processing method and device, electronic equipment and storage medium
US20190012361A1 (en) Highly atomized segmented and interrogatable data systems (hasids)
CN114510480A (en) Method and device for querying data
CN113934729A (en) Data management method based on knowledge graph, related equipment and medium
CN110928868B (en) Vehicle data retrieval method, device and computer readable storage medium
CN112685572A (en) Heterogeneous data fusion method and device based on federal calculation
CN110866005A (en) Internet of things data acquisition management method and system, storage medium and terminal
CN114579573B (en) Information retrieval method, information retrieval device, electronic equipment and storage medium
Coşkun et al. Performance matters on identification of origin-destination matrix on big geospatial 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