CN104063431A - Method and equipment for processing static resources - Google Patents

Method and equipment for processing static resources Download PDF

Info

Publication number
CN104063431A
CN104063431A CN201410256705.XA CN201410256705A CN104063431A CN 104063431 A CN104063431 A CN 104063431A CN 201410256705 A CN201410256705 A CN 201410256705A CN 104063431 A CN104063431 A CN 104063431A
Authority
CN
China
Prior art keywords
static resource
webpage
static
resource
merge
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.)
Pending
Application number
CN201410256705.XA
Other languages
Chinese (zh)
Inventor
王程
沈洪顺
张莹
相守鼎
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201410256705.XA priority Critical patent/CN104063431A/en
Publication of CN104063431A publication Critical patent/CN104063431A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • G06F16/986Document structures and storage, e.g. HTML extensions

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention provides a method and equipment for processing static resources. The method comprises the steps that the equipment for processing the static resources acquires information indicating that various web pages of a website use the static resources at the appointed time; the equipment for processing the static resources determines whether the static resources used by the web pages can be merged or not according to the information indicating that the web pages use the static resources at the appointed time and the used network condition when a user accesses the web pages. The static resources can be determined whether to be merged or not without manual participation, merging of the static resources is favorably realized, and the website performance is improved.

Description

Process the method and apparatus of static resource
[technical field]
The present invention relates to Internet technical field, relate in particular to a kind of method and apparatus of processing static resource.
[background technology]
The static resources such as client script language (javascript, js), Cascading Style Sheet language (css) be transferred to website for user before, generally need to merge to reduce network request number.The at present merging of static resource depends on slip-stick artist's manual operations of product line, and concrete slip-stick artist is normally rule of thumb merged together important static resource and static resource that they rely on.But for complicated project such as map, mhkc etc., because static resource is a lot, dependence is each other also very complicated, and this just causes the manually relation between combing static resource and importance, cannot carry out resource merging, thereby affect the performance of website.
[summary of the invention]
Whether many aspects of the present invention provide a kind of method and apparatus of processing static resource, in order to determine between static resource, can merge, be conducive to realize the merging between static resource, improve web site performance.
An aspect of of the present present invention, provides a kind of method of processing static resource, comprising:
The equipment of processing static resource obtains the information that each webpage under website is used static resource at the appointed time;
The equipment of described processing static resource is used at the appointed time the information of static resource and user to access the situation of the network that each webpage uses according to each webpage, determine whether the static resource that each webpage is used can merge.
Another aspect of the present invention, provides a kind of equipment of processing static resource, comprising:
Acquisition module, is used the information of static resource at the appointed time for obtaining each webpage under website;
Determination module, for use at the appointed time the information of static resource and user to access the situation of the network that each webpage uses according to each webpage, determines whether the static resource that each webpage is used can merge.
In technical solution of the present invention, the equipment of processing static resource obtains the information that each webpage under website is used static resource at the appointed time, according to each obtained webpage, use at the appointed time afterwards the information of static resource and user to access the situation of the network that each webpage uses, determine whether the static resource that each webpage is used can merge, do not need artificial participation, to whether merging and realize automated analysis between static resource, be conducive to realize the merging between static resource, improve web site performance.
[accompanying drawing explanation]
In order to be illustrated more clearly in the technical scheme in the embodiment of the present invention, to the accompanying drawing of required use in embodiment or description of the Prior Art be briefly described below, apparently, accompanying drawing in the following describes is some embodiments of the present invention, for those of ordinary skills, do not paying under the prerequisite of creative work, can also obtain according to these accompanying drawings other accompanying drawing.
The schematic flow sheet of the method for the processing static resource that Fig. 1 provides for one embodiment of the invention;
The schematic flow sheet of a kind of implementation method of the step 102 that Fig. 2 provides for one embodiment of the invention;
The schematic flow sheet of the method for the processing static resource that Fig. 3 provides for another embodiment of the present invention;
The structural representation of the equipment of the processing static resource that Fig. 4 provides for one embodiment of the invention.
[embodiment]
For making object, technical scheme and the advantage of the embodiment of the present invention clearer, below in conjunction with the accompanying drawing in the embodiment of the present invention, technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is the present invention's part embodiment, rather than whole embodiment.Embodiment based in the present invention, those of ordinary skills, not making the every other embodiment obtaining under creative work prerequisite, belong to the scope of protection of the invention.
The problem existing for prior art, the present invention has provided a solution.With reference to figure 1, the schematic flow sheet of the method for the processing static resource that Fig. 1 provides for one embodiment of the invention.As shown in Figure 1, the method comprises:
101, the equipment of processing static resource obtains the information that each webpage under website is used static resource at the appointed time.
102, the equipment of processing static resource is used at the appointed time the information of static resource and user to access the situation of the network that each webpage uses according to each webpage, determine whether the static resource that each webpage is used can merge.
The equipment of processing static resource in the present embodiment can be any equipment with acquisition of information, analysis and certain processing power, for example, can be Log platform, but be not limited to this.Static resource refers to the resource that need to send to browser but can not change because of regular job.For example, for js file of describing the picture of website outward appearance and css file, moving at browser etc., all belong to static resource.Conventionally these static resources can be stored in separately on static resource server.
The website that the present embodiment relates to refers on the Internet, according to certain rule, use the tool makings such as HTML (Hypertext Markup Language) (HyperText Markup language, HTML) for showing the set of the related web page of certain content.In simple terms, the website that the present embodiment relates to is exactly the set of a plurality of webpages of traffic aided.Illustrate, it is different that map, mhkc or Baidu such as purchase by group at the business tine that product relates to, so belong to different web sites.The static resource that the method that the present embodiment provides can be used for different web sites to relate to carries out combined analysis, such as can be used for that map, mhkc or Baidu are purchased by group etc. to the static resource that affiliated web site relates to, carries out combined analysis.
The above-mentioned fixed time can arrange according to application demand adaptability, and for example the described fixed time can be 1 hour, 3 hours, 1 day, 5 days, 1 week or 1 month etc.
Above-mentioned user accesses the network that each webpage uses can be identical, also can be different.Described network can be 2G network, 3G network or Wireless Fidelity (WIreless-Fidelity, WIFI) network etc.
Concrete, the equipment of processing static resource obtains the information that each webpage under website is used static resource at the appointed time, according to each webpage, use at the appointed time afterwards the information of static resource and user to access the situation of the network that each webpage uses, determine whether the static resource that each webpage is used can merge, the automated analysis of realization to static resource, determine between static resource and whether can merge, for the merging between static resource provides condition, be conducive to improve web site performance.
Above-mentioned each webpage relating to is used the information of static resource to comprise at the appointed time: the visit capacity of each webpage at the appointed time (having characterized to a certain extent the frequency that webpage is used static resource), and each webpage at the appointed time in the sign of accessed used static resource and the size of the static resource that uses, but be not limited to this.Based on this, the implementation procedure of step 101, be actually the visit capacity of each webpage of device statistics at the appointed time of processing static resource and each webpage at the appointed time in the sign of accessed used static resource and big or small process.
Further, each webpage that the equipment of processing static resource obtains the at the appointed time interior information of static resource of using also comprises: the out of Memory such as the URL(uniform resource locator) of each webpage (Uniform Resoure Locator, URL).
It should be noted that, the visit capacity of each webpage of device statistics of processing static resource at the appointed time and each webpage at the appointed time in sign and the big or small process of accessed used static resource can adopt various ways to realize.Illustrate, a kind of preferred implementation comprises:
For each webpage, process equipment HTML (Hypertext Markup Language) (the Hypertext transfer protocol that at the appointed time the interior browser that receives this webpage of access sends after this webpage of access of static resource, HTTP) request, this HTTP request comprises sign and the size of this accessed used static resource of this webpage; Afterwards, add up sign and the size of the static resource that all HTTP request comprises, determine sign and the size of accessed used static resource in this webpage at the appointed time; Add up the number of all HTTP request, the visit capacity as this webpage at the appointed time.
In this embodiment, after browser access webpage, the sign of this accessed used static resource of this webpage and size can be offered to the equipment of processing static resource with the method for HTTP request.Concerning the equipment of processing static resource, the number of asking by the HTTP receiving in the statistics fixed time, just can obtain the accessed number of times of this webpage, i.e. the visit capacity of this webpage; By adding up sign and the size of the static resource that each HTTP request comprises, can obtain this webpage at the appointed time in sign and the size of accessed used all static resources.In this explanation, different HTTP requests may comprise sign and the size of identical static resource, but only add up once when statistics.
For example, a kind of statistics obtaining by above-mentioned embodiment can be as shown in table 1.
Table 1
Above comprise altogether 6 static resources in table 1, be respectively A.Js, B.Js, C.Js, D.Js, E.Js and F.Js; Website comprises 5 webpages, is respectively page1, page2, page3, page4 and page5, and the visit capacity of these 5 webpages is respectively 100,1,20,10 and 1; " √ " in table 1 represents that this page has been used this static resource.
The browser of the same webpage of above-mentioned access can be same browser, can be also a plurality of different browsers, and the present embodiment does not limit this.But what no matter access same webpage is a browser or a plurality of browser, each browser can provide to the equipment of processing static resource the information such as the sign of this accessed used static resource of this webpage and size after this webpage of access.
How the browser of accessed web page in above-mentioned embodiment is obtained to the sign of this accessed used static resource of this webpage below and big or small process describes.
Concrete, the browser of accessed web page, before the equipment to processing static resource sends HTTP request, can send request of access to the server at this webpage place; The server at this webpage place can be played up and generate this webpage the template of webpage according to this request of access, and obtains sign and the size of this accessed used static resource of this webpage; The server at this webpage place inserts sign and the size of this accessed used static resource of this webpage of controlling script and obtaining in webpage, and this webpage is sent to above-mentioned browser.
Above-mentioned control script sends to for controlling sign and the size of the static resource that browser uses this webpage the equipment of processing static resource.Based on this, browser is controlled under the control of script at this, and after the webpage returning at the server that receives webpage place, sign and the size of the static resource that this webpage carrying in webpage is used send to the equipment of processing static resource.
In this explanation, the server at webpage place can adopt front end integrated solution (FrontendIntegration Solution, FIS) to realize.Based on this, the server at webpage place can depend on the modularization scheme that FIS provides, micro-(widget) that dynamic collection template uses when front end template engine smarty plays up the masterplate of webpage, this widget is an assembly unit in FIS, can comprise front Side Template (TPL), js, css etc. and picture, obtain widget that template used and also just mean the information that has obtained the static resource that webpage uses; Simultaneously, the server at webpage place is taken over the Output rusults (playing up the webpage obtaining) of Smarty, in webpage, insert one section and control script (can be for example javascript script), to control browser, the data that obtained (being the information of the static resource that used of webpage) are sent to the equipment of processing static resource.
In this explanation, above-mentioned HTTP request can be including but not limited to following information:
Session random number (sid): be a random number, prevent that this HTTP request is buffered;
Data (data): the information such as the sign of the static resource that above-mentioned obtained webpage is used and size, these data can, through overcompression, be conducive to reduce the quantity of information of transmission;
The version number of version number (v): HTTP request, the upgrading that can carry out HTTP request form by this version number, realizes backward compatible;
Cryptographic hash (hash): the cryptographic hash of the URL of the page;
Product line sign (fid): the sign (id) of product line in automatic packaging system, is used for distinguishing different product lines;
Template name (pageName): the masterplate title that webpage is corresponding.
For example, above-mentioned HTTP request can adopt but be not limited to following form:
http://nsclick.baidu.com/u.gif?pid=242&v=1&data=&sid=123&hash=&f id=。
Based on the various embodiments described above or embodiment, a kind of optional implementation of above-mentioned steps 102 comprises: the equipment of processing static resource is used at the appointed time the information of static resource and user to access the situation of the network that each webpage uses according to each webpage, obtains income and loss that static resource that each webpage uses merges rear generation between two; If income is more than or equal to loss, determine that two static resources can merge; If income is less than loss, determine that two static resources cannot merge; When existing a static resource can be with at least two static resources merge in addition situation time, determine that this static resource and a static resource at least two static resources in addition merge.
Wherein, after two static resources merge the income producing and refer to that two static resources merge, the time of simultaneously using the network request to static resource server request static resource that the webpage of two static resources reduces to save.After two static resources merge the loss producing and refer to that two static resources merge, the webpage that has used one of them static resource is due to the wasting of resources that loads another static resource and cause.
Optionally, when existing a static resource can be with at least two static resources merge in addition situation time, can be according to the income that in this static resource and other at least two static resources, each static resource produces after merging, determine that the static resource that this static resource is corresponding with maximum return in other at least two static resources merges, but be not limited to this.
In this explanation, according to each webpage, use the difference of the information of static resource at the appointed time, the equipment of processing static resource obtains the mode of the incomes that produce after two static resources merge and loss can be different.Illustrate, if each webpage is used at the appointed time the information of static resource to comprise the visit capacity of each webpage, and sign and the size of the static resource that uses of each webpage, the equipment of processing static resource can adopt following formula to calculate income and the losses that produce after two static resources merge.For ease of describing, by one in two static resources, be called the first static resource below, another is called to the second static resource.
Benf = Σ i = 1 n PV i 0 * T aver - - - ( 1 )
Wherein, Benf is the income producing after the first static resource and the second static resource merge; PV i 0be i webpage that has simultaneously used the first static resource and the second static resource; N is for used the quantity of the webpage of the first static resource and the second static resource simultaneously; T averfor the average tie-time of network, it is an empirical value.For example, can add up the download time of less content on website (for example this content can be that size is the picture of 1K), because this content is very little, so download time mainly consume on network connects; Get the mean value of a plurality of download times that count on as T aver.
Cos = ( Σ j = 1 m PV j 2 * X 1 + Σ l = 1 k PV l 1 * X 2 ) / R aver - - - ( 2 )
Wherein, Cos is the loss producing after the first static resource and the second static resource merge; PV j 2be that j has been used the second static resource but do not used the visit capacity of the webpage of the first static resource; M has been used the second static resource but the quantity of not using the webpage of the first static resource; PV l 1be that l has been used the first static resource but do not used the visit capacity of the webpage of the second static resource; K has been used the first static resource but the quantity of not using the webpage of the second static resource; X 1it is the size of the first static resource; X 2it is the size of the second static resource; R averfor the speed of download of network, it is an empirical value.For example, can add up and on website, specify the size of static resource and the download time of this static resource, by the size of this static resource, divided by download time, obtain speed of download, the mean value of getting a plurality of speeds of download that count on is as the R here aver.
In this explanation, the sign of the static resource that can use each webpage gathers, obtain the webpage simultaneously used the first static resource and the second static resource quantity, used the second static resource but do not use the first static resource webpage quantity and used the first static resource but do not used the quantity of the webpage of the second static resource, be i.e. said n, m, k.
Whether associative list 1, based on above-mentioned formula (1) and formula (2), can merge and be illustrated two static resources.Suppose T averfor 0.1s, R averfor 10Kb/s.
Whether for example, calculate A.js and B.js can merge.According to formula (1), calculate the income after A.js and B.js merging, Benf=(100+1+20+10+1) * 0.1=13.2s; According to formula (2), calculate the loss after A.js and B.js merging, Cos=0; Income after A.js and B.js merge is greater than loss, can merge.
Whether again for example, calculate C.js and D.js can merge.According to formula (1), calculate the income after C.js and D.js merging, Benf=0; According to formula (2), calculate the loss after C.js and D.js merging, Cos=((100+1) * 2+1*0.3)/10=20.23; Income after C.js and D.js merge is less than loss, cannot merge.
Whether more for example, calculate B.js and C.js can merge.According to formula (1), calculate the income after B.js and C.js merging, Benf=(100+1) * 0.1=10.1; According to formula (2), calculate the loss after B.js and C.js merging, Cos=(20+10+1) * 0.3/10=0.93; Income after B.js and C.js merge is greater than loss, can merge.
In the manner described above, can calculate A.Js and C.Js successively, A.Js and D.Js, whether E.Js and F.Js etc. can merge.
Further, above B.js can merge with C.js, and B.js can merge with A.js, merges respectively the income of rear generation according to B.js and C.js and A.js, selects A.Js and B.Js merging that maximum return 13.2s is corresponding.
Based on the various embodiments described above or embodiment, as shown in Figure 2, this embodiment comprises another optional embodiment of step 102:
Whether the static resource that the buffer memory utilization rate of the static resource that the equipment of 102a, processing static resource is used according to each webpage and/or each webpage are used belongs to the resource of first screen use, the static resource that each webpage is used is classified, and obtains at least one resource collection.
102b, for each resource collection, the equipment of processing static resource is used at the appointed time the information of static resource and user to access the situation of the network that the first webpage uses according to the first webpage, determine in this resource collection, whether each static resource can merge.First webpage here refers to the webpage that has used the static resource in this resource collection.
Wherein, each resource collection comprises at least two static resources.
In this explanation, whether the buffer memory utilization rate that the equipment of processing static resource can first obtain the static resource of each webpage use before use belongs to the static resource that each webpage is used the information that head shields the resource of use.Optionally, the equipment of processing static resource can send the request of obtaining to the server at webpage place, is obtained the buffer memory utilization rate of the static resource that webpage uses and is returned to the equipment of processing static resource, but be not limited to this by the server statistics at webpage place.Whether the static resource using for each webpage belongs to this information of resource that first screen is used, can by accessing the browser of this webpage, offer the equipment of processing static resource by the server at webpage place, for example, access the browser of this webpage and can ask this information to send to the equipment of processing static resource by HTTP.
In above-mentioned steps 102a, the equipment of processing static resource can be separately according to the buffer memory utilization rate of the static resource of each webpage use, and the static resource that each webpage is used is classified.A threshold value for example can be set, and the static resource that buffer memory utilization rate is greater than to this threshold value is divided into a resource collection, and the static resource that buffer memory utilization rate is not more than to this threshold value is divided into another resource collection.Again for example, a plurality of threshold values can also be set, thereby the static resource that each network is used is divided into a plurality of resource collections according to buffer memory utilization rate.Processing the equipment of static resource classifies to static resource according to the buffer memory utilization rate of static resource, the higher static resource of buffer memory utilization rate can be put together, server at webpage place receives after the request of access of browser like this, while searching these static resources in local cache, can improve the probability hitting, not needing, to static resource server request static resource, provides the time of these static resources to shorten to browser, is conducive to improve the speed of browser displaying web page!
In above-mentioned steps 102a, whether the equipment of processing static resource can belong to according to the static resource of each webpage use the resource that first screen is used separately, and the static resource that each webpage is used is classified.For example, the static resource that belongs to first screen use can be divided into a resource collection, by not belonging to the first static resource using that shields, be divided into another resource collection.Again for example, the static resource that belongs to first screen use can also be divided into a resource collection, the static resource that belongs to the 2nd screen use is divided into another resource collection, the static resource that belongs to the 3rd screen use is divided into another resource collection, etc., namely according to the static resource resource that specifically which screen is used, classify.Whether the equipment of processing static resource belongs to according to static resource the resource that first screen is used, the static resource that belongs to first screen use is divided into a class, the resource that the server at webpage place can first provide first screen to use to browser like this, because stock number reduces, to browser, provide the time of these static resources to shorten, be conducive to improve the speed of browser displaying web page!
In above-mentioned steps 102a, whether the equipment of processing static resource can also belong to the resource of first screen use simultaneously according to the static resource of the buffer memory utilization rate of the static resource of each webpage use and the use of each webpage, and the static resource that each webpage is used is classified.For example, the equipment of processing static resource can be greater than threshold value by buffer memory utilization rate simultaneously, and the static resource that belongs to the resource of first screen use is divided in a resource collection, can further reduce like this webpage place server provides the time of these static resources to browser, be conducive to further improve the speed of browser displaying web page.
In this explanation, above-mentioned steps 102b specifically can adopt above-mentioned formula (1) and (2) to determine in resource collection, whether each static resource can merge, and detailed process repeats no more.
The method flow schematic diagram of the processing static resource that Fig. 3 provides for another embodiment of the present invention.This embodiment can be based on realization embodiment illustrated in fig. 1, and as shown in Figure 3, the method also comprises after step 102:
The information the output whether static resource that 103, the equipment of processing static resource is used determined each webpage can merge.
For example, process the equipment of static resource can be by above-mentioned information the formal output with configuration file so that other equipment are used.
Further, the method for the present embodiment can also comprise:
104, static resource merges equipment according to above-mentioned information, and the static resource that can merge merges, and obtains static resource combination, and static resource combination is stored on static resource server.
What deserves to be explained is, in the present embodiment, static resource merges the equipment that equipment can be processing static resource, can be also other equipment that are different from the equipment of processing static resource, for example, can be the equipment that is deployed with FIS instrument.
In addition, owing to processing the equipment of static resource, above-mentioned information is exported, so static resource merging equipment can carry out static resource merging processing in the mode of off-line in the present embodiment, can not produced any impact to browser access webpage.
In actual applications, when browser needs accessed web page, server to webpage place sends request of access, the server at webpage place is after receiving the request of access of browser transmission, can be according to the above-mentioned information of processing the equipment output of static resource, the resource request of the sign that generation comprises the static resource that this webpage uses, combines to static resource corresponding to static resource server request by this resource request.Because having carried out resource, the present embodiment merges the number that has therefore reduced resource request when obtaining static resource, on the other hand owing to not being that the sign of static resource that this webpage is used writes in a resource request, be conducive to webpage place server and mate at local cache, be conducive to improve Buffer Utilization.
So far, the flow process that the present embodiment provides finishes.In the present embodiment, the process whether static resource can merge, and determining that the process that merges static resource after can merging completes by the equipment of processing static resource, without artificial participation, reduce the cost that manual maintenance resource merges, saved human cost.
It should be noted that, for aforesaid each embodiment of the method, for simple description, therefore it is all expressed as to a series of combination of actions, but those skilled in the art should know, the present invention is not subject to the restriction of described sequence of movement, because according to the present invention, some step can adopt other orders or carry out simultaneously.Secondly, those skilled in the art also should know, the embodiment described in instructions all belongs to preferred embodiment, and related action and module might not be that the present invention is necessary.
In the above-described embodiments, the description of each embodiment is all emphasized particularly on different fields, in certain embodiment, there is no the part of detailed description, can be referring to the associated description of other embodiment.
The structural representation of the equipment of the processing static resource that Fig. 4 provides for one embodiment of the invention.As shown in Figure 4, this equipment comprises: acquisition module 41 and determination module 42.
Acquisition module 41, is used the information of static resource at the appointed time for obtaining each webpage under website.
Determination module 42, is connected with acquisition module 41, uses at the appointed time the information of static resource and user to access the situation of the network that each webpage uses for each webpage of obtaining according to acquisition module 41, determines whether the static resource that each webpage is used can merge.
In an optional embodiment, each webpage that determination module 42 specifically can be used for obtaining according to acquisition module 41 is the interior information of static resource and the situation that user accesses the network of each webpage use used at the appointed time, the static resource that obtains each webpage use merges income and the loss of rear generation between two, and when income is more than or equal to loss, determine that two static resources can merge, when income is less than loss, determine that two static resources cannot merge, and when existing a static resource can be with at least two static resources merge in addition situation time, determine that this static resource and a static resource in other at least two static resources merge.
Wherein, after above-mentioned income refers to that two static resources merge, the time of simultaneously using the network request to static resource server request static resource that the webpage of these two static resources reduces to save; After above-mentioned loss refers to that two static resources merge, the webpage that has used one of them static resource is due to the wasting of resources that loads another static resource and cause.
In another optional embodiment, whether the buffer memory utilization rate of static resource and/or the static resource of each webpage use that determination module 42 specifically can be used for using according to each webpage belong to the resource that first screen is used, the static resource that each webpage is used is classified, obtain at least one resource collection, for each resource collection, according to the first webpage, use at the appointed time the information of static resource and user to access the situation of the network that the first webpage uses, determine in this resource collection, whether each static resource can merge.Wherein, first network is the webpage that has used the static resource in resource collection.
In an optional embodiment, acquisition module 41 specifically can be used for adding up the visit capacity of each webpage at the appointed time and each webpage at the appointed time in sign and the size of accessed used static resource.
Further, acquisition module 41 specifically can be used for each webpage, the browser that receives this webpage of access is at the appointed time being accessed the HTTP request sending after this webpage, this HTTP request comprises sign and the size of this accessed used static resource of this webpage, add up sign and the size of the static resource that all HTTP request comprises, determine sign and the size of accessed used static resource in this webpage at the appointed time, and the number of adding up all HTTP request, the visit capacity as this webpage at the appointed time.
Above-mentioned acquisition module 41 obtain the visit capacity of each webpage at the appointed time and each webpage at the appointed time in the sign and big or small basis of accessed used static resource, determination module 42 specifically can be according to formula (1), the first static resource and the second static resource that calculate in two static resources merge the rear income producing, and according to formula (2), calculate the loss producing after the first static resource and the second static resource merge, and when income is more than or equal to loss, determine that the first static resource and the second static resource can merge, when income is less than loss, determine that the first static resource and the second static resource cannot merge.
Description about formula (1) and (2), refers to said method embodiment, does not repeat them here.
Further, the equipment of the present embodiment can also comprise: output module, the information that whether can merge for the static resource that determined each webpage of above-mentioned determination module 42 is used output.
Further, the equipment of the present embodiment can also comprise: merge module, for the information of exporting according to output module, the static resource that can merge merges, and obtains static resource combination, and static resource combination is stored on static resource server.
Each functional module of the equipment of the processing static resource that the present embodiment provides can be used for the flow process of method shown in Fig. 1, and its specific works principle repeats no more, and refers to the description of embodiment of the method.
The equipment of the processing static resource that the present embodiment provides, obtain the information that each webpage under website is used static resource at the appointed time, according to each obtained webpage, use at the appointed time afterwards the information of static resource and user to access the situation of the network that each webpage uses, determine whether the static resource that each webpage is used can merge, do not need artificial participation, to whether merging and realize automated analysis between static resource, be conducive to realize the merging between static resource, improve web site performance.
Those skilled in the art can be well understood to, for convenience and simplicity of description, the system of foregoing description, the specific works process of device and unit, can, with reference to the corresponding process in preceding method embodiment, not repeat them here.
In several embodiment provided by the present invention, should be understood that, disclosed system, apparatus and method, can realize by another way.For example, device embodiment described above is only schematic, for example, the division of described unit, be only that a kind of logic function is divided, during actual realization, can have other dividing mode, for example a plurality of unit or assembly can in conjunction with or can be integrated into another system, or some features can ignore, or do not carry out.Another point, shown or discussed coupling each other or direct-coupling or communication connection can be by some interfaces, indirect coupling or the communication connection of device or unit can be electrically, machinery or other form.
The described unit as separating component explanation can or can not be also physically to separate, and the parts that show as unit can be or can not be also physical locations, can be positioned at a place, or also can be distributed in a plurality of network element.Can select according to the actual needs some or all of unit wherein to realize the object of the present embodiment scheme.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, can be also that the independent physics of unit exists, and also can be integrated in a unit two or more unit.Above-mentioned integrated unit both can adopt the form of hardware to realize, and the form that also can adopt hardware to add SFU software functional unit realizes.
The integrated unit that the above-mentioned form with SFU software functional unit realizes, can be stored in a computer read/write memory medium.Above-mentioned SFU software functional unit is stored in a storage medium, comprise that some instructions are with so that a computer equipment (can be personal computer, server, or the network equipment etc.) or processor (processor) carry out the part steps of method described in each embodiment of the present invention.And aforesaid storage medium comprises: USB flash disk, portable hard drive, ROM (read-only memory) (Read-Only Memory, ROM), the various media that can be program code stored such as random access memory (Random Access Memory, RAM), magnetic disc or CD.
Finally it should be noted that: above embodiment only, in order to technical scheme of the present invention to be described, is not intended to limit; Although the present invention is had been described in detail with reference to previous embodiment, those of ordinary skill in the art is to be understood that: its technical scheme that still can record aforementioned each embodiment is modified, or part technical characterictic is wherein equal to replacement; And these modifications or replacement do not make the essence of appropriate technical solution depart from the spirit and scope of various embodiments of the present invention technical scheme.

Claims (13)

1. a method of processing static resource, is characterized in that, comprising:
The equipment of processing static resource obtains the information that each webpage under website is used static resource at the appointed time;
The equipment of described processing static resource is used at the appointed time the information of static resource and user to access the situation of the network that each webpage uses according to each webpage, determine whether the static resource that each webpage is used can merge.
2. method according to claim 1, it is characterized in that, the equipment of described processing static resource is used at the appointed time the information of static resource and user to access the situation of the network that each webpage uses according to each webpage, determine that whether the static resource that each webpage is used can merge, and comprising:
The equipment of described processing static resource is used at the appointed time the information of static resource and user to access the situation of the network that each webpage uses according to each webpage, obtain income and loss that static resource that each webpage uses merges rear generation between two;
If described income is more than or equal to described loss, determine that two static resources can merge;
If described income is less than described loss, determine that two static resources cannot merge;
When existing a static resource can be with at least two static resources merge in addition situation time, determine a static resource merging in described static resource and described at least two static resources in addition;
Wherein, after described income refers to that two static resources merge, the time of simultaneously using the network request to static resource server request static resource that the webpage of described two static resources reduces to save; After described loss refers to that two static resources merge, the webpage that has used one of them static resource is due to the wasting of resources that loads another static resource and cause.
3. method according to claim 1, it is characterized in that, the equipment of described processing static resource is used at the appointed time the information of static resource and user to access the situation of the network that each webpage uses according to each webpage, determine that whether the static resource that each webpage is used can merge, and comprising:
Whether the static resource that the buffer memory utilization rate of the static resource that the equipment of described processing static resource is used according to each webpage and/or each webpage are used belongs to the resource that first screen is used, and the static resource that each webpage is used is classified, and obtains at least one resource collection;
For each resource collection, the equipment of described processing static resource is used at the appointed time the information of static resource and user to access the situation of the network that described the first webpage uses according to the first webpage, determine in described resource collection, whether each static resource can merge, described the first webpage is the webpage that has used the static resource in described resource collection.
4. method according to claim 2, is characterized in that, the equipment of described processing static resource obtains the information that each webpage under website is used static resource at the appointed time, comprising:
The visit capacity of each webpage of the device statistics of described processing static resource at the appointed time and each webpage at the appointed time in sign and the size of accessed used static resource.
5. method according to claim 4, is characterized in that, the visit capacity of each webpage of the device statistics of described processing static resource at the appointed time and each webpage at the appointed time in sign and the size of accessed used static resource, comprising:
For each webpage, the HTML (Hypertext Markup Language) HTTP request that at the appointed time the interior browser that receives the described webpage of access sends after the described webpage of access of the equipment of described processing static resource, described HTTP asks to comprise sign and the size of this accessed used static resource of described webpage;
Sign and the size of the static resource that all HTTP requests of device statistics of described processing static resource comprise, determine described webpage at the appointed time sign and the size of interior accessed used static resource;
The number of all HTTP requests of the device statistics of described processing static resource, the visit capacity as described webpage at the appointed time.
6. method according to claim 5, its feature is high to be, the browser of accessing described webpage also comprises before sending HTTP request to the equipment of described processing static resource:
Described browser sends request of access to the server at webpage place;
The server at described webpage place, according to described request of access, is played up and is generated described webpage the template of described webpage, and obtains sign and the size of this accessed used static resource of described webpage;
The server at described webpage place inserts sign and the size of controlling script and this accessed used static resource of described webpage in described webpage, and described webpage is sent to described browser; Described control script sends to the sign of the static resource of described webpage use and size the equipment of described processing static resource for controlling described browser.
7. according to the method described in claim 4 or 5 or 6, it is characterized in that, the equipment of described processing static resource is used at the appointed time the information of static resource and user to access the situation of the network that each webpage uses according to each webpage, the static resource that obtains each webpage use merges income and the loss of rear generation between two, comprising:
According to formula the first static resource and the second static resource that calculate in two static resources merge the rear income producing;
According to formula calculate the loss producing after described the first static resource and the second static resource merge;
Wherein, Benf is the income producing after described the first static resource and the second static resource merge;
Cos is the loss producing after described the first static resource and the second static resource merge;
PV i 0be i the visit capacity of simultaneously having used the webpage of described the first static resource and the second static resource;
N is for used the quantity of the webpage of described the first static resource and the second static resource simultaneously;
T averfor the average tie-time of described network;
PV j 2be that j has been used described the second static resource but do not used the visit capacity of the webpage of described the first static resource;
X 1size for described the first static resource;
PV l 1be that l has been used described the first static resource but do not used the visit capacity of the webpage of described the second static resource;
X 2size for described the second static resource;
M has been used described the second static resource but the quantity of not using the webpage of described the first static resource;
K has been used described the first static resource but the quantity of not using the webpage of described the second static resource;
R averspeed of download for described network.
8. an equipment of processing static resource, is characterized in that, comprising:
Acquisition module, is used the information of static resource at the appointed time for obtaining each webpage under website;
Determination module, for use at the appointed time the information of static resource and user to access the situation of the network that each webpage uses according to each webpage, determines whether the static resource that each webpage is used can merge.
9. equipment according to claim 8, is characterized in that, described determination module specifically for:
According to each webpage, use at the appointed time the information of static resource and user to access the situation of the network that each webpage uses, the static resource that obtains each webpage use merges income and the loss of rear generation between two, and when described income is more than or equal to described loss, determine that two static resources can merge, when described income is less than described loss, determine that two static resources cannot merge, and when existing a static resource can be with at least two static resources merge in addition situation time, determine that a static resource in described static resource and described at least two static resources in addition merges,
Wherein, after described income refers to that two static resources merge, the time of simultaneously using the network request to static resource server request static resource that the webpage of described two static resources reduces to save; After described loss refers to that two static resources merge, the webpage that has used one of them static resource is due to the wasting of resources that loads another static resource and cause.
10. equipment according to claim 8, is characterized in that, described determination module specifically for:
Whether the static resource that the buffer memory utilization rate of the static resource using according to each webpage and/or each webpage are used belongs to the resource that first screen is used, the static resource that each webpage is used is classified, obtain at least one resource collection, for each resource collection, according to the first webpage, use at the appointed time the information of static resource and user to access the situation of the network that described the first webpage uses, determine in described resource collection, whether each static resource can merge; Described the first webpage is the webpage that has used the static resource in described resource collection.
11. equipment according to claim 9, is characterized in that, described acquisition module specifically for:
Add up the visit capacity of each webpage at the appointed time and each webpage at the appointed time in sign and the size of accessed used static resource.
12. equipment according to claim 11, is characterized in that, described acquisition module specifically for:
For each webpage, the HTML (Hypertext Markup Language) HTTP request that at the appointed time the interior browser that receives the described webpage of access sends after the described webpage of access, described HTTP asks to comprise sign and the size of this accessed used static resource of described webpage;
Add up sign and the size of the static resource that all HTTP request comprises, determine sign and the size of accessed used static resource in described webpage at the appointed time;
Add up the number of all HTTP request, the visit capacity as described webpage at the appointed time.
13. according to the equipment described in claim 11 or 12, it is characterized in that, described determination module specifically for:
According to formula the first static resource and the second static resource that calculate in two static resources merge the rear income producing, according to formula calculate the loss producing after described the first static resource and the second static resource merge, and when described income is more than or equal to described loss, determine that described the first static resource and the second static resource can merge, when described income is less than described loss, determine that described the first static resource and the second static resource cannot merge;
Wherein, Benf is the income producing after described the first static resource and the second static resource merge;
Cos is the loss producing after described the first static resource and the second static resource merge;
PV i 0be i the visit capacity of simultaneously having used the webpage of described the first static resource and the second static resource;
N is for used the quantity of the webpage of described the first static resource and the second static resource simultaneously;
T averfor the average tie-time of described network;
PV j 2be that j has been used described the second static resource but do not used the visit capacity of the webpage of described the first static resource;
X 1size for described the first static resource;
PV l 1be that l has been used described the first static resource but do not used the visit capacity of the webpage of described the second static resource;
X 2size for described the second static resource;
M has been used described the second static resource but the quantity of not using the webpage of described the first static resource;
K has been used described the first static resource but the quantity of not using the webpage of described the second static resource;
R averspeed of download for described network.
CN201410256705.XA 2014-06-10 2014-06-10 Method and equipment for processing static resources Pending CN104063431A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410256705.XA CN104063431A (en) 2014-06-10 2014-06-10 Method and equipment for processing static resources

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410256705.XA CN104063431A (en) 2014-06-10 2014-06-10 Method and equipment for processing static resources

Publications (1)

Publication Number Publication Date
CN104063431A true CN104063431A (en) 2014-09-24

Family

ID=51551146

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410256705.XA Pending CN104063431A (en) 2014-06-10 2014-06-10 Method and equipment for processing static resources

Country Status (1)

Country Link
CN (1) CN104063431A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106209925A (en) * 2015-04-29 2016-12-07 阿里巴巴集团控股有限公司 Page loading method, client and system
CN106293675A (en) * 2015-06-08 2017-01-04 腾讯科技(深圳)有限公司 Static system resource loading method and device
CN106790687A (en) * 2017-02-17 2017-05-31 和创(北京)科技股份有限公司 Webpage display method, web data processing method and server
CN106888248A (en) * 2016-12-27 2017-06-23 网易(杭州)网络有限公司 Method and apparatus for obtaining user access activity information
CN106933965A (en) * 2017-02-08 2017-07-07 福建省华渔教育科技有限公司 The method of static resource request
CN107346309A (en) * 2016-05-04 2017-11-14 北京京东尚科信息技术有限公司 The processing method and processing device of static resource in a kind of network application
CN108984548A (en) * 2017-05-31 2018-12-11 腾讯科技(深圳)有限公司 Content of pages caching method and device
US20230028620A1 (en) * 2021-07-21 2023-01-26 Yext, Inc. Streaming static web page generation

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102622376A (en) * 2011-01-28 2012-08-01 北京千橡网景科技发展有限公司 Method and equipment used for merging cascading style sheet files

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102622376A (en) * 2011-01-28 2012-08-01 北京千橡网景科技发展有限公司 Method and equipment used for merging cascading style sheet files

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王程: "静态资源自动合并系统", 《百度文库》 *

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106209925A (en) * 2015-04-29 2016-12-07 阿里巴巴集团控股有限公司 Page loading method, client and system
CN106209925B (en) * 2015-04-29 2019-07-26 阿里巴巴集团控股有限公司 Page loading method, client and system
CN106293675A (en) * 2015-06-08 2017-01-04 腾讯科技(深圳)有限公司 Static system resource loading method and device
CN106293675B (en) * 2015-06-08 2020-12-25 腾讯科技(深圳)有限公司 System static resource loading method and device
CN107346309A (en) * 2016-05-04 2017-11-14 北京京东尚科信息技术有限公司 The processing method and processing device of static resource in a kind of network application
CN106888248A (en) * 2016-12-27 2017-06-23 网易(杭州)网络有限公司 Method and apparatus for obtaining user access activity information
CN106888248B (en) * 2016-12-27 2019-11-05 网易(杭州)网络有限公司 For obtaining the method and apparatus of user access activity information
CN106933965A (en) * 2017-02-08 2017-07-07 福建省华渔教育科技有限公司 The method of static resource request
CN106790687A (en) * 2017-02-17 2017-05-31 和创(北京)科技股份有限公司 Webpage display method, web data processing method and server
CN108984548A (en) * 2017-05-31 2018-12-11 腾讯科技(深圳)有限公司 Content of pages caching method and device
US20230028620A1 (en) * 2021-07-21 2023-01-26 Yext, Inc. Streaming static web page generation
US11816177B2 (en) * 2021-07-21 2023-11-14 Yext, Inc. Streaming static web page generation

Similar Documents

Publication Publication Date Title
CN104063431A (en) Method and equipment for processing static resources
CN101201832B (en) Method and system for optimizing web page image
US8181106B2 (en) Use of overriding templates associated with customizable elements when editing a web page
US10489361B2 (en) System and methods for cleansing automated robotic traffic from sets of usage logs
CN100547593C (en) During climbing the process of getting, arranges web the system and method for priority to the website
US8977653B1 (en) Modifying web pages to reduce retrieval latency
US20080184137A1 (en) Search results clustering in tabbed browsers
US20020078165A1 (en) System and method for prefetching portions of a web page based on learned preferences
CN103970534A (en) Method and equipment for supplying rendered page in mobile application
CN102939601A (en) Initiating font subsets
US20060224967A1 (en) Method and system for transferring web browser data between web browsers
CN106407344B (en) A kind of method and system generating search engine optimization label
US20150213484A1 (en) System and method for tracking related events
CN103797474A (en) Multi-channel conversion path position reporting
CN103874994A (en) Method and apparatus for automatically summarizing the contents of electronic documents
CN107807937B (en) Website SEO processing method, device and system
CN103597509A (en) Aggregation of conversion paths utilizing user interaction grouping
JP2010500689A (en) Method for enabling web analysis of interactive web applications
US9218369B2 (en) Ranking image search results using hover data
WO2007139313A1 (en) Method and equipment for exposing an advertisement using application
CN102902558A (en) Project script file updating system and method as well as script file merging method and device
US20120042232A1 (en) Placement of Hyperlinks in Documents
US9244891B2 (en) Adjusting search result rankings based on multiple user highlighting of documents
CN106021580B (en) Method and system for analyzing cluster logs of Impala based on Hadoop
CN102831114A (en) Method and device for realizing statistical analysis on user access condition of Internet

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20140924