summaryrefslogtreecommitdiff
path: root/README.md
blob: 9535e8b1951f3a8229349dd6fc32f2f1285237e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# UaAnalyser

根据user-agent分析ip对应的终端个数情况及相关信息

## Input
```
String inputString = "69765" + "\t" +      // userId
                "192.168.50.13" + "\t" +       // ip
                "1765433230" + "\t" +         // timeStamp
                "'Dalvik/1.6.0 (Linux; U; Android 4.0.3; LG-E612f Build/IML74K)':4, " +
                "'Dalvik/2.1.0 (Linux; U; Android 10; TNYAL00 Build/HUAWEITNY-AL00)':4, " +
                "'Mozilla/5.0 (iPhone; CPU iPhone OS 11_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15G77 ===  iOS/11.4.1 Model/iPhone10,1 BundleID/com.xunmeng.pinduoduo AppVersion/5.32.0 AppBuild/2009212125 pversion/1221 cURL/7.48.0':5, " +
                "'com.apple.trustd/1.0':1, " +
                "'server-bag [iPhone OS,13.6.1,17G80,iPhone10,2]':1, " +
                "'Microsoft-CryptoAPI/10.0':1, " +
                "'Mozilla/5.0 (Linux; Android 10; SM-G9600) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.110 Mobile Safari/537.36':10, " +
                "'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36':1";             // uaCntInfo
```

### Output
```
// 相关字段:
// osCnt, browserCnt, deviceCnt, terminalCnt, terminalCatCnt, 
// osList, browserList, deviceList, terminalList, terminalCatList
userInfo.getTerminalList(); // 获取terminalList字段值
```
* ``osCnt`` -操作系统数
* ``browserCnt``-浏览器数
* ``deviceCnt``-设备名数(如 "LG E612F")
* ``terminalCnt``-终端三元组标识数(os/browser/device)
* ``terminalCatCnt``-终端类别数(类别包括windows, apple, android三种)


## Usage

```
UaAnalyser uaAnalyser = new UaAnalyserImpl();
UserInfo userInfo = uaAnalyser.getUserinfo(inputString);
```