Embodiment
Overall thought of the present invention mainly comprises two aspect contents: one, delivery system is considered the display effect of same WEB resource on a few class heterogeneous terminals in issuing process, and describe with these effects are accurate, promptly make up a kind of description mechanism, describe content and layout that the WEB resource presents on all kinds of heterogeneous terminals.When various heterogeneous terminals visits made the WEB resource of issue in this way, delivery system generated different adaptive WEB resources according to the physical parameter of access terminal, and the WEB resource can the mode with comparatively hommization be represented on all kinds of heterogeneous terminals.Two, delivery system is when the request of access of receiving terminal, and its access technology requires terminal that the device parameter that can discern this terminal type is provided, and can go out the classification of terminal device according to these parameter recognition with the assurance system, obtains the physical parameter of terminal.
In actual life, the terminal quantity of various isomeries is numerous, should can not accomplish in when issue yet and specify the presentation mode of WEB resource on each terminal device that in fact present WEB resource is also developed at certain class rather than certain terminal device.Therefore the specific embodiment of the invention is according to the application in the real world, these heterogeneous terminals are divided into several main classifications, only should send to client, and should arrange to keep logical relation originally with what kind of layout type between these contents artificial definite which content of every kind equipment.For the concrete equipment in of all categories, will convert the WEB resource to adapt to its screen size display mode automatically in conjunction with the physical characteristics of classification information and this equipment.
Above-mentioned the WEB resource is described, terminal device is discerned, and the label of WEB resource is handled, the operation that adaptive and conversion produces new WEB resource all can realize based on middleware.A pair of the present invention describes in further detail below by specific embodiment.The process flow diagram of Web page resource issuing method specific embodiment one of the present invention as shown in Figure 1, middleware and server are wholely set, operate on the same main frame, middleware directly obtains the support of server, can be understood as the WEB resource that is distributed on the server and promptly is distributed on the middleware.In this case, terminal sends to the request of the visit WEB resource of server and will be intercepted and captured by middleware, and promptly middleware will be prior to server process WEB resource.The step of present embodiment one is as follows:
The request of step 101, middleware receiving terminal accessed web page resource, and receive the device parameter that contains this terminal class sign and physical parameter in this request, this terminal is the terminal of waiting to receive this web page resources;
Step 102, middleware be according to the classification of this device parameter identification terminal, and obtain the physical parameter of terminal;
Step 103, middleware are adjusted web page resources according to the physical parameter of terminal by the customized label of handling one or more new interpolations of representing the web page resources content, obtain the web page resources adaptive with described terminal;
Step 104, server obtain adaptive web page resources, it is finished the necessary back of handling send adaptive web page resources to this terminal.
In the foregoing description one, a kind of program (Servlet program) that can expand this server-capabilities of operation on the server, the new customized label that adds of this WEB resource is based on java server page or leaf (the Java Server Pages under the support of server S ervlet program, hereinafter to be referred as JSP) the technology realization, it is customized label, but not intrinsic label in the HTML (Hypertext Markup Language) (Hypertext Markup Language is hereinafter to be referred as HTML).Customized label is one of important technology of JSP, describes civilian module by marker character, can describe the mapping relations between the self-defining label and tag processes class in the WEB resource html language.This tag processes class is the tag processes mode, be exactly in JSP customized label technology, succession is for example inherited some classes from class " TagSupport " or " BodyTagSupport " by name from some classes of tag processes base class, is the part of Servlet program.Can obtain content between the parameter of corresponding customized label and label easily by the tag processes class.Middleware just comprises these tag processes classes.Realized some label processing method in the tag processes class, as begin at label, label finishes, handle various situations such as label substance handles, and has been equivalent to expand the ability to express of HTML.Adopt JSP/Servlet program customized label technology to carry out the definition of WEB resource tag, at first the mobile device with isomery is divided into several classes, for example be divided into regular handset, smart mobile phone/personal digital assistant (Personal Digital Assistant is hereinafter to be referred as PDA) and personal computer three classes.The issue personnel are that WEB resource to be released designs the basic presentation mode on this three Terminal Types equipment.According to above-mentioned sorting technique then needs define about 20 new linguistic labelses, these labels can indicate the best image layout of the specific JSP page on the different heterogeneous terminals of three class physical characteristicss.According to the semantic requirements of these labels, write corresponding tag processes class subsequently, and the middleware that will mainly be made of these tag processes classes is deployed on the server.At last, be the JSP page with original WEB conversion of page, the new issue of laying equal stress on.The above-mentioned label definition work of finishing by the issue personnel, also can assist the issue personnel to finish release tasks by the slotting module of development environment or development environment, but it is to be noted, development environment itself is not the content that the present invention pays close attention to, and can finish the issue of WEB resource among the present invention even without the support of special development environment yet.Work during issue in fact is exactly to add customized label according to the display mode that designs to various kinds of equipment for the JSP page.The browser great majority of considering present terminal device have certain autonomous adaptive transfer capability, and the work of therefore adding customized label can be too careful, but to adopt the characteristic of enhancing people-oriented interactions such as navigation, paging, thumbnail.Middleware is resolved and is handled according to general fashion the JSP page exactly the adaptation procedure of WEB resource, when running into customized label, middleware just calls the tag processes program in the respective labels processing class, progressively finishes ordinary pages to the adaptive process of particular terminal device.Specific implementation comprises: when running into picture in the adaptation procedure, if terminal device supports this picture/mb-type and dimension of picture to be no more than screen size, then acquiescence is not changed, if terminal device is not supported this picture/mb-type or dimension of picture is excessive or the publisher requires to do conversion, then the handling procedure of picture tag will be changed picture format, scaling pictures, reduction picture quality accordingly as the case may be or only provide the URL link; When running into audio/video media, animation (to call Flash in the following text) in the adaptation procedure, all only show the URL link for the acquiescence of the mobile device except that PC, and the publisher can use tag parameter to require handling procedure to show its preview graph or do not do the adaptive mobile device that directly sends to; Carry out the prescriber forms label for the display position that is used among the HTML to literal, picture, video etc., because a lot of mobile device screens are less, form is difficult to show according to the layout that is personal computer design, what therefore middleware can be given tacit consent to presents according to the permutation mode on the mobile device beyond the personal computer, and add significant mark for each row ending, certainly also can present in the full line mode under special circumstances, and add remarkable mark at every line endings according to publisher's intention.After handling all customized labels according to these strategies, the label information that adds in the time of can be according to issue is converted to the WEB resource on this terminal device the pattern that presents of comparatively hommization.After the page and customized label all disposed, the request of access that server can response terminal sent to terminal device with the new adaptive WEB resource page that generates.The partial content that does not have the ability processing for terminal device in the WEB resource, will be according to the default policy of publisher's requirement and setting, perhaps these contents are directly dispensed, a perhaps transmission part wherein only also can reduce transmission again after the quality for image, picture, audio etc.For the capable content of handling of terminal device in the WEB resource, if the original layout of this resource is adapted at presenting on the current terminal device, then needn't change, directly be transferred to terminal device and get final product; If layout originally is unsuitable for this resource presenting on current terminal device, then at first the content in these resources is separated in former layout, the descriptive markup of setting according to the publisher again, from several classes layout masterplate to be selected, select suitable layout pattern according to the concrete condition of equipment, these contents are inserted into form new WEB resource, send to terminal device then.
The label of WEB resource and tag processes class, can be in new WEB resource issuing process, set the tag parameter of customized label according to the particular content of the terminal physical parameter of request visit and this WEB resource, and original tag processes class is carried out corresponding modification.Also can carry out predefine according to the classification of predetermined a few class heterogeneous terminals to WEB resource to be released, or adopt defined label and tag processes class when asking to visit once more for the terminal of identical category, promptly in issuing process, no longer the WEB resource is carried out the setting or the modification of label and tag processes class.Customized label at the heterogeneous terminals classification, can be in server several classes of predefine terminal class commonly used, as regular handset, smart mobile phone/PDA, personal computer, along with the development of technology, when the classification commonly used of heterogeneous terminals increases, can constantly add new terminal class.So in the foregoing description one, can also comprise according to terminal class being the step of WEB resource settings label, and further comprise the label setting tag processes mode according to terminal class and WEB resource, the i.e. step of tag processes class.
In the process of carrying out the issue of WEB resource, answer the request of access of terminal except that server in the foregoing description one and carry out the embodiment of WEB resource issue, also have another kind of embodiment: when the server needs initiatively when terminal sends the WEB resource, then server or middleware can be directly obtain the classification logotype and the physical parameter of this terminal, the classification of identification terminal from server stores has the database of terminal class sign and physical parameter.So step 101 can also send the order of web page resources for the middleware reception server to terminal, acquisition waits to receive the device parameter of the terminal of web page resources, device parameter promptly contains the parameter of terminal class sign and physical parameter, the classification logotype of terminal can be the implementor name of terminal, also can be some crucial physical parameters, support characteristic etc. as the screen resolution of equipment, CPU frequency, memory size, browser, perhaps for the number-mark of distributing to this Terminal Type etc.
In the above-mentioned steps 104, server is handled the processing that has comprised WEB resource shell script or JSP statement to adaptive necessity that web page resources carried out, and makes it generate final html page.
WEB resource issuing method specific embodiment one adopts the method for adding a small amount of customized label to indicate the presentation mode of this WEB resource on all kinds of isomery equipment based on original WEB resource.Owing to original WEB resource itself is to develop for the specific device access of certain class,, can guarantee on this kind equipment, to reach optimal display result therefore based on original WEB resource.Customized label is mainly used in and indicates on other several kind equipments, and how this WEB resource should show.These labels can be used for removing the characteristic that certain kind equipment can't normally be supported, remove the content that influences display effect on certain kind equipment, perhaps by the bulk content is divided into several pages, and between page or leaf and page or leaf, the mode of navigation link is set, make some content on certain less kind equipment of screen, show to be different from original layout.On all kinds of isomery equipment, present effect as for how specifically using these marks to improve certain specific WEB resource, then be the work of issue personnel at launch phase, because label is defined by the issue personnel, so rely on the logical relation that layout structure embodied when farthest having kept the issue of WEB resource, and made full use of existing WEB resource, reduced the cost of overlapping development.And middleware is arranged on the server, intercepts and captures request of access, at first the WEB resource is carried out adaptation processing, makes mutual time decreased, and user's experience effect is good.
Be illustrated in figure 2 as the process flow diagram of WEB resource issuing method specific embodiment two of the present invention, in the present embodiment, middleware should be the tag processes program that comprises several tag processes classes, and two functional modules by identification terminal classification and adaptive WEB resource are formed, the identification module that middleware is discerned terminal operates on the server, the adaptation module that middleware carries out adaptation processing to the WEB resource is stored on the independent agency device that is connected with server, filtrator as the WEB resource, server is prior to middleware processes WEB resource at this moment, i.e. WEB resource issue is at first on server.Then present embodiment specifically comprises the steps:
The request of step 201, server receiving terminal accessed web page resource, and receive the device parameter that comprises terminal class sign and physical parameter in this request, this terminal is the terminal of waiting to receive this web page resources;
Step 202, server carry out necessary processing to the WEB resource;
Step 203, server judge whether to run into the label that is untreated of WEB resource, if then execution in step 204, otherwise execution in step 202;
Step 204, middleware identification module obtain the physical parameter of terminal according to the classification of this classification sign identification terminal, and identification module sends the physical parameter of this WEB resource and terminal to the middleware adaptation module;
Step 205, middleware are handled all labels that are untreated of web page resources according to the physical parameter of terminal, obtain the web page resources adaptive with this terminal;
Step 206, middleware send adaptive WEB resource to server;
Step 207, server are finished necessary processing back to adaptive web page resources and are sent to this terminal.
The advantage of WEB resource issuing method embodiment two is: middleware is independent of server the WEB resource is carried out adaptation processing, has alleviated the computational burden of server, makes network topology more flexible simultaneously, and a plurality of servers can a shared middleware.Can also be by client software be installed on terminal device, be exclusively used in the terminal iidentification and the physical parameter that produce for middleware identification, realize the compression of communicating by letter between terminal device and the middleware, thereby reduce the traffic, further save the energy of terminal device.
Be illustrated in figure 3 as the process flow diagram of WEB resource issuing method specific embodiment three of the present invention, middleware and server operate on the same main frame, but be with the difference of embodiment one: the serviced device of the request of access that terminal sends receives, and by server the WEB resource is at first carried out necessary processing, the concrete steps of embodiment three are as follows:
The request of step 301, server receiving terminal accessed web page resource, and receive the device parameter that comprises terminal class sign and physical parameter in this request, this terminal is the terminal of waiting to receive this web page resources;
Step 302, server carry out necessary processing to the WEB resource, the then execution in step 306 if the WEB resource disposes, otherwise execution in step 303;
Step 303, server judge whether to run into the label that is untreated of WEB resource, if then execution in step 304, otherwise execution in step 302;
Step 304, server send the classification logotype and the physical parameter of this WEB resource terminal to middleware, and middleware obtains the physical parameter of terminal according to the classification of this classification sign identification terminal;
The label that is untreated of the web page resources that step 305, middleware run into according to server in the physical parameter treatment step 303 of terminal, then execution in step 302;
Step 306, server send adaptive web page resources to this terminal.
In the foregoing description three, in fact be middleware and server cross processing, just run into customized label during server process and just give middleware control, be actually middleware in operational process, handle customized label to server requests, control is gone back to server behind intact this customize tag of middleware processes, circulation successively generates net result according to serial order like this again.Another kind of embodiment is exactly when server runs into first and is untreated label, just gives middleware control, behind intact all labels of middleware processes, control is gone back to entirely to server again.Also can define a specific special label, when server runs into it, just control is given to middleware.
Embodiment three, server is just handed to middleware processes when being untreated label or specific label running into, the situation that can adapt to multiple terminal access, as the terminal of routine visit still based on a certain terminal that can directly issue the WEB resource, then can determine whether the WEB resource is handed to middleware processes as the case may be, alleviate load of server, and reduced the reaction time
Figure 4 shows that the process flow diagram of WEB resource issuing method specific embodiment four of the present invention, roughly the same with embodiment one, difference is also to comprise:
Step 401, adaptive web page resources and corresponding terminal class and the physical parameter thereof of server stores;
After step 402, server identification go out terminal class, judged whether buffer memory and adapted to the web page resources that this waits to receive the terminal physical parameter of web page resources, if then execution in step 403;
Step 403, send the adaptive web page resources of this storage to this terminal.
Adopt the method for embodiment four, the terminal device of the same type with same physical parameter is visited when the WEB resource page of buffer memory is arranged, and just can alleviate the computation burden and the processing delay of server.
In WEB resource issuing method embodiment one, two, three and four, the description mechanism of WEB resource is except embodiment one described JSP/Servlet technology, multiple implementation can also be arranged, specify it for specific WEB resource and on specific terminal device, present effect.For example: the customized label function of XML itself, the customized label among the ASP.net etc.In the present invention, the issue personnel only need use descriptive markup to depict the WEB resource to get final product in the effect that presents of all kinds of isomery equipment coideals.
In WEB resource issuing method embodiment one, two, three and four, the device parameter of terminal comprises the classification logotype and the physical parameter of terminal, can produce by dual mode: first, by User-Agent header among the HTTP request package HEADER of terminal or user agent (User AgentProfile is hereinafter to be referred as UAProf) header marking terminal equipment is described; The second, client software module of operation on terminal device, the information of acquisition terminal device, these information use special independent HTTPHEADER data packet delivery to give middleware.The packet that comprises this parameter can when terminal request is visited the WEB resource, be included in the request of access or form one independently packet send to server, also can be after request visit, send again after sending the request of obtaining this parameter by server to this terminal.Middleware can be UAProf recognition of devices mechanism by the specific implementation of this parameter recognition device class, the information of carrying among the HEADER of the HTTP message that sends by the terminal device browser is judged, also can from this parameter, directly resolve the information such as characteristic of screen size, CPU frequency, memory size, browser support, adaptive ready for next step with conversion work.The terminal physical parameter can be included in the device parameter and transmit with the terminal class sign, also can only transmit the terminal class sign, after middleware identifies terminal class, searches the physical parameter that this classification terminal is had from the data in server storehouse.
Web page resource issuing method embodiment of the present invention has realized the WEB resource is only issued once by adopting above-mentioned issue and cut-in method, just can present in the mode than hommization on multiple isomery equipment.The processing and the power consumption burden of terminal device have been reduced as much as possible.
The present invention also provides a kind of WEB resource delivery system, and inventive concept is the introducing and the use of middleware.In the present invention, construct a middleware, it will be discerned the type of access terminal equipment, and handle the label of WEB resource according to terminal class, generate adaptive WEB resource.
Be illustrated in figure 5 as the specific embodiment of WEB resource delivery system of the present invention, this system comprises: server 1, and promptly first device is used to issue the issue of WEB resource, carries out conventional processing, and sends web page resources to terminal; Middleware 2, i.e. second device, middleware 2 is specifically by the identification module 21 that is used for the identification terminal classification, i.e. first module and be used for handling the adaptation module 22 of WEB resource customized label according to the physical parameter of terminal, promptly Unit second is formed.Middleware 2 can be wholely set with server 1, operates on the same main frame.The identification module 21 of middleware 2 also can separate setting with adaptation module 22, identification module 21 operates on the same main frame with server, and adaptation module 22 is separated setting with server 1, be self-existent network element hardware device, identification module 21 at middleware 2 separates with adaptation module 22 in the embodiment that is provided with, WEB resource delivery system also should comprise communication module 23, is used to control and coordinate the identification module 21 of middleware 2 and the data transmission between the adaptation module 22.
In the above-described embodiments, also can further comprise terminal parameter generation module 3, promptly the 3rd device is arranged on client terminal, is used to produce the classification logotype of described terminal and/or the physical parameter relevant with the terminal display effect.
WEB resource delivery system specific embodiment of the present invention is issued web page resources, mainly the embodiment based on Web page resource issuing method of the present invention realizes, can provide better support for the heterogeneous terminals visit WEB resource of plurality of classes, optimized the display effect of WEB resource on heterogeneous terminals, utilized existing WEB resource to a great extent, avoid overlapping development, and the adaptive foundation of WEB resource can keep WEB resource publisher to rely on the logical relation information that layout structure is showed for the label of publisher's definition to the full extent.
It should be noted last that, above embodiment is only unrestricted in order to technical scheme of the present invention to be described, although the present invention is had been described in detail with reference to preferred embodiment, those of ordinary skill in the art is to be understood that, can make amendment or be equal to replacement technical scheme of the present invention, and not break away from the spirit and scope of technical solution of the present invention.