CN112769730A - Page compression method and device, client and server - Google Patents

Page compression method and device, client and server Download PDF

Info

Publication number
CN112769730A
CN112769730A CN201911000890.5A CN201911000890A CN112769730A CN 112769730 A CN112769730 A CN 112769730A CN 201911000890 A CN201911000890 A CN 201911000890A CN 112769730 A CN112769730 A CN 112769730A
Authority
CN
China
Prior art keywords
request
compressed
link
link request
response content
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
Application number
CN201911000890.5A
Other languages
Chinese (zh)
Other versions
CN112769730B (en
Inventor
周俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing CHJ Automotive Information Technology Co Ltd
Original Assignee
Beijing CHJ Automotive Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing CHJ Automotive Information Technology Co Ltd filed Critical Beijing CHJ Automotive Information Technology Co Ltd
Priority to CN201911000890.5A priority Critical patent/CN112769730B/en
Publication of CN112769730A publication Critical patent/CN112769730A/en
Application granted granted Critical
Publication of CN112769730B publication Critical patent/CN112769730B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/04Protocols for data compression, e.g. ROHC
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]

Abstract

The invention provides a page compression method, a device, a client and a server, wherein the page compression method applied to the client comprises the following steps: under the condition of acquiring a page request, analyzing a link request corresponding to the page request, and judging whether the link request comprises repeated information or not; compressing the link request when there is duplicate information in the link request; and sending the compressed link request to a server. The technical scheme provided by the invention solves the problems of high bandwidth loss and low utilization rate caused by the large amount of repeated information in the content of the existing page request.

Description

Page compression method and device, client and server
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a page compression method, an apparatus, a client, and a server.
Background
The existing HTTP transmission protocol and the transmission content have very large bandwidth loss and connection loss, one conventional html page loading needs at least dozens of HTTP requests, and the proportion of repeated data in the requested and returned content is very high. For example, most of the information carried by the request header of each request is repeated information; in the returned message body, there are also a large number of markup languages of the same character string. Therefore, the existing page request has a large amount of repeated information on content, which causes the problems of large bandwidth loss and low utilization rate.
Disclosure of Invention
The embodiment of the invention provides a page compression method, a page compression device, a client and a server, and aims to solve the problems of high bandwidth loss and low utilization rate caused by the fact that a large amount of repeated information exists in the content of the existing page request.
In order to solve the technical problem, the invention is realized as follows:
in a first aspect, an embodiment of the present invention provides a page compression method, applied to a client, including:
under the condition of acquiring a page request, analyzing a link request corresponding to the page request, and judging whether the link request comprises repeated information or not;
compressing the link request when there is duplicate information in the link request;
and sending the compressed link request to a server.
Optionally, compressing the link request in the case that there is duplicate information in the link request includes:
under the condition that repeated information exists in the link request, obtaining a compressed sample in the link request, wherein the compressed sample is a link request which can realize the maximum compression ratio in the link request;
determining other link requests except the compressed sample in the link requests as pending link requests, and removing request information which is repeated with the compressed sample in the pending link requests.
Optionally, the sending the compressed link request to the server includes:
and combining the to-be-processed link request without the repeated request information and the compressed sample into a target link request, and sending the target link request to a server.
Optionally, after sending the compressed link request to the server, the method further includes:
receiving response information returned by the server based on the compressed link request;
and decompressing the response information to obtain response content.
In a second aspect, an embodiment of the present invention further provides a page compression method, applied to a server, including:
receiving a compressed link request sent by a client;
decompressing the compressed link request to obtain request information;
and acquiring response content responding to the request information, and sending the response content to the client.
Optionally, the sending the response content to the client includes:
and compressing the response content and then sending the compressed response content to the client.
Optionally, the compressing the response content and sending the compressed response content to the client includes:
predicting a first compression ratio of the response content after compression based on the general dictionary and a second compression ratio of the response content after compression based on the variable dictionary based on a preset algorithm;
under the condition that the first compression ratio is larger than the second compression ratio, compressing the response content according to a general dictionary, and sending the compressed response content to a client;
and under the condition that the first compression ratio is smaller than the second compression ratio, compressing the response content according to a variable dictionary, and sending the compressed response content and the variable dictionary to a client.
In a third aspect, an embodiment of the present invention further provides a page compression apparatus, applied to a client, including:
the analysis module is used for analyzing a link request corresponding to a page request under the condition of acquiring the page request and judging whether the link request comprises repeated information or not;
the compression module is used for compressing the link request under the condition that repeated information exists in the link request;
and the first sending module is used for sending the compressed link request to the server.
Optionally, the compression module is further configured to:
under the condition that repeated information exists in the link request, obtaining a compressed sample in the link request, wherein the compressed sample is a link request which can realize the maximum compression ratio in the link request;
determining other link requests except the compressed sample in the link requests as pending link requests, and removing request information which is repeated with the compressed sample in the pending link requests.
Optionally, the first sending module is further configured to:
and combining the to-be-processed link request without the repeated request information and the compressed sample into a target link request, and sending the target link request to a server.
Optionally, the apparatus further comprises a first decompression module configured to:
receiving response information returned by the server based on the compressed link request;
and decompressing the response information to obtain response content.
In a fourth aspect, an embodiment of the present invention further provides a page compression apparatus, applied to a server, including:
the receiving module is used for receiving the compressed link request sent by the client;
the second decompression module is used for decompressing the compressed link request to obtain request information;
and the second sending module is used for acquiring response content responding to the request information and sending the response content to the client.
Optionally, the second sending module is further configured to:
and compressing the response content and then sending the compressed response content to the client.
Optionally, the second sending module is further configured to:
predicting a first compression ratio of the response content after compression based on the general dictionary and a second compression ratio of the response content after compression based on the variable dictionary based on a preset algorithm;
under the condition that the first compression ratio is larger than the second compression ratio, compressing the response content according to a general dictionary, and sending the compressed response content to a client;
and under the condition that the first compression ratio is smaller than the second compression ratio, compressing the response content according to a variable dictionary, and sending the compressed response content and the variable dictionary to a client.
In a fifth aspect, an embodiment of the present invention further provides a client, including a processor, a memory, and a computer program stored on the memory and executable on the processor, where the computer program, when executed by the processor, implements the steps of the page compression method according to any one of the first aspect.
In a sixth aspect, an embodiment of the present invention further provides a server, including a processor, a memory, and a computer program stored on the memory and executable on the processor, where the computer program, when executed by the processor, implements the steps of the page compression method according to any one of the second aspects.
In a seventh aspect, the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the page compression method according to any one of the first aspect, or implements the steps of the page compression method according to any one of the second aspect.
According to the page compression method provided by the embodiment of the invention, the client can analyze the link request corresponding to the page request under the condition of acquiring the page request; compressing the link request when there is duplicate information in the link request; and sending the compressed link request to a server. Therefore, the client compresses the link request, so that the data size of the link request can be reduced, the bandwidth loss of the page request can be reduced, the network bandwidth resource is saved, and the processing efficiency of the client is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments of the present invention will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive exercise.
Fig. 1 is a flowchart of a page compression method according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating compression of a link request in the page compression method provided in FIG. 1;
FIG. 3 is a flowchart of another page compression method provided by an embodiment of the present invention;
FIG. 4 is a block diagram of a page compression apparatus according to an embodiment of the present invention;
fig. 5 is a block diagram of another page compression apparatus according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a flowchart of a page compression method according to an embodiment of the present invention, where the page compression method is applied to a client. As shown in fig. 1, the page compression method includes the following steps:
step 101, under the condition of acquiring a page request, analyzing a link request corresponding to the page request, and judging whether the link request includes repeated information.
It is understood that the obtaining of the page request by the client may refer to receiving an input operation by the user, for example, the user may select to open a certain web page in a browser of the client, or perform a search, and the like. The page request may be an html page request. In addition, the client in this embodiment may refer to a user terminal such as a mobile phone, a tablet computer, and a desktop computer.
Under the condition that the client acquires the page request, the client can acquire the resources or links required to be quoted by the page request and analyze whether the link request corresponding to the page request has repeated information.
The fact that the repeated information exists in the link requests means that the same request information exists in all the link requests corresponding to the page requests. It should be noted that, it is determined whether the link request includes duplicate information, that is, whether the request information corresponding to each link request has the same content. It can be understood that the request information, that is, a piece of text information, may refer to related technologies for how to determine whether the text information is the same, and this embodiment is not described in detail herein.
As shown in fig. 2, in the three link requests corresponding to the page request, the request information such as Method, Host, Accept, Cookie, and the like corresponding to each of request 1, request 2, and request 3 is the same, and this part of the same request information is the duplicate information.
And 102, compressing the link request under the condition that repeated information exists in the link request.
In this embodiment, when a page request is obtained, a link request referred by the page request is analyzed; the page request usually corresponds to a plurality of link requests, and one link request usually includes request information such as URL, Method, Host, Accept, Cookie, and the like.
It is understood that, in all the link requests corresponding to the page request, the request information corresponding to any two link requests is necessarily different, and of course, the same request information may exist.
In this embodiment, the step 102 includes:
under the condition that repeated information exists in the link request, obtaining a compressed sample in the link request, wherein the compressed sample is a link request which can realize the maximum compression ratio in the link request; determining other link requests except the compressed sample in the link requests as pending link requests, and removing request information which is repeated with the compressed sample in the pending link requests.
When analyzing that repeated information exists in a link request corresponding to a page request, a client acquires a compression sample in the link request, wherein the compression sample is the link request capable of realizing the maximum compression ratio in all the link requests.
Continuing with fig. 2 as an example, assuming that the link request corresponding to the page request includes request 1, request 2, and request 3, the client calculates compression ratios for request 1, request 2, and request 3 as compression samples respectively based on a preset algorithm. For example, in the case of taking request 1 as a compressed sample, the same request information as request 1 in requests 2 and 3 is removed, and the request information different from request 1 in requests 2 and 3 is retained, and the concatenated request includes all the request information of request 1 and the request information retained in requests 2 and 3, so that the compression ratio of the concatenated request compressed by taking request 1 as a compressed sample can be obtained.
If the maximum compression ratio capable of realizing the link request by taking the request 1 as the compression sample is calculated, the request 1 is determined as the compression sample, the same request information as the request 1 in the remaining requests 2 and 3 in the link request is removed, and the request information (shown in fig. 2) different from the request 1 in the requests 2 and 3 is reserved, so as to complete the compression of the link request.
In this embodiment, the same request information in the link request can be removed by compressing the link request, and the link request does not include repeated information, so that the data size of the link request is reduced, the bandwidth loss of the page request can be reduced, and the network bandwidth resource is saved.
And step 103, sending the compressed link request to a server.
It can be understood that, after compressing the link request corresponding to the page request, the client sends the compressed link request to the client.
As shown in fig. 2, the compressed request 1, request 2, and request 3 may be sent to the client, respectively, so as to obtain the response content fed back by the client after responding to the request 1, request 2, and request 3, respectively.
Alternatively, the step 103 may further include:
and combining the to-be-processed link request without the repeated request information and the compressed sample into a target link request, and sending the target link request to a server.
As shown in fig. 2, after compressing the link request corresponding to the page request, the client obtains a request 1 as a compressed sample, and a request 2 and a request 3 from which the duplicate information is removed, and the client may combine the request 1 and the request 2 and the request 3 from which the duplicate information is removed into a target link request, and then send the target link request to the server, and the client only needs to perform a sending operation once. Therefore, the client side avoids sending each compressed link request independently, the bandwidth loss of the client side for sending the page request is further reduced, and the network processing efficiency of the client side is improved.
In this embodiment of the present invention, after the step 103, the method may further include:
receiving response information returned by the server based on the compressed link request; and decompressing the response information to obtain response content.
It can be understood that, after receiving the compressed link request, the server decompresses the link request to restore the complete request information of the link request. The compressed link request includes a compressed sample and other requests from which duplicate information is removed, and the server may restore the duplicate information removed from the other requests by using the compressed sample as a restoration reference object and comparing differences between the other requests and the compressed sample, so as to complete decompression of the link request.
And after obtaining the complete request information of the link request, the server side responds to the request information to obtain response content responding to the page request. The server may compress the response content based on a general compression dictionary to obtain response information, and send the response information to the client. And the client decompresses the response information to further obtain response content. Therefore, data interaction between the client and the server based on the page request is completed.
According to the technical scheme provided by the embodiment of the invention, the client can analyze the link request corresponding to the page request under the condition of acquiring the page request; compressing the link request when there is duplicate information in the link request; and sending the compressed link request to a server. Therefore, the client compresses the link request, so that the data size of the link request can be reduced, the bandwidth loss of the page request can be reduced, the network bandwidth resource is saved, and the processing efficiency of the client is improved.
Referring to fig. 3, fig. 3 is a flowchart of a page compression method according to an embodiment of the present invention, where the page compression method is applied to a server. As shown in fig. 3, the page compression method includes the following steps:
step 301, receiving a compressed link request sent by a client.
The specific implementation manner of compressing the link request by the client may be implemented with reference to the steps in the embodiment shown in fig. 1, and in order to avoid repetition, details of the steps are not described in this embodiment of the present invention.
Step 302, decompressing the compressed link request to obtain the request information.
It can be understood that, after receiving the compressed link request sent by the client, the server decompresses the compressed link request, thereby restoring the complete request information of the link request. The compressed link request includes a compressed sample and other requests from which duplicate information is removed, and the server may restore the duplicate information removed from the other requests by using the compressed sample as a restoration reference object and comparing differences between the other requests and the compressed sample, so as to complete decompression of the link request.
Referring to fig. 2, the compressed link request includes a request 1 as a compressed sample, and a request 2 and a request 3 from which duplicate information is removed; by comparing with the compressed sample, it can be known which of the duplicate information removed in the request 2 and the request 3 is, so that the complete request information of the link request can be restored to complete the decompression of the compressed link request.
Step 303, obtaining response content responding to the request information, and sending the response content to the client.
It can be understood that, after obtaining the complete request information of the link request, the server responds to the request information to obtain the response content, and then sends the response content to the client. The server responds to the link request of the client to obtain the response content, which may refer to related technologies and is not specifically described in this embodiment.
According to the technical scheme provided by the embodiment of the invention, the server side receives the compressed link request sent by the client side; decompressing the compressed link request to obtain request information; and acquiring response content responding to the request information, and sending the response content to the client. Therefore, the link request received by the server is compressed by the client, so that the bandwidth loss can be reduced, and the network bandwidth resource can be saved.
In this embodiment of the present invention, the step 303 may further include: and compressing the response content and then sending the compressed response content to the client.
That is to say, after the server obtains the response content responding to the request information, the server can compress the response content, so as to reduce the bandwidth occupied by the server for returning the response content and optimize the network processing efficiency.
The compressing the response content and then sending the compressed response content to the client may specifically include:
predicting a first compression ratio of the response content after compression based on the general dictionary and a second compression ratio of the response content after compression based on the variable dictionary based on a preset algorithm;
under the condition that the first compression ratio is larger than the second compression ratio, compressing the response content according to a general dictionary, and sending the compressed response content to a client;
and under the condition that the first compression ratio is smaller than the second compression ratio, compressing the response content according to a variable dictionary, and sending the compressed response content and the variable dictionary to a client.
It can be understood that, after determining the response content that needs to be fed back to the client, the server can calculate the compression ratio of the response content based on a preset algorithm. Wherein the preset algorithm may be a repetition rate calculation algorithm. In the embodiment of the present invention, the compressing of the response content includes compressing based on a variable dictionary and compressing based on a general dictionary, and the compression rules corresponding to the variable dictionary and the general dictionary may specifically refer to related technologies, which is not described in detail in this embodiment.
And under the condition that the first compression ratio is larger than the second compression ratio, the fact that smaller data size can be obtained through compression by the general dictionary and the occupied bandwidth is lower is explained, the server side compresses the response content according to the general dictionary and sends the compressed response content to the client side. The client may be pre-stored with the general dictionary, or the general dictionary may be a common compression rule.
Under the condition that the first compression ratio is smaller than the second compression ratio, it is stated that smaller data size can be obtained by compressing through the variable dictionary, and the occupied bandwidth is lower, the server compresses the response content according to the variable dictionary, and sends the compressed response content and the variable dictionary to the client together, and then the client can decompress the compressed response content based on the received variable dictionary to obtain the decompressed response content.
Illustratively, the client may determine the decompression manner by determining whether the variable dictionary is received. It can be understood that if the client does not receive the variable dictionary, the compressed response content is decompressed based on the general dictionary, and if the client receives the variable dictionary, the compressed response content is decompressed based on the variable dictionary.
Therefore, by compressing the response content, the data size of the response content can be reduced, the bandwidth occupied by the server side for sending the response content can be further reduced, network bandwidth resources are saved, and the processing efficiency of the server side is improved.
Referring to fig. 4, fig. 4 is a structural diagram of a page compression apparatus according to an embodiment of the present invention, where the page compression apparatus is applied to a client. As shown in fig. 4, the page compression apparatus 400 includes:
the analysis module 401 is configured to, in a case that a page request is obtained, analyze a link request corresponding to the page request, and determine whether the link request includes repeated information;
a compressing module 402, configured to compress the link request if there is duplicate information in the link request;
a first sending module 403, configured to send the compressed link request to the server.
Optionally, the compression module 402 is further configured to:
under the condition that repeated information exists in the link request, obtaining a compressed sample in the link request, wherein the compressed sample is a link request which can realize the maximum compression ratio in the link request;
determining other link requests except the compressed sample in the link requests as pending link requests, and removing request information which is repeated with the compressed sample in the pending link requests.
Optionally, the first sending module 403 is further configured to:
and combining the to-be-processed link request without the repeated request information and the compressed sample into a target link request, and sending the target link request to a server.
Optionally, the page compression apparatus 400 further includes a first decompression module, configured to:
receiving response information returned by the server based on the compressed link request;
and decompressing the response information to obtain response content.
It should be noted that the page compression apparatus 400 can implement the processes of the page compression method embodiment described in fig. 1, and can achieve the same technical effects, and for avoiding repetition, the details are not described here again.
According to the technical scheme provided by this embodiment, the page compression apparatus 400 can analyze the link request corresponding to the page request when the page request is obtained; compressing the link request when there is duplicate information in the link request; and sending the compressed link request to a server. Therefore, the client compresses the link request, so that the data size of the link request can be reduced, the bandwidth loss of the page request can be reduced, the network bandwidth resource is saved, and the processing efficiency of the client is improved.
Referring to fig. 5, fig. 5 is a structural diagram of a page compression device according to an embodiment of the present invention, where the page compression device is applied to a server. As shown in fig. 5, the page compressing apparatus 500 includes:
a receiving module 501, configured to receive a compressed link request sent by a client;
a second decompressing module 502, configured to decompress the compressed link request to obtain request information;
a second sending module 503, configured to obtain response content in response to the request information, and send the response content to the client.
Optionally, the second sending module 503 is further configured to:
and compressing the response content and then sending the compressed response content to the client.
Optionally, the second sending module 503 is further configured to:
predicting a first compression ratio of the response content after compression based on the general dictionary and a second compression ratio of the response content after compression based on the variable dictionary based on a preset algorithm;
under the condition that the first compression ratio is larger than the second compression ratio, compressing the response content according to a general dictionary, and sending the compressed response content to a client;
and under the condition that the first compression ratio is smaller than the second compression ratio, compressing the response content according to a variable dictionary, and sending the compressed response content and the variable dictionary to a client.
It should be noted that the page compressing apparatus 500 can implement the processes of the page compressing method embodiment described in fig. 3 and achieve the same technical effects, and for avoiding repetition, the details are not repeated here
In the technical solution provided in this embodiment, the page compression apparatus 500 receives a compressed link request sent by a client; decompressing the compressed link request to obtain request information; and acquiring response content responding to the request information, and sending the response content to the client. Therefore, the link request received by the server is compressed by the client, so that the bandwidth loss can be reduced, and the network bandwidth resource can be saved.
Optionally, an embodiment of the present invention further provides a client, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor, where the computer program, when executed by the processor, implements each process of the embodiment of the page compression method shown in fig. 1, and can achieve the same technical effect, and details are not repeated here to avoid repetition.
Optionally, an embodiment of the present invention further provides a server, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor, where the computer program, when executed by the processor, implements each process of the embodiment of the page compression method illustrated in fig. 3, and can achieve the same technical effect, and details are not repeated here to avoid repetition.
An embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the page compression method embodiment shown in fig. 1 or can implement each process of the page compression method embodiment shown in fig. 3, and can achieve the same technical effect, and in order to avoid repetition, the computer program is not described herein again. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (16)

1. A page compression method is applied to a client side and is characterized by comprising the following steps:
under the condition of acquiring a page request, analyzing a link request corresponding to the page request, and judging whether the link request comprises repeated information or not;
compressing the link request when there is duplicate information in the link request;
and sending the compressed link request to a server.
2. The method according to claim 1, wherein compressing the link request in the presence of duplicate information in the link request comprises:
under the condition that repeated information exists in the link request, obtaining a compressed sample in the link request, wherein the compressed sample is a link request which can realize the maximum compression ratio in the link request;
determining other link requests except the compressed sample in the link requests as pending link requests, and removing request information which is repeated with the compressed sample in the pending link requests.
3. The method of claim 2, wherein sending the compressed link request to a server comprises:
and combining the to-be-processed link request without the repeated request information and the compressed sample into a target link request, and sending the target link request to a server.
4. The method of claim 1, wherein after sending the compressed link request to the server, the method further comprises:
receiving response information returned by the server based on the compressed link request;
and decompressing the response information to obtain response content.
5. A page compression method is applied to a server side and is characterized by comprising the following steps:
receiving a compressed link request sent by a client;
decompressing the compressed link request to obtain request information;
and acquiring response content responding to the request information, and sending the response content to the client.
6. The method of claim 5, wherein sending the response content to the client comprises:
and compressing the response content and then sending the compressed response content to the client.
7. The method of claim 6, wherein compressing the response content and sending the compressed response content to the client comprises:
predicting a first compression ratio of the response content after compression based on the general dictionary and a second compression ratio of the response content after compression based on the variable dictionary based on a preset algorithm;
under the condition that the first compression ratio is larger than the second compression ratio, compressing the response content according to a general dictionary, and sending the compressed response content to a client;
and under the condition that the first compression ratio is smaller than the second compression ratio, compressing the response content according to a variable dictionary, and sending the compressed response content and the variable dictionary to a client.
8. A page compression device applied to a client is characterized by comprising:
the analysis module is used for analyzing a link request corresponding to a page request under the condition of acquiring the page request and judging whether the link request comprises repeated information or not;
the compression module is used for compressing the link request under the condition that repeated information exists in the link request;
and the first sending module is used for sending the compressed link request to the server.
9. The apparatus of claim 8, wherein the compression module is further configured to:
under the condition that repeated information exists in the link request, obtaining a compressed sample in the link request, wherein the compressed sample is a link request which can realize the maximum compression ratio in the link request;
determining other link requests except the compressed sample in the link requests as pending link requests, and removing request information which is repeated with the compressed sample in the pending link requests.
10. The apparatus of claim 9, wherein the first sending module is further configured to:
and combining the to-be-processed link request without the repeated request information and the compressed sample into a target link request, and sending the target link request to a server.
11. The apparatus of claim 8, further comprising a first decompression module to:
receiving response information returned by the server based on the compressed link request;
and decompressing the response information to obtain response content.
12. A page compression device applied to a server side is characterized by comprising:
the receiving module is used for receiving the compressed link request sent by the client;
the second decompression module is used for decompressing the compressed link request to obtain request information;
and the second sending module is used for acquiring response content responding to the request information and sending the response content to the client.
13. The apparatus of claim 12, wherein the second sending module is further configured to:
and compressing the response content and then sending the compressed response content to the client.
14. The apparatus of claim 13, wherein the second sending module is further configured to:
predicting a first compression ratio of the response content after compression based on the general dictionary and a second compression ratio of the response content after compression based on the variable dictionary based on a preset algorithm;
under the condition that the first compression ratio is larger than the second compression ratio, compressing the response content according to a general dictionary, and sending the compressed response content to a client;
and under the condition that the first compression ratio is smaller than the second compression ratio, compressing the response content according to a variable dictionary, and sending the compressed response content and the variable dictionary to a client.
15. A client, comprising a processor, a memory and a computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing the steps of the page compression method as claimed in any one of claims 1 to 4.
16. A server comprising a processor, a memory and a computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing the steps of the page compression method according to any one of claims 5 to 7.
CN201911000890.5A 2019-10-21 2019-10-21 Page compression method, device, client and server Active CN112769730B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911000890.5A CN112769730B (en) 2019-10-21 2019-10-21 Page compression method, device, client and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911000890.5A CN112769730B (en) 2019-10-21 2019-10-21 Page compression method, device, client and server

Publications (2)

Publication Number Publication Date
CN112769730A true CN112769730A (en) 2021-05-07
CN112769730B CN112769730B (en) 2023-03-24

Family

ID=75691566

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911000890.5A Active CN112769730B (en) 2019-10-21 2019-10-21 Page compression method, device, client and server

Country Status (1)

Country Link
CN (1) CN112769730B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102184231A (en) * 2011-05-12 2011-09-14 广州市动景计算机科技有限公司 Method and device for acquiring page resources
US20110314091A1 (en) * 2010-06-22 2011-12-22 Guy Podjarny Method and system for automated analysis and transformation of web pages
CN102638580A (en) * 2012-03-30 2012-08-15 奇智软件(北京)有限公司 Webpage information processing method and webpage information processing device
CN103413335A (en) * 2013-07-23 2013-11-27 沈阳东软医疗系统有限公司 Method and device for data compression
CN108092956A (en) * 2017-12-01 2018-05-29 北京奇艺世纪科技有限公司 A kind of method and apparatus for obtaining compression dictionary

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110314091A1 (en) * 2010-06-22 2011-12-22 Guy Podjarny Method and system for automated analysis and transformation of web pages
CN102184231A (en) * 2011-05-12 2011-09-14 广州市动景计算机科技有限公司 Method and device for acquiring page resources
CN102638580A (en) * 2012-03-30 2012-08-15 奇智软件(北京)有限公司 Webpage information processing method and webpage information processing device
CN103413335A (en) * 2013-07-23 2013-11-27 沈阳东软医疗系统有限公司 Method and device for data compression
CN108092956A (en) * 2017-12-01 2018-05-29 北京奇艺世纪科技有限公司 A kind of method and apparatus for obtaining compression dictionary

Also Published As

Publication number Publication date
CN112769730B (en) 2023-03-24

Similar Documents

Publication Publication Date Title
EP3013015B1 (en) Packet compression method and apparatus
US7188214B1 (en) Efficient compression using differential caching
US8510368B2 (en) Short URI payload-status systems and methods
CN110535869B (en) Data transmission method based on compression algorithm, terminal equipment and storage medium
CN108092956B (en) Method and device for acquiring compression dictionary
CN109922049B (en) Verification device and method based on block chain
CN106534268B (en) Data sharing method and device
CN111352912A (en) Compressed file processing method, device, storage medium, terminal and server
US20130138770A1 (en) Apparatus and method for sharing web contents using inspector script
CN113411404A (en) File downloading method, device, server and storage medium
CN104811485A (en) Resource sharing method
CN108280228A (en) A kind of processing method and relevant device of webpage
CN113873013B (en) Offline package reorganization method and system
CN107766224B (en) Test method and test device
CN112769730B (en) Page compression method, device, client and server
CN113138969A (en) Data transmission method and device, electronic equipment and computer readable storage medium
CN101237301B (en) Dynamic data compression technology
CN113157480A (en) Error information processing method, device, storage medium and terminal
CN107318129B (en) Data processing method and device and terminal
CN111045934A (en) Page analysis method, device, client, storage medium and electronic equipment
CN110266814B (en) Transmission method and transmission device
US9626330B2 (en) Information processing apparatus, and information processing method
CN113746851A (en) Agent system and method for supporting real-time analysis of GRPC request
CN102088421A (en) Device and method for processing notification message
CN113204405A (en) Page data acquisition method, device, equipment and computer readable storage medium

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