Google Ads 广告系统排序与实时竞价架构揭秘

🚀 一、业务背景与挑战

Google Ads 是全球最大的广告平台之一,服务于:

  • 搜索广告(Search Ads)
  • 展示广告(GDN)
  • YouTube 视频广告
  • App 内广告(AdMob)

其核心挑战是:

维度 要求
毫秒响应 用户搜索结果页需 < 100ms 返回广告
广告精准性 保证高 CTR、CVR 和用户相关性
商业变现 优先展示出价高但质量也高的广告
风控与合规 过滤低质量广告,避免违法内容展示

🏗 二、核心架构总览图

🧠 三、排序系统核心组成

1️⃣ Bid:出价(CPC/CPM)

广告主设置:

  • CPC(点击付费)
  • CPM(千次展示付费)
  • CPA(转化付费) → 后续智能出价模块转换为等价出价

2️⃣ Quality Score:广告质量得分

QS 由多个因子决定:

python 复制代码
def compute_qs(ctr, lp_exp, ad_relevance):
    return 0.5 * ctr + 0.3 * lp_exp + 0.2 * ad_relevance
  • CTR(历史点击率)
  • LP Exp(落地页体验)
  • Ad Relevance(广告与关键词匹配度)

系统采用 TensorFlow 模型训练,结合特征交叉:

makefile 复制代码
# 示例:交叉特征生成
keywords = tf.feature_column.categorical_column_with_vocabulary_list(
    "keyword", ["shoes", "running", "cheap"]
)
device = tf.feature_column.categorical_column_with_vocabulary_list(
    "device", ["mobile", "desktop"]
)
crossed = tf.feature_column.crossed_column([keywords, device], hash_bucket_size=1000)

训练完成后,部署在 Vertex AI + TensorRT 上,支持批量推理加速。


🧮 四、实时竞价系统(RTB 引擎)

Google Ads 使用变体的 [Vickrey-Clarke-Groves 拍卖机制 (VCG)]:

  • 出价不等于最终支付价格
  • 实时系统根据其他竞价者行为动态计算付款金额

示例:两位广告主竞价

广告主 出价(Bid) 质量分(QS) 综合得分 Bid × QS
A $2.0 0.8 1.6
B $1.5 0.9 1.35

最终展示顺序:A > B

A 实际支付金额为:B 的得分 ÷ A 的 QS = 1.35 / 0.8 = $1.6875


🎯 CTR 模型训练(TensorFlow)

ini 复制代码
# 特征组合
features = tf.concat([user_emb, ad_emb, context_features], axis=1)
# MLP 网络
x = tf.keras.layers.Dense(256, activation='relu')(features)
x = tf.keras.layers.Dense(128, activation='relu')(x)
logits = tf.keras.layers.Dense(1)(x)

训练后输出 SavedModel,自动部署到线上推理系统:

arduino 复制代码
gcloud ai models upload --region=us-central1 --display-name="ctr_model_v2" --artifact-uri=gs://my-bucket/ctr_model

⚡ 实时特征计算(Flink)

ini 复制代码
val clickEvents = env.fromSource(clickStream)
val featureStream = clickEvents
  .keyBy(_.userId)
  .window(TumblingEventTimeWindows.of(Time.minutes(5)))
  .aggregate(new CTRFeatureAggregator())

⚙️ 模型线上调用(Python)

ini 复制代码
import google.cloud.aiplatform.prediction as aip
result = aip.PredictRequest(
    endpoint="projects/xxx/endpoints/ctr-v2",
    instances=[{"user_id": 123, "ad_id": 456, "device": "mobile"}],
)

📊 六、实战效果数据(AB 实验)

指标 旧系统 新系统(模型 + VCG + QS) 提升
平均点击率 CTR 1.4% 2.1% ↑50%
每千次展示收益 eCPM $2.9 $4.2 ↑44%
用户投诉广告无关率 0.72% 0.41% ↓43%

🔐 七、风控体系:广告审核 + 欺诈检测

Google 使用多层机制审核广告内容:

  • BERT + ViT 检测低俗/虚假内容
  • Flink 检测异常点击/刷广告行为
  • 落地页实时解析检测跳转劫持行为
python 复制代码
def detect_fake_ad(ad_text):
    score = nlp_model.predict(ad_text)
    if score['fake'] > 0.9:
        return True
    return False

🧠 八、未来展望

  • 引入 RL 训练的 Bid Adjustment(策略价值最大化)
  • 广告多目标排序(收益 + 品牌好感 + 内容相关性)
  • 高可用微服务系统拆解与 AI 编排调度平台落地(KubeFlow + AutoML)

✅ 总结(Google Ads 智能竞价团队技术负责人)

"广告排序系统并不是最贵者得,而是最相关、最有价值的人赢。"

我们的任务,就是让机器能在 100 毫秒内判断这场拍卖谁该赢,而且结果不能错。

相关推荐
章豪Mrrey nical44 分钟前
前后端分离工作详解Detailed Explanation of Frontend-Backend Separation Work
后端·前端框架·状态模式
派大鑫wink2 小时前
【JAVA学习日志】SpringBoot 参数配置:从基础到实战,解锁灵活配置新姿势
java·spring boot·后端
程序员爱钓鱼2 小时前
Node.js 编程实战:文件读写操作
前端·后端·node.js
xUxIAOrUIII2 小时前
【Spring Boot】控制器Controller方法
java·spring boot·后端
PineappleCoder2 小时前
工程化必备!SVG 雪碧图的最佳实践:ID 引用 + 缓存友好,无需手动算坐标
前端·性能优化
Dolphin_Home2 小时前
从理论到实战:图结构在仓库关联业务中的落地(小白→中级,附完整代码)
java·spring boot·后端·spring cloud·database·广度优先·图搜索算法
zfj3212 小时前
go为什么设计成源码依赖,而不是二进制依赖
开发语言·后端·golang
weixin_462446233 小时前
使用 Go 实现 SSE 流式推送 + 打字机效果(模拟 Coze Chat)
开发语言·后端·golang
JIngJaneIL3 小时前
基于springboot + vue古城景区管理系统(源码+数据库+文档)
java·开发语言·前端·数据库·vue.js·spring boot·后端
敲敲了个代码3 小时前
隐式类型转换:哈基米 == 猫 ? true :false
开发语言·前端·javascript·学习·面试·web