本文详细介绍了广告检索服务的设计,包括媒体方请求对象、检索服务响应对象的定义,以及如何构造响应对象和完善服务入口。媒体请求包含mediaId、RequestInfo和FeatureInfo等要素,响应对象涉及广告的二次筛选和位置类型匹配。广告检索服务的核心是通过逐层筛选,匹配广告位和推广单元。 摘要由CSDN通过智能技术生成

8.4 广告检索服务

媒体方发起广告请求,检索服务检索广告数据(条件匹配过程),返回响应

媒体方的请求包含的三个要素
媒体方的请求标识 mediaId
请求基本信息 RequestInfo: requestId,adSlots, App,Geo,Device
匹配信息 FeatureInfo:KeywordFeature, DistrictFeature,ItFeature, FeatureRelation

8.4.1 媒体方请求对象的定义

定义检索服务中媒体方发起的请求对象

@Data
@NoArgsConstructor
@AllArgsConstructor
public class SearchRequest {
    // 媒体方的请求标识
    private String mediaId;
    // 请求基本信息(广告位信息AdSlot、终端信息App、设备信息Device、地域信息Geo)
    private RequestInfo requestInfo;
    // 匹配信息(关键字、兴趣、地域)
    private FeatureInfo featureInfo;
     * 请求信息
    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class RequestInfo {
        //唯一请求ID
        private String requestId;
        //基本请求信息
        private List<AdSlot> adSlots;
        private App app;
        private Geo geo;
        private Device device;
     * 匹配信息
    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class FeatureInfo {
        //根据关键字、地域、兴趣筛选推广单元
        private KeywordFeature keywordFeature;
        private DistrictFeature districtFeature;
        private ItFeature itFeature;
        //默认全部匹配
        private FeatureRelation relation = FeatureRelation.AND;

广告位信息AdSlot

@Data
@NoArgsConstructor
@AllArgsConstructor
public class AdSlot {
    // 广告位编码
    private String adSlotCode;
    // 广告位置类型
    private Integer positionType;
    // 宽和高
    private Integer width;
    private Integer height;
    // 广告物料类型: 图片, 视频
    private List<Integer> type;
    // 最低出价
    private Integer minCpm;

应用终端信息App

@Data
@NoArgsConstructor
@AllArgsConstructor
public class App {
    // 应用编码
    private String appCode;
    // 应用名称
    private String appName;
    // 应用包名
    private String packageName;
    // 请求页面 activity名称
    private String activityName;

设备信息Device

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Device {
    // 设备 id
    private String deviceCode;
    // mac地址
    private String mac;
    // 设备ip
    private String ip;
    // 机型编码
    private String model;
    // 分辨率尺寸
    private String displaySize;
    // 屏幕尺寸
    private String screenSize;
    // 设备序列号
    private String serialName;

地域信息Geo

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Geo {
    private Float latitude;
    private Float longitude;
    //所在城市
    private String city;
    private String province;

8.4.2 检索服务响应对象的定义

检索服务中检索系统,根据

�164: 方法四的解决办法,亲测有效,链接:https://blog.csdn.net/spacesix/article/details/130678015?spm=1001.2101.3001.6650.2&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-2-130678015-blog-128184808.235%5Ev40%5Epc_relevant_anti_vip_base&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-2-130678015-blog-128184808.235%5Ev40%5Epc_relevant_anti_vip_base&utm_relevant_index=5 使用DNS名称作为安全性依据的漏洞优化 年轻的猴: 服了,我也找不到这个iptutil Kafka的生成者、消费者、broker的基本概念 jsfzdd: 谢谢提醒,那我再看一遍吧表情包 Mybatis新增数据,存在就更新,不存在就添加 不爱打代码22: LBJ反手一个赞