黃蘭情
摘要:當(dāng)今大數(shù)據(jù)、互聯(lián)網(wǎng)、AI、圖形處理等技術(shù)日益成熟,網(wǎng)絡(luò)通信技術(shù)日益成熟,智能化生活已經(jīng)逐漸從科幻電影的世界走入人們的生活。而本文介紹的此系統(tǒng)將獲取大量位置信息進(jìn)行數(shù)據(jù)分析,測(cè)繪出一個(gè)個(gè)用戶的行為軌跡,將行為軌跡的信息進(jìn)行挖掘研究,分析出潛在的信息。這些信息,對(duì)城市規(guī)劃和公共安全有著重要的意義。行為軌跡的分析以已經(jīng)大量用戶的信息前提,位置信息皆以志愿者提供。
關(guān)鍵詞:行為軌跡;Android;生活;科技
中圖分類(lèi)號(hào):TP311.52 文獻(xiàn)標(biāo)識(shí)碼:A 文章編號(hào):1007-9416(2018)12-0164-01
0 引言
隨著科學(xué)技術(shù)的發(fā)展和社會(huì)的進(jìn)步,智能手機(jī)已經(jīng)成為了生活中不可分割的一部分。基于GPS的應(yīng)用和智能手機(jī)的普及,利用GPS的定位功能實(shí)現(xiàn)行為軌跡的預(yù)測(cè)成為可能。用戶的位置信息構(gòu)成的行為軌跡中蘊(yùn)含了大量的信息。行為軌跡的預(yù)測(cè)可將用戶進(jìn)行目標(biāo)人群定位,行為軌跡的預(yù)測(cè)不僅具有不可估量的商業(yè)價(jià)值,還有重要的公共安全和城市規(guī)劃的意義。通過(guò)分析大量的用戶的軌跡在路徑的重疊性和頻繁度來(lái)規(guī)劃,可以在用于重疊度高和頻繁度高的進(jìn)行適合的整改。人們的位置信息構(gòu)成的行為軌跡有著大量信息可以來(lái)挖掘研究,利用好這些信息可以為我們的生活帶來(lái)更多的便利,這些信息也會(huì)為未來(lái)的無(wú)人車(chē)“暢通無(wú)阻”的在城市中穿梭提供有用的數(shù)據(jù)信息。
1 軌跡挖掘
現(xiàn)在的anroid手機(jī)中都帶有GPS芯片,只要在app中開(kāi)啟Service服務(wù),使用百度提供的百度地圖SDK就可以進(jìn)行全球定位,能夠精確的獲得經(jīng)緯度和位置信息。然后將數(shù)據(jù)保存在數(shù)據(jù)庫(kù)中。
定位代碼:
public class MainActivity extends Activity {
private BDLocationListener? local_listener;
private LocationClient local_client;
private final String str = "Main_Activity";
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
local_client = new LocationClient(getApplicationContext());
local_listener = new MyBDLocationListener();
local_client.registerLocationListener(local_listener);
}
public void getLocation(View view) {? ?//獲取經(jīng)緯度
LocationClientOption local = new LocationClientOption();
local.setLocationMode(LocationMode.Hight_Accuracy);
local.setCoorType("bd09ll"); //返回的坐標(biāo)類(lèi)型
local.setIsNeedAddress(true);// 設(shè)置定位結(jié)果包含地址信息
local.setNeedDeviceDirect(true);// 設(shè)置定位結(jié)果包含手機(jī)機(jī)頭的方向
local.setScanSpan(2000);// 設(shè)置獲取定位請(qǐng)求的時(shí)間間隔
mLocationClient.setLocOption(local);
mLocationClient.start();? ?// 開(kāi)始定位
}
protected void onDestroy() {
super.onDestroy();
if (local_client!= null) {
local_client.unRegisterLocationListener(local_listener);
}
}
private class MyBDLocationListener implements BDLocationListener {
public void onReceiveLocation(BDLocation location) {
if (location != null) {
double lat = location.getLatitude();? //獲取緯度
double lon = location.getLongitude();? //獲取經(jīng)度
String address = location.getAddrStr();
Log.i(str, "位置信息:" + address + "緯度 :" + lat
+ "經(jīng)度 :" + lon );
if (mLocationClient.isStarted()) {
mLocationClient.stop();
}
}
}
}
}? 預(yù)測(cè)機(jī)制
用戶在智能手機(jī)中開(kāi)啟app,通過(guò)app將獲取的信息傳遞給服務(wù)器,在服務(wù)器中進(jìn)行信息匹配,目的是將時(shí)間空間進(jìn)行整合用來(lái)推算出用戶的現(xiàn)實(shí)情境。然后進(jìn)行軌跡計(jì)算,將位置信息測(cè)繪出路線的網(wǎng)狀結(jié)構(gòu),比例越高的路線越粗。最后將信息匹配后的數(shù)據(jù)和物理軌跡進(jìn)行數(shù)據(jù)分析,用來(lái)推斷出用戶的行為軌跡。
2 結(jié)語(yǔ)
通過(guò)智能手機(jī)能力來(lái)對(duì)獲取和記錄用戶的位置信息等,并結(jié)合大數(shù)據(jù)分析的手段對(duì)用戶的行為軌跡進(jìn)行挖掘。智能手機(jī)的普遍性為數(shù)據(jù)的獲取帶來(lái)了很大的便利,只要在開(kāi)發(fā)中實(shí)現(xiàn)這些功能然后安裝在手機(jī)即可。
參考文獻(xiàn)
[1]明日科技著.Android開(kāi)發(fā)從入門(mén)到精通[M].北京:清華大學(xué)出版社,2017.
[2]Murat Yener,Onur Dundar.Andorid studio高級(jí)編程[M].北京:清華大學(xué)出版社,2017.
[3]王曉東.算法設(shè)計(jì)與分析[M].北京:清華大學(xué)出版社,2014.
[4]王珊,薩師煊.數(shù)據(jù)庫(kù)系統(tǒng)概述[M].北京:高等教育出版社,2014.
[5]軟件開(kāi)發(fā)聯(lián)盟.Java開(kāi)發(fā)實(shí)例大全[M].北京:清華大學(xué)出版社,2016.
Research and System Development of User Behavior Trajectory Based on Android
HUANG Lan-qing
(School of Mathematics and Computer Science, Northwest University for Nationalities,Lanzhou? Gansu 730030)
Abstract:Nowadays, big data, Internet,AI, graphics processing and other technologies are becoming more and more mature, network communication technology is becoming more and more mature, intelligent life has gradually gone from the world of sci-fi movies into people's lives. The system introduced in this paper will obtain a lot of location information for data analysis, map out the behavior trajectory of individual users, carry out the information of behavior trajectory mining research, and analyze the potential information. This information is of great significance to urban planning and public safety. The analysis of behavior trajectory is premised on the information of a large number of users, and the location information is provided by volunteers.
Key words:behavior trajectory;Android; life; technology