Spatial Search Using a Key-Value Repository
By using spatial indexing and sliding window technology in key-value repository, the problem of inefficiency in large-scale geometric storage and search space division is solved, and efficient spatial search and geofencing services are achieved.
Patent Information
- Application Number
- CN202180044307.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2020-06-30
- Filing Date
- 2021-06-29
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2041-06-29
AI Technical Summary
现有技术难以高效处理大规模几何存储和搜索空间的划分,尤其是在地理围栏和邻近搜索中,传统方法效率低下。
The key-value repository combined with spatial indexing technology is used to decompose the geometric shape into spatial cells through spatial filling curves, and iterative query is used to use sliding window technology to achieve efficient spatial search.
Improves the efficiency and accuracy of spatial search, enables rapid identification of spatial cells intersecting geometry, and supports large-scale geofencing and proximity search.
Smart Images

Figure CN115918110B_ABST
Abstract
Description
BACKGROUND OF THE INVENTION
[0001] As location-based capabilities associated with mobile computing devices, such as geofencing, become increasingly popular, spatial search is becoming more important. Consumers can use specified geometries to define virtual geographic boundaries to provide location-based services based on these geometries, including but not limited to geofencing and proximity search. While brute force methods of geometric search may be satisfactory for a small number of defined geometries, there is an increasing need for large-scale geometric storage and partitioning of the search space. BRIEF DESCRIPTION OF THE DRAWINGS
[0002] Figure 1 Illustrates an exemplary system environment in which a spatial search can be performed using a key-value repository, according to at least some embodiments.
[0003] Figure 2 Illustrates examples of space-filling curves for various orders, according to some embodiments.
[0004] Figure 3 Illustrates the encoding of spatial cells according to a space-filling curve, according to some embodiments.
[0005] Figure 4 Illustrates geometries that are encoded as a set of spatial cells for space-filling curves of different orders, according to some embodiments.
[0006] Figure 5 Is a high-level flowchart for performing a spatial search using a key-value repository, according to some embodiments.
[0007] Figure 6 Illustrates example data representing known geometries in a key-value repository, according to some embodiments.
[0008] Figure 7 Illustrates a series of spatial search ranges for performing a search of a key-value repository to identify spatial cells that intersect a geometry, according to some embodiments.
[0009] Figure 8 Is a high-level flowchart for querying a key-value repository to identify spatial cells that intersect a geometry, according to at least some embodiments.
[0010] Figure 9 Is a block diagram illustrating an example provider network for a geofencing service that provides a spatial search using a non-relational database service, according to some embodiments.
[0011] Figure 10 Is a block diagram illustrating an example computing device that can be used in at least some embodiments.
[0012] Although embodiments are described herein by way of example with respect to several embodiments and illustrative figures, those skilled in the art will recognize that the embodiments are not limited to the described embodiments or figures. It should be understood that the figures and the detailed description thereof are not intended to limit the embodiments to the particular forms disclosed, but on the contrary, are expected to cover all modifications, equivalents, and alternatives falling within the spirit and scope described by the appended claims. The headings used herein are for organizational purposes only and are not intended to limit the scope of the description or the claims. As used throughout this application, the word "may" is used in an enabling sense (i.e., meaning having the potential to) rather than a mandatory sense (i.e., meaning must). Similarly, the words "include", "including", and "includes" mean including but not limited to.
[0013] It should be understood that although the terms first, second, etc. may be used herein to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another. For example, without departing from the scope of the present invention, a first contact may be referred to as a second contact, and similarly, a second contact may be referred to as a first contact. The first contact and the second contact are both contacts, but they are not the same contact. Detailed Description
[0014] Describes various techniques for performing a spatial search using a representation of geometries stored in a key-value repository. According to some embodiments, the key-value repository can be used to record a set of predefined geometries, where a geometry can be decomposed into one or more spatial cells represented as a spatial index in the key-value repository. The spatial search process can then use deterministic spatial partitioning to traverse the search space to perform a spatial query. Given the present disclosure, those skilled in the art will appreciate that certain embodiments may be able to achieve a significant improvement in search performance by leveraging the deterministic spatial partitioning implemented in these embodiments.
[0015] Example System Environment
[0016] Figure 1 Illustrates a system environment in which a spatial search can be performed using a key-value repository according to at least some embodiments. In some embodiments, for example, a spatial search system 100 implemented on a computing system 2000 as shown below in Figure 10 may include a spatial search coordinator 110 and an index database 120, each of which may employ a spatial indexer 130 that provides a geometry converter 135.
[0017] In some embodiments, the index database 120 may further employ one or more key-value repositories 125, while in other embodiments, other storage subsystems, such as a relational database system, may be used.
[0018] The spatial search coordinator 110 and the index database 120 can provide services to the client 150 of the spatial search system 100 via one or more programming interfaces 140, such as web-based interfaces, command-line tools, and application programming interfaces.
[0019] In some embodiments, the client 150 can define the geometry data 126 by submitting the client geometry 170 to the index database 120 via the programming interface 140. In some embodiments, the index database 120 can use the spatial indexer 130 and one or more geometry transformers 135 to transform and decompose the client geometry 170 into spatial cells for storage as geometry data 126 in one or more key-value repositories 125. The client can further submit the client search 160 to the spatial search coordinator 110 via the programming interface 140. In some embodiments, these searches can include the definition of a geometry 165 that includes one or more geometric points. In some embodiments, the client search 160 can include additional information, such as an identifier of the client geometry 170.
[0020] Geometry Transformation
[0021] Figure 2 An example of space-filling curves of various classes according to some embodiments is shown. A client of the spatial search system, such as Figure 1 the spatial search system 100 of, can submit geometries, such as Figure 1 the shapes 165 and 170 of, which are encoded as a set of points defined using any one of several coordinate systems. For example, in some embodiments, the Cartesian coordinate system can be used, while in other embodiments, other coordinate systems, such as the polar coordinate system, can be used. Embodiments suitable for global spatial search can employ, for example, latitude and longitude coordinates. Those skilled in the art will understand that these various example coordinate systems are not intended to be limiting, and any number of coordinate systems can be employed. Additionally, while coordinate systems employing two dimensions can be implemented, more than two dimensions can also be used. In some embodiments, different dimensions of different types can be combined. For example, the coordinate system can be, for example, a spatio-temporal coordinate system (e.g., a coordinate system having both spatial and temporal dimensions), which can support spatio-temporal search in some embodiments.
[0022] In embodiments employing multiple dimensions, the coordinate dimensions can be reduced to a single dimension for searching. To achieve this reduction, in some embodiments, space-filling curves such as the Hilbert curve or the z-order curve can be employed. Such space-filling curves define points in a multi-dimensional space as positions along a one-dimensional path that fills the multi-dimensional space. Examples of such paths are shown in Figure 2 .
[0023] In Figure 2 it, a 0-order Hilbert curve (200) defines a path in a two-dimensional space, thereby dividing the space into four quadrants represented by the endpoints and corners of the path. In some embodiments, these four quadrants can be represented by the numbers zero to three.
[0024] Figure 2 Further shown is a 1-order Hilbert curve (210), which defines a path in the same two-dimensional space such that in some embodiments, each of the four quadrants defined by the 0-order Hilbert curve (200) can be further subdivided into four quadrants. Similar to the 0-order Hilbert curve, the sixteen quadrants are represented by the endpoints and corners of the 1-order Hilbert curve path.
[0025] Similarly, Figure 2 also shown are a 2-order Hilbert curve (220) and a 3-order Hilbert curve (230), each of which further subdivides the two-dimensional space into smaller quadrants, thereby generating sixty-four quadrants and two hundred and fifty-six quadrants respectively.
[0026] Figure 3 Illustrated is the encoding of spatial cells according to a space-filling curve according to some embodiments. As discussed in Figure 2 it, a space-filling curve such as a Hilbert curve can divide a two-dimensional space into quadrants. Figure 3 Shown in it is a 2-order Hilbert curve, which can divide a two-dimensional space into sixty-four quadrants.
[0027] In some embodiments, each order of the Hilbert curve can define four quadrants represented by the numbers zero to three, where each subsequent order further subdivides each quadrant. In the example shown in Figure 3 it, the two-dimensional space can thus be represented as a three-digit quaternary number in integer or string form, where the most significant digit represents the quadrant defined by the 0-order curve. As Figure 3 shown, the quadrants of a given order can be assigned increasing numbers, where the upper right quadrant is assigned the value 0, and the corresponding increasing values are assigned to the lower right, lower left, and finally upper left quadrants. Those skilled in the art will understand that such an example assignment is not intended to be restrictive, and any sortable representation of the quadrants can be employed. Additionally, in various embodiments, the assignment of sortable values to the quadrants can be done in a different order.
[0028] For example, in Figure 3The cell index identified therein can be identified as the integer value 203 or the string "203" in base four. This example cell index has quadrants defined by two in the 0th quadrant, zero in the 1st quadrant, and three in the 2nd quadrant. Thus, this cell has an index value of 203 in two-dimensional space. These indexes can further be referred to as quad-key indexes. Those skilled in the art will appreciate that Figure 3 the order in the examples of
[0029] is not intended to be restrictive, and any number of levels can be employed to balance the resolution of the transformation with storage requirements and search efficiency. Figure 2 and Figure 3 In some embodiments suitable for global space searches, latitude and longitude coordinates may be employed. These latitude and longitude coordinates can define positions on the surface of a sphere rather than positions on a two-dimensional plane as discussed above in Figure 3 and
[0030] The quad-key index of Figure 1 can be augmented to support this spherical projection by prefixing a six-valued digit representing the face of the cube in which the point lies.
[0031] Converting geometric shapes into spatial indexes
[0032] Figure 4 shows a geometry of a set of spatial cells encoded as space-filling curves for different levels. The polygon 400 can be represented by a set of spatial cells defining a region of two-dimensional space, where each of the spatial cells is represented by a quad-key index.
[0033] As Figure 4 shown, in some embodiments, the polygon 400 can be represented by spatial cells 410 using a Hilbert curve of up to order 2, while in other embodiments, the same polygon 400 can be represented by spatial cells 420 using a Hilbert curve of up to order 3. Those skilled in the art will appreciate that the set of spatial cells can be represented in a variety of ways. In Figure 3In [the figure], spatial cells 410 and 420 can use potentially the largest spatial cells, for example, represented by spatial cells 410a - 410i and 420a - 420x included in polygon 400 respectively, so as to minimize the number of required cells. As the order in the space - filling curve increases, the number of digits in the resulting four - key index of the member cells can also increase, but the accuracy of the polygon representation can be improved, thus producing a balance among the representation of the geometry, storage requirements, and search performance.
[0034] Example Spatial Search
[0035] Figure 5 is a high - level flowchart for performing a spatial search using a key - value repository according to some embodiments. The process begins at step 500, where a request to determine whether a provided geometry spatially intersects one or more predefined geometries is received, for example, via a client query 160 as shown in Figure 1 [the figure]. In some embodiments, the request may include a geometry that includes one or more points encoded in various ways, for example, as discussed earlier in Figure 4 [the figure].
[0036] The process proceeds to step 510, where one of the multiple points of the provided geometry can be converted into a spatial cell index, for example, as described earlier in Figure 4 [the figure]. In some embodiments, this conversion may involve using a space - filling function such as a Hilbert curve.
[0037] The process then proceeds to step 520, where a database of spatial cells can be queried to identify spatial cells that match one or more of the converted spatial indices, and the spatial cells are included in geometries defined in the database. An example of such a database is the key - value repository 125 as shown in Figure 1 [the figure]. Other details of the database are further discussed in Figure 6 [the figure], and other details of the query are discussed below in Figure 7 and Figure 8 [the figure].
[0038] If the query does not identify intersecting spatial cells, as indicated by the negative exit of step 530, then the process proceeds to step 535, where the process returns an indication of no intersecting geometries. Otherwise, the process proceeds to step 540.
[0039] In step 540, the database can be further queried to determine the geometries defined in the database that are members of the previously identified spatial cells. In some embodiments, a response to the request may then be sent based at least in part on these determined geometries, as shown in step 550.
[0040] Key - Value Repository
[0041] Figure 6 Illustrates instance data representing known geometries in a key - value repository according to some embodiments. In some embodiments, the key - value repository may implement data storage where data values are identified by unique keys. In some of these embodiments, these unique keys may be composite keys that can be subdivided into a separate sort key 610 and a partition key 620. The partition key 620 can be used to store data items in corresponding partitions of the key - value repository, where data items stored on the same partition of the key - value repository can be stored in a sorted order as determined by the sort key 610 of the corresponding data item.
[0042] In some embodiments, the key - value repository may contain cell - prefix records and cell - membership records, indicated as CPR and CMR records respectively in type 600. In some embodiments, for a cell - prefix record (CPR), the partition key 620 can be defined as an individual in the spatial index of the geometry defined in the key - value repository, and according to some embodiments, the sort key 610 may contain an initial number of four - key digits of the corresponding partition key of an individual in the spatial index of the defined geometry. The initial number of four - key digits can be referred to as the cell prefix. In some embodiments, the key - value repository may serve multiple clients. To accommodate multiple clients, the sort key may also be prefixed with a client identifier, as Figure 6 shown in the ClientID portion of the sort key 610 of the CPR record in. This allows different clients 150 of the spatial search system 100 to define private geometries in the key - value repository.
[0043] In some embodiments, for a cell - membership record (CMR), the partition key 620 can be defined as an individual in the spatial index of the geometry defined in the key - value repository, thus matching the partition key 620 of the cell - prefix record, and the sort key 620 can be defined using a unique identifier that includes the specific geometry of the spatial cell, as Figure 6 shown in the GeometryID portion of the sort key 610 of the CMR record in. In embodiments where the key - value repository serves multiple clients, the partition key and sort key of the cell - membership record may also be prefixed with a client identifier, as discussed above for the cell - prefix record.
[0044] Iterative Key - Value Repository Search
[0045] Figure 7 Illustrates a series of spatial search ranges for performing a search on a specific spatial cell on a key - value repository to identify spatial cells that intersect a geometry according to some embodiments. Can be used similar to above Figure 6The index 2 / 221003032030002121102313321322 of the example key-value repository entry shown in identifies a specific spatial cell. In some embodiments, spatial search may implement a sliding window technique to subdivide the search into several iterations. In Figure 7 the example shown in , a two-level fixed window of the sliding window technique is shown, where the two-level fixed window is applied sequentially in a sliding manner to the index to generate a series of search index ranges. The first query may include a range that starts from the entire index of a specific spatial cell, as shown in the start 700 of query 1, and ends at the index of the specific spatial cell minus the number of trailing four-key digits defined by the fixed window, as shown in the end 710 of query 1. Subsequent queries may include ranges that start from the end value of the previous query, and the queries may continue until the end value of the query matches the cell prefix, as described above Figure 6 in .
[0046] Figure 8 is a high-level flowchart for querying a key-value repository to identify spatial cells that intersect a geometry according to at least some embodiments. The process starts at step 810, where one or more indexes of geometries that intersect a known geometry stored in a key-value repository, such as Figure 1 the key-value repository 125 shown in , are searched. In some embodiments, the key-value repository may contain data such as that shown in Figure 6 in , and the process may implement a set of iterative queries as shown in Figure 7 in .
[0047] Initially, the process has identified a list of spatial cells that do not match one or more indexes of the geometry. At step 810, the next index of the one or more indexes is selected, and the start value of the search range of the first query is set to the selected index. The process then proceeds to step 820, where a window, such as Figure 7 the two-level fixed window shown in , is applied to the start value of the range to determine the end value of the range.
[0048] The process then proceeds to step 830, where the key-value repository is queried using the search range to identify cells that have member geometries that intersect the search range. In some embodiments, the identified cells may then be added to the cumulative list of intersecting spatial cells.
[0049] The process then proceeds to step 840, where if necessary, the start value of the next search is set to the end value of the range of the most recently completed search. As shown in step 850, if the end value of the range of the most recently completed search is not equal to the prefix value determined for the selected index, such as Figure 6If the cell prefix value of the partition key 620 is such, then the subsequent process returns to step 820. Otherwise, the search of the current spatial index is completed, and if additional indexes remain, as shown in step 860, then the process returns to step 810. Otherwise, the process is completed and a cumulative list of intersecting spatial cells is provided.
[0050] Exemplary geofencing service
[0051] Figure 9 FIG. is a block diagram of an example provider network that provides a geofencing service that implements a spatial search using a non-relational database service according to some embodiments. In some embodiments, the provider network 900 may be a private or closed system, or may be set up by an entity such as a company or a public sector organization to provide one or more services (such as various types of cloud-based storage devices) that can be accessed via the Internet and / or other networks to clients 970. In some embodiments, the provider network 900 may be implemented in a single location, or may include a number of data centers that host various resource pools, such as a collection of physical and / or virtualized computer servers, storage devices, networking devices, etc. (e.g., the computing system 2000 described below with reference to Figure 10 The components shown in are required to implement and distribute the infrastructure and storage services provided by the provider network 900. In some embodiments, the provider network 900 may implement various computing resources or services, such as a geofencing service 910, a non-database service 930 (e.g., a NoSQL database or other database service that can access a collection of items (e.g., a table containing items) using key values), and other services 940 (e.g., data stream processing services and / or other large-scale data processing techniques), data storage services (e.g., object storage services, block-based storage services, or data storage services that can store different types of data for centralized access), virtual computing services, and / or any other type of network-based service (which may include various other types of storage, processing, analysis, communication, event processing, visualization, and security services).
[0052] In various embodiments, Figure 9 The components shown in can be implemented directly within computer hardware, as instructions that can be directly or indirectly executed by computer hardware (e.g., a microprocessor or a computer system), or implemented using a combination of these techniques. For example, in some embodiments, Figure 9 The components shown in can be implemented by a system that includes several computing nodes (or simply nodes), each of which may be similar to Figure 9The computer system embodiments shown in
[0053] In some embodiments, the geofencing service 910 may provide services to specify, manage, modify, deploy, and / or delete geofences or other virtualized geographic boundaries. The geofencing service 910 may support various types of applications for security, automation, communication, or advertising, as well as other applications. As discussed above with respect to Figure 1 As discussed, spatial searches may be performed relative to the geometry of portions that may be implemented as (or are) geofences. Thus, the various techniques and / or features of the spatial search system 100 discussed above with respect to Figures 1-8 may be implemented as the spatial search feature 920 of the geofencing service 910.
[0054] The geofencing service 910 may utilize other services provided by the provider network 900. For example, the geofencing service 910 may store a spatial index 932 and spatial cells 934 for performing spatial searches as described above with respect to Figures 1-8 in a key-value store that is part of the non-relational database service 930, which may be implemented as discussed below.
[0055] In some embodiments, the non-relational database service 930 may be implemented as various types of distributed database services for storing, accessing, and updating data in tables hosted in a key-value database. Such services may be highly scalable and extensible enterprise-level database systems. In some embodiments, access requests (e.g., requests to get / obtain an item, put / insert an item, delete an item, update or modify an item, scan multiple items) may be directed to tables in the non-relational database service 930 that are distributed across multiple physical resources, and the database system may be scaled up or down as needed. In some embodiments, clients / subscribers may submit requests to the database system interactively in many ways, such as via a graphical user interface (e.g., a console) or a programming interface. In some embodiments, the non-relational database service 930 may provide a RESTful programming interface for submitting access requests (e.g., to obtain, insert, delete, or scan data).
[0056] In some embodiments, client 970 may encompass any type of client configurable to submit network-based requests to provider network 900 via network 960, the requests including requests for geofencing service 910 (e.g., performing a spatial search request as discussed above) or requests for database service 930 (e.g., accessing items in a table in non-relational database service 930). For example, in some embodiments, a given client 970 may include a suitable version of a web browser, or may include a plug-in module or other type of code module that is an extension of or executes within the execution environment provided by the web browser. Alternatively, in different embodiments, client 970 may encompass an application, such as a navigation client / application (or its user interface) or any other application that may utilize geofencing service 910. In some embodiments, such applications may include sufficient protocol support (e.g., for a suitable version of the Hypertext Transfer Protocol (HTTP)) for generating and processing network-based service requests without having to implement comprehensive browser support for all types of network-based data. That is, in some embodiments, client 970 may be an application that directly interacts with provider network 900. In some embodiments, client 970 may generate network-based service requests according to a Representational State Transfer (REST)-style network-based service architecture, a document- or message-based network-based service architecture, or another suitable network-based service architecture. It should be noted that in some embodiments, clients for services such as geofencing service 910 or database service 930 may be implemented within provider network 900 (e.g., an application hosted on a virtual computing service).
[0057] In some embodiments, client 970 may transmit network-based service requests to provider network 900 via network 960 and receive responses from the provider network. In some embodiments, network 960 may encompass any suitable combination of network hardware and protocols required to establish network-based communications between client 970 and provider network 900. For example, network 960 may encompass the various telecommunications networks and service providers that co-implement the Internet. In some embodiments, network 960 may also include private networks, such as local area networks (LANs) or wide area networks (WANs), as well as public or private wireless networks. For example, both a given client 970 and provider network 900 may be provisioned within an enterprise having its own internal network. In such embodiments, network 960 may include the hardware (e.g., modems, routers, switches, load balancers, proxy servers, etc.) and software (e.g., protocol stacks, accounting software, firewall / security software, etc.) required to establish networking links between a given client 970 and the Internet and between the Internet and provider network 900. Note that in some embodiments, client 970 may communicate with provider network 900 using a private network rather than the public Internet.
[0058] In some embodiments, non-relational database service 930 may implement a control plane to implement one or more management components, such as an automation administrator instance (which may provide multiple visibility and / or control functions). In various embodiments, in some embodiments, the control plane may direct the execution of different types of control plane operations among the nodes, systems, or devices implementing non-relational database service 930. In some embodiments, the control plane may provide visibility and control to a system administrator via an administrator console. The administrator console may allow the system administrator to directly interact with non-relational database service 930 (and / or the underlying system). In some embodiments, the administrator console may be the primary point of visibility and control for non-relational database service 930 (e.g., for configuration or reconfiguration by the system administrator). For example, the administrator console may be implemented as a relatively thin client that provides a functionally-displayed and controlled view to the system administrator and / or other privileged users, and through which system status indicators, metadata, and / or operational parameters may be observed and / or updated. In some embodiments, the control plane may provide access to or interface with information stored at non-relational database service 930 regarding one or more detected control plane events (e.g., data backups or other management operations on tables).
[0059] In some embodiments, the NoSQL database service 930 may provide various types of automated resource allocation for storing data in tables submitted to the NoSQL database service 930. For example, the control plane may communicate with processing nodes to initiate the execution of various control plane operations, such as moving multi-table partitions, splitting multi-table partitions, updating tables, deleting tables, creating indexes, and the like. In some embodiments, the control plane may include node recovery features or components that handle failure events of storage nodes that store database information (e.g., adding new nodes, removing failed or underperforming nodes, deactivating or deauthorizing underutilized nodes, etc.).
[0060] Various persistence, resiliency, control, or other operations may be implemented through the NoSQL database service 930. For example, the NoSQL database service 930 may detect split, copy, or move events for multi-table partitions at storage nodes to ensure that the storage nodes maintain a minimum performance level for executing access requests. For example, in various embodiments, there may be cases where a partition (or its replica) may need to be copied from one storage node to another. For example, if there are three replicas of a particular partition, each partition hosted on a different physical or logical machine, and one of the machines fails, then the replica hosted on that machine may need to be replaced with a new replica of the partition on another machine. In another example, if a particular machine hosting multiple partitions of one or more tables experiences heavy traffic, then one of the frequently accessed partitions may be moved (using a copy operation) to a machine experiencing less traffic to attempt to more evenly distribute the system workload and improve performance.
[0061] In some embodiments, the NoSQL database service may automatically handle changes in the size or amount of data storage. For example, a partition may be split due to its size, such as when it becomes too large to fit on one machine or storage device and / or to keep the partition size small enough to quickly rebuild a partition hosted on a single machine (using a large number of parallel processes) in the event of a machine failure. Partitions may also be split when they become too "hot" (i.e., when they experience much higher average traffic compared to other partitions). For example, if the workload for a given partition suddenly and / or significantly changes, the system may be configured to react quickly to the change. In some embodiments, the partition splitting process described herein may be transparent to applications and clients / users, which may allow the data storage service to scale automatically (i.e., without client / user intervention or initiation).
[0062] The split or move events can be detected in various ways by the control plane or other components of the non-relational database service 930. For example, the partition size and heat can be evaluated according to various performance thresholds, where the heat can be tracked by internal metrics (such as IOPS), external metrics (such as latency), and / or other factors.
[0063] In some embodiments, different models, schemas, or formats for storing database tables in the non-relational database service 930 can be implemented. For example, in some embodiments, non-relational, NoSQL, semi-structured, or other key-value data formats can be implemented. In at least some embodiments, the data model can include tables containing items with one or more attributes. In such embodiments, each table maintained on behalf of a client / user can include one or more items, and each item can include a set of one or more attributes. In some embodiments, the attributes of an item can be a set of one or more name-value pairs in any order. In some embodiments, each attribute in an item can have a name, a type, and a value. In some embodiments, items can be managed by assigning a primary key value (which can include one or more attribute values) to each item, and this primary key value can also be used to uniquely identify the item. In some embodiments, a large number of attributes can be defined across the items in a table, but each item can contain a sparse set of these attributes (where the specific attributes assigned to one item are independent of the attributes of another item in the same table), and all attributes other than the primary key attribute can be optional. In other words, the tables maintained by the non-relational database service 930 (and the underlying storage system) may not have a predefined schema other than their dependence on the primary key.
[0064] In some embodiments, the metadata of the table or other system data can also be stored as part of the database partitions using a similar partitioning scheme and using similar indexes.
[0065] The NoSQL database service 930 can provide application programming interfaces (APIs) for requesting various operations targeted at tables, indexes, items, and / or attributes maintained on behalf of storage service clients. In some embodiments, the service (and / or underlying system) can provide both control plane APIs and data plane APIs. The control plane APIs provided by the NoSQL database service 930 (and / or underlying system) can be used to manipulate table-level entities such as tables and indexes and / or reconfigure various tables. These APIs can be called relatively infrequently (when compared to data plane APIs). In some embodiments, the control plane APIs provided by the service can be used to create a table or a secondary index for a table at a separate storage node, import a table, export a table, delete a table or a secondary index, explore a table or a secondary index (e.g., to generate various performance reports or deviation reports), modify the table configuration or operation parameters of a table or a secondary index, and / or describe a table or a secondary index. In some embodiments, the control plane APIs that perform updates to table-level entries can call an asynchronous workflow to perform the requested operations. A method for requesting "describe" information (e.g., via the described table APIs) can simply return the current known state of the table or secondary index maintained by the service on behalf of the client / user. The data plane APIs provided by the NoSQL database service 930 (and / or underlying system) can be used to perform item-level operations such as requests for individual items or multiple items in one or more tables, such as queries, batch operations, and / or scans.
[0066] In different embodiments, the APIs provided by the services described herein can support request and response parameters encoded in one or more industry-standard or proprietary data exchange formats. For example, in various embodiments, the requests and responses can comply with human-readable (e.g., text-based) data exchange standards (e.g., JavaScript Object Notation or JSON), or can be represented using binary encoding (which can be more compact than text-based representations in some cases). In various embodiments, the system can supply default values (e.g., system-wide, user-specific, or account-specific default values) for one or more of the input parameters of the APIs described herein.
[0067] The non-relational database service 930 may include support for some or all of the following operations on data maintained by a service client on behalf of a service in a table (or index): performing transactions (including one or more operations on one or more items in one or more tables), putting (or storing) items, getting (or retrieving) one or more items with a specified primary key, deleting items, updating attributes in a single item, querying items using an index, and scanning an entire table (e.g., listing items), optionally filtering the returned items or conditionally varying the operations performed automatically above (e.g., conditional put, conditional get, conditional delete, conditional update, etc.). For example, the non-relational database service 930 (and / or underlying system) described herein may provide various data plane APIs for performing item-level operations, such as the TransactItems API, PutItem API, GetItem (or GetItems) API, DeleteItem API, and / or UpdateItem API, as well as one or more index-based search / traversal operations across multiple items in a table, such as the Query API and / or Scan API.
[0068] Exemplary computer system
[0069] Embodiments implementing spatial search as described herein may be executed on one or more computer systems that may interact with various other devices. Figure 10 One such computer system is shown. In different embodiments, the computer system 2000 may be any of a variety of types of devices, including but not limited to: personal computer systems, desktop computers, laptop computers, notebook computers or netbook computers, mainframe computer systems, handheld computers, workstations, network computers, cameras, set-top boxes, mobile devices, consumer devices, video game consoles, handheld video game devices, application servers, storage devices, peripheral devices (such as switches, modems, routers), or generally any type of computing node, computing device, or electronic device.
[0070] In the illustrated embodiment, computer system 2000 includes one or more processors 2010 coupled to system memory 2020 via an input / output (I / O) interface 2030. Computer system 2000 further includes a network interface 2040 coupled to the I / O interface 2030, and one or more input / output devices 2050, such as a cursor control device, a keyboard, and a display. In one embodiment, the display may include a standard computer monitor and / or other display systems, technologies, or devices. In some embodiments, it is contemplated that a single instance of computer system 2000 may be used to implement an embodiment, while in other embodiments, multiple such systems or multiple nodes that make up computer system 2000 may host different parts or instances of an embodiment. For example, in one embodiment, some elements may be implemented via one or more nodes of computer system 2000 that are different from those implementing other elements.
[0071] In various embodiments, computer system 2000 may be a single-processor system that includes one processor 2010, or a multi-processor system that includes several processors 2010 (e.g., two, four, eight, or another suitable number). In one embodiment, processor 2010 may be any suitable processor capable of executing instructions. For example, in various embodiments, processor 2010 may be a general-purpose or embedded processor implementing any one of various instruction set architectures (ISAs), such as the x86, PowerPC, SPARC, or MIPS ISA, or any other suitable ISA. In a multi-processor system, each processor 2010 may generally but not necessarily implement the same ISA.
[0072] In some embodiments, at least one processor 2010 may be a graphics processing unit. In one embodiment, a graphics processing unit or GPU may be regarded as a dedicated graphics rendering device for a personal computer, a workstation, a game console, or other computing or electronic devices. Modern GPUs can be very efficient in manipulating and displaying computer graphics, and their highly parallel structure can make them more effective than a typical CPU for a series of complex graphics algorithms. For example, a graphics processor may implement multiple graphics primitive operations in a way that can execute them faster than directly drawing to the screen with a host central processing unit (CPU). In various embodiments, graphics rendering may be implemented at least in part by program instructions for execution on one of such GPUs or for parallel execution on two or more of such GPUs. In one embodiment, a GPU may implement one or more application programming interfaces (APIs) that permit a programmer to call the functions of the GPU.
[0073] In one embodiment, system memory 2020 may store program instructions 2025 and / or data accessible by processor 2010. In various embodiments, system memory 2020 may be implemented using any suitable memory technology, such as static random access memory (SRAM), synchronous dynamic RAM (SDRAM), non-volatile / flash-type memory, or any other type of memory. In the illustrated embodiment, program instructions and data for performing the desired functions, such as those described above, are shown stored in system memory 2020 as program instructions 2025 and data repository 2035, respectively. In other embodiments, program instructions and / or data may be received, sent, or stored on different types of computer-accessible media or on similar media separate from system memory 2020 or computer system 2000. Computer-accessible media may include non-transitory storage media or memory media, such as magnetic or optical media, e.g., a disk or a CD / DVD-ROM coupled to computer system 2000 via I / O interface 2030. In one embodiment, program instructions and data stored via computer-accessible media may be transmitted by a transmission medium or signal, such as an electrical, electromagnetic, or digital signal, which may be conveyed via a communication medium, such as a network and / or a wireless link, e.g., implemented via network interface 2040.
[0074] In one embodiment, I / O interface 2030 may coordinate I / O traffic between processor 2010, system memory 2020, and any peripheral devices in the device, including network interface 2040 or other peripheral interfaces such as input / output device 2050. In some embodiments, I / O interface 2030 may perform any necessary protocol, timing, or other data transformations to convert a data signal from one component, e.g., system memory 2020, into a format suitable for use by another component, e.g., processor 2010. In some embodiments, I / O interface 2030 may include support for devices attached via various types of peripheral buses, such as variants of the Peripheral Component Interconnect (PCI) bus standard or the Universal Serial Bus (USB) standard. In some embodiments, the functionality of I / O interface 2030 may be split into two or more separate components, such as a north bridge and a south bridge. Additionally, in some embodiments, some or all of the functionality of I / O interface 2030, such as the interfacing to system memory 2020, may be incorporated directly into processor 2010.
[0075] In one embodiment, network interface 2040 may permit data to be exchanged between computer system 2000 and other devices attached to a network such as other computer systems, or between nodes of computer system 2000. In various embodiments, network interface 2040 may support communication via a wired or wireless general data network, such as any suitable type of Ethernet network; via a telecommunications / telephone network such as an analog voice network or a digital fiber optic communication network; via a storage area network such as a Fibre Channel SAN or via any other suitable type of network and / or protocol.
[0076] In some embodiments, input / output device 2050 may include one or more display terminals, keyboards, keypads, touchpads, scanning devices, voice or optical recognition devices, or any other device suitable for inputting or retrieving data by one or more computer systems 2000. Multiple input / output devices 2050 may be present in computer system 2000, or may be distributed across various nodes of computer system 2000. In some embodiments, similar input / output devices may be separate from computer system 2000 and may interact with one or more nodes of computer system 2000 via a wired or wireless connection, such as via network interface 2040.
[0077] As Figure 10 shown, in one embodiment, memory 2020 may include program instructions 2025 implementing various embodiments of the systems described herein, as well as a data repository 2035 including various data accessible by program instructions 2025. In one embodiment, program instructions 2025 may include software elements of the embodiments described herein and shown in the figures. Data repository 2035 may include data that may be used in the embodiments. In other embodiments, other or different software elements and data may be included.
[0078] Those skilled in the art will understand that the computer system 2000 is illustrative only and is not intended to limit the scope of the embodiments described herein. Specifically, the computer system and apparatus may include any combination of hardware or software that can perform the indicated functions, including computers, personal computer systems, desktop computers, laptop computers, notebook computers or netbook computers, mainframe computer systems, handheld computers, workstations, network computers, cameras, set-top boxes, mobile devices, network devices, Internet appliances, PDAs, wireless telephones, pagers, consumer devices, video game consoles, handheld video game devices, application servers, storage devices, peripheral devices (such as switches, modems, routers) or generally any type of computing or electronic device. The computer system 2000 may also be connected to other devices not shown, or alternatively may operate as a stand-alone system. Additionally, in some embodiments, the functions provided by the illustrated components may be combined in fewer components or distributed in additional components. Similarly, in some embodiments, the functions of some of the illustrated components may not be provided and / or other additional functions may be used.
[0079] Those skilled in the art will also understand that although various items are illustrated as being stored in memory or a repository when in use, for purposes of memory management and data integrity, these items or portions thereof may be transferred between memory and other storage devices. Alternatively, in other embodiments, some or all of the software components may be executed in memory on another device and communicate with the illustrated computer system via inter-computer communication. Some or all of the system components or data structures may also be stored (e.g., as instructions or structured data) on a computer-accessible medium or portable article for reading by an appropriate drive, various examples of which are described above. In some embodiments, instructions stored on a computer-readable medium separate from the computer system 2000 may be transmitted to the computer system 2000 via a transmission medium or signal (e.g., an electrical, electromagnetic or digital signal), the transmission medium or signal being conveyed via a communication medium (e.g., a network and / or a wireless link). This computer-readable storage medium may be non-transitory. Various embodiments may further include the receipt, transmission or storage of instructions and / or data on a computer-accessible medium in accordance with the foregoing description. Thus, the present invention may be practiced with other computer system configurations.
[0080] The embodiments of the present disclosure may be described in accordance with the following clauses:
[0081] Clause 1. A system, comprising:
[0082] A key-value data repository including a plurality of spatial cell indexes and a plurality of cell membership indexes;
[0083] At least one processor; and
[0084] A memory that stores program instructions which, when executed, cause the at least one processor to implement a geofencing service configured to:
[0085] Receive a request to perform a spatial search from a client, where the request includes an identifier of a provided geometry and a predefined geometry, and where the spatial search identifies geometries that intersect the provided geometry;
[0086] Convert the provided geometry into one or more indexes that make up the provided geometry, where the one or more indexes are converted according to a space-filling curve;
[0087] Identify one or more spatial cells that match at least one of the one or more indexes, where, to identify the one or more spatial cells, the geofencing service is configured to perform multiple queries of a key-value store using a sliding window on an individual one of the one or more indexes;
[0088] Query a cell membership index of the key-value store to determine one or more members of the identified spatial cells; and
[0089] Send a response to the request to the client, at least in part based on a match between the identifier of the predefined geometry and one of the determined one or more members of the identified spatial cells.
[0090] Clause 2. The system according to clause 1, wherein the spatial search is a spatio-temporal search.
[0091] Clause 3. The system according to clause 1, wherein the conversion of the geometry to one or more indexes is performed using a spherical projection.
[0092] Clause 4. The system according to clause 1, wherein the geofencing service supports multiple clients including the client, and wherein at least one of the multiple cell indexes includes an identifier associated with the client among the multiple clients.
[0093] Clause 5. A method comprising:
[0094] Receive a request to perform a spatial search from a client, the request including a geometry;
[0095] Convert the geometry into one or more indexes that make up the geometry;
[0096] Identifying one or more spatial cells that match at least one of the one or more indices by querying a key-value repository that includes a plurality of cell indices that describe spatial cells;
[0097] Querying the key-value repository to determine one or more geometries that are members of the identified spatial cells, the key-value repository further including a plurality of cell membership indices; and
[0098] Sending a response to the request to perform the spatial search to the client based at least in part on the determined one or more members of the identified spatial cells.
[0099] Clause 6. The method according to clause 5, wherein the geometry is a point, and wherein the spatial search identifies geometries that contain or intersect the point.
[0100] Clause 7. The method according to clause 5, wherein the geometry includes a plurality of points, and wherein the spatial search identifies geometries that contain or intersect the geometry.
[0101] Clause 8. The method according to clause 5, wherein identifying the one or more spatial cells that match at least one of the one or more indices includes performing a plurality of queries of the key-value repository for individual ones of the one or more indices using a sliding window over the respective index.
[0102] Clause 9. The method according to clause 5, wherein the spatial search is a spatio-temporal search.
[0103] Clause 10. The method according to clause 5, wherein the geometry includes two or more spatial dimensions.
[0104] Clause 11. The method according to clause 5, wherein the transformation of the geometry to one or more indices is performed using a spherical projection.
[0105] Clause 12. The method according to clause 5, wherein the receiving, the transforming, the identifying, the querying, and the sending are performed by a geofencing service, wherein the geofencing service supports a plurality of clients including the client, and wherein at least one of the plurality of cell indices includes an identifier associated with the client among the plurality of clients.
[0106] Clause 13. One or more non-transitory computer-readable storage media that store program instructions that, when executed on or across one or more computing devices, cause the one or more computing devices to implement:
[0107] Receive a request to perform a spatial search from a client, the request including a geometry;
[0108] Convert the geometry into one or more indices that make up the geometry;
[0109] Identify one or more spatial cells that match at least one of the one or more indices by querying a key - value repository that includes a plurality of cell indices describing spatial cells;
[0110] Query the key - value repository to determine one or more geometries that are members of the identified spatial cells, the key - value repository further including a plurality of cell membership indices; and
[0111] Send a response to the request to perform the spatial search to the client, at least in part based on a comparison of the determined one or more members of the identified spatial cells with one or more geometries identified by search criteria of the request to perform the spatial search.
[0112] Clause 14. One or more non - transitory computer - readable storage media according to clause 13, wherein the geometry is a point, and wherein the spatial search identifies geometries that contain or intersect the point.
[0113] Clause 15. One or more non - transitory computer - readable storage media according to clause 13, wherein the geometry includes a plurality of points, and wherein the spatial search identifies geometries that contain or intersect the geometry.
[0114] Clause 16. One or more non - transitory computer - readable storage media according to clause 13, wherein identifying the one or more spatial cells that match at least one of the one or more indices includes performing multiple queries of the key - value repository for individual ones of the one or more indices using a sliding window over the corresponding index.
[0115] Clause 17. One or more non - transitory computer - readable storage media according to clause 13, wherein the spatial search is a spatio - temporal search.
[0116] Clause 18. One or more non - transitory computer - readable storage media according to clause 13, wherein the geometry includes two or more spatial dimensions.
[0117] Clause 19. One or more non - transitory computer - readable storage media according to clause 13, wherein the conversion of the geometry into one or more indices is performed using a spherical projection.
[0118] Clause 20. One or more non-transitory computer-readable storage media according to Clause 13, wherein the receiving, the transforming, the identifying, the querying, and the sending are performed by a geofencing service, wherein the geofencing service supports a plurality of clients including the client, and wherein at least one of the plurality of cell indexes includes an identifier associated with the client among the plurality of clients.
[0119] Conclusion
[0120] Various embodiments may further include receiving, sending, or storing instructions and / or data implemented according to the foregoing description on a computer-accessible medium. Generally, computer-accessible media may include storage media or memory media (such as magnetic or optical media, e.g., a disk or a DVD / CD-ROM), volatile or non-volatile media (such as RAM (e.g., SDRAM, DDR, RDRAM, SRAM, etc.), ROM, etc.), and transmission media or signals (such as electrical, electromagnetic, or digital signals transmitted via a communication medium (such as a network and / or a wireless link)).
[0121] The various methods shown in the figures and described herein represent exemplary embodiments of the methods. The methods may be implemented in software, hardware, or a combination thereof. The order of the methods may be changed, and various elements may be added, reordered, combined, omitted, modified, etc.
[0122] It will be apparent to those skilled in the art that various modifications and changes can be made. All such modifications and changes are intended to be covered, and thus, the foregoing description is considered to be illustrative rather than restrictive.
Claims
1. A system, comprising: A key-value data repository including a plurality of spatial cell indexes and a plurality of cell membership indexes; At least one processor; And A memory storing program instructions that, when executed, cause the at least one processor to implement a geofencing service configured to: Receive a request to perform a spatial search from a client, wherein the request includes an identifier of a provided geometry and a predefined geometry, and wherein the spatial search identifies geometries that intersect the provided geometry; Convert the provided geometry into one or more indexes that make up the provided geometry, the one or more indexes being converted according to a space-filling curve; Identify one or more spatial cells that match at least one of the one or more indexes, wherein to identify the one or more spatial cells, the geofencing service is configured to perform multiple queries of the key-value repository using a sliding window on the respective indexes for the individual ones of the one or more indexes; Query the cell membership indexes of the key-value repository to determine one or more members of the identified spatial cells; And Send a response to the request to the client at least in part based on a match between the identifier of the predefined geometry and one of the determined one or more members of the identified spatial cells.
2. The system according to claim 1, wherein the spatial search is a spatio-temporal search.
3. The system according to claim 1, wherein the conversion of the geometry to one or more indexes is performed using a spherical projection.
4. The system according to claim 1, wherein the geofencing service supports a plurality of clients including the client, and wherein at least one of the plurality of cell indexes includes an identifier associated with the client among the plurality of clients.
5. A method, comprising: Receive a request to perform a spatial search from a client, the request including a geometry; Convert the geometry into one or more indexes that make up the geometry; Identify one or more spatial cells that match at least one of the one or more indexes by querying a key-value repository including a plurality of cell indexes describing spatial cells; Query the key-value repository to determine one or more geometries that are members of the identified spatial cells, the key-value repository further including a plurality of cell membership indexes; And Send a response to the request to perform the spatial search to the client at least in part based on the determined one or more members of the identified spatial cells.
6. The method according to claim 5, wherein the geometry is a point, and wherein the spatial search identifies geometries that contain or intersect the point.
7. The method according to claim 5, wherein the geometry includes a plurality of points, and wherein the spatial search identifies geometries that contain or intersect the geometry.
8. The method according to claim 5, wherein identifying the one or more spatial cells that match at least one of the one or more indices includes, for an individual one of the one or more indices, performing a plurality of queries of the key-value repository using a sliding window over the corresponding index.
9. The method according to claim 5, wherein the spatial search is a spatio-temporal search.
10. The method according to claim 5, wherein the geometry includes two or more spatial dimensions.
11. The method according to claim 5, wherein the transformation of the geometry to one or more indices is performed using a spherical projection.
12. The method according to claim 5, wherein the receiving, the transformation, the identifying, the querying, and the sending are performed by a geofencing service, wherein the geofencing service supports a plurality of clients including the client, and wherein at least one of the plurality of cell indices includes an identifier associated with the client among the plurality of clients.
13. One or more non-transitory computer-readable storage media storing program instructions that, when executed on or across one or more computing devices, cause the one or more computing devices to implement: Receiving, from a client, a request to perform a spatial search, the request including a geometry; Converting the geometry into one or more indices that make up the geometry; Identifying one or more spatial cells that match at least one of the one or more indices by querying a key-value repository including a plurality of cell indices that describe spatial cells; Querying the key-value repository to determine one or more geometries that are members of the identified spatial cells, the key-value repository further including a plurality of cell membership indices; and Sending a response to the request to perform the spatial search to the client, at least in part based on a comparison of the determined one or more members of the identified spatial cells with one or more geometries identified by search criteria of the request to perform the spatial search.
14. The one or more non-transitory computer-readable storage media according to claim 13, wherein the geometry is a point, and wherein the spatial search identifies geometries that contain or intersect the point.
15. The one or more non-transitory computer-readable storage media according to claim 13, wherein the geometry includes a plurality of points, and wherein the spatial search identifies geometries that contain or intersect the geometry.
Citation Information
Patent Citations
Facilitating spatial indexing on distributed key-value stores
CN110597804A
An extended System and Method for searching nearest spatial entity based on R tree index
KR1020160135907A