CN106612336A - Picture preloading method and picture preloading device - Google Patents

Picture preloading method and picture preloading device Download PDF

Info

Publication number
CN106612336A
CN106612336A CN201510689435.6A CN201510689435A CN106612336A CN 106612336 A CN106612336 A CN 106612336A CN 201510689435 A CN201510689435 A CN 201510689435A CN 106612336 A CN106612336 A CN 106612336A
Authority
CN
China
Prior art keywords
address
domain names
picture
network
file
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
CN201510689435.6A
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 Gridsum Technology Co Ltd
Original Assignee
Beijing Gridsum 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 Gridsum Technology Co Ltd filed Critical Beijing Gridsum Technology Co Ltd
Priority to CN201510689435.6A priority Critical patent/CN106612336A/en
Publication of CN106612336A publication Critical patent/CN106612336A/en
Pending legal-status Critical Current

Links

Classifications

    • 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]

Landscapes

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

Abstract

The application discloses a picture preloading method and a picture preloading device. The method comprises the following steps: receiving the network address and target identifier of a to-be-preloaded picture on a content delivery network, wherein the target identifier is the service provider identifier of the content delivery network; extracting a network domain name from the network address of the to-be-preloaded picture; acquiring an IP address corresponding to the network domain name from a preset database, wherein different network domain names correspond to different IP addresses; and associating the network domain name with the IP address corresponding to the network domain name. According to the application, the technical problem that a mobile terminal cannot preload a picture is solved.

Description

Picture preloads method and apparatus
Technical field
The application is related to data processing field, and in particular to a kind of picture method and apparatus is preloaded.
Background technology
CDN (Content Delivery Network) is content distributing network, is reached using the service of distributed cache node To the purpose that zones of different netizen optimizes to the access speed of website, preloading is that common optimization CDN accesses resource speed Method, can just allow the CDN node pre-cache URL before netizen accesses a URL.The mode of preloading is Before netizen does not also send access, intensively request is sent to CDN node using different browsers, download needs pre-add The URL of load.Different browsers and client UA (User Agent) may need to be preloaded respectively, for example:Make With the red fox browser of PC to after the pictures of node visit one, the picture is again by other PCs red fox browser access When will be hit states, i.e. cache hit, take a secondary data without the need for Hui Yuanzai, but mobile phone is when removing to access again the picture, Acquiescence compression in the http header that may be carried because of UA differences, mobile phone browser is required different and causes node to be recognized For the request triggering miss actions, i.e., do not cache, need Hui Yuan to pull.
Because the differences such as different browser UA, mobile phone and PC are also differed to the http header that same URL sends, Most CDN manufacturers support that PC ends preload, but do not support that mobile phone terminal URL is preloaded, if that is, mobile phone is to CDN node Non-hot picture is asked, then node needs to return source station pulling data temporarily, reduces access speed.
For above-mentioned problem, effective solution is not yet proposed at present.
The content of the invention
The embodiment of the present application provides a kind of picture and preloads method and apparatus, can not be preloaded with least solving mobile terminal The technical problem of picture.
According to the one side of the embodiment of the present application, there is provided a kind of picture pre-add support method, including:Receive content point The network address of picture to be preloaded and target identification on hairnet network, wherein, the target identification is the content distribution Service provider's mark of network;Domain names are extracted from the network address of the picture to be preloaded;From presetting database It is middle to obtain the corresponding IP address of the domain names, wherein, the different IP address of different domain names correspondences;Close Join the domain names and IP address corresponding with the domain names.
Further, the corresponding IP address of the domain names is obtained from presetting database to be included:From the present count According to searching destination application DLL corresponding with the target identification in storehouse, wherein, in the presetting database The corresponding relation of service provider's mark and the application programming interface of being stored with;Send out to the destination application DLL Send the request comprising the domain names;Receive the file that the destination application DLL responds the request; And the IP address in the extraction file, obtain the corresponding IP address of the domain names.
Further, associating the domain names and IP address corresponding with the domain names includes:Traversal with it is described The corresponding IP address of domain names, often traverses an IP address, by the IP address for traveling through out and the domain names Combination is stored to inquiry file, wherein, the inquiry file is the file for accessing the domain names.
Further, before domain names are extracted from the network address of the picture to be preloaded, methods described is also Including:The first matched is constructed, wherein, first matched is for from the network of the picture to be preloaded ground The matched of the domain names is extracted in location.
Further, the IP address in the file is extracted, before obtaining the corresponding IP address of the domain names, Methods described also includes:Construct the second matched, wherein, second matched be for extracting the file in The matched of IP address.
According to the another aspect of the embodiment of the present application, there is provided a kind of picture pre-load means, including:Receiving unit, For receiving the network address of picture to be preloaded and target identification on content distributing network, wherein, the target identification Service provider for the content distributing network identifies;Extraction unit, for from the network address of the picture to be preloaded Middle extraction domain names;Acquiring unit, for obtaining the corresponding IP address of the domain names from presetting database, Wherein, the different IP address of different domain names correspondences;Associative cell, for associate the domain names and with institute State the corresponding IP address of domain names.
Further, the acquiring unit includes:Subelement is searched, for searching and institute from the presetting database The corresponding destination application DLL of target identification is stated, wherein, be stored with service mark in the presetting database Know the corresponding relation with application programming interface;Subelement is sent, for the destination application DLL Send the request comprising the domain names;Receiving subelement, rings for receiving the destination application DLL Answer the file of the request;And extract subelement, for extracting the file in IP address, obtain the network The corresponding IP address of domain name.
Further, the associative cell includes:Traversal subelement, for traveling through IP corresponding with the domain names Address, often traverses an IP address, and the IP address for traveling through out and domain names combination are stored to inquiry text Part, wherein, the inquiry file is the file for accessing the domain names.
Further, described device also includes:First structural unit, waits to preload for the extraction unit from described Extract in the network address of picture before domain names, construct the first matched, wherein, first matched is use In the matched that the domain names are extracted from the network address of the picture to be preloaded.
Further, described device also includes:Second structural unit, for the extraction subelement file is extracted In IP address, before obtaining the corresponding IP address of the domain names, construct the second matched, wherein, it is described Second matched be for extracting the file in IP address matched.
In the embodiment of the present application, using the network address and service for receiving picture to be preloaded on content distributing network The mark of business, from the network address of picture to be preloaded domain names are extracted, and are obtained from the database for pre-setting The corresponding IP address of domain names is taken, the corresponding IP address of domain names and domain names is set up the mode for associating, Realize fixed ip address and access the preloading mode for specifying domain names, solving mobile terminal in prior art can not be pre- The technical problem for Loading Image, has reached the technique effect that mobile terminal preloads picture.
Description of the drawings
Accompanying drawing described herein is used for providing further understanding of the present application, constitutes the part of the application, this Shen Schematic description and description please does not constitute the improper restriction to the application for explaining the application.In accompanying drawing In:
Fig. 1 is the flow chart of the picture pre-add support method according to the embodiment of the present application;And
Fig. 2 is the schematic diagram of the picture pre-load means according to the embodiment of the present application.
Specific embodiment
In order that those skilled in the art more fully understand application scheme, below in conjunction with the embodiment of the present application Accompanying drawing, is clearly and completely described to the technical scheme in the embodiment of the present application, it is clear that described embodiment The only embodiment of the application part, rather than the embodiment of whole.Based on the embodiment in the application, ability The every other embodiment that domain those of ordinary skill is obtained under the premise of creative work is not made, all should belong to The scope of the application protection.
It should be noted that the description and claims of this application and the term " first " in above-mentioned accompanying drawing, " Two " it is etc. the object for distinguishing similar, without for describing specific order or precedence.It should be appreciated that this The data that sample is used can be exchanged in the appropriate case, so as to embodiments herein described herein can with except Here the order beyond those for illustrating or describing is implemented.Additionally, term " comprising " and " having " and they Any deformation, it is intended that covering is non-exclusive to be included, and for example, contains process, the side of series of steps or unit Method, system, product or equipment are not necessarily limited to those steps clearly listed or unit, but may include unclear List or other steps intrinsic for these processes, method, product or equipment or unit.
First description below is made to the technical term involved by the embodiment of the present application:
Content distributing network (Content Delivery Network, referred to as, CDN):Content distributing network it is basic Thinking is the bottleneck and link for avoiding being possible to affect data transmission bauds and stability on internet as far as possible, makes content Transmit faster, it is more stable.The general principle of content distributing network is widely used various caching servers, by these Caching server is distributed in area or the network that user accesses Relatively centralized, when user accesses website, using the overall situation Load technology points to the access of user on closest caching server working properly, direct by caching server Response user's request.Its objective is to make user nearby to obtain required content, solve the crowded situation of Internet network, Improve the response speed that user accesses website.
Browser mark (User Agent, referred to as, UA):Browser mark can enable the server to identifying user The operating system for using and version, cpu type, browser and version, browser renders engine, browser language, Browser plug-in, so as to judge that user is to browse using computer or mobile phone is browsed, allows webpage to make automatically adaptation.
Application programming interface (Application Programming Interface, referred to as, API):Using journey Sequence DLL is some predefined functions, it is therefore an objective to provide application program with developer based on certain software or hard Part is able to access the ability of one group of routine, and need not access source code, or the details for understanding internal work mechanism.
HyperText Markup Language (Hyper Text Markup Language, referred to as, HTML):On WWW one Individual media documents are referred to as a page (Page), and as a tissue or individual starting point is placed on the world wide web (www The page is referred to as homepage (Homepage) or homepage, and other related pages of sensing or other sections have been generally comprised in homepage Point pointer (hyperlink), so-called hyperlink is exactly a kind of URL pointers, by activate (click) it, can So that browser easily obtains new webpage.This is also that HTML obtains one of wide variety of major reason.In logic On will be regarded as an entirety a series of organic collection of pages be collectively referred to as website (Website or Site).Supertext Markup language is that a kind of markup language with other information designs that can be seen in web browser is created for webpage.It is super Text mark up language is the basis of ten thousand dimensions programming, is a kind of form of the text comprising hyperlink point." hypertext " is exactly Referring to can be comprising non-Literary Elements such as picture, link, or even music, programs in the page.The knot of HTML Structure includes " head " part (head) and " main body " part (body), wherein, " head " portion is provided with regard to webpage Information, " main body " part provides the particular content of webpage.
URL (Uniform Resource Locator, referred to as, URL):URL is It is standard on internet to the position of resource that can obtain from internet and a kind of succinct expression of access method The address of resource.Each file on internet has a unique URL, and the information that it is included points out the position of file Put and how browser should process it.
Regular expression:It is a concept of computer science also known as normal representation method, conventional expressing method.Canonical table Described using single character string up to formula, match a series of character strings for meeting certain syntactic rule.Compile in many texts In collecting device, regular expression is usually used to retrieval, replaces those texts for meeting certain pattern.
According to the embodiment of the present application, there is provided a kind of embodiment of picture pre-add support method, it should be noted that attached The step of flow process of figure is illustrated can perform in the such as computer system of one group of computer executable instructions, also, Although showing logical order in flow charts, in some cases, can be with different from order execution herein Shown or described step.
Fig. 1 is the flow chart of the picture pre-add support method according to the embodiment of the present application, as shown in figure 1, the method includes Following steps:
Step S102, receives the network address of picture to be preloaded and target identification on content distributing network, wherein, mesh It is designated service provider's mark of content distributing network.Content delivery network service business has multiple, and each service provider has one Individual service provider's mark is corresponded.User selects a service provider, is input into the mark of the service provider of its selection, i.e. mesh Mark mark, user also needs to be input into the network address of picture to be preloaded, and the network address of picture to be preloaded can be URL addresses.The network address of the picture to be preloaded that receive user is filled in and target identification.
Step S104, from the network address of picture to be preloaded domain names are extracted.That is, pre-add is treated from what is received Domain names are extracted in the network address for carrying picture.
Step S106, obtains the corresponding IP address of domain names from presetting database, wherein, different network domains The different IP address of name correspondence.That is, a database for pre-setting is there is, in this database network is store The corresponding relation of domain name and IP address, obtains the corresponding IP address of domain names from this database.
Step S108, related network domain name and IP address corresponding with domain names.I.e. domain names and network domains The corresponding IP address of name sets up association so that each domain names have specific IP address (can for one or It is multiple) correspond to therewith.
For example, user opens and is arranged on cell-phone customer terminal, is able to carry out the picture that the embodiment of the present application provided pre- The App (Android is identical with IOS interfaces) of loading method, the fill message on interface.It is able to carry out the embodiment of the present application The interface of the App of the picture pre-add support method for being provided can have various ways for user input information, and mode one is to use The full name of the content delivery network service business of its selection is directly filled at family, and mode two is that each content is shown in combobox The title of distribution network service provider is chosen for user, and mode three is the title of each service provider of showing interface and service The corresponding mark of business, user fills in mark and selects corresponding service provider, additionally, also alternate manner, is not limited to be lifted The three kinds of modes for going out.Illustrate in mode three as an example, service provider's first correspondence mark " 1 ", service provider's second correspondence is identified " 2 ", correspondence mark of service provider third " 3 ", service provider's fourth correspondence mark " 4 ", user fills in " 2 ", root on interface The information filled according to user, it can be determined that go out user and have selected service provider's second.User also fill in picture to be preloaded The network address, for example, the network address of the picture to be preloaded that user fills in is “http://www.baidu.com/test.jpg”.Receive the network address of the picture to be preloaded that user fills in “http://www.baidu.com/test.jpg " and service mark are known after " 2 ", extract from the network address Domain names " www.baidu.com ".
From the database for pre-setting, the corresponding IP address of domain names " www.baidu.com " is obtained.For example, The corresponding IP address of domain names " www.baidu.com " has 3, respectively IP address 1.2.3.4, IP address 1.2.3.5 with IP address 1.2.3.6.
Domain names " www.baidu.com " respectively with IP address " 1.2.3.4 ", IP address " 1.2.3.5 ", IP address " 1.2.3.6 " sets up contact.
By above-mentioned steps, the network address and the mark of service provider of picture to be preloaded on content distributing network are received, Domain names are extracted from the network address of picture to be preloaded, from the database for pre-setting domain names are obtained Corresponding IP address, sets up the corresponding IP address of domain names and domain names and associates, and realizes fixed ip address The preloading mode for specifying domain names is accessed, mobile terminal in prior art is solved and can not be preloaded the technology of picture and ask Topic, has reached the technique effect that mobile terminal preloads picture.
Alternatively, the corresponding IP address of domain names is obtained from presetting database to be included:Search from presetting database Destination application DLL corresponding with target identification, wherein, be stored with presetting database service provider mark and The corresponding relation of application programming interface;The request comprising domain names is sent to destination application DLL; Receive the file of destination application DLL respond request;And the IP address in extraction document, obtain network domains The corresponding IP address of name.
That is, store in the database for pre-setting content distributing network service provider and application programming interface it is right Should be related to, according to target identification, the application programming interface corresponding with target identification be searched from presetting database, Destination application DLL is searched, after finding destination application DLL, is compiled to destination application Journey interface send HTTP request, wherein, this request in contain the domain name to be inquired about (picture i.e. to be preloaded The domain names extracted in the network address), the service provider of content distributing network is received after this request, returns one Html file, this html file contains the corresponding whole node IP address of inquired about domain name, extracts this text IP address in part, has just obtained the corresponding IP address of domain names inquired about.
For example, it is assumed that one has 5 service providers, respectively first, service provider of service provider second, service provider third, service provider's fourth, Service provider penta.The corresponding mark of the full name of 5 service providers of App showing interfaces and service provider for user's selection, such as The corresponding mark of service provider's first is " h ", and the corresponding mark of service provider's second is " d ", and the corresponding mark of service provider third is " n ", The corresponding mark of service provider's fourth is " s ", and the corresponding mark of service provider penta is " e ".User input " s ", i.e. user Have selected service provider's fourth." s " is target identification.
The network address " the http of the picture to be preloaded that user fills in://www.baidu.com/test.jpg”.From net Domain names " www.baidu.com " are extracted in network address.
Store in the database for pre-setting service provider and API (Application Programming Interface, That is, application programming interface) corresponding relation, corresponding relation can be with as shown in table 1 below:
Table 1
Service provider API
Service provider's first API1
Service provider's second API2
Service provider third API3
Service provider's fourth API4
Service provider penta API5
I.e. service provider's first correspond to API1, and service provider's second correspond to API2, and service provider third correspond to API3, service provider Fourth correspond to API4, and service provider penta correspond to API5.
The corresponding relation of service provider's mark and API can also be store in the database for pre-setting, corresponding relation can be with It is as shown in table 2 below:
Table 2
Service provider identifies API
h API1
d API2
n API3
s API4
e API5
That is the mark " h " of service provider's first correspond to API1, and the mark " d " of service provider's second correspond to API2, service provider Third mark " n " correspond to API3, and the mark " s " of service provider's fourth correspond to API4, the mark " e " of service provider penta Correspond to API5.
Illustrate by taking latter corresponding relation as an example.The target identification " s " of receiving user's input, in corresponding relation It is API4 to inquire the corresponding application programming interface of target identification " s ".
HTTP request is sent to API4, domain names " www.baidu.com " are contained in request.Content delivery network Network service provider fourth returns a html file, and it is corresponding that this file contains domain names " www.baidu.com " Whole IP address, extract the whole IP address in this file, and the whole IP address for for example extracting have 3, It is respectively IP address " 1.2.3.4 ", IP address " 1.2.3.5 ", IP address " 1.2.3.6 ".Thus obtain The corresponding IP address of domain names " www.baidu.com ", is respectively IP address " 1.2.3.4 ", IP address " 1.2.3.5 ", IP address " 1.2.3.6 ".
Alternatively, related network domain name and IP address corresponding with domain names include:Traversal is corresponding with domain names IP address, often traverses an IP address, and the IP address for traveling through out and domain names combination are stored to inquiry file, Wherein, file of the file for access network domain name is inquired about.That is, whole corresponding with the domain names inquired about is got After IP address, these IP address are traveled through, often traverse an IP address, by this IP address and domain names In being combined and storing inquiry file.
For example, whole IP address one corresponding with domain names " www.baidu.com " have 3, respectively IP Address " 1.2.3.4 ", IP address " 1.2.3.5 ", IP address " 1.2.3.6 ".This 3 IP address are carried out time Go through, when IP address " 1.2.3.4 " is traversed, by IP address " 1.2.3.4 " and domain names " www.baidu.com " It is combined, stores to inquiry file.Combination follows form specified in inquiry file, for example, combination It is " 1.2.3.4www.baidu.com ".When IP address " 1.2.3.5 " is traversed, by IP address " 1.2.3.5 " It is combined with domain names " www.baidu.com ", stores to inquiry file.Traverse IP address " 1.2.3.6 " When, IP address " 1.2.3.6 " is combined with domain names " www.baidu.com ", store to inquiry file.
Alternatively, before domain names are extracted from the network address of picture to be preloaded, the embodiment of the present application is carried For picture pre-add support method also include:The first matched is constructed, wherein, the first matched is for from waiting to preload The matched of domain names is extracted in the network address of picture.That is, construct a matched, using this matched from Domain names are extracted in the network address of picture to be preloaded.This matched can be regular expression.
For example, the network address of picture to be preloaded is " http://www.baidu.com/test.jpg ", construction one Individual matched, extracts domain names " www.baidu.com ".This matched can be regular expression.
Regular expression has many usages, for example:Replace given content to replace, delete per line by line to end of line, numeral Designated character, matched character string of tail, etc..
Than if any two character strings:" 123451265345 " and " 2345 ", need " 345 " for deleting each character string end. Solution is as follows:In dialog box is replaced, " regular expression " check box is enabled, be input into inside content being searched " 345 $ ", wherein, " $ " is represented from end of line matching.
Alternatively, the IP address in extraction document, before obtaining the corresponding IP address of domain names, the application reality Applying the picture pre-add support method that example provided also includes:The second matched is constructed, wherein, the second matched is for carrying Take the matched of the IP address in file.That is, the service provider of content distributing network corresponds to HTTP request file, returns A html file is returned, the corresponding whole IP address of nslookup are contained in this html file, these IP ground Location is tape format label, and format tags are unwanted in follow-up operation, constructs a matched, is used This matched matches all IP address without format tags.This matched can be regular expression.
The App of picture pre-add support method provided by being possible to perform the embodiment of the present application is arranged on and escapes from prison or root On the mobile phone (mobile phone, the mobile phone is used by webmaster) crossed, mobile phone operation App goes to read CDN sections The URL of point and preloading picture, using the true UA of mobile phone itself HTTP request is sent to node, so that node is pre- slow Deposit picture.
According to the embodiment of the present application, a kind of embodiment of picture pre-load means is additionally provided.The picture pre-load means Above-mentioned picture pre-add support method can be performed, above-mentioned picture pre-add support method can also pass through the picture pre-load means reality Apply.
Fig. 2 is the schematic diagram of the picture pre-load means according to the embodiment of the present application.As shown in Fig. 2 the picture pre-add Carry put including:Receiving unit 22, extraction unit 24, acquiring unit 26 and associative cell 28.
Receiving unit 22, for receiving the network address of picture to be preloaded and target identification on content distributing network, its In, target identification is identified for the service provider of content distributing network.Content delivery network service business has multiple, each service Shang Youyige service providers mark is corresponded.User selects a service provider, is input into the mark of the service provider of its selection, That is target identification, user also needs to be input into the network address of picture to be preloaded, and the network address of picture to be preloaded can Being URL addresses.The network address of the picture to be preloaded that receive user is filled in and target identification.
Extraction unit 24, for extracting domain names from the network address of picture to be preloaded.That is, from receiving Domain names are extracted in the network address of picture to be preloaded.
Acquiring unit 26, for obtaining the corresponding IP address of domain names from presetting database, wherein, it is different The different IP address of domain names correspondence.That is, a database for pre-setting is there is, is stored in this database The corresponding relation of domain names and IP address, the corresponding IP address of domain names is obtained from this database.
Associative cell 28, for related network domain name and IP address corresponding with domain names.I.e. domain names and The corresponding IP address of domain names sets up association so that it (can be one that each domain names has specific IP address It is individual or multiple) correspond to therewith.
For example, user opens and is arranged on cell-phone customer terminal, is able to carry out the picture that the embodiment of the present application provided pre- The App (Android is identical with IOS interfaces) of loading method, the fill message on interface.It is able to carry out the embodiment of the present application The interface of the App of the picture pre-add support method for being provided can have various ways for user input information, and mode one is to use The full name of the content delivery network service business of its selection is directly filled at family, and mode two is that each content is shown in combobox The title of distribution network service provider is chosen for user, and mode three is the title of each service provider of showing interface and service The corresponding mark of business, user fills in mark and selects corresponding service provider, additionally, also alternate manner, is not limited to be lifted The three kinds of modes for going out.Illustrate in mode three as an example, service provider's first correspondence mark " 1 ", service provider's second correspondence is identified " 2 ", correspondence mark of service provider third " 3 ", service provider's fourth correspondence mark " 4 ", user fills in " 2 ", root on interface The information filled according to user, it can be determined that go out user and have selected service provider's second.User also fill in picture to be preloaded The network address, for example, the network address of the picture to be preloaded that user fills in is “http://www.baidu.com/test.jpg”.Receive the network address of the picture to be preloaded that user fills in “http://www.baidu.com/test.jpg " and service mark are known after " 2 ", extract from the network address Domain names " www.baidu.com ".
From the database for pre-setting, the corresponding IP address of domain names " www.baidu.com " is obtained.For example, The corresponding IP address of domain names " www.baidu.com " has 3, respectively IP address 1.2.3.4, IP address 1.2.3.5 with IP address 1.2.3.6.
Domain names " www.baidu.com " respectively with IP address " 1.2.3.4 ", IP address " 1.2.3.5 ", IP address " 1.2.3.6 " sets up contact.
The picture pre-load means that the embodiment of the present application is provided, are received by receiving unit 22 and are treated on content distributing network The network address of the picture of preloading and the mark of service provider, extraction unit 24 is from the network address of picture to be preloaded Domain names are extracted, acquiring unit 26 obtains the corresponding IP address of domain names from the database for pre-setting, Associative cell 28 is set up the corresponding IP address of domain names and domain names and is associated, and realizes fixed ip address access The preloading mode of specified domain names, solving mobile terminal in prior art can not preload the technical problem of picture, The technique effect that mobile terminal preloads picture is reached.
Alternatively, acquiring unit 26 includes searching subelement, send subelement, receiving subelement and extracting subelement. Searching subelement is used to search destination application DLL corresponding with target identification from presetting database, wherein, The corresponding relation of service provider's mark and the application programming interface of being stored with presetting database.Send subelement be used for Destination application DLL sends the request comprising domain names.Receiving subelement is used to receive destination application The file of DLL respond request.The IP address that subelement is used in extraction document is extracted, domain names correspondence is obtained IP address.
That is, store in the database for pre-setting content distributing network service provider and application programming interface it is right Should be related to, according to target identification, the application programming interface corresponding with target identification be searched from presetting database, Destination application DLL is searched, after finding destination application DLL, is compiled to destination application Journey interface send HTTP request, wherein, this request in contain the domain name to be inquired about (picture i.e. to be preloaded The domain names extracted in the network address), the service provider of content distributing network is received after this request, returns one Html file, this html file contains the corresponding whole node IP address of inquired about domain name, extracts this text IP address in part, has just obtained the corresponding IP address of domain names inquired about.
For example, it is assumed that one has 5 service providers, respectively first, service provider of service provider second, service provider third, service provider's fourth, Service provider penta.The corresponding mark of the full name of 5 service providers of App showing interfaces and service provider for user's selection, such as The corresponding mark of service provider's first is " h ", and the corresponding mark of service provider's second is " d ", and the corresponding mark of service provider third is " n ", The corresponding mark of service provider's fourth is " s ", and the corresponding mark of service provider penta is " e ".User input " s ", i.e. user Have selected service provider's fourth." s " is target identification.
The network address " the http of the picture to be preloaded that user fills in://www.baidu.com/test.jpg”.From net Domain names " www.baidu.com " are extracted in network address.
Store in the database for pre-setting service provider and API (Application Programming Interface, That is, application programming interface) corresponding relation, corresponding relation can be as shown in table 1.:
I.e. service provider's first correspond to API1, and service provider's second correspond to API2, and service provider third correspond to API3, service provider Fourth correspond to API4, and service provider penta correspond to API5.
The corresponding relation of service provider's mark and API can also be store in the database for pre-setting, corresponding relation can be with As shown in table 2.
That is the mark " h " of service provider's first correspond to API1, and the mark " d " of service provider's second correspond to API2, service provider Third mark " n " correspond to API3, and the mark " s " of service provider's fourth correspond to API4, the mark " e " of service provider penta Correspond to API5.
Illustrate by taking latter corresponding relation as an example.The target identification " s " of receiving user's input, in corresponding relation It is API4 to inquire the corresponding application programming interface of target identification " s ".
HTTP request is sent to API4, domain names " www.baidu.com " are contained in request.Content delivery network Network service provider fourth returns a html file, and it is corresponding that this file contains domain names " www.baidu.com " Whole IP address, extract the whole IP address in this file, and the whole IP address for for example extracting have 3, It is respectively IP address " 1.2.3.4 ", IP address " 1.2.3.5 ", IP address " 1.2.3.6 ".Thus obtain The corresponding IP address of domain names " www.baidu.com ", is respectively IP address " 1.2.3.4 ", IP address " 1.2.3.5 ", IP address " 1.2.3.6 ".
Alternatively, associative cell 28 includes traversal subelement.It is corresponding with domain names that the traversal subelement is used for traversal IP address, often traverses an IP address, and the IP address for traveling through out and domain names combination are stored to inquiry file, Wherein, file of the file for access network domain name is inquired about.That is, whole corresponding with the domain names inquired about is got After IP address, these IP address are traveled through, often traverse an IP address, by this IP address and domain names In being combined and storing inquiry file.
For example, whole IP address one corresponding with domain names " www.baidu.com " have 3, respectively IP Address " 1.2.3.4 ", IP address " 1.2.3.5 ", IP address " 1.2.3.6 ".This 3 IP address are carried out time Go through, when IP address " 1.2.3.4 " is traversed, by IP address " 1.2.3.4 " and domain names " www.baidu.com " It is combined, stores to inquiry file.Combination follows form specified in inquiry file, for example, combination It is " 1.2.3.4www.baidu.com ".When IP address " 1.2.3.5 " is traversed, by IP address " 1.2.3.5 " It is combined with domain names " www.baidu.com ", stores to inquiry file.Traverse IP address " 1.2.3.6 " When, IP address " 1.2.3.6 " is combined with domain names " www.baidu.com ", store to inquiry file.
Alternatively, the picture pre-load means that the embodiment of the present application is provided also include the first structural unit.First structure Make unit to extract from the network address of picture to be preloaded before domain names for extraction unit, construction first is matched Formula, wherein, the first matched is the matched for extracting domain names from the network address of picture to be preloaded. That is, a matched is constructed, domain names is extracted from the network address of picture to be preloaded using this matched. This matched can be regular expression.
For example, the network address of picture to be preloaded is " http://www.baidu.com/test.jpg ", construction one Individual matched, extracts domain names " www.baidu.com ".This matched can be regular expression.
Regular expression has many usages, for example:Replace given content to replace, delete per line by line to end of line, numeral Designated character, matched character string of tail, etc..
Than if any two character strings:" 123451265345 " and " 2345 ", need " 345 " for deleting each character string end. Solution is as follows:In dialog box is replaced, " regular expression " check box is enabled, be input into inside content being searched " 345 $ ", wherein, " $ " is represented from end of line matching.
Alternatively, the picture pre-load means that the embodiment of the present application is provided also include the second structural unit.Second structure The IP address that unit is used to extract in subelement extraction document is made, before obtaining the corresponding IP address of domain names, structure The second matched is made, wherein, the second matched is for the matched of the IP address in extraction document.That is, content point The service provider of hairnet network corresponds to HTTP request file, returns a html file, contains in this html file The corresponding whole IP address of nslookup, these IP address are tape format labels, and format tags are in follow-up behaviour It is unwanted in work, constructs a matched, using this matched all IP without format tags is matched Address.This matched can be regular expression.
By by the App of the function of the picture provided with the embodiment of the present application pre-load means be arranged on escape from prison or On the mobile phone (mobile phone, the mobile phone is used by webmaster) that root is crossed, mobile phone operation App goes to read CDN The URL of node and preloading picture, sends HTTP request, so that node is pre- using the true UA of mobile phone itself to node Cache picture.
Above-mentioned the embodiment of the present application sequence number is for illustration only, does not represent the quality of embodiment.
In above-described embodiment of the application, the description to each embodiment all emphasizes particularly on different fields, and does not have in certain embodiment The part of detailed description, may refer to the associated description of other embodiment.
In several embodiments provided herein, it should be understood that disclosed technology contents, other can be passed through Mode realize.Wherein, device embodiment described above is only schematic, such as division of described unit, Can be a kind of division of logic function, can there is other dividing mode, such as multiple units or component when actually realizing Can with reference to or be desirably integrated into another system, or some features can be ignored, or not perform.It is another, institute The coupling each other for showing or discussing or direct-coupling or communication connection can be by some interfaces, unit or mould The INDIRECT COUPLING of block or communication connection, can be electrical or other forms.
The unit as separating component explanation can be or may not be it is physically separate, it is aobvious as unit The part for showing can be or may not be physical location, you can with positioned at a place, or can also be distributed to On multiple units.Some or all of unit therein can be according to the actual needs selected to realize this embodiment scheme Purpose.
In addition, each functional unit in the application each embodiment can be integrated in a processing unit, it is also possible to It is that unit is individually physically present, it is also possible to which two or more units are integrated in a unit.It is above-mentioned integrated Unit both can be realized in the form of hardware, it would however also be possible to employ the form of SFU software functional unit is realized.
If the integrated unit is realized and as independent production marketing or when using using in the form of SFU software functional unit, During a computer read/write memory medium can be stored in.Based on such understanding, the technical scheme essence of the application On all or part of prior art is contributed part in other words or the technical scheme can be with software product Form is embodied, and the computer software product is stored in a storage medium, including some instructions are used so that one Platform computer equipment (can be personal computer, server or network equipment etc.) performs each embodiment institute of the application State all or part of step of method.And aforesaid storage medium includes:USB flash disk, read-only storage (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), portable hard drive, magnetic disc or CD Etc. it is various can be with the medium of store program codes.
The above is only the preferred embodiment of the application, it is noted that for the ordinary skill people of the art For member, on the premise of without departing from the application principle, some improvements and modifications can also be made, these improve and moisten Decorations also should be regarded as the protection domain of the application.

Claims (10)

1. a kind of picture pre-add support method, it is characterised in that include:
The network address of picture to be preloaded and target identification on content distributing network are received, wherein, the target It is designated service provider's mark of the content distributing network;
Domain names are extracted from the network address of the picture to be preloaded;
The corresponding IP address of the domain names is obtained from presetting database, wherein, different domain names pair Answer different IP address;
Associate the domain names and IP address corresponding with the domain names.
2. method according to claim 1, it is characterised in that the domain names pair are obtained from presetting database The IP address answered includes:
Destination application DLL corresponding with the target identification is searched from the presetting database, its In, the corresponding relation of be stored with the presetting database service provider's mark and application programming interface;
The request comprising the domain names is sent to the destination application DLL;
Receive the file that the destination application DLL responds the request;And
The IP address in the file is extracted, the corresponding IP address of the domain names is obtained.
3. method according to claim 1, it is characterised in that the association domain names and with the domain names Corresponding IP address includes:
Traversal IP address corresponding with the domain names, often traverses an IP address, by the IP for traveling through out Address and domain names combination are stored to inquiry file, wherein, the inquiry file is the access network The file of domain name.
4. method according to claim 1, it is characterised in that from the network address of the picture to be preloaded Before extracting domain names, methods described also includes:
The first matched is constructed, wherein, first matched is for from the network of the picture to be preloaded The matched of the domain names is extracted in address.
5. method according to claim 2, it is characterised in that the IP address in the file is extracted, obtains institute Before stating the corresponding IP address of domain names, methods described also includes:
Construct the second matched, wherein, second matched be for extracting the file in IP address Matched.
6. a kind of picture pre-load means, it is characterised in that include:
Receiving unit, for receiving the network address of picture to be preloaded and target identification on content distributing network, Wherein, the target identification is service provider's mark of the content distributing network;
Extraction unit, for extracting domain names from the network address of the picture to be preloaded;
Acquiring unit, for obtaining the corresponding IP address of the domain names from presetting database, wherein, no The different IP address of same domain names correspondence;
Associative cell, for associating the domain names and IP address corresponding with the domain names.
7. device according to claim 6, it is characterised in that the acquiring unit includes:
Subelement is searched, for searching intended application corresponding with the target identification from the presetting database Program Interfaces, wherein, be stored with service provider's mark and application programming interface in the presetting database Corresponding relation;
Subelement is sent, for sending asking comprising the domain names to the destination application DLL Ask;
Receiving subelement, for receiving the file that the destination application DLL responds the request;And
Extract subelement, for extracting the file in IP address, obtain the corresponding IP of the domain names Address.
8. device according to claim 6, it is characterised in that the associative cell includes:
Traversal subelement, for traveling through IP address corresponding with the domain names, often traverses an IP ground Location, the IP address for traveling through out and domain names combination are stored to inquiry file, wherein, the inquiry text Part is the file for accessing the domain names.
9. device according to claim 6, it is characterised in that described device also includes:
First structural unit, net is extracted for the extraction unit from the network address of the picture to be preloaded Before network domain name, the first matched is constructed, wherein, first matched is for treating preloading figure from described The matched of the domain names is extracted in the network address of piece.
10. device according to claim 7, it is characterised in that described device also includes:
Second structural unit, the IP address in the file is extracted for the extraction subelement, obtains the net Before the corresponding IP address of network domain name, the second matched is constructed, wherein, second matched is for extracting The matched of the IP address in the file.
CN201510689435.6A 2015-10-21 2015-10-21 Picture preloading method and picture preloading device Pending CN106612336A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510689435.6A CN106612336A (en) 2015-10-21 2015-10-21 Picture preloading method and picture preloading device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510689435.6A CN106612336A (en) 2015-10-21 2015-10-21 Picture preloading method and picture preloading device

Publications (1)

Publication Number Publication Date
CN106612336A true CN106612336A (en) 2017-05-03

Family

ID=58611346

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510689435.6A Pending CN106612336A (en) 2015-10-21 2015-10-21 Picture preloading method and picture preloading device

Country Status (1)

Country Link
CN (1) CN106612336A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108449395A (en) * 2018-03-05 2018-08-24 北京云端智度科技有限公司 A kind of more CDN tasks adaptation methods and system
CN108900547A (en) * 2018-08-14 2018-11-27 北京知道创宇信息技术有限公司 Return operated control method and device
CN110162373A (en) * 2019-05-28 2019-08-23 阿里巴巴集团控股有限公司 The method and device of chart is shown in webpage

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108449395A (en) * 2018-03-05 2018-08-24 北京云端智度科技有限公司 A kind of more CDN tasks adaptation methods and system
CN108900547A (en) * 2018-08-14 2018-11-27 北京知道创宇信息技术有限公司 Return operated control method and device
CN108900547B (en) * 2018-08-14 2021-06-08 北京知道创宇信息技术股份有限公司 Source returning control method and device
CN110162373A (en) * 2019-05-28 2019-08-23 阿里巴巴集团控股有限公司 The method and device of chart is shown in webpage

Similar Documents

Publication Publication Date Title
CN102521251B (en) Method for directly realizing personalized search, device for realizing method, and search server
US8645355B2 (en) Mapping Uniform Resource Locators of different indexes
US8413042B2 (en) Referrer-based website personalization
US20140249964A1 (en) System and method for gathering ecommerce data
CN104850546B (en) Display method and system of mobile media information
CN105027121A (en) Indexing application pages of native applications
CN106575298A (en) Fast rendering of websites containing dynamic content and stale content
CN102752288A (en) Method and device for identifying network access action
TW201118620A (en) Systems and methods for providing advanced search result page content
CN104021154B (en) A kind of method and apparatus scanned in a browser
CN107807937A (en) A kind of website SEO processing methods, apparatus and system
US20150100563A1 (en) Method for retaining search engine optimization in a transferred website
US20210097045A1 (en) Object identifier index
CN105868234A (en) Update method and device of caching data
CN101114284A (en) Method for displaying web page content relevant information and system
CN103455492B (en) A kind of method and apparatus of search and webpage
CN106612336A (en) Picture preloading method and picture preloading device
CN104065736A (en) URL redirection method, device, and system
CN106611029A (en) Method and device for improving site search efficiency in website
US9529922B1 (en) Computer implemented systems and methods for dynamic and heuristically-generated search returns of particular relevance
CN110955855B (en) Information interception method, device and terminal
CN103347069A (en) Method and device for realizing network access
CN101231655A (en) Method and system for processing search engine results
CN113656737A (en) Webpage content display method and device, electronic equipment and storage medium
US9135345B1 (en) Generating and updating online content using standardized tagged data

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 100083 No. 401, 4th Floor, Haitai Building, 229 North Fourth Ring Road, Haidian District, Beijing

Applicant after: Beijing Guoshuang Technology Co.,Ltd.

Address before: 100086 Cuigong Hotel, 76 Zhichun Road, Shuangyushu District, Haidian District, Beijing

Applicant before: Beijing Guoshuang Technology Co.,Ltd.

RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20170503