CN106851733A - A kind of adaptive H TTP message compression methods for mobile network's application - Google Patents

A kind of adaptive H TTP message compression methods for mobile network's application Download PDF

Info

Publication number
CN106851733A
CN106851733A CN201611244920.3A CN201611244920A CN106851733A CN 106851733 A CN106851733 A CN 106851733A CN 201611244920 A CN201611244920 A CN 201611244920A CN 106851733 A CN106851733 A CN 106851733A
Authority
CN
China
Prior art keywords
message
compression
compression method
content
mobile network
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
CN201611244920.3A
Other languages
Chinese (zh)
Inventor
唐修富
王雷
陈军
刘培
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Anhui Hengtian New Network Software Co Ltd
Original Assignee
Anhui Hengtian New Network Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Anhui Hengtian New Network Software Co Ltd filed Critical Anhui Hengtian New Network Software Co Ltd
Priority to CN201611244920.3A priority Critical patent/CN106851733A/en
Publication of CN106851733A publication Critical patent/CN106851733A/en
Withdrawn legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W28/00Network traffic management; Network resource management
    • H04W28/02Traffic management, e.g. flow control or congestion control
    • H04W28/06Optimizing the usage of the radio link, e.g. header compression, information sizing, discarding information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/04Protocols for data compression, e.g. ROHC
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M7/00Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
    • H03M7/30Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
    • H03M7/3084Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction using adaptive string matching, e.g. the Lempel-Ziv method
    • H03M7/3086Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction using adaptive string matching, e.g. the Lempel-Ziv method employing a sliding window, e.g. LZ77

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Information Transfer Between Computers (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

The invention discloses a kind of adaptive H TTP message compression methods for mobile network's application, when mobile terminal and service end carry out HTTP message transmission, size to message body waiting for transmission is calculated, the message compression methods of self adaptation are provided, it is of different sizes according to message body, judge to be compressed using different compress modes, the message after compression is sent to message receiver, message receiver passes through decompressing method by message decompression into the message format being actually needed.Self-adapting compressing method provides two schemes, and one kind is preferentially tactful, and one kind is threshold strategies;The inventive method compresses the HTTP message via network transmission in the interaction of front and back end to a certain extent, so as to effectively save the flow consumption of mobile phone terminal.

Description

A kind of adaptive H TTP message compression methods for mobile network's application
Technical field
The invention provides a kind of HTTP message compression method of the self-adapting type for mobile Internet application, it is related to move Dynamic the Internet, applications, http protocol, HTTP compressions, more particularly to a kind of compression method suitable for small text message.
Background technology
With developing rapidly for Intelligent mobile equipment and mobile Internet application, HTTP has almost turned into a kind of general soon Web standards, Web Services, REST, Open API, OAuth etc. are all based on http protocol.It is not only It is the transmission standard of Hyper Text, the transmission (multimedia, XML, JSON) of nearly all data can be using HTTP only Needs just can be quick according to web development process, stabilization, efficiently erects a server.
The content of the invention
It is an object of the invention to be directed to existing mobile Internet product front and back end interacting message mode, there is provided Yi Zhonggen It is of different sizes according to transferring content and take the compression method of different compress modes, in compressing front and back end interaction to a certain extent Via the HTTP message of network transmission, so as to effectively save the flow consumption of mobile phone terminal.
The purpose of the present invention is achieved through the following technical solutions:HTTP message biography is carried out in mobile terminal and service end When passing, the size to message body waiting for transmission is calculated, there is provided the message compression methods of self adaptation, according to message body size not Together, judge to be compressed using different compress modes, the message after compression is sent to message receiver, message receiver passes through Decompressing method is by message decompression into the message format being actually needed.Specifically include following steps:
(1) the HTTP message compression of message sender:Message sender provides two kinds of different compression methods, and the first is Compression method based on LZ77 algorithms and Huffman encoding, second is based on binary-coded compression method.Message is sent out The side of sending carries out message compression by the way of a kind of self adaptation, that is, the one kind automatically selected in above two compression method is disappeared Breath compression, and the Content-Type information in HTTP headers is changed, compressed via which kind of compression method with identifying message, will Message after treatment is sent to message receiver.
(2) the HTTP message decompression of message receiver:After message receiver gets HTTP message, according in header Content-Type, message body is decompressed, recover original message body content, and change HTTP headers Content-Type is origination message form.
Further, the mode of self adaptation selects compression method to be specially in the step (1):Simultaneously using two kinds of compressions , then be compared for the compression result of the two by method compressed message body, chooses that compression effectiveness is good is transmitted, this mode Bandwidth can be more accurately saved, but the computing resource consumption of message sending end can be increased to a certain extent and pressure is increased The time that contracting message is consumed.
Further, the mode of self adaptation selects compression method to be specially in the step (1):Formulate a threshold value, root Which interval different compress modes is used according to message body size.Test by investigation and repeatedly, the first compression side Method to big Text compression effect preferably, it is poor to the Text compression effect less than a certain size or even to no effect;Second compression Method to small text compression effectiveness preferably, it is poor to the Text compression effect more than a certain size or even to no effect.More than being based on Experiment conclusion, original message body size and threshold value are compared, and are then compressed using the first compression method more than threshold value, Then it is compressed using second compression method less than threshold value.The scope of the threshold value is [2kb, 5kb].
Further, the compression method based on LZ77 algorithms and Huffman encoding is specially:Urtext is entered After row LZ77 compression algorithms, then carry out dynamic Huffman encoding compression;The LZ77 compression algorithms are specially:If in text If having two pieces of contents identical, then only it is to be understood that previous piece of position and size, it is possible to determine latter piece of content.And then Latter piece of content is replaced using such a pair of the information of length of distance between the two and identical content, after replacement Content-length can be less than the size for being replaced content, so text is compressed;The Huffman encoding compression is specially:Breathe out Fu Man is encoded to a kind of coded system of variable word length, the value of certain bit length in text is regarded as symbol, such as 8 bit lengths 256 kinds of values, that is, 256 kinds of values of byte regard symbol as.According to the frequency that these symbols occur hereof, to these symbols Number recompile.It is very many for occurrence number, represented with less position, it is considerably less for occurrence number, with more Position represent that after so encoding, some parts digit of text tails off, some parts digit becomes many, due to what is diminished The part part bigger than change is more, and the size of whole text still can reduce, so text is compressed.
Further, it is described to be specially based on binary-coded compression method:Traditional HTTP message serializing mode General to use the forms such as byte stream or character streaming, such as common at present JSON or XML, this serializing mode is will be right A kind of cataloged procedure of character string is organized into the form of key-value pair as attribute, many and weight is increased for description data structure Multiple propertystring and punctuation mark, can increase many from volume than original contents.This also means that byte stream or The serializing mode of character stream has larger compressible space on transferring content.Binary Serialization mode, then directly will be The internal memory mapping of object is extracted and directly forms binary stream, and the category of redundancy under JSON or XML format is eliminated by contrast Property information take transmission space so that HTTP message body size is compressed.
The beneficial effects of the invention are as follows:The present invention is provided a kind of of different sizes according to transferring content and takes different compression sides The compression method of formula, to a certain extent via the HTTP message of network transmission in compression front and back end interaction, so that effectively Save the flow consumption of mobile phone terminal.
Brief description of the drawings
Fig. 1 is the message sending end schematic flow sheet using preferentially tactful self-adapting compressing method of the invention;
Fig. 2 is the message sending end schematic flow sheet of the self-adapting compressing method of use threshold strategies of the invention;
Fig. 3 is the message sink end schematic flow sheet of self-adapting compressing method of the invention.
Specific embodiment
Describe the present invention in detail below in conjunction with the accompanying drawings, the purpose of the present invention and effect will be apparent.
A kind of HTTP message compression method of the self-adapting type that bandwidth is saved for mobile Internet application of the present invention, specifically Implementation method is comprised the following steps:
(1) message sending end carries out the flow of message compression, in actual applications, according to using different self-adapting compressings Strategy and be slightly different.
It is parallelly compressed using two kinds of compress modes, according to the flow under the strategy that compression effectiveness preferentially sends as shown in figure 1, Carry out two kinds of compress modes parallel first to be compressed message body, one kind is based on LZ77 algorithms or variant algorithm and Hough The compression method of graceful coding, can select GZIP compress modes and realizes that GZIP methods are that LZ77 variant algorithms are carried out to urtext After compression, then a kind of method for carrying out dynamic Huffman compression coding;Another kind is to be based on binary-coded compression method, Can be realized using Google Protocol Buffer (hereinafter referred to as GPB) coded formats.Compare two kinds of compression methods Compression result, the smaller result of volume sends after selection compression.
Using the flow of message body size threshold value strategy as shown in Fig. 2 message sending end one blocker of offer, exists first Before message sends, the size of original message body is calculated, in units of binary digit, judge which kind of is used according to message body size Message compression mode.The blocker of message sending end provides two kinds of different compress modes, and one kind is based on LZ77 algorithms or change Body algorithm and the compression method of Huffman encoding, can select GZIP compress modes and realize that GZIP methods are that urtext is entered After row LZ77 variant compression algorithms, then a kind of method for carrying out dynamic Huffman compression coding;Another kind is based on binary system The compression method of coding, can be realized using Google Protocol Buffer (hereinafter referred to as GPB) coded formats.
Using threshold strategies adaptive approach when, it is necessary to formulate a threshold value, as from which kind of compression scheme according to According to.By testing repeatedly, it has been found that GZIP compression methods are poor to the content of text compression effectiveness less than a certain size, GPB is compiled Code method is poor to the Text compression effect more than a certain size.Decision threshold can be set as [2kb, 5kb], preferably 2kb, i.e., The size of message body to be transmitted is more than 2kb, then call GZIP compression methods to be compressed, and message body size to be transmitted is less than 2kb, Then call GPB compression methods that original contents are converted into GPB coded formats.
Using the strategy according to compression effectiveness preferentially, it can be ensured that volume compression is minimized, net is saved with more accurate Network transmits flow, on the other hand then more consumption calculations resource and can increased time used by message compression.Using threshold It is worth the self-adapting compressing method of strategy, rule of thumb which kind of compression method is compression result should can be made most using under prediction maximum probability It is excellent, can be very good to save the time cost and computing resource of compression consumption, more power saving and reduction network delay.In reality In implementation, actual demand can be combined, concrete condition concrete analysis considers and which kind of self-adapting compressing strategy selected.
Message after compression needs to change type of message attribute in header, so that message receiver decision message body is Which kind of compressed via compress mode.The HTTP message that message sending end will be handled well afterwards is sent to message sink end.
(2) message sink end carry out message decompression contracting flow as shown in Fig. 2 message sink end provide a blocker, First, when HTTP message is got, header is parsed, it is different according to message format, different decompression sides are called accordingly Method is decompressed to the message body for receiving:Relative to step (1), the blocker at message sink end provides two kinds of different decompressions Compression method, when message format is judged to that GZIP is encoded, calls GZIP decompression methods that message body is converted into origination message form, And the message format in HTTP headers is changed for origination message form;When message format is judged to that GPB is encoded, GPB is called to solve Message body is converted into origination message form by compression method, and changes the message format in HTTP headers for origination message lattice Formula.HTTP message after conversion is sent to real message sink interface by blocker.
Further, in actual applications, mobile phone terminal needs the two-way message compression that carries out with decompression, i.e. hand with service end Generator terminal application should be as the message sender described in step (1), again as the message receiver described in step (2);Service End is also similarly.So, mobile phone terminal is required for simultaneously equipped with message compression blocker and message decompression contracting blocker with service end.

Claims (6)

1. it is a kind of for mobile network application adaptive H TTP message compression methods, it is characterised in that comprise the following steps:
(1) the HTTP message compression of message sender:Message sender provide two kinds of different compression methods, the first be based on LZ77 algorithms and the compression method of Huffman encoding, second is based on binary-coded compression method.Message sender Message compression is carried out by the way of a kind of self adaptation, that is, the one kind automatically selected in above two compression method carries out message pressure Contracting, and the Content-Type information in HTTP headers is changed, compressed via which kind of compression method with identifying message, will process Message afterwards is sent to message receiver.
(2) the HTTP message decompression of message receiver:After message receiver gets HTTP message, according in header Content-Type, message body is decompressed, recover original message body content, and changes HTTP headers Content-Type is origination message form.
2. it is according to claim 1 it is a kind of for mobile network application adaptive H TTP message compression methods, its feature It is that the mode of self adaptation selects compression method to be specially in the step (1):Two kinds of compression method compressed messages are used simultaneously , then be compared for the compression result of the two by body, chooses that compression effectiveness is good is transmitted.
3. it is according to claim 1 it is a kind of for mobile network application adaptive H TTP message compression methods, its feature It is that the mode of self adaptation selects compression method to be specially in the step (1):A threshold value is formulated, original message body is big It is small to be compared with threshold value, then it is compressed using the first compression method more than threshold value, less than threshold value then using second pressure Compression method is compressed.
4. it is according to claim 3 it is a kind of for mobile network application adaptive H TTP message compression methods, its feature It is that the scope of the threshold value is [2kb, 5kb].
5. it is according to claim 1 it is a kind of for mobile network application adaptive H TTP message compression methods, its feature It is that the compression method based on LZ77 algorithms and Huffman encoding is specially:LZ77 algorithm pressures are carried out to urtext After contracting, then carry out dynamic Huffman encoding compression;The LZ77 compression algorithms are specially:If there is two pieces of content phases in text Together, then only it is to be understood that previous piece of position and size, it is possible to determine latter piece of content.And then using between the two away from From replacing latter piece of content with such a pair of the information of the length of identical content;The Huffman encoding compression is specially:Text Value of certain bit length regards symbol as in this, according to the frequency that these symbols occur hereof, these symbols is recompiled, right It is very many in occurrence number, represented with less position, it is considerably less for occurrence number, represented with more position.
6. it is according to claim 1 it is a kind of for mobile network application adaptive H TTP message compression methods, its feature It is, it is described to be specially based on binary-coded compression method:The internal memory mapping of object is directly extracted into directly formation Binary stream, eliminates the transmission space that the attribute information of redundancy under JSON or XML format takes.
CN201611244920.3A 2016-12-29 2016-12-29 A kind of adaptive H TTP message compression methods for mobile network's application Withdrawn CN106851733A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611244920.3A CN106851733A (en) 2016-12-29 2016-12-29 A kind of adaptive H TTP message compression methods for mobile network's application

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611244920.3A CN106851733A (en) 2016-12-29 2016-12-29 A kind of adaptive H TTP message compression methods for mobile network's application

Publications (1)

Publication Number Publication Date
CN106851733A true CN106851733A (en) 2017-06-13

Family

ID=59113434

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611244920.3A Withdrawn CN106851733A (en) 2016-12-29 2016-12-29 A kind of adaptive H TTP message compression methods for mobile network's application

Country Status (1)

Country Link
CN (1) CN106851733A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108156173A (en) * 2018-01-09 2018-06-12 江苏徐工信息技术股份有限公司 A kind of dynamic lossless compression method of JSON data packets
CN109218214A (en) * 2018-10-31 2019-01-15 中盈优创资讯科技有限公司 Carrier-class universal flow compression method and device
CN110505655A (en) * 2018-09-10 2019-11-26 深圳市文鼎创数据科技有限公司 Data command processing method, storage medium and bluetooth shield
CN111935261A (en) * 2020-07-30 2020-11-13 北京达佳互联信息技术有限公司 Response message processing method and device, electronic equipment and storage medium
CN114679602A (en) * 2022-03-30 2022-06-28 北京达佳互联信息技术有限公司 Data processing method and device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101079889A (en) * 2007-06-26 2007-11-28 中兴通讯股份有限公司 Data transmission system and its transmission method
CN101212471A (en) * 2006-12-31 2008-07-02 中兴通讯股份有限公司 Data synchronization method in SyncML protocol
CN101582067A (en) * 2008-05-15 2009-11-18 国际商业机器公司 Method and system for reducing storage requirements during decompressing compressed file
EP2122935A2 (en) * 2007-03-12 2009-11-25 Citrix Systems, Inc. Systems and methods of providing proxy-based quality of service
CN103166983A (en) * 2011-12-09 2013-06-19 中国移动通信集团广东有限公司 Network data optimizing method, device and network server
CN105339924A (en) * 2013-05-22 2016-02-17 亚马逊科技公司 Efficient data compression and analysis as a service

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101212471A (en) * 2006-12-31 2008-07-02 中兴通讯股份有限公司 Data synchronization method in SyncML protocol
EP2122935A2 (en) * 2007-03-12 2009-11-25 Citrix Systems, Inc. Systems and methods of providing proxy-based quality of service
CN101079889A (en) * 2007-06-26 2007-11-28 中兴通讯股份有限公司 Data transmission system and its transmission method
CN101582067A (en) * 2008-05-15 2009-11-18 国际商业机器公司 Method and system for reducing storage requirements during decompressing compressed file
CN103166983A (en) * 2011-12-09 2013-06-19 中国移动通信集团广东有限公司 Network data optimizing method, device and network server
CN105339924A (en) * 2013-05-22 2016-02-17 亚马逊科技公司 Efficient data compression and analysis as a service

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108156173A (en) * 2018-01-09 2018-06-12 江苏徐工信息技术股份有限公司 A kind of dynamic lossless compression method of JSON data packets
CN110505655A (en) * 2018-09-10 2019-11-26 深圳市文鼎创数据科技有限公司 Data command processing method, storage medium and bluetooth shield
CN109218214A (en) * 2018-10-31 2019-01-15 中盈优创资讯科技有限公司 Carrier-class universal flow compression method and device
CN111935261A (en) * 2020-07-30 2020-11-13 北京达佳互联信息技术有限公司 Response message processing method and device, electronic equipment and storage medium
CN111935261B (en) * 2020-07-30 2023-08-08 北京达佳互联信息技术有限公司 Response message processing method, device, electronic equipment and storage medium
CN114679602A (en) * 2022-03-30 2022-06-28 北京达佳互联信息技术有限公司 Data processing method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN106851733A (en) A kind of adaptive H TTP message compression methods for mobile network's application
US9454552B2 (en) Entropy coding and decoding using polar codes
CN101707616B (en) Method and device for compressing and decompressing user datagram protocol data packet
US7640362B2 (en) Adaptive compression in an edge router
US6963587B2 (en) Communication system and method utilizing request-reply communication patterns for data compression
US9392082B2 (en) Communication interface and method for robust header compression of data flows
CN105052040A (en) System and method for multi-stream compression and decompression
US9866356B2 (en) Data distribution method and device
US7605721B2 (en) Adaptive entropy coding compression output formats
US9294125B2 (en) Leveraging language structure to dynamically compress a short message service (SMS) message
CN102752320B (en) Proxy server active compression method and proxy server
WO2022063058A1 (en) Netconf protocol-based transmission method, device and storage medium
CN112399479A (en) Method, electronic device and storage medium for data transmission
US20060270418A1 (en) State-mediated data signaling used for compression in telecommunication services
CN104767710B (en) The transmission payload extracting method of HTTP block transmissions coding based on DFA
CN101197825B (en) Method, system and device for compression message transmission
WO2023179800A1 (en) Communication receiving method and apparatus thereof
CN107615810B (en) Packet header compression system and method for online network code
Jin et al. Using SigComp to compress SIP/SDP messages
CN104038307A (en) Data stream transmission system and method
CN108737349B (en) Voice data packet processing method and device
WO2002041498A2 (en) Communication system and method utilizing request-reply communication patterns for data compression
CN114900555A (en) Data distribution method and device based on lossless compression algorithm
CN101197823A (en) Method, system and device for decompression information transmission in compression/decompression course
CN110289932B (en) Out-of-order depth value updating method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20170613