弹幕系统相关研究结题报告

zsx in 记录整理 / 2 / 7330

分两次发只是为了不让六月没有文章发布=_=明年这时候差不多要去高考了呢。能考到什么地方去呢……?谁知道。

靠天靠地,不如靠自己。说起来,别人做得到的事情,为什么我就不可以呢?希望最后的结果能让自己满意。

流程改进

1.         接入第三方身份系统验证(新浪微博)

2.         加入弹幕长度验证

3.         加入自动封号机制


流程图


问题集锦

一、技术问题

1.         (已解决)架构问题

把定时器部分转给子进程操作以期主进程能提高其其他部分的CPU使用率,但可惜通信的性能损耗要远远大于定时器部分。反之,如果定时器执行的指令复杂度比较高,比我原来几乎1ms就做完的任务耗时得多,很容易堵塞主进程的话,才有用多进程来实现的价值。后调整为单进程单线程完成所有内容。相关部分已整理文章(https://blog.zsxsoft.com/post/10 )。

2.         (已解决)用户跟踪

匿名用户身份追踪部分已整理文章(https://blog.zsxsoft.com/post/11) 。

现采用新浪微博验证作为真实、有意义的身份追踪。

3.         (已解决)负载测试

发送弹幕接口采用HTTP POST,所以可直接用 ab进行测试。下附测试报告。由于一般连接的客户端少,所以没有很大的必要来测试其极限的连接数。

4.         (已解决)窗口透明

已整理文章,并发布开源库(https://blog.zsxsoft.com/post/8) 。

5.         Linux下不能打开GPU加速

不重要,基本没人用Linux当客户端。

6.         环境稳定性问题

程序健壮性不足,同时作为daemon的pm2的稳定性堪忧。另外阿里云服务器的宕机问题也值得注意。

7.         测试问题

暂未掌握针对这类项目的测试方法,有待进一步学习。

 

二、运营问题

1.         弹幕素质问题

人性问题难以用技术问题来直接解决。必须多角度综合处理。

2.         互动问题

有了这么一套机制,却难以被有效地利用,仅仅是用于吐槽,过于大材小用。需要策划者在运营活动的同时对该项目予以考量,思考互动形式。

    


性能测试


环境

网络

配置及备注

QPS

中期报告环境2(Linux)

node v0.12.1

阿里云杭州D,一个福州联通客户端连接

开启新浪微博和自动封禁

225.38




241.58



关闭以上功能461.97



431.51

iojs 1.8.2


开启新浪微博和自动封禁

444.42



536.25



关闭以上功能633.99



865.28




研究结果

一、主程序

项目danmu-server: https://github.com/zsxsoft/danmu-server

项目danmu-client: https://github.com/zsxsoft/danmu-client

二、衍生库

nw-penerate:   https://www.npmjs.com/package/nw-penetrate

三、博客文章

《关于浏览器身份追踪技术的研究与整理》https://blog.zsxsoft.com/post/11

《NodeJS多进程通信的相关笔记》https://blog.zsxsoft.com/post/10

《nwjs实现鼠标穿透》https://blog.zsxsoft.com/post/8

四、活动结果

宿舍文化节:弹幕开启时间约20分钟,到场人数约1200人,共有569人发送弹幕,筛选掉被拦截(如表白、色情词汇、脏话)弹幕,共得到4457条弹幕。由于弹幕素质问题,导致了一些意想不到的后果。

 

社巡:弹幕开启时间约15分钟,到场人数约500人,有223人发送弹幕,共得到2382条弹幕。自动封号20人。社巡时通过新浪微博登录有效提升了弹幕质量,大大加强了活动气氛。适时的弹幕使得在场内观看的同学流失率相比其他地方较低。事后其他同学将其转发到微博,也引起了已毕业同学及校外人士等的共鸣。(http://weibo.com/3115658185/Cgtldsu0x)八中官网地址(http://www.fzbz.com.cn/ArticleDetail.aspx?ArtID=3213&ColID=130

  


活动意义

个人技术角度:

1.           仔细研读了NodeJS部分源码,充分了解实现的细节。

2.           使用AngularJS等前端MVC框架,初步了解其设计思想。

3.           通过实际项目的实践,深化了对设计模式的理解。

4.           加深异步模型编程印象,更加明白各处应使用的解决方案。

5.           重新认识到Node的局限性及适用范围。

6.           加深对TCP网络协议及WebSocket协议的理解。

 

个人人文角度:

1.           充分认识到技术并不是解决一切问题的唯一手段,它必须与其它手段配合才可以解决问题。

2.           不同的技术有其不同的适用范围,不可囫囵使用。应用技术的前提是该技术在应用中存在意义,为了使用技术而使用技术是不可取的。

3.           任何事物必须提早准备,临时上阵是大忌。

 

他人角度:

1.           通过发现第三方库的BUG,为其添砖加瓦。

2.           为开源世界贡献了几个微不足道的库和项目。

   



参考资料   

1.           Node.JS   Documentation

https://nodejs.org/

2.           Canvas   fingerprinting

http://www.wikiwand.com/en/Canvas_fingerprinting

3.           Anonymous   Browser Fingerprinting  - valve's

http://valve.github.io/blog/2013/07/14/anonymous-browser-fingerprinting/

4.           AngularJS:   API: $http

https://docs.angularjs.org/ng/service/$http

5.           Angular   directives for Bootstrap

https://angular-ui.github.io/bootstrap/

6.           Components   – Bootstrap

http://getbootstrap.com/components/

7.           FindWindow   function (Windows)

https://msdn.microsoft.com/en-us/library/windows/desktop/ms633499(v=vs.85).aspx

8.           SetWindowLong   function (Windows)

https://msdn.microsoft.com/en-us/library/windows/desktop/ms633591(v=vs.85).aspx

9.           Build   native modules with nw gyp · nwjs/nw.js Wiki

https://github.com/nwjs/nw.js/wiki/Build-native-modules-with-nw-gyp

10.     Express 4.x - API Reference

http://expressjs.com/4x/api.html#router

11.     Using CSS animations - Web developer   guide | MDN

https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Using_CSS_animations

12.     Passport    | Configure

http://passportjs.org/guide/configure/

13.     Goodbye node-forever, hello PM2

http://devo.ps/blog/goodbye-node-forever-hello-pm2/

14.     NW.js with a custom executable name and   native modules

http://developers.ironsrc.com/rename-import-dll/

15.       Configuring   tasks - Grunt: The JavaScript Task Runner

http://gruntjs.com/configuring-tasks#building-the-files-object-dynamically

16.       ab -   Apache HTTP server benchmarking tool - Apache HTTP Server Version 2.2

https://httpd.apache.org/docs/2.2/programs/ab.html

17.     产品文档-阿里云

http://docs.aliyun.com/#/ocs/Introduction/Introduction-of-OCS

  



参考资源

   

1.           DDPlayer(弹幕播放器)
  https://github.com/dpy1123/ddplayer/

2.           Socket.io (Realtime   application framework (Node.JS server) )
  https://github.com/Automattic/socket.io

3.           Async (Async utilities for   node and the browser)
  https://github.com/caolan/async

4.           V8-profiler (node bindings   for the v8 profiler)
  https://github.com/node-inspector/v8-profiler

5.           Nw.js (Call all Node.js   modules directly from DOM and enable a new way of writing applications with   all Web technologies.)
  https://github.com/nwjs/nw.js

6.           Express (Fast, unopinionated,   minimalist web framework for node)
  https://github.com/strongloop/express

7.           Ejs (Embedded JavaScript   templates for node)
  https://github.com/tj/ejs

8.           Node-mysql (A pure   node.js JavaScript Client implementing the MySql protocol.)
  https://github.com/felixge/node-mysql

9.           Bootstrap (Native AngularJS   (Angular) directives for Bootstrap.)
  https://github.com/angular-ui/bootstrap

10.       Angular (HTML enhanced   for web apps)
  https://github.com/angular/angular.js

11.       passport-sina (sina weibo   strategy for passport)
  https://github.com/kfll/passport-sina

12.       passport (Simple,   unobtrusive authentication for Node.js)
  https://github.com/jaredhanson/passport

13.       pm2 (Production process   manager for Node.js / io.js applications. Perfectly fitted for microservices   architecture.)

https://github.com/Unitech/pm2

14.       node-memcached(A fully   featured Memcached client build on top of Node.js. Build with scaling in mind   so it will support Memcached clusters and consistent hashing.)

https://github.com/3rd-Eden/node-memcached

15.       rename-import-dll

https://github.com/ironSource/rename-import-dll

16.       node-webkit-builder(Create a   node-webkit builds)

https://github.com/mllrsohn/node-webkit-builder 

 

   



如果本文对你有帮助,你可以用支付宝支持一下:

Alipay QrCode
评论者 at 2015/12/6[回复]
一个高一学生膜拜、[给力]表示自己什么都不会
评论者 at 2015/7/26[回复]
比我高二的时候厉害太多了 膜拜