首页 > 技术相关 > 漫谈Google的Native Client技术(一)–历史动力篇(Web本地计算发展史)

漫谈Google的Native Client技术(一)–历史动力篇(Web本地计算发展史)

2011年8月13日 发表评论 阅读评论

昨天在CB上看到一篇文章《最新Chrome Beta支持在浏览器内直接执行C/C++代码》,而实现这功能的最基本的技术就是Google几年前提出的Native Client技术,其实之前我在一个计算所师兄的博客里已经看过一篇介绍Native Client技术的文章,个人当时就感觉这东西挺有前途的,今天无聊,也了解了下,写篇博客总结下,其中不免有拾人牙慧之处。

Web计算本地化(前端技术)历史-HTML->CSS->Javascript

最初的网络上传输的内容是纯文本的,从网络上传输回来直接通过字符界面展示出来就够了,本地几乎不用计算。

后来,为了更直观,更层次化展现网络内容,人们在文本的基础上加上了什么<h1>之类的标签,于是出现了html,这时候,就出现了浏览器,浏览器是把这些标签解释,并且按照一定格式渲染,这时,就需要一定的本地计算来进行标签分析,字体渲染之类的。

再往后,出现了CSS,并且互联网有了富媒体元素,可以把网页展示的漂亮了,要求本地计算更多了。

但是,这还不够,除了将网页做得漂亮外,还需要减少用户的等待时间,提高用户体验。这时,有人发现,其实很多网络通信是可以避免的,比如,在用户登陆界面,用户输出email格式的用户名,之前是需要将这个信息发给服务器,服务器收到信息后,检查是否合法,不合法的话,返回一个页面,叫用户重新填写,这一来一往很花时间,用户体验非常不好。于是有人就想到,能不能把这些检查用户名之类的计算放到本地,于是,就出现了JavaScript,在用户提交信息时,JS可以在本地检查是否合法,不合法的话,提示原因并要求重新输入,这样用户体验就好了,并且减少了服务器计算以及通信(这貌似符合绿色通信的概念)。

再往后,有人发现,每次点击一个链接,在载入下一个页面的时候,出现空白页让用户很不爽,于是,有人想出了一个办法,那就是事实上,很多页面很大一部分是共同的,这部分其实不需要重新加载,只需要加载改变的部分,而这又可以通过JS实现,于是出现了Ajax技术。这个技术减少了空白等待,提高了用户体验,并且减少了网络通信量(有时绿色通信!)。

Web计算本地化进一步发展-Java-applet,Flash,html5

但是,用户在互联网上的需求还是没有得到满足,有人还想直接在网页上处理图片,玩游戏之类的,由于这类应用一方面计算量大,都放到服务器,服务器不堪重负,另一方面,这类应用都是实时生成画面的,假如通过服务器来计算生成画面(如游戏),再通过网络将每帧图像实时传送回来,对网络要求极高,几乎不可能实现。

于是,需要新的技术将更多的计算放到本地,这时候,出现Java applet,flash等。Java applet允许在网页中嵌入java程序,并在本地执行。Flash应该也是类似,只不过这些计算需要通过flash提供的api完成(这一点有点类似ActiveX通过COM来完成本地计算?)。

Flash的出现,一段时间内,几乎是一统互联网的视频播放以及网页游戏领域。这时,有人眼红也好,有人有更好的主意也好,结果就是有人抱怨flash不开放(还有不安全),有人就想到,我们做一个开放的标准,这标准里面就允许类似游戏等复杂的交互,于是出现了HTML5和CSS3。HTML5以及CSS3将很多JS以及Flash能完成的功能都已到了一个HTML标签里,其实,本质还是差不多,只是这时候这些渲染的计算不是通过flash程序来了,而是直接通过浏览器执行了。

云计算时代的本地计算-Native Client

再往后,随着网络带宽的增长,以及服务器存储能力的提高,出现了大量的数据中心,为了提高这些中心的利用率,出现了云计算。在云计算时代,用户可以把很多数据都放在云端,并且访问这些应用的方法都是统一的。开发者在云服务器开发程序的接口也是统一的(PaSS),这就可以很容易实现跨平台,给用户一个统一的体验。

在这个时代,由于访问云端的资源都是通过浏览器完成的,浏览器就成为一个很重要的平台,这也就是为什么Google会推出自己的浏览器以及ChromeOS的原因。在浏览器能做的事也越来越多,如玩游戏,但是,由于这些游戏是通过一个类似flash这样的东西执行的,效率很低,为了提高效率,并且进一步的将更多的计算密集的东西(如3D渲染)放到本地完成,Google提出Native Client技术,这种技术就是想直接在本地执行C/C++/Java/Python等代码,从而提高本地计算的效率。

从这里,也可以看出Google的野心,Google希望以后用户所有的需求都能在浏览器上完成,包括大型3D游戏,到时候,什么Windows,Linux,都是透明的了,只剩下一个Chrome Broswer,成为开发者的事实平台,得开发者得天下,Google就此一统江山,虽然不能千秋万代,但也能够衣食无忧上十年。

Web计算本地化的问题-安全性

由于web计算本地化是在本地执行服务器上下下来的代码,因此,服务器上要是发给用户的恶意代码,在本地执行的话,会出现严重的后果,因此,这些技术(包括JS,Java applet,Flash)的安全性非常重要。由于Flash应用最多,因此,Flash也被经常爆漏洞。

而对于Native Client技术,如何保证安全则是更大的挑战,为了保证安全,感觉这技术最好用于计算密集型应用,而尽量不让远程代码执行文件读写操作。为了保证文件读写的安全性,个人觉得有两个办法,一个是不读写本地文件,将文件直接写到云端的云存储(但是计算还是本地);另外一个就是在本地沙盒里面读写,不过这只适合临时数据,永久的还是要写到云端。

最后,附一张图,这张图反映了个人计算机应用平台的进化方向:



本文作者: Sigma    在新浪微博关注SigmaSigmaWeibo    RSS订阅本博客
本文链接: http://www.sigma.me/2011/08/13/about-google-native-client-history.html
本博客采用知识共享署名—非商业性-禁止演绎使用3.0协议进行许可,转载请保留作者和原文链接。

  1. 2011年8月13日17:43 | #1

    @sigma

    对了对了,有没有国内的proxy或者VPN? 有的话我就可以调试了

  2. 2011年8月13日17:54 | #2

    @Rex

    科大VPN账号?我有个,别人给的,不知道能不能用,我通过邮件发给你吧

  3. 2011年8月15日01:26 | #3

    @Rex

    你怎么搞定的,我这边也好了

  4. 2011年8月13日16:33 | #4

    可否有任何思路?

  5. 2011年8月13日17:28 | #5

    @Rex

    真的好诡异。。。真可能是墙的原因。。。

  6. 2011年8月13日17:39 | #6

    @Rex

    谢谢,看了下,貌似是国内又一家做SOC的,不过没看到他们用的是何种指令集,并且也没有任何产品文档

    其实国内貌似有个新岸线的,很有钱(据说广东省给了巨多钱),在ARM SOC领域,做的很不错

  7. 2011年8月14日18:10 | #7

    @Rex

    没问题~~

  8. 2011年8月16日12:08 | #8

    我把你的字体借过去了啊~原来的字体看不惯,你这个博客字体很好看。

  9. 2011年8月13日16:32 | #9

    问一下,问毛我的网站在我这里一切正常,到了祖国大陆那个验证码就是死活填不对呢?我把验证码都去掉了,竟然还有祖国大陆的同胞跟我说提示验证码错误——可我这里是一切正常啊……

  10. 2011年8月14日16:26 | #10

    @Rex

    你那验证码真把我搞崩溃了。。。前两天填了十几次就是填不对,后来只好放弃留言了。。。

  11. 2011年8月13日17:08 | #11

    @Rex

    是不是和你使用了Cloudflare有关,很多东西cloudflare缓存了,清空Cloudflare缓存试试

    我之前刚把数字验证码换成图片的也出现了这个情况,后来貌似就好了

    再不行的话,把Micolog的memcache功能暂时关闭,也有可能是这个东西的原因

    实在不行换成原来默认的验证码,过滤垃圾评论可以用Akismet

  12. 2011年8月13日17:26 | #12

    @Rex

    嗯,刚发现翻墙后看到的源码也是一样的

  13. 2011年8月13日17:32 | #13

    对了,看下这个网站,感觉你会感兴趣

    http://icubecorp.com/

  14. 2011年8月18日04:34 | #14

    @Rex

    呵呵,我也发现很多英文主题改过来的中文字体比较难看~所以才改了默认字体

  15. 2011年8月13日17:14 | #15

    @Rex

    我在我这里看了下你的源码,很奇怪还有这么一段,感觉貌似还是有一个验证码的代码,不知道是不是缓存的原因(但奇怪的是没见到验证码输入框)

    验证码 (点击显示或更新):

  16. 2011年8月13日17:24 | #16

    @sigma

    js是都会有的,但是会检查验证码的类型。0是无验证码。

  17. 2011年8月13日17:17 | #17

    @sigma

    你在你那里试的时候也会出错吗?另外我已经把我能清空的都清了,包括cloudflare的

  18. 2011年8月13日17:25 | #18

    @Rex

    我翻墙后却可以留言。。。

  19. 2011年8月13日17:26 | #19

    @sigma

    也就是说还是和墙有关的原因了……我要不再等一两天看看吧……

  20. 2011年8月13日17:41 | #20

    @Rex

    最搞的是,旁边的新闻链接竟然是老杳吧的。。。

  21. 2011年8月14日18:04 | #21

    @grapeot

    现在还有问题没?

  22. 2011年8月14日18:05 | #22

    @sigma

    我用VPN回墙内后还是没问题……sigh

  23. 2019年1月14日17:12 | #23

    I must point out my appreciation for your generosity giving support to men and women who actually need assistance with this important area. Your personal dedication to getting the solution all over appears to be extraordinarily significant and have constantly permitted somebody much like me to arrive at their objectives. The important publication implies a great deal to me and far more to my mates. Regards; from all of us.

  24. 2019年1月15日03:49 | #24

    Thanks a lot for giving everyone an exceptionally marvellous chance to discover important secrets from this website. It is usually very cool and packed with fun for me personally and my office friends to visit your web site more than thrice every week to see the new things you have. And lastly, we are usually motivated considering the impressive inspiring ideas served by you. Certain 1 tips on this page are indeed the most effective we have ever had.

  25. 2019年1月15日11:31 | #25

    I have to show my appreciation to this writer just for rescuing me from this trouble. Right after looking through the world wide web and finding thoughts which are not pleasant, I figured my life was over. Living devoid of the answers to the difficulties you have fixed all through this write-up is a serious case, as well as the ones which may have adversely affected my entire career if I had not discovered your web page. Your expertise and kindness in taking care of every item was useful. I am not sure what I would’ve done if I had not encountered such a step like this. I am able to now look ahead to my future. Thanks very much for the high quality and results-oriented guide. I won’t be reluctant to refer your site to anybody who desires guidance on this topic.

  26. 2019年1月15日21:06 | #26

    Thanks for each of your labor on this blog. Ellie delights in engaging in research and it is simple to grasp why. We all know all about the lively tactic you give insightful tricks via the web site and as well as increase contribution from some other people on the matter then our child is in fact learning a lot. Have fun with the remaining portion of the new year. You’re the one carrying out a wonderful job.

  27. 2019年1月16日05:38 | #27

    I am commenting to make you understand what a outstanding discovery my friend’s daughter obtained going through your site. She even learned a good number of things, which include how it is like to possess an awesome giving character to get many people quite simply understand chosen complex issues. You undoubtedly did more than people’s expectations. Many thanks for providing the helpful, safe, explanatory and as well as unique tips on the topic to Ethel.

  28. 2019年1月16日13:37 | #28

    Needed to draft you one tiny word to be able to say thanks a lot the moment again just for the splendid guidelines you’ve provided in this case. This is certainly shockingly open-handed of people like you to convey freely what exactly some people could possibly have distributed as an electronic book to get some money for their own end, particularly since you could have done it if you desired. These guidelines in addition worked like a fantastic way to comprehend someone else have a similar eagerness much like my very own to understand great deal more in respect of this problem. I know there are several more pleasant occasions ahead for individuals that looked over your site.

  29. 2019年1月17日00:32 | #29

    I simply wished to appreciate you once again. I’m not certain what I could possibly have worked on in the absence of the actual points shown by you about this industry. This has been a very terrifying issue for me, nevertheless encountering your well-written style you solved the issue took me to weep over contentment. I’m just happier for this advice and believe you realize what a great job you are always providing training the rest all through your blog. I am certain you’ve never met any of us.

  30. 2019年1月17日05:42 | #30

    Thanks so much for giving everyone a very spectacular possiblity to read from this site. It is often so ideal and as well , jam-packed with a lot of fun for me personally and my office peers to visit your site not less than three times per week to see the fresh things you have got. And definitely, I’m usually impressed with your mind-blowing guidelines served by you. Some 3 facts in this posting are certainly the best I have ever had.

  31. 2019年1月17日08:30 | #31

    I and my guys happened to be checking the best key points found on your web site and so all of the sudden developed a horrible suspicion I had not expressed respect to the web site owner for them. These guys had been absolutely thrilled to learn all of them and now have actually been taking pleasure in them. Appreciation for indeed being really accommodating as well as for making a choice on varieties of good tips most people are really wanting to discover. My very own sincere regret for not expressing gratitude to sooner.

  32. 2019年1月17日17:04 | #32

    I precisely desired to thank you very much again. I do not know what I would have handled without the actual basics discussed by you over my subject matter. It was actually a horrifying difficulty in my position, nevertheless noticing this well-written manner you processed that forced me to leap for fulfillment. Extremely grateful for this information and as well , hope you comprehend what a powerful job you were carrying out educating people today through a web site. I am sure you’ve never come across any of us.

  33. 2019年1月18日03:15 | #33

    I together with my buddies came analyzing the excellent pointers found on your web blog then before long came up with an awful suspicion I had not expressed respect to the website owner for those strategies. Those guys had been absolutely warmed to see all of them and have in effect absolutely been making the most of these things. Many thanks for really being considerably accommodating as well as for figuring out this form of extraordinary subjects millions of individuals are really wanting to discover. Our own honest apologies for not expressing gratitude to you earlier.

  34. 2019年1月18日10:16 | #34

    I wish to convey my affection for your kind-heartedness in support of persons who must have assistance with your issue. Your personal commitment to passing the message across ended up being really practical and have always encouraged many people just like me to reach their ambitions. Your personal invaluable guideline means much to me and much more to my mates. Regards; from all of us.

  35. 2019年1月19日03:38 | #35

    I enjoy you because of your entire efforts on this website. Debby take interest in making time for investigation and it’s easy to understand why. Almost all learn all regarding the powerful tactic you provide sensible thoughts by means of this website and in addition strongly encourage participation from people on the idea then my girl is without question becoming educated a lot of things. Enjoy the remaining portion of the new year. You are carrying out a stunning job.

  36. 2019年1月19日10:19 | #36

    I wish to express appreciation to you just for bailing me out of this challenge. Because of scouting through the the web and seeing tips which are not helpful, I figured my life was well over. Existing without the approaches to the problems you’ve sorted out by way of your entire report is a crucial case, and those which may have badly damaged my career if I hadn’t come across your web page. Your actual natural talent and kindness in touching everything was vital. I am not sure what I would’ve done if I hadn’t come upon such a stuff like this. It’s possible to at this moment look ahead to my future. Thanks for your time so much for your specialized and results-oriented help. I won’t be reluctant to suggest your web site to any person who ought to have support on this situation.

  37. 2019年1月19日19:06 | #37

    A lot of thanks for all of your effort on this website. Gloria really loves making time for internet research and it’s easy to understand why. My partner and i know all relating to the lively mode you convey insightful guidelines on your web blog and even increase response from other people on this article so our princess is always becoming educated so much. Take pleasure in the remaining portion of the new year. Your performing a fantastic job.

  38. 2019年1月20日01:01 | #38

    I definitely wanted to write a brief message to be able to express gratitude to you for all the remarkable ideas you are giving at this site. My long internet investigation has at the end been recognized with pleasant details to exchange with my partners. I would state that that many of us readers actually are extremely lucky to dwell in a superb site with so many brilliant individuals with valuable hints. I feel quite fortunate to have seen your web pages and look forward to many more excellent times reading here. Thank you again for all the details.

  39. 2019年1月20日04:19 | #39

    Thank you for all of the labor on this website. My mom loves getting into investigations and it’s obvious why. My partner and i know all concerning the dynamic medium you give reliable information via your website and as well as improve participation from other people about this subject while our simple princess is always becoming educated a lot. Have fun with the remaining portion of the year. You have been performing a brilliant job.

  40. 2019年1月20日11:25 | #40

    I simply wanted to thank you very much yet again. I’m not certain the things I could possibly have worked on in the absence of the creative ideas discussed by you regarding my concern. It became a alarming matter for me personally, nevertheless viewing a new well-written avenue you managed the issue took me to leap for happiness. Now i’m happy for this service and sincerely hope you recognize what a powerful job you have been undertaking educating the rest through your websites. I am certain you’ve never got to know all of us.

  41. 2019年1月20日20:53 | #41

    Thanks so much for giving everyone a very remarkable chance to check tips from this blog. It’s usually very brilliant and as well , full of amusement for me personally and my office acquaintances to search the blog at least 3 times in 7 days to study the newest stuff you will have. And indeed, I’m also certainly astounded with the magnificent knowledge you serve. Selected two ideas in this post are completely the most suitable we’ve had.

  42. 2019年1月21日05:09 | #42

    I precisely desired to thank you very much once again. I am not sure the things that I would have followed in the absence of the entire aspects contributed by you on my field. It truly was an absolute intimidating concern in my position, nevertheless taking a look at this specialized technique you managed it took me to cry over joy. Extremely thankful for this assistance as well as have high hopes you find out what a great job you’re putting in educating most people via a web site. Most probably you haven’t met any of us.

  43. 2019年1月21日11:51 | #43

    Thank you so much for providing individuals with an exceptionally wonderful possiblity to check tips from this web site. It is usually very enjoyable and stuffed with fun for me and my office co-workers to visit your blog nearly thrice in 7 days to find out the new stuff you will have. And lastly, we are usually impressed for the outstanding information you serve. Some 3 ideas in this article are unquestionably the best we’ve ever had.

  44. 2019年1月21日20:15 | #44

    I would like to voice my admiration for your generosity in support of women who actually need guidance on that concern. Your personal commitment to passing the message all over had been exceptionally advantageous and have continuously enabled those like me to achieve their targets. Your own invaluable help and advice can mean so much to me and still more to my office workers. Many thanks; from each one of us.

  45. 2019年1月22日05:51 | #45

    I and my pals were found to be digesting the nice advice from your website while then I got a terrible feeling I never thanked the website owner for those secrets. My young men had been certainly passionate to read through them and already have honestly been enjoying them. Thanks for really being simply considerate as well as for picking this form of brilliant things most people are really desirous to be aware of. My very own sincere regret for not expressing gratitude to you sooner.

  46. 2019年1月22日13:59 | #46

    Thank you for each of your efforts on this site. Betty take interest in going through research and it’s really easy to see why. We all learn all relating to the powerful way you convey practical information by means of this website and therefore invigorate participation from others on this area of interest so our own child is now starting to learn a great deal. Have fun with the rest of the new year. You’re doing a useful job.

  47. 2019年1月22日22:43 | #47

    I intended to draft you a little bit of remark to help say thanks the moment again relating to the remarkable tips you have provided on this site. It is so unbelievably open-handed with people like you to convey without restraint all a lot of folks might have supplied as an e-book to end up making some money for their own end, principally considering the fact that you could possibly have tried it if you ever considered necessary. Those concepts likewise worked to be a easy way to understand that most people have a similar desire similar to my very own to grasp much more when it comes to this condition. I know there are a lot more enjoyable times up front for folks who read your blog post.

  48. 2019年1月23日00:07 | #48

    Thanks for each of your efforts on this blog. My mom really likes doing research and it is easy to understand why. I learn all concerning the dynamic way you give vital information via this web site and in addition strongly encourage response from visitors about this concept while our favorite princess is certainly studying a great deal. Enjoy the remaining portion of the year. Your carrying out a fabulous job.

  1. 本文目前尚无任何 trackbacks 和 pingbacks.

无觅相关文章插件,快速提升流量