CN108259198A - A kind of pre-judging method, device and the equipment of domain name cache hit rate - Google Patents

A kind of pre-judging method, device and the equipment of domain name cache hit rate Download PDF

Info

Publication number
CN108259198A
CN108259198A CN201611243260.7A CN201611243260A CN108259198A CN 108259198 A CN108259198 A CN 108259198A CN 201611243260 A CN201611243260 A CN 201611243260A CN 108259198 A CN108259198 A CN 108259198A
Authority
CN
China
Prior art keywords
url
fields
http
field
cache
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201611243260.7A
Other languages
Chinese (zh)
Other versions
CN108259198B (en
Inventor
刘菁宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
China Mobile Group Liaoning Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Group Liaoning 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 China Mobile Communications Group Co Ltd, China Mobile Group Liaoning Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN201611243260.7A priority Critical patent/CN108259198B/en
Publication of CN108259198A publication Critical patent/CN108259198A/en
Application granted granted Critical
Publication of CN108259198B publication Critical patent/CN108259198B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/14Network analysis or design
    • H04L41/147Network analysis or design for predicting network behaviour
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/45Network directories; Name-to-address mapping
    • H04L61/4505Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
    • H04L61/4511Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a kind of pre-judging method, device and the equipment of domain name cache hit rate, for field of communication technology, can solve the problem of to judge that the method for domain name hit rate needs to spend longer time and wastes cache resources backward.This method includes:From the access data acquisition uniform resource position mark URL of user;Separation caches relevant field with hypertext transfer protocol HTTP from URL;Based on the cache hit result that URL is determined with the relevant field of HTTP cachings.

Description

A kind of pre-judging method, device and the equipment of domain name cache hit rate
Technical field
The present invention relates to field of communication technology more particularly to a kind of pre-judging method of domain name cache hit rate, device and set It is standby.
Background technology
Caching is that the Web content for needing frequently to access is stored in from user compared near, the faster system of access speed, To improve a kind of technology of access to content speed, internet caching is the important means that internet improves access speed.It is interconnecting It crosses on the net in hundred million domain name, and not all domain name is suitable for being accelerated by internet caching, in order to save cache resources, no The domain name often accessed should be removed from caching in time or without caching, whether the hit rate of usual domain name is weighs domain name It is appropriate for the parameter of caching.At present, domain name hit rate is judged by the way of judging backward mostly in internet caching, i.e., Domain name is added in internet caching white list, after a period of time is run, the hit time of domain name is counted by log cache Number then calculates the hit rate of domain name.But this method needs to accumulate larger sample size and just may insure result of calculation Accuracy rate, the accumulation of sample size means to spend longer time, and does not need to domain name meeting when sample size accumulates of caching The resource of caching is occupied in for a long time, causes the waste of cache resources.
Invention content
An embodiment of the present invention provides a kind of pre-judging method, device and the equipment of domain name cache hit rate, after can solving The problem of needing to spend longer time to the method for judging domain name hit rate, and wasting cache resources.
In a first aspect, the present invention provides a kind of pre-judging method of cache hit rate, including:It is obtained from the access data of user Take URL (Uniform Resource Locator, uniform resource locator);Separation and HTTP (HyperText from URL Transfer Protocol, hypertext transfer protocol) the relevant field of caching;It is determined based on relevant field is cached with HTTP The cache hit result of URL.
Second aspect, the present invention provides a kind of anticipation device of internet cache hit rate, including:
Acquiring unit, for from the access data acquisition uniform resource position mark URL of user;
Separative element, for the separation from the URL and the relevant field of hypertext transfer protocol HTTP cachings;
Identifying unit, for based on the cache hit result that the URL is determined with the relevant field of HTTP cachings.
The third aspect, the present invention provides a kind of anticipation equipment of internet cache hit rate, including:
Memory, processor, communication interface and bus;
Memory, processor and communication interface are connected by bus and complete mutual communication;
Memory is used to store program code;
Processor is corresponding with executable program code to run by reading the executable program code stored in memory Program, for performing a kind of pre-judging method of domain name cache hit rate;Wherein, the pre-judging method packet of domain name cache hit rate It includes:
From the access data acquisition uniform resource position mark URL of user;
Separation caches relevant field with hypertext transfer protocol HTTP from the URL;
Based on the cache hit result that the URL is determined with the relevant field of HTTP cachings.
An embodiment of the present invention provides a kind of pre-judging method, device and the equipment of domain name cache hit rate, in the present invention from The URL that user accesses is obtained in the data that user accesses, and relevant field is cached with HTTP based on being isolated out from URL To determine the cache hit of URL as a result, so as to judge according to cache hit result whether URL caches.In this way, being not required to pair Sample is accumulated, and calculating hit rate can be carried out by user data, does not need to spend longer time;And it does not need to first Domain name is cached and can determine that cache hit and first cache target domain name to cause cache resources as a result, avoiding Waste situation.
Description of the drawings
In order to illustrate the technical solution of the embodiments of the present invention more clearly, it will make below to required in the embodiment of the present invention Attached drawing is briefly described, it should be apparent that, drawings described below is only some embodiments of the present invention, for For those of ordinary skill in the art, without creative efforts, other are can also be obtained according to these attached drawings Attached drawing.
Fig. 1 is the schematic flow chart of the pre-judging method of domain name cache hit rate provided according to embodiments of the present invention;
Fig. 2 is the schematic flow chart that hit rate prejudges in domain name cache hit rate pre-judging method shown in Fig. 1;
Fig. 3 is the hit rate judgment method flow chart of the URL level provided according to embodiments of the present invention;
Fig. 4 is the schematic block diagram of the anticipation device of the domain name cache hit rate provided according to embodiments of the present invention;
Fig. 5 is the schematic block diagram of the anticipation equipment of the domain name cache hit rate provided according to embodiments of the present invention.
Specific embodiment
Purpose, technical scheme and advantage to make the embodiment of the present invention are clearer, below in conjunction with the embodiment of the present invention In attached drawing, the technical solution in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is Part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art All other embodiments obtained without creative efforts shall fall within the protection scope of the present invention.
It should be noted that in the absence of conflict, the feature in embodiment and embodiment in the application can phase Mutually combination.The application is described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
Fig. 1 shows the schematic flow chart of the pre-judging method of domain name cache hit rate according to embodiments of the present invention.It should Method includes the following steps:110, from the access data acquisition URL of user;120, separation and hypertext transfer protocol from URL HTTP caches relevant field;130, based on the cache hit result that URL is determined with the relevant field of HTTP cachings.
In step 110, the access data of user can be historical data when user accesses internet, can be in advance to going through History data are obtained, or user accesses data in real time.The access data of user include access domain name and The URL for belonging to each domain name accessed, it is possible to obtain domain name from the access data of user and belong to the URL of domain name.
In the step 120, based on the caching life with the relevant field of HTTP cachings to target domain name in the embodiment of the present invention Middle rate is calculated, and is separated so isolating and will cache relevant field with HTTP in URL.
Specifically, with HTTP cache relevant field include field in HTTP request header field request header and/ Or the field in http response header field response header.
In step 130, for URL, it is may determine that with the relevant field of HTTP cachings by being detached in step 120 Cache hit result.The cache hit result of URL illustrates the cache hit situation of URL corresponding contents.
Specifically, cache hit result can include caching or not cache, caching represents that URL corresponding contents can be delayed It deposits, does not cache and represent that URL corresponding contents cannot be cached.The cache hit result of caching can also include caching and hit Or caching is not hit by, you can also be not hit by, cached for caching and hit or caching with the cache hit result of the URL of caching And hit represents that URL corresponding contents can carry out caching and life and can hit, caching is not hit by representing that URL corresponding contents can be with It is cached but not is hit.
It should be noted that in the embodiment of the present invention, after each URL is traversed, the cache hit of each URL can be converged As a result, obtaining the hit rate of domain name, Fig. 2 is specifically may refer to, Fig. 2 is domain name cache hit rate anticipation side shown in Fig. 1 The schematic flow chart that hit rate prejudges in method.
The URL that user accesses is obtained in the embodiment of the present invention from the data that user accesses, and is based on isolating from URL Go out cache relevant field with HTTP determine the cache hit of URL as a result, so as to according to cache hit result to URL whether Caching is judged.In this way, being not required to accumulate sample, calculating hit rate can be carried out by user data, do not need to be colored Take longer time;And it does not need to first be cached domain name and can determine that cache hit as a result, avoiding aiming field first Name cached so as to cause cache resources waste situation.
It should be noted that it in embodiments of the present invention, caches relevant field with HTTP and includes port Port, return code Code, request method Method, caching mechanism Cache-control, the time Expires that exceeds the time limit, request delivery time date, reality Body label E tag fields and last these fields of modification time Last-modified, and URL is judged according to above-mentioned field successively Cache hit result.
With reference to the hit rate judgment method flow of the URL level shown in Fig. 3, embodiment that the present invention will be described in detail be based on HTTP caches the process that relevant field judges the cache hit result of URL:
Obtain the field value that Port fields in relevant field are cached with HTTP;When the field value of Port fields is non-80 end During mouth, determine the cache hit result of URL not cache;When the field value of Port fields is 80 port, based on delaying with HTTP Deposit the cache hit result that return code Code fields in relevant field determine URL.
Wherein, the port information with generally including user data transmission in the relevant field of HTTP cachings of URL, for example, Virtual port.In internet, the data that user accesses website include transmitting the port that data correspond to agreement, for example, with The corresponding PORT COMs of HTTP are 80 ports.Cache server can pre-set and can be cached when carrying out buffer setting Port (in internet be usually 80 ports), then the port of only data transmission belongs to the pre-set port of cache server When can cache.So when the port included with the relevant field of HTTP cachings of URL belongs to the port that can be cached, URL corresponding contents can just be cached, that is, judge cache hit result for that can cache;When URL is related to HTTP cachings The port that includes of field when being not belonging to the port that can be cached, URL corresponding contents cannot be cached.Usual HTTP Port Port fields in request header are used for carrying port information, so, when URL and HTTP caches relevant word When section includes port Port fields, it can be determined that whether the field value of port Port fields is 80 ports.If it is non-80 port, Then determine the cache hit result of URL not cache;If it is 80 ports, need to continue to determine URL according to other fields Cache hit as a result, caching the cache hit knot that return code Code fields in relevant field determine URL based on HTTP Fruit.
Further, based on the cache hit knot that URL is determined with return code Code fields in the relevant field of HTTP cachings Fruit can be specially:Obtain the field value of Code fields;When the field value of Code fields is 304, the cache hit of URL is determined As a result it is caching and hit;When the field value of Code fields is 200, based on caching request method in relevant field with HTTP Method fields determine the cache hit result of URL.
Wherein, for servers such as the contents such as the higher webpage of rate of people logging in number of site, websites in response user's request When, it can indicate to store cacheable url corresponding content, such as pass through HTTP directly in the information of response The field value of Code fields in response header indicates that is, server instruction user can correspond to cacheable url Copy is being locally stored in content, when such user accesses these contents again in a short time, server can not be gone to obtain, directly It connects using the content being locally stored, therefore these contents can be hit after caching.The field value of Code fields is 304 tables Cacheable url corresponding content can be locally stored by showing, the field value of Code fields is successfully located for 200 expression servers Request is managed.So if the field value of Code fields is 304, it is determined that the cache hit result of URL is caching and hits; If the field value of Code fields is 200, need to continue to determine the cache hit of URL as a result, i.e. base according to other fields In the cache hit result that URL is determined with request method Method fields in the relevant field of HTTP cachings.
Further, determine that the caching of URL is ordered based on request method Method fields in the relevant field of HTTP cachings Middle result can be specially:Obtain the field value of Method fields;When the field value of Method fields is non-GET, URL is determined Cache hit result for caching be not hit by;When the field value of Method fields is GET, based on caching relevant word with HTTP Caching mechanism Cache-control fields determine the cache hit result of URL in section.
Wherein, the field in HTTP request header includes request method Method fields, the word of Method fields Segment value is a variety of including GET, POST etc., wherein, GET represents that the request method of cacheable url is from specified resource request data. If the field value of Method fields is non-GET, it can determine that the cache hit result of URL is not hit by for caching;If It when the field value of Method fields is GET, then needs to continue to judge, that is, is based on being cached in the relevant field of HTTP cachings Mechanism Cache-control fields determine the cache hit result of URL.
Further, determine URL's based on caching mechanism Cache-control fields in the relevant field of HTTP cachings The step of cache hit result, specifically includes:Obtain the field value of Cache-control fields;When Cache-control fields Field value include when not caching no-store, determine that the cache hit result of URL is not hit by for caching;When Method fields When field value includes cache-time max-age > 0 and does not include no-store, determine the cache hit result of URL as caching and Hit;When the field value of Method fields is other values in addition to no-store and max-age > 0, based on delaying with HTTP Deposit the cache hit result that time Expires field of exceeding the time limit in relevant field determines URL with request delivery time date fields.
Wherein, the caching mechanism of URL includes a variety of, for example, without caching, caching period, caching more than zero etc. In zero period etc., the caching mechanism of URL can be determined by field Cache-control.Cache-control's Field value includes max-age, s-maxage, no-cache, no-store etc..Max-age, which represents that setting caching is maximum, to be had The time is imitated, defines the size of effective time, without the time point being to determine, unit is the second;S-maxage is similar to max-age, But it is served only for public affairs to enjoy slow (e.g.proxy);No-cache represents that response will not be buffered, but asks to provide to server end in real time Source;No-store expressions respond will not all be buffered, and will not be written in the disk of client in any condition, this Being also based on the response of certain sensitivities of security consideration can just use.So if the field value of Cache-control includes No-store, then explanation can not be in locally retention copy, that is, the cache hit result for determining URL is that caching is not hit by;If it takes Do not include no-store in value, be more than 0 comprising max-age and its value, then show to specify the time of content caching, that is, determine The cache hit result of URL is caching and hits;If Cache-control field values are except no-store and max-age > 0 Except other values, then need to continue to judge, exceed the time limit time Expires field and to ask in relevant field based on caching with HTTP Delivery time date fields is asked to determine the cache hit result of URL.
For example, the field value of Cache-control fields is max-age=604800 in some URL, expression can be in local Stored copies 5184000 seconds (i.e. 60 days), the field value of Cache-control fields is max-age > 0 at this time, i.e. this URL's When caching mechanism is period of the caching more than zero, judge the cache hit result of this URL to cache and hitting.
Further, based on the caching that URL is determined with Expires fields and date fields in the relevant field of HTTP cachings The step of hit results, can specifically include:Obtain the field value of Expires fields and date fields;When Expires fields When time represented by field value is earlier than time represented by the field value of date fields, the cache hit result for determining URL is Caching is not hit by;When the time represented by the field value of Expires fields earlier than the field value of date fields represented by time When, the cache hit result of URL is determined as caching and is hit;When the field value that can not obtain Expires fields, based on HTTP caches entity tag Etag fields and last modification time Last-modified fields in relevant field and determines URL's Cache hit result.
Wherein, Expires fields represent the existence time of URL corresponding contents.Date header fields represent what request message was sent Time, the descriptor format of time can be defined by rfc822.As expires≤date, content existence time, which is consistently less than, to be worked as Preceding time, description are not newest always namely can not hit;If expires > date, description can be The local time span for retaining (epxires-date), that is, cache and hit;If there is no Expires fields, need to continue Judge.
For example, the field value of Expires fields is Tue, 06Sep 2,016 02 in some cacheable url:02:37GMT, The field value of Date fields is Tue, 06Sep 2,016 02:02:38GMT therefore deduces that the field value of Epxires is less than At the time of at the time of in the field value of Date, i.e. Expires earlier than Date, judge that this cacheable url corresponding content needs again Website is corresponded to cacheable url to obtain.
Further, URL is determined based on Etag fields and Last-modified fields in the relevant field of HTTP cachings Cache hit result the step of include:Judge URL with HTTP cache relevant field whether include Etag fields and/or Last-modified fields;Include Etag fields and/or Last-modified words when URL and HTTP caches relevant field Duan Shi determines the cache hit result of URL as caching and hits;Do not include Etag when URL and HTTP caches relevant field When field and Last-modified fields, determine that the cache hit result of URL is not hit by for caching.
Wherein, when caching relevant field with HTTP, at least there are one of Etag and Last-modified the two fields When, it indicating URL corresponding contents and update is judged whether there is after being locally stored, supporting paper has in the condition being locally stored, It caches and hits.So include Etag fields and/or Last-modified words when URL and HTTP caches relevant field Duan Shi determines the cache hit result of URL as caching and hits;Do not include Etag when URL and HTTP caches relevant field When field and Last-modified fields, determine that the cache hit result of URL is not hit by for caching.
It is understood that in embodiments of the present invention, before step 102, the method further includes:From the visit of user It asks and domain name is obtained in data;Judge whether domain name is the domain name for needing to cache;When whether domain name is the domain name for needing to cache, hold Row step is detached from URL caches relevant field with hypertext transfer protocol HTTP.
It should be noted that when the access data to user is needed to judge whether to need caching, can generally obtain simultaneously Domain name and URL, then first judge domain name, judge whether domain name is the domain name for needing to cache, when whether domain name is to need During the domain name to be cached, judge to URL, perform step and detached from URL and hypertext transfer protocol HTTP caching phases The field of pass.
It is understood that it in embodiments of the present invention, can also be counted according to the cache hit result of URL in each domain name The hit rate of caching is calculated, can specifically perform and be:It is caching and life to count cache hit result in each URL for belonging to same domain name In URL number;URL number for belonging to cache hit is accounted for the ratio of the sum for each URL for belonging to same domain name as target The hit rate of domain name.
Wherein, by the judgement of step 130, the cache hit of each URL has been obtained as a result, so converging each URL Cache hit as a result, can count belong to caching and URL number of hit in same domain name, then calculating belongs to caching And URL number of hit accounts for the ratio for belonging to the sum of each URL in same domain name, you can obtains the cache hit of this domain name Rate.
It should be noted that during judging the cache hit result of URL by step 130 in the above-described embodiments, Each URL may not all including above-mentioned deterministic process involved in field, if judging delaying for each URL as procedure described above The process of hit results is deposited, URL does not include the certain field involved in above-mentioned deterministic process, then can skip the judgement of this field Process is judged according to other URL fields included.For example, it is assumed that the word in the HTTPrequest header of some URL Do not include Method fields in section, can not judge the request method of this URL, then can skip the deterministic process of this field, i.e., this When the field value of Code fields is 200, based on caching caching mechanism Cache-control words in relevant field with HTTP Section determines the cache hit result of URL.
The embodiment of the present invention realize to aiming field it is entitled cache in the case of, anticipation target domain name adds in caching Cache hit rate afterwards, solves that domain name hit rate calculating cycle in backward analysis method in the prior art is long, risk is high asks Topic.
Fig. 4 shows the schematic block diagram of the anticipation device 200 of domain name cache hit rate according to embodiments of the present invention.Such as Shown in Fig. 4, which includes:
Acquiring unit 201, for from the access data acquisition uniform resource position mark URL of user;
Separative element 202, for the separation from the URL and the relevant field of hypertext transfer protocol HTTP cachings;
Determination unit 203, for based on the cache hit knot that the URL is determined with the relevant field of HTTP cachings Fruit.
The URL that user accesses is obtained in the embodiment of the present invention from the data that user accesses, and is based on isolating from URL Go out cache relevant field with HTTP determine the cache hit of URL as a result, so as to according to cache hit result to URL whether Caching is judged.In this way, being not required to accumulate sample, calculating hit rate can be carried out by user data, do not need to be colored Take longer time;And it does not need to first be cached domain name and can determine that cache hit as a result, avoiding aiming field first Name cached so as to cause cache resources waste situation.
It is understood that described cache relevant field including in HTTP request header field request header with HTTP Field and/or http response header field response header in field.
It is understood that the cache hit result includes caching and hit, caching are not hit by or do not cache, wherein, The acquiring unit 201 is additionally operable to obtain the field value for caching relevant field middle port Port fields with HTTP;
The determination unit 203 is additionally operable to, when the field value of the Port fields is non-80 port, determine the URL's Cache hit result is not cached to be described;And for when the field value of the Port fields be 80 port when, based on it is described with HTTP caches the cache hit result that return code Code fields in relevant field determine the URL.
It is understood that the acquiring unit 201 is additionally operable to obtain the field value of the Code fields;
The determination unit 203 is additionally operable to, when the field value of the Code fields is 304, determine the caching of the URL Hit results are the caching and hit;And for when the field value of the Code fields be 200 when, based on it is described with HTTP caches the cache hit result that request method Method fields in relevant field determine the URL.
It is understood that the acquiring unit 201 is additionally operable to obtain the field value of the Method fields;
The determination unit 203 is additionally operable to, when the field value of the Method fields is non-GET, determine the URL's Cache hit result is not hit by for the caching;And for when the field value of the Method fields be GET when, based on institute State the cache hit result for caching caching mechanism Cache-control fields in relevant field with HTTP and determining the URL.
It is understood that the acquiring unit 201 is additionally operable to obtain the field value of the Cache-control fields;
The determination unit 203 is additionally operable to include not caching no- when the field value of the Cache-control fields During store, determine that the cache hit result of the URL is not hit by for the caching;And for working as the Method fields When field value includes cache-time max-age > 0 and do not include no-store, the cache hit result for determining the URL is institute State caching and hit;And for working as the field value of the Method fields in addition to no-store and max-age > 0 During other values, exceed the time limit in relevant field time Expires field and request delivery time date are cached with HTTP based on described Field determines the cache hit result of the URL.
It is understood that device 200 can also include:
First judging unit, for judging that the URL's caches whether relevant field includes the Etag words with HTTP Section and/or the Last-modified fields;
The determination unit 203 is additionally operable to include the Etag fields when the URL and HTTP caches relevant field And/or during the Last-modified fields, the cache hit result for determining the URL is the caching and hit;And Relevant field, which is cached, with HTTP for working as the URL does not include the Etag fields and the Last-modified fields When, determine that the cache hit result of the URL is not hit by for the caching.
It is understood that device 200 can also include:
The acquiring unit 201 is additionally operable to obtain domain name from the access data of the user;
Second judgment unit, for judging whether domain name is to need the domain name that caches;
The separative element 202 be additionally operable to when domain name whether be need cache domain name when, perform the step from Separation caches relevant field with hypertext transfer protocol HTTP in the URL.
The anticipation device 200 of domain name cache hit rate according to embodiments of the present invention may correspond to according to embodiments of the present invention Domain name cache hit rate pre-judging method in executive agent, and domain name cache hit rate anticipation device 200 in it is each Above and other operation and/or function of a unit is respectively in order to realize the corresponding flow of each method in Fig. 1, for letter Clean, details are not described herein.
Fig. 5 is the schematic block diagram of the anticipation equipment 300 of domain name cache hit rate according to embodiments of the present invention.Such as Fig. 5 Shown, equipment 300 includes processor 301, memory 302 and communication interface 303, and memory 302 is used to store executable journey Sequence code, processor 301 are run and executable program code by reading the executable program code stored in memory 302 Corresponding program, communication interface 303 is used for and external device communication, such as communicates with terminal, website etc., and equipment 300 is also Can include bus 304, bus 304 be used for connection processing device 301, memory 302 and communication interface 303, make processor 301, Memory 302 and communication interface 303 are in communication with each other by bus 304.
Specifically, processor 301 is additionally operable to perform a kind of pre-judging method of domain name cache hit rate;Wherein, domain name caches The pre-judging method of hit rate includes:
From the access data acquisition uniform resource position mark URL of user;
Separation caches relevant field with hypertext transfer protocol HTTP from the URL;
Based on the cache hit result that the URL is determined with the relevant field of HTTP cachings.
The anticipation equipment 300 of domain name cache hit rate according to embodiments of the present invention may correspond to according to embodiments of the present invention Domain name cache hit rate pre-judging method in executive agent, it is and upper in the anticipation equipment 300 of domain name cache hit rate It states with other operation and/or functions respectively in order to realize the corresponding flow of each method in Fig. 1, for sake of simplicity, herein no longer It repeats.
Those of ordinary skill in the art may realize that each exemplary lists described with reference to the embodiments described herein Member and algorithm steps can be realized with the combination of electronic hardware, computer software or the two, in order to clearly demonstrate hardware With the interchangeability of software, each exemplary composition and step are generally described according to function in the above description.This A little functions are performed actually with hardware or software mode, specific application and design constraint depending on technical solution.Specially Industry technical staff can realize described function to each specific application using distinct methods, but this realization is not It is considered as beyond the scope of this invention.
It is apparent to those skilled in the art that for convenience of description and succinctly, foregoing description is The specific work process of system, device and unit can refer to the corresponding process in preceding method embodiment, and details are not described herein.
The above description is merely a specific embodiment, but protection scope of the present invention is not limited thereto, any Those familiar with the art in the technical scope disclosed by the present invention, can readily occur in various equivalent modifications or replace It changes, these modifications or substitutions should be covered by the protection scope of the present invention.Therefore, protection scope of the present invention should be with right It is required that protection domain subject to.

Claims (18)

1. a kind of pre-judging method of domain name cache hit rate, which is characterized in that the method includes:
From the access data acquisition uniform resource position mark URL of user;
Separation caches relevant field with hypertext transfer protocol HTTP from the URL;
Based on the cache hit result that the URL is determined with the relevant field of HTTP cachings.
2. according to the method described in claim 1, it is characterized in that, described include HTTP request with the relevant field of HTTP cachings The field in field and/or http response header field response header in header field request header.
3. according to the method described in claim 2, it is characterized in that, the cache hit result includes caching and hit, caching It is not hit by or does not cache, wherein, it is described based on the cache hit result that the URL is determined with the relevant field of HTTP cachings The step of include:
Obtain the field value that relevant field middle port Port fields are cached with HTTP;
When the field value of the Port fields is non-80 port, determine the cache hit result of the URL not cache;
When the field value of the Port fields is 80 port, return code Code in relevant field is cached with HTTP based on described Field determines the cache hit result of the URL.
4. according to the method described in claim 3, it is characterized in that, described returned based on described cached in relevant field with HTTP The step of code Code fields determine the cache hit result of the URL is returned to include:
Obtain the field value of the Code fields;
When the field value of the Code fields is 304, the cache hit result for determining the URL is the caching and hit;
When the field value of the Code fields is 200, request method in relevant field is cached with HTTP based on described Method fields determine the cache hit result of the URL.
5. according to the method described in claim 4, it is characterized in that, described please in relevant field based on described cached with HTTP The step of mode Method fields is asked to determine the cache hit result of the URL includes:
Obtain the field value of the Method fields;
When the field value of the Method fields is non-GET, determine that the cache hit result of the URL is not ordered for the caching In;
When the field value of the Method fields is GET, caching mechanism in relevant field is cached with HTTP based on described Cache-control fields determine the cache hit result of the URL.
6. according to the method described in claim 5, it is characterized in that, described delayed based on described cached in relevant field with HTTP The step of mechanism Cache-control fields determine the cache hit result of the URL is deposited to include:
Obtain the field value of the Cache-control fields;
When the field value of the Cache-control fields includes not caching no-store, the cache hit of the URL is determined As a result it is not hit by for the caching;
When the field value of the Method fields includes cache-time max-age > 0 and does not include no-store, determine described The cache hit result of URL is the caching and hit;
When the field value of the Method fields is other values in addition to no-store and max-age > 0, based on it is described with HTTP caches exceed the time limit in relevant field time Expires field and request delivery time date fields and determines that the URL's is slow Deposit hit results.
7. according to the method described in claim 6, it is characterized in that, described surpassed based on described cached in relevant field with HTTP The step of time phase Expires fields and request delivery time date fields determine the cache hit result of the URL includes:
Obtain the field value of the Expires fields and the date fields;
When the time represented by the field value of the Expires fields earlier than the field value of the date fields represented by time When, determine that the cache hit result of the URL is not hit by for the caching;
When the time represented by the field value of the Expires fields earlier than the field value of the date fields represented by time When, the cache hit result for determining the URL is the caching and hit;
When the field value that can not obtain the Expires fields, entity mark in relevant field is cached with HTTP based on described Label Etag fields and last modification time Last-modified fields determine the cache hit result of the URL.
8. the method according to the description of claim 7 is characterized in that described cached in relevant field in fact based on described with HTTP The step of body label E tag fields and last modification time Last-modified fields determine the cache hit result of the URL Including:
Judge that the URL's caches whether relevant field includes the Etag fields and/or the Last- with HTTP Modified fields;
Include the Etag fields and/or the Last-modified fields when the URL and HTTP caches relevant field When, the cache hit result for determining the URL is the caching and hit;
Do not include the Etag fields and the Last-modified fields when the URL and HTTP caches relevant field When, determine that the cache hit result of the URL is not hit by for the caching.
9. it according to the method described in claim 1, it is characterized in that, is assisted in the separation from the URL with Hyper text transfer Before discussing the step of HTTP caches relevant field, the method further includes:
Domain name is obtained from the access data of the user;
Judge whether domain name is the domain name for needing to cache;
When whether domain name is the domain name for needing to cache, performs the step and detached from the URL and Hyper text transfer Agreement HTTP caches relevant field.
10. a kind of anticipation device of domain name cache hit rate, which is characterized in that the anticipation device includes:
Acquiring unit, for from the access data acquisition uniform resource position mark URL of user;
Separative element, for the separation from the URL and the relevant field of hypertext transfer protocol HTTP cachings;
Identifying unit, for based on the cache hit result that the URL is determined with the relevant field of HTTP cachings.
11. device according to claim 10, which is characterized in that described to be asked with the relevant field of HTTP cachings including HTTP Ask the field in header field request header and/or the field in http response header field response header.
12. according to the devices described in claim 11, which is characterized in that the cache hit result includes caching and hits, is slow It deposits and is not hit by or does not cache, wherein, the acquiring unit is additionally operable to obtain the relevant field middle port of described and HTTP cachings The field value of Port fields;
The determination unit is additionally operable to, when the field value of the Port fields is non-80 port, determine the caching life of the URL Middle result is not cached to be described;And for when the field value of the Port fields is 80 port, being delayed based on described with HTTP Deposit the cache hit result that return code Code fields in relevant field determine the URL.
13. device according to claim 12, which is characterized in that the acquiring unit is additionally operable to obtain the Code fields Field value;
The determination unit is additionally operable to, when the field value of the Code fields is 304, determine the cache hit result of the URL For the caching and hit;And for when the field value of the Code fields is 200, phase to be cached with HTTP based on described Request method Method fields determine the cache hit result of the URL in the field of pass.
14. device according to claim 13, which is characterized in that the acquiring unit is additionally operable to obtain the Method words The field value of section;
The determination unit is additionally operable to, when the field value of the Method fields is non-GET, determine the cache hit of the URL As a result it is not hit by for the caching;And for when the field value of the Method fields be GET when, based on described and HTTP Cache the cache hit result that caching mechanism Cache-control fields in relevant field determine the URL.
15. device according to claim 14, which is characterized in that the acquiring unit is additionally operable to obtain the Cache- The field value of control fields;
The determination unit is additionally operable to when the field value of the Cache-control fields includes not caching no-store, really The cache hit result of the fixed URL is not hit by for the caching;And include for working as the field value of the Method fields Cache-time max-age > 0 and not include no-store when, determine the URL cache hit result be the caching and life In;And for when the field value of the Method fields is other values in addition to no-store and max-age > 0, base Time Expires field of exceeding the time limit in the relevant field with HTTP cachings and request delivery time date fields determine described The cache hit result of URL.
16. device according to claim 15, which is characterized in that described device further includes:
First judging unit, for judge the URL with HTTP cache relevant field whether include the Etag fields and/ Or the Last-modified fields;
The determination unit is additionally operable to include the Etag fields and/or institute when the URL and HTTP caches relevant field When stating Last-modified fields, the cache hit result for determining the URL is the caching and hit;And for working as When caching relevant field including the Etag fields and the Last-modified fields with HTTP of URL is stated, determines institute The cache hit result for stating URL is not hit by for the caching.
17. device according to claim 10, which is characterized in that the acquiring unit is additionally operable to the access from the user Domain name is obtained in data;
Second judgment unit, for judging whether domain name is to need the domain name that caches;
The separative element is additionally operable to, when whether domain name is the domain name for needing to cache, perform the step from the URL Middle separation caches relevant field with hypertext transfer protocol HTTP.
18. a kind of anticipation equipment of domain name cache hit rate, which is characterized in that the anticipation equipment includes:
Memory, processor, communication interface and bus;
The memory, the processor are connected by the bus with the communication interface and complete mutual communication;
The memory is used to store program code;
The processor is run and the executable program by reading the executable program code stored in the memory The corresponding program of code, for performing a kind of pre-judging method of domain name cache hit rate;Wherein, domain name cache hit rate Pre-judging method include:
From the access data acquisition uniform resource position mark URL of user;
Separation caches relevant field with hypertext transfer protocol HTTP from the URL;
Based on the cache hit result that the URL is determined with the relevant field of HTTP cachings.
CN201611243260.7A 2016-12-28 2016-12-28 Method, device and equipment for prejudging domain name cache hit rate Active CN108259198B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611243260.7A CN108259198B (en) 2016-12-28 2016-12-28 Method, device and equipment for prejudging domain name cache hit rate

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611243260.7A CN108259198B (en) 2016-12-28 2016-12-28 Method, device and equipment for prejudging domain name cache hit rate

Publications (2)

Publication Number Publication Date
CN108259198A true CN108259198A (en) 2018-07-06
CN108259198B CN108259198B (en) 2021-08-06

Family

ID=62719770

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611243260.7A Active CN108259198B (en) 2016-12-28 2016-12-28 Method, device and equipment for prejudging domain name cache hit rate

Country Status (1)

Country Link
CN (1) CN108259198B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110674169A (en) * 2019-08-30 2020-01-10 北京浪潮数据技术有限公司 Website database protection method and related device
CN110912769A (en) * 2019-11-12 2020-03-24 中移(杭州)信息技术有限公司 CDN cache hit rate statistical method, system, network device and storage medium
CN111104528A (en) * 2018-10-29 2020-05-05 浙江宇视科技有限公司 Picture obtaining method and device and client

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090287761A1 (en) * 2008-05-13 2009-11-19 International Business Machines Corporation Cached message distribution via http redirects
CN102075570A (en) * 2010-12-31 2011-05-25 南京中兴特种软件有限责任公司 Method for implementing HTTP (hyper text transport protocol) message caching mechanism based on keywords
CN103685317A (en) * 2013-12-31 2014-03-26 山石网科通信技术有限公司 Protection system and device for domain name system
CN104021028A (en) * 2014-05-16 2014-09-03 深圳市深信服电子科技有限公司 Web buffering method and device in virtual machine environment
CN104615597A (en) * 2013-11-04 2015-05-13 腾讯科技(深圳)有限公司 Method, device and system for clearing cache file in browser
CN105302801A (en) * 2014-05-27 2016-02-03 腾讯科技(深圳)有限公司 Resource caching method and apparatus
CN105930528A (en) * 2016-06-03 2016-09-07 腾讯科技(深圳)有限公司 Webpage cache method and server

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090287761A1 (en) * 2008-05-13 2009-11-19 International Business Machines Corporation Cached message distribution via http redirects
CN102075570A (en) * 2010-12-31 2011-05-25 南京中兴特种软件有限责任公司 Method for implementing HTTP (hyper text transport protocol) message caching mechanism based on keywords
CN104615597A (en) * 2013-11-04 2015-05-13 腾讯科技(深圳)有限公司 Method, device and system for clearing cache file in browser
CN103685317A (en) * 2013-12-31 2014-03-26 山石网科通信技术有限公司 Protection system and device for domain name system
CN104021028A (en) * 2014-05-16 2014-09-03 深圳市深信服电子科技有限公司 Web buffering method and device in virtual machine environment
CN105302801A (en) * 2014-05-27 2016-02-03 腾讯科技(深圳)有限公司 Resource caching method and apparatus
CN105930528A (en) * 2016-06-03 2016-09-07 腾讯科技(深圳)有限公司 Webpage cache method and server

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111104528A (en) * 2018-10-29 2020-05-05 浙江宇视科技有限公司 Picture obtaining method and device and client
CN111104528B (en) * 2018-10-29 2023-05-16 浙江宇视科技有限公司 Picture acquisition method and device and client
CN110674169A (en) * 2019-08-30 2020-01-10 北京浪潮数据技术有限公司 Website database protection method and related device
CN110674169B (en) * 2019-08-30 2022-06-10 北京浪潮数据技术有限公司 Website database protection method and related device
CN110912769A (en) * 2019-11-12 2020-03-24 中移(杭州)信息技术有限公司 CDN cache hit rate statistical method, system, network device and storage medium
CN110912769B (en) * 2019-11-12 2021-08-10 中移(杭州)信息技术有限公司 CDN cache hit rate statistical method, system, network device and storage medium

Also Published As

Publication number Publication date
CN108259198B (en) 2021-08-06

Similar Documents

Publication Publication Date Title
CN104735112B (en) Send method, the method and apparatus of cache resource file of resource file
US8135829B2 (en) Utilizing a single agent on a non-origin node for measuring the roundtrip response time of web pages with embedded HTML frames
Ihm et al. Towards understanding modern web traffic
US20100235522A1 (en) Session-cache-based http acceleration
JP4046328B2 (en) Collection of enriched web server activity data for cached web content
US7003565B2 (en) Clickstream data collection technique
CN104980478B (en) Sharing method, equipment and system are cached in content distributing network
CN103257989B (en) Web page download time is analyzed
CN104731690B (en) Adaptive metrology collection, storage and warning threshold
US6848000B1 (en) System and method for improved handling of client state objects
US7877491B2 (en) Cookie invalidation or expiration by a switch
CN105306465B (en) Web portal security accesses implementation method and device
CN108259425A (en) The determining method, apparatus and server of query-attack
CN104885064B (en) The method and apparatus that data high-speed for managing computer system caches
CN108259198A (en) A kind of pre-judging method, device and the equipment of domain name cache hit rate
CN104615597B (en) The methods, devices and systems of cache file are removed in browser
CN103618799B (en) Browser rs cache processing method, system and proxy server
CN117321589A (en) Web crawling by using proxy and application thereof
CN106161623A (en) Caching server, renewal server and data-updating method
CN105279156B (en) Network information communication means and network information browsing apparatus
CN107025226A (en) Targeted sites access method, device and transfer server
Casilari et al. Modeling of HTTP traffic
JP2013218505A (en) Communication device and system for relaying communication between client and server
CN107645543A (en) Method and system applied to the non-80 caching miniport services of caching server HTTP
CN113055503B (en) IPv6 webpage link processing method, device, equipment and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant