Summary of the invention
In view of this, fundamental purpose of the present invention is to provide a kind of advertisement putting frequency control method and device, cannot realize complicated many subcycles frequency control overflow for solving existing advertisement putting technology, advertisement putting efficiency is low, the technical matters too much to browser cookie resource occupation.
For achieving the above object, technical scheme of the present invention is achieved in that
A kind of advertisement putting frequency control method, the method comprises:
After Advertisement Server receives ad-request, obtain the frequency meeting fixed condition and control advertisement and N+ advertisement;
If described ad-request carries the historical viewings cookie of described N+ advertisement, then described historical viewings cookie is deserialized as history frequency control data object CampCookie, and according to current time, pre-service is carried out to each frequency restrictive condition in CampCookie;
If described ad-request does not carry the historical viewings cookie of described N+ advertisement, be then the newly-built CampCookie of user, and benchmark frequency control data object CampInfo carry out initialization to described CampCookie data object;
Based on described CampInfo and CampCookie, Advertisement Server judges whether this ad-request meets the frequency controlled condition of described N+ advertisement, when these segmentation symbols match, upgrade the viewing number of times in CampCookie, feed back to user after CampCookie sequence is turned to historical viewings cookie, and throw in described N+ advertisement to user.
Further, described CampCookie is used for describing the browsing histories of user to described N+ advertisement in a structured way, wherein at least comprise and watched total degree showTotalTimes and one or more subcycle interrecord structure, subcycle interrecord structure at least comprises: the frequency controls to have watched time field showTimes, subcycle expiration field expireTime in subcycle field period, subcycle.
Further, described CampInfo is for describing gray advertisement frequency control overflow, Advertisement Server can set up a unique CampInfo for each requires to do the advertisement that N+ controls, CampInfo at least comprises object identity campID, total degree limits value numLimit, one or more subcycle control structure and throws in cut-off date endDate, and subcycle control structure at least comprises: subcycle field period, subcycle limits value times.
Further, describedly pre-service carried out to each frequency restrictive condition in CampCookie be specially according to current time:
By current time compared with each subcycle closing time in CampCookie, if current time has exceeded corresponding subcycle closing time, then the subcycle of correspondence is watched number of times showTimes and set to 0 and expireTime closing time resetting corresponding subcycle according to current time.
Further, describedly initialized step carried out to described CampCookie data object be specially according to CampInfo:
ShowTotalTimes is set to 0;
Arrange the subcycle CampCookie.period1 ~ CampCookie.periodn in CampCookie according to the subcycle CampInfo.period1 ~ CampInfo.periodn in CampInfo, wherein n is the number that the frequency controls subcycle;
CampCookie.showTimes1 ~ CampCookie.showTimesn is set to 0;
Be benchmark with current date, calculate the end time that each subcycle is corresponding, and calculated value is assigned to CampCookie.expireTime1 ~ CampCookie.expireTimen.
Further, describedly judge that the method whether this ad-request meets the frequency controlled condition of described N+ advertisement is specially based on CampInfo and CampCookie:
Judge that user in the CampCookie that described N+ advertisement is corresponding has watched total degree showTotalTimes and whether has been more than or equal to numLimit in CampInfo corresponding to described N+ advertisement, if then refuse again to throw in described N+ advertisement to user, otherwise judge that each frequency controls in subcycle successively, user has watched number of times showTimes and whether has been more than or equal to the interior higher limit times allowing user to watch number of times of the corresponding subcycle set in CampInfo, only in all subcycles, user has watched number of times showTimes and has been less than in CampInfo when allowing user to watch the higher limit times of number of times in corresponding subcycle, just allow to throw in described N+ advertisement to user, otherwise refusal throws in described N+ advertisement again to user.
The present invention also provides a kind of advertisement putting frequency control device, and this device comprises:
Acquisition module, for after receiving ad-request, obtains the frequency meeting fixed condition and controls advertisement and N+ advertisement;
First judge module, for judging whether described ad-request carries the historical viewings cookie of described N+ advertisement;
Serializing processing module, for being deserialized as history frequency control data object CampCookie by historical viewings cookie; And CampCookie sequence is turned to historical viewings cookie;
Pretreatment module, for carrying the historical viewings cookie of described N+ advertisement in described ad-request, carries out pre-service according to current time to each frequency restrictive condition in CampCookie;
Initialization module, for not carrying the historical viewings cookie of described N+ advertisement in described ad-request, for the newly-built CampCookie of user, and benchmark frequency control data object CampInfo carries out initialization to described CampCookie data object;
Second judge module, for judging based on described CampInfo and CampCookie whether this ad-request meets the frequency controlled condition of described N+ advertisement;
Putting module, during for meeting the frequency controlled condition of described N+ advertisement in this ad-request, upgrades the CampCookie of described N+ advertisement, the historical viewings cookie of gained after user feedback CampCookie serializing, and throws in described N+ advertisement to user.
Further, described CampCookie is used for describing the browsing histories of user to described N+ advertisement in a structured way, wherein at least comprise and watched total degree showTotalTimes and one or more subcycle interrecord structure, subcycle interrecord structure at least comprises: the frequency controls to have watched time field showTimes, subcycle expiration field expireTime in subcycle field period, subcycle;
Described CampInfo is for describing gray advertisement frequency control overflow, Advertisement Server can set up a unique CampInfo for each requires to do the advertisement that N+ controls, CampInfo at least comprises object identity campID, total degree limits value numLimit, one or more subcycle control structure and throws in cut-off date endDate, and subcycle control structure at least comprises: subcycle field period, subcycle limits value times.
Further, described pretreatment module comprises:
Closing time judge module, for by current time compared with each subcycle closing time in CampCookie, judge that current time has exceeded corresponding subcycle closing time;
Pre-service submodule, for having exceeded corresponding subcycle closing time in current time, has watched number of times showTimes and has set to 0 and expireTime closing time resetting corresponding subcycle according to current time by the subcycle of correspondence.
Further, described second judge module comprises:
Total degree correction verification module, for judging that user in the CampCookie that described N+ advertisement is corresponding has watched total degree showTotalTimes and whether has been more than or equal to numLimit in CampInfo corresponding to described N+ advertisement, if then refuse again to throw in described N+ advertisement to user, otherwise instruction subcycle frequency correction verification module performs;
Subcycle frequency correction verification module, for judging that each frequency controls in subcycle successively, user has watched number of times showTimes and whether has been more than or equal to the interior higher limit times allowing user to watch number of times of the corresponding subcycle set in CampInfo, in all subcycles, user has watched number of times showTimes and has been less than in CampInfo when allowing user to watch the higher limit times of number of times in corresponding subcycle, throw in described N+ advertisement to user, otherwise refusal throws in described N+ advertisement again to user.
The present invention achieves by the comparison of CampCookie data structure and CampInfo data structure the requirement controlled multiple subcycle frequencys of N+ advertisement, thus advertisement can be thrown in evenly and at intervals to user within the whole cycle, fully meet advertiser's demand and ensure that gray interests, improving Consumer's Experience simultaneously.The present invention also utilizes serializing and the unserializing technology of data object, improve Advertisement Server to the treatment effeciency of user's browsing histories data and the efficiency of carrying out multiple subcycle frequency controlled condition coupling, and save limited browser cookie resource.
Embodiment
For making the object, technical solutions and advantages of the present invention clearly understand, by the following examples also with reference to accompanying drawing, the present invention is described in more detail.
Fig. 1 is a kind of advertisement putting frequency control method process flow diagram provided by the invention, and concrete steps are as follows:
Step 101, user browser send ad-request to Advertisement Server, comprise required parameter in described ad-request.
The video id that described request parameter is watched including but not limited to user, first-level class, secondary classification, User IP, key word etc. belonging to video.
If described advertisement is video ads, then described ad-request is sent by the video player embedded in browser.
Step 102, judge whether advertisement stock, if had, perform step 103, otherwise process ends;
Step 103, obtain according to required parameter the advertisement that meets fixed condition;
Step 104, judge acquired by advertisement whether be the N+ advertisement needing to carry out frequency control, if it is perform step 105, otherwise perform step 112;
Step 105, judge whether described ad-request carries the browsing histories cookie of acquired N+ advertisement, if then perform step 106, otherwise perform step 108;
When N+ advertisement browsing histories cookie preserved by browser, described ad-request also can carry N+ advertisement browsing histories cookie, enables Advertisement Server know the account of the history of the viewed N+ advertisement of user by advertisement browsing histories cookie.
Step 106, the advertisement browsing histories cookie of N+ advertisement ad-request carried are deserialized as history frequency control data object CampCookie;
The history frequency control data object CampCookie of the present invention's definition, this data object is used for describing the browsing histories of user to N+ advertisement in a structured way, understand after Advertisement Server upgrades CampCookie after by its serializing and feed back to user browser, user browser is saved as advertisement browsing histories cookie, when user sends ad-request again, advertisement browsing histories cookie is sent to Advertisement Server by user browser again, advertisement browsing histories cookie is deserialized as CampCookie by Advertisement Server again, advertisement browsing histories before can knowing user easily by CampCookie Advertisement Server, and realize controlling the advertisement frequency of N+ advertisement by CampCookie.
Serializing (Serialize) and unserializing (Deserialize) are the mechanism of fluidisation that runtime environment is used for supporting user defined type.The object of serializing makes self-defined Object Persistence with certain file layout, and unserializing is the inverse process of serializing, can be realized the across a network transmission of object, thus make program have more maintainability by the combination of the two.
As shown in Figure 2, the historical information that user watches each N+ advertisement can describe by CampCookie data structure CampCookie data object structure, wherein at least comprises following component:
Watch total degree showTotalTimes: for recording the total degree that N+ advertisement is watched by user;
Frequency control subcycle periodi (i=1,2 ... n): for being recorded in i-th sub-periodic quantity in N+ advertisement frequency control large period, preferably in units of sky;
Watched in subcycle i number of times showTimesi (i=1,2 ..., n): for being recorded in subcycle periodi, certain user watches the number of times of Current ad;
Subcycle i expireTimei closing time (i=1,2 ..., n): for recording the closing time of subcycle periodi.
Step 107, foundation current time are to the subcycle viewing number of times in CampCookie and carry out pre-service closing time, then perform step 109;
This step by current time compared with each subcycle closing time in CampCookie, if current time has exceeded subcycle closing time, then number of times showTimesi is watched to subcycle and subcycle expireTimei closing time re-starts initialization, set to 0 by showTimesi, reset expireTimei closing time of corresponding subcycle according to current time.
Step 108, Advertisement Server are the CampCookie data object that user creates described N+ advertisement, and carry out initialization, then perform step 109;
If ad-request does not comprise the advertisement browsing histories cookie of described N+ advertisement, then do not watched this N+ advertisement before user being described, system can automatically create a CampCookie for user and carry out initialization to it.
Needing according to Advertisement Server to the initialization of CampCookie is information in the benchmark frequency control data object CampInfo of N+ advertisement creation, CampInfo data object is for describing gray advertisement frequency control overflow, and Advertisement Server can set up a unique CampInfo to describe its concrete N+ control overflow for each requires to do the advertisement that N+ controls.
The structure of CampInfo as shown in Figure 3, wherein at least comprises following component:
The unique identification of object identity campId:CampInfo object, comprises a campId attribute in each advertisement entity, for associating corresponding CampInfo;
Total degree limits value numLimit: advertisement is carried out in whole cycle of throwing in the mode controlled with N+, and a user can see maximum number of times of this advertisement altogether;
Subcycle periodi: the son under the whole input cycle throws in the cycle, in units of sky;
Subcycle limits value timesi (i=1,2, ..., n): the advertisement number of times that most multipotency is watched by a user in subcycle periodi, during specific implementation, each periodi and timesi the right form of key-value can leave HashMap<Integer in, in Integer> structure;
Cut-off date endDate: the N+ of advertisement controls the cut-off date of throwing in, and exceed this day after date, advertisement can observe N+ control overflow again.
Carrying out initialized process according to CampInfo to CampCookie is:
(1) showTotalTimes is set to 0;
(2) the subcycle CampCookie.period1 ~ CampCookie.periodn in CampCookie is set according to the subcycle CampInfo.period1 ~ CampInfo.periodn in CampInfo;
(3) CampCookie.showTimes1 ~ CampCookie.showTimesn is set to 0;
(4) take current date as benchmark, calculate the end time that each subcycle is corresponding, and calculated value is assigned to CampCookie.expireTime1 ~ CampCookie.expireTimen, such as, the same day is Dec 1, subcycle period1 is 5, then corresponding CampCookie.expireTime1 is 00: 00: 00 on the 6th Dec.
During system cloud gray model, CampInfo data object will be loaded in the buffer memory of Advertisement Server, to improve response speed.
Step 109, judge whether user can watch this advertisement according to the CampInfo data object of described N+ advertisement and CampCookie data object, if the determination result is YES, then perform step 110, otherwise perform step 102;
Step 110, upgrade CampCookie, by watched in CampCookie total degree and each subcycle viewing number of times all add 1;
Step 111, feed back to user browser be stored as user advertising browsing histories cookie by after the CampCookie serializing after upgrading;
Step 112, throw in advertisement to user.
Fig. 4 is Advertisement Server judges whether to throw in user described N+ advertisement flow process according to CampInfo and CampCookie of N+ advertisement, and concrete steps are as follows:
Step 401, the CampInfo data object corresponding according to campId acquisition;
Step 402, judge that user in CampCookie has watched total degree showTotalTimes and whether has been more than or equal to numLimit in CampInfo, if be more than or equal to, illustrate that the viewing number of times of user within total input cycle of advertisement has exceeded or reached the higher limit of total viewing number of times of advertiser request, therefore refuse again to throw in this N+ advertisement to this user, therefore return false; If be less than, perform step 403;
Step 403, be cycle control parameter i initialize 0;
Step 404, judge CampCookie subcycle i in user watched number of times showTimesi and whether be less than in the subcycle i that sets in CampInfo and allow user to watch the higher limit timesi of number of times, if be less than, illustrate that this user meets the frequency control overflow of subcycle i, the judgement in next son cycle can be proceeded, perform step 405; If be more than or equal to, illustrate that this user has not met the frequency control overflow of subcycle i, therefore refuse again to throw in this N+ advertisement to this user, return false;
Step 405, cycle control parameter i do increment operator, i.e. i=i+1;
Step 406, judge whether processed all subcycles the frequency control judge, if then illustrate that this user meets the frequency controlled condition of all subcycles, this N+ advertisement can be thrown in this user, return true; If not, then step 404 is performed.
Fig. 5 also provides a kind of advertisement putting frequency control device for the embodiment of the present invention, and this device 500 comprises:
Acquisition module 510, for after receiving ad-request, obtains the frequency meeting fixed condition and controls advertisement and N+ advertisement;
First judge module 520, for judging whether described ad-request carries the historical viewings cookie of described N+ advertisement;
Serializing processing module 530, for being deserialized as history frequency control data object CampCookie by historical viewings cookie; And CampCookie sequence is turned to historical viewings cookie;
Pretreatment module 540, for carrying the historical viewings cookie of described N+ advertisement in described ad-request, carries out pre-service according to current time to each frequency restrictive condition in CampCookie;
Initialization module 550, for not carrying the historical viewings cookie of described N+ advertisement in described ad-request, for the newly-built CampCookie of user, and benchmark frequency control data object CampInfo carries out initialization to described CampCookie data object;
Second judge module 560, for judging based on described CampInfo and CampCookie whether this ad-request meets the frequency controlled condition of described N+ advertisement;
Putting module 570, during for meeting the frequency controlled condition of described N+ advertisement in this ad-request, upgrade the CampCookie of described N+ advertisement, the historical viewings cookie of gained after user feedback CampCookie serializing, and throw in described N+ advertisement to user.
Preferably, described CampCookie is used for describing the browsing histories of user to described N+ advertisement in a structured way, wherein at least comprise and watched total degree showTotalTimes and one or more subcycle interrecord structure, subcycle interrecord structure at least comprises: the frequency controls to have watched time field showTimes, subcycle expiration field expireTime in subcycle field period, subcycle;
Preferably, described CampInfo is for describing gray advertisement frequency control overflow, Advertisement Server can set up a unique CampInfo for each requires to do the advertisement that N+ controls, CampInfo at least comprises object identity campID, total degree limits value numLimit, one or more subcycle control structure and throws in cut-off date endDate, and subcycle control structure at least comprises: subcycle field period, subcycle limits value times.
Preferably, described pretreatment module 540 comprises:
Closing time judge module 541, for by current time compared with each subcycle closing time in CampCookie, judge that current time has exceeded corresponding subcycle closing time;
Pre-service submodule 542, for having exceeded corresponding subcycle closing time in current time, has watched number of times showTimes and has set to 0 and expireTime closing time resetting corresponding subcycle according to current time by the subcycle of correspondence.
Preferably, described second judge module 560 comprises:
Total degree correction verification module 561, for judging that user in the CampCookie that described N+ advertisement is corresponding has watched total degree showTotalTimes and whether has been more than or equal to numLimit in CampInfo corresponding to described N+ advertisement, if then refuse again to throw in described N+ advertisement to user, otherwise instruction subcycle frequency correction verification module 562 performs;
Subcycle frequency correction verification module 562, for judging that each frequency controls in subcycle successively, user has watched number of times showTimes and whether has been more than or equal to the interior higher limit times allowing user to watch number of times of the corresponding subcycle set in CampInfo, in all subcycles, user has watched number of times showTimes and has been less than in CampInfo when allowing user to watch the higher limit times of number of times in corresponding subcycle, throw in described N+ advertisement to user, otherwise refusal throws in described N+ advertisement again to user.
Advertisement putting frequency control method proposed by the invention and device are not only watched number of times to the user in whole input cycle and are limited, multiple subcycle not of uniform size can also be divided within the input cycle, the frequency is watched to the user of each subcycle and does more detailed restriction, thus advertisement can be thrown in evenly and at intervals to user within the whole cycle, meet the frequency control overflow of multiple restrictive conditions that advertiser proposes, compared with traditional N+ frequency control method, existing better Consumer's Experience, ensure that gray interests again to a greater degree.
The present invention carries out structural description by the advertisement browsing histories information of definition CampCookie data structure to user, and utilize serializing and the unserializing technology of data object, improve Advertisement Server to the treatment effeciency of user's browsing histories data and the efficiency of carrying out multiple subcycle frequency controlled condition coupling, and only use a cookie just to complete storage and the access of complicated user profile, save limited browser cookie resource (current major browsers can preserve under a domain name cookie quantity substantially all only have about 50).
Example 1
Certain advertiser needs to throw in advertisement A1, the requirement advertisement putting cycle is: 2011-09-25 ~ 2011-10-25, require that each user can only see at most this advertisement 6 times within the whole input cycle, and require that each user can only see at most this advertisement 2 times every day, within every 10 days, 4 times can only be seen at most.Here is concrete implementation step:
(1) in the advertising database correlation table of ad system, first create the record of this advertisement A1, and every attribute corresponding to this advertisement is set, and N+ restricted information.
(2) during actual input, the frequency restricted information of all current N+ advertisements to be thrown all can be extracted by from database, and is respectively they establishments CampInfo example.CampInfo message structure as corresponding in advertisement A1 is as following table 1:
Table 1
(3) when ad system finds the advertisement A1 that can mate current request, find that A1 is N+ advertisement, then the cookie information that advertisement A1 that user browser end transmits is relevant can be extracted, if found, be reduced to a CampCookie object, if do not found, then new initialization CampCookie object.
Such as, the value of the browser cookie obtained when ad system receives certain ad-request is " 4_1:1:1317484800000_10:2:1317830400000 ", and after being reduced to certain CampCookie object, its structure is as shown in table 2 below:
Table 2
The implication of table 2 is: advertisement A1 be have viewed 4 times altogether by certain user, wherein, the same day has watched 1 time, 2 times have been watched within nearest 10 days, wherein lint-long integer 1317484800000, 1317830400000 are respectively 1 day and the stop time point 2011-10-0200:00:00 of 10 days these two subcycles and 2011-10-0600:00:00, going out the same day according to the former deducibility is 2011-10-01 day, go out from the 2011-09-26 day before 5 days to 2011-10-01 same day according to the latter's deducibility, user has seen this advertisement 2 times altogether, and the 2011-10-06 after 5 days is terminated this subcycle zero point day, in this subcycle, number of visits can be cleared, then the frequency statistics of next 10 days is restarted.
According to the checking process of Fig. 4, this user can be found: total viewing number of times is less than the maximum times 6 times allowing viewing for 4 times, watch number of times the same day and be less than in 1 day the number of times upper limit 2 times allowing to watch for 1 time, watch number of times in 10 days and to be also less than in 10 days the number of times 4 times allowing at most viewing for 2 times, so this ad-request check results is: TRUE, namely advertisement A1 can throw to this user.
After it's a few minutes pasts this user, again to ad system request advertisement, and when ad system hits advertisement A1 again, find that the CampCookie now obtained has become as shown in table 3 below:
Table 3
Now this user cannot meet the restrictive condition that every day watches at most 2 times, so this ad-request check results is: FALSE, namely user can not see this advertisement the same day again.
After this 2nd day, when user's repeated accesses related pages, when again sending ad-request, if when ad system hits advertisement A1 again, find that the CampCookie now obtained becomes following table 4:
Table 4
The cycle that can find is that the number of visits of 1 day becomes 0 by 2 again, the period expires time also becomes 1317571200000 from 1317484800000, this is because, enter second day, the viewing number of times of every day needs to reset, closing time also automatically after prolong one day to 2011-10-0300:00:00.This CampCookie is verified again, then returns results as TRUE, be i.e. user but also advertisement A1 can be seen.In like manner, by the time after 2011-12-0600:00:00, the subcycle of previous 10 days also will terminate, before the total degree watched for 10 days be also cleared, 10 emperor's period expires times then delayed 2011-12-1600:00:00.
Example 2
Advertisement A2 will throw in certain advertiser, the requirement advertisement putting cycle is: 2011-09-01 ~ 2011-09-31, within the whole input cycle, each user can only see at most this advertisement 8 times, and require that every user can only see at most this advertisement 2 times every day, 3 times can only be seen at most weekly, within every 10 days, 4 times can only be seen at most.The CampInfo message structure that advertisement A2 is corresponding is as shown in table 5 below:
Table 5
When ad system finds the advertisement A2 that can mate current request, then the cookie information that advertisement A2 that user browser end transmits is relevant can be extracted, such as, the browser cookie information structure extracted from certain user browser end is " 51:1:1315152000000_7:2:1315584000000_10:3:1318435200000 ", after being reduced to certain CampCookie object, its structure is as shown in table 6 below:
Table 6
Above-mentioned CampInfo and CampCookie is verified, this user can be found: always watch number of times, in 1 day, watch number of times, in 7 days, watch number of times, with 10 days in watch number of times and all do not reach each upper cycle limit, so this ad-request check results is: TRUE, namely advertisement A2 can throw to active user.
The above, be only preferred embodiment of the present invention, be not intended to limit protection scope of the present invention.