## 数据说明

- `cptdsp$1.0.1$二进制avro打包数据`
- 将以上数据进行 base64 编码，就是 feed 的 adsource。

| 名称                 | 类型           | 含义                             |
| ------------------ | ------------ | ------------------------------ |
| req_id             | string       | 广告请求ID                         |
| match_id           | string       | 唯一标识一次匹配                       |
| uid                | string       | 用户ID                           |
| st_id              | long         | 策略ID                           |
| cr_id              | long         | 创意ID                           |
| pos_id             | long         | 广告位ID                          |
| cat_id             | string       | 首次加入时，是给浏览器信息流使用，表示广告位属于哪个栏目ID |
| pay_price          | long         | 广告竞胜价，即广告主应支付给我们的价格            |
| media_id           | int          | 媒体ID                           |
| app_id             | long         | 广告 app id                      |
| timestamp          | long         | 广告匹配时的时间戳                      |
| charge_type        | int          | 结算类型                           |
| day_budget         | long         | 活动日预算                          |
| advertiser_balance | long         | 广告主余额                          |
| ctr_class          | int          | ctr来源，预测 模型 id                 |
| ctr                | double       | 点击率                            |
| cvr                | double       | 转化率                            |
| ecpm               | long         | 排序时用到的ecpm                     |
| ocpx_stage         | int          | 处于 ocpx 第几阶段                   |
| keywords           | string array | 请求里的搜索关键词，数组                   |
| ua                 | string       |                                |
| dbrand             | string       | 品牌                             |
| dmodel             | string       | 设备型号                           |
| ip                 | string       |                                |
| dis_width          | int          | 屏幕宽                            |
| dis_height         | int          | 屏幕高                            |
| vc                 | string       | 媒体 app 版本号                     |
| os                 | string       | 操作系统名称                         |
| conn               | int          | 网络连接方式                         |
| oaid               | string       |                                |
| idfa               | string       |                                |
| caid               | string       |                                |
| android_id         | string       |                                |
| advertiser_id      | long         | 广告主id                          |

### 一些数值定义

```
    ConnTypeUnknown  ConnType = 0
    ConnTypeEthernet ConnType = 1
    ConnTypeWIFI     ConnType = 2
    ConnTypeCell     ConnType = 3
    ConnTypeCell2G   ConnType = 4
    ConnTypeCell3G   ConnType = 5
    ConnTypeCell4G   ConnType = 6
    ConnTypeCell5G   ConnType = 7
```

## schema

```
    {"type":"record",
        "name":"cpt_ad_source",
        "fields":[
            {"name": "req_id", "type": "string"},
            {"name": "match_id", "type": "string"},
            {"name": "uid", "type": "string"},
            {"name": "st_id", "type": "long"},
            {"name": "cr_id", "type": "long"},
            {"name": "pos_id", "type": "long"},
            {"name": "cat_id", "type": "string"},
            {"name": "pay_price", "type": "long"},
            {"name": "media_id", "type": "int"},
            {"name": "app_id", "type": "long"},
            {"name": "timestamp", "type": "long"},
            {"name": "charge_type", "type": "int"},
            {"name": "day_budget", "type": "long"},
            {"name": "advertiser_balance", "type": "long"},
            {"name": "ctr_class", "type": "int"},
            {"name": "ctr", "type": "double"},
            {"name": "cvr", "type": "double"},
            {"name": "ecpm", "type": "long"},
            {"name": "ocpx_stage", "type": "int"},
            {"name": "keywords", "type": {
                "type": "array",
                "items": "string"
            }},
            {"name": "ua", "type": "string"},
            {"name": "dbrand", "type": "string"},
            {"name": "dmodel", "type": "string"},
            {"name": "ip", "type": "string"},
            {"name": "dis_width", "type": "int"},
            {"name": "dis_height", "type": "int"},
            {"name": "vc", "type": "string"},
            {"name": "os", "type": "string"},
            {"name": "conn", "type": "int"},
            {"name": "oaid", "type": "string"},
            {"name": "idfa", "type": "string"},
            {"name": "caid", "type": "string"},
            {"name": "android_id", "type": "string"}
    ]}
```