一、数据
1、数据生命周期
2、数据源解析
2.1 商品信息
2.2 用户评分数据
2.3 主要数据模型
3、大数据处理流程
3.1 大数据离线处理流程
3.2 大数据实时处理流程
二、大数据推荐项目系统架构
1、项目系统架构
1、离线统计模块
1.1 历史热门商品统计
- 统计所有历史数据中每个商品的评分数,得:RateMoreProducts 数据结构:productId,count
select productId, count(productId) as count from ratings group by productId order by count desc
1.2 近期热门商品统计
- 统计每月的商品评分个数,就代表了商品近期的热门度,得:ratingOfMonth、RateMoreRecentlyProducts
select productId, score, changeDate(timestamp) as yearmonth from ratings
changDate :UDF函数,使用 SimpleDateFormat 对 Date 进行格式转化,转化格式为“yyyyMM”select productId, count(productId) as count ,yearmonth from ratingOfMonth group by yearmonth, productId order by yearmonth desc,count desc
RateMoreRecentlyProducts 数据结构:productId,count,yearmonth
1.3 商品平均评分统计
- AverageProducts 数据结构:productId,avg
select productId, avg(score)