Method and device for realizing real-time multi-language conversion

By processing business requests and real-time conversion based on multilingual resources in the cache, the problems of low efficiency and difficult maintenance of traditional multilingual conversion methods are solved, and real-time conversion of multilingual and optimized user experience is realized.

CN118170480BActive Publication Date: 2025-02-11NUCTECH JIANGSU CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410269567.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-08
Publication Date
2025-02-11
Estimated Expiration
2044-03-08

AI Technical Summary

Technical Problem

Traditional multilingual conversion methods have problems such as low conversion efficiency and difficulty in maintaining, and it is difficult to meet the needs of international services.

Method used

By receiving service requests, processing requests are made to obtain unified output objects and service output objects, obtaining and adding conversion characteristics to the list to be converted, real-time conversion is performed based on multilingual resources in the cache, and the converted unified output objects are generated.

Benefits of technology

Real-time multilingual conversion is realized, user experience is optimized, conversion characteristics and resources are dynamically configured, and the needs and business scenarios are flexibly responded to different languages ​​and business scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118170480B_ABST
    Figure CN118170480B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a method and device for realizing real-time multi-language conversion. The method includes: receiving a business request; processing the business request to obtain a unified output object and a business output object for the business request; obtaining the conversion characteristics of the unified output object and adding them to a list of characteristics to be converted; judging whether the conversion characteristics of the business output object exist; if the conversion characteristics of the business output object exist, obtaining the conversion characteristics of the business output object and adding them to a list of characteristics to be converted; based on multi-language resources, converting each conversion characteristic in the list of characteristics to be converted according to the target language set by the user, and returning the conversion result; and generating a converted unified output object based on the conversion result and the unified output object. This solution provides an implementation of system internationalization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of internationalization, and more particularly, to a method and apparatus for implementing real-time multi-language conversion. Background Art

[0002] With the progress of globalization, more and more services need to provide internationalization support to meet the needs of users of different languages. The traditional method of multi-language conversion of the output content of business requests is mainly implemented through coding and configuration files. For example, the traditional method requires calling the core conversion function at the attribute to be converted during the application execution process. The core conversion function matches the keywords corresponding to the input parameters in the configuration file and then outputs the conversion result. However, the traditional method has problems such as low conversion efficiency and difficult maintenance.

[0003] Therefore, a new method and device for realizing real-time multi-language conversion is needed. Summary of the invention

[0004] The embodiments of the present application provide a method and apparatus for implementing real-time multi-language conversion, which can dynamically configure conversion characteristics and resources, implement unified multi-language conversion output, and optimize user experience.

[0005] According to a first aspect of the present application, a method for implementing real-time multi-language conversion is provided, comprising: receiving a business request; processing the business request to obtain a unified output object and a business output object for the business request; obtaining a conversion characteristic of the unified output object, and adding the conversion characteristic of the unified output object to a list of characteristics to be converted; judging whether the conversion characteristic of the business output object exists; if the conversion characteristic of the business output object exists, obtaining the conversion characteristic of the business output object, and adding the conversion characteristic of the business output object to the list of characteristics to be converted; based on multi-language resources stored in a cache, converting each conversion characteristic in the list of characteristics to be converted according to a target language set by a user, and returning a conversion result; and generating a converted unified output object based on the conversion result and the unified output object.

[0006] According to an embodiment of the first aspect of the present application, the multilingual resource is loaded into the cache from a data storage device.

[0007] According to an embodiment of the first aspect of the present application, the conversion characteristics include a multilingual resource table characteristic, a conversion object characteristic, and an output object characteristic, wherein the multilingual resource table characteristic is used to identify the multilingual resource table in the multilingual resource, the conversion object characteristic is used to identify the object to be converted of the unified output object or the business output object, and the output object characteristic is used to identify the position in the unified output object to which the conversion result is to be output.

[0008] According to an embodiment of the first aspect of the present application, the method also includes: dynamically configuring the conversion characteristics; updating the multilingual resource table based on the dynamically configured conversion characteristics; and saving the updated multilingual resource table to the data storage device and synchronizing it to the cache in real time.

[0009] According to an embodiment of the first aspect of the present application, dynamically configuring the conversion characteristic includes: adding, deleting, or modifying the conversion characteristic.

[0010] According to an embodiment of the first aspect of the present application, the method further includes: recording a multi-language conversion log; and calculating a conversion performance parameter based on the multi-language conversion log, wherein the multi-language conversion log includes at least one of a URL of a service request, a conversion result, a conversion start time, a conversion end time, and a user of the service request, and wherein the conversion performance parameter includes at least one of the total number of service requests, the number of service requests in a day, the conversion time of a single service request, the average conversion time of all service requests, and the average conversion time of service requests in a day.

[0011] According to an embodiment of the first aspect of the present application, the method further includes: displaying the conversion performance parameters to the user through a user interface, wherein, based on the conversion performance parameters, the user can pause or resume the conversion process through the user interface.

[0012] According to an embodiment of the first aspect of the present application, the method further includes: when the conversion performance parameter exceeds a threshold, pausing the conversion process.

[0013] According to an embodiment of the first aspect of the present application, the method also includes: asynchronously executing the conversion process when the conversion process is suspended; calculating new conversion performance parameters for the asynchronous execution; and resuming the conversion process when the new conversion performance parameters do not exceed the threshold.

[0014] According to an embodiment of the first aspect of the present application, the method further includes: if an error occurs in the current version of the multi-lingual resource, rolling back to a previous version of the multi-lingual resource.

[0015] According to an embodiment of the first aspect of the present application, the method further includes: parsing the converted unified output object to display it to the user through a user interface.

[0016] According to a second aspect of the present application, there is provided an apparatus for implementing real-time multi-language conversion, comprising: a processor, and a memory storing instructions, wherein when the instructions are executed by the processor, the processor executes the method of the first aspect of the present application.

[0017] According to a third aspect of the present application, a computer-readable storage medium is provided, on which instructions are stored. When the instructions are executed by a computer, the computer executes the method of the first aspect of the present application.

[0018] According to the method and device for realizing multi-language real-time conversion in an embodiment of the present application, after receiving a business request, the business request is processed to obtain a unified output object and a business output object. Then, the conversion characteristics of the unified output object are obtained and added to the list of characteristics to be converted. In addition, it is determined whether the conversion characteristics of the business output object exist, and if the conversion characteristics of the business output object exist, the conversion characteristics of the business output object are obtained and added to the list of characteristics to be converted. Further, based on multi-language resources, each conversion characteristic in the list of conversion characteristics is converted and the conversion result is returned according to the target language set by the user. Finally, based on the conversion result and the unified output object, a converted unified output object is generated. In this way, content can be converted in real time according to the language requirements of the user, providing an instant localized user experience. In addition, the user can dynamically add, delete or modify conversion characteristics and resources to flexibly respond to different language requirements and business scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the drawings without paying creative work.

[0020] Figure 1 is a flow chart of a method for implementing real-time multi-language conversion according to an embodiment of the present application;

[0021] Figure 2 is a flow chart of the dynamic configuration steps of the method for implementing multi-language real-time conversion according to an embodiment of the present application;

[0022] Figure 3is a flow chart of performance monitoring steps of a method for implementing multi-language real-time conversion according to an embodiment of the present application;

[0023] Figure 4 is a flowchart of the pausing and resuming steps of the method for implementing multi-language real-time conversion according to an embodiment of the present application; and

[0024] Figure 5 It is a schematic diagram of the hardware structure of a device for implementing real-time multi-language conversion according to an embodiment of the present application. DETAILED DESCRIPTION

[0025] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only configured to explain the present application and are not configured to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.

[0026] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0027] The features and exemplary embodiments of various aspects of the present application will be described in detail below.In addition, the features, structures, or characteristics described below may be combined in any suitable manner in one or more embodiments.

[0028] Figure 1 is a flow chart of a method for implementing real-time multi-language conversion according to an embodiment of the present application. Figure 1 As shown, the method for implementing multi-language real-time conversion according to an embodiment of the present application includes the following steps S110 to S170.

[0029] S110: receiving a service request.

[0030] In one embodiment, the service request may be a service request in an application system that needs to implement a multi-language function. For example, the application system may be a backend management system, a monitoring management system, or other application systems that need to implement a multi-language function.

[0031] As an example, a business request may be to display the name of a suspect. At this time, the name of the suspect needs to be converted into a corresponding language for display according to the language set by the user. For example, "explosives" is converted into English "Explosives" or into the target language set by the user.

[0032] In addition, the business request may be that the operator performs an image recognition operation at the image recognition station. At this time, the result of whether the image recognition operation is successful needs to be converted into a corresponding language for display according to the language set by the user. For example, "Operation is successful" is converted into English "Operation is successful" or converted into the target language set by the user.

[0033] S120: Process the service request to obtain a unified output object and a service output object for the service request.

[0034] In one embodiment, after processing a business request, the application system will output a unified output object and a business output object of the business request. For example, the application system will generate a unified output object and a business output object for all business requests. For example, the unified output object is an object related to the return of the system interface, and has unified return attribute information, such as ResponseModel, including Code, Message, Data, and Timestamp, where Code represents the return code, Message is a multi-language return of Code, Data represents data, and Timestamp represents a return timestamp. In addition, the business output object is an object related to business data. For example, the business output object can be the Data in the above-mentioned unified output object.

[0035] S130: Acquire conversion characteristics of the unified output object, and add the conversion characteristics of the unified output object to a list of characteristics to be converted.

[0036] In one embodiment, the unified output object must have a conversion characteristic. Therefore, the conversion characteristic of the unified output object can be obtained. Then, the conversion characteristic of the unified output object can be added to the list of characteristics to be converted.

[0037] In one embodiment, the conversion characteristics include a multilingual resource table characteristic, a conversion object characteristic, and an output object characteristic, wherein the multilingual resource table characteristic is used to identify a multilingual resource table in a multilingual resource, the conversion object characteristic is used to identify an object to be converted of a unified output object or a business output object, and the output object characteristic is used to identify a position in the unified output object to which a conversion result is to be output.

[0038] For example, the conversion property may include table_name, field_id, source. For example, the conversion property of the output object may be [Translate("tb_sys_response_code_dictionary", "result_code", "Message")]. This indicates that the content to be converted by the conversion property corresponds to the result_code attribute of the tb_sys_response_code_dictionary table, and the result_code attribute needs to be output to the Message attribute of the output object.

[0039] The examples of the unified output object and the examples of the conversion characteristics are all examples of the C# programming language. However, the present application does not specifically limit the programming language, for example, Java or other programming languages ​​(and corresponding programming language characteristics) may also be used.

[0040] S140: Determine whether the conversion characteristic of the business output object exists.

[0041] In one embodiment, the method may determine whether a conversion characteristic of a business output object exists. For example, the conversion characteristic may define an output object that needs to be converted and returned. As an example, when the conversion characteristic of a business output object exists, it indicates that the business output object needs to be converted. When the conversion characteristic of a business output object does not exist, it indicates that the business output object does not need to be converted.

[0042] S150: If the conversion characteristic of the service output object exists, obtain the conversion characteristic of the service output object, and add the conversion characteristic of the service output object to a list of characteristics to be converted.

[0043] In one embodiment, when the conversion characteristic of the service output object exists, the conversion characteristic of the service output object may be acquired, and the conversion characteristic of the service output object may be added to the list of characteristics to be converted.

[0044] In one embodiment, when the conversion property of the business output object does not exist, the method may proceed to the next step.

[0045] In one embodiment, when there are multiple conversion characteristics for a service request (for example, including conversion characteristics of a unified output object and conversion characteristics of a service output object, and there may be multiple conversion characteristics corresponding to multiple service output objects), the multiple conversion characteristics may be added to the list of characteristics to be converted, and then each conversion characteristic may be processed in parallel. In this way, the conversion speed of the system may be improved.

[0046] S160: Based on the multilingual resources stored in the cache, and according to the target language set by the user, each conversion characteristic in the to-be-converted characteristic list is converted, and a conversion result is returned.

[0047] In one embodiment, the conversion process may include a target language matching process. For example, the conversion characteristics may be matched with the target language based on the multilingual resources and the target language.

[0048] In one embodiment, the multi-language resources are loaded from the data storage device into the cache. For example, after the application system is started, the multi-language resources are loaded from the data storage device into the cache.

[0049] For example, the cache can be ElasticSearch, memory, or Redis, etc., as long as it can achieve high-speed reading and writing. In this way, the conversion speed of the system can be improved.

[0050] The multilingual resources can be stored in a data storage device, for example, in a database, XML, Json, or other custom files, or other carriers. The present application does not specifically limit the storage of multilingual resources, as long as operations such as adding, deleting, modifying, and querying multilingual resources can be implemented. As an example, the multilingual resources can include multiple multilingual resource tables.

[0051] For example, based on the multilingual resources and the target language set by the user, the conversion result can be obtained from the conversion characteristics. In addition, when the conversion process does not match the result or the conversion process fails, a default value can be generated as the conversion result. The default value can be a pre-set value, and this application does not limit this.

[0052] S170: Generate a converted unified output object based on the conversion result and the unified output object.

[0053] For example, the converted unified output object includes the corresponding conversion result of the corresponding conversion characteristic. As an example, the Message in the ResponseModel of the unified output object is replaced with the conversion result of the conversion characteristic of the unified output object, and when the conversion characteristic of the business output object exists, the Data in the ResponseModel of the unified output object is replaced with the conversion result of the conversion characteristic of the business output object. In addition, when the conversion characteristic of the business output object does not exist, the Data in the ResponseModel of the unified output object remains unchanged.

[0054] In one embodiment, the method may further include parsing the converted unified output object to display it to the user through a user interface.

[0055] For example, after the conversion is completed, the application system may parse the converted unified output object and display the conversion result to the user through a user interface.

[0056] According to the method for realizing multi-language real-time conversion in an embodiment of the present application, after receiving a business request, the business request is processed to obtain a unified output object and a business output object. Then, the conversion characteristics of the unified output object are obtained and added to the list of characteristics to be converted. In addition, it is determined whether the conversion characteristics of the business output object exist, and if the conversion characteristics of the business output object exist, the conversion characteristics of the business output object are obtained and added to the list of characteristics to be converted. Further, based on multi-language resources, each conversion characteristic in the list of characteristics to be converted is converted and the conversion result is returned according to the target language set by the user. Finally, based on the conversion result and the unified output object, a converted unified output object is generated. In this way, content can be converted in real time according to the language requirements of the user, providing an instant localized user experience.

[0057] Figure 2 FIG. 1 is a flow chart of the dynamic configuration steps of the method for implementing multi-language real-time conversion according to an embodiment of the present application. Figure 2 As shown, the dynamic configuration step of the method for implementing real-time multi-language conversion according to an embodiment of the present application includes the following steps S210 to S230.

[0058] S210: Dynamically configure conversion characteristics.

[0059] In one embodiment, dynamically configuring conversion characteristics includes: adding, deleting, or modifying conversion characteristics. For example, a user can define a new conversion characteristic for a new service request; a user can modify the conversion characteristic of an existing service request; a user can also delete the conversion characteristic of an existing service request, etc. During the operation of the application system, the user can perform the above configuration operations dynamically and in real time.

[0060] S220: Update the multi-language resource table based on the dynamically configured conversion characteristics.

[0061] In one embodiment, after the conversion feature is dynamically configured, the corresponding multi-language resource table can be updated. For example, the user can add a new entry in the corresponding multi-language resource table for the new conversion feature; the user can modify the existing entry in the corresponding multi-language conversion resource table; the user can also delete the existing entry in the corresponding multi-language resource table, etc. During the operation of the application system, the user can perform the above update operations dynamically and in real time.

[0062] In one embodiment, the multilingual resource table can also be exported to, for example, Excel from the data storage device, and various updating and maintenance operations can be performed. Then, the updated and maintained multilingual resource table can be imported into the data storage device from Excel again.

[0063] S230: Save the updated multi-language resource table to the data storage device and synchronize it to the cache in real time.

[0064] For example, the updated multi-language resource table needs to be saved to the data storage device and the cache at the same time to maintain data consistency.

[0065] Through the above dynamic configuration steps, users can dynamically add, delete or modify conversion features and resources to flexibly respond to different language requirements and business scenarios.

[0066] Figure 3 FIG. 1 is a flow chart of the performance monitoring steps of the method for implementing multi-language real-time conversion according to an embodiment of the present application. Figure 3 As shown, the dynamic configuration step of the method for implementing real-time multi-language conversion according to the embodiment of the present application includes the following steps S310 to S320.

[0067] S310: Recording a multi-language conversion log.

[0068] In one embodiment, the multi-language conversion log includes at least one of the URL of the service request, the conversion result, the conversion start time, the conversion end time, and the user of the service request. For example, the multi-language conversion log may include various information that can reflect the conversion performance of the conversion process. In addition, the multi-language conversion log may also record various other information of the conversion process, which is not limited by the present application.

[0069] S320: Calculate conversion performance parameters based on the multi-language conversion log.

[0070] In one embodiment, the conversion performance parameter includes at least one of the total number of service requests, the number of service requests in a day, the conversion time of a single service request, the average conversion time of all service requests, and the average conversion time of service requests in a day. In addition, the conversion performance parameter may also include other parameters that can reflect the conversion performance, which is not limited in the present application.

[0071] For example, the conversion time can be calculated by the conversion start time and conversion end time in the multi-language conversion log. Then, the average conversion time of multiple business requests can be calculated by averaging the conversion time of multiple business requests.

[0072] In one embodiment, the conversion performance parameters may be displayed to the user through a user interface. In one embodiment, based on the conversion performance parameters, the user may pause or resume the conversion process through the user interface. For example, when the conversion performance parameters show that the conversion process is inefficient, the conversion process may be paused; when the conversion performance parameters show that the conversion process is efficient, the paused conversion process may be resumed.

[0073] Figure 4 FIG. 1 is a flowchart of the pause and resume steps of the method for implementing multi-language real-time conversion according to an embodiment of the present application. Figure 4 As shown, the dynamic configuration step of the method for implementing real-time multi-language conversion according to an embodiment of the present application includes the following steps S410 to S440.

[0074] S410: When the conversion performance parameter exceeds a threshold, suspend the conversion process.

[0075] In one embodiment, a corresponding threshold value can be set for each conversion performance parameter. As an example, for the conversion time consuming of a single business request, the threshold value can be set to 200ms, or other values, which are not limited in this application. In this way, when the conversion time consuming of a single business request exceeds 200ms, the conversion process can be suspended to avoid affecting the operating efficiency of the entire application system. As an example, for the average conversion time consuming of all business requests, the threshold value can be set to 200ms, or other values, which are not limited in this application. In this way, when the average conversion time consuming of all business requests exceeds 200ms, the conversion process can be suspended to avoid affecting the operating efficiency of the entire application system.

[0076] S420: In the case where the conversion process is suspended, the conversion process is asynchronously executed.

[0077] In one embodiment, after the conversion process is suspended, a default value may be returned as the conversion result, or the original text of the object to be converted may be returned as the conversion result. Then, the conversion process may be performed asynchronously. For example, the conversion process may continue to be performed in the background to obtain a normal conversion result.

[0078] S430: Calculate new conversion performance parameters for asynchronous execution.

[0079] In one embodiment, for the above asynchronous execution, a multi-language conversion log may be recorded, and a new conversion performance parameter may be calculated based on the multi-language conversion log.

[0080] S440: When the new conversion performance parameter does not exceed the threshold, the conversion process is resumed.

[0081] In one embodiment, the new conversion performance parameter may be compared with a corresponding threshold value, and when the new conversion performance parameter does not exceed the corresponding threshold value, the suspended conversion process may be resumed.

[0082] In one embodiment, the method for implementing real-time multi-language conversion further includes: if an error occurs in the current version of the multi-language resource, rolling back to a previous version of the multi-language resource.

[0083] For example, when updating and maintaining the multilingual resource table in the multilingual resource, various historical versions can be recorded and saved, and when an error occurs in the current version of the multilingual resource, it can be rolled back to the previous version of the multilingual resource, for example, the last modified version of the multilingual resource. In this way, the correctness of the conversion result can be guaranteed.

[0084] The present application also provides a device for realizing multi-language real-time conversion, comprising: a processor, and a memory storing instructions, which, when executed by the processor, enable the processor to execute the above-mentioned method for realizing multi-language real-time conversion.

[0085] Figure 5 is a schematic diagram of the hardware structure of a device for implementing real-time multi-language conversion according to an embodiment of the present application. Figure 5 As shown, the apparatus for implementing real-time multi-language conversion may include a processor 51 and a memory 52 storing computer program instructions.

[0086] Specifically, the processor 51 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0087] The memory 52 may include a large capacity memory for data or instructions. Where appropriate, the memory 52 may include removable or non-removable (or fixed) media. In a particular embodiment, the memory 52 is a non-volatile solid-state memory. The memory 52 may include a read-only memory (ROM), a random access memory (RAM), a disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Therefore, typically, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the above-mentioned method for implementing real-time multi-language conversion.

[0088] The processor 51 reads and executes the computer program instructions stored in the memory 52 to implement the method for implementing real-time multi-language conversion in the above embodiment.

[0089] In one example, the apparatus for implementing real-time multi-language conversion may further include a communication interface 53 and a bus 54. Figure 5 As shown, the processor 51, the memory 52, and the communication interface 53 are connected via a bus 54 and communicate with each other.

[0090] Bus 54 includes hardware, software or both, and the parts of the device for realizing multilingual real-time conversion are coupled to each other. For example, but not limitation, bus can include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 54 can include one or more buses. Although the present application embodiment describes and shows a specific bus, the application considers any suitable bus or interconnection.

[0091] The present application also provides a computer-readable storage medium on which instructions are stored. When the instructions are executed by a computer, the computer executes the above-mentioned method for realizing real-time multi-language conversion.

[0092] Examples of computer-readable storage media include non-transitory computer-readable storage media, such as portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk-read-only memory (CD-ROM), optical storage devices, magnetic storage devices, etc.

[0093] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.

[0094] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.

Claims

1. A method for implementing multi-language real-time conversion, comprising: Receive business requests; Processing the service request to obtain a unified output object and a service output object for the service request; Acquire the conversion characteristics of the unified output object, and add the conversion characteristics of the unified output object to a list of characteristics to be converted; Determining whether a conversion characteristic of the business output object exists; If the conversion characteristic of the service output object exists, acquiring the conversion characteristic of the service output object, and adding the conversion characteristic of the service output object to the list of characteristics to be converted; Based on the multilingual resources stored in the cache, convert each conversion feature in the list of features to be converted according to the target language set by the user, and return the conversion result; as well as generating a converted unified output object based on the conversion result and the unified output object, The conversion characteristics include multi-language resource table characteristics, conversion object characteristics, and output object characteristics. Among them, the multilingual resource table characteristic is used to identify the multilingual resource table in the multilingual resource, the conversion object characteristic is used to identify the object to be converted of the unified output object or the business output object, and the output object characteristic is used to identify the position in the unified output object to which the conversion result will be output.

2. The method according to claim 1, wherein: The multi-language resources are loaded into the cache from a data storage device.

3. The method according to claim 2, further comprising: dynamically configuring the conversion characteristic; updating the multi-language resource table based on the dynamically configured conversion characteristics; as well as The updated multi-language resource table is saved to the data storage device and synchronized to the cache in real time.

4. The method according to claim 3, wherein: Dynamically configuring the conversion characteristics includes: Add, delete, or modify the conversion characteristics.

5. The method according to claim 1, further comprising: Record multi-language conversion logs; as well as Based on the multi-language conversion log, calculating conversion performance parameters, The multi-language conversion log includes at least one of the URL of the service request, the conversion result, the conversion start time, the conversion end time, and the user of the service request, and The conversion performance parameter includes at least one of the total number of service requests, the number of service requests in a day, the conversion time of a single service request, the average conversion time of all service requests, and the average conversion time of service requests in a day.

6. The method according to claim 5, further comprising: presenting the conversion performance parameter to the user through a user interface, Wherein, based on the conversion performance parameter, the user can pause or resume the conversion process through the user interface.

7. The method according to claim 5, further comprising: When the conversion performance parameter exceeds a threshold, the conversion process is suspended.

8. The method according to claim 7, further comprising: In case of pausing the conversion process, asynchronously executing the conversion process; For the asynchronous execution, calculating new conversion performance parameters; When the new conversion performance parameter does not exceed the threshold, the conversion process is resumed.

9. The method according to claim 1, further comprising: In case an error occurs in the current version of the multi-lingual resource, fall back to the previous version of the multi-lingual resource.

10. The method according to claim 1, further comprising: The converted unified output object is parsed to be presented to the user through a user interface.

11. A device for realizing real-time multi-language conversion, comprising: processor, and A memory storing instructions, wherein when the instructions are executed by the processor, the processor is caused to perform the method according to any one of claims 1 to 10.

12. A computer-readable storage medium having instructions stored thereon, wherein when the instructions are executed by a computer, the computer is caused to perform the method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Method and device for realizing multi-language service system, electronic equipment and storage medium

    CN116974677A