Embodiment
Below in conjunction with accompanying drawing of the present invention, technical scheme of the present invention is clearly and completely described, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, the every other embodiment that those of ordinary skills are obtained under the prerequisite of not making creative work belongs to the scope of protection of the invention.
The embodiment of the invention one provides a kind of method that improves the multiple terminals display effect of network page, and referring to Fig. 1, described method comprises:
11: the label be independent of page versions is set, described label definition the semantic function that can support of the page, form by described label and to unify template;
12: utilize the request of the different terminals that receives to discern the webpage version that each terminal is supported respectively;
13: utilize factory mode that described unified template is converted to the content of the webpage version correspondence that described terminal supports, on each terminal, to show corresponding web page respectively.
By as seen above-mentioned, the technical scheme of the embodiment of the invention is on early stage version base of recognition, generated the page of different editions by the unified template of a cover, promptly can utilize a cover template to support to have a plurality of terminals of different web pages version simultaneously, thereby solved in the prior art because the version of the webpage version that terminal self is supported and its accessed web page when inconsistent problem that page display effect is relatively poor.
And the technical program can significantly reduce the workload of webpage development, reduces the difficulty that webpage is managed and safeguards, helps development of internet technology; And,, improved the utilization factor and the professional extensibility of resource owing to, the web page resources of new early version is shared by label in the unified template can be added the webpage function or revise easily.
A kind of method that improves the multiple terminals display effect of network page that the embodiment of the invention two is provided describes below.Referring to Fig. 2, the method flow synoptic diagram that has shown the raising multiple terminals display effect of network page that the embodiment of the invention provided, in scene shown in Figure 2,, specifically comprise to utilize webpage version recognition unit and tag processes unit to realize that the concrete steps of this method are that example describes:
1: the request that the receiving terminal user sends.
Above-mentioned terminal can be portable terminal, as mobile phone, also can be catv terminal, as computing machine etc.Terminal as the web page access request message, sends request to webpage version recognition unit by corresponding request message.
2: the webpage version that terminal is supported is discerned.
Webpage version recognition unit is according to the request from the terminal user, the webpage version that identification terminal is supported.Webpage version recognition unit can be handled the request of a plurality of terminals simultaneously, identifies the webpage version that a plurality of terminal is supported simultaneously.
The webpage version that terminal is supported is including, but not limited to following a kind of version:
WAP Markup Language wml1.2 version, wml2.0 version, text mark language html version and html5 version.
The existing utilization in the process that template generates the page to each ingredient of the page, all needs to carry out one by one the identification of release type in the process that generates, need repetitive operation, and complex operation, also causes when revising and make template, and difficulty is bigger.
At this problem, the technical program is in the page generates early stage process, at first the webpage version is continued identification and affirmation, in the implementation that subsequent page generates, need not to carry out again version identification, promptly distinguished significantly, be convenient to expansion the new page version to the deterministic process of page versions with to the interpretation process of label, and, to the increase or the deletion of label in the unified template.
3: obtain corresponding factory and realize class.
The pairing factory of the webpage version that acquisition identifies realizes class.For example, factory realizes that class WML1.2Factory has realized the label generation work of label corresponding to wml1.2, and factory realizes that class HTMLFactory has realized the label generation work of label corresponding to html.
The technical program is not carried out the strictness qualification to the concrete execution order of each step, and for example, the establishment of factory's realization class can be finished before the receiving terminal request in advance, can work as to receive terminal request execution more afterwards yet.Referring to Fig. 2, according to the webpage version difference that terminal is supported, obtain a plurality of different factories and realize class, realize class 1 as factory, factory realizes that class 2 realizes class n to factory, n is a sequence number.
4: give the tag processes unit with the factory's realization class that obtains.
5: tag processes unit by using factory realizes that class makes an explanation to unified template, to obtain the content of the webpage version correspondence that each terminal supports.
The label be independent of page versions is set in the tag processes unit, described label definition the semantic function that can support of the page, form the unification template by described label, unify template as label according to the predetermined relationship composition.
The embodiment of the invention has at first proposed one and has overlapped the label that is independent of each page versions, the label of this " independence " mainly is meant the definition of label and does not rely on concrete webpage version, this label has just defined the semantic function that the page can be supported, be in the embodiment of the invention according to the function and the design feature of the webpage of being realized, extract label with semantic concept fundamental element as unified template.
For example, label<ui:textarea name=" content "〉</ui:textarea〉be called the semantic function of the input frame of content corresponding to a name.
Similarly, can also pass through label definition document (doc), document head (head), document body pairing semantic functions such as (body).The attribute that the concrete mode that label is realized and these labels have (as the function of needs realization) is according to the actual needs adjusted.
After having defined these labels, just can use these labels to define or form unified template, label mainly is from semantically having described the structure of unified template.
For example, be the simple examples of a defined unified template below:
In above-mentioned unified template, comprise label<ui:doc 〉, label<ui:head 〉, label<ui:title〉and label<ui:body.
Therefore, stated a document in the example of above-mentioned unified template, as label<ui:doc 〉, it has a document head (), and the name that has wherein defined document is called " test ", and it has also defined document body, and its content is " content measurement ".
Further, different labels is to form unified template according to predetermined relationship, and described predetermined relationship is arranged in the described label.For example, in above-mentioned unified template example, label<ui:doc〉in just be provided with a kind of relation of inclusion, by this relation of inclusion with label<ui:head be included in label<ui:doc; And label<ui:head〉in also be provided with a kind of relation of inclusion, by this relation of inclusion with label<ui:title be included in label<ui:head in.
Yet, above-mentioned unified template can not directly return to user's browser, because unified template is not the realization of a concrete page versions, all browsers all nonrecognition are unified template, before turning back to user's browser, need it is translated, finally convert user's the browser acceptable page to, and this process realizes by factory mode in this programme.Tag processes unit by using factory mode is converted to the content of the webpage version correspondence that described terminal supports with described unified template, to show corresponding web page respectively on each terminal.
Factory that the tag processes unit by using is created out realizes that class makes an explanation to unified template, obtains the webpage that the webpage version of terminal is supported.
Further, corresponding with the definition of label, for each label, realize in the class explanation function being set in factory, this explanation function is interpreted as label the statement of corresponding webpage version.
For example, label<ui:textarea name=" content "〉</ui:textarea〉in factory's realization class of wml, will be translated into<input name=" content " type=" text "/
And this label is realized can being translated in the class in the factory of html:
<textarea?name=″content″></textarea>。
6: the web page contents that the tag processes unit will obtain after will explaining sends to each terminal user respectively.
Because the webpage version that web page contents that obtains after explaining and terminal are supported can be consistent, terminal can access the higher web data of quality, thereby can improve the display effect of webpage on the terminal browser.
Further, the technical program is by increasing or revise described label described unified template is upgraded, thereby is convenient to increase new function on the page, perhaps, introduces new page versions.
The technical program clear and definite definition on the basis of the label that can support, the use factory mode provides the support to different page versions respectively, the page that adds redaction only need increase a new factory newly and realize that class gets final product, and only need realize that the method for an output label of class increase gets final product to each factory when increasing a label newly.
By as seen above-mentioned, the technical scheme of the embodiment of the invention is on early stage version base of recognition, generated the page of different editions by the unified template of a cover, promptly can utilize a cover template to support to have a plurality of terminals of different web pages version simultaneously, thereby solved in the prior art because the version of the webpage version that terminal self is supported and its accessed web page when inconsistent problem that page display effect is relatively poor.
And the technical program can significantly reduce the workload of webpage development, reduces the difficulty that webpage is managed and safeguards, helps development of internet technology; And,, improved the utilization factor and the professional extensibility of resource owing to, the web page resources of new early version is shared by label in the unified template can be added the webpage function or revise easily.
The embodiment of the invention three also provides a kind of device that improves the multiple terminals display effect of network page, and referring to Fig. 3, described device comprises:
Webpageversion recognition unit 31, the webpage version that is used to utilize the request identification terminal of the terminal that receives to be supported;
Tag processes unit 32 is used to be provided with the label that is independent of page versions, described label definition the semantic function that can support of the page, form unified template by described label; And, by factory mode described unified template is converted to the webpage that the terminal of described webpage version is supported, on terminal, to show corresponding web page.
Further, describedtag processes unit 32 comprises that factory realizes class creation module and version explanation module,
Described factory realizes the class creation module, is used to create the pairing factory of the webpage version that is identified and realizes class;
Described version explanation module is used to utilize described factory to realize that class makes an explanation to unified template, obtains the webpage that the webpage version of described terminal is supported.
Further, described device also comprises unified template renewal unit 33, is used for by increasing or revising described label described unified template is upgraded.
The concrete working method of each unit and module is referring to the inventive method embodiment among apparatus of the present invention embodiment.
The technical program clear and definite definition on the basis of the label that can support, the use factory mode provides the support to different page versions respectively, the page that adds redaction only need increase a new factory newly and realize that class gets final product, and only need realize that the method for an output label of class increase gets final product to each factory when increasing a label newly.
By as seen above-mentioned, the technical scheme of the embodiment of the invention is on early stage version base of recognition, generated the page of different editions by the unified template of a cover, promptly can utilize a cover template to support to have a plurality of terminals of different web pages version simultaneously, thereby solved in the prior art because the version of the webpage version that terminal self is supported and its accessed web page when inconsistent problem that page display effect is relatively poor.
And the technical program can significantly reduce the workload of webpage development, reduces the difficulty that webpage is managed and safeguards, helps development of internet technology; And,, improved the utilization factor and the professional extensibility of resource owing to, the web page resources of new early version is shared by label in the unified template can be added the webpage function or revise easily.
Those skilled in the art can be well understood to the present invention and can realize by the mode that software adds essential general hardware platform.Based on such understanding, the part that technical scheme of the present invention contributes to prior art in essence in other words can software product form embody, this computer software product can be stored in the storage medium, as ROM/RAM, magnetic disc, CD etc., comprise that some instructions are with so that a computer equipment (can be a personal computer, server, the perhaps network equipment etc.) carry out the described method of some part of each embodiment of the present invention or embodiment.
The above only is preferred embodiment of the present invention, and is in order to restriction the present invention, within the spirit and principles in the present invention not all, any modification of being made, is equal to replacement, improvement etc., all should be included within the scope of protection of the invention.