WO2020253389A1 - Page translation method and apparatus, medium, and electronic device - Google Patents

Page translation method and apparatus, medium, and electronic device Download PDF

Info

Publication number
WO2020253389A1
WO2020253389A1 PCT/CN2020/087473 CN2020087473W WO2020253389A1 WO 2020253389 A1 WO2020253389 A1 WO 2020253389A1 CN 2020087473 W CN2020087473 W CN 2020087473W WO 2020253389 A1 WO2020253389 A1 WO 2020253389A1
Authority
WO
WIPO (PCT)
Prior art keywords
page
country
target
language type
target terminal
Prior art date
Application number
PCT/CN2020/087473
Other languages
French (fr)
Chinese (zh)
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 WO2020253389A1 publication Critical patent/WO2020253389A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • G06F9/454Multi-language systems; Localisation; Internationalisation

Definitions

  • This application relates to the technical field of natural language processing, in particular to a page translation method, device, medium and electronic equipment.
  • the purpose of this application is to provide a page translation method, device, medium and electronic equipment.
  • a page translation method includes:
  • a page translation device which includes:
  • the obtaining module is configured to receive and respond to the user's request to access the webpage, and obtain the IP address of the target terminal that sends the user's request to access the webpage;
  • the determining module is configured to determine the country to which the target terminal belongs according to the IP address of the target terminal, and to determine the language type in the webpage according to the country to which the target terminal belongs;
  • the sending module is configured to obtain a target page corresponding to the language type in the web page according to the language type in the web page, and send the target page to the target terminal, so that the target terminal displays the target page.
  • a computer-readable storage medium which stores computer program instructions, and when the computer program instructions are executed by a computer, the computer executes the aforementioned method.
  • an electronic device including:
  • a memory where computer-readable instructions are stored, and when the computer-readable instructions are executed by the processor, the method as described above is implemented.
  • the page translation method provided in this application identifies the language type suitable for the user to browse based on the IP address sending the access request when the user visits the page of the website, and then sends the target page corresponding to the language type to the target terminal, so that The language of the content in the page that the user browses directly is more likely to be the language that the user is accustomed to using, thereby improving the efficiency of the user in obtaining the information on the page and at the same time improving the user experience.
  • Fig. 1 is a schematic diagram showing a system architecture of a page translation method according to an exemplary embodiment
  • Fig. 2 is a flow chart showing a method for page translation according to an exemplary embodiment
  • FIG. 3 is a flowchart of steps after step 230 of an embodiment according to the embodiment corresponding to FIG. 2;
  • FIG. 5 is a flowchart of a predetermined rule according to an embodiment shown in the embodiment corresponding to FIG. 4
  • Fig. 6 is a block diagram showing a device for page translation according to an exemplary embodiment
  • Fig. 7 is a block diagram showing an example of an electronic device implementing the above-mentioned page translation method according to an exemplary embodiment
  • Fig. 8 shows a computer-readable storage medium for implementing the above-mentioned page translation method according to an exemplary embodiment.
  • a page refers to a file that can record text, pictures, video, audio, and other content on the World Wide Web. It can also include code written in at least one language.
  • client When the file is read and parsed by a browser, client, or App (Application, application), the page presented by the display unit on the terminal running the browser, client or App is the page.
  • Common pages can be Web pages or HTML5 pages.
  • the object applied by the page translation method provided in this application can be a static page or a dynamic page.
  • page translation refers to the conversion of a web page file containing text recorded in one language originally sent to the page requesting terminal into another The process of recording the text content of a web page file in two languages.
  • the implementation terminal of this application can be any device with computing and processing functions.
  • the device can also be connected to an external device for data transmission.
  • It can be a portable mobile device, such as a smart phone, a tablet computer, a notebook computer, a PDA (Personal Digital Assistant), etc., can also be fixed devices, such as computer equipment, field terminals, desktop computers, servers, workstations, etc., or a collection of multiple devices, such as the physical infrastructure of cloud computing.
  • Fig. 1 is a schematic diagram showing a system architecture of a page translation method according to an exemplary embodiment. As shown in Figure 1, it includes a database 110, a server 120, and a user terminal 130.
  • the server 120 is the implementation terminal of the application.
  • the server 120 and the database 110 are connected through a communication link, so that the server 120 can perform access operations on the data stored in the database 110.
  • the database 110 stores webpage files pre-installed therein.
  • the user terminal 130 can communicate with the server 120 sends a network request, and the server 120 returns a corresponding response to the user terminal 130 according to the received network request.
  • the server 120 processes the network request, obtains the web page file required by the network request, and then obtains the web page file required by the network request. 110 obtains the web page file and returns it to the user terminal 130.
  • Applications running on the user terminal 130 such as browsers, clients with web page parsing functions, etc., can read the web page file and render it into a visual page. The page can then be displayed to the user through the display unit of the user terminal 130, where the architecture between the server 120 and the user terminal 130 can be a C/S architecture, that is, a Client/Server (client/server) architecture, or B/S architecture, that is, Browser/Server (browser/server) architecture.
  • the web page browsing service is often provided by the server 120 for different countries and regions at the same time. Therefore, the user terminals accessing the server 120 are often located in different countries and regions, and used by users in different countries and regions.
  • the language of is often different, so it is necessary to perform page translation for access requests sent by users in different countries and regions, and when one or more embodiments of this application are applied to the scenario of this embodiment, it can be completed Translation of the page.
  • Fig. 1 is only an embodiment of the present application, although in the embodiment shown in Fig. 1, the webpage file is stored in a database connected to the implementation terminal of this application.
  • the implementation terminal of this application is Servers and user terminals are desktop computers, but in actual applications, webpage files are stored in various locations, such as local storage space.
  • the implementation terminal of this application can be the above-mentioned various devices, and the user terminal It can also be various terminal devices, for example, the user terminal can also be a smart phone. Therefore, this application does not make any limitation on this, and the protection scope of this application should not be restricted in any way.
  • Fig. 2 is a flow chart showing a method for page translation according to an exemplary embodiment. As shown in Figure 2, it includes the following steps:
  • Step 210 Receive and respond to the user's request for accessing the webpage, and obtain the IP address of the target terminal that sends the user's request for accessing the webpage.
  • the request of the user to access the webpage may be a request based on various network protocols, for example, it may be a request under the HTTP protocol, and the target terminal is the terminal that sends the user's request for accessing the webpage.
  • the request to access a webpage is sent by the user using his terminal. Therefore, the request of the user to access the webpage is essentially a request from the user’s terminal. The two are the same in actual situations.
  • the user’s request to access the web page is used for description.
  • the implementation terminal of this application has a log that can record the IP address of each terminal that sends a request to access a webpage to the local end, and by reading the log, the target terminal that sends the user's request to access the webpage is obtained IP address.
  • the user's request to access the webpage is a request established based on the HTTP protocol, and the header of the request message records the IP address of the target terminal that sends the user's request to access the webpage.
  • the implementation terminal of this application reads Take the header of the request message to obtain the IP address of the target terminal.
  • Step 220 Determine the country to which the target terminal belongs according to the IP address of the target terminal, and determine the language type in the webpage according to the country to which the target terminal belongs.
  • the language type in the web page is the language type in the target page to be sent to the target terminal.
  • the country correspondence table of IP address ranges and IP addresses is preset. By querying the table, the IP address range of the target terminal is determined, and then the IP address range determined is compared with the determined IP address range. The corresponding country is the country to which the determined target terminal belongs.
  • an API Application Programming Interface
  • IP address is called to determine the country to which the target terminal belongs.
  • a database storing typical IP addresses of each country is preset, and a typical IP address that matches the IP address of the target terminal is obtained by using regular expression matching, and then the matched IP address The country corresponding to the typical IP address is used as the country to which the determined target terminal belongs.
  • a country-language type correspondence table is preset, and the language type corresponding to the country to which the target terminal belongs is obtained by querying the table, so as to complete the determination of the web page according to the country to which the target terminal belongs Language type.
  • a name can uniquely determine the type of a language, and the language type is the name of the language. For example, any one of Chinese, English, French, Russian, Italian, etc. is a language type. Each country corresponds to a language type. For example, the language type corresponding to China is Chinese, the language type corresponding to France is French, and the language type corresponding to Germany is German.
  • the language type in the webpage is obtained by calling an API that can query the corresponding language type according to the country.
  • Step 230 Obtain a target page corresponding to the language type in the web page according to the language type in the web page, and send the target page to the target terminal, so that the target terminal displays the target page.
  • the target page is the page to be displayed to the user, so the target page is a page that contains information content that is consistent with the content of the page targeted by the user's request to access the webpage, and the webpage type is the language type of the webpage.
  • a corresponding page of each language type is created for the content in the page in advance, and the page with the same language type as the language type in the web page is first obtained, and then after obtaining The page whose content is consistent with the page targeted by the user's request to access the webpage is determined from the page as the target page, and the target page is sent to the target terminal.
  • the advantage of this embodiment is that since the pages of each language type are created in advance, the translation quality of the content in the pages of different language types can be controlled, thereby improving user experience.
  • the corresponding pages of each language type created in advance for the content in the page are performed by manual translation and input.
  • the specific steps of determining the page whose content is consistent with the page targeted by the user's request for accessing the webpage from the obtained pages as the target page may include:
  • a page containing all the extracted keywords is acquired from the acquired pages as a target page.
  • a corresponding page of each language type is created in advance for the content in the page and stored in a preset storage space.
  • the user's request for accessing the web page is aimed at Pages need to be obtained from the preset storage space, where, in the preset storage space, pages corresponding to each language type of the same page content are grouped into a group, and obtained according to the language type in the webpage
  • the target page corresponding to the language type in the webpage specifically includes:
  • obtaining the target page corresponding to the language type of the webpage according to the language type of the webpage specifically includes:
  • the content in the page targeted by the user's request to access the webpage is correspondingly translated into the language type of the webpage.
  • the translation script statement may include a statement calling the translation API.
  • obtaining the target page corresponding to the language type of the webpage according to the language type of the webpage specifically includes:
  • the translated content replaces the content in the page file targeted by the user's request to access the web page according to the corresponding relationship during translation, so as to obtain a target page corresponding to the language type of the web page.
  • the advantage of this embodiment is that since the translation is performed automatically and there is no need to prepare a large number of page files of different language types in advance, it saves the pre-work flow and saves the consumption of storage resources.
  • step 230 the following steps may be further included:
  • Identify the language type of the text information to be analyzed and obtain the page to be displayed that is consistent with the language type of the text information to be analyzed and the content of the target page according to the language type of the text information to be analyzed, and obtains Sending the page to be displayed to the target terminal, so that the target terminal displays the page to be displayed; or
  • Identify the language type of the text information to be analyzed and render the information in the target page into information consistent with the language type of the text information to be analyzed according to the language type of the text information to be analyzed.
  • the page to be displayed is a page waiting to be sent to the target terminal where the user is located, and the content of the page to be displayed is the same as the content of the target page.
  • the method for the local terminal to obtain the text information to be analyzed input by the user in the target page may be: using the form in the target page to receive the text information to be analyzed input by the user.
  • the target page may include a control for receiving the text information to be analyzed input by the user, and obtain the text information to be analyzed input by the user through the control.
  • the control can be a text box.
  • a corresponding dictionary library is established for each language type in advance, and the identifying the language type of the text information to be analyzed includes: traversing each dictionary library to determine the The dictionary library where the text is located; the language type corresponding to the determined dictionary library is taken as the language type of the text information to be analyzed.
  • the step of rendering the information in the target page into information consistent with the language type of the text information to be analyzed according to the language type of the text information to be analyzed can be specifically implemented in the following manner:
  • the corresponding rendering is the information consistent with the language type of the text information to be analyzed.
  • the advantage of the foregoing embodiment provided for the steps after step 230 is that it takes into account the inaccuracy of the language type determined based on the IP address and the inconsistency between the language used by the user and the general language of the user’s area, etc., by analyzing the user’s active input
  • the text information to be analyzed can further provide users with more accurate target pages, thereby improving user experience.
  • the language type suitable for the user's browsing is identified according to the IP address that sends the access request, and then the language type corresponding to the language type is identified
  • the target page is sent to the target terminal, so that the language of the content in the page that the user browses directly to is more likely to be the language that the user is accustomed to using, thereby improving the efficiency of the user in obtaining the information on the page and improving the user experience.
  • FIG. 3 is a flowchart of steps after step 230 of an embodiment shown according to the embodiment corresponding to FIG. 2.
  • the preset web page page library stores pages corresponding to multiple language types, and for the content of each page in the preset web page page library, the preset web page page library stores all pages corresponding to the The number of pages of multiple language types corresponding to the content of the page is the same as the number of the pages corresponding to the content of any page, as shown in FIG. 3, including the following steps:
  • Step 240 Obtain the voice information to be analyzed uploaded by the user through the target page.
  • the terminal from which the user sends a webpage access request that is, the target terminal has a voice input unit
  • the user's voice can be recorded and uploaded to the local terminal through the voice input unit on the user's target terminal.
  • the voice input unit may be a microphone, a microphone, or the like.
  • the user can trigger and control the voice input unit of the target terminal to start voice recording through a control located on the target page, and can also initiate an action of uploading voice information to be analyzed through the control.
  • Step 250 Identify the language type of the voice information to be analyzed.
  • a phoneme library corresponding to each language type is preset, and the identifying the language type of the speech information to be analyzed specifically includes: segmenting the speech information to be analyzed into phonemes; A phoneme library containing all the segmented phonemes is obtained from the phoneme library corresponding to the type; the language type corresponding to the phoneme library is determined as the language type of the voice information to be analyzed.
  • Step 260 When there is a page to be displayed that is consistent with the language type of the voice information to be analyzed and the content of the target page exists in the preset web page library, it will be consistent with the language type of the voice information to be analyzed and is consistent with The page to be displayed with the same content of the target page is sent to the target terminal, so that the target terminal displays the page to be displayed.
  • Step 270 When there is no page to be displayed in the preset web page library that is consistent with the language type of the voice information to be analyzed and the content of the target page is the same, render the information in the target page as Information of the same language type of the voice information to be analyzed.
  • FIG. 4 is a detailed flowchart of step 220 of an embodiment shown according to the embodiment corresponding to FIG. 2. As shown in FIG. 4, step 220 specifically includes:
  • step 220' when the country to which the target terminal belongs cannot be determined according to the IP address of the target terminal, determine the language type in the web page according to a predetermined rule.
  • the predetermined rule includes: obtaining a preset language type as the language type in the webpage.
  • the preset language type can be Chinese, English, French, etc.
  • the predetermined rule includes: acquiring the IP address of the local terminal; determining the country to which the local terminal belongs according to the IP address of the local terminal; acquiring the language type corresponding to the determined country.
  • the advantage of this embodiment is that How to determine the language type in the webpage provides a solution to ensure the user experience when the country to which the target terminal belongs cannot be determined according to the IP address of the target terminal.
  • Fig. 5 is a flowchart of a predetermined rule according to an embodiment shown in the embodiment corresponding to Fig. 4. As shown in Figure 5, it includes the following steps:
  • Step 510 Obtain the country to which the IP addresses of all the senders that sent the access request within a predetermined time period before the current time belong.
  • the predetermined time period is any time period, such as one day, one week, one month, one year, etc.
  • the local end includes a log system
  • the log in the log system records the country to which the IP addresses of all senders that send access requests belong to. By reading the log in the log system, the log of the request sent The country to which the IP addresses of all senders belong.
  • the country to which the IP address of each sender that sends the access request belongs and the corresponding time when the sender sends the access request are stored in a database correspondingly, and by querying the database, a predetermined time period before the current time is obtained.
  • Step 520 For each country, obtain the number of IP addresses belonging to the country from the IP addresses of all the senders that send the access request within the predetermined time period.
  • a counter is embedded in the local end, and the number of IP addresses belonging to each country can be counted by using the counter. Specifically, for each country, whenever the counter recognizes that an IP address belongs to that country, the counter is incremented by 1 until it can no longer recognize that an IP address belongs to the country. At this time, the number counted by the counter belongs to that country. The number of IP addresses in the country.
  • Step 530 Obtain the target country based on the number.
  • step 530 includes: obtaining the country with the largest number as the target country.
  • step 530 specifically includes:
  • the scoring correction method refers to a method of calculating the sequence number of each country to obtain the score of the country.
  • the score correction method set in advance for the local time is within the peak visit time period can be: multiply the ranking sequence number by 0.9, correspondingly, the score correction method set accordingly in advance for the local time is not within the peak visit time period can be Is: Multiply the sort number by 1.1.
  • the corresponding scoring correction method set in advance for the local time is within the peak visit time period is to use the following formula to correct the sequence number of each country:
  • x is the serial number of each country
  • y is the score of the country obtained by the amendment
  • the scoring correction method set in advance for the local time is not within the peak visit time period is to use the following formula to correct the serial number of each country:
  • the score correction method The essence of is to increase the gap between the country’s scores based on the ranking sequence number between the countries whose local time is within the peak visit time period and the countries whose local time is not within the peak visit time period, so that the score of the obtained country is more
  • the score correction method can be arbitrary, as long as the local time is within the peak visit time period and the local time is not within the peak visit time period between the countries based on the ranking sequence number. Therefore, one of the corresponding scoring correction methods set in advance to determine whether the local time is within the peak visit time period can also be to keep the country’s ranking number unchanged.
  • the specific manner of sorting the countries according to the acquired number from largest to smallest is to use a bubble sorting algorithm to sort the countries according to the acquired number from largest to smallest.
  • the predetermined period of time is a first predetermined period of time
  • the number is a first number
  • the obtaining of the target country based on the number includes: obtaining the current time before the second predetermined period of time The country to which the IP addresses of all senders of the access request belong, the second predetermined time period is less than the first predetermined time period; for each country, the IP addresses of all senders that send the access request within the second predetermined time period Acquire the number of IP addresses belonging to the country as the second number; acquire the target country based on the first number and the second number.
  • obtaining the target country based on the first number and the second number includes: for each country, respectively obtaining the weight of the first number and the second number; for each country, using the weight Determine the weighted sum of the first number and the second number acquired for the country; acquire the country with the largest weighted sum as the target country.
  • the advantage of this embodiment is that the two factors of the first number and the second number are combined to obtain the target country, which improves the accuracy of the obtained target country, thereby improving the accuracy of the language type in the finally determined webpage. .
  • This application also provides a page translation device.
  • the following are device embodiments of the application.
  • Fig. 6 is a block diagram showing a device for page translation according to an exemplary embodiment. As shown in FIG. 6, the apparatus 600 includes:
  • the obtaining module 610 is configured to receive and respond to a user's request for accessing a webpage, and obtain the IP address of the target terminal that sends the user's request for accessing the webpage.
  • the determining module 620 is configured to determine the country to which the target terminal belongs according to the IP address of the target terminal, and to determine the language type in the webpage according to the country to which the target terminal belongs.
  • the sending module 630 is configured to obtain a target page corresponding to the language type of the webpage according to the language type of the webpage, and send the target page to the target terminal, so that the target terminal displays the target page.
  • an electronic device capable of implementing the above method is also provided.
  • the electronic device 700 according to this embodiment of the present application will be described below with reference to FIG. 7.
  • the electronic device 700 shown in FIG. 7 is only an example, and should not bring any limitation to the function and use scope of the embodiments of the present application.
  • the electronic device 700 is represented in the form of a general-purpose computing device.
  • the components of the electronic device 700 may include, but are not limited to: the aforementioned at least one processing unit 710, the aforementioned at least one storage unit 720, and a bus 730 connecting different system components (including the storage unit 720 and the processing unit 710).
  • the storage unit stores program code, and the program code can be executed by the processing unit 710, so that the processing unit 710 executes the various exemplary methods described in the "Embodiment Method" section of this specification. Implementation steps.
  • the storage unit 720 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 721 and/or a cache storage unit 722, and may further include a read-only storage unit (ROM) 723.
  • RAM random access storage unit
  • ROM read-only storage unit
  • the storage unit 720 may also include a program/utility tool 724 having a set of (at least one) program module 725.
  • program module 725 includes but is not limited to: an operating system, one or more application programs, other program modules, and program data, Each of these examples or some combination may include the implementation of a network environment.
  • the bus 730 may represent one or more of several types of bus structures, including a storage unit bus or a storage unit controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local area using any bus structure among multiple bus structures. bus.
  • the electronic device 700 can also communicate with one or more external devices 900 (such as keyboards, pointing devices, Bluetooth devices, etc.), and can also communicate with one or more devices that enable users to interact with the electronic device 700, and/or communicate with Any device (such as a router, modem, etc.) that enables the electronic device 700 to communicate with one or more other computing devices. This communication can be performed through an input/output (I/O) interface 750.
  • the electronic device 700 may also communicate with one or more networks (for example, a local area network (LAN), a wide area network (WAN), and/or a public network, such as the Internet) through the network adapter 760. As shown in the figure, the network adapter 760 communicates with other modules of the electronic device 700 through the bus 730.
  • LAN local area network
  • WAN wide area network
  • public network such as the Internet
  • the exemplary embodiments described herein can be implemented by software, or can be implemented by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (can be a CD-ROM, U disk, mobile hard disk, etc.) or on the network , Including several instructions to make a computing device (which may be a personal computer, server, terminal device, or network device, etc.) execute the method according to the embodiment of the present application.
  • a non-volatile storage medium can be a CD-ROM, U disk, mobile hard disk, etc.
  • Including several instructions to make a computing device which may be a personal computer, server, terminal device, or network device, etc.
  • a computer-readable storage medium on which is stored a program product capable of implementing the above method of this specification.
  • the computer-readable storage medium may be non-volatile or volatile.
  • each aspect of the present application can also be implemented in the form of a program product, which includes program code.
  • the program product runs on a terminal device, the program code is used to make the The terminal device executes the steps according to various exemplary embodiments of the present application described in the above-mentioned "Exemplary Method" section of this specification.
  • a program product 800 for implementing the above method according to an embodiment of the present application is described. It can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be stored in a terminal device, For example, running on a personal computer.
  • CD-ROM compact disk read-only memory
  • the program product of this application is not limited to this.
  • the readable storage medium can be any tangible medium that contains or stores a program, and the program can be used by or combined with an instruction execution system, device, or device.
  • the program product can use any combination of one or more readable media.
  • the readable medium may be a readable signal medium or a readable storage medium.
  • the readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or a combination of any of the above. More specific examples (non-exhaustive list) of readable storage media include: electrical connections with one or more wires, portable disks, hard disks, random access memory (RAM), read only memory (ROM), erasable Type programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • the computer-readable signal medium may include a data signal propagated in baseband or as a part of a carrier wave, and readable program code is carried therein. This propagated data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • the readable signal medium may also be any readable medium other than a readable storage medium, and the readable medium may send, propagate, or transmit a program for use by or in combination with the instruction execution system, apparatus, or device.
  • the program code contained on the readable medium can be transmitted by any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
  • the program code used to perform the operations of this application can be written in any combination of one or more programming languages.
  • the programming languages include object-oriented programming languages—such as Java, C++, etc., as well as conventional procedural Programming language-such as "C" language or similar programming language.
  • the program code can be executed entirely on the user's computing device, partly on the user's device, executed as an independent software package, partly on the user's computing device and partly executed on the remote computing device, or entirely on the remote computing device or server Executed on.
  • the remote computing device can be connected to a user computing device through any kind of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using Internet service providers) Business to connect via the Internet).
  • LAN local area network
  • WAN wide area network
  • Internet service providers Internet service providers

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Human Computer Interaction (AREA)
  • Data Mining & Analysis (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

(FIG. 2) The present application relates to the field of natural language processing, and discloses a page translation method and apparatus, a medium, and an electronic device. The method comprises: receiving and responding to a request of a user visiting a webpage, and obtaining an IP address of a target terminal that sends the request of the user visiting the webpage; according to the IP address of the target terminal, determining a country to which the target terminal belongs, and determining a language type in the webpage according to the country to which the target terminal belongs; and according to the language type in the webpage, obtaining a target page corresponding to the language type in the webpage, and sending the target page to the target terminal so that the target terminal displays the target page. In the foregoing method, when a user visits a website page, a language type suitable for the user to browse in is automatically identified, and then a page corresponding to the language type is sent to the target terminal, so that the language of content in the page directly browsed by the user better matches user usage habits, thereby improving the efficiency with which the user obtains information and the user experience.

Description

页面转译方法、装置、介质及电子设备Page translation method, device, medium and electronic equipment
本申请要求于2019年6月19日提交中国专利局、申请号为201910533712.2,发明名称为“页面转译方法、装置、介质及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on June 19, 2019, the application number is 201910533712.2, and the invention title is "page translation method, device, medium and electronic equipment", the entire content of which is incorporated by reference In this application.
技术领域Technical field
本申请涉及自然语言处理技术领域,特别涉及一种页面转译方法、装置、介质及电子设备。This application relates to the technical field of natural language processing, in particular to a page translation method, device, medium and electronic equipment.
背景技术Background technique
随着经济全球化进程的进一步推进以及互联网的高速发展,国际交往日益频繁和便利,地球已经成为一个地球村,越来越多的同时为多个国家的用户服务的国际站点正在紧锣密鼓的建设中。发明人意识到,由于网站需要同时为不同国家的用户服务,而不同国家的用户使用的语言往往是不同的,因此网站页面在不同语言下的转译已经成为了网站建设中亟需解决的重要问题之一。With the further advancement of economic globalization and the rapid development of the Internet, international communication has become increasingly frequent and convenient. The earth has become a global village, and more and more international sites serving users in multiple countries are under construction. The inventor realized that because the website needs to serve users in different countries at the same time, and users in different countries often use different languages, the translation of website pages in different languages has become an important problem that needs to be solved in website construction. one.
发明内容Summary of the invention
在自然语言处理技术领域,为了解决上述技术问题,本申请的目的在于提供一种页面转译方法、装置、介质及电子设备。In the field of natural language processing technology, in order to solve the above technical problems, the purpose of this application is to provide a page translation method, device, medium and electronic equipment.
根据本申请的一方面,提供了一种页面转译方法,所述方法包括:According to an aspect of the present application, a page translation method is provided, the method includes:
接收并响应用户访问网页的请求,获取发送用户访问网页的请求的目标终端的IP地址;Receive and respond to the user's request to access the webpage, and obtain the IP address of the target terminal that sends the user's request for the webpage;
根据目标终端的IP地址确定目标终端所属的国家,并根据所述目标终端所属的国家确定网页中的语言类型;Determine the country to which the target terminal belongs according to the IP address of the target terminal, and determine the language type in the webpage according to the country to which the target terminal belongs;
根据网页中的语言类型获取与所述网页中的语言类型对应的目标页面,并将所述目标页面向目标终端发送,以使所述目标终端展示所述目标页面。Obtain a target page corresponding to the language type in the web page according to the language type in the web page, and send the target page to the target terminal, so that the target terminal displays the target page.
根据本申请的另一方面,提供了一种页面转译装置,所述装置包括:According to another aspect of the present application, there is provided a page translation device, which includes:
获取模块,被配置为接收并响应用户访问网页的请求,获取发送用户访问网页的请求的目标终端的IP地址;The obtaining module is configured to receive and respond to the user's request to access the webpage, and obtain the IP address of the target terminal that sends the user's request to access the webpage;
确定模块,被配置为根据目标终端的IP地址确定目标终端所属的国家,并根据所述目标终端所属的国家确定网页中的语言类型;The determining module is configured to determine the country to which the target terminal belongs according to the IP address of the target terminal, and to determine the language type in the webpage according to the country to which the target terminal belongs;
发送模块,被配置为根据网页中的语言类型获取与所述网页中的语言类型对应的目标页面,并将所述目标页面向目标终端发送,以使所述目标终端展示所述目标页面。The sending module is configured to obtain a target page corresponding to the language type in the web page according to the language type in the web page, and send the target page to the target terminal, so that the target terminal displays the target page.
根据本申请的另一方面,提供了一种计算机可读存储介质,其存储有计算机程序指令,当所述计算机程序指令被计算机执行时,使计算机执行如前所述的方法。According to another aspect of the present application, a computer-readable storage medium is provided, which stores computer program instructions, and when the computer program instructions are executed by a computer, the computer executes the aforementioned method.
根据本申请的另一方面,提供了一种电子设备,所述电子设备包括:According to another aspect of the present application, there is provided an electronic device, the electronic device including:
处理器;processor;
存储器,所述存储器上存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,实现如前所述的方法。A memory, where computer-readable instructions are stored, and when the computer-readable instructions are executed by the processor, the method as described above is implemented.
本申请所提供的页面转译方法,通过在用户访问网站的页面时,根据发送访问请求的IP地址识别出适合用户浏览的语言类型,然后将与该语言类型对应的目标页面发送到目标终端,使得用户直接浏览到的页面中内容的语言更可能是用户习惯使用的语言,从而提高了用户获 取页面中信息的效率,同时提高了用户体验。The page translation method provided in this application identifies the language type suitable for the user to browse based on the IP address sending the access request when the user visits the page of the website, and then sends the target page corresponding to the language type to the target terminal, so that The language of the content in the page that the user browses directly is more likely to be the language that the user is accustomed to using, thereby improving the efficiency of the user in obtaining the information on the page and at the same time improving the user experience.
附图说明Description of the drawings
图1是根据一示例性实施例示出的一种页面转译方法的系统构架示意图;Fig. 1 is a schematic diagram showing a system architecture of a page translation method according to an exemplary embodiment;
图2是根据一示例性实施例示出的一种页面转译方法的流程图;Fig. 2 is a flow chart showing a method for page translation according to an exemplary embodiment;
图3是根据图2对应实施例示出的一实施例的步骤230之后步骤的流程图;FIG. 3 is a flowchart of steps after step 230 of an embodiment according to the embodiment corresponding to FIG. 2;
图4是根据图2对应实施例示出的一实施例的步骤220的细节流程图;4 is a detailed flowchart of step 220 of an embodiment shown according to the embodiment corresponding to FIG. 2;
图5是根据图4对应实施例示出的一实施例的预定规则的流程图FIG. 5 is a flowchart of a predetermined rule according to an embodiment shown in the embodiment corresponding to FIG. 4
图6是根据一示例性实施例示出的一种页面转译装置的框图;Fig. 6 is a block diagram showing a device for page translation according to an exemplary embodiment;
图7是根据一示例性实施例示出的一种实现上述页面转译方法的电子设备示例框图;Fig. 7 is a block diagram showing an example of an electronic device implementing the above-mentioned page translation method according to an exemplary embodiment;
图8是根据一示例性实施例示出的一种实现上述页面转译方法的计算机可读存储介质。Fig. 8 shows a computer-readable storage medium for implementing the above-mentioned page translation method according to an exemplary embodiment.
具体实施方式Detailed ways
本申请首先提供了一种页面转译方法。页面是指在万维网上能够记录文字、图片、视频、音频以及其他内容的一种文件,其中,还可以包括基于至少一种语言编写的代码。当该文件被浏览器、客户端或者App(Application,应用程序)读取并解析时,在运行该浏览器、客户端或者App的终端上通过显示单元呈现出来的即为页面。常见的页面可以是Web页面或者Html5页面。本申请提供的页面转译方法施加的对象可以是静态页面,也可以是动态页面。应当理解,页面中的文字一般都利用一种特定的语言来编写的,所以页面转译是指将本来向页面请求方终端发送的包含由一种语言记录的文字内容的网页文件转换为由另一种语言记录的文字内容的网页文件的过程。This application first provides a page translation method. A page refers to a file that can record text, pictures, video, audio, and other content on the World Wide Web. It can also include code written in at least one language. When the file is read and parsed by a browser, client, or App (Application, application), the page presented by the display unit on the terminal running the browser, client or App is the page. Common pages can be Web pages or HTML5 pages. The object applied by the page translation method provided in this application can be a static page or a dynamic page. It should be understood that the text on the page is generally written in a specific language, so page translation refers to the conversion of a web page file containing text recorded in one language originally sent to the page requesting terminal into another The process of recording the text content of a web page file in two languages.
本申请的实施终端可以是任何具有运算和处理功能的设备,该设备还可以与外部设备相连,用于传输数据,其可以是便携移动设备,例如智能手机、平板电脑、笔记本电脑、PDA(Personal Digital Assistant)等,也可以是固定式设备,例如,计算机设备、现场终端、台式电脑、服务器、工作站等,还可以是多个设备的集合,比如云计算的物理基础设施。The implementation terminal of this application can be any device with computing and processing functions. The device can also be connected to an external device for data transmission. It can be a portable mobile device, such as a smart phone, a tablet computer, a notebook computer, a PDA (Personal Digital Assistant), etc., can also be fixed devices, such as computer equipment, field terminals, desktop computers, servers, workstations, etc., or a collection of multiple devices, such as the physical infrastructure of cloud computing.
图1是根据一示例性实施例示出的一种页面转译方法的系统构架示意图。如图1所示,包括数据库110、服务器120以及用户终端130,其中,在本实施例中服务器120是本申请的实施终端,服务器120与数据库110之间通过通信链路进行连接,从而使服务器120可以对数据库110中存储的数据进行存取操作,数据库110中存储着预先置于其中的网页文件,服务器120与用户终端130之间也存在着通信链路的连接,用户终端130可以向服务器120发送网络请求,服务器120会根据接收到的该网络请求向用户终端130返回相应的响应,具体可以为:服务器120对该网络请求进行处理,获得该网络请求所需要的网页文件,然后从数据库110获取该网页文件并向用户终端130返回,用户终端130上运行的应用程序,比如浏览器、具有网页解析功能的客户端等都可以读取该网页文件并将其渲染成视觉上的页面,然后可以通过用户终端130的显示单元向用户展示出该页面,其中,服务器120与用户终端130之间的架构可以是C/S架构,即Client/Server(客户端/服务器)架构,也可以是B/S架构,即Browser/Server(浏览器/服务器)架构。在传统方法下,网络页面浏览服务往往是需要由服务器120同时为不同的国家和地区提供的,因此,访问服务器120的用户终端,也经常位于不同的国家和地区,不同国家和地区的用户使用的语言往往是不同的,所以有必要针对不同国家和地区的用户发来的访问请求进行页面转译,而当本申请的一个或多个实施例应用到本实施例的场景下时,即可完成对页面的转译工作。Fig. 1 is a schematic diagram showing a system architecture of a page translation method according to an exemplary embodiment. As shown in Figure 1, it includes a database 110, a server 120, and a user terminal 130. In this embodiment, the server 120 is the implementation terminal of the application. The server 120 and the database 110 are connected through a communication link, so that the server 120 can perform access operations on the data stored in the database 110. The database 110 stores webpage files pre-installed therein. There is also a communication link connection between the server 120 and the user terminal 130. The user terminal 130 can communicate with the server 120 sends a network request, and the server 120 returns a corresponding response to the user terminal 130 according to the received network request. Specifically, the server 120 processes the network request, obtains the web page file required by the network request, and then obtains the web page file required by the network request. 110 obtains the web page file and returns it to the user terminal 130. Applications running on the user terminal 130, such as browsers, clients with web page parsing functions, etc., can read the web page file and render it into a visual page. The page can then be displayed to the user through the display unit of the user terminal 130, where the architecture between the server 120 and the user terminal 130 can be a C/S architecture, that is, a Client/Server (client/server) architecture, or B/S architecture, that is, Browser/Server (browser/server) architecture. Under the traditional method, the web page browsing service is often provided by the server 120 for different countries and regions at the same time. Therefore, the user terminals accessing the server 120 are often located in different countries and regions, and used by users in different countries and regions. The language of is often different, so it is necessary to perform page translation for access requests sent by users in different countries and regions, and when one or more embodiments of this application are applied to the scenario of this embodiment, it can be completed Translation of the page.
值得一提的是,图1仅是本申请的一个实施例,虽然在图1示出的实施例中,网页文件存储于与本申请的实施终端连接的数据库之中、本申请的实施终端为服务器、并且用户终端为台式电脑,但在实际应用中,网页文件存储于各种位置,比如可以是本地存储空间,同时本申请的实施终端可以是上述的各种各样的设备,而用户终端也可以是各种终端设备,比如用户终端还可以是智能手机。因此本申请对此不作任何限定,本申请的保护范围也不应因此而受到任何限制。It is worth mentioning that Fig. 1 is only an embodiment of the present application, although in the embodiment shown in Fig. 1, the webpage file is stored in a database connected to the implementation terminal of this application. The implementation terminal of this application is Servers and user terminals are desktop computers, but in actual applications, webpage files are stored in various locations, such as local storage space. At the same time, the implementation terminal of this application can be the above-mentioned various devices, and the user terminal It can also be various terminal devices, for example, the user terminal can also be a smart phone. Therefore, this application does not make any limitation on this, and the protection scope of this application should not be restricted in any way.
图2是根据一示例性实施例示出的一种页面转译方法的流程图。如图2所示,包括以下步骤:Fig. 2 is a flow chart showing a method for page translation according to an exemplary embodiment. As shown in Figure 2, it includes the following steps:
步骤210,接收并响应用户访问网页的请求,获取发送用户访问网页的请求的目标终端的IP地址。Step 210: Receive and respond to the user's request for accessing the webpage, and obtain the IP address of the target terminal that sends the user's request for accessing the webpage.
用户访问网页的请求可以是基于各种网络协议的请求,比如可以是HTTP协议下的请求,目标终端即发送用户访问网页的请求的终端。The request of the user to access the webpage may be a request based on various network protocols, for example, it may be a request under the HTTP protocol, and the target terminal is the terminal that sends the user's request for accessing the webpage.
易于理解,在一般情况下,访问网页的请求是用户使用其终端向外发送的,因此用户访问网页的请求本质上是用户的终端发来的请求,两者在实际情况下并无二致,此处为便于理解,使用了用户访问网页的请求进行描述。It is easy to understand that in general, the request to access a webpage is sent by the user using his terminal. Therefore, the request of the user to access the webpage is essentially a request from the user’s terminal. The two are the same in actual situations. For ease of understanding, the user’s request to access the web page is used for description.
在一个实施例中,本申请的实施终端具有日志,该日志可以记录向本端发送访问网页的请求的每一终端的IP地址,通过读取该日志,获取发送用户访问网页的请求的目标终端的IP地址。In one embodiment, the implementation terminal of this application has a log that can record the IP address of each terminal that sends a request to access a webpage to the local end, and by reading the log, the target terminal that sends the user's request to access the webpage is obtained IP address.
在一个实施例中,用户访问网页的请求是基于HTTP协议建立的请求,该请求的报文的头部中记录有发送用户访问网页的请求的目标终端的IP地址,本申请的实施终端通过读取该请求报文的头部,获取目标终端的IP地址。In one embodiment, the user's request to access the webpage is a request established based on the HTTP protocol, and the header of the request message records the IP address of the target terminal that sends the user's request to access the webpage. The implementation terminal of this application reads Take the header of the request message to obtain the IP address of the target terminal.
步骤220,根据目标终端的IP地址确定目标终端所属的国家,并根据所述目标终端所属的国家确定网页中的语言类型。Step 220: Determine the country to which the target terminal belongs according to the IP address of the target terminal, and determine the language type in the webpage according to the country to which the target terminal belongs.
网页中的语言类型即要向目标终端发送的目标页面中的语言类型。The language type in the web page is the language type in the target page to be sent to the target terminal.
在一个实施例中,预设有IP地址范围与IP地址所述国家对应关系表,通过查询该表,确定所述目标终端的IP地址所在IP地址范围,然后将与确定出的该IP地址范围对应的国家,作为确定出的目标终端所属的国家。In one embodiment, the country correspondence table of IP address ranges and IP addresses is preset. By querying the table, the IP address range of the target terminal is determined, and then the IP address range determined is compared with the determined IP address range. The corresponding country is the country to which the determined target terminal belongs.
在一个实施例中,调用能根据IP地址查询目标终端所属国家的API(Application Programming Interface,应用程序编程接口)来确定目标终端所属的国家。In one embodiment, an API (Application Programming Interface) that can query the country of the target terminal according to the IP address is called to determine the country to which the target terminal belongs.
在一个实施例中,预设有存储着每一国家的典型IP地址的数据库,利用正则表达式匹配的方式,获取与所述目标终端的IP地址匹配的典型IP地址,然后将与匹配出的典型IP地址对应的国家,作为确定出的目标终端所属的国家。In one embodiment, a database storing typical IP addresses of each country is preset, and a typical IP address that matches the IP address of the target terminal is obtained by using regular expression matching, and then the matched IP address The country corresponding to the typical IP address is used as the country to which the determined target terminal belongs.
比如,可以利用|、?、/d等字符构成的正则表达式进行匹配。For example, you can use |,? , /D and other characters to match the regular expression.
在一个实施例中,预先设有一个国家与语言类型对应关系表,通过查询该表,获取与所述目标终端所属的国家对应的语言类型,从而完成据所述目标终端所属的国家确定网页中的语言类型。In one embodiment, a country-language type correspondence table is preset, and the language type corresponding to the country to which the target terminal belongs is obtained by querying the table, so as to complete the determination of the web page according to the country to which the target terminal belongs Language type.
易于理解,一个名称可以唯一确定一种语言的类型,语言类型即为语言的名称。比如,中文、英文、法文、俄文、意大利文等任意一个都为一种语言类型。每一国家都对应一个语言类型,比如中国对应的语言类型为中文,法国对应的语言类型为法文,德国对应的语言类型为德文。It is easy to understand, a name can uniquely determine the type of a language, and the language type is the name of the language. For example, any one of Chinese, English, French, Russian, Italian, etc. is a language type. Each country corresponds to a language type. For example, the language type corresponding to China is Chinese, the language type corresponding to France is French, and the language type corresponding to Germany is German.
在一个实施例中,通过调用能根据国家查询相应的语言类型的API获取网页中的语言类型。In one embodiment, the language type in the webpage is obtained by calling an API that can query the corresponding language type according to the country.
步骤230,根据网页中的语言类型获取与所述网页中的语言类型对应的目标页面,并将所述目标页面向目标终端发送,以使所述目标终端展示所述目标页面。Step 230: Obtain a target page corresponding to the language type in the web page according to the language type in the web page, and send the target page to the target terminal, so that the target terminal displays the target page.
目标页面即为要向用户展示的页面,所以目标页面是包含的信息内容与用户访问网页的请求所针对页面内容一致且网页类型为所述网页中的语言类型的页面。The target page is the page to be displayed to the user, so the target page is a page that contains information content that is consistent with the content of the page targeted by the user's request to access the webpage, and the webpage type is the language type of the webpage.
在一个实施例中,对于每一页面中的内容,预先针对页面中的内容建立了对应的每一语言类型的页面,首先获取网页类型与所述网页中的语言类型相同的页面,然后在获取的所述页面中确定出内容与用户访问网页的请求所针对的页面一致的页面,作为目标页面,并将所述目标页面向目标终端发送。In one embodiment, for the content in each page, a corresponding page of each language type is created for the content in the page in advance, and the page with the same language type as the language type in the web page is first obtained, and then after obtaining The page whose content is consistent with the page targeted by the user's request to access the webpage is determined from the page as the target page, and the target page is sent to the target terminal.
本实施例的好处在于,由于每一语言类型的页面都是预先建立的,可以把控不同语言类型的页面中内容的翻译质量,从而提高用户体验。The advantage of this embodiment is that since the pages of each language type are created in advance, the translation quality of the content in the pages of different language types can be controlled, thereby improving user experience.
在一个实施例中,预先针对页面中的内容建立的对应的每一语言类型的页面是通过人工翻译并录入的方式来进行的。In one embodiment, the corresponding pages of each language type created in advance for the content in the page are performed by manual translation and input.
具体地,在获取的所述页面中确定出内容与用户访问网页的请求所针对的页面一致的页面作为目标页面的具体步骤可以包括:Specifically, the specific steps of determining the page whose content is consistent with the page targeted by the user's request for accessing the webpage from the obtained pages as the target page may include:
在用户访问网页的请求所针对的页面中提取预定数目个关键词;Extract a predetermined number of keywords from the page targeted by the user's request to access the web page;
在获取的所述页面中获取包含了提取的所有所述关键词的页面,作为目标页面。A page containing all the extracted keywords is acquired from the acquired pages as a target page.
在一个实施例中,对于每一页面中的内容,预先针对该页面中的内容建立了对应的每一语言类型的页面,并存储在预设的存储空间中,用户访问网页的请求所针对的页面是需要从该预设的存储空间中获取的,其中,在所述预设的存储空间中,对应于同一页面内容的各个语言类型的页面被分为一组,根据网页中的语言类型获取与所述网页中的语言类型对应的目标页面,具体包括:In one embodiment, for the content in each page, a corresponding page of each language type is created in advance for the content in the page and stored in a preset storage space. The user's request for accessing the web page is aimed at Pages need to be obtained from the preset storage space, where, in the preset storage space, pages corresponding to each language type of the same page content are grouped into a group, and obtained according to the language type in the webpage The target page corresponding to the language type in the webpage specifically includes:
确定所述用户访问网页的请求所针对的页面所属的组;在属于确定出的所述组的页面中获取语言类型与所述网页中的语言类型一致的页面,作为目标页面。Determine the group to which the page targeted by the user's request for accessing the webpage belongs; obtain a page whose language type is consistent with the language type of the webpage from the pages belonging to the determined group as the target page.
在一个实施例中,根据网页中的语言类型获取与所述网页中的语言类型对应的目标页面,具体包括:In one embodiment, obtaining the target page corresponding to the language type of the webpage according to the language type of the webpage specifically includes:
将所述用户访问网页的请求所针对的页面中的内容对应翻译为所述网页中的语言类型。The content in the page targeted by the user's request to access the webpage is correspondingly translated into the language type of the webpage.
具体地,在一个实施例中,通过将所述用户访问网页的请求所针对的页面嵌入翻译脚本语句并在所述脚本语句中添加所述网页中的语言类型这一目标语言参数,从而得到与所述网页中的语言类型对应的目标页面,其中,翻译脚本语句中可以包含调用翻译API的语句。Specifically, in one embodiment, by embedding the translation script sentence in the page targeted by the user's request to access the webpage, and adding the target language parameter of the language type in the webpage to the script sentence, the corresponding The target page corresponding to the language type in the webpage, wherein the translation script statement may include a statement calling the translation API.
在一个实施例中,根据网页中的语言类型获取与所述网页中的语言类型对应的目标页面,具体包括:In one embodiment, obtaining the target page corresponding to the language type of the webpage according to the language type of the webpage specifically includes:
读取所述用户访问网页的请求所针对的页面文件中的内容并对应翻译为所述网页中的语言类型;Reading the content in the page file targeted by the user's request to access the webpage and correspondingly translate it into the language type of the webpage;
将翻译后的内容按照翻译时的对应关系替换所述用户访问网页的请求所针对的页面文件中的内容,以得到与所述网页中的语言类型对应的目标页面。The translated content replaces the content in the page file targeted by the user's request to access the web page according to the corresponding relationship during translation, so as to obtain a target page corresponding to the language type of the web page.
本实施例的好处在于,由于翻译是自动进行的,而且不需要预先准备大量的不同语言类型的页面文件,省却了前序工作流程,节约了存储资源的消耗。The advantage of this embodiment is that since the translation is performed automatically and there is no need to prepare a large number of page files of different language types in advance, it saves the pre-work flow and saves the consumption of storage resources.
在一个实施例中,在步骤230之后,还可以包括以下步骤:In an embodiment, after step 230, the following steps may be further included:
获取用户在目标页面中输入的待分析文字信息;Obtain the text information to be analyzed entered by the user in the target page;
识别所述待分析文字信息的语言类型,并根据所述待分析文字信息的语言类型获取与所述待分析文字信息的语言类型一致且与所述目标页面内容相同的待显示页面,并将获取的所述待显示页面发送至目标终端,以使所述目标终端展示待显示页面;或者Identify the language type of the text information to be analyzed, and obtain the page to be displayed that is consistent with the language type of the text information to be analyzed and the content of the target page according to the language type of the text information to be analyzed, and obtains Sending the page to be displayed to the target terminal, so that the target terminal displays the page to be displayed; or
识别所述待分析文字信息的语言类型,并根据所述待分析文字信息的语言类型将目标页面中的信息渲染为与待分析文字信息语言类型一致的信息。Identify the language type of the text information to be analyzed, and render the information in the target page into information consistent with the language type of the text information to be analyzed according to the language type of the text information to be analyzed.
待显示页面是等待向用户所在的目标终端发送的页面,待显示页面中的内容与所述目标页面内容相同。The page to be displayed is a page waiting to be sent to the target terminal where the user is located, and the content of the page to be displayed is the same as the content of the target page.
具体而言,本端获取用户在目标页面中输入的待分析文字信息的方式可以是:利用所述目标页面中的表单接收用户输入的待分析文字信息。Specifically, the method for the local terminal to obtain the text information to be analyzed input by the user in the target page may be: using the form in the target page to receive the text information to be analyzed input by the user.
比如,目标页面中可以包含用来接收用户输入的待分析文字信息的控件,通过该控件获取用户输入的待分析文字信息。例如,控件可以是文本框。For example, the target page may include a control for receiving the text information to be analyzed input by the user, and obtain the text information to be analyzed input by the user through the control. For example, the control can be a text box.
在一个实施例中,预先为每一语言类型设立了相应的字典库,所述识别所述待分析文字信息的语言类型,包括:通过遍历每一字典库,确定所述待分析文字信息中的文字所在的字典库;将与确定出的所述字典库对应的语言类型作为所述待分析文字信息的语言类型。In one embodiment, a corresponding dictionary library is established for each language type in advance, and the identifying the language type of the text information to be analyzed includes: traversing each dictionary library to determine the The dictionary library where the text is located; the language type corresponding to the determined dictionary library is taken as the language type of the text information to be analyzed.
其中,对于根据所述待分析文字信息的语言类型将目标页面中的信息渲染为与待分析文字信息语言类型一致的信息的步骤,具体可以通过如下方式实现:Wherein, the step of rendering the information in the target page into information consistent with the language type of the text information to be analyzed according to the language type of the text information to be analyzed can be specifically implemented in the following manner:
将所述目标页面的文件内记录的代码中嵌入翻译脚本语句,其中,当被嵌入翻译脚本语句的目标页面被发送到目标终端时,目标终端会根据该翻译脚本语句将原目标页面中的信息对应渲染为与待分析文字信息语言类型一致的信息。Embed the translation script sentence in the code recorded in the file of the target page, wherein when the target page embedded with the translation script sentence is sent to the target terminal, the target terminal will convert the information in the original target page according to the translation script sentence The corresponding rendering is the information consistent with the language type of the text information to be analyzed.
前述针对步骤230之后的步骤所提供的实施例的好处在于,考虑了基于IP地址确定出的语言类型不准确以及用户习惯使用的语言与用户所在地区的通用语言不一致等情况,通过分析用户主动输入的待分析文字信息可以进一步向用户提供更加准确的目标页面,从而提高用户体验。The advantage of the foregoing embodiment provided for the steps after step 230 is that it takes into account the inaccuracy of the language type determined based on the IP address and the inconsistency between the language used by the user and the general language of the user’s area, etc., by analyzing the user’s active input The text information to be analyzed can further provide users with more accurate target pages, thereby improving user experience.
综上所述,根据图2对应实施例提供的页面转译方法,通过在用户访问网站的页面时,根据发送访问请求的IP地址识别出适合用户浏览的语言类型,接着将与该语言类型对应的目标页面发送到目标终端,使得用户直接浏览到的页面中内容的语言更可能是用户习惯使用的语言,从而提高了用户获取页面中信息的效率,同时提高了用户体验。In summary, according to the page translation method provided in the embodiment corresponding to FIG. 2, when the user visits the page of the website, the language type suitable for the user's browsing is identified according to the IP address that sends the access request, and then the language type corresponding to the language type is identified The target page is sent to the target terminal, so that the language of the content in the page that the user browses directly to is more likely to be the language that the user is accustomed to using, thereby improving the efficiency of the user in obtaining the information on the page and improving the user experience.
图3是根据图2对应实施例示出的一实施例的步骤230之后步骤的流程图。在本实施例中,预设网页页面库中存储有与多个语言类型对应的页面,对于预设网页页面库中的每一页面的内容,所述预设网页页面库中都存储有与该页面的内容对应的多个语言类型的页面,与任一页面的内容对应的所述页面的数目相同,如图3所示,包括以下步骤:FIG. 3 is a flowchart of steps after step 230 of an embodiment shown according to the embodiment corresponding to FIG. 2. In this embodiment, the preset web page page library stores pages corresponding to multiple language types, and for the content of each page in the preset web page page library, the preset web page page library stores all pages corresponding to the The number of pages of multiple language types corresponding to the content of the page is the same as the number of the pages corresponding to the content of any page, as shown in FIG. 3, including the following steps:
步骤240,获取用户通过所述目标页面上传的待分析语音信息。Step 240: Obtain the voice information to be analyzed uploaded by the user through the target page.
在一个实施例中,用户发送访问网页请求的终端,即目标终端具有语音输入单元,通过用户的目标终端上的语音输入单元可以录制用户的语音并上传至本端。比如语音输入单元可以是麦克风、话筒等。In one embodiment, the terminal from which the user sends a webpage access request, that is, the target terminal has a voice input unit, and the user's voice can be recorded and uploaded to the local terminal through the voice input unit on the user's target terminal. For example, the voice input unit may be a microphone, a microphone, or the like.
在一个实施例中,用户可以通过位于所述目标页面上的控件触发控制目标终端的语音输入单元开始进行语音的录制,并且还可以通过控件启动上传待分析语音信息的动作。In one embodiment, the user can trigger and control the voice input unit of the target terminal to start voice recording through a control located on the target page, and can also initiate an action of uploading voice information to be analyzed through the control.
步骤250,识别所述待分析语音信息的语言类型。Step 250: Identify the language type of the voice information to be analyzed.
在一个实施例中,预设有与每一语言类型对应的音素库,所述识别所述待分析语音信息 的语言类型具体包括:将所述待分析语音信息切分为音素;在与各语言类型对应的音素库中获取包含所有切分成的所述音素的音素库;确定与所述音素库对应的语言类型,作为所述待分析语音信息的语言类型。In one embodiment, a phoneme library corresponding to each language type is preset, and the identifying the language type of the speech information to be analyzed specifically includes: segmenting the speech information to be analyzed into phonemes; A phoneme library containing all the segmented phonemes is obtained from the phoneme library corresponding to the type; the language type corresponding to the phoneme library is determined as the language type of the voice information to be analyzed.
步骤260,当预设网页页面库中存在与所述待分析语音信息的语言类型一致且与所述目标页面内容相同的待显示页面时,将与所述待分析语音信息的语言类型一致且与所述目标页面内容相同的待显示页面发送至目标终端,以使所述目标终端展示所述待显示页面。Step 260: When there is a page to be displayed that is consistent with the language type of the voice information to be analyzed and the content of the target page exists in the preset web page library, it will be consistent with the language type of the voice information to be analyzed and is consistent with The page to be displayed with the same content of the target page is sent to the target terminal, so that the target terminal displays the page to be displayed.
当一个页面中内容的语言类型与所述待分析语音信息的语言类型一致且该页面的内容与所述目标页面内容相同,就可以说明该页面是符合用户的语言需要且包含用户需要浏览的内容的页面,此时就可以将该页面发送给目标终端。When the language type of the content in a page is consistent with the language type of the voice information to be analyzed and the content of the page is the same as the content of the target page, it can be indicated that the page meets the user's language needs and contains the content that the user needs to browse , You can send the page to the target terminal at this time.
步骤270,当预设网页页面库中不存在与所述待分析语音信息的语言类型一致且与所述目标页面内容相同的待显示页面时,将所述目标页面中的信息渲染为与所述待分析语音信息的语言类型一致的信息。Step 270: When there is no page to be displayed in the preset web page library that is consistent with the language type of the voice information to be analyzed and the content of the target page is the same, render the information in the target page as Information of the same language type of the voice information to be analyzed.
通过页面库的方式针对每一页面内容来建立所有语言的页面是很繁重的任务,特别是对于包含众多页面的大型网站来说,是很繁重的工作,所以图3示出的实施例的好处在于,对于预设网页页面库中存在与所述待分析语音信息的语言类型一致且与所述目标页面内容相同的待显示页面的情况,通过将该待显示页面直接发送到目标终端,可以保证页面内容可以具有较高的质量,同时,对于预设网页页面库中不存在与所述待分析语音信息的语言类型一致且与所述目标页面内容相同的待显示页面的这一情况,通过直接渲染的方式向用户呈现出适应用户语言要求的页面,可以提高用户体验,此外,用户只需上传语音信息即可实现用户所需网页中语言类型的进一步确认,提高了访问效率。It is a very heavy task to create pages in all languages for each page content by means of a page library, especially for a large website containing many pages, so the advantages of the embodiment shown in Figure 3 That is, if there is a page to be displayed in the preset web page library that is consistent with the language type of the voice information to be analyzed and the content of the target page, by directly sending the page to be displayed to the target terminal, it can be guaranteed The content of the page can be of higher quality. At the same time, in the case that there is no page to be displayed that is consistent with the language type of the voice information to be analyzed and the content of the target page in the preset web page library, the direct The rendering method presents a page that meets the user's language requirements to the user, which can improve the user experience. In addition, the user only needs to upload the voice information to realize the further confirmation of the language type in the web page required by the user, which improves the access efficiency.
图4是根据图2对应实施例示出的一实施例的步骤220的细节流程图。如图4所示,步骤220具体包括:FIG. 4 is a detailed flowchart of step 220 of an embodiment shown according to the embodiment corresponding to FIG. 2. As shown in FIG. 4, step 220 specifically includes:
步骤220',当无法根据目标终端的IP地址确定目标终端所属的国家时,根据预定规则确定网页中的语言类型。In step 220', when the country to which the target terminal belongs cannot be determined according to the IP address of the target terminal, determine the language type in the web page according to a predetermined rule.
在一个实施例中,所述预定规则包括:获取预设的语言类型作为网页中的语言类型。In an embodiment, the predetermined rule includes: obtaining a preset language type as the language type in the webpage.
比如,预设的语言类型可以是中文、英文、法文等。For example, the preset language type can be Chinese, English, French, etc.
在一个实施例中,所述预定规则包括:获取本端所在的IP地址;根据本端所在的IP地址确定本端所属的国家;获取与确定出的所述国家对应的语言类型。In one embodiment, the predetermined rule includes: acquiring the IP address of the local terminal; determining the country to which the local terminal belongs according to the IP address of the local terminal; acquiring the language type corresponding to the determined country.
由于本端,即用户访问网页的服务端常常位于其服务的用户所在的地区,所以根据本端所在的IP地址来获取网页中的语言类型更可能满足用户需要,本实施例的好处在于,为在无法根据目标终端的IP地址确定目标终端所属的国家的这一情况下如何确定网页中的语言类型提供了解决方案,保证了用户的体验。Since the local end, that is, the server where the user accesses the webpage, is often located in the area where the user it serves, it is more likely to meet the needs of the user to obtain the language type in the webpage according to the IP address of the local end. The advantage of this embodiment is that How to determine the language type in the webpage provides a solution to ensure the user experience when the country to which the target terminal belongs cannot be determined according to the IP address of the target terminal.
图5是根据图4对应实施例示出的一实施例的预定规则的流程图。如图5所示,包括以下步骤:Fig. 5 is a flowchart of a predetermined rule according to an embodiment shown in the embodiment corresponding to Fig. 4. As shown in Figure 5, it includes the following steps:
步骤510,获取当前时间之前预定时间段内发来访问请求的所有发送端的IP地址所属的国家。Step 510: Obtain the country to which the IP addresses of all the senders that sent the access request within a predetermined time period before the current time belong.
预定时间段是任意的时间段,比如可以是一天、一周、一个月、一年等。The predetermined time period is any time period, such as one day, one week, one month, one year, etc.
在一个实施例中,本端包含日志系统,该日志系统中的日志记录了发来访问请求的所有发送端的IP地址所属的国家,通过读取该日志系统中的日志,获取发来访问请求的所有发送端的IP地址所属的国家。In one embodiment, the local end includes a log system, and the log in the log system records the country to which the IP addresses of all senders that send access requests belong to. By reading the log in the log system, the log of the request sent The country to which the IP addresses of all senders belong.
在一个实施例中,发来访问请求的每一发送端的IP地址所属的国家和相应的该发送端发送访问请求的时间对应存储在数据库中,通过查询该数据库,获取当前时间之前预定时间段内发来访问请求的所有发送端的IP地址所属的国家。In one embodiment, the country to which the IP address of each sender that sends the access request belongs and the corresponding time when the sender sends the access request are stored in a database correspondingly, and by querying the database, a predetermined time period before the current time is obtained The country to which the IP addresses of all senders that send access requests belong to.
步骤520,针对每一国家,在所述预定时间段内发来访问请求的所有发送端的IP地址中获取属于该国家的IP地址的数目。Step 520: For each country, obtain the number of IP addresses belonging to the country from the IP addresses of all the senders that send the access request within the predetermined time period.
在一个实施例中,本端内嵌有一个计数器,利用该计数器可以对属于每一国家的IP地址的数目进行计数。具体地,针对每一国家,每当该计数器识别出一个IP地址属于该国家,计数器就加1,直至无法再识别出一个IP地址属于该国家,此时该计数器计得的数目即为属于该国家的IP地址的数目。In one embodiment, a counter is embedded in the local end, and the number of IP addresses belonging to each country can be counted by using the counter. Specifically, for each country, whenever the counter recognizes that an IP address belongs to that country, the counter is incremented by 1 until it can no longer recognize that an IP address belongs to the country. At this time, the number counted by the counter belongs to that country. The number of IP addresses in the country.
步骤530,基于所述数目获取目标国家。Step 530: Obtain the target country based on the number.
在一个实施例中,步骤530包括:获取所述数目最大的国家,作为目标国家。In one embodiment, step 530 includes: obtaining the country with the largest number as the target country.
在一个实施例中,步骤530具体包括:In one embodiment, step 530 specifically includes:
对各国家按照获取的所述数目从大到小进行排序;获取每一国家的访问高峰时间段;获取每一国家的当地时间和预先为当地时间是否位于访问高峰时间段内而相应设置的评分修正方式;针对每一国家,当该国家的当地时间位于该国家的访问高峰时间段时,获取预先为当地时间位于访问高峰时间段内而相应设置的评分修正方式,当该国家的当地时间不位于该国家的访问高峰时间段时,获取预先为当地时间不位于访问高峰时间段内而相应设置的评分修正方式;针对每一国家,按照针对该国家获取的所述评分修正方式,对该国家在所述排序中的序号进行修正,以得到该国家的评分;获取所述评分最小的国家作为目标国家。Sort the countries according to the number of acquisitions from largest to smallest; get the peak visit time period of each country; get the local time of each country and the score set accordingly for whether the local time is within the peak visit time period Correction method: For each country, when the country’s local time is in the peak visit time zone of the country, obtain the score correction method set in advance for the local time is in the peak visit time zone. When the country’s local time is not When the country is located in the peak visit time period, obtain the corresponding score correction method set in advance for the local time not in the peak visit time period; for each country, according to the score correction method obtained for the country, the country The sequence number in the sorting is modified to obtain the score of the country; the country with the smallest score is obtained as the target country.
其中,评分修正方式是指对各国家排序的序号进行运算以获得国家的评分的方式。Among them, the scoring correction method refers to a method of calculating the sequence number of each country to obtain the score of the country.
比如,预先为当地时间位于访问高峰时间段内而相应设置的评分修正方式可以为:对排序序号乘0.9,对应地,预先为当地时间不位于访问高峰时间段内而相应设置的评分修正方式可以为:对排序序号乘1.1。For example, the score correction method set in advance for the local time is within the peak visit time period can be: multiply the ranking sequence number by 0.9, correspondingly, the score correction method set accordingly in advance for the local time is not within the peak visit time period can be Is: Multiply the sort number by 1.1.
在一个实施例中,预先为当地时间位于访问高峰时间段内而相应设置的评分修正方式为利用如下公式对各国家排序的序号进行修正:In one embodiment, the corresponding scoring correction method set in advance for the local time is within the peak visit time period is to use the following formula to correct the sequence number of each country:
Figure PCTCN2020087473-appb-000001
Figure PCTCN2020087473-appb-000001
其中,x是各国家排序的序号,y是修正得到的国家的评分,Among them, x is the serial number of each country, y is the score of the country obtained by the amendment,
对应地,预先为当地时间不位于访问高峰时间段内而相应设置的评分修正方式为利用如下公式对各国家排序的序号进行修正:Correspondingly, the scoring correction method set in advance for the local time is not within the peak visit time period is to use the following formula to correct the serial number of each country:
y=x 2 y=x 2
由于各国家是按照获取的所述数目从大到小进行排序的,一个国家排序越小,则所述数目越高,也就更可能被选作目标国家,由此可以看出,评分修正方式的本质为增加对当地时间位于访问高峰时间段内的国家与当地时间不位于访问高峰时间段内的国家之间的基于排序序号建立的国家的评分之间的差距,使得获取的国家的评分更为客观,所以评分修正方式可以是任意的,只要拉大当地时间位于访问高峰时间段内的国家与当地时间不位于访问高峰时间段内的国家之间的基于排序序号建立的国家的评分之间的差距即可,所以预先为当地时间是否位于访问高峰时间段内而相应设置的评分修正方式之一还可以为保持国家的排序序号不变。Since each country is sorted according to the number of the obtained, the smaller the ranking of a country, the higher the number, and the more likely it is to be selected as the target country. It can be seen that the score correction method The essence of is to increase the gap between the country’s scores based on the ranking sequence number between the countries whose local time is within the peak visit time period and the countries whose local time is not within the peak visit time period, so that the score of the obtained country is more To be objective, so the score correction method can be arbitrary, as long as the local time is within the peak visit time period and the local time is not within the peak visit time period between the countries based on the ranking sequence number. Therefore, one of the corresponding scoring correction methods set in advance to determine whether the local time is within the peak visit time period can also be to keep the country’s ranking number unchanged.
在一个实施例中,对各国家按照获取的所述数目从大到小进行排序的具体方式为使用冒泡排序算法对各国家按照获取的所述数目从大到小进行排序。In one embodiment, the specific manner of sorting the countries according to the acquired number from largest to smallest is to use a bubble sorting algorithm to sort the countries according to the acquired number from largest to smallest.
在一个实施例中,所述预定时间段为第一预定时间段,所述数目为第一数目,所述基于 所述数目获取目标国家,包括:获取当前时间之前第二预定时间段内发来访问请求的所有发送端的IP地址所属的国家,所述第二预定时间段小于第一预定时间段;针对每一国家,在所述第二预定时间段内发来访问请求的所有发送端的IP地址中获取属于该国家的IP地址的数目,作为第二数目;基于所述第一数目和所述第二数目获取目标国家。In one embodiment, the predetermined period of time is a first predetermined period of time, the number is a first number, and the obtaining of the target country based on the number includes: obtaining the current time before the second predetermined period of time The country to which the IP addresses of all senders of the access request belong, the second predetermined time period is less than the first predetermined time period; for each country, the IP addresses of all senders that send the access request within the second predetermined time period Acquire the number of IP addresses belonging to the country as the second number; acquire the target country based on the first number and the second number.
在一个实施例中,基于所述第一数目和所述第二数目获取目标国家,包括:针对每一国家,分别获取第一数目和第二数目的权重;针对每一国家,利用所述权重确定针对该国家获取的所述第一数目和所述第二数目的加权和;获取所述加权和最大的国家作为目标国家。In one embodiment, obtaining the target country based on the first number and the second number includes: for each country, respectively obtaining the weight of the first number and the second number; for each country, using the weight Determine the weighted sum of the first number and the second number acquired for the country; acquire the country with the largest weighted sum as the target country.
本实施例的好处在于,综合利用了第一数目和第二数目两方面因素来获取目标国家,提高了获取的目标国家的准确率,从而可以提高最终确定出的网页中的语言类型的准确率。The advantage of this embodiment is that the two factors of the first number and the second number are combined to obtain the target country, which improves the accuracy of the obtained target country, thereby improving the accuracy of the language type in the finally determined webpage. .
本申请还提供了一种页面转译装置,以下是本申请的装置实施例。This application also provides a page translation device. The following are device embodiments of the application.
图6是根据一示例性实施例示出的一种页面转译装置的框图。如图6所示,装置600包括:Fig. 6 is a block diagram showing a device for page translation according to an exemplary embodiment. As shown in FIG. 6, the apparatus 600 includes:
获取模块610,被配置为接收并响应用户访问网页的请求,获取发送用户访问网页的请求的目标终端的IP地址。The obtaining module 610 is configured to receive and respond to a user's request for accessing a webpage, and obtain the IP address of the target terminal that sends the user's request for accessing the webpage.
确定模块620,被配置为根据目标终端的IP地址确定目标终端所属的国家,并根据所述目标终端所属的国家确定网页中的语言类型。The determining module 620 is configured to determine the country to which the target terminal belongs according to the IP address of the target terminal, and to determine the language type in the webpage according to the country to which the target terminal belongs.
发送模块630,被配置为根据网页中的语言类型获取与所述网页中的语言类型对应的目标页面,并将所述目标页面向目标终端发送,以使所述目标终端展示所述目标页面。The sending module 630 is configured to obtain a target page corresponding to the language type of the webpage according to the language type of the webpage, and send the target page to the target terminal, so that the target terminal displays the target page.
据本申请的第三方面,还提供了一种能够实现上述方法的电子设备。According to the third aspect of the present application, an electronic device capable of implementing the above method is also provided.
所属技术领域的技术人员能够理解,本申请的各个方面可以实现为系统、方法或程序产品。因此,本申请的各个方面可以具体实现为以下形式,即:完全的硬件实施方式、完全的软件实施方式(包括固件、微代码等),或硬件和软件方面结合的实施方式,这里可以统称为“电路”、“模块”或“系统”。Those skilled in the art can understand that various aspects of the present application can be implemented as a system, method, or program product. Therefore, each aspect of the present application can be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, which can be collectively referred to herein as "Circuit", "Module" or "System".
下面参照图7来描述根据本申请的这种实施方式的电子设备700。图7显示的电子设备700仅仅是一个示例,不应对本申请实施例的功能和使用范围带来任何限制。The electronic device 700 according to this embodiment of the present application will be described below with reference to FIG. 7. The electronic device 700 shown in FIG. 7 is only an example, and should not bring any limitation to the function and use scope of the embodiments of the present application.
如图7所示,电子设备700以通用计算设备的形式表现。电子设备700的组件可以包括但不限于:上述至少一个处理单元710、上述至少一个存储单元720、连接不同系统组件(包括存储单元720和处理单元710)的总线730。As shown in FIG. 7, the electronic device 700 is represented in the form of a general-purpose computing device. The components of the electronic device 700 may include, but are not limited to: the aforementioned at least one processing unit 710, the aforementioned at least one storage unit 720, and a bus 730 connecting different system components (including the storage unit 720 and the processing unit 710).
其中,所述存储单元存储有程序代码,所述程序代码可以被所述处理单元710执行,使得所述处理单元710执行本说明书上述“实施例方法”部分中描述的根据本申请各种示例性实施方式的步骤。Wherein, the storage unit stores program code, and the program code can be executed by the processing unit 710, so that the processing unit 710 executes the various exemplary methods described in the "Embodiment Method" section of this specification. Implementation steps.
存储单元720可以包括易失性存储单元形式的可读介质,例如随机存取存储单元(RAM)721和/或高速缓存存储单元722,还可以进一步包括只读存储单元(ROM)723。The storage unit 720 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 721 and/or a cache storage unit 722, and may further include a read-only storage unit (ROM) 723.
存储单元720还可以包括具有一组(至少一个)程序模块725的程序/实用工具724,这样的程序模块725包括但不限于:操作系统、一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。The storage unit 720 may also include a program/utility tool 724 having a set of (at least one) program module 725. Such program module 725 includes but is not limited to: an operating system, one or more application programs, other program modules, and program data, Each of these examples or some combination may include the implementation of a network environment.
总线730可以为表示几类总线结构中的一种或多种,包括存储单元总线或者存储单元控制器、外围总线、图形加速端口、处理单元或者使用多种总线结构中的任意总线结构的局域总线。The bus 730 may represent one or more of several types of bus structures, including a storage unit bus or a storage unit controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local area using any bus structure among multiple bus structures. bus.
电子设备700也可以与一个或多个外部设备900(例如键盘、指向设备、蓝牙设备等)通信,还可与一个或者多个使得用户能与该电子设备700交互的设备通信,和/或与使得该电子设备700能与一个或多个其它计算设备进行通信的任何设备(例如路由器、调制解调器等等)通信。这种通信可以通过输入/输出(I/O)接口750进行。并且,电子设备700还可以通过网络适配器760与一个或者多个网络(例如局域网(LAN),广域网(WAN)和/或公共网络,例如因特网)通信。如图所示,网络适配器760通过总线730与电子设备700的其它模块通信。应当明白,尽管图中未示出,可以结合电子设备700使用其它硬件和/或软件模块,包括但不限于:微代码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、RAID系统、磁带驱动器以及数据备份存储系统等。The electronic device 700 can also communicate with one or more external devices 900 (such as keyboards, pointing devices, Bluetooth devices, etc.), and can also communicate with one or more devices that enable users to interact with the electronic device 700, and/or communicate with Any device (such as a router, modem, etc.) that enables the electronic device 700 to communicate with one or more other computing devices. This communication can be performed through an input/output (I/O) interface 750. In addition, the electronic device 700 may also communicate with one or more networks (for example, a local area network (LAN), a wide area network (WAN), and/or a public network, such as the Internet) through the network adapter 760. As shown in the figure, the network adapter 760 communicates with other modules of the electronic device 700 through the bus 730. It should be understood that although not shown in the figure, other hardware and/or software modules can be used in conjunction with the electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives And data backup storage system, etc.
通过以上的实施方式的描述,本领域的技术人员易于理解,这里描述的示例实施方式可以通过软件实现,也可以通过软件结合必要的硬件的方式来实现。因此,根据本申请实施方式的技术方案可以以软件产品的形式体现出来,该软件产品可以存储在一个非易失性存储介质(可以是CD-ROM,U盘,移动硬盘等)中或网络上,包括若干指令以使得一台计算设备(可以是个人计算机、服务器、终端装置、或者网络设备等)执行根据本申请实施方式的方法。Through the description of the foregoing embodiments, those skilled in the art can easily understand that the exemplary embodiments described herein can be implemented by software, or can be implemented by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (can be a CD-ROM, U disk, mobile hard disk, etc.) or on the network , Including several instructions to make a computing device (which may be a personal computer, server, terminal device, or network device, etc.) execute the method according to the embodiment of the present application.
根据本申请的第四方面,还提供了一种计算机可读存储介质,其上存储有能够实现本说明书上述方法的程序产品。该计算机可读存储介质可以是非易失性的,也可以是易失性的。在一些可能的实施方式中,本申请的各个方面还可以实现为一种程序产品的形式,其包括程序代码,当所述程序产品在终端设备上运行时,所述程序代码用于使所述终端设备执行本说明书上述“示例性方法”部分中描述的根据本申请各种示例性实施方式的步骤。According to the fourth aspect of the present application, there is also provided a computer-readable storage medium on which is stored a program product capable of implementing the above method of this specification. The computer-readable storage medium may be non-volatile or volatile. In some possible implementation manners, each aspect of the present application can also be implemented in the form of a program product, which includes program code. When the program product runs on a terminal device, the program code is used to make the The terminal device executes the steps according to various exemplary embodiments of the present application described in the above-mentioned "Exemplary Method" section of this specification.
参考图8所示,描述了根据本申请的实施方式的用于实现上述方法的程序产品800,其可以采用便携式紧凑盘只读存储器(CD-ROM)并包括程序代码,并可以在终端设备,例如个人电脑上运行。然而,本申请的程序产品不限于此,在本文件中,可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。Referring to FIG. 8, a program product 800 for implementing the above method according to an embodiment of the present application is described. It can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be stored in a terminal device, For example, running on a personal computer. However, the program product of this application is not limited to this. In this document, the readable storage medium can be any tangible medium that contains or stores a program, and the program can be used by or combined with an instruction execution system, device, or device.
所述程序产品可以采用一个或多个可读介质的任意组合。可读介质可以是可读信号介质或者可读存储介质。可读存储介质例如可以为但不限于电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。The program product can use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or a combination of any of the above. More specific examples (non-exhaustive list) of readable storage media include: electrical connections with one or more wires, portable disks, hard disks, random access memory (RAM), read only memory (ROM), erasable Type programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了可读程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。可读信号介质还可以是可读存储介质以外的任何可读介质,该可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。The computer-readable signal medium may include a data signal propagated in baseband or as a part of a carrier wave, and readable program code is carried therein. This propagated data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. The readable signal medium may also be any readable medium other than a readable storage medium, and the readable medium may send, propagate, or transmit a program for use by or in combination with the instruction execution system, apparatus, or device.
可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于无线、有线、光缆、RF等等,或者上述的任意合适的组合。The program code contained on the readable medium can be transmitted by any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
可以以一种或多种程序设计语言的任意组合来编写用于执行本申请操作的程序代码,所述程序设计语言包括面向对象的程序设计语言—诸如Java、C++等,还包括常规的过程式程 序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算设备上执行、部分地在用户设备上执行、作为一个独立的软件包执行、部分在用户计算设备上部分在远程计算设备上执行、或者完全在远程计算设备或服务器上执行。在涉及远程计算设备的情形中,远程计算设备可以通过任意种类的网络,包括局域网(LAN)或广域网(WAN),连接到用户计算设备,或者,可以连接到外部计算设备(例如利用因特网服务提供商来通过因特网连接)。The program code used to perform the operations of this application can be written in any combination of one or more programming languages. The programming languages include object-oriented programming languages—such as Java, C++, etc., as well as conventional procedural Programming language-such as "C" language or similar programming language. The program code can be executed entirely on the user's computing device, partly on the user's device, executed as an independent software package, partly on the user's computing device and partly executed on the remote computing device, or entirely on the remote computing device or server Executed on. In the case of a remote computing device, the remote computing device can be connected to a user computing device through any kind of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using Internet service providers) Business to connect via the Internet).

Claims (19)

  1. 一种页面转译方法,其中,所述方法包括:A page translation method, wherein the method includes:
    接收并响应用户访问网页的请求,获取发送用户访问网页的请求的目标终端的IP地址;Receive and respond to the user's request to access the webpage, and obtain the IP address of the target terminal that sends the user's request for the webpage;
    根据目标终端的IP地址确定目标终端所属的国家,并根据所述目标终端所属的国家确定网页中的语言类型;Determine the country to which the target terminal belongs according to the IP address of the target terminal, and determine the language type in the webpage according to the country to which the target terminal belongs;
    根据网页中的语言类型获取与所述网页中的语言类型对应的目标页面,并将所述目标页面向目标终端发送,以使所述目标终端展示所述目标页面。Obtain a target page corresponding to the language type in the web page according to the language type in the web page, and send the target page to the target terminal, so that the target terminal displays the target page.
  2. 根据权利要求1所述的方法,其中,在根据网页中的语言类型获取与所述网页中的语言类型对应的目标页面,并将所述目标页面向目标终端发送,以使所述目标终端展示所述目标页面之后,所述方法还包括:The method according to claim 1, wherein the target page corresponding to the language type in the web page is obtained according to the language type in the web page, and the target page is sent to the target terminal, so that the target terminal displays After the target page, the method further includes:
    获取用户在目标页面中输入的待分析文字信息;Obtain the text information to be analyzed entered by the user in the target page;
    识别所述待分析文字信息的语言类型,并根据所述待分析文字信息的语言类型获取与所述待分析文字信息的语言类型一致且与所述目标页面内容相同的待显示页面,并将获取的所述待显示页面发送至目标终端,以使所述目标终端展示待显示页面;或者Identify the language type of the text information to be analyzed, and obtain the page to be displayed that is consistent with the language type of the text information to be analyzed and the content of the target page according to the language type of the text information to be analyzed, and obtains Sending the page to be displayed to the target terminal, so that the target terminal displays the page to be displayed; or
    识别所述待分析文字信息的语言类型,并根据所述待分析文字信息的语言类型将目标页面中的信息渲染为与待分析文字信息语言类型一致的信息。Identify the language type of the text information to be analyzed, and render the information in the target page into information consistent with the language type of the text information to be analyzed according to the language type of the text information to be analyzed.
  3. 根据权利要求1所述的方法,其中,预设网页页面库中存储有与多个语言类型对应的页面,在根据网页中的语言类型获取与所述网页中的语言类型对应的目标页面,并将所述目标页面向目标终端发送,以使所述目标终端展示所述目标页面之后,所述方法还包括:The method according to claim 1, wherein pages corresponding to multiple language types are stored in a preset web page library, and the target page corresponding to the language type in the web page is obtained according to the language type in the web page, and After sending the target page to the target terminal so that the target terminal displays the target page, the method further includes:
    获取用户通过所述目标页面上传的待分析语音信息;Acquiring the voice information to be analyzed uploaded by the user through the target page;
    识别所述待分析语音信息的语言类型;Identifying the language type of the voice information to be analyzed;
    当预设网页页面库中存在与所述待分析语音信息的语言类型一致且与所述目标页面内容相同的待显示页面时,将与所述待分析语音信息的语言类型一致且与所述目标页面内容相同的待显示页面发送至目标终端,以使所述目标终端展示所述待显示页面;When there is a page to be displayed that is consistent with the language type of the voice information to be analyzed and the content of the target page in the preset web page library, it will be consistent with the language type of the voice information to be analyzed and be consistent with the target page. The page to be displayed with the same page content is sent to the target terminal, so that the target terminal displays the page to be displayed;
    当预设网页页面库中不存在与所述待分析语音信息的语言类型一致且与所述目标页面内容相同的待显示页面时,将所述目标页面中的信息渲染为与所述待分析语音信息的语言类型一致的信息。When there is no page to be displayed in the preset web page library that is consistent with the language type of the voice information to be analyzed and has the same content as the target page, the information in the target page is rendered as the same as the voice to be analyzed Information with the same language type of information.
  4. 根据权利要求1所述的方法,其中,所述根据目标终端的IP地址确定目标终端所属的国家,并根据所述目标终端所属的国家确定网页中的语言类型,包括:The method according to claim 1, wherein the determining the country to which the target terminal belongs according to the IP address of the target terminal, and determining the language type in the webpage according to the country to which the target terminal belongs, comprises:
    当无法根据目标终端的IP地址确定目标终端所属的国家时,根据预定规则确定网页中的语言类型。When the country to which the target terminal belongs cannot be determined according to the IP address of the target terminal, the language type in the web page is determined according to predetermined rules.
  5. 根据权利要求4所述的方法,其中,所述预定规则包括:The method according to claim 4, wherein the predetermined rule comprises:
    获取当前时间之前预定时间段内发来访问请求的所有发送端的IP地址所属的国家;Get the country where the IP addresses of all senders that send access requests within a predetermined time period before the current time belong to;
    针对每一国家,在所述预定时间段内发来访问请求的所有发送端的IP地址中获取属于该国家的IP地址的数目;For each country, obtain the number of IP addresses belonging to the country from the IP addresses of all senders that send access requests within the predetermined time period;
    基于所述数目获取目标国家;Obtain the target country based on the number;
    根据所述目标国家确定网页中的语言类型。Determine the language type in the webpage according to the target country.
  6. 根据权利要求5所述的方法,其中,所述基于所述数目获取目标国家,包括:The method according to claim 5, wherein said obtaining the target country based on the number comprises:
    对各国家按照获取的所述数目从大到小进行排序;Sort the countries in descending order according to the number obtained;
    获取每一国家的访问高峰时间段;Get the peak visit time period of each country;
    获取每一国家的当地时间和预先为当地时间是否位于访问高峰时间段内而相应设置的评分修正方式;Obtain the local time of each country and the corresponding score correction method set in advance to determine whether the local time is within the peak visit period;
    针对每一国家,当该国家的当地时间位于该国家的访问高峰时间段时,获取预先为当地时间位于访问高峰时间段内而相应设置的评分修正方式,当该国家的当地时间不位于该国家的访问高峰时间段时,获取预先为当地时间不位于访问高峰时间段内而相应设置的评分修正方式;For each country, when the country’s local time is in the peak visit time zone of the country, obtain the corresponding score correction method set in advance for the local time in the peak visit time zone. When the country’s local time is not in the country During the peak visit period, obtain the corresponding score correction method set in advance for the local time not within the peak visit period;
    针对每一国家,按照针对该国家获取的所述评分修正方式,对该国家在所述排序中的序号进行修正,以得到该国家的评分;For each country, modify the country’s serial number in the ranking according to the score correction method obtained for that country to obtain the country’s score;
    获取所述评分最小的国家作为目标国家。Obtain the country with the smallest score as the target country.
  7. 根据权利要求5所述的方法,其中,所述预定时间段为第一预定时间段,所述数目为第一数目,所述基于所述数目获取目标国家,包括:The method according to claim 5, wherein the predetermined time period is a first predetermined time period, the number is a first number, and the obtaining the target country based on the number includes:
    获取当前时间之前第二预定时间段内发来访问请求的所有发送端的IP地址所属的国家,所述第二预定时间段小于第一预定时间段;Acquiring the country to which the IP addresses of all senders of the access request sent within a second predetermined time period before the current time belong, where the second predetermined time period is less than the first predetermined time period;
    针对每一国家,在所述第二预定时间段内发来访问请求的所有发送端的IP地址中获取属于该国家的IP地址的数目,作为第二数目;For each country, obtain the number of IP addresses belonging to the country from the IP addresses of all senders that send access requests within the second predetermined time period as the second number;
    基于所述第一数目和所述第二数目获取目标国家。The target country is acquired based on the first number and the second number.
  8. 一种页面转译装置,其中,所述装置包括:A page translation device, wherein the device includes:
    获取模块,被配置为接收并响应用户访问网页的请求,获取发送用户访问网页的请求的目标终端的IP地址;The obtaining module is configured to receive and respond to the user's request to access the webpage, and obtain the IP address of the target terminal that sends the user's request to access the webpage;
    确定模块,被配置为根据目标终端的IP地址确定目标终端所属的国家,并根据所述目标终端所属的国家确定网页中的语言类型;The determining module is configured to determine the country to which the target terminal belongs according to the IP address of the target terminal, and to determine the language type in the webpage according to the country to which the target terminal belongs;
    发送模块,被配置为根据网页中的语言类型获取与所述网页中的语言类型对应的目标页面,并将所述目标页面向目标终端发送,以使所述目标终端展示所述目标页面。The sending module is configured to obtain a target page corresponding to the language type in the web page according to the language type in the web page, and send the target page to the target terminal, so that the target terminal displays the target page.
  9. 一种计算机可读存储介质,其中,其存储有计算机程序指令,当所述计算机程序指令被计算机执行时,使计算机执行如下步骤:A computer-readable storage medium, in which computer program instructions are stored, and when the computer program instructions are executed by a computer, the computer executes the following steps:
    接收并响应用户访问网页的请求,获取发送用户访问网页的请求的目标终端的IP地址;Receive and respond to the user's request to access the webpage, and obtain the IP address of the target terminal that sends the user's request for the webpage;
    根据目标终端的IP地址确定目标终端所属的国家,并根据所述目标终端所属的国家确定网页中的语言类型;Determine the country to which the target terminal belongs according to the IP address of the target terminal, and determine the language type in the webpage according to the country to which the target terminal belongs;
    根据网页中的语言类型获取与所述网页中的语言类型对应的目标页面,并将所述目标页面向目标终端发送,以使所述目标终端展示所述目标页面。Obtain a target page corresponding to the language type in the web page according to the language type in the web page, and send the target page to the target terminal, so that the target terminal displays the target page.
  10. 如权利要求9所述的存储介质,其中,当所述计算机程序指令被计算机执行时,使计算机执行所述根据网页中的语言类型获取与所述网页中的语言类型对应的目标页面,并将所述目标页面向目标终端发送,以使所述目标终端展示所述目标页面的步骤之后,还用于执行如下步骤:The storage medium according to claim 9, wherein, when the computer program instructions are executed by the computer, the computer executes the acquisition of the target page corresponding to the language type in the web page according to the language type in the web page, and After the step of sending the target page to the target terminal so that the target terminal displays the target page, it is further used to perform the following steps:
    获取用户在目标页面中输入的待分析文字信息;Obtain the text information to be analyzed entered by the user in the target page;
    识别所述待分析文字信息的语言类型,并根据所述待分析文字信息的语言类型获取与所述待分析文字信息的语言类型一致且与所述目标页面内容相同的待显示页面,并将获取的所述待显示页面发送至目标终端,以使所述目标终端展示待显示页面;或者Identify the language type of the text information to be analyzed, and obtain the page to be displayed that is consistent with the language type of the text information to be analyzed and the content of the target page according to the language type of the text information to be analyzed, and obtains Sending the page to be displayed to the target terminal, so that the target terminal displays the page to be displayed; or
    识别所述待分析文字信息的语言类型,并根据所述待分析文字信息的语言类型将目标页面中的信息渲染为与待分析文字信息语言类型一致的信息。Identify the language type of the text information to be analyzed, and render the information in the target page into information consistent with the language type of the text information to be analyzed according to the language type of the text information to be analyzed.
  11. 如权利要求9所述的存储介质,其中,当所述计算机程序指令被计算机执行时,使计算机执行所述根据网页中的语言类型获取与所述网页中的语言类型对应的目标页面,并将所述目标页面向目标终端发送,以使所述目标终端展示所述目标页面的步骤,还用于执行如下步骤:The storage medium according to claim 9, wherein, when the computer program instructions are executed by the computer, the computer executes the acquisition of the target page corresponding to the language type in the web page according to the language type in the web page, and The step of sending the target page to the target terminal so that the target terminal displays the target page is also used to perform the following steps:
    获取用户通过所述目标页面上传的待分析语音信息;Acquiring the voice information to be analyzed uploaded by the user through the target page;
    识别所述待分析语音信息的语言类型;Identifying the language type of the voice information to be analyzed;
    当预设网页页面库中存在与所述待分析语音信息的语言类型一致且与所述目标页面内容相同的待显示页面时,将与所述待分析语音信息的语言类型一致且与所述目标页面内容相同的待显示页面发送至目标终端,以使所述目标终端展示所述待显示页面;When there is a page to be displayed that is consistent with the language type of the voice information to be analyzed and the content of the target page in the preset web page library, it will be consistent with the language type of the voice information to be analyzed and be consistent with the target page. Sending the page to be displayed with the same page content to the target terminal, so that the target terminal displays the page to be displayed;
    当预设网页页面库中不存在与所述待分析语音信息的语言类型一致且与所述目标页面内容相同的待显示页面时,将所述目标页面中的信息渲染为与所述待分析语音信息的语言类型一致的信息。When there is no page to be displayed in the preset web page library that is consistent with the language type of the voice information to be analyzed and has the same content as the target page, the information in the target page is rendered as the same as the voice to be analyzed Information with the same language type of information.
  12. 如权利要求9所述的存储介质,其中,当所述计算机程序指令被计算机执行时,使计算机执行所述根据目标终端的IP地址确定目标终端所属的国家,并根据所述目标终端所属的国家确定网页中的语言类型的步骤,包括:The storage medium according to claim 9, wherein, when the computer program instructions are executed by the computer, the computer executes the determination of the country to which the target terminal belongs based on the IP address of the target terminal, and the The steps to determine the type of language in a web page include:
    当无法根据目标终端的IP地址确定目标终端所属的国家时,根据预定规则确定网页中的语言类型。When the country to which the target terminal belongs cannot be determined according to the IP address of the target terminal, the language type in the web page is determined according to predetermined rules.
  13. 如权利要求12所述的存储介质,其中,当所述计算机程序指令被计算机执行时,使计算机执行所述根据预定规则确定网页中的语言类型的步骤,包括:The storage medium according to claim 12, wherein, when the computer program instructions are executed by the computer, causing the computer to execute the step of determining the language type in the webpage according to a predetermined rule, comprising:
    获取当前时间之前预定时间段内发来访问请求的所有发送端的IP地址所属的国家;Get the country where the IP addresses of all senders that send access requests within a predetermined time period before the current time belong to;
    针对每一国家,在所述预定时间段内发来访问请求的所有发送端的IP地址中获取属于该国家的IP地址的数目;For each country, obtain the number of IP addresses belonging to the country from the IP addresses of all senders that send access requests within the predetermined time period;
    基于所述数目获取目标国家;Obtain the target country based on the number;
    根据所述目标国家确定网页中的语言类型。Determine the language type in the webpage according to the target country.
  14. 如权利要求13所述的存储介质,其中,当所述计算机程序指令被计算机执行时,使计算机执行所述基于所述数目获取目标国家的步骤,包括:The storage medium according to claim 13, wherein, when the computer program instructions are executed by a computer, causing the computer to execute the step of obtaining the target country based on the number, comprising:
    对各国家按照获取的所述数目从大到小进行排序;Sort the countries in descending order according to the number obtained;
    获取每一国家的访问高峰时间段;Get the peak visit time period of each country;
    获取每一国家的当地时间和预先为当地时间是否位于访问高峰时间段内而相应设置的评分修正方式;Obtain the local time of each country and the corresponding score correction method set in advance to determine whether the local time is within the peak visit period;
    针对每一国家,当该国家的当地时间位于该国家的访问高峰时间段时,获取预先为当地时间位于访问高峰时间段内而相应设置的评分修正方式,当该国家的当地时间不位于该国家的访问高峰时间段时,获取预先为当地时间不位于访问高峰时间段内而相应设置的评分修正方式;For each country, when the country’s local time is in the peak visit time zone of the country, obtain the corresponding score correction method set in advance for the local time in the peak visit time zone. When the country’s local time is not in the country During the peak visit period, obtain the corresponding score correction method set in advance for the local time not within the peak visit period;
    针对每一国家,按照针对该国家获取的所述评分修正方式,对该国家在所述排序中的序号进行修正,以得到该国家的评分;For each country, modify the country’s serial number in the ranking according to the score correction method obtained for that country to obtain the country’s score;
    获取所述评分最小的国家作为目标国家。15、一种电子设备,其中,所述电子设备包括:Obtain the country with the smallest score as the target country. 15. An electronic device, wherein the electronic device includes:
    处理器;processor;
    存储器,所述存储器上存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,实现如下步骤:A memory, where computer-readable instructions are stored, and when the computer-readable instructions are executed by the processor, the following steps are implemented:
    接收并响应用户访问网页的请求,获取发送用户访问网页的请求的目标终端的IP地址;Receive and respond to the user's request to access the webpage, and obtain the IP address of the target terminal that sends the user's request for the webpage;
    根据目标终端的IP地址确定目标终端所属的国家,并根据所述目标终端所属的国家确定网页中的语言类型;Determine the country to which the target terminal belongs according to the IP address of the target terminal, and determine the language type in the webpage according to the country to which the target terminal belongs;
    根据网页中的语言类型获取与所述网页中的语言类型对应的目标页面,并将所述目标页面向目标终端发送,以使所述目标终端展示所述目标页面。Obtain a target page corresponding to the language type in the web page according to the language type in the web page, and send the target page to the target terminal, so that the target terminal displays the target page.
  15. 如权利要求15所述的电子设备,其中,所述计算机可读指令被所述处理器执行时,实现所述根据网页中的语言类型获取与所述网页中的语言类型对应的目标页面,并将所述目标页面向目标终端发送,以使所述目标终端展示所述目标页面的步骤之后,还用于执行如下步骤:The electronic device according to claim 15, wherein, when the computer-readable instructions are executed by the processor, the acquisition of the target page corresponding to the language type in the web page according to the language type in the web page is realized, and After the step of sending the target page to the target terminal so that the target terminal displays the target page, it is further used to perform the following steps:
    获取用户在目标页面中输入的待分析文字信息;Obtain the text information to be analyzed entered by the user in the target page;
    识别所述待分析文字信息的语言类型,并根据所述待分析文字信息的语言类型获取与所述待分析文字信息的语言类型一致且与所述目标页面内容相同的待显示页面,并将获取的所述待显示页面发送至目标终端,以使所述目标终端展示待显示页面;或者Identify the language type of the text information to be analyzed, and obtain the page to be displayed that is consistent with the language type of the text information to be analyzed and the content of the target page according to the language type of the text information to be analyzed, and obtains Sending the page to be displayed to the target terminal, so that the target terminal displays the page to be displayed; or
    识别所述待分析文字信息的语言类型,并根据所述待分析文字信息的语言类型将目标页面中的信息渲染为与待分析文字信息语言类型一致的信息。Identify the language type of the text information to be analyzed, and render the information in the target page into information consistent with the language type of the text information to be analyzed according to the language type of the text information to be analyzed.
  16. 如权利要求15所述的电子设备,其中,所述计算机可读指令被所述处理器执行时,实现所述根据网页中的语言类型获取与所述网页中的语言类型对应的目标页面,并将所述目标页面向目标终端发送,以使所述目标终端展示所述目标页面的步骤,还用于执行如下步骤:The electronic device according to claim 15, wherein, when the computer-readable instructions are executed by the processor, the acquisition of the target page corresponding to the language type in the web page according to the language type in the web page is realized, and The step of sending the target page to the target terminal so that the target terminal displays the target page is also used to perform the following steps:
    获取用户通过所述目标页面上传的待分析语音信息;Acquiring the voice information to be analyzed uploaded by the user through the target page;
    识别所述待分析语音信息的语言类型;Identifying the language type of the voice information to be analyzed;
    当预设网页页面库中存在与所述待分析语音信息的语言类型一致且与所述目标页面内容相同的待显示页面时,将与所述待分析语音信息的语言类型一致且与所述目标页面内容相同的待显示页面发送至目标终端,以使所述目标终端展示所述待显示页面;When there is a page to be displayed that is consistent with the language type of the voice information to be analyzed and the content of the target page in the preset web page library, it will be consistent with the language type of the voice information to be analyzed and be consistent with the target page. Sending the page to be displayed with the same page content to the target terminal, so that the target terminal displays the page to be displayed;
    当预设网页页面库中不存在与所述待分析语音信息的语言类型一致且与所述目标页面内容相同的待显示页面时,将所述目标页面中的信息渲染为与所述待分析语音信息的语言类型一致的信息。When there is no page to be displayed in the preset web page library that is consistent with the language type of the voice information to be analyzed and has the same content as the target page, the information in the target page is rendered as the same as the voice to be analyzed Information with the same language type of information.
  17. 如权利要求15所述的电子设备,其中,所述计算机可读指令被所述处理器执行时,实现所述根据目标终端的IP地址确定目标终端所属的国家,并根据所述目标终端所属的国家确定网页中的语言类型的步骤,包括:The electronic device according to claim 15, wherein, when the computer-readable instructions are executed by the processor, the country to which the target terminal belongs is determined according to the IP address of the target terminal, and according to the country to which the target terminal belongs The steps for the country to determine the language type on the web page include:
    当无法根据目标终端的IP地址确定目标终端所属的国家时,根据预定规则确定网页中的语言类型。When the country to which the target terminal belongs cannot be determined according to the IP address of the target terminal, the language type in the web page is determined according to predetermined rules.
  18. 如权利要求18所述的电子设备,其中,所述计算机可读指令被所述处理器执行时,实现所述根据预定规则确定网页中的语言类型的步骤,包括:The electronic device according to claim 18, wherein, when the computer-readable instructions are executed by the processor, the step of determining the language type in the webpage according to a predetermined rule comprises:
    获取当前时间之前预定时间段内发来访问请求的所有发送端的IP地址所属的国家;Get the country where the IP addresses of all senders that send access requests within a predetermined time period before the current time belong to;
    针对每一国家,在所述预定时间段内发来访问请求的所有发送端的IP地址中获取属于该国家的IP地址的数目;For each country, obtain the number of IP addresses belonging to the country from the IP addresses of all senders that send access requests within the predetermined time period;
    基于所述数目获取目标国家;Obtain the target country based on the number;
    根据所述目标国家确定网页中的语言类型。Determine the language type in the webpage according to the target country.
  19. 如权利要求19所述的电子设备,其中,所述计算机可读指令被所述处理器执行时,实现所述基于所述数目获取目标国家的步骤,包括:The electronic device of claim 19, wherein, when the computer-readable instruction is executed by the processor, the step of obtaining the target country based on the number comprises:
    对各国家按照获取的所述数目从大到小进行排序;Sort the countries in descending order according to the number obtained;
    获取每一国家的访问高峰时间段;Get the peak visit time period of each country;
    获取每一国家的当地时间和预先为当地时间是否位于访问高峰时间段内而相应设置的评分修正方式;Obtain the local time of each country and the corresponding score correction method set in advance to determine whether the local time is within the peak visit period;
    针对每一国家,当该国家的当地时间位于该国家的访问高峰时间段时,获取预先为当地时间位于访问高峰时间段内而相应设置的评分修正方式,当该国家的当地时间不位于该国家的访问高峰时间段时,获取预先为当地时间不位于访问高峰时间段内而相应设置的评分修正方式;For each country, when the country’s local time is in the peak visit time zone of the country, obtain the corresponding score correction method set in advance for the local time in the peak visit time zone. When the country’s local time is not in the country During the peak visit period, obtain the corresponding score correction method set in advance for the local time not within the peak visit period;
    针对每一国家,按照针对该国家获取的所述评分修正方式,对该国家在所述排序中的序号进行修正,以得到该国家的评分;For each country, modify the country’s serial number in the ranking according to the score correction method obtained for that country to obtain the country’s score;
    获取所述评分最小的国家作为目标国家。Obtain the country with the smallest score as the target country.
PCT/CN2020/087473 2019-06-19 2020-04-28 Page translation method and apparatus, medium, and electronic device WO2020253389A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910533712.2 2019-06-19
CN201910533712.2A CN110362372B (en) 2019-06-19 2019-06-19 Page translation method, device, medium and electronic equipment

Publications (1)

Publication Number Publication Date
WO2020253389A1 true WO2020253389A1 (en) 2020-12-24

Family

ID=68217426

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/087473 WO2020253389A1 (en) 2019-06-19 2020-04-28 Page translation method and apparatus, medium, and electronic device

Country Status (2)

Country Link
CN (1) CN110362372B (en)
WO (1) WO2020253389A1 (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112966179A (en) * 2021-03-05 2021-06-15 北京百度网讯科技有限公司 Information unified management method, device, equipment and storage medium
CN113076164A (en) * 2021-04-16 2021-07-06 北京沃东天骏信息技术有限公司 Webpage language management method and device
CN113821747A (en) * 2021-08-31 2021-12-21 挂号网(杭州)科技有限公司 A data display method, device, storage medium and electronic device
CN114265650A (en) * 2021-11-30 2022-04-01 北京声智科技有限公司 Method, device and equipment for accessing small program, storage medium and computer program product
CN114300152A (en) * 2021-12-30 2022-04-08 浙江太美医疗科技股份有限公司 Method, device, device and storage medium for sending page data
CN114491359A (en) * 2021-12-28 2022-05-13 北京航天智造科技发展有限公司 Webpage internationalization processing method and device
CN114510308A (en) * 2022-01-28 2022-05-17 北京百度网讯科技有限公司 Method, device, equipment and medium for storing application page by mobile terminal
CN114510243A (en) * 2022-02-11 2022-05-17 中国农业银行股份有限公司 Page generation method, system, electronic equipment and storage medium
CN114546559A (en) * 2022-02-21 2022-05-27 深圳壹账通智能科技有限公司 Switching method, device, computer equipment and storage medium for multiple languages of pages
CN115065627A (en) * 2022-05-20 2022-09-16 北京奇艺世纪科技有限公司 Parameter modification method and device, electronic equipment and storage medium

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110362372B (en) * 2019-06-19 2022-04-05 深圳壹账通智能科技有限公司 Page translation method, device, medium and electronic equipment
CN111193713A (en) * 2019-12-05 2020-05-22 贵阳语玩科技有限公司 System and method for managing global data of different countries by single server cluster
CN111199427B (en) * 2019-12-31 2023-09-29 上海移为通信技术股份有限公司 Grouping management method and device for network users, electronic equipment and storage medium
CN113157354B (en) * 2020-01-07 2023-11-03 北京京东振世信息技术有限公司 Method, apparatus, device and computer readable medium for processing data
CN111427647B (en) * 2020-03-20 2024-07-09 北京字节跳动网络技术有限公司 Page display method and device of application program, storage medium and electronic equipment
CN112149072A (en) * 2020-09-22 2020-12-29 北京达佳互联信息技术有限公司 Identity authentication method, device, equipment and medium for platform user
CN113961286A (en) * 2021-10-11 2022-01-21 支付宝(杭州)信息技术有限公司 Page generation method, device and equipment for application program
CN114489557B (en) * 2021-12-15 2024-03-22 青岛海尔科技有限公司 Voice interaction method, device, equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6353849B1 (en) * 1996-12-20 2002-03-05 Intel Corporation System and server for providing customized web information based on attributes of the requestor
CN101567906A (en) * 2009-05-25 2009-10-28 阿里巴巴集团控股有限公司 Method and server for confirming the webpage content language
US20110313755A1 (en) * 2009-02-10 2011-12-22 Oh Eui Jin Multilanguage web page translation system and method for translating a multilanguage web page and providing the translated web page
CN104598271A (en) * 2014-12-29 2015-05-06 福建联迪商用设备有限公司 Method, device and system for automatically setting language of Internet equipment
CN104794625A (en) * 2015-04-28 2015-07-22 酷悠悠科技(深圳)有限公司 Operation method and system of cross-border e-commerce website
CN105868320A (en) * 2016-03-25 2016-08-17 乐视控股(北京)有限公司 Display method, device and system
CN110362372A (en) * 2019-06-19 2019-10-22 深圳壹账通智能科技有限公司 Page translation method, device, medium and electronic equipment

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104239459B (en) * 2014-09-02 2018-03-09 百度在线网络技术(北京)有限公司 voice search method, device and system
CN107391122B (en) * 2017-07-01 2020-03-27 珠海格力电器股份有限公司 Method and device for setting system language of terminal and terminal
CN109068010A (en) * 2018-11-06 2018-12-21 上海闻泰信息技术有限公司 voice content recording method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6353849B1 (en) * 1996-12-20 2002-03-05 Intel Corporation System and server for providing customized web information based on attributes of the requestor
US20110313755A1 (en) * 2009-02-10 2011-12-22 Oh Eui Jin Multilanguage web page translation system and method for translating a multilanguage web page and providing the translated web page
CN101567906A (en) * 2009-05-25 2009-10-28 阿里巴巴集团控股有限公司 Method and server for confirming the webpage content language
CN104598271A (en) * 2014-12-29 2015-05-06 福建联迪商用设备有限公司 Method, device and system for automatically setting language of Internet equipment
CN104794625A (en) * 2015-04-28 2015-07-22 酷悠悠科技(深圳)有限公司 Operation method and system of cross-border e-commerce website
CN105868320A (en) * 2016-03-25 2016-08-17 乐视控股(北京)有限公司 Display method, device and system
CN110362372A (en) * 2019-06-19 2019-10-22 深圳壹账通智能科技有限公司 Page translation method, device, medium and electronic equipment

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112966179B (en) * 2021-03-05 2024-03-12 北京百度网讯科技有限公司 Unified management methods, devices, equipment and storage media for information
CN112966179A (en) * 2021-03-05 2021-06-15 北京百度网讯科技有限公司 Information unified management method, device, equipment and storage medium
CN113076164A (en) * 2021-04-16 2021-07-06 北京沃东天骏信息技术有限公司 Webpage language management method and device
CN113076164B (en) * 2021-04-16 2024-04-16 北京沃东天骏信息技术有限公司 Webpage language management method and device
CN113821747A (en) * 2021-08-31 2021-12-21 挂号网(杭州)科技有限公司 A data display method, device, storage medium and electronic device
CN114265650A (en) * 2021-11-30 2022-04-01 北京声智科技有限公司 Method, device and equipment for accessing small program, storage medium and computer program product
CN114491359A (en) * 2021-12-28 2022-05-13 北京航天智造科技发展有限公司 Webpage internationalization processing method and device
CN114300152A (en) * 2021-12-30 2022-04-08 浙江太美医疗科技股份有限公司 Method, device, device and storage medium for sending page data
CN114510308A (en) * 2022-01-28 2022-05-17 北京百度网讯科技有限公司 Method, device, equipment and medium for storing application page by mobile terminal
CN114510308B (en) * 2022-01-28 2023-10-03 北京百度网讯科技有限公司 Method, device, equipment and medium for storing application page by mobile terminal
CN114510243A (en) * 2022-02-11 2022-05-17 中国农业银行股份有限公司 Page generation method, system, electronic equipment and storage medium
CN114546559A (en) * 2022-02-21 2022-05-27 深圳壹账通智能科技有限公司 Switching method, device, computer equipment and storage medium for multiple languages of pages
CN115065627A (en) * 2022-05-20 2022-09-16 北京奇艺世纪科技有限公司 Parameter modification method and device, electronic equipment and storage medium
CN115065627B (en) * 2022-05-20 2024-04-12 北京奇艺世纪科技有限公司 Parameter modification method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN110362372A (en) 2019-10-22
CN110362372B (en) 2022-04-05

Similar Documents

Publication Publication Date Title
WO2020253389A1 (en) Page translation method and apparatus, medium, and electronic device
US20130159920A1 (en) Scenario-adaptive input method editor
US9304990B2 (en) Translation of text into multiple languages
CN108717437B (en) Search result display method and device and storage medium
US20110307776A1 (en) Transcoding a web page
US20220300573A1 (en) Method for presenting information, electronic device, and storage medium
WO2015081848A1 (en) Socialized extended search method and corresponding device and system
CN102541853A (en) Method and device which are capable of obtaining application information by utilizing browser address bar
CN110851136A (en) Data acquisition method, device, electronic device and storage medium
WO2019071907A1 (en) Method for identifying help information based on operation page, and application server
CN111444235A (en) Django-based data serialization method, device, computer equipment and storage medium
CN105893396B (en) Interpreting user queries based on nearby locations
RU2631975C2 (en) Method and system for user input command processing
CN111857934A (en) A page loading method, device, electronic device and storage medium
US11379664B2 (en) Method for acquiring a parallel corpus, electronic device, and storage medium
PH12015500034B1 (en) A web browser operation method and system
CN111680247A (en) Local calling method, device, equipment and storage medium of webpage character string
US8892596B1 (en) Identifying related documents based on links in documents
CN101772196A (en) Method and system for processing message sent by mobile terminal and acting server
CN104504039B (en) A kind of method and apparatus scanned for based on mobile device
CN114896543A (en) Public opinion analysis method, device and storage medium
CN114519110A (en) Public opinion text display method and device
WO2017197889A1 (en) Keyword link method, device and system
US10819784B1 (en) API mediation for online services
TWI407321B (en) Device and method for processing customized web pages

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20826440

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20826440

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 310322)

122 Ep: pct application non-entry in european phase

Ref document number: 20826440

Country of ref document: EP

Kind code of ref document: A1