CN108038170A - A kind of semantic track data base construction method based on expansion PostgreSQL - Google Patents
A kind of semantic track data base construction method based on expansion PostgreSQL Download PDFInfo
- Publication number
- CN108038170A CN108038170A CN201711283547.7A CN201711283547A CN108038170A CN 108038170 A CN108038170 A CN 108038170A CN 201711283547 A CN201711283547 A CN 201711283547A CN 108038170 A CN108038170 A CN 108038170A
- Authority
- CN
- China
- Prior art keywords
- track
- semantic
- postgresql
- data
- type
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/21—Design, administration or maintenance of databases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/28—Databases characterised by their database models, e.g. relational or object models
- G06F16/284—Relational databases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/29—Geographical information databases
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Remote Sensing (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a kind of based on the semantic track data base construction method for expanding PostgreSQL, specifically comprise the following steps:Step 1, from the feature of semantic track, the abstract concept model of the semantic track of proposition;Step 2, formal definitions are carried out to semantic track, mathematical model support is provided for the database realizing of semantic track;Step 3, utilize support of the PostgreSQL databases to Spatial data types and expansibility of increasing income, the primary PostgreSQL data types of one group of Semantic-Oriented track are designed, semantic track data type and other PostgreSQL native data types is used in the database;Step 4, using the realization of PL/PGSQL procedural languages and the relevant operation of semantic track data type of PostgreSQL, effective storage of track data is realized.
Description
Technical field
The invention belongs to technical field of geographic information, there is provided a kind of based on the semantic track data for expanding PostgreSQL
Base construction method.The present invention is from semantic trajectory viewing angle, the conceptual model of proposition trip track;Utilize opening for PostgreSQL
Source property, track data model is realized in terms of data type and data operation operator two, and the polymerization for being achieved in track data is high
Effect storage.The event that the original low relevance of tradition can be substantially reduced by the present invention is superfluous to the information of Method of Data Organization
It is remaining, the memory space of track big data is greatlyd save, there is stronger operability, should for the data analysis based on semantic track
Supported with providing data organization and storing.
Background technology
Track has time-space attribute, and space-time database is can to include temporal data, spatial data and space-time data, and
The time of data object and the database of space attribute can be handled at the same time.Therefore, space-time database is to be applied to track number earliest
According to the database of management.But the advantage of space-time database is to handle static spatial object, such as this kind of position of Land-change updating
Do not change, the changed object of attribute.For track, its position and attribute all can constantly change with the time, space-time
Database seems helpless to it.
In fact, track can regard the object that people spatially constantly converts its position over time and formed as, by people
Regard mobile object as, be the main stream approach of current track data modeling management using Moving objects database technology.In tradition
In empty DBMS, except non-data is explicitly modified, be otherwise always maintained at it is constant, therefore may not apply to mobile object (track) modeling
Management.In order to be managed to the position of this kind of consecutive variations, a series of new Data Storage Models are suggested in succession.According to right
The classification of mobile object, these Data Storage Models are totally divided into complete freedom, limited network[With indoor moving object model three
Class.Above-mentioned moving Object Model is all that mobile object is modeled from Spatial Dimension, and in recent years, scholars start from more multidimensional
Degree is modeled mobile object, the integration shifting in such as Zhang Hengcai research Integrated GISs space, cyberspace and social space
Dynamic object model GSM.
Track data models and storage, and particularly mobile object storehouse, comparatively perfect, but database model, which are mainly expressed, is
It is described, lacks to background semantic information such as entity correlation, entity and (quiet dynamic) geographical environments from space-time visual angle
Performance.In recent years, the semantic modeling research of track has caused extensive concern.Spaccapietra etc. is carved from semantic visual angle first
Track is drawn, it is believed that track is target drives, is that track main body is purposefully transported in a period of time in its life cycle
It is dynamic, it is a series of space-time positions (being abstracted into point entity) set.Track is organized into a series of chronological track pieces by him
Section (park point Stop or mobile Move), each park point or mobile fragment are associated with other contextual informations, model letter
Referred to as " Stop-Move " semantic model.The track theory at semantic visual angle is adopted extensively by other related semantic track researchs, and
As the theoretical foundation of the project such as EU GeoPKDD, MODAP, SEEK.But the concern of semantic track concrete implementation scheme compared with
It is few, how will be applied to data organization and management by the locus model of semantization tissue, also rarely have be related at present.The opposing party
Face, Moving objects database system is all learning prototype at present, universal at present only to support simply track index and inquiry, from
The commercial applications of specialty are also far.In current commercial database management system, such as Oracle Spatial, SQL
Server, PostgreSQL, MySQL etc., have had been built up the room and time handling function for meeting GIS needs.For track
For database, still have a long way to go.
The content of the invention
Lack semantic association present invention is generally directed to traditional track data management method, and semantic track specific implementation side
The problem of case is less, proposes a kind of semantic track data base construction method based on PostgreSQL.
The technical solution adopted in the present invention is:
A kind of semantic track data base construction method based on expansion PostgreSQL, specifically comprises the following steps:
Step 1, from the feature of semantic track, the abstract concept model of the semantic track of proposition;
Step 2, formal definitions are carried out to semantic track, the database realizing for semantic track provides mathematical model branch
Hold;
Step 3, using support of the PostgreSQL databases to Spatial data types and expansibility of increasing income, one group is designed
The primary PostgreSQL data types of Semantic-Oriented track, make semantic track data type and the primary numbers of other PostgreSQL
Used in the database according to type;
Step 4, realized and the relevant behaviour of semantic track data type using the PL/PGSQL procedural languages of PostgreSQL
Make, realize effective storage of track data.
It is a kind of based on the further preferred of the semantic track data base construction method for expanding PostgreSQL as the present invention
Scheme, the abstract concept model of semantic track include track, path segment, stop, trip, Trip chain, activity, place.
It is a kind of based on the further preferred of the semantic track data base construction method for expanding PostgreSQL as the present invention
Scheme, the realization of the data model of the database of track semanteme track, including data type and operation operator realize two parts.
It is a kind of based on the further preferred of the semantic track data base construction method for expanding PostgreSQL as the present invention
Scheme, PostgreSQL data types include routine data type, time data type and Spatial data types, and based on base
The expansion track data type that notebook data type is designed and Implemented.
It is a kind of based on the further preferred of the semantic track data base construction method for expanding PostgreSQL as the present invention
Scheme, operation operator include semantic operation, temporal operation and spatial operation etc. and are defined for track data type operation simultaneously in fact
Existing data manipulation set.
It is a kind of based on the further preferred of the semantic track data base construction method for expanding PostgreSQL as the present invention
Scheme, routine data type are the bases of other data types, other data types can be formed by routine data type combination, bag
Include integer type, type real, Boolean type, character string type and array type.
It is a kind of based on the further preferred of the semantic track data base construction method for expanding PostgreSQL as the present invention
Scheme, time data type are used to represent time, including moment and period.
It is a kind of based on the further preferred of the semantic track data base construction method for expanding PostgreSQL as the present invention
Scheme, Spatial data types are represented with the basic body of object, including point, line, surface and combinations thereof concept.
It is a kind of based on the further preferred of the semantic track data base construction method for expanding PostgreSQL as the present invention
Scheme, expand track data type be to express the semantics fusion element of track, including path segment, stop, activity, trip,
Stroke.
It is a kind of based on the further preferred of the semantic track data base construction method for expanding PostgreSQL as the present invention
Scheme, the operation operator of track are to carry out various logic computing, profit to basis and composite data type from different dimensions to track
The track data in database can be inquired about, indexed with these operation operators, be that to establish track database essential
A part, including semantic operation operator, temporal operation operator and spatial operator.
The beneficial effects of the invention are as follows:
1) the semantic track database of structure has filled up the blank that spatial database supports track data type, ensure that
The integrality and uniformity on room and time of track data;
2) tissue is carried out to track data in units of polymerization, the space-time point data of original low relevance is changed into Gao Guan
The burst block data storage of connection, can significantly improve the storage efficiency of track big data;
3) the primary track database based on abstract concept model foundation is suitable for various cross-platform uses, easy to operate
Fast, it is highly practical.
Attached drawing table explanation
Fig. 1 is to build structure diagram based on the semantic track database for expanding PostgreSQL;
Fig. 2 is the semantic composition figure of track;
Fig. 3 is track semantic operation list figure;
Fig. 4 is track temporal operation list figure;
Fig. 5 is trajectory range operating list figure;
Fig. 6 is the tables of data graph of a relation of track.
Embodiment
Part I:
The invention will be further described below in conjunction with the accompanying drawings.
Fig. 1 is the structure diagram of the method for the present invention.Based on the semantic track data base construction method for expanding PostgreSQL
It is divided into II stage:Stage I is the semantic track abstract concept model of structure;Stage II is the data model based on PostgreSQL
Realization, including data type and operation operator realize two parts.Data type includes routine data type, time data type
With the basic data type such as Spatial data types, and the expansion track data class designed and Implemented based on basic data type
Type.Operation operator includes semantic operation, temporal operation and spatial operation etc. and defines and realize for track data type operation
Data manipulation set.
Fig. 2 is the graph of a relation of each key element in semantic track abstract concept model.First, semantic track is by semantic path segment
When it is aerial end to end and form, wherein semantic segment is according to certain rule segmentation track and the different time-space process that are formed
Polymeric segment.According to the difference of rule, path segment can be divided into four kinds of stop, trip, stroke and Trip chain elements, these are semantic
Track key element is suitable for all types of trip tracks, independent of specific application.
Fig. 3-5 is respectively the language of design on the basis of track data type good defined in PostgreSQL databases
Adopted operation operator, temporal operation operator and spatial operator list.By realizing these operators in the database, can facilitate
Ground is manipulated, inquired about, retrieval track data.
Part II:
The following detailed description of the principles of science of technical scheme and institute's foundation.
1. semantic track abstract concept model
The semantic track conceptual model of structure, it is therefore an objective to be abstracted into track in information world from real world, from track
It is overall to arrive its feature of partial analysis and attribute, comprehensive definition is made to track, to realize data in semantic track database
Model provides support.The present invention expands Stop-Move models, forms the semantic track conceptual model suitable for database sharing.
Define 1 (track [Trajectory]):Track T is people's autotelic movement in the life cycle of track, makes track
The locus path that changes over time and formed, its mathematical form is a space-time curve, is from time-domain Dt(T) to sky
Between domain Ds(T) mapping fT:
fT(t):Dt(T)=f (t) | tbegin,tend∈R+,tbegin≤t≤tend}→Ds(T)=(x, y) | x ∈ R, y ∈
R}
Wherein:tbegin,tendQuarter and finish time, time-domain D at the beginning of expression track respectivelyt(T)=[tbegin,tend]
Represent the Life cycle of track.
Define 2 (path segment [Trajectory Segment]):A part of track T, uses fsegRepresent, its time-domain
For a part for track life cycle, mathematical form is:
Wherein [tbeginSeg,tendSeg] represent fsegTime range, tbeginSegAnd tendSegThe respectively path segment
The beginning and end moment.
Define 3 (stopping [Stop]):Stop is a kind of special path segment, in the fragment, the position of track main body
Do not move significantly, which is known as the place where stopping, and stay long enough.Track main body is stopped in the place
A series of activities are carried out in the time stayed, its mathematical form is shown as with triple table:
The path segment represented in Fig. 2 with time-domain [t (2i-1), t (2i)] represents.Wherein:Δ T represents the minimum stopped
Duration, Dis (fseg(ti),fseg(tj)) represent track in t at different momentsi,tjSpace length, Δ S represent maximum space away from
From the implication of place and activity, which are shown in, defines 7 and definition 8.
Minimum stay time can exclude insignificant stop in short-term, such as:Floating Car is since traffic information signal lamp is on road
Mouth waiting, this kind of park are the requirements for meeting stop.And maximum space distance restraint track main body is stopping the activity in place
Radius.
In all stops of track, there are two special stops:
If 1. tbegin∈[tbeginSeg,tendSeg], then the stop is referred to as starting point (Origin);
If 2. tend∈[tbeginSeg,tendSeg], then the stop is referred to as terminal (Destination).
Define 4 (trips [Trip]):Trip is a kind of special path segment, for connecting two continuous stops, its
Mathematical form ftripIt is expressed as:
Trip is represented with trip (i) in Fig. 2, and wherein n represents the number stopped in the T of track, and i represents the identification number stopped,
tstop(i)endRepresent the finish time of i-th of park point, tstop(i+1)beginRepresent to carve at the beginning of i+1 park point.
Trip can be divided into different types according to different description aspects.From space aspects, according to the length of trip distance
Short, trip type can be divided into short trip and long trip;From time aspect, according to the trip period, trip type can be divided into peak and go out
Row and non-peak trip.
Another place's stop is transferred to being stopped at one, often using multiple transportation modes.For example, first multiply from departure place
Subway, then turn public transport to destination.Therefore, a certain trip is organized into by a series of collection of end to end strokes by the present invention
Close, can be one or more.
Define 5 (stroke [Journey]):Movement corresponding to single trip mode, such as self-driving, public transport, subway, taxi
Car, bicycle, walking etc., are expressed as fjourney.The starting point of stroke can be upper one and stop, or the terminal of the preceding paragraph stroke;
The terminal of stroke is the starting point of lower a trip, or next stop.The mathematical definition of relation of the stroke with going on a journey is as follows:
Wherein Dt(trip) time-domain of trip, D are representedt(journey (i)) represents the time-domain of i-th of stroke.
Trip chain represents the internal association of track subject activity, i.e. the generation of current active is influenced by activity before,
It is widely used at present in the trajectory data mining method such as the analysis of track Frequent episodes and track similarity analysis.
Define 6 (Trip chain [Trip Chain]):Trip chain is a combined concept, represents a series of collection continuously gone on a journey
Close, its mathematical form ftripChainFor:
ftripChain=trip (i) | p≤i≤q:trip(i)∈ftrip,ttrip(i)end≤t≤ttrip(i+1)begin}
Wherein p, q are respectively identification number of Trip chain first and last trip, ttrip(i)endRepresent i-th of trip
Finish time, ttrip(i+1)beginRepresent to carve at the beginning of i+1 trip.
Define 7 (movable [Activity]):Activity is that track main body is stopping the behavior at (Stop) place, is the important of track
Feature, is represented with activity [stop (i)] in Fig. 1.One park point, can there is one or more activities.Activity discloses
Why the purpose of track main body trip, i.e. track main body move.
Define 8 (place [Place]):Place is to stop associated place, it is locus special in space, one
As be culture or natural landscape with geographical implication, use P in Fig. 1iRepresent.
2. the realization of the track data model based on PostgreSQL
PostgreSQL/PostGIS is a spatial database of increasing income for meeting OpenGIS specifications, there is provided flexible work
The integrated new data type of tool, including type of foundation, compound type and User-Defined Functions etc..Therefore, present invention selection exists
Semantic track abstract concept model, including two aspect contents of track data type and operation are realized in PostgreSQL databases.
The realization of the 2.1 track data types based on PostgreSQL
The present invention realizes semantic track data type definition by way of self-defined composite data type, wherein primary sky
Between the corresponding son of data type (such as Point, Linestring) and Temporal Types (such as Timestamp) as composite data type
The data type of attribute.Semantic track data type regards native data type as by PostgreSQL, can and other
PostgreSQL native data types are the same to be used in the database.Track data type based on PostgreSQL includes basic
Data type and expansion track data type.
(1) basic data type
Basic data type includes routine data type, time data type and Spatial data types.
A) routine data type
Routine data type is the basis of other data types, other data types can by routine data type combination and
Into, including:Integer type Integer, type real Real, Boolean type Boolean, character string type String and array class
Type Array.
B) time data type
Time data type is used to represent time, including moment and period.
1. the moment (Timestamp):Timestamp=Real, unit are the second, can switch to standard shaped like ' yyyy-mm-dd
hh:mm:The time type of the forms such as ss'.
2. the period (Interval):Interval={ (t1,t2)|t1<t2,t1,t2∈ Timestamp }, wherein t1,t2Point
It Biao Shi not carved at the beginning of the period and finish time.
C) Spatial data types
Spatial data types are represented with the basic body of object, including point (Point), line (Curve), face
(Surface) and combinations thereof concept, the expansion two-dimensional geometry for meeting OpenGIS specifications that the present invention is carried using PostgreSQL
Body type comes representation space data, including space vertex type (Point), space line type (Polyline) and space noodles type
(Polygon)。
(2) track data type is expanded
It is to express the semantics fusion element of track to expand track data type, including path segment, stop, activity, is gone out
Row, stroke etc., these expand track data types by routine data type, time data type and Spatial data types extend and
Obtain, mainly have with Types Below:
A) binary that event (STPoint) is formed by spatial point (base data type) and moment (base data type)
Group composition, its mathematical form are:STPoint=(pt, t) | pt ∈ Point, t ∈ Instant }.
B) space-time track (STTrajectory) is made of a series of end to end events (expansion data type), its
Mathematical form is:
Wherein n represents that the space-time that track is included is counted out, and stpt (i) represents i-th of event.
C) semantic path segment (SemSegment) is by a series of events (expansion data type) and the integer piece of the clip types
Lift mark (base data type) two tuple composition:
Wherein u, v are the event identification number that path segment includes, and segType represents the type (stop or go on a journey) of path segment.
D) semantic track (SemTrajectory) is by a series of end to end semantic path segments (expansion data type)
Composition, its mathematical form are:
E) movable (SemActivity) is by spatial point (base data type), period (base data type) and movable mesh
(base data type) triple composition, its mathematical form is:SemActivity=(pt, timespan, purpose) |
pt∈Point,timespan∈Interval,purpose∈String}。
F) (SemStop) is stopped by semantic path segment (expansion data type) and active set (expansion data type) two
Tuple forms, its mathematical form is: Wherein m is the activity number carried out in the stop.
G) stroke (SemJourney) is by semantic path segment (expansion data type) and mode of transportation (basic data class
Type) two tuples composition, its mathematical form is:
SemJourney=(seg, transMode) | seg ∈ SemSegment, transMode ∈ String }.
H) trip (SemTrip) is made of a series of end to end strokes (expansion data type), its mathematical form is:
The present invention realizes self-defined semantic track composite data type using the PL/PGSQL procedural languages of PostgreSQL
Definition.In PostgreSQL, PL/PGSQL data types define data type, composite number by CREATE TYPE functions
According to primary Spatial data types (such as Point, Linestring) and Temporal Types (such as Timestamp) can be included in type
The sub- attribute of type, can also meet data type, its syntactic structure is as follows comprising other:
CREATE TYPE name AS
([attribute_name data_type[COLLATE collation][,…]])
Wherein:
A) CREATE TYPE are meant that definition new data type.If schema name is contained in data type, then
The data type will be created in specified pattern;Otherwise system will be given tacit consent to and be created in present mode.
B) name represents the data type name to be created, and can include schema name.
C) attribute_name represents the sub- attribute of the composite data type created, and the data type of sub- attribute can be
Basic data type or meet data type.Attribute_name can have multiple, thus form sub- attribute list
Set.
Such as:The PostgreSQL of space-time orbit segment data type (STSegment) is defined as follows:
The sub- attribute of wherein STSegment includes affiliated track identification number and event (STPoint) sequence, STPoint
And customized composite data type.
The 2.2 track data operation operators based on PostgreSQL are realized
The operation operator of track is to carry out various logic computing to basis and composite data type from different dimensions to track,
The track data in database can be inquired about, indexed using these operation operators, be establish track database must can not
A few part.The present invention is realized using the PL/PGSQL procedural languages of PostgreSQL and semantic track data type is relevant
Operation, including semantic operation operator, temporal operation operator and spatial operator.
(1) semantic operation operator is to carry out computing from semantic angle to track.The semantic operation that different fields needs is not
Identical to the greatest extent, emphasis of the present invention is concluded and defined to general semantic operation.Organize, lead to from low to high from the complexity of operation
It can be divided into five classes with track semantic operation:Semantic dimension projection operator, semantic track element Locating operator, semantic trace filtering are calculated
Son and Semantic Similarity operator.
Fig. 3 illustrates the table listings of semantic operation operator.Wherein:Semantic dimension projection operator is to throw space-time orbit segment
Shadow is semantic track element, and operating result is head and the tail phase chronological SemStop and SemTrip in orbit segment life cycle
The sequential combination connect;Semantic primitive Locating operator is to look for positioning specific track semantic primitive, including is searched by identification number
Track key element, and its identification number is obtained by track key element;Semantic filtering operator is by filtering and obtaining semantic activity member
Plain (SemActivity), operating result are the track element or its set for meeting filter condition;Semantic Similarity operator compares two
Whether the effort scale of bar semanteme track is consistent, and operating result is Boolean type.
(2) temporal operation operator is to carry out computing from time dimension to track, is organized from low to high from the complexity of operation,
Track temporal operation can be divided into five classes:Tense dimension projection operator, tense amount are calculated operator, temporal relationship operator, temporal rule and are calculated
Son and tense comparability operator.
Fig. 4 illustrates the table listings of temporal operation operator.Wherein:Tense dimension projection operator is by semantic track element
(SemTrajectory, SemStop, SemActivity, SemTrip and SemJourney) projects to time-domain, operating result
It is equivalent to the time interval of the semanteme track element;It is the life cycle duration for calculating semantic track element that tense amount, which calculates operator,;
Temporal relationship operator is the tense topological relation for calculating tense element and semantic track element;Temporal rule operator is to pass through filtering
And obtain occurring at certain moment, or track element of the life cycle in some time segment limit, operating result are to meet filter condition
Semantic track element set;Whether the duration that tense comparability operator compares two semantic track elements is equal, operating result
For Boolean type.
(3) spatial operator is to carry out computing from Spatial Dimension to track, is organized from low to high from the complexity of operation,
Trajectory range operation can be divided into five classes:Spatial Dimension projection operator, spatial measuring operator, spatial relationship operator, spatial filtering are calculated
Son and spatial simlanty operator.
Fig. 5 illustrates the table listings of spatial operator.Wherein:Spatial Dimension projection operator is by semantic track element
Spatial domain is projected to, operating result is equivalent to the geometric object of the track element;Spatial measuring operator is to calculate semantic track member
The mathematical measure value of element;Spatial relationship operator be calculate spatial object and semantic track element (SemTrajectory,
SemStop, SemActivity, SemTrip and SemJourney) spatial topotaxy;Spatial filtering operator is to pass through filtering
And obtain by certain point, along certain road or positioned at certain region Nei Shengnei track element (SemTrajectory,
SemStop, SemActivity, SemTrip and SemJourney), operating result is the track element set for meeting filter condition
Close;Spatial simlanty operator compare two semantic track elements (SemTrajectory, SemStop, SemActivity,
SemTrip and SemJourney) spatial shape it is whether consistent, operating result is Boolean type.
The semantic track operation operator that the present invention designs is realized by PL/PGSQL procedural languages.In PostgreSQL,
One PL/PGSQL function realizes that algorithm is used as storing process by CREATE FUNCTION, its syntactic structure is as follows:
Wherein:
(1) CREATE FUNCTION are meant that definition new function.If schema name is contained in function, then will
The function is created in specified pattern;Otherwise system will be given tacit consent to and be created in present mode.It should be noted that what is created is new
Function name cannot be of the same name with the identical function of parameter type in pattern, otherwise cannot be created.
(2) REPLACE FUNCTION are meant that the existing function of renewal, can be with the content of renewal function, but cannot update
Title, parameter type and the return type of function, it is impossible to destroy the object for quoting the function.Otherwise, it is necessary to delete the function, so
Re-created afterwards using CREATE FUNCTION.While function is deleted, it is necessary to delete with the rule of functional dependence, view,
Trigger etc..And the function created after deleting stores in systems as new entity.
(3) name represents the function name to be created, and can include schema name.
(4) RETURNS representative functions return value, can be Value Types or table type.
(5) FUNCTION BODY representative functions define text.
Using above process function, three generic operations of semantic track --- semantic operation, temporal operation and spatial operation are all
It can be defined in PostgreSQL.Such as:The storing process of operation operator " obtaining track n-th park point "
PostgreSQL is defined as follows:
CREATE OR REPLACE FUNCTION NthStop(traj SemTrajectory,n Integer)
RETURNS SemStop AS
$BODY$
DECLARE stop SemStop;
BEGIN
FOR
RETURN stop;
END;
$BODY$;
Other operation operators also can similar definition.
Part III
The present invention is illustrated with example below, but these examples are not necessarily to be construed as limitation of the present invention.
The database of this example expands storehouse using PostgreSQL9.4.1 and PostGIS2.1, using console operation simultaneously
Export result.
Test data is 23 communities and Shangdi Information Industry Base in Shangdi-Qinghe area of Beijing Haidian-Changping District
In resident's trip of one week and activity log and GPS track in 19 typical enterprises.Each resident carries GPS positioning device, often
30s carries out a data sampling, and each sample information includes longitude, latitude, time, mode of transportation and the Activity Type of the sampling
Deng.
(1) polymerization path segment is calculated using clustering algorithm, obtains 30081 fragments, wherein park point 19264, is moved
It is 10717 dynamic.
(2) the track data type and operation operator of the present invention is realized in PostgreSQL.
(3) in PostgreSQL, track data is stored in the form of table structure, polymerize track data type
(SemSegment, SemStop, SemTrip, SemTrajectory) is as a field in table structure, and tracking clustering pair
As being stored in corresponding aggregate data type example in tables of data.The present invention creates SemSegment_TBL, SemStop_
TBL, SemTrip_TBL and SemTrajectory_TBL system table storage track data, wherein:
SemSegment_TBL tables store aggregated data, include segId (type Integer) and semSegment (classes
Type is SemSegment) field, semSegment storage polymerization path segment data, it possesses sub- aggregate data type object
Stseg, stores real space-time point data.
SemStop_TBL tables storage park aggregated data, includes stopId (type Integer) and semStop (types
For SemStop) field, park fragment data and be stored in semStop fields.
The mobile aggregated data of SemTrip_TBL tables storage, includes tripId (type Integer) and semTrip (types
For SemTrip) field, moves fragment data and is stored in semTrip fields.
SemTrajectory_TBL table storage track aggregated datas, comprising tripId (type Integer) and
SemTrajectory (type SemTrajectory) field, track data are stored in semTrajectory fields.
Fig. 6 illustrates the incidence relation of these tables, and the wherein segId of semSegment is track in semTrajectory
In set of segments in the external key of path segment identification number, and semStop and semTrip path segment identification number external key.Root
According to above-mentioned table structure, using PL/PGSQL language to can be stored to track data.
Embodiment described above is not intended to limit the present invention, and any those skilled in the art, is not departing from this hair
In bright spirit and scope, various change and retouching can be done, therefore protection scope of the present invention regards right institute circle
It is fixed.
Claims (10)
- It is 1. a kind of based on the semantic track data base construction method for expanding PostgreSQL, it is characterised in that:Specifically comprising as follows Step:Step 1, from the feature of semantic track, the abstract concept model of the semantic track of proposition;Step 2, formal definitions are carried out to semantic track, mathematical model support is provided for the database realizing of semantic track;Step 3, using support of the PostgreSQL databases to Spatial data types and expansibility of increasing income, one group of design towards The primary PostgreSQL data types of semantic track, make semantic track data type and other PostgreSQL native data classes Type uses in the database;Step 4, it is real using the realization of PL/PGSQL procedural languages and the relevant operation of semantic track data type of PostgreSQL Effective storage of existing track data.
- 2. according to claim 1 a kind of based on the semantic track data base construction method for expanding PostgreSQL, it is special Sign is:The abstract concept model of semantic track includes track, path segment, stop, trip, Trip chain, activity, place.
- 3. according to claim 1 a kind of based on the semantic track data base construction method for expanding PostgreSQL, it is special Sign is:The realization of the data model of the database of track semanteme track, including data type and operation operator realize two parts.
- 4. according to claim 3 a kind of based on the semantic track data base construction method for expanding PostgreSQL, it is special Sign is:PostgreSQL data types include routine data type, time data type and Spatial data types, and are based on The expansion track data type that basic data type is designed and Implemented.
- 5. according to claim 3 a kind of based on the semantic track data base construction method for expanding PostgreSQL, it is special Sign is:Operation operator includes semantic operation, temporal operation and spatial operation etc. and is defined simultaneously for track data type operation The data manipulation set of realization.
- 6. according to claim 4 a kind of based on the semantic track data base construction method for expanding PostgreSQL, it is special Sign is:Routine data type is the basis of other data types, other data types can be formed by routine data type combination, Including integer type, type real, Boolean type, character string type and array type.
- 7. according to claim 4 a kind of based on the semantic track data base construction method for expanding PostgreSQL, it is special Sign is:Time data type is used to represent time, including moment and period.
- 8. according to claim 4 a kind of based on the semantic track data base construction method for expanding PostgreSQL, it is special Sign is:Spatial data types are represented with the basic body of object, including point, line, surface and combinations thereof concept.
- 9. according to claim 5 a kind of based on the semantic track data base construction method for expanding PostgreSQL, it is special Sign is:It is to express the semantics fusion element of track to expand track data type, including path segment, stop, activity, is gone out Row, stroke.
- 10. according to claim 3 a kind of based on the semantic track data base construction method for expanding PostgreSQL, it is special Sign is:The operation operator of track is to carry out various logic computing to basis and composite data type from different dimensions to track, The track data in database can be inquired about, indexed using these operation operators, be establish track database must can not A few part, including semantic operation operator, temporal operation operator and spatial operator.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711283547.7A CN108038170A (en) | 2017-12-07 | 2017-12-07 | A kind of semantic track data base construction method based on expansion PostgreSQL |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711283547.7A CN108038170A (en) | 2017-12-07 | 2017-12-07 | A kind of semantic track data base construction method based on expansion PostgreSQL |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108038170A true CN108038170A (en) | 2018-05-15 |
Family
ID=62096157
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711283547.7A Pending CN108038170A (en) | 2017-12-07 | 2017-12-07 | A kind of semantic track data base construction method based on expansion PostgreSQL |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108038170A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109492150A (en) * | 2018-10-30 | 2019-03-19 | 石家庄铁道大学 | Reverse nearest neighbor queries method and device based on semantic track big data |
CN112398822A (en) * | 2020-10-29 | 2021-02-23 | 安徽江淮汽车集团股份有限公司 | Internet of vehicles Sybil attack detection method, device, equipment and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6311194B1 (en) * | 2000-03-15 | 2001-10-30 | Taalee, Inc. | System and method for creating a semantic web and its applications in browsing, searching, profiling, personalization and advertising |
CN104239581A (en) * | 2014-10-13 | 2014-12-24 | 河海大学 | Database-system-oriented replicated data provenance tracing method |
-
2017
- 2017-12-07 CN CN201711283547.7A patent/CN108038170A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6311194B1 (en) * | 2000-03-15 | 2001-10-30 | Taalee, Inc. | System and method for creating a semantic web and its applications in browsing, searching, profiling, personalization and advertising |
CN104239581A (en) * | 2014-10-13 | 2014-12-24 | 河海大学 | Database-system-oriented replicated data provenance tracing method |
Non-Patent Citations (2)
Title |
---|
金美含: "基于PostgreSQL/PostGIS的原生轨迹数据库研究", 《中国优秀硕士学位论文全文数据库信息科技辑》 * |
陈雯: "基于本体框架的交通出行语义轨迹建模、标记及数据库研究", 《中国博士学位论文全文数据库工程科技II辑》 * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109492150A (en) * | 2018-10-30 | 2019-03-19 | 石家庄铁道大学 | Reverse nearest neighbor queries method and device based on semantic track big data |
CN109492150B (en) * | 2018-10-30 | 2021-07-27 | 石家庄铁道大学 | Reverse nearest neighbor query method and device based on semantic track big data |
CN112398822A (en) * | 2020-10-29 | 2021-02-23 | 安徽江淮汽车集团股份有限公司 | Internet of vehicles Sybil attack detection method, device, equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102651020B (en) | Method for storing and searching mass sensor data | |
Papadias et al. | Query processing in spatial network databases | |
CN104766168A (en) | Earthquake three-dimensional visual platform | |
CN104376112A (en) | Road network space keyword search method | |
CN102750363A (en) | Construction method of urban geographic information data warehouse | |
KR101797207B1 (en) | Method of Processing Moving Object Trajectory Data With User Defined Functions | |
CN108038170A (en) | A kind of semantic track data base construction method based on expansion PostgreSQL | |
Gómez et al. | A data model and query language for spatio-temporal decision support | |
Ghosh et al. | Traj-cloud: a trajectory cloud for enabling efficient mobility services | |
Cai et al. | Research on analysis method of characteristics generation of urban rail transit | |
US10095724B1 (en) | Progressive continuous range query for moving objects with a tree-like index | |
Pérez et al. | Fuzzy spatial data warehouse: A multidimensional model | |
Rashid et al. | Challenging issues of spatio-temporal data mining | |
Schneider | Moving objects in databases and gis: State-of-the-art and open problems | |
Liu et al. | Analysis of spatial indexing mechanism and its application in data management: A case study on spatialite database | |
Barman et al. | Implementation of a smart map using spatial oracle | |
Wu et al. | A hybrid compression framework for large scale trajectory data in road networks | |
Huang et al. | Top-k nearest keyword search in public transportation networks | |
Li et al. | Design and implementation of trajectory data management and analysis technology framework based on spatiotemporal grid model | |
Liu et al. | A Disaster Information Service for Damaged Road Networks Using Dynamic Segmentation | |
Wang et al. | Lightweight map updating for highly automated driving in non-paved roads | |
Isomura et al. | Real-Time Spatial-Temporal Database for Geographic Polygon Data Using HD-Map | |
Stauffer et al. | Enriching the national map database for multi-scale use: Introducing the visibilityfilter attribution | |
Ye et al. | Spatio-temporal data model and spatio-temporal databases | |
Bakalov et al. | Maintaining connectivity in dynamic multimodal network models |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180515 |