对WAP站点的User_Agent最新分析
2011年我曾经对手头负责的WAP站的User_Agent分析过,通过当时的分析结果写过一些相应的处理规则。但近两年手机、手机浏览器的发展日新月异,原来的规则就慢慢的出现了不能很好兼容的情况,于是今天(2013.01.04)我又对现在WAP站的访问情况进行了分析。借助Sqlserver等关系型数据库可以对这些数据很好的进行分析、统计。以下是插入用户访问到数据库的方法(我用的是Asp.net):[csharp]SqlConnection conn = new SqlConnection("server=.;database=mobile;uid=test2011;pwd=test2011;");string sqlText = "insert into headerinfo(accept,user_agent,all_http,visit_ip) values(@accept,@user_agent,@all_http,@visit_ip)";SqlCommand command = new SqlCommand(sqlText, conn);command.CommandType = CommandType.Text;try{conn.Open();command.Parameters.Add("@accept", SqlDbType.VarChar, 8000);command.Parameters.Add("@user_agent", SqlDbType.VarChar, 8000);command.Parameters.Add("@all_http", SqlDbType.VarChar, 8000);command.Parameters.Add("@visit_ip", SqlDbType.VarChar, 8000);command.Parameters[0].Value = FormatInsertData(Request.Headers["Accept"]);command.Parameters[1].Value = FormatInsertData(Request.UserAgent);command.Parameters[2].Value = FormatInsertData(Request.ServerVariables["ALL_HTTP"]);command.Parameters[3].Value = IPAddress;command.ExecuteNonQuery();}catch (Exception ex){}finally{if (conn.State == ConnectionState.Open){conn.Close();}}我保存了几分钟内的数据,总共有14899条,下面是我借助SqlServer查询分析器得到的分析结果。-----------------------------------------------所有select count(*) from headerinfo14899 总共条数--------------------------------------------iOS android 空 其它SELECT COUNT(*) AS Expr1FROM headerinfoWHERE (User_Agent LIKE 'iuc%') OR(User_Agent LIKE 'juc%') OR(User_Agent LIKE '%android%') OR(User_Agent LIKE '%ios%') OR(User_Agent LIKE '%iphone%')6589 android,iOSSELECT COUNT(*) AS Expr1FROM headerinfoWHERE (User_Agent LIKE '')1262 user_agent为空SELECT COUNT(*) AS Expr1FROM headerinfoWHERE (User_Agent NOT LIKE 'iuc%') AND (User_Agent NOT LIKE 'juc%') AND(User_Agent NOT LIKE '%android%') AND (User_Agent NOT LIKE '%ios%') AND(User_Agent NOT LIKE '%iphone%') AND (User_Agent NOT LIKE '')7048 其他-----------------------------------------------iOSSELECT COUNT(*) AS Expr1FROM headerinfoWHERE (User_Agent LIKE '%ios%') OR(User_Agent LIKE '%iphone%') OR(User_Agent LIKE '%ipad%') OR(User_Agent LIKE '%ipod%') OR(User_Agent LIKE '%itouch%')1147 苹果系列--------------------------------------------iOS ucweb极速SELECT *FROM headerinfoWHERE (User_Agent LIKE 'iuc%')725 ucweb 极速SELECT COUNT(*) AS Expr1FROM headerinfoWHERE (User_Agent LIKE '%iphone%')422SELECT *FROM headerinfoWHERE (User_Agent LIKE 'iuc%') AND (User_Agent LIKE '%iphone%')0--------------------------------------------AndroidSELECT COUNT(*) AS Expr1FROM headerinfoWHERE (User_Agent LIKE '%android%')2894 含有android关键字--------------------------------------------Android ucweb极速SELECT COUNT(*) AS Expr1FROM headerinfoWHERE (User_Agent LIKE 'juc%')2557 Android下 ucweb 极速SELECT COUNT(*) AS Expr1FROM headerinfoWHERE (User_Agent LIKE 'juc%') AND (User_Agent LIKE '%android%')14 由此可见大部分都不含有android--------------------------------------------iOS android下 ucweb极速版SELECT COUNT(*) AS Expr1FROM headerinfoWHERE (User_Agent LIKE 'iuc%') OR(User_Agent LIKE 'juc%')3282--------------------------------------------其它--------------------------------------------其它--nokiaSELECT COUNT(*) AS Expr1FROM headerinfoWHERE (User_Agent NOT LIKE 'iuc%') AND (User_Agent NOT LIKE 'juc%') AND(User_Agent NOT LIKE '%android%') AND (User_Agent NOT LIKE '%ios%') AND(User_Agent NOT LIKE '%iphone%') AND (User_Agent LIKE '%nokia%' or user_agent like '%SymbianOS%')3095 nokia,sysbianOS---------------------------------------------其它--mtk山寨机SELECT COUNT(*) AS Expr1FROM headerinfoWHERE (User_Agent NOT LIKE 'iuc%') AND (User_Agent NOT LIKE 'juc%') AND(User_Agent NOT LIKE '%android%') AND (User_Agent NOT LIKE '%ios%') AND(User_Agent NOT LIKE '%iphone%') AND (User_Agent NOT LIKE '%nokia%') AND(User_Agent LIKE '%maui%')327 mtk山寨机---------------------------------------------其它--java最早的按键手机SELECT COUNT(*) AS Expr1FROM headerinfoWHERE (User_A补充:Web开发 , 其他 ,
上一个:记录一个字典表缓存问题的处理实例
下一个:Dom解析XML常见的操作
- 更多wap疑问解答:
- 新人求助QPainter
- 为什么程序都退出了还可以收到推送?如果大多设备都可以推送那运营商怎么办?
- qt 4.7 sqlserver2000 存储过程调用
- 关于ANDROID4.0.1编译问题!
- Android FrameBuffer读屏幕30秒后mmap失败
- 联通粗定位用java程序如何来请求和接受数据
- 为什么QT运行Android平台的程序时,mouseMoveEvent事件响应的间隔时间很长??????????
- android与PC蓝牙通讯
- 指定大小的label 内容可变,如果内容超出label的宽度,将未能显示的部分显示在另一个label上
- Android调试
- android如何通过wifi连接无线打印机
- 运行程序,release目录下产生一个乱码文件夹
- 分享个某机构最新安卓资料,自己验证了
- service启动不起来,掉不了service connection
- 求助:QT5.0 没有QPrinter吗