A translation method and device for content management system

Through the combination of multi-threaded data replication and external translation systems, the problem of low translation efficiency of the content management system is solved, fast translation is achieved, costs are reduced, and the scope of application is expanded.

CN118350387BActive Publication Date: 2024-10-01SUZHOU KONGGU NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410778600.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-17
Publication Date
2024-10-01
Estimated Expiration
2044-06-17

AI Technical Summary

Technical Problem

The translation method of the existing content management system cannot meet the needs of rapid development and launch. Line-by-line copying and translation methods are inefficient and cannot effectively cope with the needs of multi-language environments.

Method used

A multi-threaded data copy and external translation system is used to receive user requests, perform data preprocessing and batch insertion operations, and use the task management framework and external translation systems to accelerate the translation process and achieve rapid translation of the content management system.

Benefits of technology

It improves the efficiency of data copying and translation, reduces labor and time costs, expands the application scope and market prospects of the content management system, and adapts to the needs of multi-language environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118350387B_ABST
    Figure CN118350387B_ABST
Patent Text Reader

Abstract

The present application provides a translation method and device for a content management system. The translation method includes a user terminal sending a data acquisition request to a server terminal; the server terminal receiving the data acquisition request sent by the user terminal; the user terminal receiving the data to be copied sent by the server terminal; sending a copy request to the server terminal; the server terminal receiving the copy request sent by the user terminal, and sending the intermediate data obtained by the copy operation to the user terminal; the user terminal receiving the intermediate data sent by the server terminal and displaying it using a user interface; sending a translation request to the server terminal; the server terminal receiving the translation request sent by the user terminal; the server terminal using an external translation system to obtain the translation result corresponding to the pre-processed data to be translated, and sending it to the user terminal. The present application accelerates the speed of data replication through multi-threaded data replication operations to meet the needs of rapid development and launch.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the fields of computer application and content management system, and in particular to a translation method and device for content management system. Background Art

[0002] CMS system is a content management system, which is generally composed of columns, data, models, model parameters, dictionaries, advertisements, labels and other components, and the CMS system needs to support multiple languages, such as a simple web site supports Chinese / English / Japanese, etc. Users only create data in a single language (columns, data, models, model parameters, dictionaries, advertisements, and data in labels are referred to as data), and data in other languages ​​is translated through the CMS system. How to quickly translate has become an important function of the CMS system technical solution. In related technologies, the means of line-by-line copying and translation are difficult to meet the needs of rapid development and launch.

[0003] Based on this, the present application provides a translation method and device for a content management system to solve the above problems. Summary of the invention

[0004] The purpose of this application is to solve the shortcomings of the prior art that the translation of content management systems is difficult to meet the needs of rapid development and launch, and to propose a translation method and device for content management systems.

[0005] In order to achieve the above purpose, this application adopts the following technical solutions:

[0006] In a first aspect, the present application provides a translation method for a content management system, the method being applied to a server; the method comprising:

[0007] Receive a data acquisition request sent by a user terminal, and acquire the data to be copied from a database according to the data acquisition request and send it to the user terminal;

[0008] receiving a copy request sent by the user terminal, performing a multi-threaded data copy operation on data corresponding to a plurality of selected content components, and sending intermediate data obtained by the copy operation to the user terminal;

[0009] Receiving a translation request sent by the user terminal, and preprocessing the data to be translated in the translation request;

[0010] The translation result corresponding to the pre-processed data to be translated is obtained by using an external translation system, and is sent to the user end to realize the translation of the content management system.

[0011] The beneficial effect of this technical solution is that: in specific applications, data between different languages ​​may be different, and some data may also be manually translated. This technical solution realizes optional copying and translation. The user end sends a data acquisition request to the server end, and the server end receives the request and obtains the data to be copied from the database and sends it to the user end. After the user end receives the data to be copied, it uses the user interface to display the data to be copied, and generates a copy request and sends it to the server end. After the server end receives the copy request, it performs a multi-threaded data copy operation on the data corresponding to the selected content component, and sends the copied intermediate data to the user end. The translation processing operation will be performed only after the above operations are completed. After receiving the intermediate data, the user end sends a translation request to the server end according to the user's choice. After receiving the translation request, the server end pre-processes the data to be translated, and then uses an external translation system to obtain the translation result, and sends the result to the user end, thereby realizing the translation of the content management system.

[0012] Through multi-threaded data replication operations, the speed of data replication is accelerated, thereby improving the overall efficiency of translation. The fast data replication and translation process reduces manpower and time costs, which helps to reduce the operating costs of enterprises. Cross-language translation enables content management systems to better respond to the needs of multilingual environments, thereby expanding the application scope and market prospects of content management systems.

[0013] In some possible implementations, the receiving the copy request sent by the user terminal and performing a multi-threaded data copy operation on the data corresponding to the multiple selected content components includes:

[0014] Create replication tasks using the task management framework based on pre-set task scheduling information;

[0015] For the data corresponding to the multiple selected content components, a multi-threaded data replication operation is performed according to the replication task.

[0016] The beneficial effect of this technical solution is that through parallel processing and multi-threaded operation, the speed of data replication can be accelerated, the waiting time in the replication process can be reduced, and the data replication efficiency of the entire translation process can be improved. The task management framework can dynamically manage the execution of tasks, schedule and allocate them according to the situation of system resources, so that system resources can be optimally utilized to avoid resource waste and bottlenecks. By adopting the task management framework and multi-threaded processing technology, it can better cope with the increase in data volume and concurrent requests, and has stronger horizontal expansion capabilities to meet the needs of future business development.

[0017] In some possible implementations, performing a multi-threaded data replication operation on the replication task includes:

[0018] Establish a mapping relationship between new and old data in the database to obtain a mapping table;

[0019] According to the mapping table, new data is generated using N threads, where N is an integer multiple of the number of CPU cores executing thread operations;

[0020] Use batch insert mode to insert the copied data into the database in batches.

[0021] The beneficial effect of this technical solution is that the use of batch insert operations can effectively process large-scale data and improve translation efficiency. At the same time, batch insert operations can insert multiple pieces of data in a single database interaction. Compared with inserting one by one, it can significantly improve the overall speed of the translation method, which is very important for scenarios where a large number of translation tasks need to be completed quickly. Batch insert operations can maintain data consistency and ensure that the translated data can be stored completely in the database. This helps to avoid data loss or incompleteness and improves data reliability and integrity. Through batch insert operations, database write operations can be reduced, reducing the load pressure on the database, which is particularly important for high-concurrency, large-scale content management systems.

[0022] In some possible implementations, the task scheduling information is obtained by:

[0023] According to the dependency relationship between the selected content components, the execution order of copying the selected content components is determined and used as task scheduling information;

[0024] The selected content components include: column content components, model content components, data content components, model parameter content components, dictionary content components, label content components, advertisement content components and data model content components;

[0025] The dependency relationship between the selected content components is: the data model content component depends on the data content component, the model parameter content component, the dictionary content component, the label content component and the advertising content component; the data content component, the model parameter content component, the dictionary content component, the label content component and the advertising content component depend on the column content component and the model content component.

[0026] The beneficial effect of the technical solution is that: through reasonable task scheduling, unnecessary repeated copying and data loss can be avoided, thereby improving the efficiency of the copy operation. Determining the execution order of the copy tasks according to the dependency relationship can ensure the integrity of the data and ensure that the relevant data can be correctly copied and stored. By reasonably arranging the execution order of the copy tasks, the utilization of system resources can be optimized. At the same time, the task scheduling information can avoid errors caused by confusion in the execution order and reduce the risks in the data copy process.

[0027] In some possible implementations, the receiving the translation request sent by the user terminal and preprocessing the data to be translated in the translation request includes:

[0028] Performing rich text processing on the data to be translated to obtain translatable data in the rich text;

[0029] Pack the translatable data according to the preset packing rules, and record the relationship between each data package and the data, so as to establish the association between the translatable data and the translation task;

[0030] The preset packaging rule includes at least one of the following:

[0031] Packing the translatable data according to a predetermined number of characters;

[0032] The translatable data is divided into paragraphs, and each paragraph is packaged as an independent translation unit;

[0033] The structural tags contained in the translatable data are checked, and the translatable data at the same level are packaged as an independent translation unit according to the structural tags, wherein the structural tags include HTML tags and / or XML tags.

[0034] The beneficial effect of the technical solution is that: rich text processing is performed on the data to be translated in the translation request, the text data and label data in the rich text are isolated, and the translatable data in the rich text is obtained. In order to divide a large text into small blocks suitable for translation processing and facilitate the management and execution of translation tasks, the processed translatable data is packaged according to preset packaging rules. During the packaging process, the relationship between each data packet and the original data is recorded to establish an association relationship between the original data and the translation task.

[0035] In some possible implementations, the using of an external translation system to obtain a translation result corresponding to the preprocessed data to be translated includes:

[0036] Use an external translation system to translate the pre-processed data to be translated;

[0037] After the translation task is completed, the translated data will replace the corresponding fields in the original data to complete the database update.

[0038] The beneficial effect of this technical solution is that using an external translation system for translation can greatly speed up the translation process, improve the efficiency of the entire translation process, and improve translation efficiency. External translation systems usually have more powerful translation capabilities and language processing technologies, so they can provide more accurate and smooth translation results, thereby improving translation quality. After the translation is completed, the server automatically updates the translated data to the database, realizing the automatic update of the database, saving labor costs and time costs.

[0039] In some possible implementations, before receiving the translation request sent by the user terminal, the method further includes:

[0040] Acquire the translation system indication information sent by the user terminal, and determine the target translation system according to the translation system indication information;

[0041] The method of using an external translation system to obtain a translation result corresponding to the preprocessed data to be translated and sending the result to the user terminal to implement the translation of the content management system includes:

[0042] The target translation system is used to obtain the translation result corresponding to the preprocessed data to be translated, and the translation result is sent to the user end to realize the translation of the content management system.

[0043] The beneficial effect of this technical solution is that it allows users to directly specify the translation system they wish to use, providing users with flexibility so that they can choose specific translation services based on their needs or preferences. When the external translation system specified by the user is not specified, an alternative translation system will be recommended based on the user's industry type, ensuring the continuity of the translation. Different industries have different terminology and language styles, and selecting a translation system based on the user's industry type can better meet the needs of specific industries.

[0044] In a second aspect, the present application further provides a translation method for a content management system, the method being applied to a user end, the method comprising:

[0045] Send a data acquisition request to the server to request the data to be copied;

[0046] Receiving the data to be copied sent by the server, and displaying multiple content components corresponding to the data to be copied using a user interface;

[0047] Sending a copy request to the server, wherein the copy request is generated according to a user's selection operation on a content component;

[0048] Receiving intermediate data sent by the server and displaying the intermediate data using a user interface, wherein the intermediate data is obtained by the server performing a multi-threaded data copy operation on data corresponding to a plurality of selected content components;

[0049] Sending a translation request to the server, wherein the translation request is generated according to a user's selection operation on the intermediate data;

[0050] The translation result sent by the server is received; the translation result is obtained by the server using an external translation system to translate the pre-processed data to be translated.

[0051] In a third aspect, the present application provides an electronic device, comprising a memory and at least one processor, the memory storing a computer program, and the at least one processor being configured to implement a method as described in any one of the first aspect or any one of the second aspect when executing the computer program.

[0052] In a fourth aspect, the present application provides a computer program product, wherein the computer program product comprises a computer program, and when the computer program is executed by at least one processor, the steps of any of the above methods are implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] The present application is further described below in conjunction with the accompanying drawings and embodiments.

[0054] Figure 1 It is a structural block diagram of an implementation environment involved in each embodiment of the present application.

[0055] Figure 2 A flowchart of a translation method for a content management system provided in an embodiment of the present application.

[0056] Figure 3 It is a schematic diagram of an interface provided in an embodiment of the present application for a user to select data to be copied.

[0057] Figure 4 It is a flowchart of a translation process using a target translation system provided in an embodiment of the present application.

[0058] Figure 5 It is a structural block diagram of an electronic device provided in an embodiment of the present application.

[0059] Figure 6 It is a structural diagram of a computer program product provided in an embodiment of the present application. DETAILED DESCRIPTION

[0060] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments.

[0061] In the embodiments of the present application, the words "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any implementation or design scheme described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other implementations or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0062] The first, second, etc. descriptions appearing in the embodiments of the present application are only used for illustration and distinction of the description objects. There is no order, nor does it indicate any special limitation on the quantity in the embodiments of the present application, and cannot constitute any limitation on the embodiments of the present application.

[0063] See also Figure 1 , Figure 1 It is a structural block diagram of an implementation environment involved in each embodiment of the present application. The implementation environment includes: a server and a user. The user can be an electronic device with digital processing capabilities, such as a mobile phone or a tablet computer, for interacting with a user. It can be considered that the user runs client software (such as a user version of a content management system software) for receiving user program-controlled operations and implementing content management.

[0064] The server can be a server, a server cluster consisting of multiple servers, or a cloud computing service center. The server is used to communicate with the client to receive translation requests, data acquisition requests, and copy requests from the content management system of the client, and send the corresponding information to the client. The server and the client can be connected through a wireless network or a wired network, which is not limited by this application.

[0065] The present application provides a translation method and device for a content management system to improve related technologies. The following will be combined with the accompanying drawings and specific implementation methods to specifically describe in detail the technical solutions of the embodiments of the present application and how the technical solutions of the embodiments of the present application solve the above-mentioned technical problems. It should be noted that the embodiments described below or the technical features can be arbitrarily combined to form new embodiments, and the same or similar concepts or processes may not be repeated in some embodiments. Obviously, the described embodiments are part of the embodiments of the present application, not all of them.

[0066] Embodiment 1.

[0067] Reference Figure 2 , Figure 2 A flowchart of a translation method for a content management system provided in an embodiment of the present application. Figure 1 Taking the implementation environment shown in the figure as an example, the method may include the following steps:

[0068] Step S101, the user terminal sends a data acquisition request to the server terminal, requesting to obtain the data to be copied;

[0069] Step S102, the server receives a data acquisition request sent by the client, and acquires the data to be copied from the database according to the data acquisition request and sends it to the client;

[0070] Step S103, the user end receives the data to be copied sent by the server end, and uses the user interface to display multiple content components corresponding to the data to be copied; and sends a copy request to the server end. The copy request is generated according to the user's selection operation on the content component;

[0071] Step S104, the server receives the copy request sent by the client, performs a multi-threaded data copy operation on the data corresponding to the multiple selected content components, and sends the intermediate data obtained by the copy operation to the client;

[0072] Step S105, the user terminal receives the intermediate data sent by the server terminal and displays it using the user interface; and sends a translation request to the server terminal. The translation request is generated according to the user's selection operation on the intermediate data; it can be considered that the data to be translated selected (checked) by the user is sent to the server terminal;

[0073] Step S106, the server receives the translation request sent by the client, and pre-processes the data to be translated in the translation request;

[0074] Step S107, the server uses an external translation system to obtain the translation result corresponding to the pre-processed data to be translated, and sends it to the user end to implement the translation of the content management system;

[0075] Step S108: the client receives the translation result sent by the server, and the translation result is used for translation of the content management system.

[0076] In specific applications, data between different languages ​​may be different, and some data may also be manually translated. This technical solution realizes selective replication and translation. The user end sends a data acquisition request to the server end, and the server end receives the request and obtains the data to be copied from the database and sends it to the user end. After the user end receives the data to be copied, it uses the user interface to display the data to be copied, and generates a replication request and sends it to the server end. After receiving the replication request, the server end performs a multi-threaded data replication operation on the data corresponding to the selected content component, and sends the intermediate data obtained by the replication to the user end.

[0077] After receiving the intermediate data, the client sends a translation request to the server according to the user's choice. That is to say, the translation processing operation will be performed only after the above operations are performed. After receiving the translation request, the server pre-processes the data to be translated, and then uses the external translation system to obtain the translation result, and sends the result to the client to realize the translation of the content management system.

[0078] This embodiment has the following advantages: Through multi-threaded data copying operations, the speed of data copying is accelerated, thereby improving the overall efficiency of translation. The fast data copying and translation process reduces manpower and time, which helps to reduce the operating costs of the enterprise. Cross-language translation enables the content management system to better respond to the needs in a multilingual environment, thereby expanding the application scope and market prospects of the content management system. In summary, this method for the translation of the content management system can meet the needs of rapid development and launch.

[0079] In step S107, the translation result is stored in the database of the server, and the number of successful translations is returned to the backend client, and the translation result is returned to the user end. The frontend refers to the interface or platform that the user directly interacts with; the backend is the client that supports the frontend operation.

[0080] In one embodiment, the receiving of the copy request sent by the user terminal and performing a multi-threaded data copy operation on the data corresponding to the multiple selected content components (ie, step S104) includes:

[0081] Step S201, creating a replication task using a task management framework according to preset task scheduling information;

[0082] Step S202: performing a multi-threaded data replication operation on the data corresponding to the multiple selected content components according to the replication task.

[0083] The task management framework is, for example, Asynctool.

[0084] Specifically, the pre-set task scheduling information may include determining the execution order and dependencies of tasks. Task scheduling information can be designed according to the business requirements and system architecture of the server to ensure the orderly execution and efficient completion of tasks. Using the task management framework, replication tasks can be created according to the pre-set task scheduling information. Replication tasks can be created for data corresponding to different content components in a specified order and concurrency, and can also be dynamically adjusted and managed as needed.

[0085] For each created replication task, you can start multiple threads to perform data replication operations. Multiple threads can concurrently obtain data from the source, process and convert it, and then replicate the data to the target location. Through multi-threading, you can fully utilize the system resources of the server and improve the efficiency and speed of data replication.

[0086] This embodiment has the following advantages: through parallel processing and multi-threaded operation, the speed of data replication can be accelerated, the waiting time in the replication process can be reduced, and the data replication efficiency of the entire translation process can be improved. The task management framework can dynamically manage the execution of tasks, and schedule and allocate them according to the system resources of the server, so that system resources can be optimally utilized, and resource waste and bottlenecks can be avoided. By adopting the task management framework and multi-threaded processing technology, it can better cope with the increase in data volume and concurrent requests, and has stronger horizontal expansion capabilities to meet the needs of future business development.

[0087] In one embodiment, performing a multi-threaded data replication operation on the replication task includes:

[0088] Establish a mapping relationship between new and old data in the database to obtain a mapping table;

[0089] According to the mapping table, new data is generated using N threads, where N is an integer multiple of the number of CPU cores executing thread operations;

[0090] Use batch insert mode to insert the copied data into the database in batches.

[0091] Assume that the number of CPU cores executing thread operations is 4, and the value of N is, for example, 8, 12, 16, etc.

[0092] At the beginning of the replication task, a mapping relationship between the new and old data is established in the database to generate a mapping table. It can be considered that the mapping table records the corresponding relationship between the source data and the target data, which is used for matching and processing in the subsequent data replication process. Based on the information in the mapping table, new target data is generated using a multi-threaded method. According to the preset number of threads N, multiple threads are started to concurrently perform data generation operations, read information from the source data and process it, and then write the processed data into the database. After the data generation is completed, the generated new data is inserted into the target database in batches using a batch insert method. The batch insert operation can reduce the number of database interactions, improve the efficiency of data insertion, and speed up data replication.

[0093] This embodiment has the following advantages: multi-threaded parallel execution can fully utilize the multi-core processor or multi-processor architecture of the server to execute multiple threads simultaneously, thereby improving the overall performance of the system. By executing multiple tasks in parallel, concurrent processing of tasks can be achieved, speeding up the completion of tasks.

[0094] Multithreaded parallel execution can more effectively utilize the server's processor, memory and other hardware resources. By breaking down tasks into multiple threads for parallel execution, the system's processing power can be fully utilized, resource idleness can be avoided, and resource utilization can be improved.

[0095] Multi-threaded parallel execution increases translation speed, reduces user waiting time, and improves user experience.

[0096] Multithreaded execution is more scalable and can better cope with the needs of different scales and loads. In specific applications, the number of threads and task allocation can be dynamically adjusted according to the hardware configuration, and the system processing capacity can be flexibly adjusted according to the system load to achieve better scalability and adaptability.

[0097] Multithreaded execution requires effective task scheduling and resource allocation to ensure coordination and balance between threads. By optimizing task scheduling algorithms and resource management strategies, the overall efficiency and performance of the translation process can be improved to ensure that tasks can be processed in the appropriate time.

[0098] In summary, the above operations can improve resource utilization, enhance response speed, increase scalability and optimize task scheduling.

[0099] As an example, a method of dynamically adjusting threads according to load can be to write a scheduled task or background thread to periodically obtain system load information on the server. According to the system load, the size of the thread pool is dynamically adjusted. When the system load is high, the number of threads is increased, and when the load is low, the number of threads is reduced. The corresponding pseudo code example is as follows:

[0100] @Scheduled(fixedRate = 10000) / / Scheduled task, executed every 10 seconds

[0101] public void adjustThreadPoolSize() {

[0102] / / For example, dynamically adjust the thread pool size based on CPU utilization, memory usage and other indicators

[0103] int currentThreadPoolSize = taskExecutor.getPoolSize();

[0104] int desiredThreadPoolSize = calculateDesiredThreadPoolSize(); / / Calculate the expected thread pool size based on system load

[0105] if (desiredThreadPoolSize != currentThreadPoolSize) {

[0106] taskExecutor.setCorePoolSize(desiredThreadPoolSize); / / Adjust the number of core threads

[0107] taskExecutor.setMaxPoolSize(desiredThreadPoolSize); / / Adjust the maximum number of threads

[0108] }

[0109] }

[0110] In addition, the present embodiment adopts a batch insert mode to insert the copied data into a database in batches. This is because the method provided by the present embodiment is applicable to the translation method of a content management system. In its application scenario, the content management system needs to translate a large amount of data at the same time. The batch insert operation can effectively process large-scale data and improve translation efficiency. At the same time, the batch insert operation can insert multiple pieces of data in a single database interaction. Compared with inserting one by one, the overall speed of the translation method can be significantly improved, which is very important for the scene that needs to quickly complete a large number of translation tasks. The batch insert operation can maintain the consistency of the data and ensure that the translated data can be stored in the database completely. This helps to avoid data loss or incompleteness and improves the reliability and integrity of the data. Through the batch insert operation, the write operation of the database can be reduced, and the load pressure of the database is reduced, which is particularly important for high concurrency and large-scale content management systems.

[0111] In one embodiment, the task scheduling information is obtained in the following manner:

[0112] According to the dependency relationship between the selected content components, the execution order of copying the selected content components is determined and used as task scheduling information;

[0113] The selected content component includes at least one of the following: a column content component, a model content component, a data content component, a model parameter content component, a dictionary content component, a label content component, an advertisement content component and a data model content component.

[0114] As an example, the selected content components include: column content components, model content components, data content components, model parameter content components, dictionary content components, label content components, advertisement content components and data model content components;

[0115] The dependency relationship between the selected content components is: the data model content component depends on the data content component, the model parameter content component, the dictionary content component, the label content component and the advertising content component; the data content component, the model parameter content component, the dictionary content component, the label content component and the advertising content component depend on the column content component and the model content component.

[0116] The above dependency is because some data depends on specific columns or models. For example, the replication of the model parameter content component (data) needs to be performed after the replication of the model content component (data) and the column content component (data).

[0117] After understanding the dependencies between the various content components, the execution order of the replication tasks is determined based on the dependencies, ensuring that the necessary components are processed first during the replication process, and then other components that depend on these components are processed to ensure the correctness and completeness of the replication operation. After determining the execution order of the replication tasks, it is saved as task scheduling information. In other words, the task scheduling information includes the replication order of the various content components and the dependencies between them.

[0118] This embodiment has the following advantages: unnecessary duplication and data loss can be avoided through reasonable task scheduling, thereby improving the efficiency of the replication operation. Determining the execution order of replication tasks according to dependencies can ensure the integrity of data and ensure that data can be correctly replicated and stored. By reasonably arranging the execution order of replication tasks, the utilization of system resources can be optimized. At the same time, task scheduling information can avoid errors caused by confusion in the execution order, reducing the risks in the data replication process.

[0119] In one embodiment, the receiving of the translation request sent by the user terminal and preprocessing the data to be translated in the translation request (i.e., step S106) includes:

[0120] Performing rich text processing on the data to be translated to obtain translatable data in the rich text;

[0121] Pack the translatable data according to the preset packing rules, and record the relationship between each data package and the data, so as to establish the association between the translatable data and the translation task;

[0122] The preset packaging rule includes at least one of the following:

[0123] Packing the translatable data according to a predetermined number of characters;

[0124] The translatable data is divided into paragraphs, and each paragraph is packaged as an independent translation unit;

[0125] The structural tags contained in the translatable data are checked, and the translatable data at the same level are packaged as an independent translation unit according to the structural tags, wherein the structural tags include HTML tags and / or XML tags.

[0126] The data to be translated in the translation request is processed into rich text, and the text data and label data in the rich text are isolated to obtain the translatable data in the rich text. In order to divide the large text into small blocks suitable for translation processing and facilitate the management and execution of the translation task, the processed translatable data is packaged according to the preset packaging rules. During the packaging process, the relationship between each data packet and the original data is recorded to establish the association relationship between the original data and the translation task.

[0127] This embodiment has the following advantages: by rich text processing and packaging, large texts are divided into small pieces, which helps translators concentrate on translation work and improves translation efficiency. Rich text processing retains the style and structure of the original text, ensuring that the translated text is consistent with the original text in format and style, thereby improving translation quality. Recording associations helps manage and execute translation tasks, ensuring that each data packet can correctly correspond to the corresponding part of the original data, thereby improving the organization and coordination efficiency of translation projects.

[0128] In one embodiment, the step of obtaining the translation result corresponding to the pre-processed data to be translated by using an external translation system (i.e., step S107) includes:

[0129] Use an external translation system to translate the pre-processed data to be translated;

[0130] After the translation task is completed, the translated data will replace the corresponding fields in the original data to complete the database update.

[0131] First, the pre-processed data to be translated is sent to an external translation system, such as Google Translate, Baidu Translate, Microsoft Translate, etc., which can provide automatic translation of texts. The translation task can be achieved by calling the API interface of any of the above external translation systems. The external translation system will translate the received data to be translated and translate it into text in the target language. After the translation is completed, the translated data is returned to the server. After receiving the translation result, the server updates it to the database.

[0132] This embodiment has the following advantages: using an external translation system for translation can greatly speed up the translation speed, improve the efficiency of the entire translation process, and improve translation efficiency. The external translation system has more powerful translation capabilities and language processing technology, so it can provide more accurate and smooth translation results, thereby improving translation quality. After the translation is completed, the server automatically updates the translated data to the database, realizing the automatic update of the database, saving labor costs and time costs.

[0133] In one embodiment, before step S105, the method may further include obtaining, through the server, the translation system indication information sent by the user terminal, and determining the target translation system according to the translation system indication information;

[0134] Step S107 may also include: the server side uses the target translation system to obtain the translation result corresponding to the pre-processed data to be translated, and sends it to the user side to implement the translation of the content management system.

[0135] In one embodiment, before step S105, the user can manually select an API interface of any one of Google Translate, Baidu Translate, and Bing Translate through the user terminal to use the external translation system corresponding to the selected API interface as the target translation system.

[0136] In one embodiment, if the user does not manually select and confirm the target translation system through the user terminal before step S105, the intelligent selection mode is used by default, and a suitable translation system is intelligently matched based on big data before step S105, and the intelligently matched translation system is used as the target translation system.

[0137] In one embodiment, determining the target translation system according to the translation system indication information includes:

[0138] When in intelligent selection mode, a recommended translation system is obtained according to the industry type of the user, and the recommended translation system is used as the target translation system. In this case, it can be considered that there is no need for user selection, and information statistics technology is used to automatically determine the interface of the target translation system based on the statistical information of the industry type of the user (the translation system corresponding to the interface with the highest score in the industry to which the user belongs is used as the recommended translation system). The statistical information can come from the evaluation of each user in the same industry after use, and can also come from information generated after expert review and evaluation.

[0139] This embodiment has the following advantages: it allows the user to directly specify the translation system that he or she wishes to use, providing the user with flexibility so that the user can select a specific translation service according to his or her needs or preferences. When the external translation system specified by the user is not specified, an alternative translation system will be recommended based on the user's industry type, ensuring the continuity of the translation. Different industries have different terminology and language styles, and selecting a translation system based on the user's industry type can better meet the needs of a specific industry.

[0140] After the translation is completed, the server sends the evaluation information to the client for the user to evaluate the current translation effect and use it as statistical information. The server receives the user's evaluation of the current translation effect including feedback through the client. The feedback is converted into a score after semantic analysis by an external NLP system, and then the score is imported into the server's database for subsequent target translation system recommendation.

[0141] See also Figure 4 , Figure 4 It is a flowchart of a translation process using a target translation system provided in an embodiment of the present application.

[0142] As an example, the prompt information of the translation system is first obtained, and the selection mode of the external translation system is determined to be automatic mode or manual mode according to the prompt information of the translation system. If it is manual mode, it means that the user has selected the target translation system through the user end, and the translation is performed using the target translation system. Finally, the user's rating of the translation result is collected (the statistical information is updated).

[0143] When it is in the intelligent selection mode, it means that the external translation system indicated by the translation system indication information has not been manually selected, and it can be judged whether the statistical information is sufficient. For example, if there is no data corresponding to the user's industry type in the statistical information, it is considered that the statistical information is insufficient, and the translation system executed last time is used as the target translation system, and the translation is performed using the target translation system, and finally the user's rating of the translation result is collected (the statistical information is updated).

[0144] When the amount of statistical information is sufficient, the target translation system is obtained using the recommendation formula, the target translation system is used to perform the translation, and finally the user's rating of the translation result is collected (the statistical information is updated).

[0145] In one embodiment, the average score of the translation interface corresponding to each industry The calculation method is as follows:

[0146]

[0147] Among them, N s is the number of users belonging to industry s. ijrepresents the evaluation score of user i for interface j, i=1,2,…,n, j=1,2…,m. n is the number of sample users, and m is the number of translation interfaces to be selected. Assume S i represents the industry of user i, S i is a categorical variable (such as a numeric code). For example, S i =1 represents industry 1, and S2=2 represents industry 2.

[0148] Translation interface J of a target translation system recommended to users (e.g., in industry s) s , and the corresponding recommended formula is:

[0149]

[0150] Among them, J s For the translation interface recommended to industry s, compliance with the recommendation formula means that the translation interface recommended to the user is the translation interface with the highest score in the corresponding industry.

[0151] In a specific application, a translation method for a content management system is provided. AsyncTool (a multi-threaded orchestration framework) is integrated into the content management system to support the management and execution of concurrent tasks. You can add a dependency in the project's pom.xml file to add asyncTool to the project dependencies.

[0152] The translation method includes the following steps:

[0153] 1. The client sends a data acquisition request to the server, requesting the data to be copied.

[0154] The request includes parameters such as user ID, required copy data code (dataSectionIdList), and required copy module code (sectionIdList).

[0155] User ID: A unique identifier of a user, used to determine the permissions for requesting data or for personalized display. Example: User ID = 12345.

[0156] Whether to copy the banner (copyAd): Whether to copy the banner. Example: copyAd: false.

[0157] Whether to copy the dictionary (copyDict): whether to copy the dictionary. Example: copyDict: false.

[0158] Whether to copy the tag (copyTag): whether to copy the tag.

[0159] The data to be copied (dataSectionIdList). Example: dataSectionIdList:["1","2"].

[0160] Required copy module (sectionIdList). Example: sectionIdList:["1","2"].

[0161] 2. After receiving the data acquisition request, the server processes the data acquisition request according to parameters such as user identification and data type. The server retrieves the qualified data to be copied from the database and sends it to the user.

[0162] 3. After the user receives the data to be copied, it displays the data to be copied in the user interface and allows the user to select the data to be copied. After the user completes the selection, the copy request including the selected data and the user ID is sent to the server. Figure 3 , Figure 3 It is a schematic diagram of an interface for a user to select data to be copied.

[0163] 4. After receiving the replication request, the server performs a multi-threaded data replication operation on the selected data. The replication operation parameters include the replicated data ID list, the target data storage location, etc. The intermediate data obtained by the replication operation is sent to the server.

[0164] 5. After the server completes the copy operation, the user receives the intermediate data obtained by the copy operation sent by the server and displays it through the user interface. According to the user's selection, the data to be translated is determined as the data to be translated, and a translation request including the data to be translated is sent to the server.

[0165] 6. After receiving the translation request from the user, the server performs translation preprocessing based on the user ID and the data to be translated. Translation preprocessing includes rich text processing, data packaging, and recording the relationship between data packets and data. The translation request includes target language information and source language information. The target language (to) information is used to indicate which language the data needs to be translated into; the source language (to) information is used to indicate which language the data needs to be copied from.

[0166] 7. The server calls the API interface of the external translation system, sends the pre-processed translation data to the translation system, and waits for the translation result to be returned.

[0167] 8. After the external translation system completes the translation, it returns the translation result to the server. The server updates the translation result to the database, and returns the translation completion notification and translation result to the user end, updating the display of the user end.

[0168] Among them, when writing a copy task, the copying work of the column content component, model content component, data content component, model parameter content component, dictionary content component, label content component, advertising content component and data model content component corresponding data can be created using WorkerWrapper. And the mapping relationship between the new and old data is stored in the database. In the task, the original binding relationship is copied with reference to the new mapping table, and multi-threading is used to generate a new data list in the copy. The number of threads used can dynamically use N times the number of CPU cores (N is a positive integer). After copying, batchInsert is used for database insertion. After the data is copied, multiple translation tasks are created, and all the fields that need to be translated of the data just copied are packaged according to the number of words. A translation task is generated for every 20,000 characters of data, and the data id field is bound to the taskidlist subscript and stored in the cache. When the translation task is completed, the translated data is replaced in the database according to the corresponding relationship.

[0169] In the related technology, in the original serial data replication, a lot of CPU time is wasted on waiting for replication IO (database storage) and network (calling of the translation interface). After using the multi-threaded replication and translation provided by this specific application, the waiting time of IO and network is used for other translation tasks, thereby improving the efficiency of replication and translation.

[0170] Embodiment 2.

[0171] This embodiment provides a translation method for a content management system. The specific embodiments and technical effects achieved by the method are consistent with those described in the above-mentioned embodiment 1, and some contents are not repeated here.

[0172] The method is applied to a server, and the server provides a service corresponding to the current content to be displayed to the user; the method includes:

[0173] Receive a data acquisition request sent by a user terminal, and acquire the data to be copied from a database according to the data acquisition request and send it to the user terminal;

[0174] receiving a copy request sent by the user terminal, performing a multi-threaded data copy operation on data corresponding to a plurality of selected content components, and sending intermediate data obtained by the copy operation to the user terminal;

[0175] Receiving a translation request sent by the user terminal, and preprocessing the data to be translated in the translation request;

[0176] The translation result corresponding to the pre-processed data to be translated is obtained by using an external translation system, and is sent to the user end to realize the translation of the content management system.

[0177] In one embodiment, the receiving the copy request sent by the user terminal and performing a multi-threaded data copy operation on the data corresponding to the multiple selected content components includes:

[0178] Create replication tasks using the task management framework based on pre-set task scheduling information;

[0179] For the data corresponding to the multiple selected content components, a multi-threaded data replication operation is performed according to the replication task.

[0180] In one embodiment, performing a multi-threaded data replication operation on the replication task includes:

[0181] Establish a mapping relationship between new and old data in the database to obtain a mapping table;

[0182] According to the mapping table, new data is generated using N threads, where N is an integer multiple of the number of CPU cores executing thread operations;

[0183] Use batch insert mode to insert the copied data into the database in batches.

[0184] In one embodiment, the task scheduling information is obtained in the following manner:

[0185] According to the dependency relationship between the selected content components, the execution order of copying the selected content components is determined and used as task scheduling information;

[0186] The selected content components include: column content components, model content components, data content components, model parameter content components, dictionary content components, label content components, advertisement content components and data model content components;

[0187] The dependency relationship between the selected content components is: the data model content component depends on the data content component, the model parameter content component, the dictionary content component, the label content component and the advertising content component; the data content component, the model parameter content component, the dictionary content component, the label content component and the advertising content component depend on the column content component and the model content component.

[0188] In one embodiment, the receiving the translation request sent by the user terminal and preprocessing the data to be translated in the translation request includes:

[0189] Performing rich text processing on the data to be translated to obtain translatable data in the rich text;

[0190] Pack the translatable data according to the preset packing rules, and record the relationship between each data package and the data, so as to establish the association between the translatable data and the translation task;

[0191] The preset packaging rule includes at least one of the following:

[0192] Packing the translatable data according to a predetermined number of characters;

[0193] The translatable data is divided into paragraphs, and each paragraph is packaged as an independent translation unit;

[0194] The structural tags contained in the translatable data are checked, and the translatable data at the same level are packaged as an independent translation unit according to the structural tags, wherein the structural tags include HTML tags and / or XML tags.

[0195] In one embodiment, the using of an external translation system to obtain a translation result corresponding to the preprocessed data to be translated includes:

[0196] Use an external translation system to translate the pre-processed data to be translated;

[0197] After the translation task is completed, the translated data will replace the corresponding fields in the original data to complete the database update.

[0198] In one embodiment, before receiving the translation request sent by the user terminal, the method further includes:

[0199] Acquire the translation system indication information sent by the user terminal, and determine the target translation system according to the translation system indication information;

[0200] The method of using an external translation system to obtain a translation result corresponding to the preprocessed data to be translated and sending the result to the user terminal to implement the translation of the content management system includes:

[0201] The target translation system is used to obtain the translation result corresponding to the preprocessed data to be translated, and the translation result is sent to the user end to realize the translation of the content management system.

[0202] Embodiment three.

[0203] This embodiment provides a translation method for a content management system. The specific embodiments and technical effects achieved by the method are consistent with those described in the above-mentioned embodiment 1, and some contents are not repeated here.

[0204] Send a data acquisition request to the server to request the data to be copied;

[0205] Receiving the data to be copied sent by the server, and displaying multiple content components corresponding to the data to be copied using a user interface;

[0206] Sending a copy request to the server, wherein the copy request is generated according to a user's selection operation on a content component;

[0207] Receiving intermediate data sent by the server and displaying the intermediate data using a user interface, wherein the intermediate data is obtained by the server performing a multi-threaded data copy operation on data corresponding to a plurality of selected content components;

[0208] Sending a translation request to the server, wherein the translation request is generated according to a user's selection operation on the intermediate data;

[0209] The translation result sent by the server is received; the translation result is obtained by the server using an external translation system to translate the pre-processed data to be translated.

[0210] Embodiment 4.

[0211] The embodiment of the present application also provides an electronic device, the specific embodiment of which is consistent with the embodiment described in the above-mentioned embodiment 1 and the technical effects achieved, and some contents will not be repeated here.

[0212] The electronic device includes a memory and at least one processor, the memory stores a computer program, and the at least one processor is configured to implement the method as described in any one of the above-mentioned embodiments when executing the computer program.

[0213] See also Figure 5 , Figure 5 It is a structural block diagram of an electronic device provided in an embodiment of the present application.

[0214] The electronic device 10 may include, for example, at least one memory 11 , at least one processor 12 , and a bus 13 connecting different platform systems.

[0215] The memory 11 may include a (computer) readable medium in the form of a volatile memory, such as a random access memory (RAM) 111 and / or a cache memory 112 , and may further include a read-only memory (ROM) 113 .

[0216] The memory 11 also stores a computer program, which can be executed by the processor 12 so that the processor 12 implements the steps of any of the above methods.

[0217] The memory 11 may also include a utility 114 having at least one program module 115, such program module 115 including but not limited to: an operating system, one or more application programs, other program modules and program data, each of which or some combination may include the implementation of a network environment.

[0218] Accordingly, the processor 12 may execute the above-mentioned computer program, and may execute the utility 114 .

[0219] The processor 12 may be implemented by one or more application specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field programmable gate arrays (FPGAs), or other electronic components.

[0220] Bus 13 may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures.

[0221] The electronic device 10 may also communicate with one or more external devices such as a keyboard, a pointing device, a Bluetooth device, etc., and may also communicate with one or more devices that can interact with the electronic device 10, and / or communicate with any device (such as a router, a modem, etc.) that enables the electronic device 10 to communicate with one or more other computing devices. Such communication may be performed through an input / output interface 14. In addition, the electronic device 10 may also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN) and / or a public network, such as the Internet) through a network adapter 15. The network adapter 15 may communicate with other modules of the electronic device 10 through the bus 13. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 10 in actual applications, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage platforms.

[0222] Embodiment five.

[0223] The present application also provides a computer program product, the specific embodiments of which are consistent with the embodiments and technical effects described in the above embodiment 1, and some contents are not repeated here. The computer program product includes a computer program, and when the computer program is executed by at least one processor, the steps of any of the above methods are implemented or the functions of any of the above electronic devices are implemented.

[0224] See also Figure 6 , Figure 6 It is a structural diagram of a computer program product provided in an embodiment of the present application.

[0225] The computer program product is used to implement the steps of any of the above methods or to implement the functions of any of the above electronic devices. The computer program product may be a portable compact disk read-only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the computer program product of the present invention is not limited thereto, and the computer program product may be any combination of one or more computer-readable media.

[0226] This application is explained from the perspectives of purpose of use, effectiveness, progress and novelty, and has met the functional enhancement and usage requirements emphasized by the Patent Law. The above description and drawings of this application are only the preferred embodiments of this application, and are not intended to limit this application. Therefore, all structures, devices, features, etc. that are similar or identical to this application, that is, all equivalent replacements or modifications made in accordance with the scope of the patent application of this application, should fall within the scope of protection of the patent application of this application.

Claims

1. A translation method for a content management system, characterized in that: The method is applied to the server; the method comprises: Receive a data acquisition request sent by a user terminal, and acquire the data to be copied from a database according to the data acquisition request and send it to the user terminal; receiving a copy request sent by the user terminal, performing a multi-threaded data copy operation on data corresponding to a plurality of selected content components, and sending intermediate data obtained by the copy operation to the user terminal; Receiving a translation request sent by the user terminal, and preprocessing the data to be translated in the translation request; Using an external translation system, obtaining a translation result corresponding to the pre-processed data to be translated, and sending it to the user end, so as to realize the translation of the content management system; The receiving the copy request sent by the user terminal and performing a multi-threaded data copy operation on the data corresponding to the multiple selected content components includes: Create replication tasks using the task management framework based on pre-set task scheduling information; For data corresponding to the multiple selected content components, a multi-threaded data replication operation is performed on the data according to the replication task; The performing a multi-threaded data replication operation on the replication task includes: Establish a mapping relationship between new and old data in the database to obtain a mapping table; According to the mapping table, new data is generated using N threads, where N is an integer multiple of the number of CPU cores executing thread operations; Use batch insert mode to insert the copied data into the database in batches; The method for obtaining the task scheduling information includes: According to the dependency relationship between the selected content components, the execution order of copying the selected content components is determined and used as task scheduling information; The selected content components include: column content components, model content components, data content components, model parameter content components, dictionary content components, label content components, advertisement content components and data model content components; The dependency relationship between the selected content components is: the data model content component depends on the data content component, the model parameter content component, the dictionary content component, the label content component and the advertising content component; the data content component, the model parameter content component, the dictionary content component, the label content component and the advertising content component depend on the column content component and the model content component.

2. The translation method according to claim 1, characterized in that: The receiving the translation request sent by the user terminal and preprocessing the data to be translated in the translation request includes: Performing rich text processing on the data to be translated to obtain translatable data in the rich text; Pack the translatable data according to the preset packing rules, and record the relationship between each data package and the data, so as to establish the association between the translatable data and the translation task; The preset packaging rule includes at least one of the following: Packing the translatable data according to a predetermined number of characters; The translatable data is divided into paragraphs, and each paragraph is packaged as an independent translation unit; The structural tags contained in the translatable data are checked, and the translatable data at the same level are packaged as an independent translation unit according to the structural tags, wherein the structural tags include HTML tags and / or XML tags.

3. The translation method according to claim 1, characterized in that: The method of using an external translation system to obtain a translation result corresponding to the preprocessed data to be translated includes: Use an external translation system to translate the pre-processed data to be translated; After the translation task is completed, the translated data will replace the corresponding fields in the original data to complete the database update.

4. The translation method according to claim 1, characterized in that: Before receiving the translation request sent by the user terminal, the method further includes: Acquire the translation system indication information sent by the user terminal, and determine the target translation system according to the translation system indication information; The method of using an external translation system to obtain a translation result corresponding to the preprocessed data to be translated and sending the result to the user terminal to implement the translation of the content management system includes: The target translation system is used to obtain the translation result corresponding to the preprocessed data to be translated, and the translation result is sent to the user end to realize the translation of the content management system.

5. A translation method for a content management system, characterized in that: The method is applied to a user terminal, and the method comprises: Send a data acquisition request to the server to request the data to be copied; Receiving the data to be copied sent by the server, and displaying multiple content components corresponding to the data to be copied using a user interface; Sending a copy request to the server, wherein the copy request is generated according to a user's selection operation on a content component; Receiving intermediate data sent by the server and displaying the intermediate data using a user interface, wherein the intermediate data is obtained by the server performing a multi-threaded data copy operation on data corresponding to a plurality of selected content components; Sending a translation request to the server, wherein the translation request is generated according to a user's selection operation on the intermediate data; Receiving a translation result sent by the server; the translation result is obtained by the server using an external translation system to translate the pre-processed data to be translated; The server performs a multi-threaded data copy operation on the data corresponding to the multiple selected content components, including: Create replication tasks using the task management framework based on pre-set task scheduling information; For data corresponding to the multiple selected content components, a multi-threaded data replication operation is performed on the data according to the replication task; The performing a multi-threaded data replication operation on the replication task includes: Establish a mapping relationship between new and old data in the database to obtain a mapping table; According to the mapping table, new data is generated using N threads, where N is an integer multiple of the number of CPU cores executing thread operations; Use batch insert mode to insert the copied data into the database in batches; The method for obtaining the task scheduling information includes: According to the dependency relationship between the selected content components, the execution order of copying the selected content components is determined and used as task scheduling information; The selected content components include: column content components, model content components, data content components, model parameter content components, dictionary content components, label content components, advertisement content components and data model content components; The dependency relationship between the selected content components is: the data model content component depends on the data content component, the model parameter content component, the dictionary content component, the label content component and the advertising content component; the data content component, the model parameter content component, the dictionary content component, the label content component and the advertising content component depend on the column content component and the model content component.

6. An electronic device, characterized in that: The electronic device comprises a memory and at least one processor, the memory stores a computer program, and the at least one processor is configured to implement the method according to any one of claims 1 to 4 or claim 5 when executing the computer program.

7. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by at least one processor, the method according to any one of claims 1 to 4 or claim 5 is implemented.