A kind of method of advertisement
Technical field
The present invention relates to computer field more particularly to a kind of methods of advertisement.
Background technique
Currently, there are two types of the well-known page rendering methods for advertisement pushing, real-time page insertion and the page
Caching technology.
Real-time page insertion is when the advertisement pushing equipment being deployed in operator's core network detects http response stream
When the page specific position be inserted into ad code, to achieve the purpose that advertisement pushing.However the shortcomings that this mode, is,
Greatly influence the efficiency of transmission of core network.Real-time page embedded technology requires advertisement pushing equipment to be connected on Backbone network
In, when guaranteeing advertisement pushing coverage rate, advertisement pushing equipment is needed to detect each in the http response stream of the overwhelming majority
The content of data packet, to find out the specific location of suitable ad code insertion, very due to data packet number to be treated
It is more, and HTTP stream, there is also needing the page to decompress, equipment is necessarily affected to the transfer capability of data packet, this
Extreme influence can be caused to the efficiency of transmission of core network.
Page cache technology refers to need the page cache of advertisement on specified server, in advance at it
The specified ad code of middle insertion presets needs when advertisement pushing equipment detects that the page of active client access belongs to
When the page of advertisement, one HTTP page reorientation data packet of loopback substitutes purpose net with the page existing on server
Page is shown to client.This technology solves efficiency, but is the introduction of coverage rate problem.Due to the webpage for needing to push
It must be arranged in advance, it may not be possible to accomplishing all to carry out all webpages into insertion ad code and cache, therefore work as
Access is not the pre-set page, or has completed from one the page of advertisement and entered another and do not preset
It just is no longer presented out with regard to advertisement when the page of advertisement pushing.And in network instantly, the content of most Webpages
It is all fairly frequently updating, correspondingly, it is desirable to which the page of caching can be timely updated, this becomes maintenance work
Complex.
Summary of the invention
Technical problem to be solved by the present invention lies in a kind of method for inventing advertisement, the method had both been solved extensively
Core network transmits the problem of data efficiency is lowered during accusing push, and improves advertisement coverage rate.
The invention is realized in this way a kind of method of advertisement, comprising the following steps:
S1, the HTTP request for obtaining client, and purpose link, the purpose are parsed from HTTP by advertisement pushing device
It is linked as the link that client it is expected the page of access;
S2, advertisement pushing device generate http response, will be in purpose link dynamic insertion access in the http response
Hold the corresponding position in display area, inserts advertise content into the corresponding position of advertising area;
S3, the encapsulation http response, generate protocol package, and the protocol package is sent to client;
It includes ad content in protocol package that S4, client, which show, and is initiated second according to purpose link
HTTP request;
Second of HTTP request is forwarded directly to web page server by S5, advertisement pushing device, and web page server is to institute
It states second of HTTP request and carries out webpage response;
S6, client obtain the webpage response, and by webpage response display in the access content display region.
Preferably, before S1, overall page design in client is carried out, overall page is divided into access content display area
Domain and advertising area two parts.
Preferably, before S1, advertisement pushing time interval is set for advertisement pushing device, the push time interval is not small
In showing advertisement duration.
Preferably, after S6, when the internal links operation of the page that access it is expected client has occurred, will not repeat exhibition
Existing advertisement.
Preferably, it after S6, is returned again to after the internal links operation for it is expected client the page of access has occurred described
Client it is expected access the page when, the ad content is normally shown.
Preferably, the purpose link is indicated with the src field of<iframe>label in HTML.
Preferably, the ad content is advertising logo.
Preferably, the ad content is shown in the advertising area, and the advertising area is suspended in the access content
Display area.
Preferably, the ad content presentation time is hidden automatically after reaching showing advertisement duration.
Preferably, the ad content shows is realized by Html, CSS or/and JavaScript.
Preferably, in S3 the corresponding IP data packet of protocol package data volume size be not more than Ethernet MTU, the IP number
The actual content of the protocol package transmitting is described for generating protocol package, the IP data packet according to packet.
Preferably, the client is mobile device, and the ad content can be dragged arbitrarily when showing.
The invention has the following beneficial effects:
The present invention provides a kind of method of advertisement, this method only needs to parse the head of HTTP request, and leads to
Crossing advertisement pushing device and web page server realizes the push of advertisement.The present invention needs to parse HTTP header content only to obtain and visit
The purpose link asked, and the case where compressing is not present in HTTP header, therefore compared to for HTTP Context resolution, easily completes;
Therefore, when advertisement pushing equipment is connected in core network, the influence to core network efficiency of transmission is little, and works as advertisement
When pushing equipment is connected in parallel in core network, the influence to core network be there's almost no;Furthermore using this method when appearance
When returning again to parent page after internal links, although there is the display that variation has no effect on advertisement in the page, to solve
The problem of coverage rate, when advertisement pushing, can almost cover any one accessed HTTP page;In addition, being pushed in this method
Time interval is not less than showing advertisement duration, therefore the problem of be not in multiple advertisement while showing.
Detailed description of the invention
Fig. 1 is Pages Design figure;
Fig. 2 is the flow chart of a kind of method of advertisement.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, the present invention is made into one below in conjunction with attached drawing
Step ground detailed description.
The embodiment of the invention provides a kind of methods of advertisement, need before advertisement pushing whole for mobile device
The body page is designed, as shown in Figure 1, overall page 1 is divided into access content display region 2 and 3 two parts of advertising area;It is whole
The body page 1 is filled up completely mobile device browser part for display, and it includes have access content display region 2 and advertisement area
Domain 3;And before advertisement, need for advertisement pushing time interval, institute is arranged for the advertisement pushing device of advertisement
Push time interval is stated not less than showing advertisement duration;
The method of advertisement includes the following steps, as shown in Figure 2:
S1, the HTTP request for obtaining mobile device, and purpose link, the mesh are parsed from HTTP by advertisement pushing device
Be linked as client it is expected access the page link;
S2, advertisement pushing device generate http response, in the http response, the purpose are linked and is visited described in dynamic insertion
It asks content display region corresponding position, inserts advertise content into the corresponding position of the advertising area, the advertising area pair
The position answered directly is calculated by advertisement pushing device, does not need to carry out dynamic lookup, to improve response speed;The link bit
Be set to<position of src field value in iframe src=>label, this position relative to page beginning deviant in the page
It can be calculated when display;
S3, the encapsulation http response, generate protocol package, and the protocol package is sent to mobile device;
It includes ad content in protocol package that S4, mobile device, which show, and is initiated second according to purpose link
HTTP request;
Second of HTTP request is forwarded directly to web page server by S5, advertisement pushing device, and web page server is to institute
It states second of HTTP request and carries out webpage response;At this point, since advertisement pushing device sets one not less than showing advertisement duration
Advertisement pushing time interval, therefore, at this time advertisement pushing device will not advertisement, but HTTP request is transferred into web service
Device;
S6, mobile device obtain the webpage response, and by webpage response display in the access content display area
Domain.
Since advertisement part is to present by duration, and advertisement pushing device also sets one and pushes away to mobile device
The advertisement pushing time interval sent, size setting are not less than showing advertisement duration, therefore when internal links occur, in advertisement
It pushing in time interval, advertisement pushing device does not handle internal links request, and the linking request is transferred into web page server, by
Web page server is responsible for response, and mobile device receives webpage response and generates Web evolution, and the Web evolution does not influence to occur
The display of advertisement before internal links, therefore the problem of be not in multiple showing advertisement;At the desired page of mobile device
It being operated under<iframe>label, therefore even if executing to return again after internal links occur, parent page has occurred and that variation,
But the displaying of the advertisement outside<iframe>is not interfered with.It is independent and mutual that this method web displaying and ad content, which are shown,
It does not influence, it is 60 seconds in the present embodiment that the showing advertisement duration, which is greater than 0, and unit is the second.
Preferably, the advertisement pushing time interval of advertisement pushing device is adjusted according to showing advertisement duration.When advertisement pushing
Between the setting that is spaced so that advertisement pushing device HTTP request quantity to be treated will greatly reduce, and to advertisement coverage rate
Influence it is little.
Preferably, the ad content is a very succinct mark, will not influence mobile device user and carries out page
Face content is read.
Preferably, the ad content is shown in the advertising area 3, and the advertising area 3 is suspended in the access
Hold display area 2.
Preferably, the ad content is suspended in using some or all of technology in Html, CSS and JavaScript
On the access content display region 2, and it also by these technologies on a web browser, opened up in showing advertisement duration
Show, then will hide automatically.The ad content can be dragged arbitrarily when showing.
Preferably, in S3 the corresponding IP data packet of protocol package data volume size be not more than Ethernet MTU, the IP number
The actual content of the protocol package transmitting is described for generating protocol package, the IP data packet according to packet.Protocol package pair in S3
The second layer of OSI7 layer model, the i.e. encapsulation of data link layer are answered, the format of data link layer protocol packet is as follows
Protocol header H |
The actual content C of protocol package transmitting |
Agreement tail T |
The maximum length of the C field of this protocol package is MTU (Maximum Transmission Unit), that is, singly
The maximum amount of data (unit Byte) that a protocol package can be transmitted.When needing the content transmitted to be more than MTU, need to generate multiple
Protocol package is transmitted.
It is Ethernet II that two layers, which are defaulted the protocol package type standards that use, transliteration ethernet ii, the MTU be with
Net very much MTU.The protocol package actual content C is from the third layer of OSI7 layer model, i.e. the IP data packet of network layer, therefore,
When the amount of IP packet data described in the present embodiment is less than Ethernet MTU, it can be packaged into single protocol package, this can simplify extensively
The process flow for accusing pusher, improves efficiency.
The above disclosure is only the preferred embodiments of the present invention, cannot limit the right model of the present invention with this certainly
It encloses, therefore equivalent changes made in accordance with the claims of the present invention, is still within the scope of the present invention.