Abstract
A content-matched (CM) range monitoring query over moving objects continually retrieves the moving objects (i) whose non-spatial attribute values are matched to given non-spatial query values; and (ii) that are currently located within a given spatial query range. In this paper, we propose a new query indexing structure, called the group-aware query region tree (GQR-tree) for efficient evaluation of CM range monitoring queries. The primary role of the GQR-tree is to help the server leverage the computational capabilities of moving objects in order to improve the system performance in terms of the wireless communication cost and server workload. Through a series of comprehensive simulations, we verify the superiority of the GQR-tree method over the existing methods.
1. Introduction
With the technological advances in wireless networks and the wide deployment of mobile devices equipped with location sensing technology (e.g., smart phones and pads), location-based services (LBSs) have attracted much attention as one of the most promising applications in recent years [,,,,,,,,,,,,,,,,,,,]. A range monitoring query, which is defined as (i) retrieving the moving objects located within a client-specified spatial query range and (ii) keeping the query result up to date during a certain time period, can be used in many LBSs such as mobile advertising and traffic condition monitoring. For example, let us consider the scenario of a mobile advertising service, where an advertiser (i.e., client) plans to send advertising messages to the nearby potential customers (i.e., moving objects) who have opted into the mobile advertising service. Then, the service provider (i.e., server) must be able to keep track of the locations of the customers and report their proximity to the advertiser, whenever needed.
In many real-life LBSs, however, advertisers are moving away from bombarding customers with the same advertising messages regardless of whether the messages are relevant to the customers. Instead, they are moving toward sending different advertising messages to different customers by additionally specifying non-spatial target criteria. For example, let us suppose that a restaurant owner (i.e., client) wants to send advertising messages to only the nearby vegetarian customers whose ages are between 20 and 40 years. In this case, the service provider should report to the restaurant owner only the nearby vegetarian customers aged between 20 and 40 years (i.e., content-matched moving objects).
In this paper, we propose a method for evaluation of a content-matched range monitoring query (CM range monitoring query) over moving objects. Given a set of moving objects O, a CM range monitoring query q, issued by a client over O, specifies (i) a spatial query range and (ii) a set of non-spatial query values. For a query q, during a certain time period, the server should continually retrieve all moving objects (in O) (i) whose non-spatial attribute values are matched to the set of non-spatial query values; and (ii) that are currently located within the spatial query range.
There is a large body of work on evaluation of traditional spatial range monitoring queries over moving objects, which can be classified into two categories according to the mobility of spatial query ranges: one deals with stationary or quasi-stationary query ranges [,,,,,,], whereas the other deals with moving query ranges [,,,,,]. Our study belongs to the former category. The majority of existing methods for evaluation of the traditional range monitoring queries assume that moving objects periodically send location-updates to the server via wireless connections and the server keeps the results of the issued queries up to date [,,,]. However, excessive location-updates from moving objects can not only cause significant energy waste of the battery powered handheld devices (carried by the moving objects), but also significantly degrade the overall system performance due to overloading network resources and overwhelming server workload []. To support efficient evaluation of range monitoring queries over moving objects, it is crucial to satisfy the following two requirements both of which depend on the amount of location-update stream generated from moving objects: (i) the wireless communication cost should be minimized and (ii) the server workload should be minimized. It is also important to notice that in a monitoring query evaluation setting, query results are required to be updated as soon as possible whenever being changed because a time-delay may yield obsolete results for monitoring queries; thus, it is critical to keep the time delay of updating query results minimum by reducing the server workload (e.g., CPU-time).
The safe region method (SR), which helps moving objects reduce the frequency of sending their location-updates, was introduced in [,]. A safe region, assigned to each moving object o, is the region that (i) contains o and (ii) guarantees that the current results of all the queries issued to the server will remain valid if o moves only within this region. Therefore, o can move freely without sending its location-update to the server as long as it does not exit its safe region. For example, the moving object in Figure 1 need not send its location-update if it locates within its safe region (i.e., blue-dotted rectangle). Although SR improves the overall system performance to a certain degree, because the size of a safe region assigned to each moving object o is typically small, o easily exits its current safe region and contacts the server in order to receive a new safe region. Thus, the server must frequently search o’s safe regions, which requires intensive computational overhead.
Figure 1.
An example of the safe region and resident domain.
Monitoring query management (MQM) and the query region-tree method (QRT) whose primary goal is to reduce the communication cost and the server workload by leveraging the available (memory and computational) capabilities of moving objects, was introduced in [,], respectively. In MQM and QRT, the server pushes some tasks of range monitoring query evaluation to the moving objects. Specifically, the server assigns each moving object o (i) a rectangular subspace of the entire workspace, called the resident domain that contains o; and (ii) several spatial query ranges that overlap with o’s resident domain. The size of o’s resident domain is determined by o’s capability, , which indicates the maximum number of (nearby) spatial query ranges o can load and process at a time; thus if , the resident domain assigned to o must contain o and overlap with no more than n spatial query ranges. For example, assuming the capability of the moving object in Figure 1 is 3, is assigned (i) the red-dotted rectangle as its resident domain and (ii) three spatial query ranges , , and , which overlap with ’s resident domain. Only when exits its resident domain or crosses any of the boundary of its assigned spatial query ranges, does it contact the server to receive a new resident domain (together with new spatial query ranges) or to let the server update the corresponding query result, respectively. In the figure, sends its location-update because crosses the boundary of , and in response to ’s location-update, the server updates the result of the corresponding query .
As such, in MQM and QRT, moving objects and the server share the tasks of query evaluation, which lightens the server workload. Because the moving objects are aware of when they should send their location-updates, the wireless communication cost can be also reduced. For indexing queries and searching the resident domain of each moving object, MQM and QRT use the binary partitioning tree (BP-tree) and the query region tree (QR-tree) that overcomes the limitations of the BP-tree, respectively.
Unfortunately, none of the methods reviewed above can adequately deal with CM range monitoring queries because they rely only on spatial information. For evaluation of CM range monitoring queries, in the previous paper [], we proposed an enhanced version of the QR-tree, called the bit-vector query region tree (BQR-tree), which stores the additional bit-vector information required to describe the non-spatial query values. However, the BQR-tree is a naïve form of the enhanced spatial query indexing structure, where tree construction is based mostly on the spatial information. In this paper, we propose a new query indexing structure, called the group-aware query region tree (GQR-tree) for efficient evaluation of CM range monitoring queries. For the tight integration of the spatial and the non-spatial specifications of the queries, the GQR-tree groups the queries according to their non-spatial query values (i.e., non-spatial information) when being built on their spatial query ranges (i.e., spatial information). Similarly to the BP-tree, the QR-tree, and the BQR-tree, the main role of the GQR-tree is to index queries and to search the resident domains of moving objects in order for cooperative evaluation of CM range monitoring queries between the server and moving objects.
The remainder of this paper is organized as follows. In Section 2, some related work is reviewed. In Section 3, the system overview is provided. In Section 4, the problem is formally defined. In Section 5, we present the details of the GQR-tree. In Section 6, we provide the performance evaluation and verify superiority of the proposed GQR-tree method as compared with existing methods. Finally, in Section 7, we present our conclusions.
2. Related Work
Most of the early researches on spatial databases assumed the stationary objects and focused on developing efficient spatial access methods (e.g., the R-tree [] and its variants [,]) and evaluation of snapshot queries, which retrieves the results of queries only once at a specific time point. Later on, the focus has been extended to indexing moving objects. Assuming that the trajectories of moving objects are known a priori or predictable, Saltenis et al. [] proposed the Time-Parameterized R-tree (TPR-tree) for indexing moving objects, where the location of each moving object is transformed into a linear function of time. Tao et al. [] proposed the improved version of the TPR-tree, called the TPR-tree, which uses the exactly same data structure as the TPR-tree but applies new insertion and deletion algorithms. Some index structures were also presented such as the STRIPES [] and the B-tree [], a variant of the B-tree, to improve the performance of the TPR-tree family. However, the known-trajectory assumption does not hold for most real-life application scenarios (e.g., the velocity and direction of a typical customer on the road are frequently changed), which leads those index structures to become prohibitively expensive to update. To deal with a large number of moving objects that move arbitrarily, Lee et al. [] proposed a generalized bottom-up update strategy for the R-tree, while Song et al. [,] proposed two buffer-based index structures, called the R-tree with semibulk loading (R-tree) and the R-tree with Update Buffering (R-tree), both of which utilize an in-memory buffer structure.
Motivated by LBSs, another research direction has recently focused on continuous query monitoring over moving objects. Many methods for continuous range query monitoring have been proposed, which can be broadly classified into two categories depending on whether queries also move or not. The first category focuses on stationary or quasi-stationary queries over moving objects [,,,,,,], and the second category deals with moving queries over moving objects [,,,,,]. Because our work belongs to the first category, we elaborate on the review of the representative methods in the first category and briefly review the methods in the second category.
Indexing queries, instead of indexing frequently moving objects with arbitrary velocities and directions, has been considered to be an attractive strategy, which reduces the update cost of index structures because continuous monitoring queries remain active for a long period of time and are stationary (or quasi-stationary). Prabhakar et al. [] suggested to use the R-tree to index queries, while Kalashnikov et al. [] used the in-memory grid index. Wu et al. [] proposed a new query indexing method, namely containment encoded square (CES) based grid indexing. All of these methods assumed that moving objects blindly report their location-updates to the server whenever they move. The server, meanwhile, continually (i) receives the location-update stream; (ii) determines the queries that are affected by the movements of the objects; and (iii) updates their results if necessary. However, constant location-updates generated by a huge number of moving objects may incur significant communication bottleneck and greatly increase the overhead for determining the affected queries and keeping their results up to date at the server. In addition, because the transmission of a location-update message over a wireless connection takes a substantial amount of energy, the handheld device carried by each moving object exhausts its battery life quickly. To help each moving object reduce the number of sending location-updates, the safe region method (SR) was proposed in [,]. Cai et al. [] and Jung et al. [] proposed the monitoring query management method (MQM) and the QR-tree method (QRT), respectively, which aim to reduce the communication cost and the server workload by leveraging heterogeneous computational capabilities of moving objects through the concept of resident domain. Recently, the safe region techniques for moving range queries over stationary objects have also been proposed in [,]. Similarly to the safe region assigned to a moving object, the safe region assigned to a query q is the region that (i) contains q’s location (i.e., the center point of q’s spatial query range ) and (ii) guarantees that while q’s location remains inside it, the result of q remain unchanged.
Focusing on the evaluation of continuous moving queries over moving objects, Mokbel et al. [] proposed the Scalable INcremental hash based Algorithm (SINA) to achieve the system scalability based on the notions of shared execution and incremental evaluation. Gedik et al. [] presented the MobiEyes, where moving objects play an active role in the query evaluation task similar to those in MQM and QRT. In SINA, moving objects report their location-updates periodically, while in Mobieyes, moving objects rely on location estimation to reduce the number of sending location-updates as well as moving query issuers (i.e., moving clients). Liu et al. [] employed two kinds of communication methods for moving query evaluation: on-demand access and periodic broadcasting to reduce communication costs and energy wastes of handheld devices carried by moving objects and query issuers. Recently, assuming moving objects periodically send their location-updates, Mouratidis et al. [] have introduced the broadcast grid index (BGI), which employs the periodic broadcasting for communications between the server and query issuers to evaluate moving queries.
All the methods reviewed above cannot adequately deal with the CM range monitoring queries. Although some existing researches have addressed the spatial queries that involve non-spatial specifications, their methods are restricted to snapshot queries over stationary objects [,,]. We note that the problem that is slightly related to the evaluation of CM range monitoring queries is the evaluation of spatial keyword queries [,,,,]. Hariharan et al. [] studied the problem of evaluating boolean range queries over stationary geo-textual objects, where keywords are used as boolean predicates to filter out the objects, which do not contain the query keywords, among all the objects that are inside the given spatial query ranges. On the other hand, Cong et al. [] studied the problem of evaluating top-k queries over stationary geo-textual objects, where spatial proximity and textual relevance (i.e., textual similarity between the textual descriptions of the objects and query keywords) are combined by a linear function to rank the objects. Several variants of spatial keyword queries have also been studied such as m-closest keywords queries [,] and region based spatio-textual queries []. However, the methods for spatial keyword query evaluation are also restricted to snapshot queries over stationary objects.
3. System Overview
The main goal of our study is to design a query evaluation system, which satisfies two requirements mentioned in Section 1. To this end, we use the resident domain concept so that moving objects (i) share the tasks of query evaluation with the server and (ii) send their location-updates to the server only when needed (Please see Section 1 for the details of the resident domain).
Figure 2 shows a high-level overview of the system model. Similarly to the system model presented in the previous work [,,,,,], the system model we consider consists of three major components: moving objects, clients, and the central server.
Figure 2.
System overview.
- Moving objects: Each moving object o, which is registered at the server (with its non-spatial attribute values) and is identified by its unique identifier, is capable of sensing its current location (e.g., equipped with a GPS receiver) and has some available (memory and computational) capability . We assume that each moving object o has heterogeneous capability , which indicates the maximum number of (qualified) spatial query ranges it can load and process at a time, and that ≥ θ, where θ is a system parameter that indicates the minimum number of spatial query ranges o should be able to process; thus, a moving object with more powerful capability is assigned a larger resident domain together with a greater number of spatial query ranges. There are two types of location-update messages sent from moving objects to the server: and . The former is for the purpose of receiving a new resident domain, whereas the latter is to let the server update the query result. For example, assuming the moving object in Figure 2 is assigned the blue-dotted rectangle as its resident domain together with spatial query range , it sends the message to the server because it exits its resident domain. On the other hand, assuming the moving object in Figure 2 is assigned the red-dotted rectangle as its resident domain together with spatial query ranges and , it sends the message to the server because it crosses the boundary of .
- Clients: Each geographically distributed client is able to issue multiple CM range monitoring queries over the moving objects registered at the server, and continually receives the up-to-date results of these queries from the server via wireless or high-speed wired connections. Clients do not directly communicate with moving objects; instead, they use the server as an intermediary. Each query q issued by a client is identified by its unique identifier and its spatial query range is assumed to be stationary or quasi-stationary.
- Central server: The server maintains mainly two data structures: a query table (hashed on query identifiers) and the GQR-tree. The query table stores, for each query q, an identifier, a spatial query range , a set of non-spatial values , and the result. The following three main tasks are performed by the server.
- -
- Query registration (or de-registration): When a new query q is issued (or q is terminated) by a client, the task of query registration (or de-registration) is performed, which consists of inserting q into (or deleting q from) the query table, updating the GQR-tree, and broadcasting the message ( message or message) to all the moving objects to notify them of these changes.
- -
- Domain assignment: The task of domain assignment is performed in response to the message sent by a moving object o that exits its resident domain. The server searches o’s new resident domain by traversing the GQR-tree. Then, the server assigns o’s new resident domain (together with several spatial query ranges) to o. It is important to note that the main purpose of the GQR-tree is to assign the largest possible resident domain (together with as many spatial query ranges as possible) to o.
- -
- Query result update: The task of query result update is performed mainly in response to the message sent by a moving object o that crosses any of the boundary of its assigned spatial query ranges . When receiving the message from o, the server updates the result of the corresponding query q. For example, the server updates the result of in response to the message sent by the moving object in Figure 2. As we will describe later, this task may also be performed when the server receives the message from o.
4. Problem Definition and Motivation
In this paper, we address the problem of evaluating CM range monitoring queries over moving objects. Let = be a set of moving objects, each of which is associated with location and a set of non-spatial attributes A = . Each non-spatial attribute ∈ A is assumed to be either categorical (e.g., dietary preference) or numeric (e.g., age). A moving object o (∈ ) is represented as , where denotes o’s current location and = denotes o’s non-spatial attribute values. A CM range monitoring query q, issued by a client over , is represented as . Here, denotes a specified spatial query range and denotes a set of non-spatial query values (or intervals) specified on a subset of non-spatial attributes () = . We assume in this paper that is an interval if is a numerical attribute by assuming that the system let the clients to select one of the predefined intervals (e.g., age: [20, 40)) when issuing queries.
Definition 1. A content-matched (CM) range monitoring query q, issued over , continually returns a set () of moving objects for which the condition
holds, where denotes conjunction. We say that o is matched to or vice versa if (or ∈ ).
The existing methods, especially, MQM [] and QRT [], which use the resident domain concept cannot adequately deal with CM range monitoring queries due to the following drawbacks:
- First, because in MQM and QRT, the capability of each moving object o is measured by the number of spatial query ranges without any consideration of non-spatial query values (or intervals), o’s resident domain tends to be small. This leads o to frequently send messages to the server for receiving new resident domains. For example, let us assume that the moving object with in Figure 3 is associated with three non-spatial attributes A = {: Age, : Dietary preference, : Gender} and = { }. Suppose the queries involve non-spatial values (or intervals) specified on a subset of A, as shown in Figure 3. In MQM and QRT, the server assigns the red-dotted rectangle as ’s resident domain together with two spatial query ranges and . However, because is matched to only (i.e., , , and ) and (i.e., and ), ’s movement only affects the results of the corresponding queries and . So, when determining the size of ’s resident domain, the server can ignore the spatial query ranges , , and ; thus the server can assign much larger resident domain (i.e., entire space) together with the qualified spatial query ranges and .
- Second, due to the same reason of the first drawback, each moving object o has to send unnecessary messages to the server. For example, when in Figure 3 crosses the boundary of as depicted in the figure, it sends the message to the server. However, because is not matched to (i.e., and ), ’s movement does not affect the result of the corresponding query ; hence, can ignore , and check its movement against only (because is matched to ) and send the message if necessary.
In our previous paper [], we proposed the BQR-tree, which is the extension of the QR-tree. Each node N of the BQR-tree additionally stores the summary of non-spatial values (or intervals) each query specifies in the form of bit-vector. With the bit-vector information stored in N, the server can identify whether non-spatial values (or intervals) can be found in N or not. Therefore, when searching the resident domain of each moving object o, if there is no non-spatial values (or intervals) to which o is matched in a given node N, N can be the additional part of o’s resident domain. (Note: In the BQR-tree, each subspace of the entire space corresponds to each node.) This relieves the first drawback because the server can assign o a larger resident domain if possible. However, in the BQR-tree method (BQRT), the capability of o is still measured by the number of spatial query ranges without considering non-spatial values (or intervals) because the BQR-tree is a naïve form of the enhanced QR-tree, where tree construction (operations of insertion and deletion) is based mostly on the spatial information. In addition, the searching the additional part of o’s resident domain tends to be computation-intensive. On the other hand, BQRT overcomes the second drawback by filtering needless spatial query ranges.
Figure 3.
Example of content-matched (CM) range monitoring queries.
In the next section, in order to remedy the problems stated above, we propose the GQR-tree that supports efficient evaluation of CM range monitoring queries. Table 1 summarizes the primary notation we use throughout the paper.
Table 1.
Frequently used notation.
| Notation | Explanation |
|---|---|
| o | A moving object |
| The current location of o | |
| The non-spatial attribute values of o | |
| The object bit-vector of o | |
| q | A CM range monitoring query |
| The spatial query range q specifies | |
| A set of non-spatial query values (or intervals) q specifies | |
| The query bit-vector of q | |
| A query group | |
| The group bit-vector of | |
| N | A GQR-tree node or its corresponding subspace of the entire workspace |
| A set of ’s elements (queries) whose spatial query ranges are covered by or partially intersect N | |
| The cardinality of |
5. The Group-Aware Query Region Tree (GQR-Tree)
5.1. Description
Similarly to the BQR-tree, we choose to extend the QR-tree to the GQR-tree because, to the best of our knowledge, the QR-tree is superior to existing index structures (e.g., the BP-tree) for evaluation of traditional spatial range monitoring queries. In addition, because the cost of implementing entirely new index structure can be more expensive than the cost of extending an already existing index structure; thus, for efficient evaluation of CM range monitoring queries, extending the QR-tree by adding new features can be an excellent alternative.
For the tight integration of the spatial and the non-spatial specifications of the queries, we group the queries based on their query bit-vectors, after which we construct the GQR-tree based on their spatial query ranges. We represent non-spatial values (or intervals) specified by the queries as query bit-vectors. The query bit-vector is generated based on a mapping function predefined for each non-spatial attribute ∈ A. If is a categorical attribute with categories , given a non-spatial value ∈ specified by a query q on , its mapping function maps into a bit-string such that = ‘1’ if , otherwise, = ‘0’.
On the other hand, if is a numerical attribute, divides ’s domain into disjoint intervals of equal length. Then, given a non-spatial interval , maps into a bit-string such that = “1” if overlaps with , otherwise, = “0”. If overlaps with more than one interval, say () intervals, then we consider q as distinct queries.
Definition 2. Given a query q = (, ), suppose that there is a predefined mapping function for each non-spatial attribute ∈ A. Then, a query bit-vector generated for is (q.) + (q.) + ⋯ + (q.), where + denotes the bit-string concatenation operator. When does not contain the specified value (or interval) on , the bit-string for (q.) becomes with its length being equal to (), where the symbol “*” denotes a “don’t care” condition. Although a bit can represent only two states “0” and “1”, we assume that one bit represents “0”, “1”, and “*” for convenience.
In the following, using the non-spatial values (or intervals) specified on a subset of A = {: Age, : Dietary preference, : Gender} in Figure 3 as an example, we show how query bit-vectors for are generated. Suppose that there are three predefined mapping functions:
Then, the query bit-vectors , , , , and generated for , , , , and are 01000110 (0100 + 01 + 10), 00100101 (0010 + 01 + 01), (0100 + + 10), ( + 10 + 01), and 01001001 (0100 + 10 + 01), respectively.
Given a set of queries = , we partition into a set of query groups = such that each query group consists of the queries that have the same query bit-vector. Then, each query group can be identified by a unique query bit-vector, which we call group bit-vector. Let and be the number of categories per each categorical attribute and the number of intervals per each numerical attribute , respectively, where k () is the number of categorical attributes. Then, the maximum possible number of generated query groups (or the maximum possible number of generated group bit-vectors) is
Figure 4 shows an example of partitioning the queries in Figure 3 into three query groups based on their query bit-vectors . Notice that if a query bit-vector contains bit positions filled with “*”, the corresponding query q can become an element of multiple query groups because “*” is a wildcard, which matches any bit in those positions. For example, the query in Figure 4 can be an element of two query groups; the query group whose group bit-vector is 01000110 and another query group (though not as yet generated) whose group bit-vector is 01001010.
Figure 4.
An example of query grouping.
The GQR-tree is a space partitioning query indexing structure, which is built by recursively splitting two-dimensional entire workspace into two subspaces. Given a set of query groups = on the entire workspace that corresponds to the root, if there exists a query group ) whose cardinality (i.e., the number of queries that are the elements of ) is greater than the split threshold θ, the entire workspace is split into two subspaces, each of which corresponds to a child node N of the root. Without ambiguity, we use the symbol “N” to denote both a tree node and its corresponding subspace. This process recursively continues until, for each ), the number of its elements (queries) whose spatial query ranges are covered by or partially intersect every subspace N is no more than θ. Hereafter, we denote a set of ’s elements whose spatial query ranges are covered by or partially intersect N as (). We classify the overlap relationship between a spatial query range and a subspace (i.e., GQR-tree node) N into four categories according to whether the intersection and difference of and N are empty or non-empty.
Definition 3. Given a spatial query range and a subspace (a GQR-tree node) N, there can be four overlap relationships as follows.
- Cover relationship (See Figure 5a): We say that covers N if () () (), where − denotes difference.
- Covered by relationship (See Figure 5b): We say that is covered by N if () () ().
- Partially intersect relationship (See Figure 5c): We say that partially intersects N if () () ().
- Equal relationship (See Figure 5d): We say that equals N if () () ().
Figure 5.
Classification of the overlap relationship. (a) and cover N; (b) and are covered by N; (c) and partially intersect N; (d) and equal N.
It should be noted that, in this paper, if a spatial query range meets (or touches) a subspace N, we consider that and N are disjoint although () () (). Now, we describe the structure and properties of the GQR-tree. A leaf node of the GQR-tree stores, for each query group , a tuple of the form , where is a group bit-vector of and is a list that contains at most θ query identifiers. A non-leaf node of the GQR-tree stores two entries of the form , where is a pointer to a child node (i.e., non-leaf or leaf node) and N is a subspace that corresponds to the child node pointed to by .
Definition 4. Given a query group and a leaf node N of the GQR-tree, the list , with its size , contains only the query identifier of each element (query) q whose spatial query range is covered by or partially intersects N (i.e., query identifier of each query q ).
The GQR-tree satisfies the following properties:
- A tuple for each query group can be stored in a leaf node N only if there exists at least one element (query) whose spatial query range is covered by or partially intersects N (i.e., ).
- A tuple for each query group can be redundantly stored in several leaf nodes if there exists an element whose spatial query range partially intersects all of these leaf nodes.
- For each entry stored in a non-leaf node N, represents one of the equal halves of N’s space.
- Each (non-leaf or leaf) node N stores, for each query group , the cardinality of (i.e., the total number of ’s elements whose spatial query ranges are covered by or partially intersect N). In case that N is a non-leaf node, N additionally stores, for each query group , a single bit flag , which is set to if 0 ≤ ≤ θ and set to otherwise.
- Each (non-leaf or leaf) node N is associated with a data structure , which is a set of tuples of the form , where is a group bit-vector of a query group and (See Definition 5 below) is a list that contains arbitrary number of query identifiers.
- A tuple for a query group can be maintained in only if there exists at least one element whose spatial query range covers or equals N.
- Each non-leaf node N is associated with another data structure , which is a set of tuples of the form , where and are defined as in the case of a leaf node.
- For each non-leaf node N, if a flag for a query group is set to , N is considered as the leaf node from the viewpoint of , and only if ≥ 1, a tuple for can be maintained in .
- For each non-leaf node N, if N is considered as the leaf node from the viewpoint of , no information about is stored in N’s descendant nodes and their associated s (if exist) and s.
Definition 5. Given a query group and a (non-leaf or leaf) node N of the GQR-tree, the list with arbitrary size contains only the query identifier of each element (query) q whose spatial query range covers or equals N.
The GQR-tree method (GQRT) has three advantages over the existing methods (e.g., MQM, QRT, and BQRT).
First, GQRT overcomes the first drawback of the existing methods (MQM, QRT, and BQRT) mentioned in Section 4. In contrast to the existing methods, in GQRT, the capability of each moving object o is measured by the number of only the spatial query ranges that are non-spatially relevant to o without any additional complex computation. Specifically, when assigning the resident domain to o, the GQR-tree enables to be measured by the number of only the queries that are the elements of the query group whose group bit-vector is matched to the object bit-vector of o. We say that is matched to or vice versa if ∧ = , where ∧ denotes bit-wise AND-ing. This helps the server assign o much larger resident domain, and thus the number of messages sent by o can be reduced. We represent non-spatial attribute values of o as object bit-vector. The object bit-vector is generated based on the same mapping functions used for generating the query bit-vector.
Definition 6. Given a moving object o = (, ) and a set of predefined mapping functions for a set of A = , an object bit-vector generated for is (o.) + (o.) + ⋯ + (o.).
For example, the object bit-vector generated for non-spatial attribute values = { } of the object with its capability in Figure 3 is 01000110 (0100 + 01 + 10). Then, because the group bit-vector of the query group in Figure 4 is matched to (i.e., ∧ = ), is measured by the number of only the queries that are the elements of . Because the total number of ’s elements () is not greater than , can be assigned the entire space in Figure 3 as its resident domain.
Second, GQRT overcomes the second drawback of MQM and QRT mentioned in Section 4. In GQRT, each moving object o sends messages to the server only when necessary because the server assigns o its resident domain together with only the qualified spatial query ranges such that the corresponding queries are the elements of the query group with its group bit-vector being matched to the object bit-vector . Continuing the example above, in Figure 3 can be assigned the entire space as its resident domain together with and because the corresponding queries and , respectively, are the elements of the query group , and thus ’s movement may affect only the results of and . In addition, by associating each GQR-tree node N with , GQRT further reduces the number of messages sent by moving objects based on the following lemma.
Lemma 1. Given a GQR-tree node N, , and a query q that is an element of some query group , if the query identifier of q is contained in of the tuple , every moving object o whose object bit-vector is matched to , and that is currently moving within N cannot cross the boundary of q’s spatial query range .
Proof. We prove this lemma by contradiction. Given a GQR-tree node N, let us assume that there exist (i) a moving object o whose object bit-vector is matched to the group bit-vector of some query group and (ii) a query q () whose query identifier is contained in of the tuple . By Definition 5, we know that the spatial query range of q covers or equals N. Let us further assume that we can find o, which crosses the boundary of but not that of N. Then, the condition holds. This leads to a contradiction to the cover relationship or equal relationship defined in Definition 3. Hence, o cannot cross the boundary of as long as it is moving within N. ☐
Based on Lemma 1, when assigning N to a moving object o as its resident domain together with qualified spatial query ranges, for each spatial query range among them, if the query identifier of the corresponding query q is contained in of the tuple , i.e., if covers or equals N, the server can exclude ; instead, when the server receives the message from o, it has to check whether the result of q is affected by o’s movement and update the result of q (if necessary). Therefore, given a GQR-tree node N and a moving object o with its object bit-vector being matched to the group bit-vector of some query group , if (i) N contains the location of o and (ii) , the server can assign N to o as its resident domain together with only the spatial query ranges of the queries that are elements of (), i.e., spatial query ranges that are covered by or partially intersect N, among the qualified spatial query ranges.
Assuming , Figure 6 shows an example of some sub-GQR-tree rooted at the node . In the figure, assuming the capability is 1 and the object bit-vector is matched to the group bit-vector of the query group (i.e., ∧ = ), the moving object is assigned as its resident domain together with the spatial query range because contains the location of and () ≤ . It should be noted that the spatial query range is not assigned to because the query identifier of the corresponding query is contained in of the tuple maintained in (i.e., because covers ). When exits its resident domain as depicted in Figure 6, it sends the message to the server. Then, the server assigns a new resident domain and additionally checks if ’s movement affects the result of . Because does not cross the boundary of , the server need not update the current result of .
Figure 6.
An example of the sub-GQR-tree.
Third, by grouping the issued queries according to their query bit-vectors, GQRT efficiently handles the case, where a leaf node N overlaps with spatial query ranges as a result of a newly issued query q. In the existing methods (MQM, QRT, and BQRT), without any consideration of non-spatial query values (or intervals), N is recursively split until all of its descendant nodes (i.e., subspaces of N) overlap with no more than θ spatial query ranges. On the other hand, in GQRT, if q is an element of some query group and , no split process occurs although spatial query ranges overlap with N. In case that , N is recursively split until, for each descendant node , .
5.2. Resident Domain Search
When a new moving object o is registered at the server (or the server receives the message from o), the search algorithm for o’s resident domain is invoked. Algorithm 1 is the pseudocode of the search algorithm on the GQR-tree. Given a GQR-tree node N (initially set to the root) and a moving object with its capability , the search algorithm generates an object bit-vector and identifies the query group such that ∧ = . Then, the search algorithm recursively accesses the GQR-tree nodes that contain until reaching the node N such that . Now, N becomes o’s resident domain.
| Algorithm 1 Search(N, o) |
| Input N: a GQR-tree node initially set to the root, o: a moving object Output R: o’s resident domain, : a set of (distinct) query identifiers 1: map to ; 2: initialize an empty set ; 3: identify the query group such that ∧ = ; 4: for each entry stored in N do 5: if contains then 6: if then 7: set R to ; 8: set to ; // one-bit flag 9: FindQueryID ; 10: return R and ; 11: else 12: Search(, o); |
Next, the search algorithm invokes FindQueryID (See Algorithm 2), which is a depth-first search algorithm that takes N, , and (one-bit flag) as an input and retrieves all the query identifiers of the queries that are elements of (⊆ ). Specifically, assuming N is a non-leaf node, FindQueryID identifies the query group such that ∧ = . Then, FindQueryID checks if stored in N for is set to (i.e., 0 ≤ ≤ θ). If so, it visits and retrieves all the query identifiers contained in of the tuple (Lines 2–8).
On the other hand, if stored in N for is set to , FindQueryID recursively accesses each N’s descendent (non-leaf or leaf) node (Lines 9–12 or 26–28) and according to two cases, it proceeds as follows:
- Case (1): If is a non-leaf node and stored in for is set to , FindQueryID visits and , after which it retrieves all the distinct query identifiers contained in of the tuple and of the tuple (Lines 19–25).
- Case (2): If is a leaf node, FindQueryID retrieves all the distinct query identifiers contained in of the tuple (stored in ), after which it visits and retrieves all the distinct query identifiers contained in of the tuple (Lines 29–34).
It should be noted that must be visited and each query identifier contained in must be retrieved and checked if the corresponding query . This is because, although the spatial query range of q covers or equals , they may be covered by or partially intersect N. In the worst case, N (o’s resident domain) may be a leaf node. In this case, FindQueryID retrieves only the query identifiers contained in of the tuple stored in N (Lines 13–16).
| Algorithm 2 FindQueryID() |
| Input N: a GQR-tree node, : an object bit-vector, : a bit flag initially set to Output : a set of (distinct) query identifiers 1: initialize an empty set ; 2: if = then 3: identify the query group such that ∧ = ; 4: if N is a non-leaf node then 5: if stored in N for is then 6: visit and get the tuple ; 7: retrieve all the query identifiers contained in and insert them into ; 8: return ; 9: else // stored in N for is 10: set to ; 11: for each entry stored in N do 12: FindQueryID(); 13: else // N is a leaf node 14: get the tuple stored in N; 15: retrieve all the query identifiers contained in and insert them into ; 16: return ; 17: else // = 18: identify the query group such that ∧ = ; 19: if N is a non-leaf node then 20: if stored in N for is then 21: visit and get the tuple ; 22: retrieve all the query identifiers contained in and insert them into ; 23: visit and get the tuple ; 24: retrieve all the query identifiers contained in and insert them into ; 25: return ; 26: else // stored in N for is 27: for each entry stored in N do 28: FindQueryID(); 29: else // N is a leaf node 30: get the tuple stored in N; 31: retrieve all the query identifiers contained in and insert them into ; 32: visit and get the tuple ; 33: retrieve all the query identifiers contained in and insert them into ; 34: return ; |
After Algorithm 1 terminates, the server searches all the queries (in the query table) referred to by the retrieved query identifiers, updates query results if necessary, and assigns the moving object o its resident domain N together with query identifier and spatial query range pairs. Figure 7 shows an example of the GQR-tree for the queries shown in Figure 3, assuming . Let us assume that the non-spatial attribute values of the moving object with in Figure 7 is { }. Then, the object bit-vector of is 01000110 and is matched to . When is registered at the server, starting from the root, the search algorithm recursively traverses the GQR-tree until it reaches the node because contains the location of and () ≤ . Then, the search algorithm invokes FindQueryID(), which retrieves the query identifier of . After the search algorithm terminates, the server assigns to as it resident domain together with a pair of query identifier and spatial query range ().
Figure 7.
An example of the Group-Aware Query Region (GQR)-tree.
5.3. GQR-Tree Manipulations
The GQR-tree can be manipulated with a set of algorithms, which specify how a query is inserted into and deleted from the GQR-tree, and how overflow and underflow of a GQR-tree node can be managed.
Algorithm 3 is the pseudocode of the insert algorithm. When a new query is issued by a client and is inserted into the query table, the insert algorithm generates a query bit-vector , identifies the query group whose group bit-vector is same as (Lines 1–2). Then, starting from the root, the insert algorithm recursively follows the paths of the GQR-tree, each of which consists of non-leaf and leaf nodes with which the spatial query range of q overlaps. At a non-leaf node N in each path, the insert algorithm checks if covers or equals N (Line 4). If so, it inserts the query identifier of q into of the tuple maintained in (Line 5). Otherwise (i.e., is covered by or partially intersects N), the insert algorithm increases by 1 and checks if stored in N for is set to (Lines 6–8). If so, it inserts the query identifier of q into of the tuple maintained in and stops following the corresponding path of the GQR-tree (Line 9). In case that becomes greater than θ due to the insertion of q, SplitNonLeaf, a split algorithm for a non-leaf node, is invoked (Line 10).
When reaching a leaf node N in the path, the insert algorithm checks if covers or equals N (Line 16). If so, it inserts the query identifier of q into of the tuple maintained in (Line 17). Otherwise, the insert algorithm increases by 1 and inserts the query identifier of q into of the tuple stored in N (Lines 18–20). When N overflows (i.e., ), SplitLeaf, a split algorithm for a leaf node, is invoked (Line 21).
| Algorithm 3 Insert(N, q) |
| Input N: a GQR-tree node initially set to the root, q: a newly issued query 1: map to ; 2: identify the query group whose group bit-vector is same as ; 3: if N is a non-leaf node then 4: if covers or equals N then 5: insert the query identifier of q into of the tuple maintained in ; 6: else // is covered by or partially intersects N 7: increase by 1; 8: if stored in N for is then 9: insert the query identifier of q into of the tuple maintained in ; 10: SplitNonLeaf() in case that ; 11: else // for is 12: for each entry stored in N do 13: if overlaps with then 14: Insert(, q); 15: else // N is a leaf node 16: if covers or equals N then 17: insert the query identifier of q into of the tuple maintained in ; 18: else // is covered by or partially intersects N 19: increase by 1; 20: insert the query identifier of q into of the tuple stored in N; 21: SplitLeaf() in case that ; |
Algorithm 4 is the pseudocode of SplitNonLeaf. Given a non-leaf node N and a group bit-vector , SplitNonLeaf identifies the query group , which causes N to be overflowed, using (Line 1). Then, SplitNonLeaf sets stored in N for to (Line 2) and according to two cases, it proceeds as follows:
- Case (1): If N’s children are non-leaf, SplitNonLeaf copies the tuple maintained in and pastes it into s of N’s children. (Line 4). Next, given the tuple maintained in , for each query q referred to by each query identifier contained in , SplitNonLeaf checks for each child node if covers or equals . If so, it inserts the query identifier of q into of the tuple maintained in (Lines 5–9). On the other hand, if is covered by or partially intersects , SplitNonLeaf increases by 1, creates a new tuple for in (if it does not exist), and inserts the query identifier of q into (Lines 10-13). Then, SplitNonLeaf deletes the tuple from (Line 14). Finally, for each N’s child node , SplitNonLeaf checks if . If so, it sets stored in for to (Lines 15–17). Otherwise, SplitNonLeaf invokes itself with and as an input (Lines 18–19).
- Case (2): If N’s children are leaf, similarly to the case (1), SplitNonLeaf copies the tuple maintained in and and pastes it into s of N’s children (Line 21). Next, given maintained in , for each q referred to by each query identifier contained in , SplitNonLeaf checks for each child node if covers or equals . If so, it inserts the query identifier of q into of the tuple maintained in (Lines 22–26). On the other hand, if is covered by or partially intersects , SplitNonLeaf increases by 1, inserts a new tuple for into (if it does not exist), and inserts the query identifier of q into (Lines 27–30). Then, SplitNonLeaf deletes the tuple from (Line 31). In case that each N’s child node overflows (i.e., ), SplitNonLeaf invokes SplitLeaf with and as an input (Lines 32–34).
| Algorithm 4 SplitNonLeaf() |
| Input N: an overflowed non-leaf node, : a group bit-vector 1: identify the query group , which causes N to be overflowed, using ; 2: set stored in N for to ; 3: if N’s children are non-leaf nodes then 4: copy the tuple maintained in and paste it into s of N’s children; 5: visit and get the tuple ; 6: for each query q referred to by each query identifier contained in do 7: for each N’s child node do 8: if covers or equals then 9: insert the query identifier of q into of the tuple maintained in ; 10: else if is covered by or partially intersects then 11: increase by 1; 12: create a new tuple for in (if it does not exist); 13: insert the query identifier of q into ; 14: delete the tuple from ; 15: for each N’s child node do 16: if then 17: set stored in for to ; 18: else 19: SplitNonLeaf(); 20: else // N’s children are leaf nodes 21: copy the tuple maintained in and paste it into s of N’s children; 22: visit and get the tuple ; 23: for each query q referred to by each query identifier contained in do 24: for each N’s child node do 25: if covers or equals then 26: insert the query identifier of q into of the tuple maintained in ; 27: else if is covered by or partially intersects then 28: increase by 1; 29: insert a new tuple for into (if it does not exist); 30: insert the query identifier of q into ; 31: delete the tuple from ; 32: for each N’s child node do 33: if then 34: SplitLeaf(); |
Algorithm 5 is the pseudocode of SplitLeaf. Given a leaf node N and a group bit-vector , SplitLeaf identifies the query group , which causes N to be overflowed (using ), after which it creates two new empty leaf nodes and , and a new non-leaf node that stores entries and , where or represents one of the equal halves of N (Lines 1–4). Now, and become ’s children. Then, SplitLeaf copies the tuple maintained in and pastes it into , , and (Line 5). In addition, for each query group such that , SplitLeaf (i) copies the tuple stored in N and pastes it into , and (ii) sets and created in for to and , respectively (Lines 6–8). Then, SplitLeaf sets and created in for to || and , respectively, after which it finds the entry stored in N’s parent to redirect to point to (Lines 9–10). Now, N’s parent becomes ’s parent.
| Algorithm 5 SplitLeaf() |
| Input N: an overflowed leaf node, : a group bit-vector 1: identify the query group , which causes N to be overflowed, using ; 2: create two new empty leaf nodes and ; 3: create a new empty non-leaf node ; 4: insert entries and into ; 5: copy the tuple maintained in and paste it into , , and ; 6: for each group such that do 7: copy the tuple stored in N and paste it into ; 8: set and created in for to and ; 9: set and created in for to || and ; 10: find the entry stored in N’s parent and redirect to point to ; 11: get the tuple from N; 12: for each query q referred to by each query identifier contained in do 13: for each ’s child node do // we use to denote or 14: if covers or equals then 15: insert the query identifier of q into of the tuple maintained in ; 16: else if is covered by or partially intersects then 17: increase by 1; 18: insert a new tuple for into (if it does not exist); 19: insert the query identifier of q into ; 20: discard N; 21: for each ’s child node do 22: if then 23: SplitLeaf(); |
Next, given the tuple stored in N, SplitLeaf checks for each query q referred to by each query identifier contained in if covers or equals (or ). If so, it inserts the query identifier of q into of the tuple maintained in (or ) (Lines 11–15). On the other hand, if is covered by or partially intersects (or ), SplitLeaf increases (or ) by 1 and inserts a new tuple for into (or ) (if it does not exist), and inserts the query identifier of q into (Lines 16–19). Finally, SplitLeaf discards N (Line 20). This split process propagates downward if necessary (Lines 21–23).
When an existing query is terminated by a client and is deleted from the query table, the delete algorithm is invoked. Algorithm 6 is the pseudocode of the delete algorithm. Similarly to the insert algorithm, after identifying the query group whose group bit-vector is same as the query bit-vector of q (Lines 1–2), the delete algorithm recursively follows the paths of the GQR-tree, each of which consists of the non-leaf and leaf nodes that overlap with the spatial query range of q.
At a non-leaf node N in each path, the delete algorithm checks if covers or equals N. If so, it deletes the query identifier of q from of the tuple maintained in (Lines 4–5). Otherwise (i.e., is covered by or partially intersects N), the delete algorithm decreases by 1 and checks if stored in N for has already set to . If so, it deletes the query identifier of q from of the tuple maintained in and stops following the corresponding path of the GQR-tree (Lines 6–9). Then, the delete algorithm invokes a merge algorithm for a non-leaf node, namely, MergeNonLeaf (Line 10).
| Algorithm 6 Delete(N, q) |
| Input N: a GQR-tree node initially set to the root, q: a terminated query 1: map to ; 2: identify the query group whose group bit-vector is same as ; 3: if N is a non-leaf node then 4: if covers or equals N then 5: delete the query identifier of q from of the tuple maintained in ; 6: else // is covered by or partially intersects N 7: decrease by 1; 8: if stored in N for is then 9: delete the query identifier of q from of the tuple maintained in ; 10: MergeNonLeaf(N’s parent, ); 11: else // for is 12: for each entry stored in N do 13: if overlaps with then 14: Delete(, q); 15: else // N is a leaf node 16: if covers or equals N then 17: delete the query identifier of q from of the tuple maintained in ; 18: else // is covered by or partially intersects N 19: decrease by 1; 20: delete the query identifier of q from of the tuple stored in N; 21: MergeLeaf(N’s parent, ); |
When reaching a leaf node N in the path, the delete algorithm checks if covers or equals N. If so, it deletes the query identifier of q from of the tuple maintained in (Lines 16–17). Otherwise, the delete algorithm decreases by 1 and deletes the query identifier of q from of the tuple stored in N (Lines 18–20). Then, the delete algorithm invokes a merge algorithm for a leaf node, namely, MergeLeaf to condense the GQR-tree if possible (Line 21).
Algorithm 7 is the pseudocode of MergeNonLeaf. Given a non-leaf node N, which is a parent of non-leaf nodes, and a group bit-vector , MergeNonLeaf identifies the query group using (Line 1). Then, MergeNonLeaf checks if . If so, it sets stored in N for to and creates a new tuple for in (Lines 2–4). Next, for each N’s child node , MergeNonLeaf checks if stored in for is set to . If so, given the tuple maintained in , MergeNonLeaf inserts all the query identifiers contained in into of the tuple (Lines 5–8). Next, given the tuple maintained in each , for each query q referred to by each query identifier contained in , MergeNonLeaf checks if is covered by or partially intersects N. If so, it inserts the query identifier of q into of the tuple (Lines 9–12). Finally, MergeNonLeaf deletes the information about stored in all N’s descendant nodes and their associated s (if exist) and s (Line 13). This merge process propagates upward until reaching the node that does not satisfy the merge condition (Line 14).
| Algorithm 7 MergeNonLeaf() |
| Input N: a non-leaf node, which is a parent of non-leaf nodes, : a group bit-vector 1: identify the query group using ; 2: if then 3: set stored in N for to ; 4: create a new tuple for in ; 5: for each N’s child node do 6: if stored in for is then 7: visit and get the tuple ; 8: insert all the query identifiers contained in into of the tuple ; 9: visit and get the tuple ; 10: for each query q referred to by each query identifier contained in do 11: if is covered by or partially intersects N then 12: insert the query identifier of q into of the tuple ; 13: delete the information about stored in all N’s descendant nodes and their associated s (if exist) and s; 14: MergeNonLeaf(N’s parent, ); |
Algorithm 8 is the pseudocode of MergeLeaf. Given a non-leaf node N, which is a parent of leaf nodes, and a group bit-vector , MergeLeaf identifies the query group using (Line 1). Then, MergeLeaf checks if ; if this is the case, it further checks if every stored in N for every query group is set to (Lines 2–3). If so, MergeLeaf creates a new empty leaf node (Line 4). Then, MergeLeaf (i) copies all the tuples maintained in and , and pastes them into and , respectively, and (ii) sets to (Lines 5–6). In addition, MergeLeaf (i) inserts a new tuple for into and (ii) sets to , after which it finds the entry stored in N’s parent to redirect to point to (Lines 7–9). Now, N’s parent becomes ’s parent. Next, given the tuple stored in each N’s child node , MergeLeaf inserts all the distinct query identifiers contained in into of the tuple (Lines 10–12). Then, given the tuple maintained in each , for each query q referred to by each query identifier contained in , MergeLeaf checks if is covered by or partially intersects . If so, it inserts the query identifier of q into of the tuple (stored in ) (Lines 13–16). Finally, after discarding N and N’s children, MergeLeaf invokes itself with ’s parent and as an input to condense the tree if possible (Lines 17–18).
On the other hand, if and there exists some query group such that stored in N for is , MergeLeaf sets stored in N for to and creates a new tuple for in (Lines 19–21). Next, given the tuple stored in each N’s child node , MergeLeaf inserts all the distinct query identifiers contained in into of the tuple (Lines 22–24). Then, given the tuple maintained in each , for each query q referred to by each query identifier contained in , MergeLeaf checks if is covered by or partially intersects N. If so, it inserts the query identifier of q into of the tuple (maintained in ) (Lines 25–28). Finally, after deleting the tuples and from and , respectively, MergeLeaf invokes MergeNonLeaf with N’s parent and as an input (Lines 29–30).
| Algorithm 8 MergeLeaf() |
| Input N: a non-leaf node, which is a parent of leaf nodes, : a group bit-vector 1: identify the query group using ; 2: if then 3: if every stored in N for every query group is then 4: create a new empty leaf node ; 5: copy all the tuples maintained in and , and paste them into and ; 6: set to ; 7: insert a new tuple for into ; 8: set to ; 9: find the entry stored in N’s parent and redirect to point to ; 10: for each N’s child node do; 11: get the tuple from ; 12: insert all the query identifiers contained in into of the tuple ; 13: visit and get the tuple ; 14: for each query q referred to by each query identifier contained in do 15: if is covered by or partially intersects then 16: insert the query identifier of q into of the tuple ; 17: discard N and N’s children; 18: MergeLeaf(’s parent, ); 19: else // if there exists some query group such that stored in N for is 20: set stored in N for to ; 21: create a new tuple for in ; 22: for each N’s child node do 23: get the tuple from ; 24: insert all the query identifiers contained in into of the tuple ; 25: visit and get the tuple ; 26: for each query q referred to by each query identifier contained in do 27: if is covered by or partially intersects N then 28: insert the query identifier of q into of the tuple ; 29: delete the tuples and from and ; 30: MergeNonLeaf(N’s parent, ); |
After the insert algorithm (or the delete algorithm) terminates, the server broadcasts the message (or message) to all the moving objects (registered at the server) to notify them of such a change.
5.4. Cooperative Evaluation of CM Range Monitoring Queries
In this subsection, we describe how each moving object cooperates with the server to evaluate CM range monitoring queries. The cooperative query evaluation consists of server-side tasks and object-side tasks.
5.4.1. Server-Side Tasks
The server performs three main tasks: (i) query registration (or de-registration); (ii) domain assignment; and (iii) query result update.
Query Registration (or De-Registration). When a new query is issued by a client, the server assigns an identifier to q, inserts q into the query table, and invokes Algorithm 3 (i.e., insert algorithm), after which it broadcasts the message to all the moving objects that are registered at the server, where denotes the identifier of q. On the other hand, when an existing query q is terminated by a client, the server deletes q from the query table and invokes Algorithm 6 (i.e., delete algorithm). Then, the server broadcasts the message.
Domain assignment. In addition to the main data structures, namely the query table and the GQR-tree, the server maintains an object table (hashed on object identifiers), which stores for each moving object o, an identifier, a location (from the last message or message), a set of non-spatial attribute values , and a capability . When a new moving object is registered at the server with its capability , the server assigns an identifier to o, inserts o into the object table, and invokes Algorithm 1 (i.e., search algorithm). Then, the server assigns a resident domain N to o together with query identifier and spatial query range pairs. When the server receives the message from o, where , , and denote the identifier, current location, and previous resident domain of o, respectively, it visits the object table and sets of o (referred to by ) to . Next, the server invokes Algorithm 1 and assigns a new resident domain to o together with new pairs of query identifiers and spatial query ranges. Finally, the server visits and gets the tuple such that ∧ = , after which it checks if the movement of o affects the result of each query q referred to by each query identifier contained in . (Note: the object bit-vector of o has already generated in Algorithm 1.) If so, the server update the result of q.
Query Result Update. When the server receives the ) from a moving object o, it visits the query table and checks if the result of the query q (referred to by ) contains . If so, the server inserts o into the result of q. Otherwise, the server removes o from the result of q.
5.4.2. Object-Side Tasks
Each moving object o maintains its current resident domain N and a local query table (hashed on query identifiers), which stores, for each query , an identifier and a spatial query range . Whenever o changes its location, it monitors its spatial relationships with N and spatial query ranges stored in the local query table. In particular, when o moves, it checks if it exits N or crosses any of the boundary of spatial query ranges stored in the local query table. If o exits N, it sends the message to the server. On the other hand, if o crosses some spatial query range stored in the local query table, it sends the ). In addition, o expects the following broadcast messages from the server and processes them as follows:
- : When receives the message from the server, given the query , it checks if (i) contains and (ii) it is matched to , i.e., or ∈ (assuming a set of non-spatial attributes A=). If this is the case, o sends the ) message to the server in order to let the server insert o into the result of q. Next, o checks if is covered by or partially intersects its current resident domain N. If so, it inserts and into the local query table. It should be noted that if the number of query identifier and spatial query range pairs stored in the local query table becomes greater than the capability of o due to the insertion, o sends the message to the server in order to receive a new resident domain (together with new query identifier and spatial query range pairs).
- : When o receives the message from the server, it just deletes the pair of and from the local query table if the pair is stored in the local query table.
6. Performance Evaluation
In this section, we evaluate and compare the performance of GQRT with that of SR [], MQM [], QRT [], and BQRT [] in terms of the server workload and communication cost. The server workload was measured in terms of the CPU-time that the server takes for evaluation of CM range monitoring queries. On the other hand, the communication cost was measured by the total number of messages transmitted between the server and moving objects. The simulations were conducted on Intel Xeon E5-2620 6-core Processor with 8GB RAM running on the Linux system.
6.1. Simulation Setup
Our simulations were based on two sets of queries, Uniform and Skewed, with the workspace fixed at 50 km × 50 km square. In Uniform, spatial query ranges are uniformly placed on the workspace. On the other hand, in Skewed, the distribution of spatial query ranges on the workspace follows the Zipf distribution with skew coefficient . Each spatial query range in both Uniform and Skewed is a square. The movements of the moving objects that we generated follow the random waypoint model [], which is one of the most widely used mobility models: each moving object chooses a random point of destination on the workspace and moves to the destination at a constant speed distributed uniformly from 0 to maximum speed, which we set to 50 km/h. Upon reaching the destination, it remains stationary for a certain period of time. When this period expires, the moving object chooses a new destination and repeats the same process during the simulation time steps. The computational capability of each moving object was randomly selected from the range between 25 and 100 spatial query ranges, and thus the threshold value θ of the BP-tree (used in MQM), QR-tree (used in QRT), BQR-tree (used in BQRT), and GQR-tree was set to 25. For SR, we used the grid indexes for indexing queries and safe regions.
Each non-spatial attribute is assumed to be categorical because numerical attribute can be replaced with the categorical attribute by discretizing the domain of . The domain of a is 32 and the distribution of each non-spatial attribute value of each moving object o follows the Zipf distribution with skew coefficient . Each non-spatial value specified on a subset of A by each query q in both Uniform and Skewed follows the same distribution. We list the set of used parameters and their default values (stated in boldface) in the simulations in Table 2. In each simulation, we evaluated the effect of one parameter while the others were fixed at their default values. We ran each simulation for 1000 simulation time steps and measured the average of the CPU-time (in ms) and total number of messages. At each time step, 10% of queries in Uniform and Skewed were set to be updated (i.e., reinserted after they are deleted). Note that this update rate is sufficient to study the performances of SR, MQM, QRT, BQRT, and GQRT because these methods focus on dealing with stationary or quasi-stationary queries.
Table 2.
Simulation parameters and their values.
| Simulation Parameter | Value Used (Default) |
|---|---|
| Cardinality of Uniform/Skewed | 1000 ∼ 10,000 (5000) |
| Side length of spatial query ranges | 500 m ∼ 5000 m (2500 m) |
| Number of moving objects | 10,000 ∼ 100,000 (50,000) |
| Number of non-spatial attributes | 1 ∼ 10 (5) |
6.2. Simulation Results
6.2.1. Effect of the Number of Queries
In the first simulation, we varied the cardinalities of Uniform and Skewed from 1000 to 10,000 and studied the effect of the number of queries on the server workload and communication cost. The purpose of this simulation was to show the scalability of GQRT with regard to the number of queries. Figure 8 shows the effect of the number of queries (i.e., cardinalities of Uniform and Skewed) on the CPU-time the server takes for query evaluation. In MQM, QRT, BQRT, and GQRT, the CPU-time performance is mainly affected by the search process for assigning resident domains to moving objects, whereas, in SR, the CPU-time performance is mainly affected by safe region computation. As shown in the figure, SR performs worst for Uniform because as the number of queries becomes larger, the size of a safe region assigned to each moving object o becomes smaller. Therefore, o easily exits its current small safe region and contacts the server in order to receive a new safe region. This leads the server to frequently determine o’s new safe region with intensive computation. It is also observed from the figure that BQRT and GQRT perform much better than QRT and MQM for Uniform and Skewed. This is due to the fact that the BQR-tree and GQR-tree store the bit-vector information in order to assign each moving object o a larger resident domain. As a result, the server can reduce the frequency of search process for assigning a new resident domain to o that exits its current resident domain.
Figure 8.
CPU-time vs. cardinalities of Uniform and Skewed. (a) Uniform; (b) Skewed.
However, GQRT performs much better than BQRT. This is because the BQR-tree is a naïve form of the enhanced QR-tree, where tree construction is based mostly on the spatial information, and thus, similarly to MQM and QRT, in the BQRT, when assigning a resident domain to o, the capability of o is measured by the number of spatial query ranges without any consideration of the non-spatial information. On the other hand, in GQRT, when assigning the resident domain to o, the GQR-tree, which groups the queries according to their non-spatial information when being built on their spatial query ranges, enables to be measured by the number of only the queries that are the elements of the query group whose group bit-vector is matched to the object bit-vector of o. This helps the server assign a larger resident domain to o. GQRT takes 76.2% of the server workload, as compared to BQRT for Uniform. Meanwhile, GQRT takes 67.7% of the server workload, as compared to BQRT for Skewed.
Figure 9.
Total number of messages vs. cardinalities of Uniform and Skewed. (a) Uniform; (b) Skewed.
Figure 9 shows the effect of the number of queries on the total number of messages communicated between the server and moving objects. As the number of queries increases, the performances of all the methods degrade. However, BQRT and GQRT outperform SR, MQM, and QRT for Uniform and Skewed. This is because, in BQRT and GQRT, the server can assign moving objects large resident domains together with only qualified spatial query ranges with the help of bit-vector information. This not only makes the moving objects to reduce the number of sending messages and messages to the server for receiving new resident domains and letting the server update some query results, respectively, but also makes the server to reduce the communication overhead for assigning new resident domains to the moving objects. We note that, however, GQRT performs better than BQRT because the server in GQRT assigns much larger resident domains to the moving objects than that in BQRT for the reason mentioned in the description of Figure 8. Under the default parameter settings, the average sizes of resident domains assigned to the moving objects in GQRT and BQRT for Uniform are 58.7 km and 37.5 km, respectively. On the other hand, those in GQRT and BQRT for Skewed are 52.4 km and 34.1 km, respectively. It is also observed from the figure that SR performs the worst for Uniform, whereas MQM performs the worst for Skewed due to the limitations of the BP-tree used in MQM. The details of the limitations of the BP-tree are described in our previous paper []. In all the cases, GQRT performs the best in all the cases. As compared to SR, MQM, QRT, and BQRT, GQRT incurs , , , and respectively, of the communication cost for Uniform. On the other hand, GQRT incurs , , , and of the communication cost as compared to SR, MQM, QRT, and BQRT, respectively, for Skewed.
6.2.2. Effect of the Size of Spatial Query Ranges
In this simulation, we varied the side length of spatial query ranges from 500 m to 5000 m to examine how the size of spatial query ranges affects the performances of SR, MQM, QRT, BQRT, and GQRT.
As shown in Figure 10, GQRT performs much better and are less sensitive to this parameter than SR, MQM, QRT, and BQRT for Uniform and Skewed. As the side length of each spatial query range becomes longer (i.e., the size of each spatial query range becomes larger), the excessive overlap among spatial query ranges occurs. Excessive overlap among spatial query ranges reduces the size of the safe region assigned to each moving object o, and thus the server in SR should frequently determine o’s new safe region. The excessive overlap among spatial query ranges also increases the number of node split of the BP-tree, QR-tree, and BQR-tree, which incurs huge amount of computation time. In addition, the increment of node splits accelerates height growth of the BP-tree, QR-tree, and BQR-tree, which leads the server to assign smaller resident domains to the moving objects, and thus the server in MQM, QRT, and BQRT frequently searches new resident domains for the moving objects that exit their small resident domains. On the other hand, GQRT is nearly not affected by the side length of spatial query ranges due to the third advantage of the GQRT over MQM, QRT, and BQRT mentioned in Section 5. As compared to SR, MQM, QRT, and BQRT, GQRT takes , , , and , respectively, of the server workload for Uniform. On the other hand, GQRT takes , , , and of the server workload, as compared to SR, MQM, QRT, and BQRT, respectively, for Skewed.
Figure 10.
CPU-time vs. size of spatial query ranges. (a) Uniform; (b) Skewed.
Figure 11 shows the effect of the side length of spatial query ranges (i.e., the size of spatial query ranges) on the total number of messages. As shown in the figure, BQRT and GQRT perform better than SR, MQM, and QRT for Uniform and Skewed due to the same reason mentioned in the first simulation. On the other hand, SR performs the worst for Uniform, whereas MQM performs the worst for Skewed. This is because longer side length of spatial query ranges more negatively affects the performances of SR and MQM than the performance of QRT. In all cases, GQRT achieves the best performance for Uniform and Skewed. As compared to SR, MQM, QRT, and BQRT, GQRT incurs , , , and , respectively, of the communication cost for Uniform. On the other hand, GQRT incurs , , , and of the communication cost as compared to SR, MQM, QRT, and BQRT, respectively, for Skewed.
Figure 11.
Total number of messages vs. size of spatial query ranges. (a) Uniform; (b) Skewed.
6.2.3. Effect of the Number of Moving Objects
In this simulation, we increased the number of moving objects from 10,000 to 100,000 to study how the number of moving objects affects the performances of SR, MQM, QRT, BQRT, and GQRT.
As shown in Figure 12 and Figure 13, as the number of moving objects increases, the overhead of all the methods increases in terms of the CPU-time and the total number of messages. However, in all cases, GQRT outperforms SR, MQM, QRT, and BQRT due to the fact that only GQRT has the ability to fully utilize the capabilities of moving objects. Note that BQRT cannot fully utilize the capabilities of moving objects as mentioned in Section 4.
Figure 12.
CPU-time vs. number of moving objects. (a) Uniform; (b) Skewed.
Figure 13.
Total number of messages vs. number of moving objects. (a) Uniform; (b) Skewed.
6.2.4. Effect of the Number of Non-Spatial Attributes
Finally, we investigated how the number of non-spatial attributes affects the performance of SR, MQM, QRT, BQRT, and GQRT by increasing the number of non-spatial attributes (from 1 to 10).
Figure 14 shows the effect of the number of non-spatial attributes on the CPU-time. It is observed from the figure that the performances of BQRT and GQRT improve as the number of non-spatial attributes increases. This is due to the fact that as the number of non-spatial attributes increases, the server in BQRT and GQRT can utilize more non-spatial information when assigning resident domains to the moving objects. However, GQRT, which fully utilizes the non-spatial information, performs much better than BQRT. GQRT takes 64.3% of the server workload, as compared to BQRT for Uniform. On the other hand, GQRT takes 52.9% of the server workload, as compared to BQRT for Skewed. Note that SR, MQM, and QRT are practically unaffected by the number of non-spatial attributes.
Figure 14.
CPU-time vs. number of non-spatial attributes. (a) Uniform; (b) Skewed.
Figure 15 shows the effect of the number of non-spatial attributes on the total number of messages. As expected, the performances of BQRT and GQRT improve as the value of the number of non-spatial attributes increases. However, it is observed from the figure that GQRT outperforms BQRT in all cases for Uniform and Skewed. As compared to BQRT, GQRT incurs only and of the communication cost for Uniform and Skewed, respectively.
Figure 15.
Total number of messages vs. number of non-spatial attributes. (a) Uniform; (b) Skewed.
7. Conclusions
In this paper, we addressed the problem of the efficient and scalable evaluation of content-matched range monitoring queries (CM range monitoring queries). Given a set of geographically distributed moving objects, the primary goal of our study is to keep the results of queries up to date, while incurring the minimum communication cost and server workload by letting the moving objects evaluate several queries that are relevant to them. To achieve this, we used the resident domain concept and proposed a novel query indexing structure, namely the group-aware query region tree (GQR-tree). For the tight integration of the spatial and the non-spatial specifications of the CM range monitoring queries, The GQR-tree groups the queries according to their non-spatial query values (i.e., non-spatial information) when being built on their spatial query ranges (i.e., spatial information). We carried out a series of comprehensive simulations and demonstrated that the GQR-tree method outperform the existing methods, validating the effectiveness of the GQR-tree.
Acknowledgments
This research was supported by Basic Science Research Program through the National Research Foundation of Korea (NRF) funded by the Ministry of Education (NRF- 2013R1A1A2061269) and the ICT R&D program of MSIP/IITP (1391105003).
Author Contributions
All authors significantly contributed to the manuscript. HaRim Jung and MoonBae Song initiated the idea, developed the research concept, and wrote the manuscript. Hee Yong Youn and Ung-Mo Kim oversaw all of the work and revised the manuscript.
Conflicts of Interest
The authors declare no conflict of interest.
References
- Jung, H.; Kim, Y.S.; Chung, Y.D. QR-tree: An efficient and scalable method for evaluation of continuous range queries. Inf. Sci. 2014, 274, 156–176. [Google Scholar]
- Cai, Y.; Hua, K.A.; Cao, G.; Xu, T. Real-time processing of range-monitoring queries in heterogeneous mobile databases. IEEE Trans. Mobile Comput. 2006, 5, 931–942. [Google Scholar]
- Cheema, M.A.; Brankovic, L.; Lin, X.; Zhang, W.; Wang, W. Continuous monitoring of distance-based range queries. IEEE Trans. Knowl. Data Eng. 2011, 23, 1182–1199. [Google Scholar] [CrossRef]
- Chen, X.A.; Pang, J.; Xue, R. Constructing and comparing user mobility profiles for location-based services. In Proceedings of the 28th Annual ACM Symposium on Applied Computing, Coimbra, Portugal, 18–22 March 2013.
- Gedik, B.; Liu, L. Mobieyes: A distributed location monitoring service using moving location queries. IEEE Trans. Mobile Comput. 2006, 5, 1384–1402. [Google Scholar] [CrossRef]
- Hu, H.; Xu, J.; Lee, D.L. A generic framework for monitoring continuous spatial queries over moving objects. In Proceedings of the 2005 ACM SIGMOD International Conference on Management of Data, Chicago, IL, USA, 13–16 June 2005.
- Huang, J.L.; Huang, C.C. A proxy-based approach to continuous location-based spatial queries in mobile environments. IEEE Trans. Knowl. Data Eng. 2013, 25, 260–273. [Google Scholar] [CrossRef]
- Ilarri, S.; Mena, E.; Illarramendi, A. Location-dependent query processing: Where we are and where we are heading. ACM Comput. Surv. 2010, 42, 1–73. [Google Scholar] [CrossRef]
- Jung, H.; Kim, Y.S.; Chung, Y.D. SPQI: An Efficient Index for Continuous Range Queries in Mobile Environments. J. Inf. Sci. Eng. 2013, 29, 557–578. [Google Scholar]
- Jung, H.; Cho, B.K.; Chung, Y.D.; Liu, L. On processing location based Top-k queries in the wireless broadcasting system. In Proceedings of the 2010 ACM Symposium on Applied Computing, Sierre, Switzerland, 22–26 March 2010.
- Jung, H.; Chung, Y.D.; Liu, L. Processing generalized k-nearest neighbor queries on a wireless broadcast stream. Inf. Sci. 2012, 188, 64–79. [Google Scholar] [CrossRef]
- Kalashnkov, D.V.; Prabhakar, S.; Hambrusch, S.E. Main memory evaluation of monitoring queries over moving objects. Disrtib. Parallel Database 2004, 15, 117–135. [Google Scholar] [CrossRef]
- Lee, K.C.K.; Zheng, B.; Chen, C.; Chow, C.Y. Efficient index-based approaches for skyline queries in location-based applications. IEEE Trans. Knowl. Data Eng. 2013, 25, 2507–2520. [Google Scholar] [CrossRef]
- Liu, F.; Hua, K.A.; Xie, F. A hybrid communication solution to distributed moving query monitoring systems. Electron. Commer. Res. Appl. 2011, 10, 214–228. [Google Scholar] [CrossRef]
- Mokbel, M.F.; Xiong, X.; Aref, W.G. SINA: Scalable incremental processing of continuous queries in spatio-temporal databases. In Proceedings of the 2004 ACM SIGMOD International Conference on Management of Data, Paris, France, 13–18 June 2004.
- Mouratidis, K.; Bakiras, S.; Papadias, D. Continuous monitoring of spatial queries in wireless broadcast environments. IEEE Trans. Mob. Comput. 2009, 8, 1297–1311. [Google Scholar] [CrossRef]
- Prabhakar, S.; Xia, Y.; Aref, W.G.; Hambrusch, S. Query indexing and velocity constrained indexing: Scalable techniques for continuous queries on moving objects. IEEE Trans. Comput. 2002, 51, 1124–1140. [Google Scholar] [CrossRef]
- Guo, L.; Zhang, D.; Li, G.; Tan, K.; Bao, Z. Location-Aware Pub/Sub System: When Continuous Moving Queries Meet Dynamic Event Streams. In Proceedings of the ACM SIGMOD 2015, Melbourne, VIC, Australia, 31 May–4 June, 2015.
- Wu, K.L.; Chen, S.-K.; Yu, P.S. Efficient processing of continual range queries for location-aware mobile services. Inf. Syst. Front. 2005, 7, 435–448. [Google Scholar] [CrossRef]
- Wu, K.L.; Chen, S.-K.; Yu, P.S. On incremental processing of continual range queries for location-aware services and applications. In Proceedings of the Second Annual International Conference on Mobile and Ubiquitous Systems: Networking and Services, San Jose, CA, USA, 17–21 July 2005.
- Ding, X.; Lian, X.; Chen, L.; Jin, H. Continuous monitoring of skylines over uncertain data streams. Inf. Sci. 2012, 184, 196–214. [Google Scholar] [CrossRef]
- Guttman, A. R-trees: A dynamic index structure for spatial searching. In Proceedings of the 1984 ACM SIGMOD International Conference on Management of Data, Boston, MA, USA, 18–21 June 1984.
- Beckmann, N.; Kriegel, H.-P.; Schneider, R.; Seeger, B. The R*-tree: An efficient and robust access method for points and rectangles. In Proceedings of the 1990 ACM SIGMOD International Conference on Management of Data, Atlantic City, NJ, USA, 23–25 May 1990.
- Roussopoulos, N.; Faloutsos, C. The R+-tree: A dynamic index for multi-dimensional objects. In Proceedings of the 13th International Conference on Very Large Data Bases, Brighton, UK, 1–4 September 1987.
- Saltenis, S.; Jensen, C.; Leutenegger, S.; Lopez, M.A. Indexing the positions of continuously moving objects. In Proceedings of the 2000 ACM SIGMOD International Conference on Management of Data, Dallas, TX, USA, 16–18 May 2000.
- Tao, Y.; Papadias, D.; Sun, J. The TPR*-tree: An optimized spatio-temporal access method for predictive queries. In Proceedings of the 29th International Conference on Very Large Data, Berlin, Germany, 9–12 September 2003.
- Patel, J.M.; Chen, Y.; Chakka, V.P. STRIPES: An efficient index for predicted trajectories. In Proceedings of the 2004 ACM SIGMOD International Conference on Management of Data, Paris, France, 13–18 June 2004.
- Jensen, C.S.; Lin, D.; Ooi, B.C. Query and update efficient B+-tree based indexing of moving objects. In Proceedings of Thirtieth International Conference on Very Large Data Bases, Toronto, ON, Canada, 29 August–3 September 2004.
- Lee, M.L.; Hsu, W.; Jensen, C.S.; Cui, B.; Teo, K.L. Supporting frequent updates in R-trees: A bottom-up approach. In Proceedings of the 29th International Conference on Very Large Data Bases, Berlin, Germany, 9–12 September 2003.
- Song, M.; Kitagawa, H. Managing frequent updates in R-trees for update-intensive applications. IEEE Trans. Knowl. Data Eng. 2009, 21, 1573–1589. [Google Scholar]
- Song, M.; Choo, H.; Kim, W. Spatial indexing for massively update intensive applications. Inf. Sci. 2012, 203, 1–23. [Google Scholar] [CrossRef]
- Al-Khalidi, H.; Taniar, D.; Betts, J.; Alamri, S. Monitoring moving queries inside a safe region. Sci. World J. 2014, 2014. [Google Scholar] [CrossRef] [PubMed]
- Hariharan, R.; Hore, B.; Li, C.; Mehrotra, S. Processing spatial-keyword (SK) queries in geographic information retrieval (GIR) systems. In Proceedings of the 19th International Conference on Scientific and Statistical Database Management, Banff, AB, Canada, 9–11 July 2007.
- Cong, G.; Jensen, C.S.; Wu, D. Efficient retrieval of the top-k most relevant spatial web objects. PVLDB 2009, 2, 337–348. [Google Scholar] [CrossRef]
- Zhang, D.; Chee, Y.; Mondal, A.; Tung, A.; Kitsuregawa, M. Keyword search in spatial databases: Towards searching by document. In Proceedings of the IEEE 25th International Conference on Data Engineering, Shanghai, China, 29 March–2 April 2009.
- Guo, T.; Cao, X.; Cong, G. Efficient algorithms for answering the m-Closest keywords query. In Proceedings of the 2015 ACM SIGMOD International Conference on Management of Data, Melbourne, Australia, 31 May–4 June 2015.
- Cao, X.; Cong, G.; Jensen, C.S.; Yiu, M.L. Retrieving regions of interest for user exploration. PVLDB 2014, 7, 733–744. [Google Scholar] [CrossRef]
- Broch, J.; Maltz, D.A.; Johnson, D.; Hu, Y.-C.; Jetcheva, J. A performance comparison of multi-hop wireless ad hoc network routing protocols. In Proceedings of the 4th Annual ACM/IEEE International Conference on Mobile Computing and Networking, Dallas, TX, USA, 25–30 October 1998.
© 2015 by the authors; licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution license (http://creativecommons.org/licenses/by/4.0/).