Refer a friend According Online

Last year, a company on-line RPG game, each bosses are to experience the tour, as the younger brother of our practice to follow suit brush copy number. A few days later, the boss threw me a question, he said he added a lot of friends, but want to brush copy of the time, basically not many people online. Can you recommend a friend like it based on the player's online time?

Recommended is the essence of the sort. Recommend user to user, it is to find a similarity evaluation function to measure the user's online time period two are similar. Then target player and all players similarity eleven calculations and sequential recommended.

In my practice before the introduction, the column encountered three problems:

  1. How to represent each player's online habits, new players how to do?
  2. How to design similarity evaluation function?
  3. How does the system support the order of tens of millions more players?

Think about the suggestion here, if you are, how to solve the above problems. Welcome in the comments area :)

My approach

Online vectors

Use a 24-dimensional vector describing the user 24 hours of online habits, each dimension represents the players within this time-line expectations , known online vector .

As Figure 1 , suppose we have a player A, he one day between 12:00 to 13:00 on the line for a while, in the evening also had 20 points on the line for a while.

If we think A rough at 12: 00-13: 00,20: 00-21: 00 and online probability one, you get 2 in-line vector.

If the long term, the period of time of time of day vector averaging, we get an average vector this time. FIG 3 the green block is the player A after four days of observation vectors obtained online, i.e.,

V_a $$ = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 0.25, 0, 0, 0, 0, 0, 0, 0.25, 0, 0 , 0) $$

使用在线向量,我们可以粗略刻画玩家在某个时间点在线的期望。此外,在线向量的norm也在一定程度上刻画了用户的活跃情况,对于频繁上线的用户,其在线向量的norm会大于不常上线的用户。我们可以利用这点,尽量给推荐更加活跃的用户作为好友。

在线相似度

对于两个用户之间的在线相似度,我们使用两人的在线向量的內积表示。这个內积可以理解为两个玩家在一天中“相遇”的期望。

$$ S_{AB} = V_A cdot V_B $$

假设我们有3个用户,

$$
begin{aligned}
V_A & = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 0.25, 0, 0, 0, 0, 0, 0, 0.25, 0, 0, 0) \
V_B &am 大专栏  根据在线时间推荐好友p; = (1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.1, 0, 1, 0) \
V_C & = (1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0.5, 0, 0, 0, 0, 0, 0, 0.5, 0, 0, 0)
end{aligned}
$$

假设我们要给A推荐用户,分别计算A与B、A与C的相似度,

$$
begin{aligned}
S_{AB} & = V_A cdot V_B = 0.25 times 0.1 = 0.025 \
S_{AC} & = V_A cdot V_C = 0.5 times 1 + 0.25 times 0.5 + 0.25 times 0.5 = 0.75
end{aligned}
$$

用户B、C相比,我们更愿意推荐C给A作为好友。尽管B的活跃程度非常高,但是与C与A的在线习惯更为匹配。这种推荐方案符合我的要求。

聚类+随机+排序

对于每一条推荐请求,计算其与所有用户的在线相似度,并排序推荐显然开销巨大。常见的推荐系统往往采用分层的架构减少计算开销,大致意思就是底层过滤一些根本不靠谱的,上层再对少量数据精排。

我们底层使用离线聚类,将所有用户打上类标签。在应对用户的推荐请求时,只对同一类的用户随机挑选若干,然后进行相似度计算和排序,并最终按序推荐给用户。通过控制聚类的类数,和随机挑选的用户数,可以保证最后的排序人数可控。

实验

为了验证效果,我拿了某游戏800名用户一段时间的在线记录做验证demo。图4展示了这些玩家的在线向量。

图5中,我随机挑选了2个用户,计算所有用户和他们的在线相似度并排序。从效果来看,推荐效果还是比较理想的。

此外,我也试验了一下聚类的效果。从图6的实验结果来看,在聚为五类时,用户的在线习惯也比较明显的展现了。

除了用于粗排,聚类也从一个侧面做了一些用户画像的工作。图6很好的展示了这点,从上到下的5类用户,分别对应晚间上线、中午上线、傍晚上线、上午上线、全天在线几种类型,利用这点可以采取更加精细化的运营策略。

最后

This requirement is very common in the game, another case in addition to a copy of the online multiplayer. Used to do a card game between teams can play against the organization, it requires at least three people to participate online. However, the line features six months, the number of teams to race a few innings. Although this problem finally solved by increasing the maximum number of teams, but look at the silent hundred micro-channel group, we know that the increase is bound to reduce the number of participation of each player in the team. Now look, if at the time to join the "time-line" factor in the team recommended, so that the time-line of similar players and teams, should be better than some of the effect of the number change.

Guess you like

Origin www.cnblogs.com/lijianming180/p/12041443.html