A data processing method, device and medium for an application program
By using Chinese and foreign language configuration tables, multi-version language mapping tables, and a translation system to update target data on the server side, the problems of code redundancy and low translation efficiency in multilingual display of applications are solved, achieving efficient and low-cost multilingual display and response.
Patent Information
- Application Number
- CN202611260365.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-19
- Publication Date
- 2026-11-06
AI Technical Summary
Existing multilingual display methods for applications lead to code redundancy, increase development and maintenance costs, and rely on external translation systems or real-time human translation, which severely reduces response efficiency.
When the server receives a network request, it determines the target language configuration table from the Chinese and foreign language configuration tables based on the target language version, and updates the target data using a multi-version language mapping table and a translation system, thus avoiding code redundancy and enabling multi-language display.
It reduces the development and maintenance costs of applications, improves translation accuracy and response efficiency, reduces translation resource consumption, and enhances the internationalization efficiency of applications.
Smart Images

Figure CN123048090A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing, and in particular to a data processing method, apparatus, and medium for an application. Background Technology
[0002] With the continuous development of Internet technology, the demand for internationalized multilingual applications for global users is increasing. Users from different countries all want to use applications that display their own languages. In existing technologies, the methods for achieving multilingual display of applications usually rely heavily on the underlying code design. That is, during the application development stage, the multilingual text content is directly hard-coded into the code, and the language version matching, switching and rendering are performed within the code through conditional branching statements. For content that cannot be pre-embedded in the code, such as domain data or dynamic data in the database, external translation systems or manual translation are relied upon in real time.
[0003] However, the above method hard-codes multilingual text content directly into the code, leading to severe code redundancy. When new language versions of text content need to be added or the text content needs to be modified later, the code needs to be modified repeatedly and the entire application needs to be repackaged and released, which significantly increases the development and maintenance costs of the application. Furthermore, for content such as domain data or dynamic data in the database that cannot be pre-embedded in the code, all rely on external translation systems or manual real-time translation, which greatly increases the consumption of translation resources and seriously reduces response efficiency; thus reducing the overall efficiency of application internationalization. Summary of the Invention
[0004] To address the aforementioned technical problem, the technical solution adopted in this application is as follows:
[0005] According to a first aspect of this application, a data processing method for an application is provided, the method comprising the following steps:
[0006] S1. When the server receives a network request from the user, it determines the target functional module, target language version, and data query parameters based on the network request.
[0007] S2. Based on the target language version, determine the target language configuration table from the Chinese configuration table and several foreign language configuration tables corresponding to the static data of the target functional module.
[0008] S3. Based on the data query parameters, retrieve several target data from the database and determine the data type of each target data; the data types include domain data and dynamic data.
[0009] S4. If the data type of the target data is domain data, then based on the multi-version language mapping table corresponding to the target functional module, determine the target language version text corresponding to each Chinese language version text in the target data, and replace each Chinese language version text with the corresponding target language version text, so as to update the target data.
[0010] S5. If the target data is dynamic data, then update the target data based on the target language version and translation system.
[0011] S6. Generate response data corresponding to the network request based on the target language configuration table and target data, and return the response data to the user.
[0012] According to a second aspect of this application, a non-transitory computer-readable storage medium is provided, which stores at least one instruction or at least one program, wherein the at least one instruction or at least one program is loaded and executed by a processor to implement the above-described data processing method for an application program.
[0013] According to a third aspect of this application, an electronic device is provided, including a processor and the aforementioned non-transitory computer-readable storage medium.
[0014] This application has at least the following beneficial effects:
[0015] This application provides a data processing method, device, and medium for an application. In the method, when a server receives a network request from a user, it determines a target functional module, a target language version, and data query parameters based on the network request. According to the target language version, it determines a target language configuration table from a Chinese configuration table and several foreign language configuration tables corresponding to the static data of the target functional module. According to the data query parameters, it retrieves several target data from a database and determines the data type of each target data. If the data type of the target data is domain data, it determines the target language version text corresponding to each Chinese language version text in the target data based on a multi-version language mapping table corresponding to the target functional module, and replaces each Chinese language version text with the corresponding target language version text to update the target data. If the data type of the target data is dynamic data, it updates the target data based on the target language version and a translation system. It generates response data corresponding to the network request based on the target language configuration table and the target data, and returns the response data to the user. As can be seen, this application achieves multilingual display of the application through Chinese and foreign language configuration tables, avoiding code redundancy. When a new language version or text content needs to be added or modified later, only the Chinese and foreign language configuration tables need to be updated, without repeatedly modifying the source code and redeploying the application. This significantly reduces the development and maintenance costs of the application. Furthermore, for target data of different data types, different methods are used to update the target data to the target language version. Specifically, for target data of domain data type, a pre-built multi-version language mapping table is used for accurate and efficient text replacement, which significantly reduces the computational power consumption of real-time translation while ensuring translation accuracy. For target data of dynamic data type, real-time translation is performed through a translation system, ensuring timely response to non-standardized content. This improves overall response efficiency and effectively reduces the consumption of translation resources, thereby significantly improving the overall efficiency of application internationalization. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 A flowchart illustrating a data processing method for an application provided in an embodiment of this application. Detailed Implementation
[0018] The technical solutions in the embodiments of this application will be clearly and completely described below. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0019] It is worth noting that in the following description, specific details such as particular system structures and techniques are set forth for illustrative purposes rather than for limiting purposes, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application can also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods are omitted so as not to obscure the description of this application with unnecessary details.
[0020] Embodiments of this application provide a data processing method for an application, the method comprising the following steps, such as... Figure 1 As shown:
[0021] S1. When the server receives a network request from the user, it determines the target functional module, target language version, and data query parameters based on the network request.
[0022] Specifically, by parsing the network request, the interface identifier and target language version are obtained, and data query parameters are extracted; the data query parameters are used for data retrieval.
[0023] Specifically, the network request is an HTTP request.
[0024] Specifically, the target functional module is determined by the interface identifier in the network request; when the interface identifier in the network request is the same as a preset interface identifier in the preset interface mapping table, the functional module corresponding to the preset interface identifier that is the same as the interface identifier in the network request is determined as the target functional module; the preset interface mapping table stores several preset interface identifiers and the functional module identifier of the functional module corresponding to each preset interface identifier.
[0025] Specifically, the target language version is the current system language version of the electronic device running the application.
[0026] S2. Based on the target language version, determine the target language configuration table from the Chinese configuration table and several foreign language configuration tables corresponding to the static data of the target functional module.
[0027] Specifically, the process before step S2 also includes:
[0028] S01. Based on the application's source code, obtain the Chinese configuration table corresponding to the static data of each functional module of the application, and store the Chinese configuration table in the server. The Chinese configuration table includes several first key-value pairs corresponding to the static data. The first key-value pairs include the Chinese language version of the text and the user interface positioning information corresponding to the text.
[0029] Specifically, the text in the first key-value pair is the text in the static data corresponding to its Chinese configuration table; the text is a string with complete semantics, such as words (e.g., login, submit, cancel, refresh), phrases (e.g., please enter the verification code, forget password) or complete sentences (e.g., your account has been logged in on another device, please re-verify, click here to modify your profile picture and nickname), which can be used as an independent translation unit for the translation platform to perform language conversion, rather than a single character without independent semantics.
[0030] Specifically, the user interface positioning information corresponding to the text includes the relative position information of the UI component corresponding to the text within the application's user interface.
[0031] Specifically, the text is extracted from the static data corresponding to each functional module of the application from the application's source code using text matching rules, and the UI component identifier corresponding to the text is determined. The relative position information of the UI component corresponding to the UI component identifier in the application's user interface is used as the user interface positioning information corresponding to the text. As those skilled in the art know, any text matching rule in the prior art that can extract Chinese language version text from the source code is within the protection scope of this invention, such as regular expressions, which will not be elaborated here.
[0032] Furthermore, the relative position information of the UI component in the application's user interface includes, but is not limited to: the width and height parameters of the UI component, and the offset of the UI component relative to the edge of its parent container; wherein, as those skilled in the art know, the specific parameters in the relative position information of the UI component in the application's user interface are predetermined by those skilled in the art according to actual needs, for example: the width of the UI component is 50% of the width of the parent container, and the height is 100 pixels; the offset of the left edge of the UI component from the left edge of its parent container is 20 pixels, and the offset of the bottom edge of the UI component from the bottom edge of its parent container is 30 pixels; further details will not be elaborated here.
[0033] Specifically, the functional modules of an application can be understood as software units within the application that have independent business logic and can be compiled or run independently; for example, the software unit corresponding to hotel booking is the hotel booking module, the software unit corresponding to flight booking is the flight booking module, and the software unit corresponding to restaurant booking is the restaurant booking module.
[0034] Specifically, static data refers to content that serves as a fixed identifier or prompt during the application's interface rendering process and does not dynamically change with the application's running state or user interaction. Examples include the word "Login" displayed on the login screen, the word "Home" displayed in the home navigation bar, or other fixed prompts.
[0035] S02. For each Chinese configuration table, send the Chinese configuration table to the translation system to obtain several foreign language configuration tables corresponding to the static data of the Chinese configuration table, and store each foreign language configuration table on the server. The foreign language configuration table includes a second key-value pair that corresponds one-to-one with the first key-value pair in the corresponding Chinese configuration table. The second key-value pair includes the text of the foreign language version corresponding to the text in the first key-value pair and the user interface positioning information.
[0036] Specifically, the foreign language version refers to a language version other than the Chinese language version, including at least the English language version; the foreign language configuration table and the foreign language version are in a one-to-one correspondence, that is, two different foreign language configuration tables correspond to different foreign language versions, and different texts in the same foreign language configuration table correspond to the same foreign language version.
[0037] Specifically, the foreign language versions also include: Russian, French, Japanese, and Korean.
[0038] Specifically, while sending the Chinese configuration table to the translation system, several foreign language versions are also sent to the translation system.
[0039] Specifically, the translation system internally integrates a large language model or translation software to perform machine translation tasks.
[0040] Specifically, after receiving the Chinese configuration table and several foreign language versions, the translation system determines the processing order of the foreign language versions according to their preset priority scores from high to low, and identifies the foreign language version with the highest priority score as the current foreign language version to be processed. It then calls a large language model or translation software to perform machine translation on the text in the first key-value pair of the Chinese configuration table, translating the text into the text of the current foreign language version to be processed, thereby generating the corresponding foreign language configuration table. This foreign language configuration table is then manually reviewed and returned to the server. Foreign language versions whose processing order follows the current foreign language version are identified as the new current foreign language version to be processed, and the above translation, review, and return operations are repeated until the foreign language configuration table of the last foreign language version in the processing order is returned to the server. The English language version has the highest preset priority score; the preset priority scores for other foreign language versions are preset by those skilled in the art according to actual needs and will not be elaborated here.
[0041] Specifically, manual review of the foreign language configuration table includes: checking whether there are translation errors in the text of the foreign language version of the foreign language configuration table; when a translation error is found, it is manually corrected to the accurate text so that the foreign language configuration table can be updated.
[0042] In the embodiments of this application, the Chinese configuration table and the foreign language versions are sent to an external translation system. The translation system generates foreign language configuration tables in descending order of priority scores corresponding to the foreign language versions, and returns the manually reviewed foreign language configuration tables to the server. This ensures that the configuration tables for the more important foreign language versions are prioritized, and the manual review ensures the accuracy of the final foreign language configuration tables. This enables multilingual display of the application using only the Chinese and foreign language configuration tables, eliminating the need to hardcode the multilingual text content into the code, avoiding code redundancy. After developing the Chinese language version of the application, it can be deployed directly, resulting in rapid development. Furthermore, when new language versions or text content need to be added or modified later, only the Chinese and foreign language configuration tables need to be updated, without repeatedly modifying the source code and redeploying the application. This significantly reduces the development and maintenance costs of the application and greatly improves the overall efficiency of application internationalization.
[0043] By following the steps above, it is not necessary to hardcode the multilingual text content into the code. Instead, the Chinese configuration tables corresponding to the static data of each functional module are extracted from the source code, and several corresponding foreign language configuration tables are obtained through an external translation platform. The multilingual display of the application is achieved through the Chinese and foreign language configuration tables. This avoids code redundancy, and the application can be directly deployed after the Chinese language version is developed, resulting in fast development speed. When it is necessary to add language versions or modify text content in the future, only the Chinese and foreign language configuration tables need to be updated, without repeatedly modifying the source code and redeploying the application. This significantly reduces the development and maintenance costs of the application and significantly improves the overall efficiency of application internationalization.
[0044] Specifically, step S2 includes the following steps S21-S23:
[0045] S21. When the target language version is Chinese, the Chinese configuration table will be used as the target language configuration table.
[0046] S22. When the target language version is not Chinese, if the target language version is included in all foreign language versions corresponding to all foreign language configuration tables, then the foreign language configuration table corresponding to the target language version shall be used as the target language configuration table; otherwise, determine whether the English language version is included in all foreign language versions corresponding to all foreign language configuration tables.
[0047] S23. If the English language version is included, the foreign language configuration table corresponding to the English language version shall be used as the target language configuration table; if the English language version is not included, the Chinese configuration table shall be used as the target language configuration table.
[0048] By following the steps above, when the target language version is neither the Chinese language version nor the foreign language version corresponding to the foreign language configuration table, the English language version of the foreign language configuration table is given priority as the target language configuration table. When there is no English language version of the foreign language configuration table, the Chinese configuration table is used as the target language configuration table. This avoids abnormal issues such as blank pages, errors, or network request failures due to the inability to find the corresponding language configuration. At the same time, using English as the first-priority fallback language maximizes the common reading experience for multilingual users in global applications.
[0049] S3. Based on the data query parameters, retrieve several target data from the database and determine the data type of each target data; the data types include domain data and dynamic data.
[0050] Specifically, in step S3, several data are retrieved from the database according to the data query parameters. For each retrieved data, if the data type label corresponding to the data is dynamic data, then the data is determined to be target data with dynamic data type; otherwise, the data is determined to be target data with domain data type.
[0051] In one specific embodiment, if the data retrieved from the database according to the data query parameters does not have a corresponding data type label, then the data type label corresponding to the data is determined to be domain data and stored in the database.
[0052] Specifically, domain data can be understood as data that has exclusive business meaning within a specific business domain and is only accessed and displayed when entering that specific business scenario. Domain data is persistently stored in a database and can dynamically change in response to backend configuration commands or data source updates. For example, in the hotel booking module, data such as 'hotel name' or 'hotel star rating' retrieved and returned from the database based on the user's current search criteria belongs to the domain data of the hotel booking module. Although this data is pre-stored in the database, when the hotel operator modifies the star rating in the backend, the domain data in the database will be updated accordingly and retrieved the next time the user searches. Data like 'airport name', which is unrelated to hotel booking but related to flight booking, belongs to the domain data of a module such as flight booking, but not to the domain data of the hotel booking module.
[0053] Specifically, dynamic data refers to data whose content changes in real time during the operation of the application, as user interaction or business logic is executed; for example, the content of posts published and updated by users in real time in the forum module.
[0054] S4. If the data type of the target data is domain data, then based on the multi-version language mapping table corresponding to the target functional module, determine the target language version text corresponding to each Chinese language version text in the target data, and replace each Chinese language version text with the corresponding target language version text, so as to update the target data.
[0055] Specifically, the multi-version language mapping list corresponding to the target functional module includes several preset Chinese texts corresponding to the target functional module and several foreign language texts corresponding to each preset Chinese text; wherein, the Chinese texts are texts in the Chinese language version; the foreign language texts are texts in the foreign language version; the preset Chinese texts are Chinese texts predetermined by those skilled in the art based on the functional module and actual needs, and will not be elaborated here.
[0056] Specifically, the preset Chinese text corresponds to several foreign language texts, which are obtained through a translation system.
[0057] Furthermore, each preset Chinese text and several foreign language versions are sent to the translation system to obtain the corresponding foreign language texts for the preset Chinese text.
[0058] Specifically, after receiving the preset Chinese text and several foreign language versions, the translation system determines the processing order of the foreign language versions according to their preset priority scores from high to low, and identifies the foreign language version with the highest priority as the current foreign language version to be processed. It then calls a large language model or translation software to perform machine translation on the preset Chinese text, translating it into the foreign language text corresponding to the current foreign language version. The foreign language text is then manually reviewed and returned. Foreign language versions whose processing order follows the current foreign language version are identified as the new current foreign language version to be processed, and the above translation, review, and return operations are repeated until the foreign language text corresponding to the last foreign language version in the processing order is returned.
[0059] Furthermore, manual review of foreign language texts includes: checking for translation errors; and when translation errors are found, manually correcting them to accurate text so that the foreign language text can be updated.
[0060] Specifically, step S4 includes the following steps S41-S43:
[0061] S41. For each Chinese language version of text in the target data, if all preset Chinese texts in the multi-version language mapping table corresponding to the target functional module include the text of the Chinese language version, then obtain all foreign language texts corresponding to the text of the Chinese language version from the multi-version language mapping table; otherwise, proceed to step S43.
[0062] S42. If the foreign language versions corresponding to all foreign language texts include the target language version, then the foreign language text corresponding to the target language version is used as the text of the target language version corresponding to the Chinese language version; otherwise, proceed to step S43.
[0063] S43. Send the Chinese language version text and the target language version to the translation system to obtain the target language version text corresponding to the Chinese language version text; wherein, those skilled in the art know that the method of obtaining the target language version text corresponding to the Chinese language version is the same as the method of obtaining the foreign language text corresponding to the preset Chinese text, and will not be described again here.
[0064] Through the above steps, a progressive processing mechanism of table lookup first and translation as a fallback is constructed. For target data of domain data type, the target language version of the text for each Chinese language version in the target data is first determined according to the multi-version language mapping table corresponding to the target functional module. The response speed is fast and the accuracy of the target language version text can be guaranteed. When the target language version text cannot be obtained according to the multi-version language mapping table, the target language version text corresponding to the Chinese language version text is then obtained through the translation system to avoid data display abnormalities caused by the inability to obtain the target language version text. This minimizes unnecessary translation interface calls and reduces the consumption of translation resources while ensuring translation accuracy.
[0065] S5. If the target data is dynamic data, then update the target data based on the target language version and translation system.
[0066] Specifically, step S5 includes: sending the text of each Chinese language version and the target language version in the target data to the translation system to obtain the text of the target language version corresponding to each Chinese language version in the target data, and replacing the text of each Chinese language version in the target data with the text of the corresponding target language version, so as to update the target data.
[0067] In another specific embodiment, step S5 includes: obtaining translation data of the target language version corresponding to the target data based on the translation system, and using the translation data as the target data to update the target data.
[0068] Specifically, obtaining translation data in the target language version corresponding to the target data based on the translation system includes: sending the target data and the target language version to the translation system to obtain the translation data in the target language version corresponding to the target data.
[0069] Specifically, after receiving the target data and the target language version, the translation system calls a large language model or translation software to perform machine translation on the target data, translating the target data into the target language version of the translated data; the translated data is then manually reviewed, and the translated data is returned after the review is completed.
[0070] Furthermore, manual review of the translation data includes: checking whether there are any translation errors; when translation errors are found, the data is corrected manually to ensure accuracy, so that the translation data can be updated.
[0071] S6. Generate response data corresponding to the network request based on the target language configuration table and target data, and return the response data to the user terminal.
[0072] Specifically, after receiving the response data, the client parses the response data and renders and displays the response data on the user interface based on the parsing results.
[0073] Through the above steps, multilingual display of the application is achieved using Chinese and foreign language configuration tables, avoiding code redundancy. When new language versions or text content need to be added or modified later, only the Chinese and foreign language configuration tables need to be updated, without repeatedly modifying the source code and redeploying the application. This significantly reduces the development and maintenance costs of the application. Furthermore, different methods are used to update the target data to correspond to the target language version for different data types. For target data of domain data type, a pre-built multi-version language mapping table is used for accurate and efficient text replacement, which greatly reduces the computational power consumption of real-time translation while ensuring translation accuracy. For target data of dynamic data type, real-time translation is performed through the translation system, ensuring timely response to non-standardized content. This improves overall response efficiency and effectively reduces the consumption of translation resources, thereby significantly improving the overall efficiency of application internationalization.
[0074] This application also provides a specific embodiment, which differs from the above embodiment in that it includes steps S10-S20 before step S1:
[0075] S10. When the server receives dynamic data in Chinese language version, it stores the dynamic data in the database and extracts the first summary data from the dynamic data according to a preset extraction rule. Those skilled in the art will understand that any method in the prior art for determining whether data received by the server is dynamic data falls within the protection scope of this invention. For example, determining whether data is dynamic data based on the data's source interface; that is, if the data's source interface is a preset dynamic data interface, then the data is determined to be dynamic data; otherwise, the data is determined to be domain data. Further details will not be elaborated here. The data received by the server includes data submitted by the client and data uploaded by the backend.
[0076] Specifically, the text in the dynamic data for the Chinese language version is the text for the Chinese language version.
[0077] Specifically, in step S10, while storing the dynamic data in the database, the data type label of the dynamic data is also stored in the database. The data type label of the dynamic data is "dynamic data".
[0078] Specifically, when the server receives dynamic data or domain data in a non-Chinese language version, it stores the non-Chinese language version of the dynamic data or domain data in the database. At the same time, it also stores the data type tag of the non-Chinese language version of the dynamic data or domain data in the database. The data type tag of the non-Chinese language version of the dynamic data is "Dynamic Data", and the data type tag of the domain data is "Domain Data".
[0079] Specifically, the first summary data consists of the first few complete semantic texts extracted from dynamic data according to preset truncation rules.
[0080] Optionally, the preset truncation rule is as follows: obtain the number of characters in the content before the i-th preset semantic segmenter in the dynamic data. If the number of characters is not less than the preset number of characters, then the content before the i-th preset semantic segmenter is used as the first summary data; if the number of characters is less than the preset number of characters, then let i = i + 1, and continue to determine whether the number of characters in the content before the i-th preset semantic segmenter in the dynamic data is less than the preset number of characters, so as to obtain the first summary data; where i is a pre-designed value and the initial value of i is 1; the preset number of characters is the number of characters predetermined by those skilled in the art according to actual needs, such as 100, 150, which will not be elaborated here.
[0081] S20. Obtain second summary data in several foreign language versions corresponding to the first summary data based on the translation system, and store the first summary data and each second summary data corresponding to the first summary data in the server.
[0082] Specifically, the first summary data and several foreign language versions are sent to the translation system to obtain the second summary data in several foreign language versions corresponding to the first summary data; wherein, as those skilled in the art know, the method for obtaining the second summary data in several foreign language versions corresponding to the first summary data is the same as the method for obtaining several foreign language texts corresponding to the preset Chinese text, and will not be described in detail here.
[0083] Through the above steps, when the server receives dynamic data in Chinese language version, it stores the dynamic data in the database and extracts the first summary data from the dynamic data according to the preset extraction rules; it obtains the second summary data in several foreign language versions corresponding to the first summary data based on the translation system, and stores the first summary data and each corresponding second summary data in the server; when the user only needs to display part of the dynamic data, the server can directly match and return the pre-stored first summary data or second summary data, completely avoiding the time-consuming real-time full-text translation process, greatly reducing the concurrent computing pressure on the server, and significantly improving the response speed and user experience.
[0084] Further, step S5 includes:
[0085] S51. When the display mode corresponding to the target functional module is partial display, based on the target data, the first summary data and the second summary data corresponding to the first summary data, obtain the target summary data of the target language version corresponding to the target data, and use the target summary data as the target data to update the target data.
[0086] S52. When the display mode corresponding to the target function module is "all display", the translation data of the target language version corresponding to the target data is obtained based on the translation system, and the translation data is used as the target data to update the target data.
[0087] Specifically, the display modes include full display and partial display.
[0088] Specifically, by parsing the network request, the dynamic data display identifier corresponding to the target functional module is obtained. When the dynamic data display identifier is identifier 0, the display mode corresponding to the target functional module is determined to be partial display. When the dynamic data display identifier is identifier 1, the display mode corresponding to the target functional module is determined to be full display.
[0089] Through the above steps, when the display mode corresponding to the target functional module is partial display, the pre-stored first summary data or second summary data is directly matched and returned, completely avoiding real-time full-text translation, greatly reducing translation costs and significantly improving response speed; when the display mode corresponding to the target functional module is full display, the translation data of the target language version corresponding to the target data is obtained through the translation system; this avoids lag caused by translation when briefly displaying dynamic data, and ensures the accurate presentation of content when dynamic data is fully displayed, which is conducive to improving the overall operating efficiency of the application and user experience.
[0090] Specifically, based on the target data, the first summary data, and the second summary data corresponding to the first summary data, the target language version of the target data is obtained, including the following steps:
[0091] S511. For each first digest data in the server, match the first digest data with the target data.
[0092] Specifically, matching the first summary data with the target data includes: obtaining the number of characters in the first summary data, determining the position of that number of characters in the target data, and taking the data before that position in the target data as the data to be matched; matching the first summary data with the data to be matched, and taking the matching result as the matching result of the first summary data and the target data; wherein, as those skilled in the art know, any matching method in the prior art is within the protection scope of this invention, such as: character-by-character matching, semantic similarity matching, hash value matching, which will not be elaborated here.
[0093] Specifically, the matching results include successful matching and failed matching. Successful matching means that the first summary data is highly similar to or the same as the data to be matched corresponding to the target data, and the first summary data comes from the target data. Failed matching means that the first summary data is not similar to the data to be matched corresponding to the target data, and the first summary data does not come from the target data.
[0094] S512. When the foreign language versions of all the second summary data corresponding to the first summary data that successfully matches the target data include the target language version, the second summary data corresponding to the target language version among all the second summary data corresponding to the first summary data that successfully matches the target data shall be used as the target summary data of the target language version corresponding to the target data; otherwise, the first summary data that successfully matches the target data and the target language version shall be sent to the translation system to obtain the target summary data of the target language version corresponding to the target data.
[0095] In one specific embodiment, if no first summary data that successfully matches the target data exists, third summary data is extracted from the target data according to a preset truncation rule, and the third summary data and the target language version are sent to the translation system to obtain the target summary data of the target language version corresponding to the target data.
[0096] Through the above steps, the first summary data in the server is first matched with the target data. If the foreign language versions of all the second summary data corresponding to the first summary data that successfully matches the target data include the target language version, then the second summary data corresponding to the target language version among all the second summary data that successfully matches the target data is used as the target summary data for the target language version of the target data. Otherwise, the first summary data and the target language version that successfully match the target data are sent to the translation system to obtain the target summary data for the target language version of the target data. The first summary data or the second summary data are reused first. When the target summary data cannot be obtained from the first summary data or the second summary data, the summary data is then obtained through the translation system. This not only improves the response speed but also saves a lot of translation costs and avoids the problem of blank page display due to missed translations.
[0097] This application also provides a specific embodiment, which differs from the above embodiment in that, after step S10, steps S100-S400 are included:
[0098] S100. At each preset fixed time interval, obtain the current popularity value of each dynamic data in the database; wherein, those skilled in the art know that the preset fixed time interval is a time interval preset by those skilled in the art according to actual needs, such as: 1 second, 5 seconds, 10 seconds; any method of obtaining popularity value in the prior art is within the protection scope of this invention, such as: the Hotness algorithm based on the number of likes, comments and shares; it will not be described in detail here.
[0099] S200. Sort each dynamic data in the database according to the current popularity value from high to low, so as to obtain the current order index value corresponding to each dynamic data in the database.
[0100] S300. For each piece of dynamic data in the database, if the current sequential index value corresponding to the dynamic data is not greater than a preset index threshold, and the popularity value tag corresponding to the dynamic data is low popularity, then based on the translation platform, the foreign language data of several foreign language versions corresponding to the dynamic data is obtained, and the dynamic data and the foreign language data of several foreign language versions corresponding to the dynamic data are stored in the server. At the same time, the popularity value tag corresponding to the dynamic data is updated to high popularity. The preset index threshold is an index threshold pre-set by those skilled in the art according to actual needs, such as 10 or 20, which will not be elaborated here.
[0101] Specifically, obtaining foreign language data in several foreign language versions corresponding to the dynamic data based on the translation platform includes: sending the dynamic data and several foreign language versions to the translation platform to obtain foreign language data in several foreign language versions corresponding to the dynamic data; wherein, those skilled in the art know that the method of obtaining foreign language data in several foreign language versions corresponding to the dynamic data is the same as the method of obtaining several foreign language texts corresponding to the preset Chinese text, and will not be described in detail here.
[0102] S400. For each piece of dynamic data in the database, if the current sequential index value corresponding to the dynamic data is greater than the preset index threshold, and the popularity value tag corresponding to the dynamic data is high popularity, then delete the dynamic data and the foreign language versions of the dynamic data corresponding to the dynamic data from the server, and at the same time update the popularity value tag corresponding to the dynamic data to low popularity.
[0103] Through the above steps, at preset fixed intervals, the current popularity value of each dynamic data in the database is obtained; each dynamic data in the database is sorted in descending order of current popularity value to obtain the current order index value corresponding to each dynamic data in the database; if the current order index value corresponding to the dynamic data is not greater than the preset index threshold, and the popularity value label corresponding to the dynamic data is low popularity, it means that the popularity of the dynamic data has increased. Therefore, based on the translation platform, several foreign language versions of the dynamic data are obtained, and the dynamic data and the several foreign language versions of the dynamic data are stored in the server. At the same time, the popularity value label corresponding to the dynamic data is updated to high popularity. If the current sequential index value corresponding to dynamic data is greater than the preset index threshold, and the popularity value tag corresponding to the dynamic data is high popularity, it indicates that the popularity of the dynamic data has decreased. Therefore, the dynamic data and its corresponding foreign language versions are deleted from the server, and the popularity value tag corresponding to the dynamic data is updated to low popularity. This ensures that the server always stores high-popularity dynamic data and its corresponding foreign language versions, ensuring that high-popularity dynamic data can be responded to quickly, thereby greatly improving the user browsing experience. It also automatically cleans up low-popularity dynamic data and its corresponding foreign language versions from the server, freeing up storage space and avoiding wasted computing power and server storage overload.
[0104] Furthermore, based on the translation system, translation data in the target language version corresponding to the target data is obtained, including:
[0105] If the target data is included in all the dynamic data stored on the server, and the target language version is included in all the foreign language versions of all the foreign language data corresponding to the target data, then the foreign language data corresponding to the target language version in all the foreign language data corresponding to the target data will be used as the translation data for the target language version of the target data; otherwise, the target data and the target language version will be sent to the translation system to obtain the translation data for the target language version of the target data.
[0106] Optionally, for each piece of dynamic data in the server, the dynamic data is matched with the target data. If there is dynamic data that successfully matches the target data, then it is determined that the target data is included in all the dynamic data stored in the server; that is, the dynamic data that successfully matches the target data is the target data. The matching method between dynamic data and target data is the same as the matching method between the first summary data and the data to be matched.
[0107] By prioritizing the direct matching and reuse of foreign language data stored on the server, the response speed is extremely fast, and significant translation costs are saved. When the server does not store the foreign language version corresponding to the target data, the target data is then translated in real time through the translation system to obtain the translation data of the target language version. This avoids the waste of resources caused by repeated translation and ensures the complete presentation of the translation data of the target language version, thereby improving the application's operating efficiency and user experience.
[0108] This application also provides a specific embodiment, which differs from the above embodiment in that, after step S10, it further includes S001-S003:
[0109] S001. When the server receives dynamic data in Chinese language version, it sends the dynamic data and several foreign language versions to the translation system to obtain the foreign language data in several foreign language versions corresponding to the dynamic data.
[0110] S002. Store the dynamic data and the corresponding foreign language versions of the dynamic data in the server, and record the storage time point corresponding to the dynamic data.
[0111] S003. When the interval between the storage time point corresponding to the dynamic data and the current time point reaches the cumulative maximum storage time corresponding to the dynamic data, delete the dynamic data and the foreign language versions of the dynamic data corresponding to the dynamic data from the server.
[0112] Specifically, the initial value of the cumulative maximum storage duration for all dynamic data is the same, which is a fixed duration preset by those skilled in the art according to actual needs, such as 30 minutes or 60 minutes.
[0113] Furthermore, when the dynamic data is the target data, the cumulative maximum storage time corresponding to the dynamic data is increased by a preset growth period, so as to update the cumulative maximum storage time corresponding to the dynamic data; the preset growth period is a duration predetermined by those skilled in the art based on actual needs, for example: 10 minutes.
[0114] Through the above steps, by accumulating the maximum storage time, the system automatically cleans up dynamic data stored on the server that has reached the maximum storage time, along with its corresponding foreign language versions, preventing server storage bloat. At the same time, when dynamic data is frequently accessed, the system automatically extends the maximum storage time corresponding to that dynamic data, avoiding the long-term occupation of storage resources by low-frequency data while ensuring that the translation results of high-frequency data can be continuously reused. This ensures response speed while achieving an effective balance between storage cost and operational efficiency.
[0115] In this application embodiment, a non-transitory computer-readable storage medium is also provided. This non-transitory computer-readable storage medium can be disposed in an electronic device to store at least one instruction or at least one program related to implementing the method provided in any embodiment of this application. The at least one instruction or the at least one program is loaded and executed by a processor to implement the method provided in any embodiment of this application, and can achieve the same technical effect. To avoid repetition, further details are omitted here.
[0116] Examples of non-transitory computer-readable storage media include: computer read-only memory (ROM), random access memory (RAM), erasable programmable read-only memory (EPROM), compact disc read-only memory (CD-ROM), flash memory, magnetic disk, optical disk, portable computer disk, hard disk and / or solid-state drive, etc.
[0117] In this application embodiment, an electronic device is also provided, the electronic device including a processor and the non-transitory computer-readable storage medium. The processor loads and executes at least one instruction or at least one program stored in the non-transitory computer-readable storage medium related to implementing the method provided in any embodiment of this application, so as to implement the method provided in the embodiment of this application.
[0118] For example, the electronic device may be a mobile electronic device or a non-mobile electronic device that also includes other functions such as a personal digital assistant and / or music player. Further, the mobile electronic device may be any one of a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA); the non-mobile electronic device includes any one of a server, network attached storage (NAS), personal computer (PC), television (TV), ATM, or self-service machine. No specific limitations are made in the embodiments of this application.
[0119] For example, the processor can be a processor in any electronic device.
[0120] Exemplary embodiments of this application also provide a feasible structure for an electronic device. For example, the electronic device may include a processor, an external memory interface, internal memory, a universal serial bus (USB) interface (hereinafter referred to as a USB interface), a charging management module, a power management module, a battery, a first antenna, a second antenna, a mobile communication module, a wireless communication module, an audio module, a speaker, a receiver, a microphone, a headphone jack, a sensor module, buttons, a motor, an indicator, a camera, a display screen, and a subscriber identification module (SIM) card interface (hereinafter referred to as a SIM card interface), etc. The sensor module may include pressure sensors, gyroscope sensors, barometric pressure sensors, magnetic sensors, accelerometers, distance sensors, proximity sensors, fingerprint sensors, temperature sensors, touch sensors, ambient light sensors, and / or bone conduction sensors, etc.
[0121] It should be understood that the exemplary structures of the embodiments of this application do not constitute a specific limitation on the electronic device. In other embodiments of this application, the electronic device may include more or fewer components than the structure described herein, or combine some components, or split some components, or have different component arrangements. The components may be implemented in hardware, software, or a combination of software and hardware.
[0122] For example, the processor may include one or more processing units, wherein the processing units include: an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors. The controller may generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution.
[0123] For example, the processor may further include a memory for storing instructions and data. In some embodiments of this application, the memory in the processor is a cache memory. The memory can store instructions or data that the processor has just used or that are used repeatedly. If the processor needs to use the instructions or data again, it can directly retrieve them from the memory.
[0124] For example, the processor may also include one or more interfaces. These interfaces include: an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a SIM card interface, and / or a USB interface, etc.
[0125] The integrated circuit interface is a bidirectional synchronous serial bus, which includes a serial data line (SDA) and a serial clock line (SCL).
[0126] Integrated circuits with built-in audio interfaces can be used for audio communication. In some embodiments of this application, the processor may include multiple sets of integrated circuit-based audio interfaces. The processor can couple with an audio module through the integrated circuit-based audio interface to achieve communication between the processor and the audio module.
[0127] The pulse code modulation interface can also be used for audio communication, specifically for sampling, quantizing, and encoding analog signals. In some embodiments of this application, the audio module and the wireless communication module can be coupled through the pulse code modulation interface.
[0128] A Universal Asynchronous Receiver / Transmitter (UART) is a universal serial data bus interface used for asynchronous communication. This bus can be a bidirectional communication bus interface. It converts the data to be transmitted between serial and parallel communication. In some embodiments of this application, the processor and the wireless communication module can be connected via the UART.
[0129] Mobile industry processor interfaces can be used to connect processors to peripheral devices such as displays and cameras.
[0130] General purpose input / output interfaces can be configured via software.
[0131] Furthermore, the general-purpose input / output interface can be configured as a control signal or a data signal. In some embodiments of this application, the general-purpose input / output interface can be used to connect the processor to a camera, display screen, wireless communication module, audio module, sensor module, etc.
[0132] A USB interface is an interface that conforms to the USB standard specification, specifically including Mini USB, Micro USB, and USB Type-C interfaces. USB interfaces can be used to connect chargers to charge electronic devices, and also for transferring data between electronic devices and peripheral devices.
[0133] It should be understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a limitation on the structure of the electronic device. In other embodiments of this application, the electronic device may also employ different interface connection methods or a combination of multiple interface connection methods as described in the embodiments.
[0134] The charging management module receives charging input from a charger, which can be either a wireless or wired charger. In some wired charging embodiments, the charging management module receives charging input from the wired charger via a USB interface. In some wireless charging embodiments, the charging management module receives wireless charging input via the wireless charging coil of the electronic device. While charging the battery, the charging management module can also supply power to various parts of the electronic device via the power management module.
[0135] The power management module is used to connect the battery, the charging management module, and the processor.
[0136] Wireless communication functionality in electronic devices can be achieved through a first antenna, a second antenna, a mobile communication module, a wireless communication module, a modem processor, and a baseband processor.
[0137] Mobile communication modules can enable wireless communication solutions, including 2G / 3G / 4G / 5G, for use in electronic devices.
[0138] A modem processor may include a modulator and a demodulator. The modulator modulates a low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates a received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to a baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signal is transmitted to an application processor. The application processor outputs sound signals through audio devices (not limited to speakers, receivers, etc.) or displays images or videos on a display screen. In some embodiments of this application, the modem processor may be a separate device. In other embodiments, the modem processor may be independent of the processor and housed within the same device as the mobile communication module or other functional modules.
[0139] Wireless communication modules can enable solutions for wireless communication applications in electronic devices, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies.
[0140] In some embodiments of this application, the first antenna of the electronic device is coupled to the mobile communication module, and the second antenna is coupled to the wireless communication module, enabling the electronic device to communicate with networks and other devices via wireless communication technology.
[0141] Electronic devices utilize GPUs, displays, and application processors to achieve their display functions. A GPU is a microprocessor for image processing, connecting the display and the application processor. GPUs perform mathematical and geometric calculations and are used for graphics rendering. A processor may include one or more GPUs, which execute program instructions to generate or modify display information.
[0142] The display screen is used to display images, videos, etc. The display screen includes a display panel. The display panel can be a liquid crystal display (LCD), or a display panel made of materials selected from organic light-emitting diodes (OLEDs), active-matrix organic light-emitting diodes (AMOLEDs), flexible light-emitting diodes (FLEDs), minimized, microLEDs, micro-OLEDs, or quantum dot light-emitting diodes (QLEDs). In some embodiments of this application, the electronic device may include one or more display screens. In some embodiments of this application, the display screen may also integrate touch functionality and may also be referred to as a touch screen.
[0143] Electronic devices can achieve shooting functions through ISPs, cameras, video codecs, GPUs, displays, and application processors.
[0144] External storage interfaces can be used to connect external memory cards, such as Micro SD cards, to expand the storage capacity of electronic devices.
[0145] Internal memory can be used to store executable program code for a computer, which includes instructions. The processor executes the instructions stored in internal memory to perform various functional applications and data processing of electronic devices.
[0146] Electronic devices can implement audio functions through audio modules, speakers, receivers, microphones, headphone jacks, and application processors. Examples include music playback and recording.
[0147] The audio module converts digital audio information into analog audio signals for output, and also converts analog audio input into digital audio signals. The speaker, also called a "horn," converts audio electrical signals into sound signals. The receiver, also called a "handset," converts audio electrical signals into sound signals. The microphone, also called a "microphone" or "voice transducer," converts sound signals into electrical signals. The headphone jack is used to connect wired headphones.
[0148] Pressure sensors are used to sense pressure signals and convert them into electrical signals. In some embodiments of this application, the pressure sensor can be located on the display screen. A gyroscope sensor can be used to determine the motion posture of the electronic device. A barometric pressure sensor is used to measure air pressure. In some embodiments of this application, the electronic device calculates altitude using the air pressure value measured by the barometric pressure sensor, assisting in positioning and navigation. An accelerometer can detect the magnitude of acceleration of the electronic device in various directions (generally three axes). A distance sensor is used to measure distance. A fingerprint sensor is used to collect fingerprints. A touch sensor, also known as a "touch panel," can be located on the display screen, forming a touchscreen, also known as a "touch screen." A bone conduction sensor can acquire vibration signals. In some embodiments of this application, a bone conduction sensor can acquire vibration signals from vibrating bone fragments in the human vocal cords. A bone conduction sensor can also contact the human pulse to receive blood pressure signals.
[0149] The buttons include a power button and volume buttons. A motor can generate vibration alerts. Indicators can be indicator lights, used to show charging status, battery level changes, messages, missed calls, notifications, etc. A SIM card slot is used to connect a SIM card.
[0150] Embodiments of this application also provide a computer program product including program code that, when the program product is run on an electronic device, causes the electronic device to perform the steps of the methods described in this specification according to various exemplary embodiments of this application.
[0151] This application also provides a chip, which includes a processor and a communication interface. The communication interface is used to receive signals and transmit the signals to the processor. The processor processes the signals so that the methods described in the various exemplary embodiments of this application are executed.
[0152] While specific embodiments of this application have been described in detail by way of examples, those skilled in the art should understand that the examples are for illustrative purposes only and not intended to limit the scope of this application. Those skilled in the art should also understand that various modifications can be made to the embodiments without departing from the scope and spirit of this application. The scope of this application is defined by the appended claims.
Claims
1. A data processing method for an application, characterized in that, The method includes the following steps: S1. When the server receives a network request from the user, it determines the target functional module, target language version, and data query parameters based on the network request. S2. Based on the target language version, determine the target language configuration table from the Chinese configuration table and several foreign language configuration tables corresponding to the static data of the target functional module; S3. Based on the data query parameters, retrieve several target data from the database and determine the data type of each target data; the data types include domain data and dynamic data; S4. If the data type of the target data is domain data, then based on the multi-version language mapping table corresponding to the target functional module, determine the target language version text corresponding to each Chinese language version text in the target data, and replace each Chinese language version text with the corresponding target language version text so as to update the target data. S5. If the target data is dynamic data, then update the target data based on the target language version and translation system; S6. Generate response data corresponding to the network request based on the target language configuration table and target data, and return the response data to the user terminal.
2. The data processing method for an application according to claim 1, characterized in that, The multi-version language mapping list corresponding to the target functional module includes several preset Chinese texts corresponding to the target functional module and several foreign language texts corresponding to each preset Chinese text; wherein, the Chinese texts are texts in the Chinese language version; the foreign language texts are texts in the foreign language version; the foreign language version is a language version other than the Chinese language version, including at least the English language version.
3. The data processing method for an application according to claim 2, characterized in that, Step S4 includes the following steps: S41. For each Chinese language version of text in the target data, if all preset Chinese texts in the multi-version language mapping table corresponding to the target functional module include the text of the Chinese language version, then obtain all foreign language texts corresponding to the text of the Chinese language version from the multi-version language mapping table; otherwise, proceed to step S43. S42. If the foreign language versions corresponding to all foreign language texts include the target language version, then the foreign language text corresponding to the target language version shall be used as the text of the target language version corresponding to the text of the Chinese language version. Otherwise, proceed to step S43; S43. Send the Chinese language version of the text and the target language version to the translation system to obtain the target language version of the text corresponding to the Chinese language version of the text.
4. The data processing method for an application according to claim 1, characterized in that, Step S5 includes: The text of each Chinese language version and the target language version in the target data are sent to the translation system to obtain the text of the target language version corresponding to each Chinese language version in the target data. Then, the text of each Chinese language version in the target data is replaced with the text of the corresponding target language version to update the target data.
5. The data processing method for an application according to claim 1, characterized in that, The target functional module is identified by the interface identifier in the network request.
6. The data processing method for an application according to claim 1, characterized in that, The target language version is the current system language version of the electronic device running the application.
7. The data processing method for an application according to claim 1, characterized in that, The steps preceding step S1 also include: S10. When the server receives the Chinese language version of the dynamic data, it stores the dynamic data in the database and extracts the first summary data from the dynamic data according to the preset extraction rules. S20. Obtain second summary data in several foreign language versions corresponding to the first summary data based on the translation system, and store the first summary data and each second summary data corresponding to the first summary data in the server.
8. The data processing method for an application according to claim 7, characterized in that, Step S5 includes: S51. When the display mode corresponding to the target functional module is partial display, based on the target data, the first summary data and the second summary data corresponding to the first summary data, obtain the target summary data of the target language version corresponding to the target data, and use the target summary data as the target data to update the target data. S52. When the display mode corresponding to the target function module is "all display", the translation data of the target language version corresponding to the target data is obtained based on the translation system, and the translation data is used as the target data to update the target data.
9. A non-transitory computer-readable storage medium, characterized in that, The non-transitory computer-readable storage medium stores at least one instruction or at least one program segment, which is loaded and executed by a processor to implement the data processing method for an application program as described in any one of claims 1-8.
10. An electronic device, characterized in that, Includes a processor and the non-transitory computer-readable storage medium as described in claim 9.
