Background technology
Current Streaming Media field, the Streaming Media jettison system is by player and the mutual realization of remote web server.namely by the embedded player of web browser (mainly), or other client (as itudou/, liking strange skill) embedded player under computer operating system, or mobile communication equipment terminals is (as ipad, iphone, htc) embedded player, initiate the http request, this request is carried stream media information and (is comprised Streaming Media ID, the Streaming Media duration, the Streaming Media type), cookie, user profile (comprises user ID, User IP, the user accessed duration the same day), pass to remote web server by network, use this solicited message constructing variable processor, server is by different requests, return to different Streaming Medias.The request of every kind of Streaming Media type, server end have the responsor (paste for example responsor, in plug in responsor, suspend responsor, footmark responsor, page response device) of unique correspondence, process request accordingly.Therefore responsor generally has five to eight (seeing accompanying drawing 1).But, these responsor set, corresponding with unique player kernel, and along with the fast development of network, and mobile client is in recent years rapidly universal, various streaming media playing environment occurred, cause Streaming Media to throw in environment also varied, single player kernel, and corresponding responsor set, streaming media playing, the Streaming Media that can't meet various clients are thrown in demand.
According to existing technical implementation way, different player kernels, need different responsor set.A kind of new player kernel namely occurs, need to again develop a cover Streaming Media and throw in responsor, cost consumption is huge, probably because the switching of player version or roll off the production line causes output value greatly to reduce.Therefore input, the output ratio of this implementation, be low-down.Along with the differentiation trend of various clients, player is in rising trend, the developer of responsor will be very passive, and development task is more and more heavier.Therefore a kind of response policy of server flexibly, the development cost with lower, the different demands of can adapt to, compatible various players, Streaming Media being thrown in environment, be very important.
The stream media system adapter, just for addressing this problem, a kind of scheme of designing, it is take same set of responsor as basis, exploitation by adapter, realize the different demands that a plurality of players, Streaming Media are thrown in environment, the relative new responsor set of cover of the development cost of adapter, be low-down.And flexibility is very strong, and a kind of new player kernel of every appearance, or Streaming Media input environment, revise adapter and can realize compatibility.See (accompanying drawing 2).
Summary of the invention
The invention provides a kind of Streaming Media jettison system, this system comprises for the player of initiating the Streaming Media request, is used for the parameter Processor of storage resource request information, the front subsides responsor that request responds to Streaming Media, in plug in responsor, suspend responsor, footmark responsor, page response device, it is characterized in that this system is new adapter corresponding to player configurations, described adapter comprises:
The adapter responsor, be used for obtaining Streaming Media material and convection current media materials information according to the required parameter after conversion and carry out assembly unit and integrate, the XML conversion of player interface agreement;
The adapter transducer, be used for obtaining player requests information and operation parameter processor RequestParams stores, and be used for parameter Processor RequestParams canned data being converted to the original system required parameter and being stored in the above-mentioned parameter processor;
Parameter Processor RequestParams, be used for the information that the Memory player request is carried.
Further, the conversion of adapter transducer comprises: according to the mapping relations between parameter, the value that implication is identical is mapped, and the value of new argument is stored by revising parameter Processor RequestParams.
Further, the adapter responsor comprises and obtains material module and agreement assembling module, and the request msg of obtaining after the material module is used for change is passed to the input engine,, according to different material types, passes to the disparate modules of input engine to carry out transferring of material; What return to the adapter responsor is the material list, and this material list comprises the required all types material of new player, and described agreement assembling module is used for assembly unit and integrates Streaming Media material information.
Further, the adapter responsor return Streaming Media material information to player after, with releasing resource.
The present invention also provides a kind of Streaming Media put-on method, it is characterized in that:
Step (1) player is initiated the Streaming Media request;
Step (2) adapter transducer obtains player requests information and operation parameter processor RequestParams stores, and is used for parameter Processor RequestParams canned data is converted to the original system required parameter and is stored in parameter Processor;
Step (3) adapter responsor obtains the Streaming Media material according to the required parameter after changing and convection current media materials information is carried out the assembly unit integration;
Carry out the XML conversion between step (4) adapter and player interface agreement in order to send Streaming Media material information to player.
Further, the conversion of adapter transducer described in step (2) comprises: according to the mapping relations between parameter, the value that implication is identical is mapped, and the value of new argument is stored by revising parameter Processor RequestParams.
Further, the request msg of obtaining after the material module is used for changing that further comprises wherein of obtaining of adapter responsor described in step (3) is passed to the input engine,, according to different material types, pass to the disparate modules of input engine to carry out transferring of material; Described assembly unit integrate comprise return to the adapter responsor be the material list, this material list comprises the required all types material of new player, agreement assembling module wherein is used for assembly unit and integrates Streaming Media material information.
Further, the method comprises: the adapter responsor return Streaming Media material information to player after, with releasing resource.。
Embodiment
The invention will be further described below in conjunction with the drawings and specific embodiments.
The present invention is a kind of Streaming Media jettison system and method, increases the compatibility of stream media system by this invention, reduces player and the heavily coupling of throwing between engine, make between player and input engine communicate by letter more flexible.
As shown in Figure 3, player is initiated the Streaming Media request to the general flow of system, carries stream media information, cookie, user profile, as: Streaming Media ID---itemID, user ID---userID.After adapter responsor Servlet receives request, pass to adapter transducer Parser.Adapter transducer Parser analysis request parameter, stored valuable information in the player requests such as Streaming Media ID, user ID with all solicited message constructing variable processor RequestParams(, and the non-real physical device of this parameter Processor, this processor is object in internal memory, object has the data structure of oneself, the attribute that oneself is arranged, the attribute number is not limit.Solicited message deposits in respectively in the attribute of RequestParams.)。Adapter transducer Parser takes the parameter Processor RequestParams that has constructed, the original system required parameter is as Streaming Media ID---sid, user ID---uid, adapter Parser realizes the conversion of parameter, itemID transfers sid to, it is in order to construct existing parameter Processor that userID transfers the uid(conversion to, throw in like this engine and need not change interface, can identify.), construct existing parameter Processor, return to adapter Servlet.
Adapter responsor Servlet obtains the Streaming Media material to throwing in engine.After taking material, adapter responsor Servlet will arrange material information.Because it is different from existing agreement to return to the agreement of player, adapter responsor Servlet, according to agreement, carries out assembly unit with the player desired data by character string, material information is assembled into the form of New Deal, returns to player.Every kind of adapter is just realized the assembly unit of agreement one to one.
Adapter structure as shown in Figure 5, has comprised adapter responsor Servlet, adapter transducer Parser, parameter Processor RequestParams.Adapter responsor (Servlet) inside also comprises two modules, as shown in Figure 6, has comprised and has obtained material module and agreement assembling module.Each component representation in adapter is as follows: 1) parameter Processor RequestParams:
Function: the full detail that the Memory player request is carried contains user profile, page info, stream media information etc.Attribute: corresponding with parameter in the player requests agreement.Parameter Processor RequestParams only has memory function, the process that structured value grows out of nothing.Initial condition is empty, does not store any information, and structure i.e. the process of storage.
2) adapter transducer Parser:
Function: conversion parameter processor RequestParams canned data, transform to throwing in the list of engine core parameter, shield the information gap opposite sex that different player requests are brought, be kernel object.
Attribute: request: solicited message; Response: adapter return information.
Method: get
*(), to player requests information, screens.* be the concept of having used regular expression, get
*() is the general designation of a plurality of methods, as getUnionId---and obtain the id of alliance method, realized the Base64 deciphering of the id of alliance; GetIP---obtain the User IP method, realized from repeatedly obtaining source IP function routing forwarding.Parser can obtain player requests information by these method adapter transducers.
Perform () realizes the solicited message translation function.Perform () takes the data of storage from parameter Processor RequestParams, according to the implication of value, the translation data form, deposit existing parameter Processor in.If do not change, throw in None-identified of engine, need make again the input engine of a differentiation, development cost is huge.
With reference to figure 3, different player requests, so-called difference is that agreement is different, two kinds of situations are specifically arranged: the one, parameter name is different, and the 2nd, parameter list different (as new argument, or lacking some parameter), adapter transducer Parser is according to the mapping relations between parameter, the value that implication is identical is mapped, and the value of new argument, by revising parameter Processor RequestParams, is stored.Shield the information gap alienation realization like this that different player requests are brought.For example: existing player parameter A BC, new player parameter A BD,, for new argument D, can map to parameters C, deposits the space of C in.If new player parameter is ABCD, need to revise existing parameter Processor, increase parameter D.
3) adapter responsor Servlet:
Function: realized the major function of adapter, and play the part of overall scheduling, the control the role.
Use process() realized calling of parameter Processor RequestParams, the obtaining of Streaming Media material, the assembly unit of Streaming Media material information is integrated, the XML conversion of player interface agreement.As Fig. 2, existing Streaming Media jettison system, be that different responsors return to different materials, and returning in the present invention adapter is material list (be the material information list, each material information comprises a material address)! This material list comprises the required all types material of new player, as the player first, only throws in front subsides, time-out, footmark, and the agreement assembling module in adapter responsor Servlet will once return to 3 kinds of Streaming Media materials and carry out the assembly unit integration.
Obtain the material module and be used for obtaining the Streaming Media material, data acquisition system comprises: 1) prerollIdeas: the set of front subsides Streaming Media material.2) postrollIdeas: paste afterwards the set of Streaming Media material.3) cornerIdeas: footmark Streaming Media material set.4) pauseIdeas: suspend the set of Streaming Media material.5) minibannerIdeas:minibanner miniflow media column material set.
Be stored in adapter responsor Servlet, return Streaming Media material information to player after, with releasing resource.
In set each field of basic data as shown in Figure 4, wherein, adIdea: Streaming Media material object.Stored stream media material full detail.Cp: throw in the N+ statistical information.ShowTimes: the user has watched number of times.IesParam: third party's detected parameters.Pl: paste position before expression in front subsides, meaningless in other type, be defaulted as 0 during structure, can only arrange afterwards, be fixed as 1 a mouthful sowing time, mouthful broadcasts as a kind of Streaming Media form paster Streaming Media a kind of.But last the broadcast.AdPos: Streaming Media position (be Streaming Media in the streaming media playing process, the ordinal position that represents) is used for data team statistics.
At first, the protocol data that will obtain in the adapter responsor after the material module will be changed is passed to the input engine,, according to different material types, passes to the disparate modules of input engine to carry out transferring of material.Throw in engine the corresponding multiple Streaming Media type of a plurality of modules is arranged, every kind of Streaming Media type has a material list acquisition module.The Streaming Media type comprises front subsides, time-out, footmark etc.For example, certain player is only asked front subsides Streaming Media, and adapter after the existing parameter Processor RequestParams of structure, passes to it front subsides material list acquisition module of throwing in engine so, namely returns to corresponding material list.
The Streaming Media material information of returning is stored in each Ideas.
Take player in the potato station as example, obtain front subsides, rear subsides, footmark, time-out, the set of minibanner material, owing to inserting during in the potato station, player is not supported, so obtain the material module in adapter, insert material in skipping over.The minbanner of player in the potato station, need to peel away with front subsides, so adapter carries out special processing to front subsides material prerollIdeas.Traversal prerollIdeas, obtain the material A that binds minibanner.Convert material A to the minibanner type, join the set of minibanner material.
The flow process brief introduction of XML conversion of carrying out the docking port agreement as an example of the potato player example is as follows:
The material data format that the adapter responsor is taken, player can not Direct Recognition, as front subsides material, need to be ads node (a kind of node type in the XML text) according to protocol conversion, material ID 97256 need transfer nodal community id to, the Streaming Media duration need transfer nodal community dt in 30 seconds, finally was converted to the XML text that player can be identified.
As follows according to the technique effect that technical scheme of the present invention obtains:
Technical solution of the present invention is with great flexibility, and extremely low development cost, maintenance cost, meet increasing player kernel, Streaming Media input environmental demand.A kind of player kernel of every increase, or increase a kind of Streaming Media input environment, only need revise the stream media system adapter, increase by 1~2 class file, can realize corresponding Streaming Media input function.Reduced development cost.
The foregoing is only preferred embodiment of the present invention, be not limited to the invention, all any modifications of making, be equal to replacement and improvement etc., within all being contained in protection scope of the present invention within the invention spirit and principle.