Product Manager: An Engineer's Perspective

Product manager

I recently start an online lesson on Geektime and come across an enlightening lecture from a facebook Product Manager Xiaoyin Qu. This article collects some learning & opinion that I thought useful.

Read More / 继续阅读

Share

未来大学:文中的职场生命故事

生命故事

受未来大学的邀请,我为未来大学的学员主讲了一期课程。其中有一段内容,是向学员介绍我的「职场故事」。我选择了「如何建立主动意识,明确方向快速蜕变」这个方向。

课程由北辰青年策划,课程内容由昕睿、文中共同完成创作。

Read More / 继续阅读

Share

Sim Cloud:蔚来服务云仿真平台设计

「一键加电」是蔚来为车主提供的代客加电服务。用户在 App 中下单后,系统的调度模式如下:用户下单后,调度系统会根据用户期望的取车位置 / 取车时间、车辆状态(例如续航里程)等因素,求解服务专员和服务电力资源的组合方案。系统在求解过程中会考虑一系列的地理信息因素(如限行围栏、道路状况等),然后结合服务人员的空闲情况、电力资源的服务能力和再生能力,以及系统的配置,求出服务距离、服务时长综合最优的服务方案。

为用户提供的加电资源主要有两种:换电站和移动充电车。换电站可以在 3 分钟内将旧电池拆下,换上新电池,提供非常好的加电体验。移动充电车则适合于远郊或低电量场景,除换电站和移动充电车以外,在部分资源还没有密集布局的地区,我们也会利用三方的充电桩进行加电服务。

以下是蔚来一键加电的服务流程图:
一键加电流程

(其中虚线框表示服务流程,绿色段表示对资源的占用,蓝色段表示对服务专员的占用)。

随着车辆的逐渐交付,线上一键加电的订单需求日益增多。为保障一键加电的服务完成率和准时率,我们有大量的优化问题需要被解决,如:

  • 预测 traffic model 的变化可能带来的服务时长、人员利用效率的影响
  • 预测不同的人力和电力资源供给情况下,系统的服务能力上限
  • 为服务人员的资源布局提出建议
  • 评测待上线的算法和调参的效果

这些问题对系统的调度性能提出了离线和可测量要求。

对于包含调度行为的 O2O 系统,服务承载能力难以通过一个简单的模型或者线性公式进行数学推演,直接得出有参考意义的指标。为了更好地评测和调优系统,以及给出一线运营资源的配置建议,我们设计并实现了 Sim Cloud —— 一个可以精确重建线上系统和环境,引入线上流量或自定义流量,估算系统供需能力曲线、评估调度策略性能的仿真平台

Read More / 继续阅读

Share

Practical Apache Kafka Usage

Kafka

I collect some of Apache Kafka usage in our team and write an internal post in Chinese. And I would like to pull the fundamental part into this post.

Read More / 继续阅读

Share

A 2D Nim Game

2D Nim

Intro

This article is about a Nim game I played in my primary school. The rule are simple:

  • There are 16 stones, arranged in a 4 row * 4 column grid.
  • Each player take stone(s) in turn.
  • Once the stone is taken, there is a gap on it’s original location on the grid.
  • In each take, one should take no more than 3 stones (1/2/3). Only those stones in the same row or in the same column without gap between them could be taken.
  • Player who takes the last stone LOSE

Let me demonstrate it. Assuming 1 means there is stone on the specific cell and 0 represent a gap in the following chart. And those state that would definitely lose are called Losing State.

  • the initial state could be represented as (I)
  • the ending state could be represented as (II)
  • one of the losing state (LS) for current turn player could be represented as (III)
1
2
3
4
5
1111   0000   0000
1111 0000 0000
1111 0000 0010
1111 0000 0000
(I) (II) (III)

To be more specific, the following state is a possible game.

Read More / 继续阅读

Share

Understanding Fstab

Today I encounter a very strange problem that all recent deployed applications in a specific host fail to start, with a simple error message “Permission Denied. xxxx.sh could not be executed”.

Nonsense! They’ve run for a very long time with a Jenkins driven deployment, started by a deploy script. And a binary “could not be executed” might be controlled by user & file access flag. Both checked, using root user & 755 access flag.

Suddenly I remember that the hard-disk on this host have been re-mounted by Ops a few days ago, this operation might corrupt some filesystem runtime context. So I wrote a simple test script a.sh, place it into different mounting point /tmp and /data and try to execute them via ./a.sh (not bash ./a.sh because in this case we are using r way instead of x to access the script). And script could be executed under /tmp but not /data.

Seems we are close to the root cause, but what stop us from executing a binary in different mounting point? The answer is the fstab.

Read More / 继续阅读

Share

2017 Resolution

I drafted this new year resolution on the plane. Looking forwards to a fruitful year!

Read More / 继续阅读

Share

The Data Migration Problem

Migrate the Hotel!
Today I am trying to solve a very interesting problem, I would like to call it the “data migration problem”.

Read More / 继续阅读

Share