Скачать презентацию Smart Home Technologies Data Management and Databases Скачать презентацию Smart Home Technologies Data Management and Databases

a7a007b2e5ce79e80cf52dc96275dea1.ppt

  • Количество слайдов: 42

Smart Home Technologies Data Management and Databases Smart Home Technologies Data Management and Databases

Databases for Smart Homes n n n Requirements Database Types Database Technologies n n Databases for Smart Homes n n n Requirements Database Types Database Technologies n n Smart Home Databases Data Mining

Data Storage Requirements n Sensor data n n n n Temperature (15 @ 8 Data Storage Requirements n Sensor data n n n n Temperature (15 @ 8 Kbps) Humidity (15 @ 8 Kbps) Gas (15 @ 8 Kbps) Light (15 @ 8 Kbps) Motion (15 @ 8 Kbps) Pressure (100 @ 8 Kbps) Microphone (15 @ 500 Kbps) Camera (15 @ 10 Mbps)

Data Storage Requirements n User data n Multimedia n n n Phone messages/conversations (500 Data Storage Requirements n User data n Multimedia n n n Phone messages/conversations (500 Kbps – 10 Mbps) Music (500 Kbps) TV/Radio broadcasts (500 Kbps – 10 Mbps) Home movies (10 Mbps) Images Computer n n n Programs Data files Operating systems

Data Storage Issues n Query frequency and type n Sampling/recording rates n n n Data Storage Issues n Query frequency and type n Sampling/recording rates n n n n 205 sensors (158, 900 Kbps) Multimedia recordings Simultaneous playback Analysis, prediction, decision-making queries Transaction granularity Historical data, decay Security and privacy Centralized vs. distributed

What Data to Store n Type of Data n n Raw data Pre-processed Compressed What Data to Store n Type of Data n n Raw data Pre-processed Compressed Frequency of Data Storage for Sensor Data n Tradeoff between precision and quantity

Sensor Data Example n n n n n 9/8/2002 2: 0: 1 AM~A 5 Sensor Data Example n n n n n 9/8/2002 2: 0: 1 AM~A 5 (Coffee Maker) ON 9/8/2002 1: 6: 59 AM~A 9 (A/C) ON 9/8/2002 3: 58: 52 AM~A 0 (Stereo) ON 9/8/2002 5: 57: 0 AM~A 2 (Kitchen Light) ON 9/8/2002 3: 1: 42 AM~A 5 (Coffee Maker) OFF 9/8/2002 7: 8: 3 AM~A 3 (Stove) ON 9/8/2002 12: 54: 52 PM~A 10 (Bathroom Light) ON 9/8/2002 4: 58: 5 AM~A 0 (Stereo) OFF 9/8/2002 8: 1: 20 AM~A 3 (Stove) OFF 9/8/2002 9: 6: 10 AM~A 8 (Computer) ON 9/8/2002 10: 8: 19 AM~A 4 (Bathtub Heater) ON 9/8/2002 11: 9: 4 AM~A 0 (Stereo) ON 9/8/2002 9: 4: 5 AM~A 8 (Computer) OFF 9/8/2002 10: 9: 4 AM~A 4 (Bathtub Heater) OFF 9/8/2002 2: 2: 5 PM~A 10 (Bathroom Light) OFF 9/8/2002 2: 52: 37 PM~A 0 (Stereo) OFF 9/8/2002 4: 2: 0 PM~A 9 (A/C) OFF

Media Viewing Example Media Viewing Example

Multimedia Example n Digital Silhouettes (Predictive Networks) n Predicting web surfing behavior ($$$) n Multimedia Example n Digital Silhouettes (Predictive Networks) n Predicting web surfing behavior ($$$) n n Microsoft (2002) track TV viewing preferences 140 data items for each user n Demographics (50) n n Subcategories within gender, age, income, education, occupation, and race 90 Content preferences n golf, music, yoga

Database Types / Data Models n n n Relational OO Hybrid (Object-Relational) Temporal Deductive Database Types / Data Models n n n Relational OO Hybrid (Object-Relational) Temporal Deductive Others n Spatial, …

Example Data Representations n Relational n n We all know…flat tables of atomic attributes Example Data Representations n Relational n n We all know…flat tables of atomic attributes with foreign key relationships OO n Complex data reps n n multivalued, composite Temporal n n Relational model: add valid start, end dates to each table (versions of info and when valid) Includes time, events, durations…

Operations n DDL/DML (data def/manip languages) n n n SQL OQL Update operations n Operations n DDL/DML (data def/manip languages) n n n SQL OQL Update operations n n Built-in insert, delete, update Stored procedures for triggers, active (ECA) rules

Example Operations for Temporal Databases n INCLUDES n n n Rows valid in a Example Operations for Temporal Databases n INCLUDES n n n Rows valid in a certain time period BEFORE/AFTER a time condition Set operations n Union, intersection of 2 time periods

Active DB n Event-Condition-Action rules n n Relational n n Allow for decisions to Active DB n Event-Condition-Action rules n n Relational n n Allow for decisions to be made in the database instead of a separate application Implemented as triggers Challenges n Rule consistency n n (2+ rules do not contradict) Guaranteed termination n Trigger loops (T 1 <->T 2)

Smart Home Active DB Example n n Java, Postgres, Jess rules Event classification (local&composite) Smart Home Active DB Example n n Java, Postgres, Jess rules Event classification (local&composite) n Data Manipulation Events n n Temporal Events (instance, recurring) n n Set temp to 70 degrees at 7: 00 am workdays Exception Events n n TV show being viewed (channel, time, genre…) Power failure Behavioral Events n Time children home from school; dinner time

Active DB Example (TCU) Title Event Condition Action TV View Menu TV turned on Active DB Example (TCU) Title Event Condition Action TV View Menu TV turned on Molly is holding remote Display shows matching Molly’s preferences Entry Lighting Inhabitant enters Light level house 15 minutes, inhabitant in TV&lights are on room Always Turn off all devices in the room

Distributed vs. Centralized n Centralized database can produce a bottleneck n n Large volume Distributed vs. Centralized n Centralized database can produce a bottleneck n n Large volume of data input Large database Large volume of queries In distributed databases, data consistency, replication, and retrieval can be more problematic n n n Consistency of schemas Retrieval in case the data location is not known Communication overhead to ensure database consistency

Smart. Home Database Architecture n Centralized vs. distributed? n n n n Answer: Both Smart. Home Database Architecture n Centralized vs. distributed? n n n n Answer: Both Central storage of high demand, persistent data Distributed storage of low demand, dynamic data Distributed queries Push processing toward sensors Adaptive, hierarchical organization End-effector autonomy (“smart sensor”)

Database Systems n Commercial n n n n DB 2 Empress Informix Oracle MS Database Systems n Commercial n n n n DB 2 Empress Informix Oracle MS Access MS SQL Sybase n Free n n n Berkeley DB Postgre. SQL My. SQL

UTA Mav. Home DB n Active n n n Reactive & proactive (e. g. UTA Mav. Home DB n Active n n n Reactive & proactive (e. g. , to predict) Distributed Information collection agents n Rules n n Local Agent: what data they need to collect Distributed: coordinate overall monitoring of collected information Continuous monitoring of events Extension of SNOOP

Microsoft Easy Living DB (2002) n Relational n n World Model DB Describes: n Microsoft Easy Living DB (2002) n Relational n n World Model DB Describes: n n n Fast & robust, but awkward for some data Computing devices People and their personal preferences/settings Services Rooms and doorways Serves as Abstraction Layer between sensors and application that use data from sensors n e. g. new sensors no change to applications

Stanford Interactive Workspace n Uses LORE n A semi-structured XML DB system n n Stanford Interactive Workspace n Uses LORE n A semi-structured XML DB system n n Still available, but work stopped in 2000 Data stored is catalog of (index to) n documents, images, 3 -D models, applicationspecific domain models

Sensor Database Systems n COUGAR project n n n www. cs. cornell. edu/database/cougar Query Sensor Database Systems n COUGAR project n n n www. cs. cornell. edu/database/cougar Query processing over ad-hoc sensor networks Small database component (Query. Proxy) at each sensor Sensor clusters provide local aggregations (e. g. , min, max, mean) Assumes centralized index of all data sources

Siemens Netabase n “The network is the database. ” n n Sensor networks n Siemens Netabase n “The network is the database. ” n n Sensor networks n n Navas and Wynblatt, ACM SIGMOD 2001 Large number of data sources (105) Volatile data and data organization “Thin” data servers on scaled-down hardware Netabase approach n n Query decomposition Characteristic routing (ala IP routing) Local joins Query evaluation

Siemens Netabase n www. netabasesoftware. com Siemens Netabase n www. netabasesoftware. com

Data Warehouses n Repositories for data mining activities n n n Aggregates/summaries of data Data Warehouses n Repositories for data mining activities n n n Aggregates/summaries of data help efficiency Optimized for decision-support, not transaction processing Definition (Elmasri, page 900) n A subject-oriented, integrated, non-volatile, timevariant collection of data in support of management’s decisions” n Replace “management”, with “smart home agents”

Warehouse Properties n n n Very large: 100 gigabytes to many terabytes Tends to Warehouse Properties n n n Very large: 100 gigabytes to many terabytes Tends to include historical data Workload: mostly complex queries that access lots of data, and do many scans, joins, aggregations. Tend to look for "the big picture". Updates pumped to warehouse in batches (overnight) Data may be heavily summarized and/or consolidated in advance (must be done in batches too, must finish overnight). n Research work has been done (e. g. "materialized views") -- a small piece of the problem. 02. 15. 04 from http: //redbook. cs. berkeley. edu/lec 28. html

Data Warehouses n Data Cleaning n n Data Migration: simple transformation rules (replace Data Warehouses n Data Cleaning n n Data Migration: simple transformation rules (replace "gender" with "sex") Data Scrubbing: use domain-specific knowledge (e. g. zip codes) to modify data. Try parsing and fuzzy matching from multiple sources. Data Auditing: discover rules and relationships (or signal violations thereof). Not unlike data mining. Data Loading n n n can take a very long time! (Sorting, indexing, summarization, integrity constraint checking, etc. ) Parallelism a must. Full load: like one big xact – change from old data to new is atomic. Incremental loading ("refresh") makes sense for big warehouses, but transaction model is more complex – have to break the load into lots of transactions, and commit them periodically to avoid locking everything. Need to be careful to keep metadata & indices consistent along the way. 02. 15. 04 from http: //redbook. cs. berkeley. edu/lec 28. html

Data Warehouses 02. 15. 04 from http: //redbook. cs. berkeley. edu/lec 28. html Data Warehouses 02. 15. 04 from http: //redbook. cs. berkeley. edu/lec 28. html

Data Mining Definition n n Discovery of new information in terms of patterns or Data Mining Definition n n Discovery of new information in terms of patterns or rules from vast amounts of data Extracts patterns that can’t readily be found by asking the right questions (queries) n n TOO MUCH DATA FOR HUMANS Emerged from n n n Artificial Intelligence: Machine learning, Neural nets, Genetic Algorithms Statistics Operations Research

Data Mining Steps n n Data selection -- pick the data needed Data cleansing Data Mining Steps n n Data selection -- pick the data needed Data cleansing n n n Enrichment n n n Add data (e. g. , age, gender, income) Data transformation n n Fix bad data (e. g. , spelling, zip codes) Hard to deal with missing, erroneous, conflicting, redundant data Aggregate (e. g. , zip codes regions) Data mining Reporting on discovered Knowledge

Types of Results n Association rules n n Sequential patterns n n Buy house Types of Results n Association rules n n Sequential patterns n n Buy house buy furniture within months Classification trees n n Buy diapers buy lots of beer Types of buyers (upscale, bargain-conscience, …) Why do it? n n Make more money Science & medicine

Data Mining Goals n n Find patterns to predict future events Find major groupings Data Mining Goals n n Find patterns to predict future events Find major groupings n n Groupings of buyers, stars, diseases … Find which group something belongs to n creditworthiness

Data Mining Results n n n n Association rules Classification hierarchies Clustering Sequential patterns Data Mining Results n n n n Association rules Classification hierarchies Clustering Sequential patterns Patterns within time series Type of result, inputs & algorithms vary Often interested in some combination of these types of Knowledge

Clustering n Unsupervised learning techniques n n n Training samples are unclassified Vs. supervised Clustering n Unsupervised learning techniques n n n Training samples are unclassified Vs. supervised learning (classification) Drug categories for depression Categories of TV viewers Categories of buyers (likely, unlikely) Categories of households? n Single male, mother/children, conventional (M/D/kids), DINKs.

Sequential Patterns n n Detecting associations among events with certain temporal relationships Example: n Sequential Patterns n n Detecting associations among events with certain temporal relationships Example: n n Cardiac bypass for blocked arteries AND within 18 months, high blood urea THEN kidney failure likely in next 18 months Particularly important in smart homes

Sequential Pattern Discovery n Sequence of itemsets n Grocery store purchases by 1 person Sequential Pattern Discovery n Sequence of itemsets n Grocery store purchases by 1 person (3 itemsets) n n {soy milk, bread, chocolate}, {bananas, chocolate}, {lettuce, tomato, chocolate} 2 Subsequences n n {soy milk, bread, chocolate}, {bananas, chocolate}, {lettuce, tomato, chocolate}

Sequential Pattern Discovery n The support for a sequence S is the % of Sequential Pattern Discovery n The support for a sequence S is the % of the given set U of sequences of which S is a subsequence. n n n That is: how many times does S show up? Find all subsequences from the given sequence sets that have a user-defined minimum support. The sequence S 1, S 2, … Sn, is a predictor of “fact” that a customer that buys itemset S 1 is likely to buy itemset S 2, then S 3, … Prediction support based on frequency of this sequence in the past Many research issues to create good algos

Patterns Within Time Series n Finding 2 patterns that occur over time n n Patterns Within Time Series n Finding 2 patterns that occur over time n n n 2003 stock prices of Choice Homes and Home Depot 2 products show same sales pattern in summer but different one in winter Solar magnetic wind patterns may predict earth atmospheric changes

Time Series Pattern Discovery n Time series are sequences of events n n Event Time Series Pattern Discovery n Time series are sequences of events n n Event could be a transaction (closing daily stock price) Look at sequences over n days, or Longest period in which change is no greater than 1% Comparing n Must define similarity measures

Other Approaches in Data Mining n Neural nets n Infer a function from a Other Approaches in Data Mining n Neural nets n Infer a function from a set of examples n n Supervised & unsupervised algorithms Capabilities n n n Non-parametric curve-fitting Interpolates to solve new problems classification time-series prediction Disadvantages n can’t see what it learned (not declarative)

Other Approaches in Data Mining n Genetic algorithms n Set up n n n Other Approaches in Data Mining n Genetic algorithms n Set up n n n Representation (strings over an alphabet) Evaluation (fitness) function Parameters: # of generations, cross-over rate, mutation rate, etc. Randomized (probabilistic operators), parallel search over search space Used for problem solving and clustering