Spatiotemporal Pattern Queries
Total Page:16
File Type:pdf, Size:1020Kb
Spatiotemporal Pattern Queries Von der Fakult¨atf¨urMathematik und Informatik der FernUniversit¨atin Hagen genehmigte Dissertation zur Erlangung des akademischen Grades eines Doktors der Naturwissenschaften (Dr. rer. nat.) von Mahmoud Attia Sakr Geburtsort: El-Scharkia, Agypten¨ Hagen, 2012 ii Dedicated to the martyrs of the Egyptian revolution Jan 25th 2011. To those who gave their lives to make Egypt a better place for everyone. i ii Aknowledgement goal goal start start When people see my work, they think I have reached these results like this. But actually it was like this! I guess this drawing holds for all research projects. When I saw it some years ago on Facebook, I thought this is really expressive! It was fun going the whole way to finishing this thesis. Without the support of my work group, family and friends, it would not have been possible to reach this end. I gratefully thank all of them and wish them all the best! All thanks and praise to God who has planned all this for me. My adviser Prof. Ralf Hartmut G¨utinghas been actively involved at all stages of this work from writing the proposal to finishing the thesis. He was always available for discussing research issues. I admire his ability to establish such a good relationship with foreign students. Very shortly after I joined his group, he introduced me to his family and friends. Finally, he is one of the few people I know who could beat me at table tennis! Thank you, Hartmut, for all your support, for the friendship, and for being a great teacher! I thank my colleagues in the work group for their patience during the long hours they spent with me helping with my research. I surely needed all the goodwill they have shown towards me. Thanks to Prof. Michael Gertz who accepted to review this thesis, and did the review in a short time. This was essential to me, as I was committed to a limited stay in Germany. I also need to express all my love to my family and to my son. They have carried on my responsibilities in Egypt during my stay in Germany. Despite the distance, they managed to always let me know they were continuously supporting me. iii iv AKNOWLEDGEMENT This work was funded in the first two years by DAAD, with supplemen- tary funds from the Egyptian study mission. The remaining 21 months were funded by the FernUniversit¨atin Hagen, Lehrgebiet Datenbanksysteme f¨ur neue Anwendungen, Prof. Ralf Hartmut G¨uting. Contents i Aknowledgement iii List of Tables ix List of Algorithms xi List of Figures xiii Abstract xv 1 Introduction 1 1.1 Problem Definition . .2 1.2 Thesis Contributions . .3 1.2.1 Individual STP Queries . .4 1.2.2 Group STP Queries . .6 1.2.3 Contributions . 10 1.3 Thesis Organization . 11 2 Related Work 13 2.1 Individual Spatiotemporal Pattern Queries . 13 2.2 Group Spatiotemporal Pattern Queries . 15 3 The Moving Objects Data Model (Review) 19 3.1 The Type System . 19 3.2 SECONDO . 22 3.3 The Query Language . 22 3.4 Time-Dependent Predicates . 24 4 Individual Spatiotemporal Patterns 27 4.1 The Spatiotemporal Pattern Predicate . 29 4.2 Evaluating The STP Predicate . 32 4.3 Extending The Definition Of The STP Predicate . 36 4.4 Optimizing The STP Predicate . 38 4.4.1 Basic Assumptions . 38 4.4.2 Query Optimization . 39 4.5 The Implementation In Secondo ................ 42 4.5.1 Extending The Kernel . 42 v vi CONTENTS 4.5.2 Extending The Optimizer . 43 4.6 Experimental Evaluation . 44 4.6.1 Experiment 1: The Overhead Of Evaluating The STP Predicate . 45 4.6.2 Experiment 2: Run-Time And Optimization Gain . 47 4.6.3 Experiment 3: Scalability . 49 4.7 Conclusions . 53 5 Group Spatiotemporal Patterns 55 5.1 Extending The Type System . 55 5.2 Group Spatiotemporal Pattern Operators . 56 5.2.1 The reportpattern Operator . 59 5.2.2 The gpattern Operator . 60 5.2.3 The crosspattern Operator . 63 5.3 The crosspattern Evaluation Algorithm . 65 5.3.1 Related Work (REVIEW) . 66 5.3.2 The Proposed Algorithm . 67 5.4 Examples . 76 5.5 Optimization . 78 5.5.1 Optimizing The gpattern Operator . 79 5.5.2 Optimizing The crosspattern Operator . 81 5.5.3 Optimizing The reportpattern Operator . 81 5.5.4 Notes On The Implementation . 82 5.6 Experimental Evaluation . 82 5.6.1 Evaluating The gpattern Operator . 82 5.6.2 Evaluating The crosspattern Operator . 86 5.6.3 A Remark . 90 5.7 Conclusions . 91 6 Temporal Reasoning 93 6.1 Temporal Reasoning (REVIEW) . 94 6.2 The Reasoning Task . 95 6.3 Integration With The Individual STP Operators . 97 6.4 Experimental Evaluation . 102 6.4.1 Experiment 1: The Overhead Of Temporal Reasoning . 102 6.4.2 Experiment 2: The Performance Gain Of Temporal Reasoning . 102 6.5 Discussion And Conclusions . 107 7 Application Examples 109 7.1 Air Traffic Control . 109 7.1.1 Missed Approach . 111 7.1.2 Stepwise-Descent Landing . 113 7.2 Ghent City Game . 115 8 Conclusions and Future Work 121 Appendices 123 CONTENTS vii A Experimental Repeatability 125 A.1 Repeating The Individual STP Experiments . 125 A.1.1 Repeating the First Experiment . 125 A.1.2 Repeating the Second Experiment . 126 viii CONTENTS List of Tables 2.1 Examples of the Group STPs . 16 3.1 The type system . 20 4.1 Individual spatiotemporal pattern operators . 28 4.2 A language for expressing interval relationships . 30 4.3 Mapping time-dependent predicates into standard predicates. 41 4.4 The database relations used in the scalability experiment . 50 5.1 The extended type system . 56 5.2 Group spatiotemporal pattern operators . 58 5.3 Composing component states . 72 5.4 Component states occurrence frequencies . 72 5.5 The datasets used for evaluating the gpattern operator . 83 5.6 Description of the datasets of the crosspattern experiment . 89 6.1 Individual STP operators with temporal reasoning . 101 A.1 The schema of the STPQExpr1Result relation . 126 A.2 The schemas of the Expr2StatsDO.csv and Expr2StatsEO.csv files . 127 ix x LIST OF TABLES List of Algorithms 1 The MatchPattern Algorithm . 34 2 The Extend Helper Function . 35 3 The gpattern Algorithm . 63 4 The mbool2mset Helper Function . 63 5 The DeleteUnitsBelowSize Helper Function . 63 6 The DeleteElemsBelowDuration Helper Function . 64 7 The crosspattern Algorithm . 68 8 The FindLargeConnectedComponents Helper Function . 69 9 The FindConnectedComponents Helper Function . 70 10 The IA-To-PA Helper Function . 96 11 MatchPattern With Temporal Reasoning . 98 12 The GetConsistentPeriods Helper Function . 99 xi xii LIST OF ALGORITHMS List of Figures 3.1 The sliced representation of a moving point . 22 3.2 Time-dependent predicates . 25 4.1 Evaluating the STP predicate . 32 4.2 The overhead of evaluating the STP predicate . 47 4.3 The run-time of the STP queries on the Trains20 relation . 49 4.4 Scalability results . 51 5.1 State NewlyAdded followed by state RemoveNow ....... 72 5.2 State NewlyAdded followed by state Split ............ 72 5.3 State Merged followed by state Split .............. 73 5.4 Helper indexes for representing the nodes of the pattern graph 75 5.5 The run-time of the gpattern operator . 85 5.6 The run-time of the crosspattern operator . 90 6.1 Continuous and discontinuous endpoint relationships . 95 6.2 The Decompose vector . 96 6.3 The j operator . 97 6.4 The overhead of temporal reasoning . 103 6.5 The performance gain of temporal reasoning . 105 6.6 Run-time statistics . 106 7.1 Integrating SECONDO with V-Analytics . 111 7.2 Missed approach query results . 113 7.3 Stepwise-descent query results . 115 xiii xiv LIST OF FIGURES Abstract Capturing moving objects data is now possible and becoming cheaper with the advances in positioning and sensor technologies. The increasing amount of such data and the various fields of applications call for intensive research work for building spatiotemporal database management systems. This in- volves several tasks such as modeling the moving objects data, designing query methods, query optimization, etc. This PhD project goes in this direc- tion. Our goal is to design and implement query operators for the Spatiotem- poral Pattern Queries (STP queries). This includes the design of expressive query operators, the integration with the query optimizers for efficient evalu- ation, and the implementation within the context of a spatiotemporal DBMS. In this thesis we distinguish between two kinds of spatiotemporal pat- terns: individual and group, according to the number of objects composing the pattern. Accordingly, two sets of query operators are proposed. An individual STP is a certain movement profile shown by the moving object during its observation period. An example of this is the pattern of a drifting ship. When a ship has engine problems, and the crew has no more control over it, it starts drifting. It moves according to the wind and current. This movement pattern is characterized by low speed and high drifting angle (the difference between the heading and the course over ground). Another example is the holding pattern of aircraft. When the run-way is busy and the landing of an aircraft has to be delayed, it is directed to join the holding pattern. The aircraft flies in circles over a pre-defined area in the airspace of the destination airport until the run-way is ready. The first part of this work proposes query operators for expressing such patterns and matching them on trajectory databases. They allow one to specify temporal order constraints on the fulfillment of several predicates.