基于Android的用户行为轨迹分析研究与系统研发

2018-03-02 12:22黄兰情
数字技术与应用 2018年12期
关键词:科技生活

黄兰情

摘要:当今大数据、互联网、AI、图形处理等技术日益成熟,网络通信技术日益成熟,智能化生活已经逐渐从科幻电影的世界走入人们的生活。而本文介绍的此系统将获取大量位置信息进行数据分析,测绘出一个个用户的行为轨迹,将行为轨迹的信息进行挖掘研究,分析出潜在的信息。这些信息,对城市规划和公共安全有着重要的意义。行为轨迹的分析以已经大量用户的信息前提,位置信息皆以志愿者提供。

关键词:行为轨迹;Android;生活;科技

中图分类号:TP311.52 文献标识码:A 文章编号:1007-9416(2018)12-0164-01

0 引言

随着科学技术的发展和社会的进步,智能手机已经成为了生活中不可分割的一部分。基于GPS的应用和智能手机的普及,利用GPS的定位功能实现行为轨迹的预测成为可能。用户的位置信息构成的行为轨迹中蕴含了大量的信息。行为轨迹的预测可将用户进行目标人群定位,行为轨迹的预测不仅具有不可估量的商业价值,还有重要的公共安全和城市规划的意义。通过分析大量的用户的轨迹在路径的重叠性和频繁度来规划,可以在用于重叠度高和频繁度高的进行适合的整改。人们的位置信息构成的行为轨迹有着大量信息可以来挖掘研究,利用好这些信息可以为我们的生活带来更多的便利,这些信息也会为未来的无人车“畅通无阻”的在城市中穿梭提供有用的数据信息。

1 轨迹挖掘

现在的anroid手机中都带有GPS芯片,只要在app中开启Service服务,使用百度提供的百度地图SDK就可以进行全球定位,能够精确的获得经纬度和位置信息。然后将数据保存在数据库中。

定位代码:

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) {   //获取经纬度

LocationClientOption local = new LocationClientOption();

local.setLocationMode(LocationMode.Hight_Accuracy);

local.setCoorType("bd09ll"); //返回的坐标类型

local.setIsNeedAddress(true);// 设置定位结果包含地址信息

local.setNeedDeviceDirect(true);// 设置定位结果包含手机机头的方向

local.setScanSpan(2000);// 设置获取定位请求的时间间隔

mLocationClient.setLocOption(local);

mLocationClient.start();   // 开始定位

}

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();  //获取经度

String address = location.getAddrStr();

Log.i(str, "位置信息:" + address + "纬度 :" + lat

+ "经度 :" + lon );

if (mLocationClient.isStarted()) {

mLocationClient.stop();

}

}

}

}

}  预测机制

用戶在智能手机中开启app,通过app将获取的信息传递给服务器,在服务器中进行信息匹配,目的是将时间空间进行整合用来推算出用户的现实情境。然后进行轨迹计算,将位置信息测绘出路线的网状结构,比例越高的路线越粗。最后将信息匹配后的数据和物理轨迹进行数据分析,用来推断出用户的行为轨迹。

2 结语

通过智能手机能力来对获取和记录用户的位置信息等,并结合大数据分析的手段对用户的行为轨迹进行挖掘。智能手机的普遍性为数据的获取带来了很大的便利,只要在开发中实现这些功能然后安装在手机即可。

参考文献

[1]明日科技著.Android开发从入门到精通[M].北京:清华大学出版社,2017.

[2]Murat Yener,Onur Dundar.Andorid studio高级编程[M].北京:清华大学出版社,2017.

[3]王晓东.算法设计与分析[M].北京:清华大学出版社,2014.

[4]王珊,萨师煊.数据库系统概述[M].北京:高等教育出版社,2014.

[5]软件开发联盟.Java开发实例大全[M].北京:清华大学出版社,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

猜你喜欢
科技生活
科技助我来看云
科技在线
科技在线
科技在线
疯狂让你的生活更出彩