TWI718993B - Method and device for dynamic page conversion - Google Patents

Method and device for dynamic page conversion Download PDF

Info

Publication number
TWI718993B
TWI718993B TW104129196A TW104129196A TWI718993B TW I718993 B TWI718993 B TW I718993B TW 104129196 A TW104129196 A TW 104129196A TW 104129196 A TW104129196 A TW 104129196A TW I718993 B TWI718993 B TW I718993B
Authority
TW
Taiwan
Prior art keywords
language
request
web page
url
page
Prior art date
Application number
TW104129196A
Other languages
Chinese (zh)
Other versions
TW201635170A (en
Inventor
黃華
張美德
Original Assignee
香港商阿里巴巴集團服務有限公司
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 香港商阿里巴巴集團服務有限公司 filed Critical 香港商阿里巴巴集團服務有限公司
Publication of TW201635170A publication Critical patent/TW201635170A/en
Application granted granted Critical
Publication of TWI718993B publication Critical patent/TWI718993B/en

Links

Images

Abstract

本發明提出一種動態頁面轉換的方法和裝置,該動態頁面轉換的方法包括:代理伺服器接收用戶端發送的網頁請求,確定該網頁請求的類型和該網頁請求所請求訪問的應用伺服器所處的地理位置;如果該網頁請求的類型為第一語言的頁面請求,但上述地理位置對應的官方語言為第二語言,則根據該網頁請求的URL從應用伺服器獲取第二語言的頁面內容;根據第一語言與第二語言的對照表將獲取的第二語言的頁面內容轉換為第一語言的頁面內容,並向用戶端輸出第一語言的頁面內容。本發明可以實現一次性集中對頁面內容進行轉換,減小對性能的影響,大大節約了人力資源成本和機器成本,並且同時支援同步請求和非同步請求,具有非常高的通用性。 The present invention provides a dynamic page conversion method and device. The dynamic page conversion method includes: a proxy server receives a web page request sent by a client, and determines the type of the web page request and the location of the application server requested by the web page request. If the type of the web page request is a page request in the first language, but the official language corresponding to the above geographic location is a second language, then the page content in the second language is obtained from the application server according to the URL of the web page request; The obtained page content in the second language is converted into the page content in the first language according to the comparison table of the first language and the second language, and the page content in the first language is output to the user terminal. The invention can realize one-time centralized conversion of page content, reduce the impact on performance, greatly save human resource costs and machine costs, and support synchronous requests and asynchronous requests at the same time, and has very high versatility.

Description

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

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

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

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

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

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

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

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

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

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

為了實現上述目的,本發明第二態樣實施例的動態頁面轉換的裝置,所述裝置在與用戶端和應用伺服器通信的代理伺服器執行,包括:接收模組,用於接收所述用戶端發送的網頁請求;確定模組,用於確定所述接收模組接收的網頁請求的類型和所述網頁請求所請求訪問的所述應用伺服器所處的地理位置;獲取模組,用於當所述確定模組確定所述網頁請求的類型為第一語言的頁面請求,但所述地理位置對應的官方語言為第二語言時,根據所述網頁請求的統一資源定位符URL從所述應用伺服器獲取所述第二語言的頁面內容;轉換模組,用於根據所述第一語言與所述第二語言的對照表 將所述獲取模組獲取的第二語言的頁面內容轉換為所述第一語言的頁面內容;輸出模組,用於向所述用戶端輸出所述轉換模組轉換的所述第一語言的頁面內容。 In order to achieve the above object, the device for dynamic page conversion in the second aspect of the present invention is executed on a proxy server that communicates with a client and an application server, and includes: a receiving module for receiving the user A web page request sent by the client terminal; a determining module for determining the type of web page request received by the receiving module and the geographic location of the application server requested to be accessed by the web page request; an obtaining module for When the determining module determines that the type of the web page 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 of the web page request is selected from the The application server obtains the content of the page in the second language; the conversion module is used for comparing the first language and the second language according to the comparison table Convert the page content in the second language acquired by the acquisition module into the page content in the first language; an output module for outputting to the user terminal the content in 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 on a proxy server that communicates with the client and the application server. After the receiving module receives the web page request sent by the client, if the determining module determines that the type of the web page request is A page request in the first language, but the official language corresponding to the geographic location of the application server requested by the above web page request is the second language, then the acquisition module obtains the second language from the application server according to the URL of the above web page request The conversion module converts the acquired page content in the second language into the page content in the first language according to the comparison table between the first language and the second language, and the output module outputs the page in the first language to the above-mentioned client Content, which can realize one-time centralized conversion of page content, reduce the impact on performance, greatly save human resource costs and machine costs, and support synchronous and asynchronous requests at the same time, with very high versatility.

本發明附加的方面和優點將在下面的描述中部分給出,部分將從下面的描述中變得明顯,或通過本發明的實踐瞭解到。 The additional aspects and advantages of the present invention will be partially given in the following description, and some will become obvious from the following description, or be understood through the practice of the present invention.

31‧‧‧接收模組 31‧‧‧Receiving Module

32‧‧‧確定模組 32‧‧‧Determine the module

33‧‧‧獲取模組 33‧‧‧Get Module

34‧‧‧轉換模組 34‧‧‧Conversion Module

35‧‧‧輸出模組 35‧‧‧Output Module

331‧‧‧請求確定子模組 331‧‧‧Request to confirm submodule

332‧‧‧生成子模組 332‧‧‧Generate 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 obvious and easy to understand from the following description of the embodiments in conjunction with the accompanying drawings, in which: Fig. 1 is a flowchart of an 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. 3 is another embodiment of the method for dynamic page conversion according to the present invention Flow chart; FIG. 4 is a schematic structural diagram of an embodiment of a device for dynamic page conversion of the present invention; FIG. 5 is a schematic structural diagram of another embodiment of a device for dynamic page conversion of the present invention.

下面詳細描述本發明的實施例,所述實施例的示例在附圖中示出,其中自始至終相同或類似的標號表示相同或類似的元件或具有相同或類似功能的元件。下面通過參考附圖描述的實施例是示例性的,僅用於解釋本發明,而不能理解為對本發明的限制。相反,本發明的實施例包括落入所附加申請專利範圍的精神和內涵範圍內的所有變化、修改和等同物。 The embodiments of the present invention are described in detail below. Examples of the embodiments are shown in the accompanying drawings, in which the same or similar reference numerals indicate the same or similar elements or elements with the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary, and are only used to explain the present invention, but should not be understood as limiting the present invention. On the contrary, the embodiments of the present invention include all changes, modifications, and equivalents that fall within the spirit and connotation scope of the appended patent application.

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

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

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

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

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

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

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

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

本實施例中,第一語言與第二語言為不同的語言,例如:第一語言為繁體中文,第二語言為簡體中文;或者,第一語言為英語,第二語言為簡體中文等等,在此不做限定。 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, etc., There is no limitation here.

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

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

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

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

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

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

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

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

舉例來說,假設上述網頁請求的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, suppose the URL of the above web page request is "http://www.1688.com/detail/123456789.html", then according to the tail code of the URL, it can be determined that the above web page request is a synchronous request, and then according to the URL, Using the pre-configured rules, the URL corresponding to the simplified Chinese page "http://detail.1688.com/offer/123456789.html" can be generated; then the URL corresponding to the simplified Chinese page "http://detail.1688" can be generated .com/offer/123456789.html" Get the simplified Chinese page content from the above application server.

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

舉例來說,假設上述網頁請求的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 web page request is: "http://www.1688.com/tw/rpc.json?orginalUrl=http://detail.1688.com/rpc/12345667.json", then according to The suffix of the URL can determine that the above web page request is an asynchronous request. At this time, by parsing the above URL, the query string in the above URL obtained is "orginalUrl=http://detail.1688.com/rpc/12345667.json" , And then according to the above query string, the URL corresponding to the simplified Chinese page "http://detail.1688.com/rpc/12345667.json" can be generated using the pre-configured rules, and then the URL corresponding to the simplified Chinese page can be generated according to the URL "Http://detail.1688.com/rpc/12345667.json" to get the page content in simplified Chinese.

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

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

其中,上述簡體中文與繁體中文的對照表可以從本地檔中載入到本地系統記憶體之中,考慮到web應用的併發請求特徵,這裡需要考慮多使用者同時請求繁體頁面時的性能消耗,因此採用簡體中文與繁體中文的對照表進行簡繁轉換,另外,考慮系統處理請求時的效率,整個簡體中文與繁體中文的對照表的載入不使用延遲載入的方式來實現,在啟動時就將上述對照表載入到系統記憶體之中。 Among them, the above comparison table of simplified Chinese and traditional Chinese can be loaded from the local file into the local system memory. Considering the concurrent request characteristics of web applications, the performance consumption when multiple users request the traditional page at the same time needs to be considered here. Therefore, the comparison table between simplified Chinese and traditional Chinese is used for the conversion between simplified and traditional Chinese. In addition, considering the efficiency of the system when processing requests, the loading of the entire simplified and traditional Chinese comparison table is not implemented by lazy loading. Just load the above comparison table 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 characters one by one according to the comparison table of simplified Chinese and traditional Chinese, thereby completing the simplified Chinese page The content is converted to the traditional Chinese page content. After the conversion is completed, the traditional Chinese page content is output.

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

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

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

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

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

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

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

步驟303,判斷上述網頁請求的類型是否為簡體中文的頁面請求。如果否,則執行步驟304;如果上述網頁請求的類型為簡體中文的頁面請求,則執行步驟308。 Step 303: It is judged whether the type of the above-mentioned web page request is a simplified Chinese page request. If not, go to step 304; if the type of the web page request is a simplified Chinese page request, go to step 308.

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

具體地,可以根據上述網頁請求的URL的尾碼確定上述網頁請求是否為同步請求。 Specifically, it may be determined whether the web page request is a synchronous request according to the suffix of the URL of the web page request.

步驟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 above web page, and obtains the simplified Chinese page content according to the URL corresponding to the above simplified Chinese page. Then step 307 is executed.

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

舉例來說,假設上述網頁請求的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, suppose the URL of the above web page request is "http://www.1688.com/detail/123456789.html", then according to the suffix of the URL, it can be determined that the above web page request is a synchronous request, and then according to the URL, using pre-configured rules, you can generate the URL corresponding to the simplified Chinese page "http://detail.1688.com/offer/123456789.html"; then you can use the URL corresponding to the simplified Chinese page "http:// detail.1688.com/offer/123456789.html" to get the page content in Simplified Chinese.

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

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

舉例來說,假設上述網頁請求的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 web page request is: "http://www.1688.com/tw/rpc.json?orginalUrl=http://detail.1688.com/rpc/12345667.json", then according to The suffix of the URL can determine that the above web page request is an asynchronous request. At this time, by parsing the above URL, the query string in the above URL obtained is "orginalUrl=http://detail.1688.com/rpc/12345667.json" , And then according to the above query string, using the pre-configured rules, the URL corresponding to the simplified Chinese page "http://detail.1688.com/rpc/12345667.json" can be generated, and then the simplified Chinese page corresponding to the URL can be generated URL "http://detail.1688.com/rpc/12345667.json" to get the page content in simplified Chinese.

本實施例提供的方法總體上依賴代理伺服器實現,不管是同步請求還是javascript觸發的非同步請求,上述簡體中文的頁面內容都是經過代理伺服器請求的,代理伺服器根據生成的簡體中文頁面對應的URL獲取相應的簡體頁面內容,考慮到網頁(web)應用的併發請求特徵,在具體實現時,可以在啟動時創建一定數量的抓取物件集區,以提高資料請求的效率。 The method provided in this embodiment is generally implemented by a proxy server. Regardless of whether it is a synchronous request or an asynchronous request triggered by javascript, the above-mentioned simplified Chinese page content 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. Taking into account the concurrent request characteristics of web applications, in specific implementation, a certain number of grabbing object pools can be created at startup to improve the efficiency of data requests.

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

其中,上述簡體中文與繁體中文的對照表可以從本地檔中載入到本地系統記憶體之中,考慮到web應用的併發請求特徵,這裡需要考慮多使用者同時請求繁體頁面時的性能消耗,因此採用簡體中文與繁體中文的對照表進行簡繁轉換,另外,考慮系統處理請求時的效率,整個簡體中文與繁體中文的對照表的載入不使用延遲載入的方式來實現,在啟動時就將上述對照表載入到系統記憶體之中。 Among them, the above comparison table of simplified Chinese and traditional Chinese can be loaded from the local file into the local system memory. Considering the concurrent request characteristics of web applications, the performance consumption when multiple users request the traditional page at the same time needs to be considered here. Therefore, the comparison table between simplified Chinese and traditional Chinese is used for the conversion between simplified and traditional Chinese. In addition, considering the efficiency of the system when processing requests, the loading of the entire simplified and traditional Chinese comparison table is not implemented by lazy loading. Just load the above comparison table 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 characters one by one according to the comparison table of simplified Chinese and traditional Chinese, thereby completing simplified Chinese The page content is converted to the traditional Chinese page content. After the conversion is completed, the traditional Chinese page content is output.

步驟308,代理伺服器根據上述網頁請求的URL獲取簡體中文的頁面內容,並輸出上述簡體中文的頁面內容。本次流程結束。 Step 308: The proxy server obtains the simplified Chinese page content according to the URL requested by the above web page, and outputs the above simplified Chinese page content. 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 page synchronization requests and asynchronous requests using a proxy server. In the present invention, all page requests and traditionalization of page content are performed on the proxy Completed on the server, it has the following advantages: 1. It greatly saves human resource costs and machine costs. The method provided by the present invention not only does not need to re-develop the code for traditional Chinese applications, but also does not require investment in testing and other aspects, and does not need to purchase additional machines. To build a dedicated cluster for traditional Chinese, simplified and traditional applications can be deployed in the same system; 2. One-time centralized conversion between simplified and traditional, which has a very small impact on performance, which is different from the implementation of multilingual frameworks. The essence of is based on resource mapping, the conversion of simplified and traditional is scattered in the process of page generation and data generation, so it is a piecemeal conversion. The present invention uniformly intercepts the output content during page rendering or data output, and batch converts simplified characters into traditional characters at one time. At the same time, the solution also supports the application scenario of byte stream. After stress testing, the present invention The performance of the system has almost no significant impact; 3. Simultaneous support for simultaneous page and asynchronous page generation: Please follow the webpage The suffix of the requested URL judges whether the web page request is a synchronous request or an asynchronous request. The synchronous request renders the page according to the corresponding template, and the asynchronous request outputs the data directly. This satisfies some advanced browsers to execute JavaScript. The remote data requested by executing JavaScript can be converted into traditional Chinese at the same time; 4. It has very high versatility: the method provided by the present invention is very low intrusive to the application, and the access is very convenient. When the request and asynchronous request arrives, it can automatically request matching simplified Chinese data or traditional Chinese data for the web page according to the directory and/or its parameters of the web page request. Especially for large websites with a lot of sub-sites, applications corresponding to different sub-function variable names can generate corresponding traditional pages for the sub-sites based on the method provided by the present invention; 5. It is possible to realize the Chinese of mainland Chinese websites in overseas search engines. Maintaining the same starting point of competitiveness and weight in the search market has improved the scores of Chinese websites in mainland China for search engine promotion and participation in ranking.

圖4為本發明動態頁面轉換的裝置一個實施例的結構示意圖,本實施例中的動態頁面轉換的裝置在與用戶端和應用伺服器通信的代理伺服器執行,也就是說,本實施例中的動態頁面轉換的裝置可以作為代理伺服器,或者代理伺服器的一部分實現本發明圖1~圖3所示實施例的流程,如圖4所示,該動態頁面轉換的裝置可以包括:接收模組31、確定模組32、獲取模組33、轉換模組34和輸出模組35; 其中,接收模組31,用於接收用戶端發送的網頁請求。 FIG. 4 is a schematic structural diagram of an embodiment of a device for dynamic page conversion of the present invention. The device for dynamic page conversion in this embodiment is executed on 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 can implement the process of the embodiment shown in Figures 1 to 3 of the present invention. As shown in Figure 4, the device for dynamic page conversion can include: a receiving module Group 31, determination module 32, acquisition module 33, conversion module 34, and output module 35; Among them, the receiving module 31 is used to receive a web page 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 used to determine the type of web page request received by the receiving module 31 and the geographic location of the application server requested to be accessed by the web page request; in this embodiment, the determining module 32 is specifically configured to The directory in the URL of the web page request and/or the parameters carried in the query string of the URL of the web page request determine the type of the web page request. For example, if the directory in the URL of the received web page request is a directory in a preset traditional Chinese page directory, the determining module 32 can determine that the type of the web page request is a traditional Chinese page request. For example, when the URL of the web page request is "http://www.1688.com/tw/***", the directory "/tw/" in the URL is a directory in the preset traditional page directory, then , The determining module 32 can determine that the received web page request "http://www.1688.com/tw/***" is a traditional Chinese page request.

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

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

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

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

其中,上述第一語言與第二語言的對照表可以從本地檔中載入到本地系統記憶體之中,考慮到web應用的併發請求特徵,這裡需要考慮多使用者同時請求繁體頁面時的性能消耗,因此轉換模組34採用第一語言與第二語言的對照表進行簡繁轉換,另外,考慮系統處理請求時的效率,整個第一語言與第二語言的對照表的載入不使用延遲載入的方式來實現,在轉換模組34啟動時就將第一語言與第二語言的對照表載入到系統記憶體之中。 Among them, the above-mentioned comparison table of the first language and the second language can be loaded from the local file into the local system memory. Considering the concurrent request characteristics of web applications, it is necessary to consider the performance when multiple users request traditional pages at the same time. Therefore, the conversion module 34 uses the comparison table between the first language and the second language to convert from simplified to traditional. In addition, considering the efficiency of the system when processing requests, the loading of the entire comparison table between the first language and the second language does not use delay This is achieved by loading. When the conversion module 34 is activated, 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 compares the page content in the second language acquired by the acquiring module 33 Perform interception and match character by character according to the comparison table of the first language and the second language, so as to complete the conversion of the page content in the second language to the page content in the first language. After the conversion is completed, the output module 35 outputs the first The language of the page content.

上述動態頁面轉換的裝置,接收模組31接收到用戶端發送的網頁請求之後,如果確定模組32確定網頁請求的類型為第一語言的頁面請求,但上述網頁請求所請求訪問的應用伺服器所處的地理位置對應的官方語言為第二語言,則獲取模組33根據上述網頁請求的URL從應用伺服器獲取第二語言的頁面內容,轉換模組34再根據第一語言與第二語言的對照表將獲取的第二語言的頁面內容轉換為第一語言的頁面內容,輸出模組35向上述用戶端輸出第一語言的頁面內容,從而可以實現一次性集中對頁面內容進行轉換,減小對性能的影響,大大節約了人力資源成本和機器成本,並且同時支援同步請求和非同步請求,具有非常高的通用性。 In the above dynamic page conversion device, after the receiving module 31 receives the web page request sent by the client, if the determining module 32 determines that the type of the web page request is a page request in the first language, but the application server requested by the web page request to access If the official language corresponding to the geographic location is the second language, the obtaining module 33 obtains the page content in the second language from the application server according to the URL requested by the above webpage, and the conversion module 34 then obtains the page content in the second language according to the first language and the second language. The comparison table converts the obtained page content in the second language into the page content in the first language, and the output module 35 outputs the page content in the first language to the above-mentioned user terminal, so that the page content can be converted in a centralized manner at one time. The small impact on performance greatly saves human resource costs and machine costs, and supports synchronous and asynchronous requests at the same time, 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 the device for dynamic page conversion of the present invention. Compared with the device for dynamic page conversion shown in FIG. 4, the difference is that in the device for dynamic page conversion shown in FIG. The module 33 may include: a request determination sub-module 331, a generation sub-module 332, and a content acquisition sub-module 333; or, the acquisition module 33 may include: a request determination sub-module 331, a generation sub-module 332, and content acquisition Sub-module 333 and analysis sub-module 334.

本實施例的一種實現方式中,請求確定子模組331,用於根據上述網頁請求的URL的尾碼確定上述網頁請求為同步請求;生成子模組332,用於當請求確定子模組331確定上述網頁請求為同步請求時,根據上述網頁請求的URL生成第二語言的頁面對應的URL;其中,生成子模組332可以根據上述網頁請求的URL,利用預先配置的規則生成第二語言的頁面對應的URL;內容獲取子模組333,用於根據生成子模組332生成的第二語言的頁面對應的URL從應用伺服器獲取第二語言的頁面內容。 In an implementation of this embodiment, the request determination sub-module 331 is used to determine that the web page request is a synchronization request according to the suffix of the URL of the above-mentioned web page request; When it is determined that the web page request is a synchronous request, the URL corresponding to the page in the second language is generated according to the URL of the web page request; wherein, the generation sub-module 332 can generate the web page in the second language according to the URL of the web page request and using pre-configured rules. The URL corresponding to the page; the content acquisition sub-module 333 is used to obtain the page content in the second language from the application server according to the URL corresponding to the page in 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, assuming that the URL of the above web page request is "http://www.1688.com/detail/123456789.html", the request determination submodule 331 can determine that the above web page request is a synchronous request according to the tail code of the URL , And then generate the sub-module 332 according to the URL, using the pre-configured rules to generate the URL "http://detail.1688.com/offer/123456789.html" corresponding to the page in the second language; then the content acquisition sub-module 333 can obtain the content of the page in the second language according to the URL "http://detail.1688.com/offer/123456789.html" corresponding to the page in the second language.

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

舉例來說,假設上述網頁請求的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 web page request is: "http://www.1688.com/tw/rpc.json?orginalUrl=http://detail.1688.com/rpc/12345667.json", then the request The determining sub-module 331 can determine that the web page request is an asynchronous request according to the suffix of the URL. At this time, the parsing sub-module 334 parses the URL and obtains the query string in the URL as "orginalUrl=http://detail" .1688.com/rpc/12345667.json", and then generate the sub-module 332 according to the above query string, using pre-configured rules to generate the URL corresponding to the second language page "http://detail.1688.com/ rpc/12345667.json", and the content acquisition submodule 333 can obtain the page content in the second language according to the URL corresponding to the second language page "http://detail.1688.com/rpc/12345667.json" .

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

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

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

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

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

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

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

上述提到的儲存媒體可以是唯讀記憶體,磁片或光碟等。 The storage medium mentioned above can be a read-only memory, a floppy disk or an optical disc, etc.

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

儘管上面已經示出和描述了本發明的實施例,可以理解的是,上述實施例是示例性的,不能理解為對本發明的限制,本領域的普通技術人員在本發明的範圍內可以對上述實施例進行變化、修改、替換和變型。 Although the embodiments of the present invention have been shown and described above, it can be understood that the above-mentioned embodiments are exemplary and cannot be construed as limiting the present invention. Those of ordinary skill in the art can comment on the above-mentioned embodiments within the scope of the present invention. The embodiment undergoes changes, modifications, substitutions, and modifications.

Claims (10)

一種動態頁面轉換的方法,其特徵在於,包括:代理伺服器接收用戶端發送的網頁請求,確定該網頁請求的類型和該網頁請求所請求訪問的應用伺服器所處的地理位置;如果該網頁請求的類型為第一語言的頁面請求,但該地理位置對應的官方語言為第二語言,則根據該網頁請求的統一資源定位符URL從該應用伺服器獲取該第二語言的頁面內容;該代理伺服器根據該第一語言與該第二語言的對照表將獲取的第二語言的頁面內容轉換為該第一語言的頁面內容,並向該用戶端輸出該第一語言的頁面內容。 A method for dynamic page conversion, which is characterized in that it includes: a proxy server receives a web page request sent by a client, determines the type of the web page request and the geographic location of the application server requested by the web page request; The request type is a page request in the first language, but the official language corresponding to the geographic location is the second language, then the page content in the second language is obtained from the application server according to the uniform resource locator URL of the web page request; The proxy server converts the acquired page content in the second language into the page content in the first language according to the comparison table between the first language and the second language, and outputs the page content in the first language to the client. 根據申請專利範圍第1項所述的方法,其中,該根據該網頁請求的URL從應用伺服器獲取該第二語言的頁面內容包括:根據該網頁請求的URL的尾碼確定該網頁請求為同步請求時,根據該網頁請求的URL生成該第二語言的頁面對應的URL,根據該第二語言的頁面對應的URL從應用伺服器獲取該第二語言的頁面內容。 The method according to item 1 of the scope of patent application, wherein the obtaining the page content in the second language from the application server according to the URL of the web page request includes: determining that the web page request is synchronous according to the tail code of the URL of the web page request Upon request, the URL corresponding to the page in the second language is generated according to the URL requested by the web page, and the page content in the second language is obtained from the application server according to the URL corresponding to the page in the second language. 根據申請專利範圍第1項所述的方法,其中,該根據該網頁請求的URL從應用伺服器獲取該第二語言的頁面內容包括:根據該網頁請求的URL的尾碼確定該網頁請求為非同步請求時,解析該網頁請求的URL,獲得該網頁請求的 URL中的查詢字串;根據該查詢字串生成該第二語言的頁面對應的URL,根據該第二語言的頁面對應的URL從應用伺服器獲取該第二語言的頁面內容。 The method according to item 1 of the scope of patent application, wherein the obtaining the page content in the second language from the application server according to the URL of the web page request includes: determining that the web page request is non-compliant according to the end code of the URL of the web page request When a synchronization request is made, the URL requested by the web page is parsed to obtain the requested URL of the web page The query string in the URL; the URL corresponding to the page in the second language is generated according to the query string, and the page content in the second language is obtained from the application server according to the URL corresponding to the page in the second language. 根據申請專利範圍第1至3項中任意一項所述的方法,其中,該確定該網頁請求的類型包括:根據該網頁請求的URL中的目錄和/或根據該網頁請求的URL的查詢字串中攜帶的參數確定該網頁請求的類型。 The method according to any one of items 1 to 3 in the scope of the patent application, wherein the determining the type of the web page request includes: according to the directory in the URL of the web page request and/or according to the query word of the URL of the web page request The parameters carried in the string determine the type of the web page request. 根據申請專利範圍第1至3項中任意一項所述的方法,其中,該確定該網頁請求的類型之後,還包括:將該網頁請求的類型標注在該網頁請求的上下文中。 The method according to any one of items 1 to 3 in the scope of patent application, wherein after determining the type of the web page request, the method further includes: marking the type of the web page request in the context of the web page request. 一種動態頁面轉換的裝置,該裝置在與用戶端和應用伺服器通信的代理伺服器執行,其中,包括:接收模組,用於接收該用戶端發送的網頁請求;確定模組,用於確定該接收模組接收的網頁請求的類型和該網頁請求所請求訪問的該應用伺服器所處的地理位置;獲取模組,用於當該確定模組確定該網頁請求的類型為第一語言的頁面請求,但該地理位置對應的官方語言為第二語言時,根據該網頁請求的統一資源定位符URL從該應用伺服器獲取該第二語言的頁面內容;轉換模組,用於根據該第一語言與該第二語言的對照表將該獲取模組獲取的第二語言的頁面內容轉換為該第一 語言的頁面內容;輸出模組,用於向該用戶端輸出該轉換模組轉換的該第一語言的頁面內容。 A device for dynamic page conversion, which is executed on a proxy server that communicates with a client and an application server, and includes: a receiving module for receiving a web page request sent by the client; a determining module for determining The type of the web page request received by the receiving module and the geographic location of the application server requested by the web page request; the acquisition module is used when the determining module determines that the type of the web page request is in the first language When the page is requested, but the official language corresponding to the geographic location is the second language, the page content in the second language is obtained from the application server according to the uniform resource locator URL of the web page request; the conversion module is used to obtain the page content in the second language according to the The comparison table between a language and the second language converts the page content of the second language acquired by the acquisition module into the first language Language page content; an output module for outputting the page content in the first language converted by the conversion module to the client. 根據申請專利範圍第6項所述的裝置,其中,該獲取模組包括:請求確定子模組,用於根據該網頁請求的URL的尾碼確定該網頁請求為同步請求;生成子模組,用於當該請求確定子模組確定該網頁請求為同步請求時,根據該網頁請求的URL生成該第二語言的頁面對應的URL;內容獲取子模組,用於根據該生成子模組生成的該第二語言的頁面對應的URL從應用伺服器獲取該第二語言的頁面內容。 The device according to item 6 of the scope of patent application, wherein the acquisition module includes: a request determination sub-module for determining that the web page request is a synchronization request according to the suffix of the URL of the web page request; generating a sub-module, When the request determination sub-module determines that the web page request is a synchronous request, generate the URL corresponding to the page in the second language according to the URL of the web page request; the content acquisition sub-module is used to generate according to the generating sub-module The URL corresponding to the page in the second language obtains the content of the page in the second language from the application server. 根據申請專利範圍第6所述的裝置,其中,該獲取模組包括:請求確定子模組,用於根據該網頁請求的URL的尾碼確定該網頁請求為非同步請求;解析子模組,用於當該請求確定子模組確定該網頁請求為非同步請求時,解析該網頁請求的URL,獲得該網頁請求的URL中的查詢字串;生成子模組,用於根據該解析子模組獲得的查詢字串生成該第二語言的頁面對應的URL;內容獲取子模組,用於根據該生成子模組生成的該第二語言的頁面對應的URL從應用伺服器獲取該第二語言 的頁面內容。 The device according to the sixth of the scope of patent application, wherein the acquisition module includes: a request determination sub-module for determining that the web page request is an asynchronous request according to the suffix of the URL of the web page request; and a parsing sub-module, When the request determination sub-module determines that the web page request is an asynchronous request, parse the URL of the web page request to obtain the query string in the URL of the web page request; generate a sub-module for analyzing the sub-module according to the The query string obtained by the group generates the URL corresponding to the page in the second language; the content acquisition sub-module is used to obtain the second language from the application server according to the URL corresponding to the page in the second language generated by the generating sub-module Language The content of the page. 根據申請專利範圍第6至8項中任意一項所述的裝置,其中,該確定模組,具體用於根據該網頁請求的URL中的目錄和/或根據該網頁請求的URL的查詢字串中攜帶的參數確定該網頁請求的類型。 The device according to any one of items 6 to 8 in the scope of patent application, wherein the determining module is specifically used for searching according to the directory in the URL requested by the webpage and/or according to the query string of the URL requested by the webpage The parameters carried in determine the type of the web page request. 根據申請專利範圍第6至8項中任意一項所述的裝置,其中,還包括:標注模組,用於在該確定模組確定該網頁請求的類型之後,將該網頁請求的類型標注在該網頁請求的上下文中。 The device according to any one of items 6 to 8 in the scope of patent application, further comprising: a marking module for marking the type of the web page request after the determining module determines the type of the web page request In 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.4A CN106156080B (en) 2015-03-31 2015-03-31 The method and apparatus of dynamic page conversion
CN201510149776.4 2015-03-31

Publications (2)

Publication Number Publication Date
TW201635170A TW201635170A (en) 2016-10-01
TWI718993B true 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

Citations (4)

* 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
CN101676904A (en) * 2008-09-19 2010-03-24 中兴通讯股份有限公司 Multilingual method of Web application system and device
CN102651750A (en) * 2011-02-24 2012-08-29 阿里巴巴集团控股有限公司 Method, system and device for providing Web page information

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101945081A (en) * 2009-07-06 2011-01-12 北京易路联动技术有限公司 Code conversion method, system and server of class webpage applications
CN103970751A (en) * 2013-01-28 2014-08-06 鸿富锦精密工业(深圳)有限公司 Multi-language web page converting system and method

Patent Citations (4)

* 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
CN101676904A (en) * 2008-09-19 2010-03-24 中兴通讯股份有限公司 Multilingual method of Web application system and device
CN102651750A (en) * 2011-02-24 2012-08-29 阿里巴巴集团控股有限公司 Method, system and device for providing Web page information

Also Published As

Publication number Publication date
CN106156080A (en) 2016-11-23
TW201635170A (en) 2016-10-01
CN106156080B (en) 2019-06-11

Similar Documents

Publication Publication Date Title
WO2021139127A1 (en) Method and apparatus for running mini program, electronic device, and storage medium
US11086962B2 (en) Webpage loading method, client and server
JP6626211B2 (en) Method and apparatus for processing short link and short link server
WO2017113060A1 (en) Website access method and device, and website system
KR101824222B1 (en) Fast rendering of websites containing dynamic content and stale content
CN109683998B (en) Internationalization realization method, device and system
US20160283461A1 (en) Method and terminal for extracting webpage content, and non-transitory storage medium
WO2018001124A1 (en) Webpage file sending method, webpage rendering method and apparatus, and webpage rendering system
TW201314577A (en) Device of WebKit browser and associated method of loading homepage content
TWI718993B (en) Method and device for dynamic page conversion
WO2016201819A1 (en) Method and apparatus for detecting malicious file
WO2019019361A1 (en) Method and apparatus for processing data of database, computer device, and storage medium
JP2016154006A (en) System and method for searching personal content item
WO2017012234A1 (en) Information acquiring method and apparatus, device, and computer storage medium
US20110145299A1 (en) Offline Gadgets IDE
KR101689745B1 (en) Web browsing system and method for rendering dynamic resource URI of script
WO2015074459A1 (en) Method and apparatus for opening webpage, invoking client, and creating light app
JP2009037501A (en) Information retrieval apparatus, information retrieval method and program
WO2015003664A1 (en) Method, device, server, and client device for download processing
WO2015154682A1 (en) Network request processing method, network server, and network system
CN110704721A (en) Client data processing method and device, terminal equipment and readable storage medium
CN103914479A (en) Resource request matching method and device
WO2019024520A1 (en) Page presentation method, electronic device and non-volatile computer readable storage medium
RU2603535C2 (en) METHOD AND SYSTEM FOR USING A Web-BROWSER
WO2017008654A1 (en) Deserialization method and apparatus