CN103383687B - A kind of page processing method and device - Google Patents

A kind of page processing method and device Download PDF

Info

Publication number
CN103383687B
CN103383687B CN201210134966.5A CN201210134966A CN103383687B CN 103383687 B CN103383687 B CN 103383687B CN 201210134966 A CN201210134966 A CN 201210134966A CN 103383687 B CN103383687 B CN 103383687B
Authority
CN
China
Prior art keywords
module
content
request
pages
page
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201210134966.5A
Other languages
Chinese (zh)
Other versions
CN103383687A (en
Inventor
陈波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201210134966.5A priority Critical patent/CN103383687B/en
Publication of CN103383687A publication Critical patent/CN103383687A/en
Application granted granted Critical
Publication of CN103383687B publication Critical patent/CN103383687B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

This application provides a kind of page processing method and device, it is related to page processing technology field.The present processes include:Parameter information in parsing page request, described parameter information includes target domain name and indicates the first mark that described page request belongs to the first module;Described page request is initiated by the user side of the first module, and the corresponding content of pages of described page request is provided by corresponding three module;For the request including the first mark, corresponding three module is forwarded it to according to the aiming field name in this request, and obtains the content of pages of response from described three module;Load the configuration information of described first mark of correspondence in the configuration file of configuration module, and according to described configuration information, described content of pages is processed;Return the content of pages after described process.The modification code of first module of the application and the core business code dehind of three module, make system easy to maintain, and stable, the modification demand of energy other modules of quick response.

Description

A kind of page processing method and device
Technical field
The application is related to page processing technology field, more particularly to a kind of page processing method and device.
Background technology
With the popularization of Internet enabled mobile terminal, most users have begun to use mobile terminal Internet access, clear Look at info web.For this trend, each big website specially optimizes WAP site (WAP, the Wireless of oneself Application Protocol, WAP, a kind of realize the application protocol mark that mobile phone is combined with the Internet Accurate), do the WAP site for mobile phone users experience.In practice, there is such a data processing method, website A Three module the web page contents of certain application are provided, and first module of website B needs this that the three module of website A provides Plant the web page contents of application, the user in order to website B can pass through the content that website B accesses the three module offer of website A, And when user being accessed to the web page contents of the three module of website A from website B, need to show website B's in web page contents Relevant information (such as shows the logo of webpage B) in footer, and that is, the web page contents of the three module of website A need with reference to website B Relevant information be adjusted.
For above-mentioned situation, in prior art, for the relevant information of website B, need the offer original web page in website A Carry out adaptation, to ensure the net providing by the first module accesses three module of website B in the logical code of content During page content, the relevant information of website B can be shown.
Due to above-mentioned modification mode, there is following several shortcoming in prior art:
1st, for distributed system, that is, when there are the web page contents that multiple three modules provide various applications, existing solution Certainly scheme can lead to the demand code of website B to be scattered in multiple application systems is in multiple three modules, needs and each 3rd mould The business logic codes coupling of the original offer web page contents of block, which increases maintenance cost.
2nd, with need three module provide web page contents website increase and demand change, such as also website C, D is also required to the web page contents of certain three module offer, or website B needs the information of modification to change, then need in the 3rd mould Continue to modify according to demand in the current logical code of block.So, directly modification in the service logic of three module Service code will get more and more.And if three module provides the core business logic of original web page content to need to change and upgrade When, the logic that the above-mentioned demand according to the 3rd server side is modified is also required to synchronized update.When three module offer is original Increasing of the core business logic scale of content of pages and increasing of described modification logic, this logic meeting changed according to demand Gradually become one of factor of impact the 3rd business module business logic systems, increase the risk of system stability, and increase Upgrade cost.
3rd, the modification demand of website B or other parties in request different from three module be typically urgent, scattered, with Machine, when receiving the modification demand of other websites, if the logic of modification three module service logic is issued, during modification again Between the cycle long, increase time cost, thus affecting the efficiency for issuing of three module service logic.
Content of the invention
The application is to provide a kind of page processing method and device, can will change offer parent page in each three module The demand code of the core business logic of content is stripped out, from each three module before service application not being modified Put, for the difference demand of other modules of affiliated sides different from three module, quickly generate and fit with other module demand phases The page answered, there is provided the response effect of quick modification, and ensure that the stability of the original logical system of three module.
In order to solve the above problems, this application discloses a kind of page processing method, including:
Parameter information in parsing page request, described parameter information includes target domain name and indicates described page request genus The first mark in the first module;Described page request is initiated by the user side of the first module, the corresponding page of described page request Face content is provided by corresponding three module;
For the request including the first mark, corresponding 3rd mould is forwarded it to according to the aiming field name in this request Block, and the content of pages of response is obtained from described three module;
Load the configuration information of described first mark of correspondence in the configuration file of configuration module, and according to described configuration information Described content of pages is processed;
Return the content of pages after described process.
Preferably, load the configuration letter of described first mark of correspondence in the configuration file of configuration module as follows Breath, and according to described configuration information, described content of pages is processed:
Step A1, loads the configuration information of described first mark of correspondence in the configuration file of configuration module;
Step A2, searches node information corresponding with node information each in described configuration information from described content of pages;
Step A3, is carried out to the node information in described content of pages to the description of each node information according in configuration information Modification.
Preferably, from described content of pages, lookup is corresponding with each node information in described configuration information as follows Node information:
Tag name according to node to be modified in configuration information and the corresponding character string of attribute information, by by described character Character string corresponding with content of pages of going here and there is mated, and searches node information described in content of pages;
Or, according to the tag name of node information to be modified in configuration information and attribute information, by traveling through in the described page The dom tree holding, searches node information described in content of pages.
Preferably, described each step executes in proxy module.
Preferably, described content of pages is carried out processing also including:
Step A4, the former Object linking address in content of pages is replaced with agent address.
Preferably, parse page request parameter information by following steps:
Step B1, analysis request URL, obtain the domain name in request;
Step B2, whether verifying domain name is legal;If illegal, proceed to step B3, if legal, proceed to B4;
Step B3, refuses this access request;
Step B4, extracts user side parameter information in request.
Preferably, described user side parameter information includes the first mark, the IP of user side, and the type of user side.
Preferably, also include:
URL process step, reduces the link length of URL, and the statistical parameter comprising in URL is added in back page In each URL holding.
Preferably, the described request for inclusion first mark, forwards it to phase according to the aiming field name in this request The three module answered, and the step of content of pages obtaining response from described three module includes:
Step D1, sets up a simulation HTTP request according to the identity letter of requesting party in request;
Step D2, executes described simulation HTTP request, obtains the content of pages of response.
Preferably, execute described simulation HTTP request, when obtaining the content of pages responding:
When http response code is normal, then direct access response content of pages and cache;
When http response code is that described page request needs to reorientate, then allow first server access agent ground again Location.
Accordingly, disclosed herein as well is a kind of Page handling device, including:
Request accept module, for parsing the parameter information in page request, described parameter information include target domain name and Indicate the first mark that described page request belongs to the first module;Described page request is initiated by the user side of the first module, institute Stating the corresponding content of pages of page request is provided by corresponding three module;
Request forwarding module, for for the request including the first mark, according to aiming field its turn of star in this request It is sent to corresponding three module, and obtain the content of pages of response from described three module;
Content processing module, for loading the configuration information of described first mark of correspondence in the configuration file of configuration module, And according to described configuration information, described content of pages is processed;
The page returns module, for returning the content of pages after described process.
Compared with prior art, the application includes advantages below:
(1) Noninvasive.The application is according to the configuration beyond the core logic of three module offer parent page content It is directed to different demands in module and configures corresponding configuration information, then page is changed beyond described core logic according to configuration information Face content, need not change each three module provides the core logic code of parent page content, and so, modification does not interfere with the 3rd Module provides the core logic of parent page content, and the code of modification will not be coupled with core logic.
(2) ease for maintenance and stability.The application is configured to each species diversity demand by configuration module, is then based on Configuration is modified, and without changing core logic, is all easy to safeguard for demand code and core logic code, and, by Do not change in core logic code, so systematic comparison is stable;And when for different demands, configuration module can be based only on In configuration information web page contents are modified, when three module core logic change or upgrade when need not pay close attention to demand Code, reduces upgrade cost.
(3) mode of dynamic publishing.The application can increase in configuration module at any time or change configuration information, be then System changes content of pages according to configuration information beyond described core logic, and the logic that need not change in multiple three modules is entered again Row is issued, the demand of energy other modules of quick response.
Brief description
Fig. 1 is a kind of schematic flow sheet of page processing method of the application;
Fig. 2 is preferably a kind of schematic flow sheet of Page handling device of the application;
Fig. 3 is a kind of structural representation of page processing method of the application;
Fig. 4 is preferably a kind of structural representation of page processing method of the application;
Fig. 5 is preferably a kind of structural representation of page processing method of the application.
Specific embodiment
Understandable for enabling the above-mentioned purpose of the application, feature and advantage to become apparent from, below in conjunction with the accompanying drawings and specifically real Mode of applying is described in further detail to the application.
One of core concept of the application is, based on the principle of reverse proxy, for providing the of parent page content Three module, the application is independent by it.For the first module of the content of pages needing three module to provide, in configuration module The configuration information of middle configuration the first module demand, is then initiated by the user side that second module of the application is directed to the first module Web-page requests, obtain web page contents from three module, are processed according to the configuration information of the first module, then result is returned Back to user side.So, three module is provided to the core logic of parent page content, because it is served only for providing original net Page content, the demand modification logic for the first module demand is then carried out in second module of the application, need not change the 3rd Described core logic in module.Therefore, demand modification logical code is not influenced each other each other with core logic code, respectively From carrying out respective logical code maintenance, convenient and easy, the logical system of three module is stable, and the need for the first module Ask, need not completely change again and issue after all logics of three module such that it is able to quick response cooperation demand.
With reference to Fig. 1, it illustrates a kind of schematic flow sheet of page processing method of the application, including:
Request receiving step 110, the parameter information in parsing page request, described parameter information includes target domain name and mark Show that described page request belongs to the first mark of the first module;Described page request is initiated by the user side of the first module, described The corresponding content of pages of page request is provided by corresponding three module;
In practice, would generally cooperate between website, to throw in related pages content.Such as, the second website B and One website A cooperates, and the user accessing the first website A can be obtained by corresponding first module of the first website A or show second The web page contents that the corresponding three module of website B provides.Generally in these cases, the corresponding first website A of the first module needs The content of pages wanting the three module of the second website B to provide, needs including the first clothes in the content of pages of three module providing The relevant information of business device place side;Such as first website A needs to adopt the in the footer of the page that three module provides and header The additional informations such as the LOGO picture of one website A.In addition, may have multiple first modules in practice, that is, there are multiple websites and carry For the three module of web page contents, and the process demand of each the first module is generally all different, the such as concrete content loading, loading Mode etc..In addition also likely to be present multiple three modules.
For the first module, there is the user side accessing the first module in it.Such as website A, user side may have access to net Stand A, if being provided with the link of the web page contents that corresponding three module provides in the A of website, and user clicks this link, then use This web-page requests that family is initiated send to second module of the application.Generally, first module of website A is by the 3rd The link of module web page contents hangs over website, jumps directly to the second module when user clicks on, and first module of website A also may be used The link of corresponding three module web page contents is carried out processing carry on the A of website again, when user clicks on, the first module is first right Link carries out process and retransmits to the second module.The page request that second module receives includes corresponding first mark of the first module Knowledge, target domain name and user side parameter information.URL (the Uniform/ of the page request that the such as second module receives Universal Resource Locator, URL):
http://proxy.m.taobao.com/gate/sina/p.do?p_url=wap.taobao.com%3Fttid% 3D1, wherein, first server corresponding first is designated sina, and in request, the aiming field of corresponding three module is entitled wap.taobao.com.In addition, also including in described page request accessing the user side parameter information of first server, such as use Family end IP, type of user side etc..
Preferably, the page request user side receiving being sent by the interface that first server provides, agency Page request described in meeting pretreatment, and check the effectiveness of described page request.
Preferably, analyze and process described page request by following steps:
Step B1, analysis request URL, obtain the domain name in request.
Such as, for aforementioned request URL:
http://proxy.m.taobao.com/gate/sina/p.do?p_url=wap.taobao.com%3Fttid% 3D1
According to the parameter value after p_url, carry out url decoding, obtain domain name wap.taobao.com of request.
Step B2, whether verifying domain name is legal;If illegal, proceed to step B3, if legal, proceed to B4.
According to specifically strategy, the domain name obtaining is verified in practice it is ensured that agent's access is legal station Point, it is to avoid the case problem such as fishing.If such as this wap website is wap.taobao.com, and the domain name in asking is Wap.taobao1.com, and wap.taobao1.com is a fishing website, then be may determine that according to the true domain name of our station Wap.taobao1.com is illegal domain name, i.e. invalidation request.
B3, refuses this access request.
If the address of request is not a legal address, request accept module just direct refusal process that this accesses please Ask.
B4, extracts user side parameter information in request.
This step encapsulates user side parameter information, and described parameter information includes the first mark, the IP of user side, and user The type at end.As the first user-agent (type (user- of such as user side identifying sina, the ip of user side, user side Agent) be iphone user) etc. information.Above- mentioned information can be used by subsequent module.
In addition, also including URL process step, reduce the link length of URL, and the statistical parameter comprising in URL is added To in each URL of back page content.
Such as by http://wap.taobao.com?The url of ttid=1 replaces with wap.taobao.com?Ttid=1 subtracts Few link length, reduces customer flow.By the statistical parameter comprising in the URL of request such as ttid, it is added to the institute of back page Have in URL, for data statisticss.
In practice, second module of the application is usually proxy module, may reside in each three module corresponding In server.Can also be separately provided as a proxy server, provide various webpages by proxy server reverse proxy rear end The three module of content.
Request forwards step 120, for the request including the first mark, is forwarded according to the aiming field name in this request To corresponding three module, and obtain the content of pages of response from described three module.
In practice, this request and relevant parameter information can be assisted with HTTP by this step according to the request of agency View resubmits three module corresponding with domain name, accepts long-range response contents simultaneously.Whether first pass through in request Judge whether this request is sent by first server end including the first mark, if please by this further according to the mesh domain name in request Ask and be forwarded to corresponding three module.In practice, the content of pages that three module returns is cached in the second module again.
Preferably, as follows described page request is forwarded to three module, and obtains response from three module Content of pages:
Step D1, sets up a simulation HTTP request according to the identity letter of requesting party in request.Please with the URL of aforementioned acquisition Ask:
“http://proxy.m.taobao.com/gate/sina/p.do?p_url=wap.taobao.com% As a example 3Fttid%3D1 ", target three module can be resubmited by http protocol as follows in practice:
Step m1, request to create object.
It is the corresponding GetMethod object creating a httpClient according to domain name wap.taobao.com, be used for Package request.
Step m2, will access parameter ttid=1 in URL, submits to Method object, and simulate HTTP request, increase The information such as use-agent information, requesting party ip, access application system for simulating true HTTP.
Step D2, executes described simulation HTTP request, obtains the content of pages of response.
After obtaining simulating HTTP request by abovementioned steps, can be carried out with following steps:
Step m3, executes request.
Asked by HttpClient component call.Obtain the content of response.
Step m4, processes response contents.
Wherein, when obtaining the content of pages responding:
When http response is normal, the code of such as response is 200, then the content of pages that direct access responds simultaneously caches. Content in this caching is used for follow-up process.
When http response needs to reorientate for described page request, the code of such as response is 302, then allow user side weight New access agent address.If i.e. response code is 302, illustrates it is to need to redirect, need overwrite request address, that is, allow use The new agent address of the browser access at family end.
Said process can (can be used to provide efficient, up-to-date, feature richness support using httpClient The client programming tool kit of http protocol) assembly carries out forwarding the content of pages asking and obtaining response, it is possible to use its His method carries out forwarding the content of pages asking and obtaining response, and the application is not any limitation as to this.The mistake of simulation http request Journey it is also possible to use additive method, and the application is not any limitation as to this.
Contents processing step 130, loads the configuration information of described first mark of correspondence in the configuration file of configuration module, and According to described configuration information, described content of pages is processed.
In practice, for others first module of the web page contents needing three module to provide, if described first Module requires the content of pages that modification returns, then can be pre-configured with, in configuration module, the configuration information requiring to change Finish, wherein configuration information identifies as loading environment using the first module corresponding first, when agency needs to use further according to this First mark loads corresponding configuration information, then using configuration information, the content of pages of aforementioned acquisition is processed.Wherein Configuration information place configuration file can be in agency.
In practice, configuration module can individualism, also there may be with proxy server in, concrete condition the application is not right It is any limitation as.
This step is mainly responsible for content of pages is processed, and includes deletion, adds and updates the process such as content of pages Mode.Typically xhtml and/or html document is processed in practice.
Preferably, load described first mark of correspondence in the configuration file of configuration module as follows The configuration information known, and according to described configuration information, described content of pages is processed:
Step A1, loads the configuration information of described first mark of correspondence in the configuration file of configuration module.
Described first mark indicates this page request and is initiated by the user of corresponding first module, and described correspondence described first is marked The configuration information known includes the modification information to content of pages of the first module.
In such as aforementioned request URL first is designated sina, then first in the configuration file of system loads configuration module The mark corresponding configuration information of sina.Then using described configuration information to above cache in response page content at Reason.Described configuration file has potentially included the configuration information of multiple websites, and the application can be corresponding according to described different server Corresponding configuration information in the first different mark loading configuration file.
Wherein, configuration information can be using XML (Extensible Markup Language, extensible markup language) definition A series of rules that process describe, and can conveniently change, be easy to update the demand of first server end place website at any time.
Step A2, searches node information corresponding with node information each in described configuration information from described content of pages.
After step A1 is loaded with request corresponding third-party configuration information, can be according to needing in configuration information to change Node information, find in described content of pages with the corresponding node information of this node information in configuration information.
Preferably, from described content of pages, lookup is corresponding with each node information in described configuration information as follows Node information:
Step C1, the tag name according to node to be modified in configuration information and the corresponding character string of attribute information, by inciting somebody to action Described character string character string corresponding with content of pages is mated, and searches node information described in content of pages.
For the html element content of the page, this step is to parse html element content by way of character string, according to Attribute (such as class value, or the id value etc.) Rapid matching of tag name (tag) and this label searches node.
In practice, can be first according to the corresponding property value of the corresponding tag name of node information in configuration information and html element The character string of content is mated, then after finding matching result, the model of the whole node information of structural confirmation according to tag label Enclose.
The coupling element of the node of such as coupling is:
<nodeMatcher name="footer"type="TAG"></nodeMatcher>, it represents one name of coupling Html element tags for footer.
The lookup method of this step is quick, saves time.
Or, step C2, the tag name according to node information to be modified in configuration information and attribute information, described by traversal The dom tree of content of pages, searches node information described in content of pages.
In order to find content of pages node information corresponding with node information to be modified in configuration information, the application also may be used In the form of the traversal corresponding dom tree of full page content.Relatively for former lookup method, speed is relatively slow.
In addition, the application is for the method finding content of pages node corresponding with node to be modified in configuration information not It is any limitation as, any method that can find corresponding node information in described content of pages.
Step A3, modifies to described node information to the description of each node information according in configuration information.
When after finding node information to be modified in content of pages in step A2, according in configuration information to each node The description of information is modified to described node information.Modification action includes replacing (replace), insertion (insert), deletes (delete) etc..Such as corresponding replacement, its execution action is " action=replace ".
Wherein, as " action=replace " or " action=insert ", by node information described in content of pages Content modification be configuration information in configuration content.
In practice, for each node information in configuration information, can search one by one simultaneously by the order of each node information Modification, that is, after searching and changed a node information, then the lookup modification process carrying out next node information.
In addition, during step C1 and C2 line character String matching search node information in content of pages, may It is fitted on multiple node information of diverse location, now, the node information that can configure in configuration information in advance to which position is entered Row modification, such as only changes the node information of top margin and page footing, or all node information found all is modified.
In practice, search and change what these processing procedures can be completed by the Handler interface realizing defining, described Handler interface is the core classes for processing message content, and its class can be as follows:
Ihandler
+getName{}:String
+invoke{ProxyContext ProxyContext}:void
Achieve ReplaceHandler, DeleteHandler and InsertHander assembly in systems, more than correspondence Alteration ruler defined in Action.Can also be extended according to specific modification requirement in this Handler interface actual.
Further, also include for when executing each step in agency:
Step A4, the former Object linking address in content of pages is replaced with agent address.
In practice, the second module that the application adopts is agency, and such as wap acts on behalf of.Therefore execution can be acted on behalf of by wap Each step above-mentioned.
Follow-up request in order to ensure user side is all processed by wap agency, need effective url all in the page are Object linking address in former request, replaces with agent address.Ensure that user clicks in displayed page other with aiming field famous prime minister Also access agent during the link closed.Http is contained in the such as page:The link of //m.taobao.com/index.htm, then root Requirement according to configuration information is replaced with:/proxy/ifeng/p.do?p_url=m.taobao.com/index.htm.
With reference to Fig. 2, it is the comparison example figure before and after a content of pages is replaced.Wherein, carry out Matcher behaviour first Make, Matcher is the operation matching foot (page footing) node by the matching principle in aforementioned processing rule, that is, thick in Fig. 2 Region shown in frame 81;Carry out Action operation again, original page footing node content is replaced with the first module (needs three module The partner of the web page contents providing) the page footing content (Content) that requires, obtain i.e. region shown in thick frame 82 in Fig. 2.At this In example, the first module corresponds to phoenix net.
Page return to step 140, returns the content of pages after described process.
After content of pages being disposed by above-mentioned steps, by described process after content of pages be back to use Family end.When returning, directly the content of pages of described return can be back to user side by acting on behalf of;Also can first by agency send to First server, then it is back to user side by by first server.Concrete echo plex mode the application is not any limitation as to it.
It should be noted that for aforesaid each method embodiment, in order to be briefly described, therefore it is all expressed as a series of Combination of actions, but those skilled in the art should know, the present invention is not limited by described sequence of movement because According to the present invention, some steps can be carried out using other orders or simultaneously.Secondly, those skilled in the art also should know Know, embodiment described in this description belongs to preferred embodiment, involved action and the module not necessarily present invention Necessary.
With reference to Fig. 3, it illustrates a kind of structural representation of page processing method of the application, including:
Request accepts module 310, and for parsing the parameter information in page request, described parameter information includes target domain name Belong to the first mark of the first module with the described page request of sign;Described page request is initiated by the user side of the first module, The corresponding content of pages of described page request is provided by corresponding three module.
Request forwarding module 320, with for the request including the first mark, according to aiming field its turn of star in this request It is sent to corresponding three module, and obtain the content of pages of response from described three module.
Content processing module 330, for loading the configuration letter of described first mark of correspondence in the configuration file of configuration module Breath, and according to described configuration information, described content of pages is processed.
The page returns module 340, for returning the content of pages after described process.
In practice, above-mentioned module is commonly included in the second module, and described second module is generally proxy module, in institute State in proxy module or proxy server also packet scheduling center module, with reference to Fig. 4, control centre carries out system control, in scheduling The heart carries out 404/500 process and Cache (cache memory) management etc., and control centre's module is getting asking of user side After asking, according to configuration, Handler is combined into a calling logic flow process, calls aforesaid request to accept module, request forwards The page of agency is finally returned to user side by module and content processing module, completes a proxy requests processing procedure.Its In, the page returns module and is generally positioned in control centre.Proxy call center also provides the infrastructure service that request is processed simultaneously, As mistake etc. is processed;Transparent buffer service is to improve access efficiency.Wherein, forwarding module is forwarded to accordingly according to without application Three module end in.
With reference to Fig. 5, it illustrates preferably a kind of page processing system of the application one kind.
The application may include at least one first module, and described first module is generally first server, can correspond to respectively Different websites, the application may also include at least one three module, and described three module is application server, each application service Device provides different web page contents.The user side of first server can obtain at least one the 3rd mould described by proxy server The content of pages that in block, any one provides.The above-mentioned page request that each first server sends is all by the agency service of in figure Device receives, then according to its this request processing forward of aiming field star in first server transmission request to corresponding 3rd mould Block obtains described web-page requests and corresponds to web page contents, then loads the first mark in described page request in proxy server right Described web page contents are processed by the configuration information answered, and are finally returned, by proxy server, the web page contents being disposed again Return until user side receives described web-page requests.
For system embodiment, due to itself and embodiment of the method basic simlarity, so description is fairly simple, related Part illustrates referring to the part of embodiment of the method.
Each embodiment in this specification is all described by the way of going forward one by one, what each embodiment stressed be with The difference of other embodiment, between each embodiment identical similar partly mutually referring to.
The application can be described in the general context of computer executable instructions, such as program Module.Usually, program module includes execution particular task or the routine realizing particular abstract data type, program, object, group Part, data structure etc..The application can also be put into practice in a distributed computing environment, in these distributed computing environment, by The remote processing devices connected by communication network are executing task.In a distributed computing environment, program module is permissible It is located in the local and remote computer-readable storage medium including storage device.
Last in addition it is also necessary to explanation, herein, such as first and second or the like relational terms be used merely to by One entity or operation are made a distinction with another entity or operation, and not necessarily require or imply these entities or operation Between there is any this actual relation or order.
Those of ordinary skill in the art should further appreciate that, in conjunction with the embodiments described herein description The unit of each example and algorithm steps, can be with electronic hardware, computer software or the two be implemented in combination in, in order to clear The interchangeability of Chu's ground explanation hardware and software, generally describes the group of each example in the above description according to function Become and step.These functions to be executed with hardware or software mode actually, the application-specific depending on technical scheme and design Constraints.Professional and technical personnel can use different methods to each specific application realize described function, but It is this realization it is not considered that exceeding scope of the present application.
The step of the method in conjunction with the embodiments described herein description or algorithm can be with hardware, computing device Software module, or the combination of the two is implementing.Software module can be placed in random access memory (RAM), internal memory, read only memory (ROM), electrically programmable ROM, electrically erasable ROM, depositor, hard disk, moveable magnetic disc, CD-ROM or technical field In interior known any other form of storage medium.
Above to a kind of page processing method provided herein and device, it is described in detail, used herein Specific case is set forth to the principle of the application and embodiment, and the explanation of above example is only intended to help understand The present processes and its core concept;Simultaneously for one of ordinary skill in the art, according to the thought of the application, in tool All will change on body embodiment and range of application, in sum, this specification content should not be construed as to the application Restriction.

Claims (11)

1. a kind of page processing method is it is characterised in that include:
Parameter information in parsing page request, described parameter information includes target domain name and indicates described page request and belong to the First mark of one module;Described page request is initiated by the user side of the first module, in the corresponding page of described page request Hold and provided by corresponding three module;Described page request is the interface transmission that user side passes through that the first module provides;
For the request including the first mark, corresponding three module is forwarded it to according to the aiming field name in this request, and Obtain the content of pages of response from described three module;
Load the configuration information of described first mark of correspondence in the configuration file of configuration module, and according to described configuration information to institute State content of pages to be processed;
Return the content of pages after described process.
2. method according to claim 1 it is characterised in that as follows load configuration module configuration file in The configuration information of described first mark of correspondence, and according to described configuration information, described content of pages is processed:
Step A1, loads the configuration information of described first mark of correspondence in the configuration file of configuration module;
Step A2, searches node information corresponding with node information each in described configuration information from described content of pages;
Step A3, repaiies to the node information in described content of pages to the description of each node information according in configuration information Change.
3. method according to claim 2 is it is characterised in that search and institute as follows from described content of pages State the corresponding node information of each node information in configuration information:
Tag name according to node to be modified in configuration information and the corresponding character string of attribute information, by by described character string with The corresponding character string of content of pages is mated, and searches node information described in content of pages;
Or, according to the tag name of node information to be modified in configuration information and attribute information, by traveling through described content of pages Dom tree, searches node information described in content of pages.
4. method according to claim 1 it is characterised in that:
Described each step executes in proxy module.
5. method according to claim 4 is it is characterised in that carry out processing also including to described content of pages:
Step A4, the former Object linking address in content of pages is replaced with agent address.
6. method according to claim 1 is it is characterised in that parse page request parameter information by following steps:
Step B1, analysis request URL, obtain the domain name in request;
Step B2, whether verifying domain name is legal;If illegal, proceed to step B3, if legal, proceed to B4;
Step B3, refuses this access request;
Step B4, extracts user side parameter information in request.
7. method according to claim 6 it is characterised in that:
Described user side parameter information includes the first mark, the IP of user side, and the type of user side.
8. the method according to claim 6 or 7 is it is characterised in that also include:
URL process step, reduces the link length of URL, and the statistical parameter comprising in URL is added to back page content In each URL.
9. the method according to claim 5 or 6 it is characterised in that described for include first mark request, according to this Aiming field name in request forwards it to corresponding three module, and obtains, from described three module, the content of pages responding Step includes:
Step D1, sets up a simulation HTTP request according to the identity information of requesting party in request;
Step D2, executes described simulation HTTP request, obtains the content of pages of response.
10. method according to claim 9, it is characterised in that executing described simulation HTTP request, obtains the page of response During content:
When http response code is normal, then direct access response content of pages and cache;
When http response code is that described page request needs to reorientate, then user side is allowed to access new agent address.
A kind of 11. Page handling device are it is characterised in that include:
Request accepts module, and for parsing the parameter information in page request, described parameter information includes target domain name and sign Described page request belongs to the first mark of the first module;Described page request is initiated by the user side of the first module, described page Request in person and ask corresponding content of pages to be provided by corresponding three module;Described page request is that user side passes through the first module offer Interface send;
Request forwarding module, for for the request including the first mark, forwarding it to according to the aiming field name in this request Corresponding three module, and the content of pages of response is obtained from described three module;
Content processing module, for loading the configuration information of described first mark of correspondence in the configuration file of configuration module, and root According to described configuration information, described content of pages is processed;
The page returns module, for returning the content of pages after described process.
CN201210134966.5A 2012-05-02 2012-05-02 A kind of page processing method and device Active CN103383687B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210134966.5A CN103383687B (en) 2012-05-02 2012-05-02 A kind of page processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210134966.5A CN103383687B (en) 2012-05-02 2012-05-02 A kind of page processing method and device

Publications (2)

Publication Number Publication Date
CN103383687A CN103383687A (en) 2013-11-06
CN103383687B true CN103383687B (en) 2017-03-01

Family

ID=49491477

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210134966.5A Active CN103383687B (en) 2012-05-02 2012-05-02 A kind of page processing method and device

Country Status (1)

Country Link
CN (1) CN103383687B (en)

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015085456A1 (en) * 2013-12-09 2015-06-18 北京新媒传信科技有限公司 Log extraction method under server cluster and server cluster
CN104331217B (en) * 2014-10-24 2018-12-14 中国建设银行股份有限公司 A kind of method for showing interface and device
CN104468785A (en) * 2014-12-08 2015-03-25 上海斐讯数据通信技术有限公司 Electronic device, server device, and data request submitting method and processing method
CN104598227A (en) * 2014-12-31 2015-05-06 国家电网公司 Method for modifying content of system presentation page
CN106156172A (en) * 2015-04-16 2016-11-23 阿里巴巴集团控股有限公司 Embed the expired treating method and apparatus of session of the page
CN104954363B (en) * 2015-04-30 2018-05-22 北京嘀嘀无限科技发展有限公司 For generating the method and apparatus of interface document
CN105100242B (en) * 2015-07-24 2019-02-26 北京奇虎科技有限公司 A kind of data processing method and system
CN105354269B (en) * 2015-10-27 2019-07-12 中通服公众信息产业股份有限公司 Web applicational language Localization methodologies and system based on reverse proxy and information filtering
CN106856434B (en) 2015-12-08 2020-06-30 阿里巴巴集团控股有限公司 Method and device for converting access request
CN109960939B (en) * 2017-12-25 2021-02-05 航天信息股份有限公司 Remote HTML5 page loading method and system
CN107948329A (en) * 2018-01-03 2018-04-20 湖南麓山云数据科技服务有限公司 A kind of cross-domain processing method and system
CN108363749B (en) * 2018-01-29 2019-03-01 上海星佑网络科技有限公司 Method and apparatus for information processing
CN108600157A (en) * 2018-03-08 2018-09-28 阿里巴巴集团控股有限公司 page loading method and device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6018748A (en) * 1996-05-28 2000-01-25 Sun Microsystems, Inc. Dynamic linkable labels in a network browser page
CN1173282C (en) * 1999-09-20 2004-10-27 国际商业机器公司 Method and system for dynamically increasiing new functions for www. page
CN101902485B (en) * 2009-05-27 2014-05-14 北京启明星辰信息技术股份有限公司 Rewriting method of reversal Web agent link
CN101997854B (en) * 2009-08-31 2013-09-18 阿里巴巴集团控股有限公司 Processing system and method for providing data service

Also Published As

Publication number Publication date
CN103383687A (en) 2013-11-06

Similar Documents

Publication Publication Date Title
CN103383687B (en) A kind of page processing method and device
AU2015401229B2 (en) Website access method, apparatus, and website system
US10498847B2 (en) System and method for mobile application deep linking
CN106575298B (en) Rapid presentation of web sites containing dynamic content and stale content
US20190190977A1 (en) System and method of automatic generation and insertion of analytic tracking codes
CN103546498B (en) It is a kind of that the method and apparatus accessing webpage is provided for mobile terminal
CN104541262B (en) System and method for being adapted in the transparent network of Rich Internet application
CN106294379A (en) The loading method of a kind of page, device and system
CN107391664A (en) Page data processing method and system based on WEB
CN101178717A (en) Method for adaptation processing web page and web page adaptation device
CN101997927A (en) Method and system for caching data of WEB platform
CN105550338A (en) HTML5 application cache based mobile Web cache optimization method
CN107590145A (en) A kind for the treatment of method and apparatus of page static resource
CN106897336A (en) Web page files sending method, webpage rendering intent and device, webpage rendering system
CN103269377B (en) Process the method for script file, server, client and system
CN103744845A (en) Method and system for WEB platform data caching
CN105279156B (en) Network information communication means and network information browsing apparatus
CN103716319B (en) A kind of apparatus and method of web access optimization
CN103401926A (en) Method and device for improving network resource access speed
CN106446617A (en) Static webpage access method with active file protection function
CN104980464B (en) A kind of network request processing method, network server and network system
CN102681996B (en) Pre-head method and device
US9942345B2 (en) Web server caching for performance improvement
CN106919600A (en) One kind failure network address access method and terminal
CN102664959B (en) The wireless middleware of a kind of mobile platform

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 1187122

Country of ref document: HK

GR01 Patent grant
GR01 Patent grant
REG Reference to a national code

Ref country code: HK

Ref legal event code: GR

Ref document number: 1187122

Country of ref document: HK