local uidKey = KEYS[1] local bindUidKey = KEYS[2] local openID = ARGV[1] local uid = redis.call('HGET', bindUidKey, openID) if uid then return tonumber(uid) else local new_uid = redis.call('INCR', uidKey) redis.call('HSET', bindUidKey, openID, new_uid) return tonumber(new_uid) end