Background technology
Router (Router), be the equipment connecting each LAN (Local Area Network), wide area network in the Internet, it can automatically be selected according to the situation of channel and set route, with optimal path, sends signal by tandem.
Router is for connecting multiple network separated in logic also known as gateway device (Gateway), and so-called logical network represents an independent network or a subnet.When data are transferred to another subnet from a subnet, the routing function by router has come.Therefore, router has the function judging the network address and select IP path, it can in Multi net voting Interconnection Environment, set up and connect flexibly, available diverse packet is connected various subnet with media access method, router only accepts the information of source station or other routers, belongs to a kind of InterWorking Equipment of network layer.
At present, router is widely used in all trades and professions, and the product of various different class has become and realizes that various backbone network inside connects, the main force of key internetworking and backbone network and internet interconnection business.
Further, most router has been supported multi-lingual, and also have and only support single language, but, this is not easy to the expansion of market abroad, in order to more quick, supports new language easily.
Existing multi-lingual way is add the hook of <#...#> and so in the page of web services end substantially, when having request to come, web services end is responsible for translating corresponding word string, and translated data is returned to client, client reading displayed.
But the multilingual way of existing router at least has shortcoming: the pressure increasing web services end, ask each time all to need conversion one substring, suppose, when router has a lot of session number simultaneously, can produce a large amount of time-consuming operation, while, is inconvenient to expand.
Summary of the invention
The shortcoming of prior art in view of the above, the object of the present invention is to provide and a kind ofly realize the multilingual method of router and web services end, realizing multilingual the brought increase web services end of router for solving in prior art, be inconvenient to the problem expanded.
For achieving the above object and other relevant objects, an aspect of of the present present invention provides a kind of and realizes the multilingual method of router, said method comprising the steps of: said method comprising the steps of: receive Request Packet; The main part of read requests package; Judge that whether described main part is containing lang.js; When described main part contains lang.js, then perform corresponding do_lang action; Judge whether the family of languages changes; And when the family of languages changes, then former lang.js is upgraded.
In one embodiment of the present invention, also comprise: when the family of languages does not change, then judge whether former lang.js is empty; When former lang.js is empty, then former lang.js is upgraded.
In one embodiment of the present invention, when former lang.js is not empty, then former lang.js is not upgraded.
In one embodiment of the present invention, judge that the family of languages step that whether changes comprises: the content of the content of the lang.js in described main part and former lang.js compared, to judge whether the family of languages changes.
For achieving the above object and other relevant objects, another aspect of the present invention provides a kind of and realizes the multilingual web services end of router, comprising: receiver module, receives Request Packet; Read module, the main part of read requests package; First judge module, judges that whether described main part is containing lang.js; Execution module, when described main part contains lang.js, then performs corresponding do_lang action; Second judge module, judges whether the family of languages changes; And update module, when the family of languages changes, then former lang.js is upgraded.
In one embodiment of the present invention, also comprise the 3rd judge module, wherein, when the family of languages does not change, then described 3rd judge module judges whether former lang.js is empty; When former lang.js is empty, then described update module upgrades former lang.js.
In one embodiment of the present invention, when former lang.js is not empty, then former lang.js is not upgraded.
In one embodiment of the present invention, described second judge module judges whether the family of languages changes and comprises: the content of the content of the lang.js in described main part and former lang.js compared, to judge whether the family of languages changes.
In sum, of the present inventionly realize the multilingual method of router and web services end, by the optimization of web services end, the multilingual translation of router can be made not carry out at web services end, thus alleviate the pressure of web services end, save the time; Further, more newspeak is convenient, thus convenient expansion.
Embodiment
Below by way of specific instantiation, embodiments of the present invention are described, those skilled in the art the content disclosed by this instructions can understand other advantages of the present invention and effect easily.The present invention can also be implemented or be applied by embodiments different in addition, and the every details in this instructions also can based on different viewpoints and application, carries out various modification or change not deviating under spirit of the present invention.It should be noted that, when not conflicting, the feature in following examples and embodiment can combine mutually.
It should be noted that, the diagram provided in following examples only illustrates basic conception of the present invention in a schematic way, then only the assembly relevant with the present invention is shown in graphic but not component count, shape and size when implementing according to reality is drawn, it is actual when implementing, and the kenel of each assembly, quantity and ratio can be a kind of change arbitrarily, and its assembly layout kenel also may be more complicated.
Refer to Fig. 1, the schematic flow sheet realizing the multilingual method of router of the present invention.
First, in step s 11, receive Request Packet, namely receive client, such as browser, the Request Packet sent.
Then, in step s 12, the main part of read requests package.
Afterwards, in step s 13, judge that whether main part is containing lang.js.
Then, in step S14, when described main part contains lang.js, then perform corresponding do_lang action.
Then, in step S15, judge whether the family of languages changes.
In one embodiment, judge whether the family of languages changes, Ke Yishi, the content of the content of the lang.js in main part and former lang.js is compared, to judge whether the family of languages changes, such as, the family of languages in main part has English EN, then represent and change.
Afterwards, in step s 16, when the family of languages changes, then former lang.js is upgraded, and client will be back to after upgrading, and then allow client load.
For example, when the family of languages changes, such as, current is EN, then return the EN.js of content to client, load to allow client.
In one embodiment, step S17, S18 can also be comprised.
In step S17, determine whether sky, namely judge whether former lang.js is empty, if be empty, then enter step S16, otherwise enters step S18, namely do not upgrade.
Refer to Fig. 2, the module diagram realizing the multilingual web services end of router of the present invention.
Described Web service end 2 comprises receiver module 21, read module 22, first judge module 23, execution module 24, second judge module 25, update module 26 and the 3rd judge module 27.
Described receiver module 21, for receiving Request Packet, namely receives client, such as browser, the Request Packet sent.
Described read module 22 is for the main part of read requests package.
Described first judge module 23 is for judging that whether main part is containing lang.js.
Described execution module 24 for when main part contains lang.js, then performs corresponding do_lang action.
Described second judge module 25 is for judging whether the family of languages changes.
In one embodiment, the second judge module 25 judges whether the family of languages changes, Ke Yishi, the content of the content of the lang.js in main part and former lang.js is compared, to judge whether the family of languages changes.
Described update module 26 for when the family of languages changes, then upgrades former lang.js, and will be back to client after upgrading, and then allows client load.
For example, when the family of languages changes, such as, current is EN, then return the EN.js of content to client, to allow client load, can certainly be updated to other Languages, such as Japanese JP.
Wherein, when the family of languages does not change, then the 3rd judge module 27 judges whether former lang.js is empty; When former lang.js is empty, then update module 26 upgrades former lang.js, and when former lang.js is not empty, does not then upgrade former lang.js.
In sum, of the present inventionly realize the multilingual method of router and web services end, by the optimization of web services end, the multilingual translation of router can be made not carry out at web services end, thus alleviate the pressure of web services end, save the time; Further, more newspeak is convenient, thus convenient expansion.
Above-described embodiment is illustrative principle of the present invention and effect thereof only, but not for limiting the present invention.Any person skilled in the art scholar all without prejudice under spirit of the present invention and category, can modify above-described embodiment or changes.Therefore, such as have in art usually know the knowledgeable do not depart from complete under disclosed spirit and technological thought all equivalence modify or change, must be contained by claim of the present invention.