Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
doc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
frank.chen
doc
Commits
d6a3bdbf
Commit
d6a3bdbf
authored
Jun 13, 2025
by
frank.chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffwe
parent
5f7f98cc
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
257 additions
and
7 deletions
+257
-7
ppt_结构体.md
doc-code/ssp/ppt_结构体.md
+140
-0
ssp_match.md
doc-code/ssp/ssp_match.md
+23
-5
ssp_resp.md
doc-code/ssp/ssp_resp.md
+67
-0
预测.md
doc-code/ssp/预测.md
+10
-0
prometheus.md
通用/prometheus.md
+11
-0
我们的IP被合作伙伴加白.txt
通用/我们的IP被合作伙伴加白.txt
+6
-2
No files found.
doc-code/ssp/ppt_结构体.md
0 → 100644
View file @
d6a3bdbf
## 概述
-
PPT是指 publish_parameter_t 这个结构体。
-
INFO是指 ad_match_log_info_t 这个结构体
-
标
`*`
的表示字段需要记录日志。
## PPT
### 状态成员
ppt 记录多个广告位。做匹配时,ppt里有几个字段,记录状态。
-
m_creative_matched_num 广告位开始匹配时,清零该成员。经常与 m_adpos_match_number 做比较,也与 m_ads_pos_sizes 做比较。
-
m_ads_pos_index 当前做匹配的那个广告位的索引
-
m_ads_pos_id_matched_index 数组下标,用于操作info数组。
-
m_curr_ads_pos_id_matched_index 数组下标,指示当前正处理的 ad_match_log_info_t,与 m_ads_pos_id_matched_index 相似。
-
m_deal_price 策略筛选过程临时存放的竞价价格值。当活动级别为 HIGH_LEVE_SPECILE 或 LOW_LEVE_SPECILE 时,价格为活动价格,否则为调整后的价格。
-
m_is_validate 请求是否有效。
-
m_keywords_matched_ids 广告条件里获取值,ctr class 为 ZHIZIYUN_KEYWORDS 时,做广告筛选。
-
m_adpos_match_number 开始对一个广告位进行匹配时,初始化该字段。可能取值为:m_ads_pos_sizes,m_adpos_search_size。
### 固定值成员
初始化后不变
-
`*m_timestamp`
每次广告匹配的时间戳,单位毫秒,实际精确到秒。
-
m_time_segment 由上面的时间戳推算,当前时间在一周的第几个小时。该值用于广告定向。
-
`*m_log_type`
当前 http 请求类型,比如匹配、展示、行为(点击、下载等等)、视频。
-
`*m_match_type`
匹配类型。0 非匹配,1 普通匹配,2 搜索匹配。
-
m_ads_pos_sizes 广告位需要的最大广告数,优先考虑 m_ads_pos_reqcnt 的值,即 url 传来的参数。若无此参数,则从共享内存获取。
### 参数值 url
-
m_gps_long 目前只做了有效性检查,没有存下来,也没有参与匹配。
-
m_gps_lat 同 m_gps_long
-
`*m_ip_str`
url 不传参时,初始化为127.0.0.1。dmp 预测需要,adsource 需要。推算出的地理位置信息做定向。
-
m_ip_value ip 的数字形式,无特别作用,可干掉。
-
`*m_ip`
由 ip 推算的地理位置信息。
-
m_ad_poses 广告位的url参数原始信息,不记录日志,目前没什么用处。
-
m_ads_pos_id_num 广告位总数。
-
m_ads_pos_id 广告位ID数组。
-
m_ad_pos_reqcnts url参数 reqcnt 字符串。不记录日志,目前没什么用处。
-
m_ads_pos_reqcnt 每个广告位需要的最大广告数,从 url 参数 reqcnt 解析。
-
m_ads_pos_width 一开始会从url里的参数解析,不过后续会被共享内存里的值覆盖。
-
m_ads_pos_height 同上。
-
m_source_adsource 广告追踪事件会用到。
-
`*m_user_agent`
url 参数 ua。获取到 ua 参数后,要 base64 decode。
-
`*m_user_os url`
参数 dos。dmp 预测时需要。
-
m_user_language url 参数 lan。未使用。
-
`*m_user_device`
url 参数 db。请求有效性检查要用到。
-
`*m_user_dm`
url参数 dt。请求有效性检查需要。dmp 预测需要。
-
`*m_user_id`
参数 uid。请求有效性检查。adsource。广告过滤。dmp 预测。
-
m_phone_number 参数 phone_number。无使用。
-
m_key_words_no 参数 keywords 所含关键字数量。
-
m_key_words 参数 keywords 分解的关键字数组。参与预测,广告筛选。
-
`*m_source_key_words`
参数 keywords 原始值。参与 adsource,敏感词检测,返回串构造。
-
`*m_apps_names`
参数 apps。参与广告筛选,dmp 预测。
-
m_category_list 参数 category。参与广告筛选。
-
`*m_orignal_adsourceid`
参数 original,似乎无用,待确认。
-
`*m_dcs_display`
参数 dis,分辨率。参与 adsource,dmp 预测。
-
m_dcs_width 参数 dis 分解出的分辨率值。无使用。
-
m_dcs_height 同上。
-
`*m_dcs_nt`
参数nt。参与 adsource,dmp 预测。
-
m_hashvalue 参数 hashvalue。无使用。
-
`*m_app_version`
参数 vc。参与 adsource,预测,筛选。
-
m_force_flag 参数 force,目前未使用。
-
m_https_flag 是否为 https 请求,根据 http 头获取,目前未使用。
-
`*m_pkgname`
参数 pkgname。用于dmp预测。
-
m_video_event_type 参数 type。视频类通知里才会出现。用于记录 kafka 日志。
-
m_video_event_desc 视频类通知的类别描述。与 m_video_event_type 相关联。用于记录 kafka 日志。
### 配置值 -- 共享内存 redis
-
m_medias_id 从共享内存获取的广告位所属媒体。会赋值给 info 的媒体ID。
-
m_ads_pos_type 需要的广告类型,如 banner,flow。从共享内存获取。
-
m_adpos_pos_game 是否支持游戏类型的创意。从共享内存获取。
-
m_adpos_search_size 搜索类广告位的最大广告数,从共享内存获取。当show type为1或者2,且有搜索词时,m_adpos_match_number 会被赋值为这个字段。
-
m_adpos_show_type 广告位类型。从共享内存获取。
-
m_adpos_match_force 匹配策略:1 精准; 2 精准&模糊; 3 精准&模糊&强制。从共享内存获取。
-
m_callback_toutiao 是否给头条发 callback。从共享内存获取。
-
m_distr 由redis配置获取,并摇骰子决定。
-
m_adpos_match_levle 共享内存获取。
-
m_adpos_page 共享内存获取。目前不使用。
-
m_media_name 共享内存获取。用于判断非 appstore 媒体的广告填充。
-
m_page 共享内存获取。dmp 预测需要,adsource 需要。
-
m_adpos_slogon 共享内存获取。用于返回信息的字段 app_creative_title。
### 其他值
-
m_ads_pos_ctr_class 广告位的预测模型ID。
-
m_ads_pos_ctr_class_original 和 ZHIZIYUN_KEYWORDS 有关。
-
m_ctr_type 展示、搜索、相关性。
-
`*m_app_log_set_tag`
日志ID。比较绕,需要好好看看。
-
`*m_refer_pub_log_id`
追踪信息使用。
### 注意
-
m_ads_pos_sizes m_ads_pos_reqcnt m_adpos_match_number,注意关系。匹配数的判定有两级。
-
CTR_CLASS_ZHIZIYUN_KEYWORDS 有特殊处理。
-
媒体信息有些冗余。
-
PPT里混合了匹配和追踪,不太合理,应该分开。目前已基本分开,视频广告追踪目前还未分开。
-
m_app_log_set_tag 等一些日志id比较绕。
-
ppt和info,都在nginx pool里,初始化机制,导致成员不适合用c++ 复杂类型,比如 stl。
## INFO
-
`*m_ads_pos_id`
用于 adsource,广告筛选。
-
m_ad_show_pos 用于广告筛选。
-
`*m_cutted_word`
切词匹配。
-
`*m_matched_word`
匹配到的平台设置的关键词。
-
`*m_matched_word_flag`
只记日志。
-
`*m_medias_id`
用于 adsource。
-
m_adpos_match_levle 有赋值但实际未使用。
-
m_ads_pos_width 有赋值但实际未使用。
-
m_ads_pos_height有赋值但实际未使用。
-
m_ads_pos_type 有赋值但实际未使用。
-
`*m_app_ad_log_id`
用于 adsource。
-
m_ads_creative_width 有赋值但实际未使用。
-
m_ads_creative_height 有赋值但实际未使用。
-
m_strategy 标识匹配到的活动。
-
m_creative 标识匹配到的创意。
-
`*m_creative_id`
和 m_creative 比,冗余了。
-
`*m_strategy_id`
和 m_strategy 比,冗余了。
-
`*m_strategy_price`
和 m_strategy比,冗余了。
-
`*m_deal_price`
策略的成交价格。用于 adsource,生成响应信息。
-
`*m_pay_price`
未赋值但是记录日志。可考虑干掉。
-
`*m_campaign_id`
用于 adsource。和 m_strategy 比,冗余了。
-
m_app_creative_title 用于响应信息。show type 为1或2,才需要此字段。
-
`*m_app_id`
用于 adsource,生成响应信息。和 m_creative 比,冗余了。
-
`*m_source_app_id`
生成响应信息。和 m_creative 比,冗余了。
-
`*m_source_product_id`
生成响应信息。和 m_creative 比,冗余了。
-
`*m_adsource_id`
生成响应信息。
-
`*m_creative_click_url`
匹配时,只记录日志。追踪信息,该字段存放 clickurl 参数,现计划PPT中分离追踪信息,所以现在该字段不存 clickurl 参数。
-
m_match_creative_index 一个广告位的所有 info 数组的索引。
-
`*m_is_matched`
该字段目前用的较少,某些关键代码,应该多使用该字段。
-
`*m_voucher_flag`
是否优先消耗虚拟币。
-
m_ctr_value 取自策略曝光值 m_strategy_roi_imprevalue,目前只有赋值,但没使用该字段。
-
`*m_ctr_class`
用于adsource。最初赋值于ppt->m_ads_pos_ctr_class,等于 CTR_CLASS_RECOMMEND_RECOMMEND 时,对 m_voucher_flag 做特殊处理。之后,值等于 CTR_CLASS_ZHIZIYUN_KEYWORDS 时,赋值为 ppt->m_ads_pos_ctr_class_original。
-
m_download_btn; // 取自 m_strategy->m_download_btn,目前只有赋值,但没使用该字段。生成响应时,实际使用到了 m_strategy->m_download_btn。因此可以废弃。
-
m_adpos_slogon 取值于ppt->m_adpos_slogon。用于响应信息的 app_creative_title 字段。
doc-code/ssp/ssp_match.md
View file @
d6a3bdbf
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
-
广告定向-鹏泰预测时
-
广告定向-鹏泰预测时
-
投放 游戏类
-
投放 游戏类
-
投放 showType为15时,
appname
==keyword
-
投放 showType为15时,
(appname 或 pkg)
==keyword
-
投放 关联关键词的活动
-
投放 关联关键词的活动
-
投放 定向筛选-关键字完全匹配的活动
-
投放 定向筛选-关键字完全匹配的活动
-
投放 定向筛选-关键字模糊匹配的活动
-
投放 定向筛选-关键字模糊匹配的活动
...
@@ -88,7 +88,7 @@
...
@@ -88,7 +88,7 @@
-
按 LLM 来优化出价
-
按 LLM 来优化出价
-
DSP 的 CPM 类广告价格转化为 CPD
-
DSP 的 CPM 类广告价格转化为 CPD
### 计算 ecpm
### 计算 ecpm
(排序用)
-
走鹏泰预测时
-
走鹏泰预测时
-
获取鹏泰ctr
-
获取鹏泰ctr
-
以共享内存里的数据作为保底
-
以共享内存里的数据作为保底
...
@@ -123,7 +123,7 @@
...
@@ -123,7 +123,7 @@
-
价格优化
-
价格优化
-
OAID 长度判断,某些广告对 OAID 有要求
-
OAID 长度判断,某些广告对 OAID 有要求
-
UID 为 NoUserAgreement时的相关判定
-
UID 为 NoUserAgreement时的相关判定
-
showtype 14时,关键词和包名,应用名
的匹配
-
showtype 14时,关键词和包名,应用名
匹配才投放
-
创意类型匹配
-
创意类型匹配
-
避免本次重复推送
-
避免本次重复推送
-
行业分类
-
行业分类
...
@@ -146,14 +146,32 @@
...
@@ -146,14 +146,32 @@
-
获取返回并解析数据
-
获取返回并解析数据
-
若上述步骤失败,则使用鹏泰预测数据
-
若上述步骤失败,则使用鹏泰预测数据
## 获取 dsp 广告
### ocpd 预测
### ocpd 预测
-
只有走zzy预测时,才会做ocpd预测
-
只有走zzy预测时,才会做ocpd预测
## dsp
-
判断当前请求是否满足请求dsp的要求。
-
计算底价
-
摇骰子确定是否请求dsp
-
构造请求数据,发送 http 请求,获取返回
-
解析返回数据,得到广告数组,初步判断是否投放
-
当dsp返回的广告不在我们库中时,需要登记
-
按价格排序,同名广告,选价高的
-
待广告筛选完成后
-
价格加密
-
缓存投放广告的tracking url
-
发送 win loss 通知
-
记录匹配日志
-
记录 dsp 广告返回计数,用于统计和监控
## smartswitch 做特殊处理
## smartswitch 做特殊处理
-
按包名去重
-
按包名去重
-
将前5个广告的category设为'0'
-
将前5个广告的category设为'0'
-
按分类分组广告
-
根据请求里指定的分类,选广告
-
分类的广告数不满5个时,该分类会被过滤
-
当分类数不足4个时,将未被选中的且满5个的分类,进行补充
-
关于 4个分类: '0' 分类必推,所以 '0' 分类 + 另外3个分类。
## 辅助流程
## 辅助流程
...
...
doc-code/ssp/ssp_resp.md
0 → 100644
View file @
d6a3bdbf
## 概述
响应信息为一个json字符串。是一个json数组,最外层是中括号。
## 普通
-
result 成功与否。1或0。
-
ad_pos_id 广告位ID。
-
creative_id
-
ad_app_id 数字ID。
-
creative_type 创意类型,image或text。
-
creative_width
-
creative_height
-
content 图片url或者广告文本描述。
-
adType 值的含义待考证。
-
product_id
-
app_id 似乎是bundle。
-
click_url 点击跳转地址。
-
keyword 用户搜索的关键字串,原始串。
-
reward_point 用户安装app后可获取的星钻值。
-
ctr_class 模型ID
-
ctr_val 转化率
-
download_type 从哪儿下载,0: 三星应用商店,1:鹏泰cdn
-
tencentReportField 应用宝广告相关字段
-
app_name
-
app_version
-
app_pay 付费方式。
-
app_creative_title
-
app_size
-
adsource
-
download_btn
-
debug
### 非appstore
-
tracking_click_url 点击通知。
-
tracking_imp_url 展示通知。
-
tracking_download_url 下载通知。
-
tracking_install_url 安装通知。
-
app_rating app星值。
-
app_desc
-
deeplink_url
-
app_price 成交价。
-
app_download_url
-
app_download_md5
-
app_version_code
-
ver_diff
## smartswitch
-
result
-
content
-
product_id
-
app_id
-
app_name
-
app_version
-
app_pay
-
app_size
-
adsource
-
category
-
app_rating
-
reward_point
-
debug
doc-code/ssp/预测.md
0 → 100644
View file @
d6a3bdbf
## 主体流程
-
摇骰子,确定使用哪家合作者
-
构造请求数据,发送HTTP请求,获取返回
-
解析返回数据
-
广告匹配
-
发送 callback
### tracking
-
发送数据给合作者
通用/prometheus.md
0 → 100644
View file @
d6a3bdbf
## 启动
-
暂时通过 nohup 来启动
```
例如:
nohup ./prometheus --web.enable-lifecycle &
```
## 重启
-
启动时,增加参数
`--web.enable-lifecycle`
-
后面通过接口热重启
`curl -XPOST http://127.0.0.1:9090/-/reload`
\ No newline at end of file
通用/我们的IP被合作伙伴加白.txt
View file @
d6a3bdbf
180.184.56.132 180.184.56.134 180.184.61.63 180.184.56.138 180.184.56.139 180.184.56.136 180.184.61.244
180.184.56.132 180.184.56.134 180.184.61.63 180.184.56.138 180.184.56.139 180.184.56.136 180.184.61.244
3个代理服务器,用于dsp广告请求、广告预测
3个代理服务器,用于dsp广告请求、广告预测
180.184.56.132 180.184.56.134 180.184.61.63
2台trace通知,合作者:dsp、广告预测
2台trace通知,合作者:dsp、广告预测
180.184.56.138 180.184.56.139
2台 stg 测试
adx-stg 180.184.56.136
ngx-stg 180.184.61.244
2台 stg
ssp、adx。其中adx的stg服务器,还会发给合作伙伴,dsp、广告预测
ssp、adx。其中adx的stg服务器,还会发给合作伙伴,dsp、广告预测
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment