CN108092956A - A kind of method and apparatus for obtaining compression dictionary - Google Patents
A kind of method and apparatus for obtaining compression dictionary Download PDFInfo
- Publication number
- CN108092956A CN108092956A CN201711249958.4A CN201711249958A CN108092956A CN 108092956 A CN108092956 A CN 108092956A CN 201711249958 A CN201711249958 A CN 201711249958A CN 108092956 A CN108092956 A CN 108092956A
- Authority
- CN
- China
- Prior art keywords
- unpressed
- compression dictionary
- user data
- targeted compression
- client
- 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.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/04—Protocols for data compression, e.g. ROHC
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03M—CODING; DECODING; CODE CONVERSION IN GENERAL
- H03M7/00—Conversion 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/30—Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Theoretical Computer Science (AREA)
- Information Transfer Between Computers (AREA)
- Computer And Data Communications (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Abstract
An embodiment of the present invention provides a kind of method and apparatus for obtaining compression dictionary, and the method for obtaining compression dictionary, applied to client, method includes:It sends datagram to server end, the request that the data message includes unpressed user data targeted compression dictionary corresponding with for asking the unpressed user data identifies;Obtain the targeted compression dictionary that the server end is sent, the targeted compression dictionary to be used to be compressed processing to unpressed user data, the targeted compression dictionary is that the server receives the data message that client is sent, judge the request mark whether is carried in the data message, if it is, establish the targeted compression dictionary and sent to the client.It can realize that client obtains compression dictionary from server end using the embodiment of the present invention.
Description
Technical field
The present invention relates to technical field of data compression, more particularly to a kind of method and apparatus for obtaining compression dictionary.
Background technology
In order to provide a user better service, Internet company needs by gathering substantial amounts of user data to understand use
The use habit and preference at family.Since the data volume of user data is larger, compression dictionary can be used by client to number of users
According to being uploaded to server end again after being compressed.In practical applications, user data is usually with key-value pair (key:Value shape)
Formula stores, in addition, compression dictionary includes the correspondence of value value and sequence number.
Since the resource data amount of client is big and is constantly updating, in order to ensure compression efficiency, it is necessary in client and
Server end increases new compression dictionary in time.At present, can visitor be made by the software version of updating client and server end
Family end and server end get new compression dictionary.But upgrade in time software version due to being unable to control client, it may
It is present with that the software version of server end is promoted, but the situation that the software version of client not yet upgrades.At this point, server
End has got new compression dictionary, and new compression dictionary has not been obtained in client, in such a scenario, server end and visitor
The detailed process of transmission data between the end of family is:
First, client is judged in the existing compression dictionary of client, if there are user data correspondences to be uploaded
Compression dictionary, specifically, bag can be determined whether there is in existing compression dictionary according to the value in user data
Include the compression dictionary of the value;If it is, being compressed processing to user data using the compression dictionary, generation is compressed
User data;If it has not, upload unpressed user data to server end.
Next, the user data that received server-side client is sent, judges whether the user's data have been compressed;If
It is that decompression processing, the user data after being decompressed are carried out to the user's data using the user's data corresponding compression dictionary;
If it has not, directly acquire unpressed user data.
As it can be seen that when client lacks compression dictionary, processing can not be compressed to the user data of part, still, to
Server end uploads unpressed user data, can occupy substantial amounts of floating resources and bandwidth resources.
The content of the invention
The embodiment of the present invention be designed to provide it is a kind of obtain compression dictionary method and apparatus, with realize client from
Server end obtains compression dictionary.Specific technical solution is as follows:
An embodiment of the present invention provides a kind of method for obtaining compression dictionary, applied to client, the described method includes:
It sends datagram to server end, the data message is described including unpressed user data and for asking
The request mark of the corresponding targeted compression dictionary of unpressed user data;
The targeted compression dictionary that the server end is sent is obtained, to use the targeted compression dictionary to uncompressed
User data be compressed processing, the targeted compression dictionary is that the server receives the data message that client is sent,
Judge whether to carry the request mark in the data message, if it is, establishing the targeted compression dictionary and to the visitor
What family end was sent.
Optionally, before described the step of sending datagram to server end, the method further includes:
Judge in the existing compression dictionary of the client, if there are the corresponding mesh of the unpressed user data
Mark compression dictionary;
If it has not, it is used to ask the corresponding target of the unpressed user data described in adding in the data message
Compress the request mark of dictionary.
Optionally, the storage format of the unpressed user data is key-value pair key:value;
It is used to ask the corresponding targeted compression word of the unpressed user data described in adding in the data message
Before the step of request mark of allusion quotation, the method further includes:
Determine the correspondence of the target key and default identifier in the unpressed user data;
The correspondence of the target key and the identifier are determined as the request to identify.
Optionally, described it is used to that the unpressed user data be asked to correspond to described in addition in the data message
Targeted compression dictionary request mark the step of before, the method further includes:
Judge the number and the unpressed user that the unpressed user data occurs in preset time period
Whether the byte length of data is no to meet preset condition;
If it has, then performing, the addition in the data message is described to be used to ask the unpressed user data
The step of request mark of corresponding targeted compression dictionary.
Optionally, it is described to judge number that the unpressed user data occurs in preset time period and described
The byte length of unpressed user data whether no the step of meeting preset condition, including:
Judge number that the unpressed user data occurs in preset time period, with the unpressed number of users
According to byte length product whether be more than predetermined threshold value;
It is described if it has, then perform it is described added in the data message it is described for asking the unpressed user
The step of request mark of the corresponding targeted compression dictionary of data, including:
If the product is more than the predetermined threshold value, the unpressed user data meets the preset condition, holds
The row addition in the data message is described to be used to ask the corresponding targeted compression dictionary of the unpressed user data
Request mark the step of.
Optionally, the storage format of the unpressed user data is key:Value, the compression dictionary include
The correspondence of value and default sequence number;
Described the step of obtaining the targeted compression dictionary that the server end is sent, including:
Receive the target key in the unpressed user data that the server end is sent and the targeted compression word
The correspondence of target sequence number in allusion quotation, the target sequence number are corresponding in the targeted compression dictionary for target value
Default sequence number, the target value be the target key corresponding value in the unpressed user data;
It is raw according to the correspondence and the unpressed user data of the target key and the target sequence number
Into the targeted compression dictionary.
The embodiment of the present invention additionally provides a kind of method for obtaining compression dictionary, applied to server end, the method bag
It includes:
The data message that client is sent is received, the data message includes unpressed user data and for asking
State the request mark of the corresponding targeted compression dictionary of unpressed user data;
Establish the targeted compression dictionary;
The targeted compression dictionary is sent to the client, so that the client obtains the targeted compression dictionary,
Processing is compressed to unpressed user data using the targeted compression dictionary.
Optionally, the data message for receiving client and sending, the data message include unpressed user data
The step of request mark of targeted compression dictionary corresponding with for asking the unpressed user data, including:
The data message that the client is sent is received, the data message includes unpressed user data;
Before described the step of establishing the targeted compression dictionary, the method further includes:
Judge whether carry to ask the corresponding targeted compression of the unpressed user data in the data message
The request mark of dictionary;
If it is, perform described the step of establishing the targeted compression dictionary.
Optionally, the unpressed user data includes keyword key;
The request mark includes default identifier pass corresponding with the target key in the unpressed user data
System;
It is described to judge whether carry to ask the corresponding target of the unpressed user data in the data message
The step of compressing the request mark of dictionary, including:
Judge whether include the identifier in the data message;
It is described if it is, perform described the step of establishing the targeted compression dictionary, including:
If the data message includes the identifier, determine to carry in the data message to ask described not press
The request mark of the corresponding targeted compression dictionary of user data of contracting, performs described the step of establishing the targeted compression dictionary.
Optionally, before described the step of establishing the targeted compression dictionary, the method further includes:
Judge whether include the targeted compression dictionary in the compression dictionary preserved in the server end;
If it is, the targeted compression dictionary is determined from the compression dictionary preserved;
If it has not, perform described the step of establishing the targeted compression dictionary.
Optionally, the storage format of the unpressed user data is key:value;The compression dictionary includes
The correspondence of value and default sequence number;
Before described the step of sending the targeted compression dictionary to the client, the method further includes:
Establish the target key in the unpressed user data and the target sequence number in the targeted compression dictionary
Correspondence, the target sequence number is target value corresponding default sequence numbers in the targeted compression dictionary, described
Target value is the target key corresponding value in the unpressed user data;
The step of transmission targeted compression dictionary to the client, including:
The correspondence of the target key and the target sequence number are sent to the client, so that the client
The mesh is obtained according to the correspondence and the unpressed user data of the target key and the target sequence number
Mark compression dictionary.
The embodiment of the present invention provides a kind of device for obtaining compression dictionary again, and applied to client, described device includes:
Transmitting element, for sending datagram to server end, the data message includes unpressed user data
The request mark of targeted compression dictionary corresponding with for asking the unpressed user data;
Acquiring unit, for obtaining the targeted compression dictionary that the server end is sent, to use the target pressure
Contracting dictionary is compressed unpressed user data processing, and the targeted compression dictionary is that the server receives client hair
The data message sent judges the request mark whether is carried in the data message, if it is, establishing the targeted compression word
Allusion quotation and to the client send.
Optionally, described device further includes:
Judging unit, for judging in the existing compression dictionary of the client, if there are the unpressed use
The corresponding targeted compression dictionary of user data;
Adding device, if being to be deposited in the existing compression dictionary of the client for the judging result of the judging unit
In the corresponding targeted compression dictionary of the unpressed user data, added in the data message described described for asking
The request mark of the corresponding targeted compression dictionary of unpressed user data.
Optionally, the storage format of the unpressed user data is key:value;
Described device further includes:
First determination unit, for determining the target key in the unpressed user data and default identifier
Correspondence;
Second determination unit, for the correspondence of the target key and default identifier to be determined as the request
Mark.
Optionally, described device further includes:
Second judgment unit, for judging number that the unpressed user data occurs in preset time period, with
And whether the byte length of the unpressed user data is no meets preset condition;
Execution unit, if meeting institute for the judging result of the second judgment unit for the unpressed user data
Preset condition is stated, then the execution addition in the data message is described is used to ask the unpressed user data correspondence
Targeted compression dictionary request mark the step of.
Optionally, the second judgment unit, specifically for judging the unpressed user data in preset time period
Whether the product of the byte length of the number of interior appearance and the unpressed user data is more than predetermined threshold value;
The execution unit, if specifically for the product more than the predetermined threshold value, the unpressed number of users
According to the preset condition is met, the execution addition in the data message is described to be used to ask the unpressed number of users
The step of being identified according to the request of corresponding targeted compression dictionary.
Optionally, the storage format of the unpressed user data is key:Value, the compression dictionary include
The correspondence of value and default sequence number;
The acquiring unit, including:Receiving subelement and generation subelement;
The receiving subelement, for receiving the target in the unpressed user data of the server end transmission
The correspondence of key and the target sequence number in the targeted compression dictionary, the target sequence number are target value described
Corresponding default sequence number in targeted compression dictionary, the target value are the target key in the unpressed user
Corresponding value in data;
The generation subelement described is not pressed for the correspondence according to the target key and target sequence number and
The user data of contracting generates the targeted compression dictionary.
The embodiment of the present invention provides a kind of device for obtaining compression dictionary again, applied to server end, described device bag
It includes:
Receiving unit, for receiving the data message of client transmission, the data message includes unpressed number of users
It is identified according to the request of targeted compression dictionary corresponding with for asking the unpressed user data;
First establishes unit, for establishing the targeted compression dictionary;
Transmitting element, for sending the targeted compression dictionary to the client, so that described in client acquisition
Targeted compression dictionary is compressed processing using the targeted compression dictionary to unpressed user data.
Optionally, the receiving unit, the data message sent specifically for receiving the client, the data message
Including unpressed user data;
Described device further includes:
First judging unit, for judging whether to carry in the data message to ask the unpressed number of users
It is identified according to the request of corresponding targeted compression dictionary;
First execution unit, if being to carry to ask in the data message for the judging result of the judging unit
The request mark of the corresponding targeted compression dictionary of the unpressed user data, performs described first and establishes unit.
Optionally, the unpressed user data includes keyword key;
The request mark includes default identifier pass corresponding with the target key in the unpressed user data
System;
First judging unit, specifically for judging whether include the identifier in the data message;
First execution unit, if the judging result specifically for first judging unit is in the data message
Including the identifier, determine to carry to ask the corresponding target pressure of the unpressed user data in the data message
The request mark of contracting dictionary, performs described first and establishes unit.
Optionally, described device further includes:
Second judgment unit, for judging whether include the target in the compression dictionary preserved in the server end
Compress dictionary;
Determination unit, if being the compression that has been preserved in the server end for the judging result of the second judgment unit
Dictionary includes the targeted compression dictionary, and the targeted compression dictionary is determined from the compression dictionary preserved;
Second execution unit, if having been preserved for the judging result of the second judgment unit in the server end
Compressing does not include the targeted compression dictionary in dictionary, perform described first and establish unit.
Optionally, the storage format of the unpressed user data is key:value;
The compression dictionary includes the correspondence of value and default sequence number;
Described device further includes:
Second establishes unit, for establishing the target key in the unpressed user data and the targeted compression word
The correspondence of target sequence number in allusion quotation, the target sequence number are corresponding in the targeted compression dictionary for target value
Default sequence number, the target value be the target key corresponding value in the unpressed user data;
The transmitting element, specifically for sending pair of the target key and the target sequence number to the client
It should be related to, so that the client obtains the target pressure according to the correspondence of the target key and the target sequence number
Contracting dictionary.
The present invention implements to provide a kind of electronic equipment again, including processor, communication interface, memory and communication bus,
Wherein, processor, communication interface, memory complete mutual communication by communication bus;
Memory, for storing computer program;
Processor during for performing the program stored on memory, realizes any of the above-described acquisition compression dictionary
Method.
The present invention implements to provide a kind of computer readable storage medium again, and finger is stored in computer readable storage medium
Order, when run on a computer so that the method that computer performs any of the above-described acquisition compression dictionary.
The present invention implements to provide a kind of computer program product for including instruction again, when run on a computer,
So that the method that computer performs any of the above-described acquisition compression dictionary.
A kind of method and apparatus for obtaining compression dictionary provided in an embodiment of the present invention, first, client
It sends datagram, data message includes unpressed user data target corresponding with for asking unpressed user data
Compress the request mark of dictionary;Then, client obtains the targeted compression dictionary that server end is sent, and targeted compression dictionary is clothes
Device be engaged in after the data message that client is sent is received, judges whether carry to ask unpressed user in data message
The request mark of the corresponding targeted compression dictionary of data, if it is, establish targeted compression dictionary and sent to client.This
Sample, client can be identified by sending the request of the targeted compression dictionary needed for unpressed user data to server end,
Obtain compression dictionary.Even if the software version of client does not update, required compression dictionary can be also got from server end,
It avoids occupying substantial amounts of floating resources and bandwidth resources due to sending unpressed user data to server end, improves flow
The service efficiency of resource and bandwidth resources.Certainly, implement any of the products of the present invention or method must be not necessarily required to reach simultaneously
All the above advantage.
Description of the drawings
It in order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing
There is attached drawing needed in technology description to be briefly described.
Fig. 1 is a kind of flow chart of the method for the acquisition compression dictionary of the embodiment of the present invention;
Fig. 2 is another flow chart of the method for the acquisition compression dictionary of the embodiment of the present invention;
Fig. 3 is another flow chart of the method for the acquisition compression dictionary of the embodiment of the present invention;
Fig. 4 is a kind of schematic diagram of the system of the acquisition compression dictionary of the embodiment of the present invention;
Fig. 5 is a kind of structure chart of the device of the acquisition compression dictionary of the embodiment of the present invention;
Fig. 6 is the structure chart of another device of the acquisition compression dictionary of the embodiment of the present invention;
Fig. 7 is a kind of schematic diagram of the electronic equipment of the embodiment of the present invention;
Fig. 8 is another schematic diagram of the electronic equipment of the embodiment of the present invention.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present invention, the technical solution in the embodiment of the present invention is described.
In order to provide a user better service, Internet company needs by gathering substantial amounts of user data to understand use
The use habit and preference at family.Since the data volume of user data is larger, compression dictionary can be used by client to number of users
According to being uploaded to server end again after being compressed.In practical applications, user data is usually with key assignments (key:Value) to shape
Formula stores, in addition, compression dictionary includes the correspondence of value value and sequence number.
Since the resource data amount of client is big and is constantly updating, in order to ensure compression efficiency, it is necessary in client and
Server end increases new compression dictionary in time.At present, can visitor be made by the software version of updating client and server end
Family end and server end get new compression dictionary.But upgrade in time software version due to being unable to control client, it may
It is present with that the software version of server end is promoted, but the situation that the software version of client not yet upgrades.At this point, server
End has got new compression dictionary, and new compression dictionary has not been obtained in client, in such a scenario, server end and visitor
The detailed process of transmission data between the end of family is:
First, client is judged in the existing compression dictionary of client, if there are user data correspondences to be uploaded
Compression dictionary, specifically, bag can be determined whether there is in existing compression dictionary according to the value in user data
Include the compression dictionary of the value;If it is, being compressed processing to user data using the compression dictionary, generation is compressed
User data;If it has not, upload unpressed user data to server end.
Next, the user data that received server-side client is sent, judges whether the user's data have been compressed;If
It is that decompression processing, the user data after being decompressed are carried out to the user's data using the user's data corresponding compression dictionary;
If it has not, directly acquire unpressed user data.
As it can be seen that when client lacks compression dictionary, processing can not be compressed to the user data of part, still, to
Server end uploads unpressed user data, can occupy substantial amounts of floating resources and bandwidth resources.
To solve the above-mentioned problems, an embodiment of the present invention provides it is a kind of obtain compression dictionary method and apparatus, first,
Client sends datagram, and data message includes unpressed user data and for asking unpressed use
The request mark of the corresponding targeted compression dictionary of user data;Then, server end receive client send data message it
Afterwards, judge the request mark for asking the corresponding targeted compression dictionary of unpressed user data whether is carried in data message
Know, if it is, establish targeted compression dictionary and sent to client;Finally, client obtains the target from server end
Compress dictionary.In this way, client can be by sending the targeted compression dictionary needed for unpressed user data to server end
Request mark, obtain compression dictionary.Even if the software version of client does not update, can also be got from server end required
Compression dictionary, avoid occupying substantial amounts of floating resources and bandwidth provides due to sending unpressed user data to server end
The service efficiency of floating resources and bandwidth resources is improved in source.
An embodiment of the present invention provides a kind of method for obtaining compression dictionary, applied to client.Referring to Fig. 1, Fig. 1 is this
A kind of flow chart of the method for the acquisition compression dictionary of inventive embodiments, includes the following steps:
Step 101, send datagram to server end.
Wherein, data message includes unpressed user data target corresponding with for asking unpressed user data
Compress the request mark of dictionary.
In this step, client can send datagram to server end, which includes unpressed use
User data and for ask the request of the corresponding targeted compression dictionary of unpressed user data identify, with realize by should
Request mark, request server end establishes the targeted compression dictionary and is sent to client.
Optionally, before step 101, the method provided in an embodiment of the present invention for obtaining compression dictionary can also include:
Judge in the existing compression dictionary of client, if there are the corresponding targeted compression words of unpressed user data
Allusion quotation;
If it has not, it adds to ask asking for the corresponding targeted compression dictionary of unpressed user data in data message
Seek mark.
Specifically, whether client before sending datagram to server end, can determine client first
Preserve to compress the targeted compression dictionary of the user's data;If so, it is sent out after the user's data are compressed with processing
It send to server end, in this case, data message includes compressed data;If not provided, it can add in data message
Add to ask the request of the corresponding targeted compression dictionary of the user's data to identify, in this case, data message includes
Unpressed user data and the request identify.
Optionally, add to ask the corresponding targeted compression word of unpressed user data in data message above-mentioned
Before the step of request mark of allusion quotation, the method provided in an embodiment of the present invention for obtaining compression dictionary can also include:
Determine the correspondence of the target key and default identifier in unpressed user data;
The correspondence of target key and the identifier are determined as request mark.
It should be noted that the storage format of unpressed user data can be key:value.Specifically, client
Target key in unpressed user data and the correspondence of default identifier can be determined as request mark.
For example, unpressed user data can be:Key0=value0&key1=value1, wherein, target key bags
Key0 and key1 are included, corresponding value is respectively value0 and value1;Default identifier can be suggesting;That
, the correspondence of target key and suggesting can be determined as to request mark, are specifically denoted as suggesting=
Key0, key1.In this case, the data message that client is sent can be key0=value0&key1
=value1&suggesting=key0, key1.
In specific implementation process, client can be these users with the higher user data of selected section compression efficiency
Request of data targeted compression dictionary.Optionally, add to ask unpressed user data pair in data message above-mentioned
Before the step of request mark for the targeted compression dictionary answered, the method provided in an embodiment of the present invention for obtaining compression dictionary, also
It can include:
Judge the word of number that unpressed user data occurs in preset time period and unpressed user data
Whether length is no meets preset condition for section;
It adds to ask the corresponding targeted compression word of unpressed user data in data message if it has, then performing
The step of request mark of allusion quotation.
Specifically, can preset condition be set according to actual conditions, wherein, preset condition can be included in preset time period
The number that interior unpressed user data occurs is more than the byte length of default frequency threshold value and unpressed user data
More than default length threshold etc..When unpressed user data meets preset condition, it is believed that these user data categories
In the higher user data of compression efficiency, can just be added in data message for the request mark of request target compression dictionary.
So, it is possible to reduce client and the workload of server end improve work efficiency.
Further, the step of whether unpressed user data meets preset condition judged, including:
Judge the number, the byte with unpressed user data that unpressed user data occurs in preset time period
Whether the product of length is more than predetermined threshold value;
It is described to be used to ask the corresponding mesh of unpressed user data described in addition in data message if it has, then performing
The step of request mark of mark compression dictionary, including:
If the number that unpressed user data occurs in preset time period, the byte long with unpressed user data
The product of degree is more than predetermined threshold value, then unpressed user data meets preset condition, performs to add in data message and is used for
The step of request of the corresponding targeted compression dictionary of unpressed user data is asked to identify.
Specifically, preset condition can be arranged to number that unpressed user data occurs in preset time period,
Whether the product with the byte length of unpressed user data is more than predetermined threshold value, if the product is more than predetermined threshold value, explanation
The user's data fit preset condition belongs to the higher user data of compression efficiency, can add to ask in data message
The request of targeted compression dictionary is asked to identify;If the product is not above predetermined threshold value, illustrate that the user's data do not meet default item
Part is not belonging to the higher user data of compression efficiency, without addition the asking for request target compression dictionary in data message
Seek mark.
It is of course also possible to preset condition is set according to actual demand, so that client can be according to the characteristics of user itself
To ask most suitable dictionary.
Step 102, the targeted compression dictionary that server end is sent is obtained, to use targeted compression dictionary to unpressed use
User data is compressed processing.
Wherein, the targeted compression dictionary is that the server receives the data message that client is sent, and judges the number
It is identified according to the request whether is carried in message, if it is, establish the targeted compression dictionary and sent to the client.
In this step, client can obtain the targeted compression dictionary of server end transmission, in this way, client just can
Using the targeted compression dictionary, processing is compressed to unpressed user data;Wherein, server end is being received from visitor
During the data message at family end, it can first judge above-mentioned request mark whether is carried in the data message, if so, the data message
In user data for uncompressed data, server end can establish targeted compression dictionary for the user's data, and to client
End sends the targeted compression dictionary, so that client obtains the targeted compression dictionary.
Optionally, step 102 can include:
Receive the target key in the unpressed user data that server end is sent and the target sequence in targeted compression dictionary
The correspondence of row number, target sequence number are target value corresponding default sequence number, target in targeted compression dictionary
Value is target key corresponding value in unpressed user data;
According to the correspondence and unpressed user data of target key and target sequence number, targeted compression word is generated
Allusion quotation.
Specifically, since the value values in user data are generally included compared with multibyte, server end is directly sent out to client
Send compression dictionary that may occupy more floating resources and bandwidth resources.In order to improve transmitting efficiency, server end can be to
Client sends the correspondence of target key and target sequence number, makes client according to the correspondence and unpressed use
User data obtains targeted compression dictionary;Wherein, target sequence number is corresponding default in targeted compression dictionary for target value
Sequence number, target value be target key corresponding value in unpressed user data.
For example, unpressed user data can be:Key0=value0&key1=value1, the target key received
Include the correspondence of key0 and $ K0 and the correspondence of key1 and $ K1 with the correspondence of target sequence number;So, it is objective
Family end is according to the correspondence and key1 that receive key0 and $ K0 and the correspondence of $ K1, with reference to unpressed number of users
According to key0=value0&key1=value1, it can learn that targeted compression dictionary includes the correspondence of value0 and $ K0, with
And the correspondence of value1 and $ K1.
As it can be seen that in the method provided in an embodiment of the present invention for obtaining compression dictionary, client is sent out first to server end
Data message is sent, data message includes unpressed user data target pressure corresponding with for asking unpressed user data
The request mark of contracting dictionary;Then, client obtains the targeted compression dictionary that server end is sent, and targeted compression dictionary is service
Device judges whether carry to ask unpressed number of users in data message after the data message that client is sent is received
It is identified according to the request of corresponding targeted compression dictionary, if it is, establish targeted compression dictionary and sent to client.In this way,
Client can be identified by sending the request of the targeted compression dictionary needed for unpressed user data to server end, be obtained
Compress dictionary.Even if the software version of client does not update, required compression dictionary can be also got from server end, is avoided
Substantial amounts of floating resources and bandwidth resources are occupied due to sending unpressed user data to server end, improve floating resources
With the service efficiency of bandwidth resources.
In addition, in embodiments of the present invention, it can determine to obtain the higher user data institute of compression efficiency by client
The compression dictionary needed, and server end only needs to establish corresponding compression dictionary according to the request of client.
In one implementation, client can not pre-save any compression dictionary under initial situation, to
In the processing procedure of user data, compression dictionary only is obtained from server end, client development cost can be reduced.
Corresponding, the embodiment of the present invention additionally provides a kind of method for obtaining compression dictionary, applied to server end.Referring to
Fig. 2, Fig. 2 are another flow chart of the method for the acquisition compression dictionary of the embodiment of the present invention, are included the following steps:
Step 201, the data message that client is sent is received.
Wherein, data message includes unpressed user data target corresponding with for asking unpressed user data
Compress the request mark of dictionary.
In this step, server end can receive the data message from client, wherein, data message is included not
The user data of compression and for ask the request of the corresponding targeted compression dictionary of unpressed user data identify, in this way,
Server end can be identified according to the request, established the corresponding targeted compression dictionary of the unpressed user data and be sent to
Client enables the client to be compressed user data processing using the targeted compression dictionary.
Step 202, targeted compression dictionary is established.
In this step, server end can establish the corresponding targeted compression dictionary of the user data received.
Optionally, before step 202, the method provided in an embodiment of the present invention for obtaining compression dictionary can also include:
Judge whether include targeted compression dictionary in the compression dictionary preserved in server end;
If it is, targeted compression dictionary is determined from the compression dictionary preserved;
If it has not, perform step 202.
Specifically, server end is receiving the data message including unpressed user data and above-mentioned request mark
Afterwards, it can be determined that targeted compression dictionary whether has been preserved, if so, can determine to be somebody's turn to do from the compression dictionary preserved
Targeted compression dictionary compresses dictionary, to improve work efficiency without new destination again;It if not provided, can be by performing step
202, establish targeted compression dictionary.
Step 203, targeted compression dictionary is sent to client, so that client obtains targeted compression dictionary, uses target
Compression dictionary is compressed processing to unpressed user data.
In this step, server end can send established targeted compression dictionary to client, in this way, client is just
The targeted compression dictionary can be got, processing is compressed to unpressed user data using the targeted compression dictionary.
Optionally, before step 203, the method provided in an embodiment of the present invention for obtaining compression dictionary can also include:
Establish the target key passes corresponding with the target sequence number in targeted compression dictionary in unpressed user data
System, target sequence number are target value corresponding default sequence numbers in targeted compression dictionary, and target value is target key
The corresponding value in unpressed user data;
Corresponding, step 203 can include:
The correspondence of target key and target sequence number are sent to client, so that client is according to target key and target
The correspondence of sequence number and unpressed user data obtain targeted compression dictionary.
It should be noted that compression dictionary can include the correspondence of value and default sequence number.
Specifically, since the value values in user data are generally included compared with multibyte, server end is directly sent out to client
Send compression dictionary that may occupy more floating resources and bandwidth resources.In order to improve transmitting efficiency, server end can be built
Target key in vertical unpressed user data, the correspondence with the target sequence number in targeted compression dictionary, and this is right
It should be related to and be sent to client, client is made to obtain targeted compression word according to the correspondence and unpressed user data
Allusion quotation;Wherein, target sequence number is target value corresponding default sequence numbers in targeted compression dictionary, and target value is mesh
Mark key corresponding value in unpressed user data.
For example, unpressed user data can be:Key0=value0&key1=value1, wherein, target key bags
Key0 and key1 are included, corresponding target value is respectively value0 and value1;The corresponding target of the unpressed user data
Compression dictionary includes the correspondence of target value0 and default sequence number $ K0 and target value1 and default sequence
The correspondence of row number $ K1, wherein, $ K0 are the corresponding default sequence numbers of value0, and $ K1 are corresponding default for value1
Sequence number;So, the target key that server end is established includes the corresponding pass of key0 and $ K0 with the correspondence of target sequence number
System and the correspondence of key1 and $ K1.When client receives the correspondence of key0 and $ K0 and key1 and $ K1
During correspondence, with reference to unpressed user data key0=value0&key1=value1, targeted compression dictionary can be learnt
The correspondence of correspondence and value1 and $ K1 including value0 and $ K0.
As it can be seen that in the method provided in an embodiment of the present invention for obtaining compression dictionary, received server-side comes from client
Data message, data message include unpressed user data target pressure corresponding with for asking unpressed user data
The request mark of contracting dictionary;Then, server end judges whether carry to ask unpressed user data in data message
The request mark of corresponding targeted compression dictionary, if it is, establishing targeted compression dictionary and being sent to client.In this way, client
End can be identified by sending the request of the targeted compression dictionary needed for unpressed user data to server end, obtain compression
Dictionary.Even if the software version of client does not update, required compression dictionary can be also got from server end, avoid due to
Unpressed user data is sent to server end and occupies substantial amounts of floating resources and bandwidth resources, improves floating resources and band
The service efficiency of wide resource.
In order to more clearly illustrate the method for the acquisition compression dictionary of the embodiment of the present invention, the embodiment of the present invention separately provides
A kind of method for obtaining compression dictionary, including client and server end.Referring to Fig. 3, Fig. 3 is the acquisition of the embodiment of the present invention
Another flow chart of the method for dictionary is compressed, is included the following steps:
Step 301, client sends datagram.
Wherein, data message includes unpressed user data target corresponding with for asking unpressed user data
Compress the request mark of dictionary.
The detailed process and technique effect of the present invention may be referred to the step in the method shown in FIG. 1 for obtaining compression dictionary
101, details are not described herein.
Step 302, the data message that received server-side client is sent.
Wherein, data message includes unpressed user data.
In this step, server end can receive the data message from client, wherein, data message is included not
The user data of compression, server also need to judge whether include asking not press in the data message by follow-up step
The request mark of the corresponding targeted compression dictionary of user data of contracting, if the data message is identified including the request, server end
It can be identified according to the request, establish the corresponding targeted compression dictionary of the unpressed user data and be sent to client,
It enables the client to be compressed user data processing using the targeted compression dictionary.
Step 303, server end judges whether carry to ask unpressed user data corresponding in data message
The request mark of targeted compression dictionary;If it is, perform step 304.
In this step, server end may determine that whether carry to ask in the data message received it is unpressed
The request mark of the corresponding targeted compression dictionary of user data;If being identified including the request, step 304 is continued to execute;If no
It is identified including the request, then server end can directly acquire the unpressed user data, no longer by performing subsequent step
Establish targeted compression dictionary.
Optionally, unpressed user data includes keyword key;Request mark includes default identifier with not pressing
The correspondence of target key in the user data of contracting;
Correspondingly, step 303 can include:
Judge whether include identifier in data message;
If data message includes identifier, determine to carry that unpressed user data is asked to correspond in data message
Targeted compression dictionary request mark, perform step 304.
Specifically, it is wrapped due to above-mentioned for the request of the corresponding targeted compression dictionary of unpressed user data to be asked to identify
The correspondence of default identifier and the target key in unpressed user data is included, therefore, server end can be by sentencing
Whether identified in disconnected data message including the identifier to determine whether to carry above-mentioned request in the data message;If data message
Include the identifier, illustrate to carry above-mentioned request mark in the data message, follow-up step 304 can be performed, if data
Do not include the identifier in message, illustrate that, without carrying above-mentioned request mark in the data message, server end can be obtained directly
The unpressed user data is taken, no longer establishes targeted compression dictionary by performing subsequent step.
It should be noted that the concrete processing procedure for not carrying above-mentioned request mark in data message may be referred to it is existing
Technology.
For example, the data message that received server-side arrives is key0=value0&key1=value1&suggesting=
Key0, key1, suggesting=key0, key1 are for asking the corresponding targeted compression dictionary of unpressed user data
Request mark, wherein, default identifier is suggesting, and the corresponding target key of the identifier is key0 and key1;That
, server end can be by judging in data message whether including identifier suggesting to determine to be in the data message
It is no to carry above-mentioned request mark.
Step 304, server end establishes targeted compression dictionary.
The detailed process and technique effect of the present invention may be referred to the step in the method shown in Fig. 2 for obtaining compression dictionary
202, details are not described herein.
Step 305, server end sends targeted compression dictionary to client.
The detailed process and technique effect of the present invention may be referred to the step in the method shown in Fig. 2 for obtaining compression dictionary
203, details are not described herein.
Step 306, client obtains the targeted compression dictionary that server end is sent, to use targeted compression dictionary to not pressing
The user data of contracting is compressed processing.
The detailed process and technique effect of the present invention may be referred to the step in the method shown in FIG. 1 for obtaining compression dictionary
102, details are not described herein.
As it can be seen that in the method provided in an embodiment of the present invention for obtaining compression dictionary, client is sent out first to server end
Data message is sent, data message includes unpressed user data target pressure corresponding with for asking unpressed user data
The request mark of contracting dictionary;Next, data message of the received server-side from client;Server end judges data message
In whether carry to ask the request of the corresponding targeted compression dictionary of unpressed user data to identify, if it is, establishing mesh
Mark compression dictionary is simultaneously sent to client;Finally, client obtains the targeted compression dictionary that server end is sent.In this way, client
End can be identified by sending the request of the targeted compression dictionary needed for unpressed user data to server end, obtain compression
Dictionary.Even if the software version of client does not update, required compression dictionary can be also got from server end, avoid due to
Unpressed user data is sent to server end and occupies substantial amounts of floating resources and bandwidth resources, improves floating resources and band
The service efficiency of wide resource.
The embodiment of the present invention separately provides a kind of system for obtaining compression dictionary.Referring to Fig. 4, Fig. 4 is the embodiment of the present invention
Acquisition compression dictionary system a kind of schematic diagram.
In Fig. 4, obtaining the system of compression dictionary includes server end and customer end A, customer end B, client C, this is
The workflow of system is as follows:
The first step, client send datagram.
Specifically, client can send datagram to server end, which includes unpressed number of users
According to and for the request of the corresponding targeted compression dictionary of unpressed user data is asked to identify, to realize through the request
Mark, request server end establishes the targeted compression dictionary and is sent to client.
Second step, the data message that received server-side client is sent.
Specifically, server end can receive the data message from client, in this way, server end can be according to this
Request mark establishes the corresponding targeted compression dictionary of the unpressed user data and is sent to client, enables the client to
Processing is compressed to user data using the targeted compression dictionary..
3rd step, server end judge whether include targeted compression dictionary in the compression dictionary preserved in server end,
If it is, the 4th step is performed, if it has not, performing the 5th step.
Specifically, server end is receiving the data message including unpressed user data and above-mentioned request mark
Afterwards, it can be determined that targeted compression dictionary whether has been preserved, if so, can determine to be somebody's turn to do from the compression dictionary preserved
Targeted compression dictionary compresses dictionary, to improve work efficiency without new destination again;It if not provided, can be by performing the 5th
Step, establishes targeted compression dictionary.
4th step, if it is, server end determines targeted compression dictionary from the compression dictionary preserved.
Specifically, when server end has preserved targeted compression dictionary, server end can be from the compression dictionary preserved
In determine targeted compression dictionary, dictionary is compressed without new destination again, to improve work efficiency.
5th step, server end establish targeted compression dictionary.
Specifically, when server end does not preserve targeted compression dictionary, server end can establish targeted compression dictionary.
6th step, server end send targeted compression dictionary to client.
It is specifically, that server end can be found to client transmission by the 4th step or established by the 5th step
Targeted compression dictionary.
7th step, client obtains the targeted compression dictionary that server end is sent, to use targeted compression dictionary to not pressing
The user data of contracting is compressed processing.
Specifically, client can obtain the targeted compression dictionary of server end transmission, in this way, client can just use
The targeted compression dictionary is compressed processing to unpressed user data;Wherein, server end is being received from client
Data message when, can first judge whether to carry above-mentioned request mark in the data message, if so, in the data message
User data is uncompressed data, and server end can establish targeted compression dictionary for the user's data, and be sent out to client
The targeted compression dictionary is given, so that client obtains the targeted compression dictionary.
It should be noted that the detailed step and technique effect of the process flow of the system of generation compression dictionary may be referred to
Related description in the method for Fig. 1, Fig. 2 and generation compression dictionary shown in Fig. 3 above, details are not described herein.
As it can be seen that in the system provided in an embodiment of the present invention for obtaining compression dictionary, client is sent out first to server end
Data message is sent, data message includes unpressed user data target pressure corresponding with for asking unpressed user data
The request mark of contracting dictionary;Next, data message of the received server-side from client;Server end judges data message
In whether carry to ask the request of the corresponding targeted compression dictionary of unpressed user data to identify, if it is, search or
Person establishes targeted compression dictionary and is sent to client;Finally, client obtains the targeted compression dictionary that server end is sent.This
Sample, client can be identified by sending the request of the targeted compression dictionary needed for unpressed user data to server end,
Obtain compression dictionary.Even if the software version of client does not update, required compression dictionary can be also got from server end,
It avoids occupying substantial amounts of floating resources and bandwidth resources due to sending unpressed user data to server end, improves flow
The service efficiency of resource and bandwidth resources.
The embodiment of the present invention provides a kind of device for obtaining compression dictionary again, applied to client.It is referring to Fig. 5, Fig. 5
A kind of structure chart of the device of the acquisition compression dictionary of the embodiment of the present invention, the device include:
Transmitting element 501, for sending datagram to server end, data message include unpressed user data and
For the request of the corresponding targeted compression dictionary of unpressed user data to be asked to identify;
Acquiring unit 502, for obtaining the targeted compression dictionary of server end transmission, to use targeted compression dictionary to not
The user data of compression is compressed processing, and targeted compression dictionary is that server receives the data message that client is sent, and is judged
Whether request mark is carried in data message, if it is, establish targeted compression dictionary and sent to client.
Optionally, device further includes:
Judging unit, for judging in the existing compression dictionary of client, if there are unpressed user data pair
The targeted compression dictionary answered;
Adding device, if being that there are uncompressed in the existing compression dictionary of client for the judging result of judging unit
The corresponding targeted compression dictionary of user data, added in data message for asking the corresponding mesh of unpressed user data
The request mark of mark compression dictionary.
Optionally, the storage format of unpressed user data is key-value pair key:value;
Device further includes:
First determination unit, for determining that the target key in unpressed user data is corresponding with default identifier
Relation;
Second determination unit, for the correspondence of target key and default identifier to be determined as request mark.
Optionally, compressing dictionary includes the correspondence of value and default sequence number;
Acquiring unit 502, including:Receiving subelement and generation subelement;
Receiving subelement, for receiving the target key in the unpressed user data of the server end transmission
With the correspondence of the target sequence number in the targeted compression dictionary, the target sequence number is target value in the mesh
Corresponding default sequence number in mark compression dictionary, the target value is the target key in the unpressed number of users
The corresponding value in;
Subelement is generated, for the correspondence according to target key and target sequence number and unpressed number of users
According to generation targeted compression dictionary.
As it can be seen that in the device provided in an embodiment of the present invention for obtaining compression dictionary, client is sent out first to server end
Data message is sent, data message includes unpressed user data target pressure corresponding with for asking unpressed user data
The request mark of contracting dictionary;Then, client obtains the targeted compression dictionary that server end is sent, and targeted compression dictionary is service
Device judges whether carry to ask unpressed number of users in data message after the data message that client is sent is received
It is identified according to the request of corresponding targeted compression dictionary, if it is, establish targeted compression dictionary and sent to client.In this way,
Client can be identified by sending the request of the targeted compression dictionary needed for unpressed user data to server end, be obtained
Compress dictionary.Even if the software version of client does not update, required compression dictionary can be also got from server end, is avoided
Substantial amounts of floating resources and bandwidth resources are occupied due to sending unpressed user data to server end, improve floating resources
With the service efficiency of bandwidth resources.
The embodiment of the present invention provides a kind of device for obtaining compression dictionary again, applied to server end.Referring to Fig. 6, Fig. 6
For the structure chart of another device of the acquisition compression dictionary of the embodiment of the present invention, which includes:
Receiving unit 601, for receiving the data message of client transmission, data message includes unpressed user data
The request mark of targeted compression dictionary corresponding with for asking unpressed user data;
First establishes unit 602, for establishing targeted compression dictionary;
Transmitting element 603, for sending targeted compression dictionary to client, so that client obtains targeted compression dictionary,
Processing is compressed to unpressed user data using targeted compression dictionary.
Optionally, receiving unit 601, the data message sent specifically for receiving client, data message include not pressing
The user data of contracting;
Device further includes:
First judging unit, for judging whether to carry in data message to ask unpressed user data corresponding
The request mark of targeted compression dictionary;
First execution unit, if unpressed for asking to be carried in data message for the judging result of judging unit
The request mark of the corresponding targeted compression dictionary of user data, performs first and establishes unit 602.
Optionally, unpressed user data includes keyword key;
Request mark includes the correspondence of default identifier and the target key in unpressed user data;
First judging unit, specifically for judging whether include identifier in data message;
First execution unit, if including identifier specifically for the judging result of the first judging unit for data message,
It determines to carry for the request of the corresponding targeted compression dictionary of unpressed user data to be asked identify in data message, execution the
One establishes unit 602.
Optionally, device further includes:
Second judgment unit, for judging whether include targeted compression word in the compression dictionary preserved in server end
Allusion quotation;
Determination unit, if being to be wrapped in the compression dictionary preserved in server end for the judging result of second judgment unit
Targeted compression dictionary is included, targeted compression dictionary is determined from the compression dictionary preserved;
Second execution unit, if being the compression dictionary that has been preserved in server end for the judging result of second judgment unit
In do not include targeted compression dictionary, perform and first establish unit 602.
Optionally, the storage format of unpressed user data is key-value pair key:value;
Compressing dictionary includes the correspondence of value and default sequence number;
Device further includes:
Second establishes unit, for establishing the target key in the unpressed user data and the targeted compression word
The correspondence of target sequence number in allusion quotation, the target sequence number are corresponding in the targeted compression dictionary for target value
Default sequence number, the target value be the target key corresponding value in the unpressed user data;
Transmitting element 603, specifically for sending the correspondence of target key and target sequence number to client, so that objective
Family end obtains targeted compression dictionary according to the correspondence of target key and target sequence number.
As it can be seen that in the device provided in an embodiment of the present invention for obtaining compression dictionary, received server-side comes from client
Data message, data message include unpressed user data target pressure corresponding with for asking unpressed user data
The request mark of contracting dictionary;Then, server end judges whether carry to ask unpressed user data in data message
The request mark of corresponding targeted compression dictionary, if it is, establishing targeted compression dictionary and being sent to client.In this way, client
End can be identified by sending the request of the targeted compression dictionary needed for unpressed user data to server end, obtain compression
Dictionary.Even if the software version of client does not update, required compression dictionary can be also got from server end, avoid due to
Unpressed user data is sent to server end and occupies substantial amounts of floating resources and bandwidth resources, improves floating resources and band
The service efficiency of wide resource.
The embodiment of the present invention provides a kind of electronic equipment again, and with reference to figure 7, Fig. 7 is the electronic equipment of the embodiment of the present invention
A kind of schematic diagram, as shown in fig. 7, electronic equipment include processor 701, communication interface 702, memory 703 and communication bus
704, wherein, processor 701, communication interface 702, memory 703 completes mutual communication by communication bus 704,
Memory 703, for storing computer program;
Processor 701 during for performing the program stored on memory 703, realizes following steps:
It sends datagram to server end, data message includes unpressed user data and unpressed for asking
The request mark of the corresponding targeted compression dictionary of user data;
Obtain server end send targeted compression dictionary, with use targeted compression dictionary to unpressed user data into
Row compression is handled, and targeted compression dictionary is that server receives the data message that client is sent, and judges whether taken in data message
Band request mark, if it is, establish targeted compression dictionary and sent to client.
The communication bus that above-mentioned electronic equipment is mentioned can be Peripheral Component Interconnect standard (Peripheral Component
Interconnect, abbreviation PCI) bus or expanding the industrial standard structure (Extended Industry Standard
Architecture, abbreviation EISA) bus etc..The communication bus can be divided into address bus, data/address bus, controlling bus etc..
For ease of representing, only represented in figure with a thick line, it is not intended that an only bus or a type of bus.
Communication interface is for the communication between above-mentioned electronic equipment and other equipment.
Memory can include random access memory (Random Access Memory, abbreviation RAM), can also include
Nonvolatile memory (non-volatile memory), for example, at least a magnetic disk storage.Optionally, memory may be used also
To be at least one storage device for being located remotely from aforementioned processor.
Above-mentioned processor can be general processor, including central processing unit (Central Processing Unit,
Abbreviation CPU), network processing unit (Network Processor, abbreviation NP) etc.;It can also be digital signal processor
(Digital Signal Processing, abbreviation DSP), application-specific integrated circuit (Application Specific
Integrated Circuit, abbreviation ASIC), field programmable gate array (Field-Programmable Gate Array,
Abbreviation FPGA) either other programmable logic device, discrete gate or transistor logic, discrete hardware components.
The embodiment of the present invention provides a kind of electronic equipment again, and with reference to figure 8, Fig. 8 is the electronic equipment of the embodiment of the present invention
Another schematic diagram, as shown in figure 8, to include processor 801, communication interface 802, memory 803 and communication total for electronic equipment
Line 804, wherein, processor 801, communication interface 802, memory 803 completes mutual communication by communication bus 804,
Memory 803, for storing computer program;
Processor 801 during for performing the program stored on memory 803, realizes following steps:
The data message that client is sent is received, data message includes unpressed user data and uncompressed for asking
The corresponding targeted compression dictionary of user data request mark;
Establish targeted compression dictionary;
Targeted compression dictionary is sent to client, so that client obtains targeted compression dictionary, uses targeted compression dictionary
Processing is compressed to unpressed user data.
The communication bus that above-mentioned electronic equipment is mentioned can be Peripheral Component Interconnect standard (Peripheral Component
Interconnect, abbreviation PCI) bus or expanding the industrial standard structure (Extended Industry Standard
Architecture, abbreviation EISA) bus etc..The communication bus can be divided into address bus, data/address bus, controlling bus etc..
For ease of representing, only represented in figure with a thick line, it is not intended that an only bus or a type of bus.
Communication interface is for the communication between above-mentioned electronic equipment and other equipment.
Memory can include random access memory (Random Access Memory, abbreviation RAM), can also include
Nonvolatile memory (non-volatile memory), for example, at least a magnetic disk storage.Optionally, memory may be used also
To be at least one storage device for being located remotely from aforementioned processor.
Above-mentioned processor can be general processor, including central processing unit (Central Processing Unit,
Abbreviation CPU), network processing unit (Network Processor, abbreviation NP) etc.;It can also be digital signal processor
(Digital Signal Processing, abbreviation DSP), application-specific integrated circuit (Application Specific
Integrated Circuit, abbreviation ASIC), field programmable gate array (Field-Programmable Gate Array,
Abbreviation FPGA) either other programmable logic device, discrete gate or transistor logic, discrete hardware components.
The embodiment of the present invention provides a kind of computer readable storage medium again, is stored in the computer readable storage medium
There is instruction, when run on a computer so that computer performs any acquisition compression dictionary in above-described embodiment
Method.
The embodiment of the present invention provides a kind of computer program product for including instruction again, when it runs on computers
When so that the method that computer performs any acquisition compression dictionary in above-described embodiment.
In the above-described embodiments, can come wholly or partly by software, hardware, firmware or its any combination real
It is existing.When implemented in software, can entirely or partly realize in the form of a computer program product.The computer program
Product includes one or more computer instructions.When loading on computers and performing the computer program instructions, all or
It partly generates according to the flow or function described in the embodiment of the present invention.The computer can be all-purpose computer, special meter
Calculation machine, computer network or other programmable devices.The computer instruction can be stored in computer readable storage medium
In or from a computer readable storage medium to another computer readable storage medium transmit, for example, the computer
Instruction can pass through wired (such as coaxial cable, optical fiber, number from a web-site, computer, server or data center
User's line (DSL)) or wireless (such as infrared, wireless, microwave etc.) mode to another web-site, computer, server or
Data center is transmitted.The computer readable storage medium can be any usable medium that computer can access or
It is the data storage devices such as server, the data center integrated comprising one or more usable mediums.The usable medium can be with
It is magnetic medium, (for example, floppy disk, hard disk, tape), optical medium (for example, DVD) or semiconductor medium (such as solid state disk
Solid State Disk (SSD)) etc..
It should be noted that herein, relational terms such as first and second and the like are used merely to a reality
Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation
In any this actual relation or order.Moreover, term " comprising ", "comprising" or its any other variant are intended to
Non-exclusive inclusion, so that process, method, article or equipment including a series of elements not only will including those
Element, but also including other elements that are not explicitly listed or further include as this process, method, article or equipment
Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that
Also there are other identical elements in process, method, article or equipment including the element.
Each embodiment in this specification is described using relevant mode, identical similar portion between each embodiment
Point just to refer each other, and the highlights of each of the examples are difference from other examples.It is real especially for system
For applying example, since it is substantially similar to embodiment of the method, so description is fairly simple, related part is referring to embodiment of the method
Part explanation.
Claims (24)
- A kind of 1. method for obtaining compression dictionary, which is characterized in that applied to client, the described method includes:It sends datagram to server end, the data message includes unpressed user data and for asking described not press The request mark of the corresponding targeted compression dictionary of user data of contracting;The targeted compression dictionary that the server end is sent is obtained, to use the targeted compression dictionary to unpressed use User data is compressed processing, and the targeted compression dictionary is that the server receives the data message that client is sent, and is judged Whether the request mark is carried in the data message, if it is, establishing the targeted compression dictionary and to the client It sends.
- 2. according to the method described in claim 1, it is characterized in that, described the step of sending datagram to server end it Before, the method further includes:Judge in the existing compression dictionary of the client, if there are the corresponding target pressures of the unpressed user data Contracting dictionary;If it has not, it is used to ask the corresponding targeted compression of the unpressed user data described in adding in the data message The request mark of dictionary.
- 3. according to the method described in claim 2, it is characterized in that, the storage format of the unpressed user data is key assignments To key:value;It is used to ask the corresponding targeted compression dictionary of the unpressed user data described in adding in the data message Before the step of request mark, the method further includes:Determine the correspondence of the target key and default identifier in the unpressed user data;The correspondence of the target key and the identifier are determined as the request to identify.
- 4. it according to the method described in claim 2, it is characterized in that, is used to ask described in addition in the data message described Before the step of request of the corresponding targeted compression dictionary of the unpressed user data is asked to identify, the method further includes:Judge the number and the unpressed user data that the unpressed user data occurs in preset time period Byte length whether no meet preset condition;If it has, then performing, the addition in the data message is described to be used to that the unpressed user data to be asked to correspond to Targeted compression dictionary request mark the step of.
- 5. according to the method described in claim 4, it is characterized in that,The number and the unpressed user that the judgement unpressed user data occurs in preset time period The byte length of data whether no the step of meeting preset condition, including:Judge number that the unpressed user data occurs in preset time period, with the unpressed user data Whether the product of byte length is more than predetermined threshold value;It is described if it has, then perform it is described added in the data message it is described for asking the unpressed user data The step of request mark of corresponding targeted compression dictionary, including:If the product is more than the predetermined threshold value, the unpressed user data meets the preset condition, performs institute It states and is used to ask asking for the corresponding targeted compression dictionary of the unpressed user data described in adding in the data message The step of seeking mark.
- 6. according to the method described in claim 1, it is characterized in that, the storage format of the unpressed user data is key: Value, the compression dictionary include the correspondence of value and default sequence number;Described the step of obtaining the targeted compression dictionary that the server end is sent, including:It receives in the target key and the targeted compression dictionary in the unpressed user data that the server end is sent Target sequence number correspondence, the target sequence number for target value it is corresponding pre- in the targeted compression dictionary If sequence number, the target value be the target key corresponding value in the unpressed user data;According to the correspondence and the unpressed user data of the target key and the target sequence number, institute is generated State targeted compression dictionary.
- A kind of 7. method for obtaining compression dictionary, which is characterized in that applied to server end, the described method includes:Receive the data message that client is sent, the data message include unpressed user data and for ask it is described not The request mark of the corresponding targeted compression dictionary of user data of compression;Establish the targeted compression dictionary;The targeted compression dictionary is sent to the client, so that the client obtains the targeted compression dictionary, is used The targeted compression dictionary is compressed processing to unpressed user data.
- 8. the method according to the description of claim 7 is characterized in thatThe data message for receiving client and sending, the data message include unpressed user data and for asking The step of stating the request mark of the corresponding targeted compression dictionary of unpressed user data, including:The data message that the client is sent is received, the data message includes unpressed user data;Before described the step of establishing the targeted compression dictionary, the method further includes:Judge whether carry to ask the corresponding targeted compression dictionary of the unpressed user data in the data message Request mark;If it is, perform described the step of establishing the targeted compression dictionary.
- 9. according to the method described in claim 8, it is characterized in that, the unpressed user data includes keyword key;The request mark includes the correspondence of default identifier and the target key in the unpressed user data;It is described to judge whether carry to ask the corresponding targeted compression of the unpressed user data in the data message The step of request mark of dictionary, including:Judge whether include the identifier in the data message;It is described if it is, perform described the step of establishing the targeted compression dictionary, including:If the data message includes the identifier, determine to carry in the data message described unpressed for asking The request mark of the corresponding targeted compression dictionary of user data, performs described the step of establishing the targeted compression dictionary.
- 10. the method according to the description of claim 7 is characterized in that described the step of establishing the targeted compression dictionary it Before, the method further includes:Judge whether include the targeted compression dictionary in the compression dictionary preserved in the server end;If it is, the targeted compression dictionary is determined from the compression dictionary preserved;If it has not, perform described the step of establishing the targeted compression dictionary.
- 11. the method according to the description of claim 7 is characterized in that the storage format of the unpressed user data is key:value;The compression dictionary includes the correspondence of value and default sequence number;Before described the step of sending the targeted compression dictionary to the client, the method further includes:It is corresponding with the target sequence number in the targeted compression dictionary to establish the target key in the unpressed user data Relation, the target sequence number are target value corresponding default sequence number, target in the targeted compression dictionary Value is the target key corresponding value in the unpressed user data;The step of transmission targeted compression dictionary to the client, including:The correspondence of the target key and the target sequence number are sent to the client so that the client according to The target key obtains the target pressure with the correspondence of the target sequence number and the unpressed user data Contracting dictionary.
- 12. a kind of device for obtaining compression dictionary, which is characterized in that applied to client, described device includes:Transmitting element, for sending datagram to server end, the data message includes unpressed user data and use In the request mark for asking the corresponding targeted compression dictionary of the unpressed user data;Acquiring unit, for obtaining the targeted compression dictionary that the server end is sent, to use the targeted compression word Allusion quotation is compressed unpressed user data processing, and the targeted compression dictionary is that the server receives client transmission Data message judges the request mark whether is carried in the data message, if it is, establishing the targeted compression dictionary simultaneously It is sent to the client.
- 13. device according to claim 12, which is characterized in that described device further includes:First judging unit, for judging in the existing compression dictionary of the client, if there are the unpressed use The corresponding targeted compression dictionary of user data;Adding device, if for the judging unit judging result for the client it is existing compression dictionary in there are institutes The corresponding targeted compression dictionary of unpressed user data is stated, is added in the data message described for asking described not press The request mark of the corresponding targeted compression dictionary of user data of contracting.
- 14. device according to claim 13, which is characterized in that the storage format of the unpressed user data is key:value;Described device further includes:First determination unit, for determining that the target key in the unpressed user data is corresponding with default identifier Relation;Second determination unit identifies for the correspondence of the target key and default identifier to be determined as the request.
- 15. device according to claim 13, which is characterized in that described device further includes:Second judgment unit, for judging number that the unpressed user data occurs in preset time period, Yi Jisuo The byte length for stating unpressed user data whether no meets preset condition;Execution unit, if for the second judgment unit judging result for the unpressed user data meet it is described pre- If condition, then the execution addition in the data message is described is used to ask the corresponding mesh of the unpressed user data The step of request mark of mark compression dictionary.
- 16. device according to claim 15, which is characterized in thatThe second judgment unit, time occurred specifically for judging the unpressed user data in preset time period Whether the product of the byte length of number and the unpressed user data is more than predetermined threshold value;The execution unit, if being more than the predetermined threshold value specifically for the product, the unpressed user data symbol The preset condition is closed, the execution addition in the data message is described to be used to ask the unpressed user data pair The step of request mark for the targeted compression dictionary answered.
- 17. device according to claim 12, which is characterized in that the storage format of the unpressed user data is key:Value, the compression dictionary include the correspondence of value and default sequence number;The acquiring unit, including:Receiving subelement and generation subelement;The receiving subelement, for receiving the target key in the unpressed user data of the server end transmission With the correspondence of the target sequence number in the targeted compression dictionary, the target sequence number is target value in the mesh Corresponding default sequence number in mark compression dictionary, the target value is the target key in the unpressed number of users The corresponding value in;The generation subelement, for the correspondence according to the target key and target sequence number and described unpressed User data generates the targeted compression dictionary.
- 18. a kind of device for obtaining compression dictionary, which is characterized in that applied to server end, described device includes:Receiving unit, for receive client transmission data message, the data message include unpressed user data and For the request of the corresponding targeted compression dictionary of the unpressed user data to be asked to identify;First establishes unit, for establishing the targeted compression dictionary;Transmitting element, for sending the targeted compression dictionary to the client, so that the client obtains the target Dictionary is compressed, processing is compressed to unpressed user data using the targeted compression dictionary.
- 19. device according to claim 18, which is characterized in thatThe receiving unit, the data message sent specifically for receiving the client, the data message includes uncompressed User data;Described device further includes:First judging unit, for judging whether to carry in the data message to ask the unpressed user data pair The request mark for the targeted compression dictionary answered;First execution unit, if described to carry to ask in the data message for the judging result of the judging unit The request mark of the corresponding targeted compression dictionary of unpressed user data, performs described first and establishes unit.
- 20. device according to claim 19, which is characterized in thatThe unpressed user data includes keyword key;The request mark includes the correspondence of default identifier and the target key in the unpressed user data;First judging unit, specifically for judging whether include the identifier in the data message;First execution unit, if including specifically for the judging result of first judging unit for the data message The identifier determines to carry to ask the corresponding targeted compression word of the unpressed user data in the data message The request mark of allusion quotation, performs described first and establishes unit.
- 21. device according to claim 18, which is characterized in that described device further includes:Second judgment unit, for judging whether include the targeted compression in the compression dictionary preserved in the server end Dictionary;Determination unit, if being the compression dictionary that has been preserved in the server end for the judging result of the second judgment unit Include the targeted compression dictionary, the targeted compression dictionary is determined from the compression dictionary preserved;Second execution unit, if being the compression that has been preserved in the server end for the judging result of the second judgment unit Do not include the targeted compression dictionary in dictionary, perform described first and establish unit.
- 22. device according to claim 18, which is characterized in thatThe storage format of the unpressed user data is key:value;The compression dictionary includes the correspondence of value and default sequence number;Described device further includes:Second establishes unit, for establishing in the target key in the unpressed user data and the targeted compression dictionary Target sequence number correspondence, the target sequence number for target value it is corresponding pre- in the targeted compression dictionary If sequence number, the target value be the target key corresponding value in the unpressed user data;The transmitting element, specifically for being sent to the client, the target key is corresponding with the target sequence number to close System, so that the client obtains the targeted compression word according to the correspondence of the target key and the target sequence number Allusion quotation.
- 23. a kind of electronic equipment, which is characterized in that including processor, communication interface, memory and communication bus, wherein, processing Device, communication interface, memory complete mutual communication by communication bus;Memory, for storing computer program;Processor during for performing the program stored on memory, realizes any method and steps of claim 1-6.
- 24. a kind of electronic equipment, which is characterized in that including processor, communication interface, memory and communication bus, wherein, processing Device, communication interface, memory complete mutual communication by communication bus;Memory, for storing computer program;Processor during for performing the program stored on memory, realizes any method and steps of claim 7-11.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711249958.4A CN108092956B (en) | 2017-12-01 | 2017-12-01 | Method and device for acquiring compression dictionary |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711249958.4A CN108092956B (en) | 2017-12-01 | 2017-12-01 | Method and device for acquiring compression dictionary |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108092956A true CN108092956A (en) | 2018-05-29 |
CN108092956B CN108092956B (en) | 2020-12-04 |
Family
ID=62173569
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711249958.4A Active CN108092956B (en) | 2017-12-01 | 2017-12-01 | Method and device for acquiring compression dictionary |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108092956B (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109088867A (en) * | 2018-08-08 | 2018-12-25 | 浙江天地人科技有限公司 | A method of reducing data and uploads the connection frequency |
WO2020156261A1 (en) * | 2019-01-31 | 2020-08-06 | 华为技术有限公司 | Data compression method and base station |
CN112769730A (en) * | 2019-10-21 | 2021-05-07 | 北京车和家信息技术有限公司 | Page compression method and device, client and server |
CN114666406A (en) * | 2022-02-24 | 2022-06-24 | 国电南瑞科技股份有限公司 | Object model-based power internet of things data compression method and device |
EP4009696A4 (en) * | 2019-08-05 | 2022-09-14 | Huawei Technologies Co., Ltd. | Communication method and device |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101211352A (en) * | 2006-12-28 | 2008-07-02 | 凌阳科技股份有限公司 | Electronic dictionary data update system and its method |
CN102194499A (en) * | 2010-03-15 | 2011-09-21 | 华为技术有限公司 | Method and device for synchronizing compressed dictionary |
CN103716056A (en) * | 2012-09-29 | 2014-04-09 | 华为技术有限公司 | Data compression method, data decompression method and devices |
CN104917786A (en) * | 2014-03-11 | 2015-09-16 | 杭州雾隐美地传媒有限公司 | Method and module for saving transmission flow during interaction of client and server |
US20150286668A1 (en) * | 2014-04-03 | 2015-10-08 | Thomas Legler | Optimizing update operations in in-memory database systems |
-
2017
- 2017-12-01 CN CN201711249958.4A patent/CN108092956B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101211352A (en) * | 2006-12-28 | 2008-07-02 | 凌阳科技股份有限公司 | Electronic dictionary data update system and its method |
CN102194499A (en) * | 2010-03-15 | 2011-09-21 | 华为技术有限公司 | Method and device for synchronizing compressed dictionary |
CN103716056A (en) * | 2012-09-29 | 2014-04-09 | 华为技术有限公司 | Data compression method, data decompression method and devices |
CN104917786A (en) * | 2014-03-11 | 2015-09-16 | 杭州雾隐美地传媒有限公司 | Method and module for saving transmission flow during interaction of client and server |
US20150286668A1 (en) * | 2014-04-03 | 2015-10-08 | Thomas Legler | Optimizing update operations in in-memory database systems |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109088867A (en) * | 2018-08-08 | 2018-12-25 | 浙江天地人科技有限公司 | A method of reducing data and uploads the connection frequency |
WO2020156261A1 (en) * | 2019-01-31 | 2020-08-06 | 华为技术有限公司 | Data compression method and base station |
EP3910903A4 (en) * | 2019-01-31 | 2022-03-09 | Huawei Technologies Co., Ltd. | Data compression method and base station |
AU2020214893B2 (en) * | 2019-01-31 | 2022-10-20 | Huawei Technologies Co., Ltd. | Data compression method and base station |
US11902401B2 (en) | 2019-01-31 | 2024-02-13 | Huawei Technologies Co., Ltd. | Data compression method and base station |
EP4009696A4 (en) * | 2019-08-05 | 2022-09-14 | Huawei Technologies Co., Ltd. | Communication method and device |
CN112769730A (en) * | 2019-10-21 | 2021-05-07 | 北京车和家信息技术有限公司 | Page compression method and device, client and server |
CN112769730B (en) * | 2019-10-21 | 2023-03-24 | 北京车和家信息技术有限公司 | Page compression method, device, client and server |
CN114666406A (en) * | 2022-02-24 | 2022-06-24 | 国电南瑞科技股份有限公司 | Object model-based power internet of things data compression method and device |
CN114666406B (en) * | 2022-02-24 | 2023-11-21 | 国电南瑞科技股份有限公司 | Electric power Internet of things data compression method and device based on object model |
Also Published As
Publication number | Publication date |
---|---|
CN108092956B (en) | 2020-12-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108092956A (en) | A kind of method and apparatus for obtaining compression dictionary | |
US11657284B2 (en) | Neural network model apparatus and compressing method of neural network model | |
WO2019001006A1 (en) | Method and device for encoding and decoding image data | |
CN103458460A (en) | Method and device for compressing and decompressing signal data | |
CN111654498A (en) | Equipment adding method and Internet of things platform | |
CN107172886A (en) | A kind of method of server and server compresses data | |
US20170264526A1 (en) | Information collecting apparatus, information analyzing apparatus, and information transferring method based on different internet of things platforms | |
KR101188507B1 (en) | The device and method for relaying heterogeneous netnork and user terminal using the same based on technology of relaying network and browsing things of internet of things based on ip using web platform | |
WO2020125527A1 (en) | Data compression method, apparatus, computer device and storage medium | |
WO2020230658A1 (en) | Feature extraction device and state estimation system | |
CN114039973A (en) | File transmission method, device and storage medium | |
JP6647340B2 (en) | Improved file compression and encryption | |
WO2018072095A1 (en) | Load testing management method and system | |
CN112367215B (en) | Network traffic protocol identification method and device based on machine learning | |
EP3255837A1 (en) | Method and system for automating troubleshooting of a network | |
CN108011952A (en) | A kind of method and apparatus for obtaining compression dictionary | |
CN116582794A (en) | Audio transmission method, system and device thereof, electronic equipment and storage medium | |
CN111464506A (en) | Protocol conversion method and device for Internet of things and computer readable storage medium | |
CN117744794A (en) | Method for training machine learning model in server-client machine learning scene | |
CN105430006B (en) | A kind of method of dynamic realtime adjustment spice image quality | |
CN113204683B (en) | Information reconstruction method and device, storage medium and electronic equipment | |
Iglesias et al. | Enabling powerful GUIs in ISOBUS networks by transparent data compression | |
CN114244911A (en) | Voice analysis method and device, receiving terminal equipment and storage medium | |
CN114466088B (en) | Data transmission method and device of sweeping robot, storage medium and terminal | |
CN112188456B (en) | Bluetooth device data acquisition method and device, storage medium and electronic 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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |