简体   繁体   English

设计用于流量压缩的移动Web服务器和客户端

[英]Designing a mobile web server and client for traffic compression

I have been a bit confused on how best to go about this. 我对如何最好地解决这个问题感到有些困惑。

The thing : I'm creating a j2me mobile app that will send compressed data via HTTP to a web server, which then will uncompress the request, fetch the data, compress it and send back to client. 事情 :我正在创建一个j2me移动应用程序,它将通过HTTP将压缩数据发送到Web服务器,然后Web服务器将解压缩请求,获取数据,压缩数据并发送回客户端。

One similar solution to this is: T-Booster 一个类似的解决方案是: T-Booster

The Problem : I'm confused on how to send a compressed http request from the client app, what technology to use for the server and how best to go about implementing it. 问题 :我对如何从客户端应用程序发送压缩的http请求,服务器使用什么技术以及如何最好地实现它感到困惑。 Assuming the server is handing thousands of requests at a time, what will be the effect on the whole application? 假设服务器一次处理数千个请求,对整个应用程序的影响是什么?

Comments are well appreciated. 评论非常感谢。 Thanks. 谢谢。

Approach I: Top Criteria's: Compression, Security and Architectural design freedom 方法I:最重要的标准: 压缩,安全和建筑设计自由

The perceivable best way to achieve data compression is to create custom language that is understandable by the mobile client and its server only. 实现数据压缩的最佳可行方法是创建移动客户端及其服务器可理解的自定义语言。 You can add next level compression to it by using GZIP / LZW or any other compression algorithm. 您可以使用GZIP / LZW或任何其他压缩算法为其添加下一级压缩。

Pros: 优点:

  1. Customize the payload content with minimal headers and send it to the server. 使用最少的标头自定义有效负载内容并将其发送到服务器。
  2. Relatively secured from eaves-droppers, also an extra level of encryption would do no harm but to be considered on need basis. 从屋檐下降器相对安全,额外的加密水平也不会造成伤害,但需要根据需要进行考虑。
  3. Tow levels compression reducing the total payload. 拖曳水平压缩减少总有效载荷。
  4. Does not have any depending on any 3rd party encoder/decoder library, unless you use GZIP / encryption libraries. 除非您使用GZIP /加密库,否则不依赖于任何第三方编码器/解码器库。 Hence its portable across platforms. 因此它可跨平台移植。
  5. As 3rd party libraries are not used, assuming no gzip and no encryption algos, there is no commercial licensing hassles. 由于没有使用第三方库,假设没有gzip且没有加密算法,没有商业许可麻烦。

Cons: 缺点:

  1. Difficult to maintain the custom language, should be supported with architecture, design and javadoc's 难以维护自定义语言,应该支持架构,设计和javadoc
  2. Relatively high time to create payload if used multiple compressors viz. 如果使用多个压缩器,则创建有效负载的时间相对较长。 custom language encoding, GZIP compression and encryption library. 自定义语言编码,GZIP压缩和加密库。

Example: In this link Opera Mini read section on Functionality . 示例:在此链接中, Opera Mini阅读有关功能的部分。

.

Approach II: Top Criteria: Strict project timelines 方法II:最高标准: 严格的项目时间表

For quick disbursement of the project use 3rd party compressors like GZIP and industry standard webservice content exchange formats like SOAP and JSON. 为了快速支付项目,使用第三方压缩器,如GZIP和行业标准的Web服务内容交换格式,如SOAP和JSON。

Pros: 优点:

  1. Quick integration, adherence to standard approach's which make the web-server component easier to develop 快速集成,遵循标准方法,使Web服务器组件更易于开发
  2. No time consume in inventing the wheel, like is said no time consumed in architecturing and developing custom language. 发明轮子没有时间消耗,就像说在构建和开发自定义语言时没有浪费时间。

Cons: 缺点:

  1. The level compression is driven by 3rd party libraries where-in the actual content might not be compressed. 级别压缩由第三方库驱动,其中实际内容可能不会被压缩。 The library would just restructures similar to Shannon / Rate-Distortion theory. 该库只会重构类似于香农/速率 - 失真理论。
  2. The compression works the same in low end / high end device so the heap memory consumption might be blocker on low memory devices. 压缩在低端/高端设备中的工作原理相同,因此堆内存消耗可能会在低内存设备上受阻。
  3. Dependency on 3rd party libraries, you never know when the support is pulled back. 依赖于第三方库,您永远不知道何时撤回支持。
  4. You might get pulled into the vicious circle of commercial licensing when using 3rd party libraries, unless you use open source libraries. 除非使用开源库,否则在使用第三方库时,您可能会陷入商业许可的恶性循环。

Example: http://developers.sun.com/mobility/apis/articles/wsa/ 示例: http //developers.sun.com/mobility/apis/articles/wsa/

.

Edit: Some very useful links 编辑:一些非常有用的链接

  1. Informit InformIT的
  2. DevX DevX
  3. Design Mobile Webservices 设计移动Web服务
  4. Providing web services to mobile users: the architecture design of an m-service portal 为移动用户提供Web服务:移动服务门户的体系结构设计

I am not a J2ME developer but wanted to share my view as a Java developer. 我不是J2ME开发人员,但想分享我作为Java开发人员的观点。 If you are communicating with your webserver then i am guessing that you will be calling a webservice(SOAP or REST). 如果您正在与您的Web服务器通信,那么我猜您将调用Web服务(SOAP或REST)。 I did something similar with webservice for SOAP to compress the communication some time back. 我做了类似于Web服务的SOAP,以便在一段时间后压缩通信。 Here is what i followed. 这是我所遵循的。 http://www.predic8.com/soap-compression-howto.htm http://www.predic8.com/soap-compression-howto.htm

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM