caiwang / board2ihost

0 stars 0 forks source link

频次-时长分析 #28

Open caiwang opened 9 years ago

caiwang commented 9 years ago

Issue by unissoft-bj Monday Jan 26, 2015 at 10:09 GMT Originally opened as https://github.com/caiwang/ihostsrc/issues/28


echo "DROP TABLE IF EXISTS z_passenger_raw;" | mysql -uroot -p0ffs4t? wlsp

echo "Create table z_passenger_raw (select mac, timestampdiff(second,firstseen,lastseen) as dura_raw, sender,netid, SUBSTRING(lastseen,1,13) as timebyhour from wlact where event='gone' and timestampdiff(second,firstseen,lastseen) >='1' and SUBSTRING(lastseen,1,4) = '2015' and weekofyear(lastseen) = '4');" | mysql -uroot -p0ffs4t? wlsp

remove duplicated rows

echo "DROP TABLE IF EXISTS z_passenger_raw1;" | mysql -uroot -p0ffs4t? wlsp echo "Create table z_passenger_raw1 (select distinct(CONCAT(mac,dura_raw,sender,netid,timebyhour)) as flag,mac,dura_raw,sender,netid,timebyhour from z_passenger_raw group by mac, sender, netid, timebyhour);" | mysql -uroot -p0ffs4t? wlsp

connect segments in the same hour

echo "DROP TABLE IF EXISTS z_passenger;" | mysql -uroot -p0ffs4t? wlsp echo "Create table z_passenger (select mac, sum(dura_raw) as dura, sender,netid, SUBSTRING(timebyhour,1,10) as timebyday,timebyhour from z_passenger_raw1 group by mac, sender, netid, timebyhour);" | mysql -uroot -p0ffs4t? wlsp

echo "delete from z_passenger where dura >'18000';" | mysql -uroot -p0ffs4t? wlsp

echo "DROP TABLE IF EXISTS z_weekfreq;" | mysql -uroot -p0ffs4t? wlsp echo "Create table z_weekfreq (select mac, count(mac) as freq,timebyday, sender, netid from z_passenger group by mac, timebyday,sender,netid);" | mysql -uroot -p0ffs4t? wlsp

echo "DROP TABLE IF EXISTS z_weekdurabystage;" | mysql -uroot -p0ffs4t? wlsp echo "Create table z_weekdurabystage (select mac,round(dura/600)+1 as durabystage, timebyday,sender,netid from z_passenger);" | mysql -uroot -p0ffs4t? wlsp

echo "select tbldura.mac,tbldura.durabystage as dura,tblfreq.freq, tbldura.timebyday,CONCAT(SUBSTRING(tbldura.timebyday,1,4),'-',IF(weekofyear(tbldura.timebyday) < 10, CONCAT('0',weekofyear(tbldura.timebyday)),weekofyear(tbldura.timebyday))) as timebyweek,tbldura.sender,tbldura.netid from z_weekdurabystage as tbldura INNER JOIN z_weekfreq as tblfreq on tbldura.mac=tblfreq.mac and tbldura.sender=tblfreq.sender and tbldura.netid=tblfreq.netid and tbldura.timebyday=tblfreq.timebyday ;" | mysql -uroot -p0ffs4t? wlsp > weekmac-dura-freq-13.txt

caiwang commented 9 years ago

Comment by unissoft-bj Monday Jan 26, 2015 at 10:38 GMT


不同店面 客流时长分布曲线(是否可计算出时长指数?)

image

caiwang commented 9 years ago

Comment by unissoft-bj Monday Jan 26, 2015 at 10:39 GMT


不同店面 客流频次分布曲线

image

caiwang commented 9 years ago

Comment by unissoft-bj Monday Jan 26, 2015 at 10:40 GMT


同一店面,不同日期之间的比较

1月19日数据与其他日期不同 image

caiwang commented 9 years ago

Comment by unissoft-bj Monday Jan 26, 2015 at 10:42 GMT


频次为1,2,3客流的时长特性

停留时间集中在30分钟内

image

caiwang commented 9 years ago

Comment by unissoft-bj Monday Jan 26, 2015 at 10:44 GMT


停留时间为20,30,40分钟顾客的频次特性

image

caiwang commented 9 years ago

Comment by unissoft-bj Tuesday Jan 27, 2015 at 00:20 GMT


总时长在不同时长段上的分布

image