TW201635170A - Dynamic webpage conversion method and device - Google Patents

Dynamic webpage conversion method and device Download PDF

Info

Publication number
TW201635170A
TW201635170A TW104129196A TW104129196A TW201635170A TW 201635170 A TW201635170 A TW 201635170A TW 104129196 A TW104129196 A TW 104129196A TW 104129196 A TW104129196 A TW 104129196A TW 201635170 A TW201635170 A TW 201635170A
Authority
TW
Taiwan
Prior art keywords
request
language
webpage
page
url
Prior art date
Application number
TW104129196A
Other languages
Chinese (zh)
Other versions
TWI718993B (en
Inventor
Hua Huang
Mei-De Zhang
Original Assignee
Alibaba Group Services 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 Services Ltd filed Critical Alibaba Group Services Ltd
Publication of TW201635170A publication Critical patent/TW201635170A/en
Application granted granted Critical
Publication of TWI718993B publication Critical patent/TWI718993B/en

Links

Abstract

This invention provides a dynamic webpage conversion method and device. The dynamic webpage conversion method includes the following steps: proxy server receiving a webpage request from the user end and confirming the type of webpage request and the geographical location of the application server requested by the webpage request; if the type of webpage request is a first language request and the official language corresponding to the geographical location is a second language, obtaining second language webpage content from the application server according to the URL of the webpage request; and converting the obtained second language webpage content to first language webpage content according to a first language and second language conversion table, and outputting the first language webpage content to the user end. This invention realizes one-time conversion of the webpage content, which minimizes impact on the performance, saves human resource cost and machine cost, and meanwhile supports synchronization and non- synchronization requests with high versatility.

Description

動態頁面轉換的方法和裝置 Method and device for dynamic page conversion

本發明關於互聯網技術領域,尤其關於一種動態頁面轉換的方法和裝置。 The present invention relates to the field of Internet technologies, and in particular, to a method and apparatus for dynamic page conversion.

在中國香港、臺灣以及東南亞等國家和地區,雖然使用中文,但是在電腦輸入以及輸出的時候絕大部分使用的都是繁體中文。這對於市場主要是基於中國大陸的中文網站在進行搜尋引擎推廣以及參與排序的時候,都處於劣勢的地位。因為搜尋引擎排序首先考慮的是頁面之中關鍵字的相關性,簡體中文頁面與繁體中文頁面在實質內容上雖然差不多,但是在字串層面的差距卻非常大,因此在搜尋引擎計算排序得分的時候,二者之間的差距是非常明顯的。 In Hong Kong, Taiwan, Southeast Asia and other countries and regions, although Chinese is used, most of the computers used for input and output are traditional Chinese. This is at a disadvantage when the market is mainly based on Chinese websites in mainland China when conducting search engine promotion and participation in sorting. Because the search engine sorting first considers the relevance of the keywords in the page, the Simplified Chinese page and the Traditional Chinese page are similar in substance, but the gap at the string level is very large, so the search engine calculates the sorting score. At the time, the gap between the two is very obvious.

針對這個問題,本土的中文網站希望在海外的中文市場參與排序與競爭就必須將應用實現繁體化,才能與繁體網站站在同一起跑線上。 In response to this problem, local Chinese websites hope to participate in the sorting and competition in the overseas Chinese market, and they must implement the traditionalization of the application in order to stand on the same starting line as the traditional website.

但是,現有的實現頁面繁體化的技術方案存在對性能的 影響較大,人力資源成本和機器成本較高,通用性較差的問題。 However, existing technical solutions for implementing page traditionalization exist for performance. The impact is large, the human resource cost and the machine cost are high, and the versatility is poor.

本發明的目的旨在至少在一定程度上解決相關技術中的技術問題之一。 The object of the present invention is to solve at least one of the technical problems in the related art to some extent.

為此,本發明的第一個目的在於提出一種動態頁面轉換的方法。該方法可以實現一次性集中對頁面內容進行轉換,減小對性能的影響,大大節約了人力資源成本和機器成本,並且同時支援同步請求和非同步請求,具有非常高的通用性。 To this end, a first object of the present invention is to propose a method of dynamic page conversion. The method can realize the one-time centralized conversion of the page content, reduce the impact on performance, greatly save the human resource cost and the machine cost, and simultaneously support the synchronous request and the asynchronous request, and has very high versatility.

本發明的第二個目的在於提出一種動態頁面轉換的裝置。 A second object of the present invention is to provide an apparatus for dynamic page conversion.

為了實現上述目的,本發明第一態樣實施例的動態頁面轉換的方法,包括:代理伺服器接收用戶端發送的網頁請求,確定所述網頁請求的類型和所述網頁請求所請求訪問的應用伺服器所處的地理位置;如果所述網頁請求的類型為第一語言的頁面請求,但所述地理位置對應的官方語言為第二語言,則根據所述網頁請求的統一資源定位符URL從所述應用伺服器獲取所述第二語言的頁面內容;根據所述第一語言與所述第二語言的對照表將獲取的第二語言的頁面內容轉換為所述第一語言的頁面內容,並向所述用戶端輸出所述第 一語言的頁面內容。 In order to achieve the above object, a method for dynamic page conversion according to a first aspect of the present invention includes: receiving, by a proxy server, a webpage request sent by a client, determining a type of the webpage request, and an application requested by the webpage requesting access. a geographic location where the server is located; if the type of the webpage request is a page request in the first language, but the official language corresponding to the geographic location is a second language, the uniform resource locator URL requested according to the webpage is The application server acquires the page content of the second language, and converts the acquired page content of the second language into the page content of the first language according to the comparison table of the first language and the second language, And outputting the number to the client The content of a page in a language.

本發明實施例的動態頁面轉換的方法,代理伺服器接收到用戶端發送的網頁請求之後,如果網頁請求的類型為第一語言的頁面請求,但上述網頁請求所請求訪問的應用伺服器所處的地理位置對應的官方語言為第二語言,則根據上述網頁請求的URL從所述應用伺服器獲取第二語言的頁面內容,再根據第一語言與第二語言的對照表將獲取的第二語言的頁面內容轉換為第一語言的頁面內容,並向上述用戶端輸出第一語言的頁面內容,從而可以實現一次性集中對頁面內容進行轉換,減小對性能的影響,大大節約了人力資源成本和機器成本,並且同時支援同步請求和非同步請求,具有非常高的通用性。 In the dynamic page conversion method of the embodiment of the present invention, after the proxy server receives the webpage request sent by the client, if the type of the webpage request is a page request in the first language, but the application server requested by the webpage request is located The official language corresponding to the geographical location is the second language, and the page content of the second language is obtained from the application server according to the URL requested by the webpage, and the second language is obtained according to the comparison table of the first language and the second language. The page content of the language is converted into the page content of the first language, and the page content of the first language is output to the user terminal, so that the content of the page can be converted in one time, thereby reducing the impact on performance and greatly saving human resources. Cost and machine cost, and support both synchronous and asynchronous requests, with very high versatility.

為了實現上述目的,本發明第二態樣實施例的動態頁面轉換的裝置,所述裝置在與用戶端和應用伺服器通信的代理伺服器執行,包括:接收模組,用於接收所述用戶端發送的網頁請求;確定模組,用於確定所述接收模組接收的網頁請求的類型和所述網頁請求所請求訪問的所述應用伺服器所處的地理位置;獲取模組,用於當所述確定模組確定所述網頁請求的類型為第一語言的頁面請求,但所述地理位置對應的官方語言為第二語言時,根據所述網頁請求的統一資源定位符URL從所述應用伺服器獲取所述第二語言的頁面內容;轉換模組,用於根據所述第一語言與所述第二語言的對照表 將所述獲取模組獲取的第二語言的頁面內容轉換為所述第一語言的頁面內容;輸出模組,用於向所述用戶端輸出所述轉換模組轉換的所述第一語言的頁面內容。 In order to achieve the above object, an apparatus for dynamic page conversion according to a second aspect of the present invention, the apparatus is executed by a proxy server in communication with a client and an application server, comprising: a receiving module, configured to receive the user a webpage request sent by the terminal; a determining module, configured to determine a type of the webpage request received by the receiving module, and a geographical location of the application server requested by the webpage requesting; the acquiring module is configured to: When the determining module determines that the type of the webpage request is a page request in a first language, but the official language corresponding to the geographic location is a second language, the uniform resource locator URL requested according to the webpage is from the The application server obtains the page content of the second language; the conversion module is configured to compare the table according to the first language and the second language Converting the page content of the second language acquired by the obtaining module into the page content of the first language; and outputting a module, configured to output, to the user end, the first language converted by the conversion module Page content.

本發明實施例的動態頁面轉換的裝置,在與用戶端和應用伺服器通信的代理伺服器執行,在接收模組接收到用戶端發送的網頁請求之後,如果確定模組確定網頁請求的類型為第一語言的頁面請求,但上述網頁請求所請求訪問的應用伺服器所處的地理位置對應的官方語言為第二語言,則獲取模組根據上述網頁請求的URL從應用伺服器獲取第二語言的頁面內容,轉換模組再根據第一語言與第二語言的對照表將獲取的第二語言的頁面內容轉換為第一語言的頁面內容,輸出模組向上述用戶端輸出第一語言的頁面內容,從而可以實現一次性集中對頁面內容進行轉換,減小對性能的影響,大大節約了人力資源成本和機器成本,並且同時支援同步請求和非同步請求,具有非常高的通用性。 The device for dynamic page conversion in the embodiment of the present invention is executed by a proxy server that communicates with the client and the application server. After the receiving module receives the webpage request sent by the client, if the determining module determines that the type of the webpage request is a page request in a first language, but the official language corresponding to the geographical location of the application server requested by the webpage requesting is a second language, and the obtaining module acquires the second language from the application server according to the URL of the webpage requesting The content of the page, the conversion module converts the obtained page content of the second language into the page content of the first language according to the comparison table of the first language and the second language, and the output module outputs the page of the first language to the user terminal. The content can realize the one-time centralized conversion of the page content, reduce the impact on performance, greatly save the human resource cost and the machine cost, and simultaneously support the synchronous request and the asynchronous request, and has very high versatility.

本發明附加的方面和優點將在下面的描述中部分給出,部分將從下面的描述中變得明顯,或通過本發明的實踐瞭解到。 The additional aspects and advantages of the invention will be set forth in part in the description which follows.

31‧‧‧接收模組 31‧‧‧ receiving module

32‧‧‧確定模組 32‧‧‧Determining modules

33‧‧‧獲取模組 33‧‧‧Getting module

34‧‧‧轉換模組 34‧‧‧Transition module

35‧‧‧輸出模組 35‧‧‧Output module

331‧‧‧請求確定子模組 331‧‧‧Request to determine the sub-module

332‧‧‧生成子模組 332‧‧‧Generation submodule

333‧‧‧內容獲取子模組 333‧‧‧Content Acquisition Submodule

334‧‧‧解析子模組 334‧‧‧analysis submodule

本發明上述的和/或附加的方面和優點從下面結合附圖對實施例的描述中將變得明顯和容易理解,其中: 圖1為本發明動態頁面轉換的方法一個實施例的流程圖;圖2為本發明動態頁面轉換的方法另一個實施例的流程圖;圖3為本發明動態頁面轉換的方法再一個實施例的流程圖;圖4為本發明動態頁面轉換的裝置一個實施例的結構示意圖;圖5為本發明動態頁面轉換的裝置另一個實施例的結構示意圖。 The above and/or additional aspects and advantages of the present invention will become apparent and readily understood from FIG. 1 is a flowchart of another embodiment of a method for dynamic page conversion according to the present invention; FIG. 2 is a flowchart of another embodiment of a method for dynamic page conversion according to the present invention; FIG. 4 is a schematic structural diagram of an embodiment of a device for dynamic page conversion according to the present invention; FIG. 5 is a schematic structural diagram of another embodiment of a device for dynamic page conversion according to the present invention.

下面詳細描述本發明的實施例,所述實施例的示例在附圖中示出,其中自始至終相同或類似的標號表示相同或類似的元件或具有相同或類似功能的元件。下面通過參考附圖描述的實施例是示例性的,僅用於解釋本發明,而不能理解為對本發明的限制。相反,本發明的實施例包括落入所附加申請專利範圍的精神和內涵範圍內的所有變化、修改和等同物。 The embodiments of the present invention are described in detail below, and the examples of the embodiments are illustrated in the drawings, wherein the same or similar reference numerals are used to refer to the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are intended to be illustrative of the invention and are not to be construed as limiting. On the contrary, the invention is intended to cover all modifications, modifications and equivalents

圖1為本發明動態頁面轉換的方法一個實施例的流程圖,如圖1所示,該動態頁面轉換的方法可以包括:步驟101,代理伺服器接收用戶端發送的網頁請求,確 定上述網頁請求的類型和上述網頁請求所請求訪問的應用伺服器所處的地理位置。 FIG. 1 is a flowchart of an embodiment of a method for dynamic page conversion according to the present invention. As shown in FIG. 1 , the method for dynamic page conversion may include: Step 101: A proxy server receives a webpage request sent by a client, and The type of the webpage request and the geographic location of the application server requested by the webpage request.

具體地,確定上述網頁請求的類型可以為:根據上述網頁請求的URL中的目錄和/或根據上述網頁請求的URL的查詢字串中攜帶的參數確定上述網頁請求的類型。舉例來說,如果接收到的網頁請求的URL中的目錄為預先設置的繁體頁面目錄中的一個目錄,則可以確定上述網頁請求的類型為繁體中文的頁面請求。例如,當網頁請求的URL為“http://www.1688.com/tw/***”時,該URL中的目錄“/tw/”為預先設置的繁體頁面目錄中的一個目錄,這時,可以確定接收到的網頁請求“http://www.1688.com/tw/***”為繁體中文的頁面請求。 Specifically, determining the type of the webpage request may be: determining a type of the webpage request according to a directory in the URL requested by the webpage and/or a parameter carried in a query string according to the URL requested by the webpage. For example, if the directory in the URL of the received webpage request is a directory in the preset traditional page directory, it may be determined that the type of the webpage request is a traditional Chinese page request. For example, when the URL requested by the web page is "http://www.1688.com/tw/***", the directory "/tw/" in the URL is a directory in the preset traditional page directory. , you can confirm that the received web page request "http://www.1688.com/tw/***" is a traditional Chinese page request.

進一步地,確定上述網頁請求的類型之後,還可以將上述網頁請求的類型標注在上述網頁請求的上下文中。 Further, after determining the type of the webpage request, the type of the webpage request may also be marked in the context of the webpage request.

具體地,確定上述網頁請求所請求訪問的應用伺服器所處的地理位置可以為:根據上述網頁請求的統一資源定位符(Uniform Resource Locator;以下簡稱:URL)中的功能變數名稱確定上述網頁請求所請求訪問的應用伺服器所處的地理位置;例如:如果上述網頁請求的URL的功能變數名稱中包含“.cn”的尾碼,則可以確定上述網頁請求所請求訪問的應用伺服器所處的地理位置為中國,並且該地理位置對應的官方語言為簡體中文。本實施例對確定上述網頁請求所請 求訪問的應用伺服器所處的地理位置所採用的方法不作限定,只要可以確定上述網頁請求所請求訪問的應用伺服器所處的地理位置即可。 Specifically, determining the geographic location where the application server requested to access the webpage request is located: determining the webpage request according to the function variable name in the Uniform Resource Locator (URL) of the webpage request The geographical location of the application server requested to access; for example, if the function variable name of the URL requested by the webpage includes the end code of ".cn", it may be determined that the application server requested by the webpage request is located The geographic location is China, and the official language for this location is Simplified Chinese. In this embodiment, the request for determining the above webpage request is requested. The method used to obtain the geographical location of the accessed application server is not limited, as long as the geographic location of the application server requested by the webpage requesting request can be determined.

步驟102,如果上述網頁請求的類型為第一語言的頁面請求,但上述地理位置對應的官方語言為第二語言,則代理伺服器根據上述網頁請求的URL從應用伺服器獲取第二語言的頁面內容。 Step 102: If the type of the webpage request is a page request in the first language, but the official language corresponding to the geographic location is the second language, the proxy server obtains the page in the second language from the application server according to the URL requested by the webpage. content.

本實施例的一種實現方式中,根據上述網頁請求的URL從應用伺服器獲取第二語言的頁面內容可以為:根據上述網頁請求的URL的尾碼確定上述網頁請求為同步請求時,根據上述網頁請求的URL生成第二語言的頁面對應的URL,根據上述第二語言的頁面對應的URL從應用伺服器獲取上述第二語言的頁面內容。 In an implementation manner of the embodiment, the obtaining the page content of the second language from the application server according to the URL requested by the webpage may be: determining, according to the last code of the URL requested by the webpage, that the webpage request is a synchronization request, according to the webpage The requested URL generates a URL corresponding to the page of the second language, and the page content of the second language is obtained from the application server according to the URL corresponding to the page of the second language.

本實施例的另一種實現方式中,根據上述網頁請求的URL從應用伺服器獲取第二語言的頁面內容可以為:根據上述網頁請求的URL的尾碼確定上述網頁請求為非同步請求時,解析上述網頁請求的URL,獲得上述網頁請求的URL中的查詢字串;根據上述查詢字串生成第二語言的頁面對應的URL,根據上述第二語言的頁面對應的URL從應用伺服器獲取第二語言的頁面內容。 In another implementation manner of this embodiment, the obtaining the page content of the second language from the application server according to the URL of the webpage request may be: parsing the webpage request as an asynchronous request according to the tail code of the URL requested by the webpage, and parsing The URL of the webpage requesting, obtaining the query string in the URL of the webpage request; generating the URL corresponding to the page of the second language according to the query string, and acquiring the second URL from the application server according to the URL corresponding to the page of the second language; The page content of the language.

步驟103,代理伺服器根據第一語言與第二語言的對照表將獲取的第二語言的頁面內容轉換為第一語言的頁面內 容,並向上述用戶端輸出第一語言的頁面內容。 Step 103: The proxy server converts the acquired page content of the second language into the page of the first language according to the comparison table of the first language and the second language. And output the page content of the first language to the above client.

本實施例中,第一語言與第二語言為不同的語言,例如:第一語言為繁體中文,第二語言為簡體中文;或者,第一語言為英語,第二語言為簡體中文等等,在此不做限定。 In this embodiment, the first language and the second language are different languages, for example, the first language is Traditional Chinese, the second language is Simplified Chinese; or the first language is English, the second language is Simplified Chinese, and the like. There is no limit here.

上述動態頁面轉換的方法,代理伺服器接收到用戶端發送的網頁請求之後,如果網頁請求的類型為第一語言的頁面請求,但上述網頁請求所請求訪問的應用伺服器所處的地理位置對應的官方語言為第二語言,則根據上述網頁請求的URL從應用伺服器獲取第二語言的頁面內容,再根據第一語言與第二語言的對照表將獲取的第二語言的頁面內容轉換為第一語言的頁面內容,並向上述用戶端輸出第一語言的頁面內容,從而可以實現一次性集中對頁面內容進行轉換,減小對性能的影響,大大節約了人力資源成本和機器成本,並且同時支援同步請求和非同步請求,具有非常高的通用性。 In the above method for dynamic page conversion, after the proxy server receives the webpage request sent by the client, if the type of the webpage request is a page request in the first language, but the geographic location corresponding to the application server requested by the webpage request is corresponding to The official language of the second language is to obtain the page content of the second language from the application server according to the URL requested by the webpage, and then convert the obtained page content of the second language according to the comparison table of the first language and the second language into The content of the page in the first language, and outputting the page content of the first language to the above-mentioned user end, thereby realizing one-time centralized conversion of the page content, reducing the impact on performance, greatly saving human resource costs and machine costs, and Support for both synchronous and asynchronous requests is highly versatile.

下面以第一語言為繁體中文,第二語言為簡體中文為例對本發明提供的動態頁面轉換的方法進行說明。 The following describes the method of dynamic page conversion provided by the present invention by taking the first language as Traditional Chinese and the second language as Simplified Chinese as an example.

圖2為本發明動態頁面轉換的方法另一個實施例的流程圖,如圖2所示,該動態頁面轉換的方法可以包括:步驟201,代理伺服器接收用戶端發送的網頁請求,確定上述網頁請求的類型和上述網頁請求所請求訪問的應用伺服器所處的地理位置。 2 is a flowchart of another embodiment of a method for dynamic page conversion according to the present invention. As shown in FIG. 2, the method for dynamic page conversion may include: Step 201: A proxy server receives a webpage request sent by a client, and determines the webpage. The type of request and the geographic location of the application server requested by the above web page request.

具體地,確定上述網頁請求的類型可以為:根據上述網 頁請求的URL中的目錄和/或根據上述網頁請求的URL的查詢字串(QueryString)中攜帶的參數確定上述網頁請求的類型。 Specifically, determining the type of the webpage request may be: according to the foregoing network The type of the web page request is determined by the directory in the URL of the page request and/or the parameter carried in the query string (QueryString) of the URL requested by the web page.

在具體實現時,可以設置一個專門的繁體頁面目錄,如果接收到的網頁請求的URL中的目錄為繁體頁面目錄中的一個目錄,則可以確定上述網頁請求的類型為繁體中文的頁面請求。舉例來說,當網頁請求的URL為“http://www.1688.com/tw/***”時,該URL中的目錄“/tw/”為設置的繁體頁面目錄中的一個目錄,這時,可以確定接收到的網頁請求“http://www.1688.com/tw/***”的類型為繁體中文的頁面請求。 In a specific implementation, a special traditional page directory may be set. If the directory in the URL of the received webpage request is a directory in the traditional page directory, the page request may be determined to be a traditional Chinese page request. For example, when the URL requested by the web page is “http://www.1688.com/tw/***”, the directory “/tw/” in the URL is a directory in the set traditional page directory. At this time, it can be determined that the received web page request "http://www.1688.com/tw/***" is a page request of the type of Traditional Chinese.

具體地,確定上述網頁請求所請求訪問的應用伺服器所處的地理位置可以為:根據上述網頁請求的URL的功能變數名稱確定上述網頁請求所請求訪問的應用伺服器所處的地理位置;例如:如果上述網頁請求的URL的功能變數名稱中包含“.cn”的尾碼,則可以確定上述網頁請求所請求訪問的應用伺服器所處的地理位置為中國,並且該地理位置對應的官方語言為簡體中文。本實施例對確定上述網頁請求所請求訪問的應用伺服器所處的地理位置所採用的方法不作限定,只要可以確定上述網頁請求所請求訪問的應用伺服器所處的地理位置即可。 Specifically, determining the geographic location where the application server requested to access the webpage request is located: determining, according to the function variable name of the URL requested by the webpage, a geographic location where the application server requested by the webpage request is located; for example If the function variable name of the URL requested by the webpage includes the ending code of “.cn”, it may be determined that the geographical location of the application server requested by the webpage requesting access is China, and the official language corresponding to the geographic location Simplified Chinese. The method for determining the geographical location of the application server requested to access the webpage request is not limited in this embodiment, as long as the geographic location of the application server requested by the webpage requesting is determined.

步驟202,如果上述網頁請求的類型為繁體中文的頁面 請求,但上述地理位置對應的官方語言為簡體中文,則代理伺服器根據上述網頁請求的URL從上述應用伺服器獲取簡體中文的頁面內容。 Step 202: If the type of the webpage request is a traditional Chinese page The request, but the official language corresponding to the geographical location is Simplified Chinese, the proxy server obtains the content of the simplified Chinese page from the application server according to the URL requested by the webpage.

具體地,本實施例的一種實現方式中,根據上述網頁請求的URL從上述應用伺服器獲取簡體中文的頁面內容可以為:根據上述網頁請求的URL的尾碼確定上述網頁請求為同步請求時,根據上述網頁請求的URL生成簡體中文頁面對應的URL,根據上述簡體中文頁面對應的URL從上述應用伺服器獲取簡體中文的頁面內容。其中,根據上述網頁請求的URL生成簡體中文頁面對應的URL可以為:根據上述網頁請求的URL,利用預先配置的規則生成簡體中文頁面對應的URL。 Specifically, in an implementation manner of the embodiment, the obtaining the Simplified Chinese page content from the application server according to the URL of the webpage request may be: determining, according to the tail code of the URL requested by the webpage, that the webpage request is a synchronization request, The URL corresponding to the simplified Chinese page is generated according to the URL requested by the webpage, and the page content of the simplified Chinese is obtained from the application server according to the URL corresponding to the simplified Chinese page. The generating the URL corresponding to the Simplified Chinese page according to the URL requested by the webpage may be: generating a URL corresponding to the simplified Chinese page by using a pre-configured rule according to the URL requested by the webpage.

舉例來說,假設上述網頁請求的URL為“http://www.1688.com/detail/123456789.html”,則根據該URL的尾碼可以確定上述網頁請求為同步請求,然後根據該URL,利用預先配置的規則可以生成簡體中文頁面對應的URL“http://detail.1688.com/offer/123456789.html”;然後就可以根據該簡體中文頁面對應的URL“http://detail.1688.com/offer/123456789.html”從上述應用伺服器獲取簡體中文的頁面內容。 For example, if the URL of the webpage request is “http://www.1688.com/detail/123456789.html”, the webpage request may be determined as a synchronization request according to the last code of the URL, and then according to the URL, The pre-configured rules can be used to generate the URL corresponding to the Simplified Chinese page "http://detail.1688.com/offer/123456789.html"; then the URL corresponding to the Simplified Chinese page can be generated "http://detail.1688 .com/offer/123456789.html"Get the page content of Simplified Chinese from the above application server.

本實施例的另一種實現方式中,根據上述網頁請求的URL從上述應用伺服器獲取簡體中文的頁面內容可以為:根 據上述網頁請求的URL的尾碼確定上述網頁請求為非同步請求時,解析上述網頁請求的URL,獲得上述網頁請求的URL中的查詢字串;然後,根據上述查詢字串生成簡體中文頁面對應的URL,根據上述簡體中文頁面對應的URL獲取簡體中文的頁面內容。其中,根據上述查詢字串生成簡體中文頁面對應的URL可以為:根據上述查詢字串,利用預先配置的規則生成簡體中文頁面對應的URL。 In another implementation manner of this embodiment, the page content of the simplified Chinese may be obtained from the application server according to the URL of the webpage request. And determining, according to the last code of the URL requested by the webpage, that the webpage request is an asynchronous request, parsing the URL of the webpage request, and obtaining a query string in the URL of the webpage request; and then generating a simplified Chinese page corresponding to the query string according to the query string. The URL of the Simplified Chinese page is obtained according to the URL corresponding to the Simplified Chinese page. The generating a URL corresponding to the simplified Chinese page according to the query string may be: generating a URL corresponding to the simplified Chinese page by using a pre-configured rule according to the query string.

舉例來說,假設上述網頁請求的URL為:“http://www.1688.com/tw/rpc.json?orginalUrl=http://detail.1688.com/rpc/12345667.json”,則根據該URL的尾碼可以確定上述網頁請求為非同步請求,這時通過解析上述URL,獲得的上述URL中的查詢字串為“orginalUrl=http://detail.1688.com/rpc/12345667.json”,然後根據上述查詢字串,利用預先配置的規則可以生成簡體中文頁面對應的URL“http://detail.1688.com/rpc/12345667.json”,然後就可以根據該簡體中文頁面對應的URL“http://detail.1688.com/rpc/12345667.json”獲取簡體中文的頁面內容。 For example, suppose the URL of the above webpage request is: "http://www.1688.com/tw/rpc.json?orginalUrl=http://detail.1688.com/rpc/12345667.json", then The last code of the URL can determine that the webpage request is an asynchronous request, and the query string in the above URL obtained by parsing the URL is "orginalUrl=http://detail.1688.com/rpc/12345667.json" Then, according to the above query string, the URL corresponding to the Simplified Chinese page can be generated by using the pre-configured rule "http://detail.1688.com/rpc/12345667.json", and then the URL corresponding to the simplified Chinese page can be obtained. "http://detail.1688.com/rpc/12345667.json" gets the page content of Simplified Chinese.

本實施例提供的方法總體上依賴代理伺服器實現,不管是同步請求還是javascript觸發的非同步請求,上述簡體中文的頁面內容都是經過代理伺服器請求的,代理伺服器根據 生成的簡體中文頁面對應的URL獲取相應的簡體中文的頁面內容,考慮到網頁(web)應用的併發請求特徵,在具體實現時,可以在啟動時創建一定數量的抓取物件集區,以提高資料請求的效率。 The method provided in this embodiment generally relies on a proxy server implementation, whether it is a synchronous request or a javascript-triggered asynchronous request, the page content of the above simplified Chinese is requested by the proxy server, and the proxy server is based on The URL corresponding to the generated Simplified Chinese page obtains the content of the corresponding Simplified Chinese page. Considering the concurrent request feature of the web application, a specific number of captured object collection areas can be created at startup to improve The efficiency of the data request.

步驟203,代理伺服器根據簡體中文與繁體中文的對照表將獲取的簡體中文的頁面內容轉換為繁體中文的頁面內容,並輸出上述繁體中文的頁面內容。 Step 203: The proxy server converts the obtained page content of the simplified Chinese into the content of the traditional Chinese page according to the comparison table of the simplified Chinese and the traditional Chinese, and outputs the page content of the traditional Chinese.

其中,上述簡體中文與繁體中文的對照表可以從本地檔中載入到本地系統記憶體之中,考慮到web應用的併發請求特徵,這裡需要考慮多使用者同時請求繁體頁面時的性能消耗,因此採用簡體中文與繁體中文的對照表進行簡繁轉換,另外,考慮系統處理請求時的效率,整個簡體中文與繁體中文的對照表的載入不使用延遲載入的方式來實現,在啟動時就將上述對照表載入到系統記憶體之中。 The comparison table between the simplified Chinese and the traditional Chinese can be loaded into the local system memory from the local file. Considering the concurrent request feature of the web application, it is necessary to consider the performance consumption when multiple users simultaneously request the traditional page. Therefore, the Simplified Chinese and Traditional Chinese comparison tables are used for Simplified and Traditional conversion. In addition, considering the efficiency of the system when processing requests, the loading of the entire Simplified Chinese and Traditional Chinese comparison tables is not implemented by using lazy loading. The above comparison table is loaded into the system memory.

本實施例中,在向用戶端輸出頁面內容之前,代理伺服器對獲取的簡體中文的頁面內容進行攔截,根據簡體中文與繁體中文的對照表逐個字元進行匹配,以此完成簡體中文的頁面內容到繁體中文的頁面內容的轉換,轉換完成後,輸出繁體中文的頁面內容。 In this embodiment, before outputting the page content to the client, the proxy server intercepts the obtained Simplified Chinese page content, and matches the Simplified Chinese and Traditional Chinese comparison tables one by one to complete the Simplified Chinese page. The content of the content to the traditional Chinese page is converted, and after the conversion is completed, the content of the traditional Chinese page is output.

本實施例中,在步驟201,確定上述網頁請求的類型之後,步驟203根據簡體中文與繁體中文的對照表將獲取的簡體中文的頁面內容轉換為繁體中文的頁面內容之前,還可以 將上述網頁請求的類型標注在上述網頁請求的上下文中。也就是說,本實施例中,在確定網頁請求的類型之後,可以對該網頁請求的類型進行標注,具體的是標明該網頁請求是同步請求還是非同步請求以及該請求是簡體中文的頁面請求還是繁體中文的頁面請求,這樣,後續就可以根據標注的類型進行相應處理,具體地,可以將上述網頁請求的類型標注在上述網頁請求的上下文中,例如:可以將上述網頁請求的類型標注在上述網頁請求對應的HttpServletRequest的attribute之中。 In this embodiment, after determining the type of the webpage request in step 201, step 203 may convert the obtained page content of the simplified Chinese to the content of the traditional Chinese page according to the comparison table of the simplified Chinese and the traditional Chinese. The type of the above webpage request is marked in the context of the above webpage request. That is to say, in this embodiment, after determining the type of the webpage request, the type of the webpage request may be marked, specifically indicating whether the webpage request is a synchronous request or an asynchronous request, and the request is a simplified Chinese page request. Or a traditional Chinese page request, so that the subsequent processing can be corresponding according to the type of the annotation. Specifically, the type of the webpage request may be marked in the context of the webpage request, for example, the type of the webpage request may be marked in The above webpage request corresponds to the attribute of the HttpServletRequest.

上述實施例中,代理伺服器接收到網頁請求之後,如果該網頁請求的類型為繁體中文的頁面請求,但上述網頁請求所請求訪問的應用伺服器所處的地理位置對應的官方語言為簡體中文,則代理伺服器根據該網頁請求的URL先從上述應用伺服器請求簡體中文的頁面內容,並在輸出頁面內容之前,將該簡體中文的頁面內容轉換為繁體中文的頁面內容,從而可以實現一次性集中將簡體中文的頁面內容轉換為繁體中文的頁面內容,減小了對性能的影響,大大節約了人力資源成本和機器成本,並且同時支援同步請求和非同步請求,具有非常高的通用性;並且可以實現中國大陸的中文網站在海外搜尋引擎的中文搜索市場中保持同等起點的競爭力與權重,提高了中國大陸的中文網站進行搜尋引擎推廣以及參與排序時的得分。 In the above embodiment, after the proxy server receives the webpage request, if the webpage request type is a traditional Chinese page request, but the official language corresponding to the geographical location of the application server requested by the webpage requesting request is Simplified Chinese. The proxy server first requests the content of the simplified Chinese page from the application server according to the URL requested by the webpage, and converts the content of the simplified Chinese page into the content of the traditional Chinese page before outputting the content of the webpage, thereby achieving one time. Sexuality converts Simplified Chinese page content into Traditional Chinese page content, reduces the impact on performance, greatly saves human resource costs and machine costs, and supports both synchronous and asynchronous requests, with very high versatility And can realize the Chinese website in mainland China to maintain the competitiveness and weight of the same starting point in the Chinese search market of overseas search engines, and improve the scores of Chinese websites in China for search engine promotion and participation in sorting.

圖3為本發明動態頁面轉換的方法再一個實施例的流程圖,如圖3所示,該動態頁面轉換的方法可以包括:步驟301,代理伺服器接收用戶端發送的網頁請求。 FIG. 3 is a flowchart of still another embodiment of a method for dynamic page conversion according to the present invention. As shown in FIG. 3, the method for dynamic page conversion may include: Step 301: A proxy server receives a webpage request sent by a client.

步驟302,代理伺服器確定上述網頁請求的類型和上述網頁請求所請求訪問的應用伺服器所處的地理位置。 Step 302: The proxy server determines the type of the webpage request and the geographic location of the application server requested by the webpage request.

具體地,確定上述網頁請求的類型可以為:根據上述網頁請求的URL中的目錄和/或根據上述網頁請求的URL的查詢字串(QueryString)中攜帶的參數確定上述網頁請求的類型。 Specifically, determining the type of the webpage request may be: determining the type of the webpage request according to a directory in the URL of the webpage request and/or a parameter carried in a query string (QueryString) according to the URL of the webpage request.

在具體實現時,可以設置一個專門的繁體頁面目錄,如果接收到的網頁請求的URL中的目錄為繁體頁面目錄中的一個目錄,則可以確定上述網頁請求的類型為繁體中文的頁面請求。舉例來說,當網頁請求的URL為“http://www.1688.com/tw/***”時,該URL中的目錄“/tw/”為設置的繁體頁面目錄中的一個目錄,這時,可以確定接收到的網頁請求“http://www.1688.com/tw/***”的類型為繁體中文的頁面請求。 In a specific implementation, a special traditional page directory may be set. If the directory in the URL of the received webpage request is a directory in the traditional page directory, the page request may be determined to be a traditional Chinese page request. For example, when the URL requested by the web page is “http://www.1688.com/tw/***”, the directory “/tw/” in the URL is a directory in the set traditional page directory. At this time, it can be determined that the received web page request "http://www.1688.com/tw/***" is a page request of the type of Traditional Chinese.

具體地,確定上述網頁請求所請求訪問的應用伺服器所處的地理位置可以為:根據上述網頁請求的URL的功能變數名稱確定上述網頁請求所請求訪問的應用伺服器所處的地理位置;例如:如果上述網頁請求的URL的功能變數名稱中包含“.cn”的尾碼,則可以確定上述網頁請求所請求訪問 的應用伺服器所處的地理位置為中國,並且該地理位置對應的官方語言為簡體中文。本實施例對確定上述網頁請求所請求訪問的應用伺服器所處的地理位置所採用的方法不作限定,只要可以確定上述網頁請求所請求訪問的應用伺服器所處的地理位置即可。 Specifically, determining the geographic location where the application server requested to access the webpage request is located: determining, according to the function variable name of the URL requested by the webpage, a geographic location where the application server requested by the webpage request is located; for example : If the function variable name of the URL requested by the above webpage includes the last code of ".cn", it can be determined that the above webpage request requests access The application server is located in China, and the official language corresponding to the location is Simplified Chinese. The method for determining the geographical location of the application server requested to access the webpage request is not limited in this embodiment, as long as the geographic location of the application server requested by the webpage requesting is determined.

步驟303,判斷上述網頁請求的類型是否為簡體中文的頁面請求。如果否,則執行步驟304;如果上述網頁請求的類型為簡體中文的頁面請求,則執行步驟308。 Step 303: Determine whether the type of the webpage request is a Simplified Chinese page request. If no, step 304 is performed; if the type of the webpage request is a Simplified Chinese page request, step 308 is performed.

步驟304,判斷上述網頁請求是否為同步請求。如果是,則執行步驟305;如果上述網頁請求不是同步請求,而是非同步請求,則執行步驟306。 Step 304: Determine whether the webpage request is a synchronization request. If yes, step 305 is performed; if the webpage request is not a synchronization request but an asynchronous request, step 306 is performed.

具體地,可以根據上述網頁請求的URL的尾碼確定上述網頁請求是否為同步請求。 Specifically, whether the webpage request is a synchronization request may be determined according to a tail code of the URL requested by the webpage.

步驟305,代理伺服器根據上述網頁請求的URL生成簡體中文頁面對應的URL,根據上述簡體中文頁面對應的URL獲取簡體中文的頁面內容。然後執行步驟307。 Step 305: The proxy server generates a URL corresponding to the simplified Chinese page according to the URL requested by the webpage, and obtains the page content of the simplified Chinese according to the URL corresponding to the simplified Chinese page. Then step 307 is performed.

其中,根據上述網頁請求的URL生成簡體中文頁面對應的URL可以為:根據上述網頁請求的URL,利用預先配置的規則生成簡體中文頁面對應的URL。 The generating the URL corresponding to the Simplified Chinese page according to the URL requested by the webpage may be: generating a URL corresponding to the simplified Chinese page by using a pre-configured rule according to the URL requested by the webpage.

舉例來說,假設上述網頁請求的URL為“http://www.1688.com/detail/123456789.html”,則根據該URL的尾碼可以確定上述網頁請求為同步請求,然後根據該 URL,利用預先配置的規則,可以生成簡體中文頁面對應的URL“http://detail.1688.com/offer/123456789.html”;然後就可以根據該簡體中文頁面對應的URL“http://detail.1688.com/offer/123456789.html”獲取簡體中文的頁面內容。 For example, if the URL of the webpage request is “http://www.1688.com/detail/123456789.html”, the webpage request may be determined as a synchronization request according to the tail code of the URL, and then according to the The URL, using the pre-configured rules, can generate the URL corresponding to the Simplified Chinese page "http://detail.1688.com/offer/123456789.html"; then, according to the URL corresponding to the simplified Chinese page "http:// Detail.1688.com/offer/123456789.html"Get the page content of Simplified Chinese.

步驟306,代理伺服器解析上述網頁請求的URL,獲得上述網頁請求的URL中的查詢字串,根據上述查詢字串生成簡體中文頁面對應的URL,根據上述簡體中文頁面對應的URL獲取簡體中文的頁面內容。然後執行步驟307。 Step 306: The proxy server parses the URL of the webpage request, obtains a query string in the URL of the webpage request, generates a URL corresponding to the simplified Chinese page according to the query string, and obtains the simplified Chinese according to the URL corresponding to the simplified Chinese page. Page content. Then step 307 is performed.

其中,根據上述查詢字串生成簡體中文頁面對應的URL可以為:根據上述查詢字串,利用預先配置的規則生成簡體中文頁面對應的URL。 The generating a URL corresponding to the simplified Chinese page according to the query string may be: generating a URL corresponding to the simplified Chinese page by using a pre-configured rule according to the query string.

舉例來說,假設上述網頁請求的URL為:“http://www.1688.com/tw/rpc.json?orginalUrl=http://detail.1688.com/rpc/12345667.json”,則根據該URL的尾碼可以確定上述網頁請求為非同步請求,這時通過解析上述URL,獲得的上述URL中的查詢字串為“orginalUrl=http://detail.1688.com/rpc/12345667.json”,然後根據上述查詢字串,利用預先配置的規則可以生成簡體中文頁面對應的URL“http://detail.1688.com/rpc/12345667.json”,然後就可以根據該簡體中文頁面對應的 URL“http://detail.1688.com/rpc/12345667.json”獲取簡體中文的頁面內容。 For example, suppose the URL of the above webpage request is: "http://www.1688.com/tw/rpc.json?orginalUrl=http://detail.1688.com/rpc/12345667.json", then The last code of the URL can determine that the webpage request is an asynchronous request, and the query string in the above URL obtained by parsing the URL is "orginalUrl=http://detail.1688.com/rpc/12345667.json" Then, according to the above query string, the URL corresponding to the Simplified Chinese page can be generated by using the pre-configured rule "http://detail.1688.com/rpc/12345667.json", and then according to the corresponding Chinese page. The URL "http://detail.1688.com/rpc/12345667.json" gets the page content of Simplified Chinese.

本實施例提供的方法總體上依賴代理伺服器實現,不管是同步請求還是javascript觸發的非同步請求,上述簡體中文的頁面內容都是經過代理伺服器請求的,代理伺服器根據生成的簡體中文頁面對應的URL獲取相應的簡體頁面內容,考慮到網頁(web)應用的併發請求特徵,在具體實現時,可以在啟動時創建一定數量的抓取物件集區,以提高資料請求的效率。 The method provided in this embodiment generally relies on a proxy server implementation, whether it is a synchronous request or a javascript-triggered asynchronous request, the content of the above simplified Chinese page is requested by the proxy server, and the proxy server generates the simplified Chinese page according to the request. The corresponding URL obtains the corresponding simplified page content, and in consideration of the concurrent request feature of the web application, a specific number of captured object collection areas may be created at startup to improve the efficiency of the data request.

步驟307,代理伺服器根據簡體中文與繁體中文的對照表將獲取的簡體中文的頁面內容轉換為繁體中文的頁面內容,並輸出上述繁體中文的頁面內容。本次流程結束。 Step 307: The proxy server converts the obtained page content of the simplified Chinese into the content of the traditional Chinese page according to the comparison table of the simplified Chinese and the traditional Chinese, and outputs the page content of the traditional Chinese. This process ends.

其中,上述簡體中文與繁體中文的對照表可以從本地檔中載入到本地系統記憶體之中,考慮到web應用的併發請求特徵,這裡需要考慮多使用者同時請求繁體頁面時的性能消耗,因此採用簡體中文與繁體中文的對照表進行簡繁轉換,另外,考慮系統處理請求時的效率,整個簡體中文與繁體中文的對照表的載入不使用延遲載入的方式來實現,在啟動時就將上述對照表載入到系統記憶體之中。 The comparison table between the simplified Chinese and the traditional Chinese can be loaded into the local system memory from the local file. Considering the concurrent request feature of the web application, it is necessary to consider the performance consumption when multiple users simultaneously request the traditional page. Therefore, the Simplified Chinese and Traditional Chinese comparison tables are used for Simplified and Traditional conversion. In addition, considering the efficiency of the system when processing requests, the loading of the entire Simplified Chinese and Traditional Chinese comparison tables is not implemented by using lazy loading. The above comparison table is loaded into the system memory.

本實施例中,在向用戶端輸出頁面內容之前,代理伺服器對獲取的簡體中文的頁面內容進行攔截,根據簡體中文與繁體中文的對照表逐個字元進行匹配,以此完成簡體中文的 頁面內容到繁體中文的頁面內容的轉換,轉換完成後,輸出繁體中文的頁面內容。 In this embodiment, before outputting the content of the page to the client, the proxy server intercepts the obtained page content of the simplified Chinese, and matches the character according to the simplified Chinese and the traditional Chinese table by character, thereby completing the simplified Chinese. The conversion of the page content to the traditional Chinese page content, after the conversion is completed, the content of the traditional Chinese page is output.

步驟308,代理伺服器根據上述網頁請求的URL獲取簡體中文的頁面內容,並輸出上述簡體中文的頁面內容。本次流程結束。 Step 308: The proxy server obtains the page content of the simplified Chinese according to the URL requested by the webpage, and outputs the page content of the simplified Chinese. This process ends.

本發明提供的動態頁面轉換的方法是一種使用代理伺服器的方式對頁面的同步請求以及非同步請求進行統一處理的方法,本發明中,所有的頁面請求以及頁面內容的繁體化工作都在代理伺服器上完成,具有以下優點:1、大大節約人力資源成本以及機器成本,本發明提供的方法不僅不需要為繁體應用重新開發代碼,並且不需要測試等方面的投入,也無需採購額外的機器來搭建繁體專用集群,簡體應用與繁體應用完全可以部署在同一系統之中;2、一次性集中式簡繁轉換,對性能的影響非常小,這是不同於多語言框架的實現,多語言框架的本質是基於資源映射的,簡體繁體的轉換是散落在頁面生成以及資料生成的過程中的,因此是零碎的轉換。本發明在頁面渲染或者資料輸出的時候統一對輸出的內容進行攔截,將簡體字符一次性批量轉換成繁體字符,同時該方案一併支援位元組流的應用場景,經過壓力測試,本發明對系統的性能幾乎沒有很大的影響;3、同時支援同步頁面與非同步頁面生成:根據網頁請 求的URL的尾碼判斷該網頁請求是同步請求還是非同步請求,同步請求則根據相應的模版渲染頁面,非同步請求則將資料直接輸出,這裡很好地滿足了某些高級瀏覽器執行JavaScript的需求,執行JavaScript請求的遠端資料可以一併轉換成繁體;4、具有非常高的通用性:本發明提供的方法對應用的侵入性非常低,接入非常方便,在網頁請求(包括同步請求和非同步請求)到來之時,能夠根據該網頁請求的目錄和/或其參數自動地為該網頁請求匹配簡體中文資料或繁體中文資料。特別對於子網站非常多的大型網站,不同子功能變數名稱對應的應用可以基於本發明提供的方法來為子站生成對應的繁體頁面;5、可以實現中國大陸的中文網站在海外搜尋引擎的中文搜索市場中保持同等起點的競爭力與權重,提高了中國大陸的中文網站進行搜尋引擎推廣以及參與排序時的得分。 The method for dynamic page conversion provided by the present invention is a method for uniformly processing a synchronization request and an asynchronous request of a page by using a proxy server. In the present invention, all the page requests and the traditionalization of the page content are performed in the proxy. The server has the following advantages: 1. The utility model greatly saves the human resource cost and the machine cost. The method provided by the invention does not need to re-develop the code for the traditional application, and does not require investment in testing and the like, and does not need to purchase additional machines. To build a traditional private cluster, simplified and traditional applications can be deployed in the same system; 2, one-time centralized simplified conversion, the impact on performance is very small, which is different from the implementation of multi-language framework, multi-language framework The essence is based on resource mapping. Simplified and traditional conversion is scattered in the process of page generation and data generation, so it is a piecemeal transformation. The invention uniformly intercepts the output content during page rendering or data output, and converts the simplified characters into a traditional character at one time, and simultaneously supports the application scenario of the byte stream, and the stress test, the invention is The performance of the system has almost no significant impact; 3, support for synchronous pages and asynchronous page generation: according to the web page The tail code of the requested URL determines whether the webpage request is a synchronous request or an asynchronous request, the synchronous request renders the page according to the corresponding template, and the asynchronous request directly outputs the data, which satisfies some advanced browsers to execute the JavaScript well. The requirements, the remote data of the execution of the JavaScript request can be converted into a traditional one; 4, has a very high versatility: the method provided by the invention is very invasive to the application, the access is very convenient, in the webpage request (including synchronization When the request and the asynchronous request arrive, the page can be automatically requested to match the simplified Chinese or traditional Chinese materials according to the directory and/or its parameters requested by the web page. Especially for a large number of large websites with different sub-sites, applications corresponding to different sub-function variable names can generate corresponding traditional pages for sub-station based on the method provided by the present invention; 5. Chinese language search engine in Chinese can be realized in Chinese. The competitiveness and weight of the same starting point in the search market has improved the scores of Chinese-language websites in mainland China for search engine promotion and participation in sorting.

圖4為本發明動態頁面轉換的裝置一個實施例的結構示意圖,本實施例中的動態頁面轉換的裝置在與用戶端和應用伺服器通信的代理伺服器執行,也就是說,本實施例中的動態頁面轉換的裝置可以作為代理伺服器,或者代理伺服器的一部分實現本發明圖1~圖3所示實施例的流程,如圖4所示,該動態頁面轉換的裝置可以包括:接收模組31、確定模組32、獲取模組33、轉換模組34和輸出模組35; 其中,接收模組31,用於接收用戶端發送的網頁請求。 4 is a schematic structural diagram of an embodiment of a device for dynamic page conversion according to the present invention. The device for dynamic page conversion in this embodiment is executed by a proxy server that communicates with a client and an application server, that is, in this embodiment. The device for dynamic page conversion can be used as a proxy server or a part of the proxy server to implement the flow of the embodiment shown in FIG. 1 to FIG. 3 of the present invention. As shown in FIG. 4, the device for dynamic page conversion can include: receiving mode The group 31, the determining module 32, the obtaining module 33, the converting module 34 and the output module 35; The receiving module 31 is configured to receive a webpage request sent by the client.

確定模組32,用於確定接收模組31接收的網頁請求的類型和上述網頁請求所請求訪問的應用伺服器所處的地理位置;本實施例中,確定模組32,具體用於根據上述網頁請求的URL中的目錄和/或根據上述網頁請求的URL的查詢字串中攜帶的參數確定上述網頁請求的類型。舉例來說,如果接收到的網頁請求的URL中的目錄為預先設置的繁體頁面目錄中的一個目錄,則確定模組32可以確定上述網頁請求的類型為繁體中文的頁面請求。例如,當網頁請求的URL為“http://www.1688.com/tw/***”時,該URL中的目錄“/tw/”為預先設置的繁體頁面目錄中的一個目錄,這時,確定模組32可以確定接收到的網頁請求“http://www.1688.com/tw/***”為繁體中文的頁面請求。 The determining module 32 is configured to determine the type of the webpage request received by the receiving module 31 and the geographic location of the application server that the webpage request is requested to access; in this embodiment, the determining module 32 is specifically configured to be used according to the foregoing The type of the web page request is determined by a directory in the URL of the web page request and/or a parameter carried in the query string of the URL requested by the web page. For example, if the directory in the URL of the received webpage request is a directory in the preset traditional page directory, the determining module 32 may determine that the webpage request is of a traditional Chinese page request. For example, when the URL requested by the web page is "http://www.1688.com/tw/***", the directory "/tw/" in the URL is a directory in the preset traditional page directory. The determining module 32 can determine that the received webpage request "http://www.1688.com/tw/***" is a traditional Chinese page request.

具體地,確定模組32確定上述網頁請求所請求訪問的應用伺服器所處的地理位置可以為:確定模組32根據上述網頁請求的URL中的功能變數名稱確定上述網頁請求所請求訪問的應用伺服器所處的地理位置;例如:如果上述網頁請求的URL的功能變數名稱中包含“.cn”的尾碼,則確定模組32可以確定上述網頁請求所請求訪問的應用伺服器所處的地理位置為中國,並且該地理位置對應的官方語言為簡體中文。本實施例對確定模組32確定上述網頁請求所請求訪 問的應用伺服器所處的地理位置所採用的方法不作限定,只要可以確定上述網頁請求所請求訪問的應用伺服器所處的地理位置即可。 Specifically, the determining module 32 determines that the geographic location of the application server that the webpage request is requested to access may be: the determining module 32 determines, according to the function variable name in the URL requested by the webpage, the application requested by the webpage request. The geographical location where the server is located; for example, if the function variable name of the URL requested by the webpage includes the last code of “.cn”, the determining module 32 may determine that the application server requested by the webpage request is located The geographical location is China, and the official language corresponding to the geographic location is Simplified Chinese. In this embodiment, the determining module 32 determines that the webpage request is requested. The method used for the geographical location of the application server is not limited, as long as it can determine the geographical location of the application server requested by the above webpage request.

獲取模組33,用於當確定模組32確定上述網頁請求的類型為第一語言的頁面請求,但上述地理位置對應的官方語言為第二語言時,根據上述網頁請求的URL從上述應用伺服器獲取第二語言的頁面內容。 The obtaining module 33 is configured to: when the determining module 32 determines that the type of the webpage request is a page request in a first language, but the official language corresponding to the geographical location is a second language, the application server is requested according to the URL of the webpage request Get the page content of the second language.

轉換模組34,用於根據第一語言與第二語言的對照表將獲取模組33獲取的第二語言的頁面內容轉換為第一語言的頁面內容。 The conversion module 34 is configured to convert the page content of the second language acquired by the obtaining module 33 into the page content of the first language according to the comparison table of the first language and the second language.

輸出模組35,用於向用戶端輸出轉換模組34轉換的第一語言的頁面內容。 The output module 35 is configured to output the page content of the first language converted by the conversion module 34 to the client.

其中,上述第一語言與第二語言的對照表可以從本地檔中載入到本地系統記憶體之中,考慮到web應用的併發請求特徵,這裡需要考慮多使用者同時請求繁體頁面時的性能消耗,因此轉換模組34採用第一語言與第二語言的對照表進行簡繁轉換,另外,考慮系統處理請求時的效率,整個第一語言與第二語言的對照表的載入不使用延遲載入的方式來實現,在轉換模組34啟動時就將第一語言與第二語言的對照表載入到系統記憶體之中。 The comparison table of the first language and the second language may be loaded into the local system memory from the local file. Considering the concurrent request feature of the web application, it is necessary to consider the performance when multiple users simultaneously request the traditional page. Consumption, so the conversion module 34 uses the comparison table of the first language and the second language to perform the simplified conversion. In addition, considering the efficiency when the system processes the request, the loading of the entire first language and the second language is not delayed. The loading mode is implemented, and when the conversion module 34 is started, the comparison table of the first language and the second language is loaded into the system memory.

本實施例中,在輸出模組35向用戶端輸出頁面內容之前,轉換模組34對獲取模組33獲取的第二語言的頁面內容 進行攔截,根據第一語言與第二語言的對照表逐個字元進行匹配,以此完成第二語言的頁面內容到第一語言的頁面內容的轉換,轉換完成後,輸出模組35輸出第一語言的頁面內容。 In this embodiment, before the output module 35 outputs the page content to the client, the conversion module 34 acquires the page content of the second language acquired by the acquiring module 33. Intercepting, according to the first language and the second language comparison table matching characters one by one, thereby completing the conversion of the page content of the second language to the page content of the first language, after the conversion is completed, the output module 35 outputs the first The page content of the language.

上述動態頁面轉換的裝置,接收模組31接收到用戶端發送的網頁請求之後,如果確定模組32確定網頁請求的類型為第一語言的頁面請求,但上述網頁請求所請求訪問的應用伺服器所處的地理位置對應的官方語言為第二語言,則獲取模組33根據上述網頁請求的URL從應用伺服器獲取第二語言的頁面內容,轉換模組34再根據第一語言與第二語言的對照表將獲取的第二語言的頁面內容轉換為第一語言的頁面內容,輸出模組35向上述用戶端輸出第一語言的頁面內容,從而可以實現一次性集中對頁面內容進行轉換,減小對性能的影響,大大節約了人力資源成本和機器成本,並且同時支援同步請求和非同步請求,具有非常高的通用性。 The device for dynamic page conversion, after receiving the webpage request sent by the client, the receiving module 31 determines that the type of the webpage request is a page request in the first language, but the webpage requests the application server requested to access the webpage. If the official language corresponding to the geographical location is the second language, the obtaining module 33 obtains the page content of the second language from the application server according to the URL requested by the webpage, and the conversion module 34 is further configured according to the first language and the second language. The comparison table converts the acquired page content of the second language into the page content of the first language, and the output module 35 outputs the page content of the first language to the user terminal, so that the page content can be converted and reduced at one time. The small impact on performance greatly saves human resource costs and machine costs, and supports both synchronous and asynchronous requests, with very high versatility.

圖5為本發明動態頁面轉換的裝置另一個實施例的結構示意圖,與圖4所示的動態頁面轉換的裝置相比,不同之處在於,圖5所示的動態頁面轉換的裝置中,獲取模組33可以包括:請求確定子模組331、生成子模組332和內容獲取子模組333;或者,獲取模組33可以包括:請求確定子模組331、生成子模組332、內容獲取子模組333和解析子模組334。 FIG. 5 is a schematic structural diagram of another embodiment of a dynamic page conversion apparatus according to the present invention, which is different from the dynamic page conversion apparatus shown in FIG. 4 in that the dynamic page conversion apparatus shown in FIG. 5 acquires The module 33 may include a request determining sub-module 331, a generating sub-module 332, and a content obtaining sub-module 333. Alternatively, the obtaining module 33 may include: a request determining sub-module 331, a generating sub-module 332, and content acquisition. Sub-module 333 and parsing sub-module 334.

本實施例的一種實現方式中,請求確定子模組331,用於根據上述網頁請求的URL的尾碼確定上述網頁請求為同步請求;生成子模組332,用於當請求確定子模組331確定上述網頁請求為同步請求時,根據上述網頁請求的URL生成第二語言的頁面對應的URL;其中,生成子模組332可以根據上述網頁請求的URL,利用預先配置的規則生成第二語言的頁面對應的URL;內容獲取子模組333,用於根據生成子模組332生成的第二語言的頁面對應的URL從應用伺服器獲取第二語言的頁面內容。 In an implementation manner of this embodiment, the request determining submodule 331 is configured to determine, according to the last code of the URL requested by the webpage, that the webpage request is a synchronization request, and generate a submodule 332, when the request determining submodule 331 When the webpage request is determined to be a synchronization request, the URL corresponding to the page of the second language is generated according to the URL of the webpage request; wherein the generating submodule 332 can generate the second language by using the pre-configured rule according to the URL of the webpage requesting. The URL corresponding to the page; the content acquisition sub-module 333 is configured to obtain the page content of the second language from the application server according to the URL corresponding to the page of the second language generated by the generation sub-module 332.

舉例來說,假設上述網頁請求的URL為“http://www.1688.com/detail/123456789.html”,則請求確定子模組331根據該URL的尾碼可以確定上述網頁請求為同步請求,然後生成子模組332根據該URL,利用預先配置的規則可以生成第二語言的頁面對應的URL“http://detail.1688.com/offer/123456789.html”;然後內容獲取子模組333就可以根據該第二語言的頁面對應的URL“http://detail.1688.com/offer/123456789.html”獲取第二語言的頁面內容。 For example, if the URL of the webpage request is “http://www.1688.com/detail/123456789.html”, the request determining submodule 331 can determine that the webpage request is a synchronization request according to the tail code of the URL. And then generating a sub-module 332 according to the URL, using a pre-configured rule to generate a URL corresponding to the page of the second language "http://detail.1688.com/offer/123456789.html"; then the content acquisition sub-module 333, the page content of the second language can be obtained according to the URL "http://detail.1688.com/offer/123456789.html" corresponding to the page of the second language.

本實施例的另一種實現方式中,請求確定子模組331,用於根據上述網頁請求的URL的尾碼確定上述網頁請求為 非同步請求;解析子模組334,用於當請求確定子模組331確定上述網頁請求為非同步請求時,解析上述網頁請求的URL,獲得上述網頁請求的URL中的查詢字串;生成子模組332,用於根據解析子模組334獲得的查詢字串生成第二語言的頁面對應的URL;內容獲取子模組333,用於根據生成子模組332生成的第二語言的頁面對應的URL從應用伺服器獲取第二語言的頁面內容。 In another implementation manner of this embodiment, the request determining submodule 331 is configured to determine, according to the last code of the URL requested by the webpage, that the webpage request is The asynchronous sub-module 334 is configured to: when the request determining sub-module 331 determines that the webpage request is an asynchronous request, parse the URL of the webpage request, and obtain a query string in the URL of the webpage request; The module 332 is configured to generate a URL corresponding to the page in the second language according to the query string obtained by the parsing submodule 334. The content obtaining submodule 333 is configured to correspond to the page in the second language generated by the generating submodule 332. The URL gets the page content of the second language from the application server.

舉例來說,假設上述網頁請求的URL為:“http://www.1688.com/tw/rpc.json?orginalUrl=http://detail.1688.com/rpc/12345667.json”,則請求確定子模組331根據該URL的尾碼可以確定上述網頁請求為非同步請求,這時解析子模組334通過解析上述URL,獲得的上述URL中的查詢字串為“orginalUrl=http://detail.1688.com/rpc/12345667.json”,然後生成子模組332根據上述查詢字串,利用預先配置的規則可以生成第二語言的頁面對應的URL“http://detail.1688.com/rpc/12345667.json”,然後內容獲取子模組333就可以根據該第二語言的頁面對應的URL“http://detail.1688.com/rpc/12345667.json”獲取第二語言的頁面內容。 For example, suppose the URL of the above webpage request is: "http://www.1688.com/tw/rpc.json?orginalUrl=http://detail.1688.com/rpc/12345667.json", then request The determining sub-module 331 can determine that the webpage request is an asynchronous request according to the tail code of the URL. At this time, the parsing sub-module 334 parses the URL, and the query string in the URL obtained is “orginalUrl=http://detail”. .1688.com/rpc/12345667.json", and then the generating sub-module 332 can generate a URL corresponding to the page of the second language by using the pre-configured rule according to the above-mentioned query string "http://detail.1688.com/ Rpc/12345667.json", then the content acquisition sub-module 333 can obtain the page content of the second language according to the URL corresponding to the page of the second language "http://detail.1688.com/rpc/12345667.json" .

進一步地,上述動態頁面轉換的裝置還可以包括:標注模組36,用於在確定模組32確定上述網頁請求的類型之後,將上述網頁請求的類型標注在上述網頁請求的上下文中。 Further, the device for dynamic page conversion may further include: an annotation module 36, configured to mark the type of the webpage request in the context of the webpage request after the determining module 32 determines the type of the webpage request.

上述動態頁面轉換的裝置可以實現一次性集中對頁面內容進行轉換,減小對性能的影響,大大節約了人力資源成本和機器成本,並且同時支援同步請求和非同步請求,具有非常高的通用性。 The above dynamic page conversion device can realize the one-time centralized conversion of the page content, reduce the impact on performance, greatly save the human resource cost and the machine cost, and simultaneously support the synchronous request and the asynchronous request, and has very high versatility. .

需要說明的是,在本發明的描述中,術語“第一”、“第二”等僅用於描述目的,而不能理解為指示或暗示相對重要性。此外,在本發明的描述中,除非另有說明,“多個”的含義是兩個或兩個以上。 It should be noted that in the description of the present invention, the terms "first", "second" and the like are used for descriptive purposes only, and are not to be construed as indicating or implying relative importance. Further, in the description of the present invention, the meaning of "a plurality" is two or more unless otherwise specified.

流程圖中或在此以其他方式描述的任何過程或方法描述可以被理解為,表示包括一個或更多個用於實現特定邏輯功能或過程的步驟的可執行指令的代碼的模組、片段或部分,並且本發明的較佳實施方式的範圍包括另外的實現,其中可以不按所示出或討論的順序,包括根據所涉及的功能按基本同時的方式或按相反的順序,來執行功能,這應被本發明的實施例所屬技術領域的技術人員所理解。 Any process or method description in the flowcharts or otherwise described herein can be understood as a module, segment or code representing code that includes one or more executable instructions for implementing the steps of a particular logical function or process. The scope of the preferred embodiments of the invention includes additional implementations, in which the functions may be performed in a substantially simultaneous manner or in the reverse order, depending on the order in which they are illustrated, This should be understood by those skilled in the art to which the embodiments of the present invention pertain.

應當理解,本發明的各部分可以用硬體、軟體、韌體或它們的組合來實現。在上述實施方式中,多個步驟或方法可以用存儲在記憶體中且由合適的指令執行系統執行的軟體或 韌體來實現。例如,如果用硬體來實現,和在另一實施方式中一樣,可用本領域公知的下列技術中的任一項或他們的組合來實現:具有用於對資料信號實現邏輯功能的邏輯門電路的離散邏輯電路,具有合適的組合邏輯門電路的專用積體電路,可程式設計閘陣列(Programmable Gate Array;以下簡稱:PGA),現場可程式設計閘陣列(Field Programmable Gate Array;以下簡稱:FPGA)等。 It should be understood that portions of the invention may be implemented in hardware, software, firmware, or combinations thereof. In the above embodiments, multiple steps or methods may be implemented in software stored in memory and executed by a suitable instruction execution system or Firmware to achieve. For example, if implemented in hardware, as in another embodiment, it can be implemented by any one or combination of the following techniques well known in the art: having logic gates for implementing logic functions on data signals Discrete logic circuit, dedicated integrated circuit with suitable combination logic gate circuit, programmable gate array (Programmable Gate Array; PGA), Field Programmable Gate Array (hereinafter referred to as FPGA) )Wait.

本技術領域的普通技術人員可以理解實現上述實施例方法攜帶的全部或部分步驟是可以通過程式來指令相關的硬體完成,所述的程式可以儲存於一種電腦可讀儲存媒體中,該程式在執行時,包括方法實施例的步驟之一或其組合。 One of ordinary skill in the art can understand that all or part of the steps carried by the method of the above embodiment can be completed by a program to instruct the related hardware, and the program can be stored in a computer readable storage medium. When executed, one or a combination of the steps of the method embodiments is included.

此外,本發明各個實施例中的各功能模組可以集成在一個處理模組中,也可以是各個模組單獨物理存在,也可以兩個或兩個以上模組集成在一個模組中。上述集成的模組既可以採用硬體的形式實現,也可以採用軟體功能模組的形式實現。所述集成的模組如果以軟體功能模組的形式實現並作為獨立的產品銷售或使用時,也可以儲存在一個電腦可讀取儲存媒體中。 In addition, each function module in each embodiment of the present invention may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. The integrated module can also be stored in a computer readable storage medium if it is implemented in the form of a software function module and sold or used as a standalone product.

上述提到的儲存媒體可以是唯讀記憶體,磁片或光碟等。 The storage medium mentioned above may be a read only memory, a magnetic disk or a compact disk.

在本說明書的描述中,參考術語“一個實施例”、“一些實施例”、“示例”、“具體示例”、或“一些示例”等的描述意 指結合該實施例或示例描述的具體特徵、結構、材料或者特點包含於本發明的至少一個實施例或示例中。在本說明書中,對上述術語的示意性表述不一定指的是相同的實施例或示例。而且,描述的具體特徵、結構、材料或者特點可以在任何的一個或多個實施例或示例中以合適的方式結合。 In the description of the present specification, reference is made to the descriptions of the terms "one embodiment", "some embodiments", "example", "specific examples", or "some examples" and the like. The specific features, structures, materials, or characteristics described in connection with the embodiments or examples are included in at least one embodiment or example of the invention. In the present specification, the schematic representation of the above terms does not necessarily mean the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in a suitable manner in any one or more embodiments or examples.

儘管上面已經示出和描述了本發明的實施例,可以理解的是,上述實施例是示例性的,不能理解為對本發明的限制,本領域的普通技術人員在本發明的範圍內可以對上述實施例進行變化、修改、替換和變型。 Although the embodiments of the present invention have been shown and described, it is understood that the above-described embodiments are illustrative and are not to be construed as limiting the scope of the invention. The embodiments are subject to variations, modifications, substitutions and variations.

Claims (10)

一種動態頁面轉換的方法,其特徵在於,包括:代理伺服器接收用戶端發送的網頁請求,確定該網頁請求的類型和該網頁請求所請求訪問的應用伺服器所處的地理位置;如果該網頁請求的類型為第一語言的頁面請求,但該地理位置對應的官方語言為第二語言,則根據該網頁請求的統一資源定位符URL從該應用伺服器獲取該第二語言的頁面內容;該代理伺服器根據該第一語言與該第二語言的對照表將獲取的第二語言的頁面內容轉換為該第一語言的頁面內容,並向該用戶端輸出該第一語言的頁面內容。 A method for dynamic page conversion, comprising: receiving, by a proxy server, a webpage request sent by a client, determining a type of the webpage request and a geographical location of an application server requested by the webpage request; if the webpage If the requested type is a page request in the first language, but the official language corresponding to the geographic location is the second language, the page content of the second language is obtained from the application server according to the uniform resource locator URL requested by the webpage; The proxy server converts the acquired page content of the second language into the page content of the first language according to the comparison table of the first language and the second language, and outputs the page content of the first language to the client. 根據申請專利範圍第1項所述的方法,其中,該根據該網頁請求的URL從應用伺服器獲取該第二語言的頁面內容包括:根據該網頁請求的URL的尾碼確定該網頁請求為同步請求時,根據該網頁請求的URL生成該第二語言的頁面對應的URL,根據該第二語言的頁面對應的URL從應用伺服器獲取該第二語言的頁面內容。 The method of claim 1, wherein the obtaining the page content of the second language from the application server according to the URL requested by the webpage comprises: determining that the webpage request is synchronized according to a tail code of the URL requested by the webpage. When requested, the URL corresponding to the page of the second language is generated according to the URL requested by the webpage, and the page content of the second language is obtained from the application server according to the URL corresponding to the page of the second language. 根據申請專利範圍第1項所述的方法,其中,該根據該網頁請求的URL從應用伺服器獲取該第二語言的頁面內容包括:根據該網頁請求的URL的尾碼確定該網頁請求為非同步請求時,解析該網頁請求的URL,獲得該網頁請求的 URL中的查詢字串;根據該查詢字串生成該第二語言的頁面對應的URL,根據該第二語言的頁面對應的URL從應用伺服器獲取該第二語言的頁面內容。 The method of claim 1, wherein the obtaining the page content of the second language from the application server according to the URL requested by the webpage comprises: determining, according to a tail code of the URL requested by the webpage, the webpage request is not When the request is synchronized, the URL of the webpage request is parsed, and the webpage request is obtained. a query string in the URL; generating a URL corresponding to the page of the second language according to the query string, and acquiring the page content of the second language from the application server according to the URL corresponding to the page of the second language. 根據申請專利範圍第1至3項中任意一項所述的方法,其中,該確定該網頁請求的類型包括:根據該網頁請求的URL中的目錄和/或根據該網頁請求的URL的查詢字串中攜帶的參數確定該網頁請求的類型。 The method of any one of claims 1 to 3, wherein the determining the type of the webpage request comprises: a directory in a URL requested according to the webpage and/or a queryword according to a URL requested by the webpage The parameters carried in the string determine the type of the web page request. 根據申請專利範圍第1至3項中任意一項所述的方法,其中,該確定該網頁請求的類型之後,還包括:將該網頁請求的類型標注在該網頁請求的上下文中。 The method of any one of claims 1 to 3, wherein the determining the type of the web page request further comprises: marking the type of the web page request in the context of the web page request. 一種動態頁面轉換的裝置,該裝置在與用戶端和應用伺服器通信的代理伺服器執行,其中,包括:接收模組,用於接收該用戶端發送的網頁請求;確定模組,用於確定該接收模組接收的網頁請求的類型和該網頁請求所請求訪問的該應用伺服器所處的地理位置;獲取模組,用於當該確定模組確定該網頁請求的類型為第一語言的頁面請求,但該地理位置對應的官方語言為第二語言時,根據該網頁請求的統一資源定位符URL從該應用伺服器獲取該第二語言的頁面內容;轉換模組,用於根據該第一語言與該第二語言的對照表將該獲取模組獲取的第二語言的頁面內容轉換為該第一 語言的頁面內容;輸出模組,用於向該用戶端輸出該轉換模組轉換的該第一語言的頁面內容。 A device for dynamic page conversion, the device is executed by a proxy server that communicates with a client and an application server, and includes: a receiving module, configured to receive a webpage request sent by the client; and a determining module, configured to determine The type of the webpage request received by the receiving module and the geographic location of the application server that the webpage request is requested to access; the obtaining module is configured to: when the determining module determines that the type of the webpage request is in the first language a page request, but when the official language corresponding to the geographic location is a second language, the page content of the second language is obtained from the application server according to the uniform resource locator URL requested by the webpage; and the conversion module is configured to be used according to the a comparison table between the language and the second language converts the page content of the second language acquired by the obtaining module into the first The page content of the language; the output module is configured to output the page content of the first language converted by the conversion module to the client. 根據申請專利範圍第6項所述的裝置,其中,該獲取模組包括:請求確定子模組,用於根據該網頁請求的URL的尾碼確定該網頁請求為同步請求;生成子模組,用於當該請求確定子模組確定該網頁請求為同步請求時,根據該網頁請求的URL生成該第二語言的頁面對應的URL;內容獲取子模組,用於根據該生成子模組生成的該第二語言的頁面對應的URL從應用伺服器獲取該第二語言的頁面內容。 The device of claim 6, wherein the obtaining module comprises: a request determining submodule, configured to determine, according to a tail code of the URL requested by the webpage, the webpage request as a synchronization request; and generating a submodule, When the request determining submodule determines that the webpage request is a synchronization request, generating a URL corresponding to the page of the second language according to the URL requested by the webpage; the content obtaining submodule is configured to generate according to the generated submodule The URL corresponding to the page of the second language acquires the page content of the second language from the application server. 根據申請專利範圍第6所述的裝置,其中,該獲取模組包括:請求確定子模組,用於根據該網頁請求的URL的尾碼確定該網頁請求為非同步請求;解析子模組,用於當該請求確定子模組確定該網頁請求為非同步請求時,解析該網頁請求的URL,獲得該網頁請求的URL中的查詢字串;生成子模組,用於根據該解析子模組獲得的查詢字串生成該第二語言的頁面對應的URL;內容獲取子模組,用於根據該生成子模組生成的該第二語言的頁面對應的URL從應用伺服器獲取該第二語言 的頁面內容。 The device of claim 6, wherein the obtaining module comprises: a request determining submodule, configured to determine, according to a tail code of the URL requested by the webpage, the webpage request as an asynchronous request; When the request determining submodule determines that the webpage request is an asynchronous request, parsing the URL of the webpage request, obtaining a query string in the URL of the webpage request, and generating a submodule for using the parsing submodule The query string obtained by the group generates a URL corresponding to the page of the second language; the content acquisition submodule is configured to obtain the second from the application server according to the URL corresponding to the page of the second language generated by the generating submodule Language Page content. 根據申請專利範圍第6至8項中任意一項所述的裝置,其中,該確定模組,具體用於根據該網頁請求的URL中的目錄和/或根據該網頁請求的URL的查詢字串中攜帶的參數確定該網頁請求的類型。 The device according to any one of claims 6 to 8, wherein the determining module is specifically configured to use a directory in a URL requested by the webpage and/or a query string according to a URL requested by the webpage. The parameters carried in the determination determine the type of the web page request. 根據申請專利範圍第6至8項中任意一項所述的裝置,其中,還包括:標注模組,用於在該確定模組確定該網頁請求的類型之後,將該網頁請求的類型標注在該網頁請求的上下文中。 The device according to any one of claims 6 to 8, further comprising: an annotation module, configured to mark the type of the webpage request after the determining module determines the type of the webpage request The context of the page request.
TW104129196A 2015-03-31 2015-09-03 Method and device for dynamic page conversion TWI718993B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510149776.4 2015-03-31
CN201510149776.4A CN106156080B (en) 2015-03-31 2015-03-31 The method and apparatus of dynamic page conversion

Publications (2)

Publication Number Publication Date
TW201635170A true TW201635170A (en) 2016-10-01
TWI718993B TWI718993B (en) 2021-02-21

Family

ID=57338253

Family Applications (1)

Application Number Title Priority Date Filing Date
TW104129196A TWI718993B (en) 2015-03-31 2015-09-03 Method and device for dynamic page conversion

Country Status (2)

Country Link
CN (1) CN106156080B (en)
TW (1) TWI718993B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109241480A (en) * 2018-08-16 2019-01-18 海信电子科技(深圳)有限公司 page display method and device
CN110442396B (en) * 2019-07-31 2022-12-16 网易(杭州)网络有限公司 Application program starting method and device, storage medium and electronic equipment
CN111988384B (en) * 2020-08-10 2022-08-30 北京百度网讯科技有限公司 Information transmission method and device, electronic equipment and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201006199A (en) * 2008-07-25 2010-02-01 Chi Mei Comm Systems Inc System and method for controlling internet push messages
US20100050089A1 (en) * 2008-08-20 2010-02-25 Company 100, Inc. Web browser system of mobile communication terminal, using proxy server
CN101676904B (en) * 2008-09-19 2013-06-12 中兴通讯股份有限公司 Multilingual method of Web application system and device
CN101945081A (en) * 2009-07-06 2011-01-12 北京易路联动技术有限公司 Code conversion method, system and server of class webpage applications
CN102651750B (en) * 2011-02-24 2015-03-18 阿里巴巴集团控股有限公司 Method, system and device for providing Web page information
CN103970751A (en) * 2013-01-28 2014-08-06 鸿富锦精密工业(深圳)有限公司 Multi-language web page converting system and method

Also Published As

Publication number Publication date
CN106156080A (en) 2016-11-23
CN106156080B (en) 2019-06-11
TWI718993B (en) 2021-02-21

Similar Documents

Publication Publication Date Title
WO2019019361A1 (en) Method and apparatus for processing data of database, computer device, and storage medium
WO2020253389A1 (en) Page translation method and apparatus, medium, and electronic device
WO2017114206A1 (en) Method and device for processing short link, and short link server
WO2017113060A1 (en) Website access method and device, and website system
US20160259800A1 (en) Webpage loading method, client and server
WO2018001124A1 (en) Webpage file sending method, webpage rendering method and apparatus, and webpage rendering system
WO2013143403A1 (en) Method and system for accessing website
US8250466B2 (en) Computer and method for converting a web page
WO2016184349A1 (en) Domain name parsing method, device and system
TW201314577A (en) Device of WebKit browser and associated method of loading homepage content
CN107145784B (en) Vulnerability scanning method and device and computer readable medium
US11080322B2 (en) Search methods, servers, and systems
TW201635170A (en) Dynamic webpage conversion method and device
TW201437826A (en) Method and device for combining webpage style address
WO2018103735A1 (en) Method, device, and file server for voice data exchange
WO2015074459A1 (en) Method and apparatus for opening webpage, invoking client, and creating light app
WO2020088170A1 (en) Domain name system configuration method and related apparatus
CN111639275A (en) Routing information processing method and device, electronic equipment and computer storage medium
WO2015003664A1 (en) Method, device, server, and client device for download processing
JP2019512776A (en) Language recognition method, apparatus and system
WO2015003556A1 (en) Device and method for acquiring second-level domain name information associated with main domain name
WO2015154682A1 (en) Network request processing method, network server, and network system
WO2016086784A1 (en) Method, apparatus and system for collecting webpage data
AU2017268628A1 (en) Method, device, terminal, server and storage medium of processing network request and response
WO2019024520A1 (en) Page presentation method, electronic device and non-volatile computer readable storage medium