Summary of the invention
Throwing in efficiency for improving flow media advertisement, the invention provides a kind of method carrying out advertisement putting based on stream media advertisement template, it comprises the following steps:
Step (1) is completed flow media advertisement material by flow media advertisement background management system and creates;
Step (2) is created by flow media advertisement background management system and generates flow media advertisement block object data;
Step (3) reads all flow media advertisement blocks of data collection, the flow media advertisement bit data of correspondence is got according to flow media advertisement block ID, and the flow media advertisement position ID got is stored positions field and to identify masterplate be upstate, if during the corresponding multiple flow media advertisement position of flow media advertisement block, and flow media advertisement block masterplate data being split into array and store to templet field;
When step (4) Webpage is loaded into flow media advertisement region, sends flow media advertisement by HTTP request to the webserver and ask, afferent stream media advertisement block ID simultaneously;
Step (5) webserver, according to Webpage afferent stream media advertisement block ID, obtains corresponding flow media advertisement position ID, then gets flow media advertisement material according to flow media advertisement position ID;When a flow media advertisement block only comprises a flow media advertisement position, directly use the masterplate of the flow media advertisement type that flow media advertisement material is corresponding;When a flow media advertisement block comprises multiple flow media advertisement position, by assembling the masterplate of flow media advertisement block and the masterplate of flow media advertisement type, form one section of complete input code;
The complete HTML code of this generation is returned to Webpage by step (6), and complete HTML code is inserted the flow media advertisement block that Webpage is corresponding by Webpage.
Further, step (2) described establishment flow media advertisement block object data include: block ID, block title, flow media advertisement position ID array, masterplate templet, script scripts, if having masterplate, affiliated Webpage ID, site information.
Further, described step (1) farther includes: add the material information of correspondence on the premise of having impression information;When creating material, the flow media advertisement type of material has existed, and does not allow change;After material information solicitation is complete, by reading the common template of this flow media advertisement type during preservation, variable part is replaced, in obtaining the complete HTML fragment of this material and storing the AD_BODY field of material table;Throw in engine and read the input data of present period, and according to the flow media advertisement position of impression information, all materials are analyzed, get the set of material corresponding to flow media advertisement position, then one record of random taking-up from set, this record is using the value as Hash table, key is flow media advertisement position ID, is built into Hash table data and stores Buffer Pool.
Further, the structure of flow media advertisement blocks of data is described as Hash table structure, this Hash table structural bond is flow media advertisement block ID, value is the flow media advertisement block object of encapsulation, this flow media advertisement block object encapsulates 1 or 1 group of flow media advertisement position ID, resolves the DYNAMIC J S script and masterplate data obtained, if during the corresponding multiple flow media advertisement position of flow media advertisement block, flow media advertisement block masterplate data are split into array and stores to templet field, packaged object is stored Buffer Pool.
Further, the corresponding masterplate of each flow media advertisement type, it is stored in the templet field of flow media advertisement categorical data.
Further, described step (5) farther includes: the webserver, according to the flow media advertisement block ID in parameter, gets the PositionBlock object of correspondence from Buffer Pool;Flow media advertisement material is assembled by the webserver with flow media advertisement block object: first get the HTML code of material from the AD_BODY field of flow media advertisement material, when current flow media advertisement block only comprises a flow media advertisement position, directly return the HTML code of material;When current flow media advertisement block comprises multiple flow media advertisement position, the templet field of fast to the HTML code of material and flow media advertisement object is merged, assembles complete HTML code and return to Webpage.
Present invention also offers a kind of device carrying out advertisement putting based on stream media advertisement template, comprising:
Flow media advertisement background management system, completes flow media advertisement material and creates and the establishment generation of flow media advertisement block object data;
Delivery device, read all flow media advertisement blocks of data collection, the flow media advertisement bit data of correspondence is got according to flow media advertisement block ID, and the flow media advertisement position ID got is stored positions field and to identify masterplate be upstate, if during the corresponding multiple flow media advertisement position of flow media advertisement block, and flow media advertisement block masterplate data being split into array and store to templet field;
DST PLAYER, when Webpage is loaded into flow media advertisement region, sends flow media advertisement by HTTP request to the webserver and asks, afferent stream media advertisement block ID simultaneously;Complete HTML code is inserted the flow media advertisement block that Webpage is corresponding;
The webserver, according to Webpage afferent stream media advertisement block ID, obtains corresponding flow media advertisement position ID, then gets flow media advertisement material according to flow media advertisement position ID;When a flow media advertisement block only comprises a flow media advertisement position, directly use the masterplate of the flow media advertisement type that flow media advertisement material is corresponding;When a flow media advertisement block comprises multiple flow media advertisement position, by assembling the masterplate of flow media advertisement block and the masterplate of flow media advertisement type, form one section of complete input code;The complete HTML code generated is returned to Webpage.
Further, described establishment flow media advertisement block object data include: block ID, block title, network video advertisement position ID array, masterplate templet, script scripts, if having masterplate, affiliated Webpage ID, site information.
Further, when creating material, the flow media advertisement type of material has existed, and does not allow change;After material information solicitation is complete, by reading the common template of this flow media advertisement type during preservation, variable part is replaced, in obtaining the complete HTML fragment of this material and storing the AD_BODY field of material table;Throw in engine and read the input data of present period, and according to the flow media advertisement position of impression information, all materials are analyzed, get the set of material corresponding to flow media advertisement position, then one record of random taking-up from set, this record is using the value as Hash table, key is flow media advertisement position ID, is built into Hash table data and stores Buffer Pool.
Further, the structure of flow media advertisement blocks of data is described as Hash table structure, this Hash table structural bond is flow media advertisement block ID, value is the flow media advertisement block object of encapsulation, this flow media advertisement block object encapsulates 1 or 1 group of flow media advertisement position ID, resolves the DYNAMIC J S script and masterplate data obtained, if during the corresponding multiple flow media advertisement position of flow media advertisement block, flow media advertisement block masterplate data are split into array and stores to templet field, packaged object is stored Buffer Pool.
Further, the corresponding masterplate of each flow media advertisement type, it is stored in the templet field of flow media advertisement categorical data.
Further, the webserver according to the flow media advertisement block ID in parameter, gets the PositionBlock object of correspondence further from Buffer Pool;Flow media advertisement material is assembled by the webserver with flow media advertisement block object: first get the HTML code of material from the AD_BODY field of flow media advertisement material, when current flow media advertisement block only comprises a flow media advertisement position, directly return the HTML code of material;When current flow media advertisement block comprises multiple flow media advertisement position, the templet field of fast to the HTML code of material and flow media advertisement object is merged, assembles complete HTML code, return to Webpage.
Detailed description of the invention
Below in conjunction with the drawings and specific embodiments, the invention will be further described.
The core design theory of the present invention: mainly for the design of Webpage flow media advertisement, eliminate mistake hidden danger present in Webpage flow media advertisement automatization launch process, input effect can be checked after material has created immediately, and improve development efficiency, quickly be responsive to party in request.
Flow media advertisement block: the webserver is responsible for all flow media advertisement blocks of entirely standing, manager's streaming media commercial block has additions and deletions to change to look into authority.Flow media advertisement block is the encapsulation of streaming media advertisement position, flow media advertisement block object includes block ID, block title, flow media advertisement position ID array, masterplate templet, script scripts, whether there are masterplate, affiliated Webpage ID, site information, what the html code in masterplate templet field described is template information, (the most as shown in Figure 2, it is the js specially good effect of a label form), the js code realizing specially good effect exactly of storage in script scripts.Being mainly used in some specially good effect flow media advertisements of Webpage, such as the flow media advertisement etc. of rolling picture form, same position can arrange multiple flow media advertisement position, therefore a flow media advertisement block can corresponding one or more flow media advertisement positions.
Flow media advertisement position: the webserver is responsible for all flow media advertisement positions of entirely standing, the corresponding flow media advertisement block in one or more flow media advertisement positions.Manager's streaming media advertisement position has additions and deletions to change to look into authority, flow media advertisement position is reserved medium position for carrying issue flow media advertisement, flow media advertisement position have recorded the essential information of current flow media advertisement position, such as Webpage high, wide, affiliated, affiliated flow media advertisement block, price etc..One corresponding flow media advertisement material in flow media advertisement position.
Flow media advertisement impression information: impression information is to generate according to user's order, requiring to be abstracted into an object by the input in user's order, this object includes the release time scope of this order, input capacity, throws in material, the flow media advertisement position throwing in type, input rule, input etc..
Flow media advertisement type: carry out classifying and managing according to residing region and the form of expression by flow media advertisement in station.Such as Webpage flow media advertisement segmentation type has: word flow media advertisement, size figure (being a kind of flow media advertisement type, similar banner), homepage excellent special topic MiniBanner, search results pages recommendation, homepage banner1 etc..
Flow media advertisement material: flow media advertisement material is to rely on impression information and create, so when creating, the flow media advertisement type that material is corresponding exists the most.Material content is provided by client, can be picture, animation, word etc..It is below the generation step of flow media advertisement material data:
In order to enable the party in request of more efficient response Webpage flow media advertisement and development efficiency can be taken into account, improve code reusability, the invention provides a set of flow media advertisement Informal development based on template, carry out planning by streaming media adline to arrange, segment out 1152 flow media advertisement blocks and 64 kinds of flow media advertisement types.Flow media advertisement block is all regions that can throw flow media advertisement in referring to website, one flow media advertisement block can corresponding one or more flow media advertisement positions (situation of a corresponding flow media advertisement position as shown in Figure 1, the situation of corresponding multiple flow media advertisement positions is as shown in Figure 2), when a flow media advertisement block comprises multiple flow media advertisement position, this flow media advertisement block has masterplate and the JS script of correspondence, is used for controlling flow media advertisement block layout and specially good effect;Flow media advertisement type refers to according to residing region, the form of expression etc., the flow media advertisement position of Webpage is carried out Classification And Nomenclature, (such as: word flow media advertisement, homepage excellent special topic MiniBanner, search results pages recommendation, homepage banner flow media advertisement banner1 etc.), the corresponding masterplate of each flow media advertisement type (is applied to the general masterplate of flow media advertisement position, from the point of view of the angle of technology, masterplate refers to one section of general HTML code fragment, and it is stored in the templet field of flow media advertisement categorical data).When a flow media advertisement block only comprises a flow media advertisement position, directly use the masterplate of flow media advertisement type;When a flow media advertisement block comprises multiple flow media advertisement position, by assembling the masterplate of flow media advertisement block and the masterplate of flow media advertisement type, form one section of input code completed.(detailed process is shown in step 10).Data loading process is completed by throwing in engine, throw in engine from data base, within every 5 minutes, reload a flow media advertisement blocks of data and throw in material data, flow media advertisement blocks of data comprises the information such as masterplate, JS script, flow media advertisement bit array, stores Buffer Pool with Hash table data form;Throw in material data and include material HTML code (AD_BODY field, refer to step 3), with the data structure storage of Hash table to Buffer Pool, after the webserver receives flow media advertisement request, directly obtain data from Buffer Pool and return to front end, (referring to step 7) thus realize purpose flexible, efficient.
Create flow media advertisement material to be completed by flow media advertisement background management system.Concrete steps are as shown in Figure 3:
1) management personnel generate flow media advertisement order according to customer demand;
2) on the premise of having order, manager can create the impression information of correspondence, mainly specifies the flow media advertisement type thrown in when creating impression information and throws in rule.
3) on the premise of having impression information, add the material information of correspondence;When creating material, the flow media advertisement type of material has existed (must be consistent with the flow media advertisement type of impression information), and does not allow change;After material information solicitation is complete, the common template of this flow media advertisement type will be read during preservation, variable part is replaced (such as material address, clicking on the information such as jump address, material ID), in obtaining the complete HTML fragment of this material and storing the AD_BODY field of material table.The material of same flow media advertisement position can be in addition to difference except content, its size, form, layout etc. are the most identical, so same flow media advertisement position does not appears in masterplate and the unmatched problem of actual effect, preserve successful material can management system material configuration page call preview material carry out preview throw in effect.
4) throw in engine and read the input data of present period, and according to the flow media advertisement position of impression information, all materials are analyzed, get the set of material corresponding to flow media advertisement position, then one record of random taking-up from set, this record is using the value as Hash table, key is flow media advertisement position ID, is built into Hash table data and stores Buffer Pool.
5) throw in engine and reload a secondary data by every five minutes.
Flow media advertisement blocks of data is by managing system administration, and data genaration step is as follows:
6) management personnel are according to demand, create flow media advertisement block object information and (include block ID, block title, flow media advertisement position ID array, masterplate templet, script scripts, whether have masterplate, affiliated Webpage ID, site information), HTML code and the JS script masterplate that i.e. we to use.Masterplate is only used for flow media advertisement location and layout information in the presentation web page page, and when the corresponding multiple flow media advertisement position of a flow media advertisement block, what this field stored includes HTML fragment and JS code two parts.(as in figure 2 it is shown, when a flow media advertisement block comprises multiple flow media advertisement position constantly, need to use js to do some specially good effects, so js script here is for realizing specially good effect;And when only one of which flow media advertisement position, it is only necessary to call the JS code backfill HTML of acquiescence;When there being multiple flow media advertisement position, then need the JS code of dynamic call flow media advertisement block to complete specially good effect part).
7) data load
Its structure Java language of flow media advertisement blocks of data is described as Hash table structure HashMap<String, PositionBlock>, this Hash table structural bond is flow media advertisement block ID, value is corresponding flow media advertisement block object, this flow media advertisement block object encapsulates 1 or 1 group of flow media advertisement position ID, resolves the DYNAMIC J S script and masterplate data obtained, as only one of which flow media advertisement position ID, masterplate data length is 3, without HTML fragment.First all flow media advertisement blocks of data collection are read, loop iteration data set gets flow media advertisement block ID, get the flow media advertisement bit data of correspondence according to flow media advertisement block ID, and the flow media advertisement position ID got is stored positions field and to identify masterplate be upstate.If during the corresponding multiple flow media advertisement position of flow media advertisement block, and flow media advertisement block masterplate data being split into array and store to templet field.Then packaged object is stored Buffer Pool.
Webpage flow media advertisement request step is as follows:
8) when Webpage is loaded into flow media advertisement region, the flow media advertisement of Webpage buries point (referring to the HTTP request that a flow media advertisement is special) and sends flow media advertisement request to the webserver, afferent stream media advertisement block ID (this value is fixing, and Webpage each flow media advertisement block has unique No. ID) simultaneously.
9) webserver is according to Webpage afferent stream media advertisement block ID, the webserver judge request from website, then get flow media advertisement material (see step 4) according to flow media advertisement block ID;
10) webserver is according to the flow media advertisement block ID in parameter, gets the PositionBlock object of correspondence from Buffer Pool;
11) flow media advertisement material is assembled by the webserver with PositionBlock: first get the HTML code of material from the AD_BODY field of flow media advertisement material, when current flow media advertisement block only comprises a flow media advertisement position, directly return the HTML code of material;When current flow media advertisement block comprises multiple flow media advertisement position, (see step 7), the templet field of the HTML code of material with PositionBlock object is merged, assembles complete HTML code, return.
12) generate complete HTML code and return to Webpage, the JS script that Webpage will be immediately performed in return information, flow media advertisement code is inserted the flow media advertisement block that Webpage is corresponding.
13) complete flow media advertisement more than to show.
Two main data structures are: Map<String, PositionBlock>, Map<String, ADIdea>.Map<String, PositionBlock>it is the data structure in caching, form [flow media advertisement block ID->flow media advertisement block], key is flow media advertisement block ID, value is the flow media advertisement block object of encapsulation, the HTML code information (templet field) corresponding including flow media advertisement block and DYNAMIC J S script (scripts field) information.Map<String, ADIdea>: the data structure in caching, form [material ID->material], key is material Id, is worth for flow media advertisement material information, and wherein what AD_BODY deposited is the HTML code of this material.
The foregoing is only presently preferred embodiments of the present invention, be not limited to the invention, all any amendment, equivalent and improvement etc. made within the invention spirit and principle, within being both contained in protection scope of the present invention.