Method and device for displaying pages in multiple languages

Querying material resources of various material types and language types through middleware solves the problem of excessive server disk space usage, realizes unified management and distributed storage of material resources, reduces server load and supports dynamic switching.

CN113742010BActive Publication Date: 2024-10-18BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010474452.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-05-29
Publication Date
2024-10-18
Estimated Expiration
2040-05-29

AI Technical Summary

Technical Problem

In the existing technology, each server is configured with multiple configuration files of different language categories, which results in excessive disk space usage and the inability to achieve dynamic switching.

Method used

Query the material resources of each material type and language type through middleware, realize unified management and distributed storage of material resources, reduce the load of a single server, reduce disk space occupation, and realize dynamic switching.

Benefits of technology

It achieves unified management and distributed storage of material resources, reduces the load on a single server, reduces disk space occupation, and supports dynamic switching.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113742010B_ABST
    Figure CN113742010B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for displaying a page in multiple languages, and relates to the field of computer technology. A specific implementation of the method includes: receiving an access request for a page, the access request including: a material type, a resource identifier, and a target language category; sending the access request to a target middleware corresponding to the material type, so as to use the target middleware to query a target resource corresponding to the resource identifier and the target language category; receiving the target resource returned by the target middleware to display the target resource. This implementation can achieve unified management and distributed storage of material resources by querying material resources of various material types and language types through the middleware, reduce the load of a single server, reduce disk space usage, and achieve dynamic switching.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and device for displaying a page in multiple languages. Background Art

[0002] At present, the implementation scheme of multi-language internationalization of pages is usually to pre-write multiple configuration files of different language categories and store them in the local server disk. When the server starts, all configuration files are loaded into the server memory at one time, and the front-end uses the template engine tag to determine which language category configuration file to use.

[0003] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:

[0004] Each server is configured with multiple configuration files of different language categories. Too many configuration files will take up a lot of server disk space and cannot be switched dynamically. Summary of the invention

[0005] In view of this, an embodiment of the present invention provides a method and device for displaying a page in multiple languages. By querying material resources of various material types and language types through middleware, unified management and distributed storage of material resources can be achieved, the load of a single server can be reduced, disk space occupancy can be reduced, and dynamic switching can be achieved.

[0006] According to one aspect of an embodiment of the present invention, a method for displaying a page in multiple languages ​​is provided, comprising:

[0007] receiving a page access request, the access request including: a material type, a resource identifier, and a target language category;

[0008] Sending the access request to a target middleware corresponding to the material type, so as to query a target resource corresponding to the resource identifier and the target language category by using the target middleware;

[0009] The target resource returned by the target middleware is received to display the target resource.

[0010] Optionally, before sending the access request to the target middleware corresponding to the material type, the method further includes: confirming that there is no target resource corresponding to the resource identifier and the target language category in the cache;

[0011] After receiving the target resource returned by the target middleware, the method further includes: saving the target resource into the cache.

[0012] Optionally, the method of the embodiment of the present invention further includes: receiving a resource change notification pushed by the target middleware in response to a resource modification request of a user, and updating the cache according to the resource change notification.

[0013] Optionally, the material type is picture, and the target middleware is picture multilingual middleware;

[0014] Utilizing the target middleware to query a target resource corresponding to the resource identifier and the target language category includes:

[0015] The image multi-language middleware is used to query the image template and image template information corresponding to the resource identifier, and the template subgraph corresponding to the resource identifier and the target language category, and the image multi-language middleware is used to merge the template subgraph into the image template according to the image template information to obtain the target resource.

[0016] Optionally, the picture template information includes: sub-picture position information;

[0017] Merging the template sub-image into the picture template according to the picture template information includes: determining the position of the template sub-image in the picture template according to the sub-image position information, and inserting the template sub-image into the picture template according to the position.

[0018] Optionally, the picture template information further includes: sub-picture size information;

[0019] Before inserting the template sub-image into the picture template according to the position, the method further includes: verifying the template sub-image according to the sub-image size information, and confirming that the verification passes.

[0020] Optionally, the material type is video, and the target middleware is video multilingual middleware;

[0021] Utilizing the target middleware to query a target resource corresponding to the resource identifier and the target language category includes:

[0022] The video multi-language middleware is used to query the video template corresponding to the resource identifier and the audio template corresponding to the resource identifier and the target language category, and the video multi-language middleware is used to merge the video template and the audio template to obtain the target resource.

[0023] Optionally, the material type is text, and the target middleware is text multilingual middleware;

[0024] Utilizing the target middleware to query a target resource corresponding to the resource identifier and the target language category includes:

[0025] The multi-language material resource corresponding to the resource identifier is searched by the video multi-language middleware, and the material resource corresponding to the target language category is selected from the multi-language material resources by the video multi-language middleware as the target resource.

[0026] According to a second aspect of an embodiment of the present invention, there is provided a device for displaying a page in multiple languages, comprising: a request processing module and a middleware module; wherein:

[0027] The request processing module receives a page access request and sends the access request to a target middleware corresponding to the material type in the middleware module; the access request includes: material type, resource identifier and target language category;

[0028] The target middleware module queries the target resource corresponding to the resource identifier and the target language category, and returns the query to the request processing module;

[0029] The request processing module receives the target resource returned by the target middleware to display the target resource.

[0030] Optionally, the request processing module is further used to: before sending the access request to the target middleware corresponding to the material type in the middleware module, confirm that there is no target resource corresponding to the resource identifier and the target language category in the cache;

[0031] The request processing module is further configured to: after receiving the target resource returned by the target middleware, save the target resource into the cache.

[0032] Optionally, the request processing module is further used to: receive a resource change notification pushed by the target middleware in response to a user's resource modification request, and update the cache according to the resource change notification.

[0033] Optionally, the material type is a picture, and the target middleware module includes a picture multi-language middleware;

[0034] The target middleware module searches for a target resource corresponding to the resource identifier and the target language category, including:

[0035] The image multi-language middleware queries the image template and image template information corresponding to the resource identifier, and the template subgraph corresponding to the resource identifier and the target language category. The image multi-language middleware merges the template subgraph into the image template according to the image template information to obtain the target resource.

[0036] Optionally, the picture template information includes: sub-picture position information;

[0037] Merging the template sub-image into the picture template according to the picture template information includes: determining the position of the template sub-image in the picture template according to the sub-image position information, and inserting the template sub-image into the picture template according to the position.

[0038] Optionally, the picture template information further includes: sub-picture size information;

[0039] Before inserting the template sub-image into the picture template according to the position, the method further includes: verifying the template sub-image according to the sub-image size information, and confirming that the verification passes.

[0040] Optionally, the material type is video, and the middleware is video multilingual middleware;

[0041] The target middleware searches for a target resource corresponding to the resource identifier and the target language category, including:

[0042] The video multi-language middleware queries the video template corresponding to the resource identifier and the audio template corresponding to the resource identifier and the target language category, and uses the video multi-language middleware to merge the video template and the audio template to obtain the target resource.

[0043] Optionally, the material type is text, and the middleware is text multilingual middleware;

[0044] Utilizing the middleware to query a target resource corresponding to the resource identifier and the target language category includes:

[0045] The multi-language material resource corresponding to the resource identifier is searched by the video multi-language middleware, and the material resource corresponding to the target language category is selected from the multi-language material resources by the video multi-language middleware as the target resource.

[0046] According to a third aspect of an embodiment of the present invention, there is provided an electronic device for displaying pages in multiple languages, including:

[0047] one or more processors;

[0048] a storage device for storing one or more programs,

[0049] When the one or more programs are executed by the one or more processors, the one or more processors implement the method provided in the first aspect of the embodiment of the present invention.

[0050] According to a fourth aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored, and when the program is executed by a processor, the method provided by the first aspect of the embodiment of the present invention is implemented.

[0051] An embodiment of the above invention has the following advantages or beneficial effects: by querying material resources of various material types and language types through the middleware, unified management and distributed storage of material resources can be achieved, the load of a single server can be reduced, disk space occupancy can be reduced, and dynamic switching can be achieved.

[0052] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0054] Figure 1 This is a schematic diagram of the main process of the method for displaying a page in multiple languages ​​according to an embodiment of the present invention;

[0055] Figure 2 A schematic diagram of a picture template in an optional embodiment of the present invention is shown;

[0056] Figure 3 A schematic diagram of a template subgraph in an optional embodiment of the present invention is shown;

[0057] Figure 4 A schematic diagram showing a picture material resource in an optional embodiment of the present invention;

[0058] Figure 5 is a schematic diagram of a method for displaying a page in multiple languages ​​in an optional embodiment of the present invention;

[0059] Figure 6 Schematic diagram of the system framework of the method for displaying pages in multiple languages ​​in an optional embodiment of the present invention;

[0060] Figure 7 It is a schematic diagram of main modules of a device for displaying pages in multiple languages ​​according to an embodiment of the present invention;

[0061] Figure 8 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0062] Fig. 9 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0063] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0064] According to one aspect of an embodiment of the present invention, a method for displaying a page in multiple languages ​​is provided.

[0065] Figure 1 is a schematic diagram of the main flow of the method for displaying multiple languages ​​on a page according to an embodiment of the present invention. Figure 1 As shown, the method for displaying a page in multiple languages ​​includes: step S101, step S102 and step S103.

[0066] Step S101: receiving a page access request, wherein the access request includes: a material type, a resource identifier, and a target language category.

[0067] The material type classification method can be selectively set according to the actual situation. For example, the material can be classified into text, picture, and video according to its file format. For another example, the material can be classified into static material and dynamic material according to its attributes. The resource identifier is used to uniquely identify a resource, such as a picture, a text, a video, etc. The language category refers to the language type, such as Chinese, English, French, etc.

[0068] In step S102, the access request is sent to the target middleware corresponding to the material type, so as to query the target resource corresponding to the resource identifier and the target language category by using the target middleware. In step S103, the target resource returned by the target middleware is received to display the target resource.

[0069] Each middleware corresponds to a material type and is used to search for various material resources in the material type. By querying the material resources of various material types and language types through the middleware, it is possible to achieve unified management and distributed storage of material resources, reduce the load of a single server, reduce disk space usage, and achieve dynamic switching.

[0070] In actual application, a unified multi-language material management platform can be used to manage all material resources. Each material resource can be managed based on a relational database. For example, the unified resource table shown in Table 1 below is used to manage material resources of each material type:

[0071] Table 1 Unified resource table

[0072] uid ukey resource_type 1 fy text 2 cap picture .. .. video

[0073] In Table 1, uid represents the uniform resource identifier (id), ukey represents the key of the uniform resource, and resource_type represents the material type. Each material resource (text, picture, video, etc.) has a unique ukey. You can use the ukey and language category to locate a specific material resource. For example, "fy+Chinese" corresponds to "French", and "fy+English" corresponds to "French"; "French" and "French" are material resources, "fy" is ukey, and "Chinese" or "English" is the language category.

[0074] Optionally, before sending the access request to the target middleware corresponding to the material type, the method further includes: confirming that the target resource corresponding to the resource identifier and the target language category does not exist in the cache. After receiving the target resource returned by the target middleware, the method further includes: saving the target resource to the cache. By setting up a cache, the consumption of system resources can be reduced and the system response speed can be improved.

[0075] Optionally, the method of the embodiment of the present invention further includes: receiving a resource change notification pushed by the target middleware in response to a resource modification request of a user, and updating the cache according to the resource change notification. In this embodiment, a user can perform operations such as adding, deleting, modifying, and checking on each material resource, and the middleware can push a resource change notification to the server in response to the operations such as adding, deleting, modifying, and checking, so that the server updates the data in its cache according to the resource change notification. When the configuration information of a material resource changes (for example, modifying existing configuration information or expanding new material resources, etc.), it can take effect immediately without restarting the application server, thereby realizing dynamic switching.

[0076] In some optional embodiments, the material type is a picture, and the target middleware is a picture multi-language middleware. Using the target middleware to query the target resource corresponding to the resource identifier and the target language category includes: using the picture multi-language middleware to query the picture template and picture template information corresponding to the resource identifier, and the template subgraph corresponding to the resource identifier and the target language category, and using the picture multi-language middleware to merge the template subgraph into the picture template according to the picture template information to obtain the target resource.

[0077] The picture template information is used to describe the insertion method or insertion position of the sub-picture in the picture template. Optionally, the picture template information includes: sub-picture position information; merging the template sub-picture into the picture template according to the picture template information includes: determining the position of the template sub-picture in the picture template according to the sub-picture position information, and inserting the template sub-picture into the picture template according to the position. The picture template information may also include: sub-picture size information. Before inserting the template sub-picture into the picture template according to the position, it also includes: verifying the template sub-picture according to the sub-picture size information, and confirming that the verification passes.

[0078] Exemplarily, for a material resource whose material type is a picture, the picture template table shown in Table 1 and the template sub-picture view table shown in Table 2 below can be used to manage each material resource:

[0079] Table 1 Picture template table

[0080] id ukey address sub_x sub_y sub_length sub_width 1 cap / .. / cup.jpg 20 50 100 50 2 bottle / .. / bottle.jpg 30 60 100 50 … … … … … … …

[0081] Table 2 Picture template table

[0082] id ukey language_type sub_address resource_value 1 cap English / .. / cap-name-en.jpg / .. / cap-en.jpg 2 cap Chinese / .. / cap-name-ch.jpg / .. / cap-ch.jpg … … … … …

[0083] In Table 1, id represents the unique identifier of the field, ukey represents the key of the unified resource, address represents the template image address, sub_x represents the horizontal coordinate of the upper left corner of the sub-image, sub_y represents the vertical coordinate of the upper left corner of the sub-image, sub_length represents the state length, and sub_width represents the width of the sub-image. Figure 2 An example of an image template is shown. In Table 2, id represents a field unique identifier, ukey represents a uniform resource key, language_type represents a language category, sub_address represents a sub-image address, and resource_value represents a page final view address. Figure 3 An example of a template subgraph is shown.

[0084] Using an image template and sub-images of different language categories, you can create multiple final page views. With the uniform resource ukey and language category language_type as parameters, you can determine a unique resource_value and return it to the front-end page for rendering. Figure 4 Shown according to Figure 2 Image templates and Figure 3 The final view of the page created by the template submap.

[0085] In some other optional embodiments, the material type is video, and the target middleware is video multi-language middleware. Using the target middleware to query the target resource corresponding to the resource identifier and the target language category includes: using the video multi-language middleware to query the video template corresponding to the resource identifier and the audio template corresponding to the resource identifier and the target language category, and using the video multi-language middleware to merge the video template and the audio template to obtain the target resource.

[0086] For example, for a material resource whose material type is a video, the video template table shown in Table 3 below may be used to manage each material resource:

[0087] Table 3 Video template table

[0088] id ukey video_address 1 pen / .. / pen.mp3 2 book / .. / boook.mp3 … … …

[0089] In Table 3, id represents the video template id, ukey represents the key of the video template unified resource, and video_address represents the video template address. video_address is the video address without audio. For a video template (one video template corresponds to one ukey), select audio of different language categories to generate the final video. The page uses ukey and language category language-type as parameters to query the final video file. The final video synthesized by different laguage_type audio files is shown in Table 4 below:

[0090] Table 4 Video final results

[0091] id ukey language-type audio_address resource_value pen Chinese / .. / pen-ch.wav / .. / pen-res.mp3 book English / .. / book-en.wav / .. / pen-res.mp3 … … … … …

[0092] In Table 4, id represents the video template id, ukey represents the key of the video template unified resource, language-type represents the language category, audio_address represents the audio of different language categories, and resource_value represents the final video containing the audio.

[0093] In some other optional embodiments, the material type is text, and the target middleware is text multilingual middleware. Using the target middleware to query the target resource corresponding to the resource identifier and the target language category includes: using the video multilingual middleware to query the multilingual material resource corresponding to the resource identifier, and using the video multilingual middleware to select the material resource corresponding to the target language category from the multilingual material resources as the target resource.

[0094] For example, for a material resource whose material type is text, the text multi-language table shown in Table 5 below can be used to manage each material resource:

[0095] Table 5 Text multi-language table

[0096] id ukey resource_value language_type 1 fy French Chinese 2 fy French English … … … …

[0097] In Table 5, id represents the unique identifier of the field, ukey represents the key of the unified resource, resource_value represents the value corresponding to the resource id, and language_type represents the language category. With the unified resource ukey and the language category language_type as parameters, a unique target resource resource_value can be determined for use by the front-end page.

[0098] Figure 5 It is a schematic diagram of the method for multilingual display of a page in an optional embodiment of the present invention. In this embodiment, the materials in the front-end page are subdivided into text, picture and video types, and each material that needs to be internationalized in multiple languages ​​has a separate unified resource ukey. When the user refreshes the page, after the page back-end server receives the access request, it uses the material type, resource ukey and target language category in the page as parameters to request the middleware server of the corresponding type. Finally, when the middleware returns the result, it is saved in the local cache of the page back-end server and displayed to the user at the same time. When the system administrator modifies the configuration of a certain language category on the multilingual unified material management platform, it will be notified to each page back-end server in real time through the middleware. The cache listener in the back-end server is responsible for receiving the latest configuration information and updating it to the local cache.

[0099] Figure 6 Schematic diagram of the system framework of the method for displaying pages in multiple languages ​​in an optional embodiment of the present invention. Figure 6 In the illustrated embodiment:

[0100] The page front-end server is the medium for direct interaction between the user and the entire information system. The user can trigger an event in the browser of the front-end server, and the back-end server will respond and render the information to the front-end page. The front-end page elements include text, pictures, videos, audio and other materials. In this embodiment, each text that needs to be implemented in multiple languages ​​has a unified resource text ukey, and each picture that needs to be implemented in multiple languages ​​has a unified resource picture template ukey and a picture template address. Each video that needs to be implemented in multiple languages ​​has a unified resource video template ukey and a video link address.

[0101] The page backend server includes a multilingual request processing module, a local cache module, and a cache listening module. The multilingual request processing module is used to receive multilingual query requests from the front-end page, and then query the request results from the local cache module. If the cache does not contain the request result, the multilingual middleware is called to return the query result, and finally returned to the front-end page server. The local cache module is used to cache the multilingual data of various materials in the front-end page, such as text, pictures, and videos. Each time the result is returned from the multilingual middleware, it will be synchronously saved to the local cache module to reduce the interaction between the WEB server and the external system, improve the request processing speed and reduce the response time. The cache listening module is mainly used to monitor international language change messages and update local cache data. After the system administrator adjusts the value corresponding to the multilingual key on the unified material management platform, for example, the multilingual value "France" corresponding to "fy" is changed to "French", the unified material management platform will push this message to the multilingual middleware, and then the middleware will push it to the cache listening module. The cache monitoring module updates the latest data to the local cache. When the user actively refreshes the page or uses the page monitoring device to monitor the data in the back-end cache, the latest content can be rendered to the front-end page.

[0102] The multi-language middleware is divided into "text multi-language middleware", "image multi-language middleware" and "video multi-language middleware". It is used to connect the page backend server and various material types (such as text, image, video) storage and unified material management platform, and return the specified value to the page backend server.

[0103] After the system administrator modifies the data on the multilingual unified material management platform, the multilingual middleware receives the request and pushes it to the backend server. The backend server updates the local cache to always keep the latest status of the data.

[0104] Unified material management platform: It is a page material management platform based on a relational database (non-relational databases such as redis can also be used, but in terms of complexity, it is more suitable to use a relational database to build a page material management platform). In this embodiment, a multilingual material unified management platform is used to store data information such as a unified resource table, a picture template table, a sub-picture and a final page view table, a video template table, and a video final result table. At the same time, it is responsible for uploading pictures, etc. After the user selects the language category, the final page view is generated by the middleware and stored in the data table. Exemplarily, for material resources whose material type is a picture, the middleware can generate the corresponding material resources according to the following steps: First, select a picture template, then select a language category and upload a sub-picture. Then, check whether the sub-picture meets the rules defined in the picture template information (such as length, width, etc.). If the check passes, the sub-picture is merged into the picture template, the final video is obtained and saved, and then the process ends. Otherwise, the process ends.

[0105] This embodiment uses different methods to achieve multi-language internationalization for different material types (text, pictures, videos, etc.), and realizes unified management, dynamic switching and distributed storage of materials. Distributed storage can realize language configuration distributed data storage, reduce the disk storage pressure of a single server, etc.; realize dynamic switching to improve the flexibility and scalability of the program; and realize the multi-language internationalization function of pictures and video materials in the page.

[0106] According to a second aspect of an embodiment of the present invention, a device for implementing the above method is provided.

[0107] Figure 7 is a schematic diagram of the main modules of the device for displaying pages in multiple languages ​​according to an embodiment of the present invention. Figure 7 As shown, the apparatus 700 for displaying a page in multiple languages ​​includes: a request processing module and a middleware module; wherein,

[0108] The request processing module receives a page access request and sends the access request to a target middleware corresponding to the material type in the middleware module; the access request includes: material type, resource identifier and target language category;

[0109] The target middleware module queries the target resource corresponding to the resource identifier and the target language category, and returns the query to the request processing module;

[0110] The request processing module receives the target resource returned by the target middleware to display the target resource.

[0111] Optionally, the request processing module is further used to: before sending the access request to the target middleware corresponding to the material type in the middleware module, confirm that there is no target resource corresponding to the resource identifier and the target language category in the cache;

[0112] The request processing module is further configured to: after receiving the target resource returned by the target middleware, save the target resource into the cache.

[0113] Optionally, the request processing module is further used to: receive a resource change notification pushed by the target middleware in response to a user's resource modification request, and update the cache according to the resource change notification.

[0114] Optionally, the material type is a picture, and the target middleware module includes a picture multi-language middleware;

[0115] The target middleware module searches for a target resource corresponding to the resource identifier and the target language category, including:

[0116] The image multi-language middleware queries the image template and image template information corresponding to the resource identifier, and the template subgraph corresponding to the resource identifier and the target language category. The image multi-language middleware merges the template subgraph into the image template according to the image template information to obtain the target resource.

[0117] Optionally, the picture template information includes: sub-picture position information;

[0118] Merging the template sub-image into the picture template according to the picture template information includes: determining the position of the template sub-image in the picture template according to the sub-image position information, and inserting the template sub-image into the picture template according to the position.

[0119] Optionally, the picture template information further includes: sub-picture size information;

[0120] Before inserting the template sub-image into the picture template according to the position, the method further includes: verifying the template sub-image according to the sub-image size information, and confirming that the verification passes.

[0121] Optionally, the material type is video, and the middleware is video multilingual middleware;

[0122] The target middleware searches for a target resource corresponding to the resource identifier and the target language category, including:

[0123] The video multi-language middleware queries the video template corresponding to the resource identifier and the audio template corresponding to the resource identifier and the target language category, and uses the video multi-language middleware to merge the video template and the audio template to obtain the target resource.

[0124] Optionally, the material type is text, and the middleware is text multilingual middleware;

[0125] Utilizing the middleware to query a target resource corresponding to the resource identifier and the target language category includes:

[0126] The multi-language material resource corresponding to the resource identifier is searched by the video multi-language middleware, and the material resource corresponding to the target language category is selected from the multi-language material resources by the video multi-language middleware as the target resource.

[0127] According to a third aspect of an embodiment of the present invention, there is provided an electronic device for displaying pages in multiple languages, including:

[0128] one or more processors;

[0129] a storage device for storing one or more programs,

[0130] When the one or more programs are executed by the one or more processors, the one or more processors implement the method provided in the first aspect of the embodiment of the present invention.

[0131] According to a fourth aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored, and when the program is executed by a processor, the method provided by the first aspect of the embodiment of the present invention is implemented.

[0132] Figure 8 An exemplary system architecture 800 is shown to which the method for displaying a page in multiple languages ​​or the apparatus for displaying a page in multiple languages ​​according to an embodiment of the present invention may be applied.

[0133] like Figure 8 As shown, the system architecture 800 may include terminal devices 801, 802, 803, a network 804, and a server 805. The network 804 is used to provide a medium for communication links between the terminal devices 801, 802, 803, and the server 805. The network 804 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.

[0134] The user can use the terminal devices 801, 802, 803 to interact with the server 805 through the network 804 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 801, 802, 803, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).

[0135] The terminal devices 801 , 802 , and 803 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0136] The server 805 may be a server that provides various services, such as a backend management server (only as an example) that provides support for shopping websites browsed by users using the terminal devices 801, 802, and 803. The backend management server may analyze and process the received data such as product information query requests, and feed back the processing results (such as target push information, product information - only as an example) to the terminal device.

[0137] It should be noted that the method for displaying a page in multiple languages ​​provided in the embodiment of the present invention is generally executed by the server 805 , and accordingly, the device for displaying a page in multiple languages ​​is generally disposed in the server 805 .

[0138] It should be understood that Figure 8The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0139] Reference below Fig. 9 , which shows a schematic diagram of the structure of a computer system 900 of a terminal device suitable for implementing an embodiment of the present invention. Fig. 9 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0140] like Fig. 9 As shown, the computer system 900 includes a central processing unit (CPU) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage part 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the system 900 are also stored. The CPU 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0141] The following components are connected to the I / O interface 905: an input section 906 including a keyboard, a mouse, etc.; an output section 907 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 908 including a hard disk, etc.; and a communication section 909 including a network interface card such as a LAN card, a modem, etc. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the I / O interface 905 as needed. A removable medium 911, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 910 as needed, so that a computer program read therefrom is installed into the storage section 908 as needed.

[0142] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 909, and / or installed from the removable medium 911. When the computer program is executed by the central processing unit (CPU) 901, the above-mentioned functions defined in the system of the present invention are executed.

[0143] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0144] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0145] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be set in a processor, for example, it may be described as: a processor includes: a request processing module and a middleware module. The names of these modules do not constitute a limitation on the modules themselves in some cases, for example, the middleware module may also be described as a "module for receiving access requests for pages".

[0146] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: receiving a page access request, the access request includes: material type, resource identifier and target language category; sending the access request to the target middleware corresponding to the material type, so as to use the target middleware to query the target resource corresponding to the resource identifier and the target language category; receiving the target resource returned by the target middleware, so as to display the target resource.

[0147] According to the technical solution of the embodiment of the present invention, by querying the material resources of various material types and language types through the middleware, unified management and distributed storage of material resources can be achieved, the load of a single server can be reduced, the disk space occupancy can be reduced, and dynamic switching can be achieved.

[0148] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for displaying a page in multiple languages, characterized in that: include: receiving a page access request, the access request including: a material type, a resource identifier, and a target language category; Sending the access request to a target middleware corresponding to the material type, so as to query a target resource corresponding to the resource identifier and the target language category by using the target middleware; receiving the target resource returned by the target middleware to display the target resource; Wherein, the material type is a picture, and the target middleware is a picture multi-language middleware; using the target middleware to query the target resource corresponding to the resource identifier and the target language category includes: using the picture multi-language middleware to query the picture template and picture template information corresponding to the resource identifier, and the template subgraph corresponding to the resource identifier and the target language category, and using the picture multi-language middleware to merge the template subgraph into the picture template according to the picture template information to obtain the target resource; or, The material type is video, and the target middleware is video multi-language middleware; using the target middleware to query the target resource corresponding to the resource identifier and the target language category includes: using the video multi-language middleware to query the video template corresponding to the resource identifier and the audio template corresponding to the resource identifier and the target language category, and using the video multi-language middleware to merge the video template and the audio template to obtain the target resource; or The material type is text, and the target middleware is text multilingual middleware; using the target middleware to query the target resource corresponding to the resource identifier and the target language category includes: using the text multilingual middleware to query the multilingual material resource corresponding to the resource identifier, and using the text multilingual middleware to filter the material resource corresponding to the target language category from the multilingual material resources as the target resource.

2. The method according to claim 1, characterized in that Before sending the access request to the target middleware corresponding to the material type, the method further includes: confirming that there is no target resource corresponding to the resource identifier and the target language category in the cache; After receiving the target resource returned by the target middleware, the method further includes: saving the target resource into the cache.

3. The method according to claim 2, characterized in that Also includes: A resource change notification pushed by the target middleware in response to a resource modification request of a user is received, and the cache is updated according to the resource change notification.

4. The method according to claim 1, characterized in that The picture template information includes: sub-picture position information; Merging the template sub-image into the picture template according to the picture template information includes: determining the position of the template sub-image in the picture template according to the sub-image position information, and inserting the template sub-image into the picture template according to the position.

5. The method according to claim 4, characterized in that The picture template information also includes: sub-picture size information; Before inserting the template sub-image into the picture template according to the position, the method further includes: verifying the template sub-image according to the sub-image size information, and confirming that the verification passes.

6. A device for displaying pages in multiple languages, characterized in that: include: Request processing module and middleware module; among them, The request processing module receives a page access request and sends the access request to a target middleware in the middleware module that corresponds to the material type in the access request; the access request includes: material type, resource identifier and target language category; The target middleware queries the target resource corresponding to the resource identifier and the target language category, and returns the query to the request processing module; The request processing module receives the target resource returned by the target middleware to display the target resource; Wherein, the material type is a picture, and the target middleware is a picture multi-language middleware; the target middleware queries the target resource corresponding to the resource identifier and the target language category, including: the picture multi-language middleware queries the picture template and picture template information corresponding to the resource identifier, and the template subgraph corresponding to the resource identifier and the target language category, and the picture multi-language middleware merges the template subgraph into the picture template according to the picture template information to obtain the target resource; or, The material type is video, and the target middleware is video multi-language middleware; the target middleware queries the target resource corresponding to the resource identifier and the target language category, including: the video multi-language middleware queries the video template corresponding to the resource identifier, and the audio template corresponding to the resource identifier and the target language category, and the video multi-language middleware merges the video template and the audio template to obtain the target resource; or, The material type is text, and the target middleware is text multilingual middleware; the target middleware queries the target resource corresponding to the resource identifier and the target language category, including: the text multilingual middleware queries the multilingual material resource corresponding to the resource identifier, and the text multilingual middleware selects the material resource corresponding to the target language category from the multilingual material resources as the target resource.

7. An electronic device with multi-language page display, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 5.

8. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Augmenting Middleware Communication Services

    CN104052792A

  • Interface switching method and device

    CN111061535A