The content of the invention
It is an object of the invention to provide a kind of generation method of super web page template, device and
Page data transmission method, can reduce the non-figure WEB page data for issuing, and accelerate resource
Downloading speed, improve page browsing response take.
In a first aspect, a kind of generation method of super web page template is the embodiment of the invention provides,
Including:
Multiple resource files in collection preset range;
Resource file two-by-two in the multiple resource file carries out similarity computing, works as number
According to it is identical when by the one of rejecting in two resource files, if when data are similar two
One of resource file in individual resource file has included the whole of another resource file
Or most contents, this is rejected by the resource file comprising all or most content;
The resource file that will be remained is merged, and generates super web page template.
Preferably, the resource file is WEB page data resource file;The default model
Enclose including:Default WEB websites, the path of default WEB websites or default resource keyword.
Preferably, it is described to the multiple resource file in resource file two-by-two carry out it is similar
Degree computing includes:
The size that the multiple resource files for gathering include data volume according to it is carried out into interval
Packet, multiple resource files of the data volume in certain interval are divided into one group;
Similarity computing is carried out to the resource file two-by-two in the multiple resource files in every group.
Preferably, the resource file that will be remained merge including:
One group of maximum resource file for being remained of interval value is merged, generation is faced
When web page template;
By the temporary homepage template respectively with other every group of resource files for being remained
Similarity computing is carried out, when data and the temporary homepage template of the resource file in one of which
Data it is same or similar when reject the resource file, the resource file is otherwise merged into institute
In stating temporary homepage template, and continue in the same manner and the next group of money for being remained
Source file carries out similarity computing, and the temporary homepage template for ultimately generating is super web page template.
Preferably, the multiple resource files in the collection preset range, including:By pre-
If the lower threshold of resource file size filters out small resource file.
Preferably, Different Strategies are carried out according to different situations to the resource file for remaining
Stage casing interception retains, and gets rid of head and the tail data.
Preferably, the super web page template for generating is split line by line;
The multirow resource data that will be split out is contrasted two-by-two successively from front to back, works as data
By the one of rejecting in two row resource datas when identical, if two row when data are similar
One of row resource data in resource data contains the complete of another row resource data
Portion or most contents, by this by the row resource data comprising all or most content
Reject, ultimately generate the super web page template simplified.
Preferably, also include:The big row of data volume in the super web page template that generation is simplified
Resource data is split as multiple block number evidences;
To will be provided with other rows per block number according to similarity computing is carried out with other row resource datas
The same or analogous block number of source data is according to rejecting.
Second aspect, the embodiment of the present invention also provides a kind of page data transmission method, including:
Obtain the current non-figure WEB resource datas of the page of client's request;
With pre-building with the super web page template corresponding to the page to the non-figure
WEB resource datas carry out residual quantity computing, obtain differential data;Wherein, described super net
Page template is generated according to above-mentioned super web page template generation method;
The differential data is sent to client.
The third aspect, the embodiment of the present invention also provides a kind of generating means of super web page template,
Including:
Acquisition module, for gathering the multiple resource files in preset range;
Similarity identification and module is rejected, for the money two-by-two in the multiple resource file
Source file carries out similarity computing, identifies same or analogous two resource files of data,
When data are identical by the one of rejecting in two resource files, when data are similar such as
Really the one of resource file in two resource files has included another resource file
All or most content, by this by the resource file comprising all or most content
Reject;
Template generation module, the resource file for that will remain is merged, and generation is super
Level web page template.
Preferably, wherein, the resource file be WEB page data resource file;It is described
Preset range includes:Default WEB websites, the path of default WEB websites or default resource
Keyword.
Preferably, the similarity identification and rejecting module also include:
Interval packet submodule, for first being included the multiple resource files for gathering according to it
The size of data volume carries out interval packet, multiple resource files of the data volume in certain interval
It is divided into one group;
Similarity identification submodule, for the money two-by-two in the multiple resource files in every group
Source file carries out similarity computing and identification.
Preferably, the template generation module includes:
Merge submodule:For the resource for remaining of this maximum group of interval value is literary
Part is merged, and generates temporary homepage template;
Similarity computing and generation submodule, for by the temporary homepage template respectively with other
Every group of resource file for being remained carries out similarity computing, when the resource in one of which
The data of file reject the resource file when same or similar with the data of temporary homepage template,
Otherwise the resource file is merged into the temporary homepage template, and in the same manner after
Continuous to carry out similarity computing with the next group of resource file for being remained, what is ultimately generated faces
When web page template be super web page template.
Preferably, the multiple resource files in the collection preset range, including:By pre-
If the lower threshold of resource file size filters out small resource file.
Preferably, also include:Stage casing intercepts reservation module, for the resource to remaining
File is intercepted according to the stage casing that different situations carry out Different Strategies and retained, and gets rid of head and the tail data.
Preferably, also include:
Row resource splits and generation module, for the super web page template for generating to be carried out line by line
Split, the multirow resource data that will be split out is contrasted two-by-two successively from front to back, works as number
According to it is identical when by the one of rejecting in two row resource datas, if when data are similar two
One of row resource data in row resource data contains another row resource data
All or most content, by this by the row number of resources comprising all or most content
According to rejecting, the super web page template simplified is ultimately generated.
Preferably, also include:
Block number will generate data volume in the super web page template simplified according to splitting and rejecting module
Big row resource data is split as multiple block number evidences, will per block number according to and other row resource datas
Similarity computing is carried out, will be with other same or analogous block numbers of row resource data according to rejecting.
The generation method of the super web page template that the embodiment of the present invention is provided, device and the page
Data transmission method, by gathering multiple resource files within a preset range, and to collecting
Multiple resource files in resource file two-by-two carry out similarity computing, when data are identical
By the one of rejecting in two resource files, if two resource texts when data are similar
One of resource file in part has included the whole of another resource file or big portion
Divide content, this is rejected by the resource file comprising all or most content, while also
Remain with differed with other data or dissmilarity data, final remaining data
As super web page template, when server issues non-figure WEB resource datas, can be by
The non-figure WEB resource datas of related pages carry out residual quantity computing with the super web page template, obtain
Non- figure WEB resource datas different from the data in super web page template, and by these
Different non-figure WEB resource datas are sent to client.The non-figure for issuing can so be reduced
The data volume of WEB resources, accelerates the downloading speed of resource, improves the response consumption of page browsing
When.Client only needs to the shorter data receipt time of consumption and receives the non-figure WEB moneys in this part
Source data, so as to accelerate the response speed of server, improves customer perception.
It is cited below particularly to enable the above objects, features and advantages of the present invention to become apparent
Preferred embodiment, and coordinate appended accompanying drawing, it is described in detail below.
Specific embodiment
Below in conjunction with the embodiment of the present invention and accompanying drawing, to the technical side in the embodiment of the present invention
Case is clearly and completely described, and described embodiment is only a real part of the invention
Example is applied, rather than whole embodiments.This hair generally described and illustrated in accompanying drawing herein
The component of bright embodiment can be arranged and designed with a variety of configurations.Therefore, below
The detailed description of the embodiments of the invention to providing in the accompanying drawings is not intended to limit requirement
The scope of the present invention of protection, but it is merely representative of selected embodiment of the invention.
Below in conjunction with the drawings and specific embodiments of the invention, to technical scheme
It is clearly and completely described.
Fig. 1 is a kind of flow of the generation method of super web page template provided by the present invention
Figure.It is shown in Figure 1, the generation side of the super web page template that the embodiment of the present invention is provided
Method includes:
S101:Multiple resource files in collection preset range.
Wherein, the resource file is page data resource file;The preset range includes:
Default WEB websites, the path of default WEB websites or default resource keyword.
When implementing, for certain specific WEB website, its
Javascript resources and CSS resources are quoted with outreaching mode in the page, its purpose
Be can on these resource multiplexes to the page that path is identical or path is different so that
Same or similar interactive function is provided on the different pages, and it is same or similar
Layout.In this case, based on the WEB websites, these different pages
Between Javascript resources and between CSS resources, can all there is identical number in its content
According to or set of metadata of similar data.By taking Javascript resources as an example, can in different resource contents
Some identical function modules can be included.In other words, these Javascript resources exist
In similar resource tool similitude, i.e. preset range on spatial extent (particular station)
Resource file be on spatial extent have polymerism.Although what the website can be over time pushes away
Move and update Javascript resources and CSS resources, but as long as not being great correcting,
Still a part of old resource can be included in new Javascript resources and CSS resources
Content.For example, although some Javascript resources have updated, but for wherein including
A little core function modules keep constant, i.e., these Javascript resources are on time dimension
Similar resource also have similitude.Resource file i.e. in the preset range is in time dimension
It is upper that there is convergence.
In addition, the website different for some, although their business emphasis is different, but
The need for due to front end interactive function or page layout, same front end may be selected
Javascript storehouses or CSS storehouses.Such as, a series of Javascript storehouses of jquery
/ CSS storehouses, are just widely currently used by many sites, the non-figure WEB of the page in these websites
Resource should just have set of metadata of similar data.This illustrates in this given a collection of website, is based on
In title with same keyword non-figure web resource set in, exist content it is identical or
The close resource of person.Although the common trait of this class similar resource be respective domain name it is different but
Resource name carries same keyword.
And the preset range described in the present invention, it is as above-mentioned described in Javascript moneys
The similar resource of source and CSS resources on time range and on spatial extent is respectively provided with phase
Some of website, website like property path, or in multiple different websites, select
Same front end Javascript storehouses or CSS storehouses, same money is carried in title
The non-figure WEB set of source keyword.
When the resource file in preset range is gathered, the resource file is non-figure WEB
Resource file.Generally, due to non-figure WEB resource files are generally comprised:Javascript
Resource and CSS resources, and both resources belong to two kinds of different files in the application,
Therefore can be by the way of gathering respectively.When collection, can pre-set collection model
Enclose, then from the acquisition range delimited, carry out the time and the page to be collected is random
Multi collect.For example, for the multiple pages in a certain WEB websites, every a timing
Between just gather once.And in order to ensure that it is stronger that the super web page template for finally being generated has
Continuity, can be a cycle for collection by the process setting of collection.This cycle can be with
Specifically set according to actual conditions.
In addition, it should be noted that gather preset range in multiple resource files when
Wait, specifically also include:Petty bourgeoisie is filtered out by presetting the lower threshold of resource file size
Source file.
When implementing, due to the size of different resource files, (i.e. byte is big
It is small) all it is different.And because resource file is directly to be gathered from preset range,
Therefore according to actual preset range, the size spans of different resource files may compare
It is larger, and the less resource files of some size may be relatively more, cause resource file
In long-tail resource it is excessive.Using resource file as the basic operation list in similarity computing
First (resource file two-by-two in i.e. to multiple resource files carries out similarity computing), then
The super web page template for finally being obtained can be caused can be unfavorable for actual application than larger.
And long-tail resource is too small due to its size, meaning is not very big in adding super web page template.
Thus, in order to ensure super web page template size within limits, can to money
The size of source file is screened.Before screening, a threshold for resource size can be preset
Value.The threshold value of the resource size can typically set a lower limit.Only when resource file
When size is more than the lower threshold of the resource size, subsequent arithmetic can be just selected into
Process.And set the lower threshold of resource size, can effectively reduce some size compared with
Small long-tail resource, reduces the size of super web page template.Meanwhile, implement the filtering policy,
Resource of the super web page template of generation when in use to using carries out same limitation, i.e.,
Size too small resource file during client is issued to from server, be not required to through
Cross and the residual quantity computing between super web page template, directly after compression algorithm is compressed, hair
Give client.
It should be noted that the step of resource file is filtered is optional step, in reality
In the application process on border, the filtration step can be implemented to resource file, it is also possible to direct handle
All resource files for collecting carry out the treatment in S102.
S102:Resource file two-by-two in the multiple resource file carries out similarity computing,
When data are identical by the one of rejecting in two resource files, when data are similar such as
Really the one of resource file in two resource files has included another resource file
All or most content, by this by the resource file comprising all or most content
Reject.For example, the one of resource file in two resource files has included another
The content more than half of individual resource file, at this moment, can select by it is above-mentioned contained it is super
The resource file for crossing the content of half is rejected.From another point of view for example, two resource texts
The contrast of the content of part, can be comprising at least one of following several dimensions:Data volume
Contrast, the contrast of valuable information classification not easily passs through the information content of downloading acquisition again
Contrast etc..
When implementing, it is usually using existing that similarity computing is carried out to resource file
Some residual quantity algorithms, such as xdelta3, open-vcdiff scheduling algorithms storehouse is calculated.
Usually, in residual quantity algorithm, for source file (source) A for giving, for depositing
It is certain continuous data m in A, is retrieved in the content of template (template) B
Go out the data block m ' for matching, generation offset commands (data volume of offset commands seldom and
It is fixed, only include offset address value and data length);And for that can not be retrieved in B
Go out the m of matched data, if its content is the repeated data of single character data, such as
" CCCCCCCC ", then generate repetitive instruction (data volume of repetitive instruction is less and fixed,
Its content ratio deviation instructs how limited fixed byte), if its content is not repeated,
(data volume of duplicate instructions may be larger, based on data block m's itself for generation duplicate instructions
Length).These instructions are finally carried out sequential organization and differential data is generated.
Usually, based on the similar resource set in some given preset range, to multiple
Resource file two-by-two in resource file carries out similarity computing, when data are identical by two
One of rejecting in resource file, if when data are similar in two resource files
One of resource file has included all or most content of another resource file,
This is rejected by the resource file comprising all or most content;The money that will be remained
Source file is merged, and ultimately generates a big data file, and the data file is exactly most
The super web page template for being generated eventually.During this calculating, the resource text for collecting
Part can constitute a computing collection resource file data, the similar resource set in the preset range,
Referred to as " computing collection resource ".In the file data of the computing collection resource, contain all
All data in the resource file for collecting.Transported in the similarity two-by-two for carrying out resource file
In calculation, also computing is carried out both for the computing collection resource file data.
The process of the identical data and set of metadata of similar data in resource file is rejected, is actually by institute
The data for having composition repetition in resource data (i.e. resource file) are rejected.For example, certain
In the file data of computing collection resource, contain a, b, c, d, a ', b ', e, f
Eight resource files, wherein, a and a ' is same or similar resource file, b and b '
It is same or similar resource file, during similarity computing is carried out, by difference
Amount computing, can obtain a and a ', b and b of same or similar data ', then
It is necessary to be wrapped in rejecting a and a ' during identical data and set of metadata of similar data is rejected
That for containing, such as a contain the wholly or largely content of a ', reject a ', reject
In b and b ' by comprising that, such as b contains the wholly or largely content of b ',
Reject b ', then should just include in the super web page template obtained by final computing:a、
b、c、d、e、f。
In addition, it should be noted that the resource file two-by-two in resource file carry out it is similar
Degree computing, is exactly, using each resource file as computing elementary cell, to carry out similarity
It is to carry out the residual quantity computing between resource file and resource file during computing.If
Data in two resource files it is identical (now, in the result of residual quantity computing, should
When being to have only included offset commands), then the two resource file contents are identical.If two
Data division in individual resource file is identical, and identical data division occupies one of them
On the default threshold value of resource file, for example, more than the 95% of the resource file is occupied, then
Think that two resource files are similar resource.If the data in two resource files are completely not
Together, or only small part is identical, and identical part occupies in two resource files
It is under default threshold value, such as equal less than 95% in two resource files, then it is assumed that two moneys
Source file is different resource file.
It should be noted that above-mentioned default threshold value can be to carry out according to the actual needs
Specific setting.Usually, it is if to be tightened up to the condition rejected, i.e., strict to reject bar
Part, then increase the default threshold value.It is if to loosen to the condition rejected, this is pre-
If threshold value reduction.
During above-mentioned similarity computing, calculated using residual quantity algorithm,
The result that the differential data for being obtained as residual quantity is calculated.During this computing, most
The difference of the result that basic arithmetic element can be calculated according to residual quantity, obtains be referred to as winning respectively
Person, loser and/or neutral Resource Role (here why use and/or, be due to
Each basic arithmetic element, in different residual quantity computings, its Resource Role is probably not
With).
Wherein, if two resources (most basic arithmetic element) of similarity computing will be carried out
It is referred to as first resource and Secondary resource.If the content phase of first resource and Secondary resource
Together, then first resource and Secondary resource are identical data;If first resource contains second
The full content of resource, or first resource contains the content of Secondary resource beyond default
Threshold value, then first resource and Secondary resource are set of metadata of similar data;First resource is victor, the
Two resources are loser.
If first resource and other resources neither identical data and be not set of metadata of similar data,
Data i.e. in first resource and Secondary resource are entirely different, or first resource and the second money
It is identical that source only has part, and identical part occupies pre- in first resource and Secondary resource
If threshold value below, then first resource be neutral.
Usually, in residual quantity algorithm, source file data are carried out into residual quantity based on template data
Computing, the differential data size for drawing claims divided by percentage obtained from source file size of data
It is delta rates.In the present invention, if using first resource as template data, second provides
Source is first resource and Secondary resource part phase as source file data, i.e. the delta rates
Meanwhile, the part (data after residual quantity computing) that differs is occupied in Secondary resource to be arrived
Percentage.Vice versa, if using Secondary resource as template data, first resource is made
Be source file data, i.e., the delta rates be first resource it is identical with Secondary resource part when,
The part (data after residual quantity computing) for differing occupied percentage for arriving in first resource
Than.And judge two resources whether be similar resource or two data whether set of metadata of similar data
When, it is based on the size of delta rates.It is default to have one with the delta rates
Cause property.
It should be noted that the first resource and second when carrying out residual quantity computing in the present invention
Resource, using bigger one of wherein data as template data, and by less one of data
As source data.And if the size of data of first resource and Secondary resource is equal, then can be with
Will wherein any one as template data, using another as source data.
S103:The resource file that will be remained is merged, and generates super web page template.
The generation method of the super web page template that the embodiment of the present invention is provided, by default
In the range of gather multiple resource files, and to the money two-by-two in multiple resource files for collecting
Source file carries out similarity computing, when data are identical by wherein in two resource files
Individual rejecting, if the one of resource bundle when data are similar in two resource files
Contained all or most content of another resource file, by this by comprising all or
The resource file of most contents is rejected, while also remain with being differed with other data
Or the data of dissmilarity, final remaining data are used as super web page template.In service
When device issues non-figure WEB resource datas, can be by the non-figure WEB number of resources of related pages
Residual quantity computing is carried out according to the super web page template, is obtained and the data in super web page template
Different non-figure WEB resource datas, and these different non-figure WEB resource datas are sent out
Give client.The data volume of the non-figure WEB resources for issuing can be so reduced, accelerates resource
Downloading speed, improve page browsing response take.Client only needs to consume shorter
Data receipt time receives the non-figure WEB resource datas in this part, so as to accelerate server
Response speed, improves customer perception.
In the above-described embodiment, in order that the super web page template for obtaining can reach more preferably
Using effect, the resource file that will can also be remained carries out more fine-grained similarity number
According to merging, super web page template is generated.Will be made below detailed description.
Shown in Figure 2, the embodiment of the present invention also provides a kind of super web page template generation side
In method, it has done optimization processing to above-mentioned steps S102 and S103.
Specifically, to the multiple resource file in resource file two-by-two carry out similarity
The method of computing is specifically included:
S201:The multiple described resource file for gathering is included the size of data volume according to it
Interval packet is carried out, multiple resource files of the data volume in certain interval are divided into one group.
When implementing, due to same or similar resource file, its size is led to
Be also often close, be typically not in the less resource contents of size contain size compared with
Most of set of metadata of similar data of big resource content.Therefore, it is possible to by resource file according to default
Resource file siz intervals be grouped, be according to resource file institute when packet
Comprising the size of data volume carry out.By packet, it is follow-up poor two-by-two effectively to reduce
The number of times of computing is measured, accelerates arithmetic speed when super web page template is generated.For example, according to
Following resource file siz intervals are grouped to resource file:(204800,
1024000000,),(102400,204800,),(51200,102400),(10240,
51200),(1024,10240),(0,1024).That is, by size in 0 byte -1024
Resource file in bytes range is divided into one group, by size in the word of 1024 byte -10240
Resource file in adjusting range is divided into one group ... ..., by size in 204800 bytes
Resource file in -1024000000 bytes ranges is divided into one group.Generally, every
In one group, include at least one resource file.And distinguishingly, in some packets, can
Resource file can not included.In this example embodiment, during packet and it is not provided with resource size threshold value
Lower limit.If there is provided the lower limit of resource size threshold value, the minimum packet of size
Minimum byte-sized should be the resource size threshold value lower limit.For example when the default money
When source size threshold value is 1024 byte, the packet can be:(204800,
1024000000),(102400,204800),(51200,102400),(10240,
51200),(1024,10240)。
S202:Similarity is carried out to the resource file two-by-two in the multiple resource files in every group
Computing.
When implementing, the resource file to be directed in each group carries out two in group
Two residual quantity computings.And especially, if only including a resource file in certain packet, that
Directly retain the resource file.If in certain packet and not comprising resource file, then
Directly the packet is rejected.
In addition, when the multiple resource files in every group carry out residual quantity computing two-by-two,
There can be following several ways:
1st, according to resource file tissue sequentially, from front to back, every time read two resources
File carries out residual quantity computing.
For example:In certain packet, six resource texts of A, B, C, D, E, F are contained
Part, then carrying out the order of residual quantity computing can be:
1. A and B, is carried out into residual quantity computing;
If 2., A and B are same or similar resource files, and data volume is smaller
Resource file reject, and remaining resource file and C are carried out into residual quantity computing;
If 3., two not only non-equal but also non-similar in A and B, then by two resource texts
Part retains, and two resource files then are carried out into residual quantity computing ... with C respectively;
Until the resource file that final all of resource file is retained with others
Untill carrying out residual quantity computing two-by-two.
2nd, according to resource file tissue sequentially, from front to back, order read two resources
File carries out residual quantity computing, what the resource file that will be remained was retained with other again
Resource file carries out residual quantity computing.
For example:In certain packet, six resource texts of A, B, C, D, E, F are contained
Part, then carrying out the order of residual quantity computing can be:
1. A and B, is carried out into residual quantity computing, C and D is carried out into residual quantity computing, by E and
F carries out residual quantity computing;
If 2., the computing of above three residual quantity eliminates the less identical money of data volume
Source or similar resource, then difference two-by-two will be again carried out between remaining three resource files
Amount computing, smaller that of data volume in rejecting all of same asset or similar resource
One;And if not rejecting an any resource file in above three residual quantity computing,
The resource file that the resource file that so will just remain is remained with other respectively enters
Row residual quantity computing two-by-two, it is all of same or analogous in residual quantity computing until eliminating
In two resource files untill that small resource of data volume.
The processing mode carried out after similarity computing is same as described above, when data are identical
By the one of rejecting in two resource files, if two resource texts when data are similar
One of resource file in part has included the whole of another resource file or big portion
Divide content, this is rejected by the resource file comprising all or most content.
S203:The resource file for remaining of this maximum group of interval value is merged,
Generation temporary homepage template.
S204:By the temporary homepage template respectively with other every group of resources for being remained
File carries out similarity computing, when the data and temporary homepage of the resource file in one of which
The resource file is rejected when the data of template are same or similar, otherwise merges the resource file
To in the temporary homepage template, and continue to be remained with next group in the same manner
Resource file carry out similarity computing, the temporary homepage template for ultimately generating be super webpage
Template.
When implementing, due to when residual quantity computing, usually, it is necessary to
Two participation residual quantity computing resources in, size larger resource as template data, and
The less resources of another size are carried out into residual quantity computing as source data, if both are
Same or similar resource, then just reject source data.Thus between carry out group two-by-two
In residual quantity computing, will first can organize in the multi-group data file that is generated after residual quantity computing two-by-two
In, group based on the interval maximum groups of size, the resource file for being retained is closed
And, generate temporary homepage template;Resource file in group that will be size interval maximum is made
It is template data.It should be noted that in base set, a temporary homepage only can be generated
Template, the temporary homepage template contains the institute in the base set (the maximum group of interval value)
There are different resource files.
And the resource file in all of comparative group is made others group as comparative group
It is source data.Resource file will carry out residual quantity computing two-by-two in each comparative group, using above
The elimination method of description rejects loser's resource file, the resource that will retain in each comparative group
File and temporary homepage template carry out the residual quantity computing between group.During residual quantity computing,
If the data in comparative group wherein certain resource file and temporary homepage template are identical numbers
According to or set of metadata of similar data, then by the resource file reject.If it is not, then the resource is literary
Part is merged into the temporary homepage template of base set, generates new temporary homepage template.
In a preferred embodiment, the resource file for remaining is entered according to different situations
The stage casing interception of row Different Strategies retains, and gets rid of head and the tail data.
When implementing, stage casing interception strategy is concentrated on based on critical data majority
Resource file stage casing it is assumed that having by removing the head and the tail data of each resource file
Effect reduces the size of super web page template.When concrete operations, based on above-mentioned S204
The super web page template for being exported, according to difference of the resource file in the super web page template
Situation (i.e. according to the Resource Role that resource file is different in super web page template), can adopt
Intercepted with the stage casing of Different Strategies and retained.For example, for neutral, its stage casing interception strategy
Can be relatively radical, you can only to intercept less Mid-Section Data, the more numbers of removal head and the tail
According to;And for victor, due to containing more other resource files in victor (i.e.
The resource file being removed) set of metadata of similar data, therefore interception strategy in its stage casing relative can protect
Keep, that is, the Mid-Section Data for needing interception more.Different Resource Roles, corresponding resource
The occupied percentage in the resource file of the data being intercepted in file is different.I.e.
For different Resource Roles, different data areas can be set to carry out resource file
Stage casing intercepts.
For example, when the data area in a kind of interception to stage casing carries out default, this is matched somebody with somebody
Parameter is put to be specially:
FILE_DEFEATER:[(1024000,0.4),(512000,0.5),(409600,
0.6),(307200,0.7),(204800,0.8),(102400,0.9),],
FILE_NEUTRALIER:[(1024000,0.1),(512000,0.1),
(307200,0.15),(204800,0.3),(102400,0.6),]
Each numerical value pair, first parameter is the lower limit to resource file size,
Second parameter represents a percentage in document retaining stage casing.For example, for victor's
When resource file carries out stage casing interception, if its size is in 204800 to 307200 words
Between section, then the data of file first section 10% and rear 10% are rejected, only retain stage casing 80%
Data.It can be seen that, in the configuration parameter of example, stage casing interception (reservation) of victor
Ratio is guarded relatively than neutral, and its reason is to contain other in victor's resource file
Most of Similar content of resource file is rejected, therefore has needed to retain more data;And in
Vertical person only retains due to not having obvious similitude with other resource files outside it
Less data.
In a preferred embodiment, can be reached preferably in order that obtaining super web page template
Using effect, invention also contemplates that being carried out to the row resource data of super web page template similar
Degree computing, when data are identical by the one of rejecting in two row resource datas, works as data
If one of row resource data when similar in two row resource datas contains another
The all or most content of row resource data, by this by comprising in all or most
The row resource data of appearance is rejected, and ultimately generates a super web page template simplified, the method
Specifically include:
The super web page template for generating is split line by line;
The multirow resource data that will be split out is contrasted two-by-two successively from front to back, works as data
By the one of rejecting in two row resource datas when identical, if two row when data are similar
One of row resource data in resource data contains the complete of another row resource data
Portion or most contents, by this by the row resource data comprising all or most content
Reject, ultimately generate the super web page template simplified.
Usually, in the tissue of Javascript resource contents, substantially have followed every
Individual function module is write with behavior unit, and space is reduced as far as possible between data in row,
Purpose is to reduce resource size.Therefore in each row data in general, at least
Include a function module.And for CSS resources, it may have it is same with row granularity group
The characteristic of organization data.Based on logic between related Javascript resources or CSS resources
The principle of principle or data-reusing is taken, phase is there may be in individual different similar resource
Same or similar row data (are may included in such as two Javascript row resources
The row data of same function module).
Usually, when the resource data of every two row is contrasted two-by-two, typically make
With the method for residual quantity computing.
In comparison process, if two row data are identical (now, in residual quantity computing
In result, it may be that only included offset commands), then claim two row data contents identical.
If the data division in two row data is identical, and identical part occupies one of them
On the default threshold value of row data, for example, occupy more than the 95% of the row data, then it is assumed that
Two row data are set of metadata of similar data.If the data in two row data are entirely different, or
Only part is identical, and identical part occupied in two row data default threshold value it
Under, such as it is equal less than 95% in two row data, then it is assumed that two row data contents are different.
It should be noted that above-mentioned default threshold value equally can be according to the actual needs
Carry out specific setting.The principle of setting and the above-mentioned Similarity Measure based on file granularity
It is similar, will not be repeated here.
By super web page template file declustering into after multiple row data files, according to line number
According to file organization sequentially, by row data file with carry out residual quantity computing two-by-two from front to back.
This two-by-two residual quantity computing carry out residual quantity two-by-two with above-mentioned multiple resource files by each group
The method of computing is similar to, therefore repeats no more.Result according to residual quantity computing judges two rows
Whether data source file is same asset.If same asset, then mistake therein is rejected
The vanquished, and remaining resource data as the super webpage simplified will be rejected after loser
Template.
In a further advantageous embodiment, can be reached more preferably in order that obtaining super web page template
Using effect, invention also contemplates that the super web page template to simplifying carry out based on block grain
The residual quantity operation method of degree, the method is specifically included:
The big row resource data of data volume is split as in the super web page template that generation is simplified
Multiple block number evidences;
To will be provided with other rows per block number according to similarity computing is carried out with other row resource datas
The same or analogous block number of source data is according to rejecting.
Specifically, exactly the big row data of data volume are further refined.According to regulation word
Row more long is cut into multiple block number evidences by joint number, and the size of block number evidence can be according to reality
Needs are specifically set, and partial block data therein are possible to and other row resource data phases
It is same or similar, will be with other same or analogous block numbers of row resource data according to rejecting.To simplifying
Super web page template carry out the similarity computing based on block granularity and can effectively reject phase
Likelihood data, further reduces the data volume in super web page template.
Any of the above preferred embodiment can carry out independent assortment, to realize to generate most preferably
Super web page template.
The embodiment of the present invention also provides a kind of super web page template generating means, referring to Fig. 3 institutes
Show, the super web page template generating means that the embodiment of the present invention is provided include:
Acquisition module, for gathering the multiple resource files in preset range;
Similarity identification and module is rejected, for the money two-by-two in the multiple resource file
Source file carries out similarity computing, identifies same or analogous two resource files of data,
When data are identical by the one of rejecting in two resource files, when data are similar such as
Really the one of resource file in two resource files has included another resource file
All or most content, by this by the resource file comprising all or most content
Reject;
Template generation module, the resource file for that will remain is merged, and generation is super
Level web page template.
Wherein, the resource file is WEB page data resource file;The preset range
Including:Default WEB websites, the path of default WEB websites or default resource keyword.
In a preferred embodiment, the similarity identification and rejecting module also include:
Interval packet submodule, for first being included the multiple resource files for gathering according to it
The size of data volume carries out interval packet, multiple resource files of the data volume in certain interval
It is divided into one group;
Similarity identification submodule, for the money two-by-two in the multiple resource files in every group
Source file carries out similarity computing and identification.
In a preferred embodiment, the template generation module includes:
Merge submodule:For the resource for remaining of this maximum group of interval value is literary
Part is merged, and generates temporary homepage template;
Similarity computing and generation submodule, for by the temporary homepage template respectively with other
Every group of resource file for being remained carries out similarity computing, when the resource in one of which
The data of file reject the resource file when same or similar with the data of temporary homepage template,
Otherwise the resource file is merged into the temporary homepage template, and in the same manner after
Continuous to carry out similarity computing with the next group of resource file for being remained, what is ultimately generated faces
When web page template be super web page template.
In a preferred embodiment, the multiple resource files in the collection preset range,
Including:Small resource file is filtered out by presetting the lower threshold of resource file size.
In a preferred embodiment, also include:Stage casing intercepts reservation module, for protecting
The resource file for staying is intercepted according to the stage casing that different situations carry out Different Strategies and retained, and is gone
Remove head and the tail data.
In a preferred embodiment, also include:
Row resource splits and generation module, for the super web page template for generating to be carried out line by line
Split, the multirow resource data that will be split out is contrasted two-by-two successively from front to back, works as number
According to it is identical when by the one of rejecting in two row resource datas, if when data are similar two
One of row resource data in row resource data contains another row resource data
All or most content, by this by the row number of resources comprising all or most content
According to rejecting, the super web page template simplified is ultimately generated.
In a preferred embodiment, also include:
Block number will generate data volume in the super web page template simplified according to splitting and rejecting module
Big row resource data is split as multiple block number evidences, will per block number according to and other row resource datas
Similarity computing is carried out, will be with other same or analogous block numbers of row resource data according to rejecting.
In the present embodiment, the concrete function and interactive mode of each functional module, reference can be made to figure
The record of 1 and 2 corresponding embodiments, will not be repeated here.
The super web page template generating means that the embodiment of the present invention is provided, its advantage is:
Resource file is gathered by acquisition module within a preset range, and by similarity identification and is picked
Except module carries out similarity computing to the resource file two-by-two in the resource file that collects, know
Do not go out same or analogous two resource files of data, when data are identical by two resource texts
One of rejecting in part, if when data are similar in two resource files wherein one
Individual resource file has included all or most content of another resource file, by the quilt
Resource file comprising all or most content is rejected, while also remaining with and others
Data differ or dissmilarity data, final remaining data are used as super webpage
Template, when server issues non-figure WEB resource datas, can be by the non-of related pages
Figure WEB resource datas carry out residual quantity computing with the super web page template, obtain and super webpage
The different non-figure WEB resource datas of data in template, and by these different non-figures
WEB resource datas are sent to client.When client only needs to consume shorter data receiver
Between receive the non-figure WEB resource datas in this part, so as to accelerate the response speed of server,
Improve customer perception.
In addition, the embodiment of the present invention also provides a kind of page data transmission method, referring to Fig. 4
Shown, the method includes:
S301:Obtain the current non-figure WEB resource datas of the page of client's request;
S302:With pre-building super web page template corresponding with the page to described non-
Figure WEB resource datas carry out residual quantity computing, obtain differential data;Wherein, it is described super
Web page template is according to above-described embodiment or its super web page template generation method for combining life
Into;
S303:The differential data is sent to client.
The page data transmission method that the embodiment of the present invention is provided, by above-described embodiment
The super web page template generation method for being provided generates super web page template.When server is received
To client client ask when, according to the client ask, obtain with the client request
The current non-figure WEB resource datas of corresponding WEB page, and with pre-build with
Super web page template corresponding to the WEB page carries out residual quantity fortune to non-figure WEB resource datas
Calculate, obtain differential data, the differential data is exactly the non-figure WEB number of resources of the WEB page
According to and difference data between super web page template.Server sends to client differential data
End, all data of super web page template have been included in client.Client can be combined
Differential data and super web page template represent the WEB page required by it to user.At this
During, server issues the data of client only differential data, largely
The upper data volume for reducing the non-figure WEB resources for being handed down to client, that accelerates resource issues speed
Degree, reduction issues flow spent during data, and the response for improving page browsing takes.
Method and the computer program product of system that the embodiment of the present invention is provided, including
Store the computer-readable recording medium of program code, the instruction that described program code includes
Can be used to perform the method described in previous methods embodiment, implement and can be found in method reality
Example is applied, be will not be repeated here.
It is apparent to those skilled in the art that, for convenience and simplicity of description,
The specific work process of the device of foregoing description, it is right in preceding method embodiment to may be referred to
Process is answered, be will not be repeated here.
If the function is to realize in the form of SFU software functional unit and as independent product
When selling or using, can store in a computer read/write memory medium.Based on this
The understanding of sample, what technical scheme substantially contributed to prior art in other words
The part of part or the technical scheme can be embodied in the form of software product, the meter
Calculation machine software product is stored in a storage medium, including some instructions are used to so that one
Computer equipment (can be personal computer, server, or network equipment etc.) is performed
The all or part of step of each embodiment methods described of the invention.And foregoing storage medium
Including:USB flash disk, mobile hard disk, read-only storage (ROM, Read-Only Memory),
Random access memory (RAM, Random Access Memory), magnetic disc or CD
Etc. it is various can be with the medium of store program codes.
The above, specific embodiment only of the invention, but protection scope of the present invention
Be not limited thereto, any one skilled in the art the invention discloses skill
In the range of art, change or replacement can be readily occurred in, should all covered in protection scope of the present invention
Within.Therefore, protection scope of the present invention should be based on the protection scope of the described claims.