Term management method and apparatus, electronic device, and storage medium

By detecting and replacing distinguishing characters in entries across multiple operating system versions, and utilizing a distinguishing character lookup table to automate entry matching and integration, the complexity of entry management across multiple operating systems is solved, and the efficiency of user interface modification and translation is improved.

CN122308899APending Publication Date: 2026-06-30SHENZHEN QIANHAI EVOC ASIA-PACIFIC ELECTRONIC EQUIP TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN QIANHAI EVOC ASIA-PACIFIC ELECTRONIC EQUIP TECH CO LTD
Filing Date
2026-02-26
Publication Date
2026-06-30

Smart Images

  • Figure CN122308899A_ABST
    Figure CN122308899A_ABST
Patent Text Reader

Abstract

This application relates to the field of term management technology, and discloses a term management method, apparatus, electronic device, and storage medium. The method includes: acquiring multiple terms displayed on the same user interface under multiple operating system versions; checking each term separately; obtaining distinguishing characters in the terms; searching a preset distinguishing character lookup table; obtaining the replacement characters corresponding to the distinguishing characters in the terms; wherein the replacement characters corresponding to distinguishing characters representing the same meaning are the same across different operating system versions; replacing the distinguishing characters in the terms with the corresponding replacement characters; matching the terms corresponding to the multiple operating system versions after replacement; and integrating all terms into a target document based on the matching results. Through this method, unified management of terms across multiple operating system versions is achieved, providing a solid data foundation for subsequent advanced functions such as automated translation, term updates, and consistency checks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of term management technology, specifically to a term management method, term management device, electronic device, and computer-readable storage medium. Background Technology

[0002] To meet the needs of different users and application scenarios, different electronic devices may use different operating systems. For example, mobile devices use operating systems such as Android, iOS, and HarmonyOS. Furthermore, because different operating systems use different development languages ​​and frameworks, placeholders, formats, and specifications, developers need to write separate project files for each operating system to ensure that software applications are compatible with multiple operating systems.

[0003] Similarly, when developers extract relevant terms from the project files of a software application, they also need to generate separate terminology documents for different operating systems. This results in complex and cumbersome operations when modifying or translating terms on the software application, requiring separate processing of terms for each operating system. Summary of the Invention

[0004] In view of the above problems, embodiments of this application provide a term management method, term management device, electronic device, and computer-readable storage medium to solve the problem of complex and cumbersome term management corresponding to multiple operating systems in the prior art.

[0005] According to one aspect of the embodiments of this application, a term management method is provided. The method includes: acquiring multiple terms displayed on the same user interface under multiple operating system versions; checking each term to obtain distinguishing characters in the term; searching a preset distinguishing character lookup table according to the operating system version and the distinguishing characters in the term to obtain replacement characters corresponding to the distinguishing characters in the term, wherein the distinguishing character lookup table pre-stores distinguishing characters included in each operating system version and replacement characters corresponding to each distinguishing character, and the replacement characters corresponding to distinguishing characters representing the same meaning between different operating system versions are the same; replacing the distinguishing characters in the term with the corresponding replacement characters; matching the terms corresponding to the multiple operating system versions after replacement, and integrating all terms into a target document according to the matching results.

[0006] In one optional approach, multiple terms displayed on the same user interface under multiple operating system versions are obtained, specifically including: obtaining the code file corresponding to the user interface under multiple operating system versions, wherein the code file contains the display text to be displayed on the user interface; and extracting the display text from the code file using preset filtering rules to obtain the terms.

[0007] In one alternative approach, matching is performed on entries corresponding to multiple operating system versions after replacement. Specifically, this includes: traversing multiple entries and performing the following steps for each entry: taking the entry as the target entry; calculating the similarity between the target entry and other entries among the multiple entries to determine whether the target entry is the same as other entries; if the target entry is the same as other entries, then deleting the other entries from the multiple entries.

[0008] In one optional approach, the similarity between the target term and other terms among multiple terms is calculated to determine whether the target term is the same as other terms. Specifically, this includes: counting the number of characters in the target term and determining the similarity corresponding to each character based on the number of characters; matching the characters in the target term with the characters in other terms to determine the number of identical characters between the target term and other terms; calculating a first similarity between the target term and other terms based on the similarity corresponding to each character and the number of identical characters; if the first similarity is greater than or equal to a first preset threshold, then the target term is determined to be the same as other terms.

[0009] In one optional approach, determining that the target term is the same as other terms specifically includes: if the first similarity is greater than or equal to a first preset threshold, then using a semantic recognition algorithm to calculate the second similarity between the target term and other terms; if the second similarity is greater than or equal to a second preset threshold, then determining that the target term is the same as other terms.

[0010] In one alternative approach, after integrating all terms into the target document based on the matching results, the method further includes: obtaining the text language and the first target translation language corresponding to the terms in the target document; translating the terms in the target document using a preset translation interface based on the text language and the first target translation language to obtain translated text; and matching the translated text with the terms and storing it in the target document.

[0011] In one alternative approach, after mapping the translated text to the corresponding term and storing it in the target document, the method includes: obtaining the code file corresponding to the user interface, the target operating system version, and the second target translation language; extracting the display text from the code file using preset filtering rules to obtain the term to be translated; searching the target document based on the term to be translated and the second target translation language to obtain the target translated text corresponding to the term to be translated; inspecting the target translated text to obtain replacement characters in the target translated text; searching a preset distinguishing character lookup table based on the target operating system version and the replacement characters in the target translated text to obtain the target distinguishing characters corresponding to the replacement characters in the target translated text; replacing the target replacement characters in the target translated text with the target distinguishing characters; and updating the code file with the replaced target translated text to generate the translated user interface.

[0012] According to another aspect of the embodiments of this application, a term management device is provided. The device includes: an acquisition module, used to acquire multiple terms displayed on the same user interface under multiple operating system versions; an inspection module, used to inspect the terms respectively and acquire distinguishing characters in the terms; a search module, used to search a preset distinguishing character lookup table according to the operating system version and the distinguishing characters in the terms, and acquire the replacement characters corresponding to the distinguishing characters in the terms, wherein the distinguishing character lookup table pre-stores the distinguishing characters included in each operating system version and the replacement characters corresponding to each distinguishing character, and the replacement characters corresponding to distinguishing characters representing the same meaning between different operating system versions are the same; a replacement module, used to replace the distinguishing characters in the terms with the corresponding replacement characters; and a matching module, used to match the terms corresponding to the multiple operating system versions after replacement, and integrate all terms into a target document according to the matching results.

[0013] According to another aspect of the embodiments of this application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the term management method described in any of the preceding claims.

[0014] According to another aspect of the embodiments of this application, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the term management method described in any of the preceding claims.

[0015] In this embodiment, after the electronic device obtains entries from multiple operating system versions, it can detect distinguishing characters in the entries and replace them with the same replacement characters. This allows entries from different operating system versions to be correctly matched, transforming the tedious work of manually comparing, identifying, and correcting each entry into a fully automated process, thus improving the efficiency of managing and maintaining entries from multiple operating system versions. Simultaneously, by generating target documents for unified management of entries, it achieves automated, efficient extraction and intelligent integration of entries from multiple operating system versions, providing a solid data foundation for subsequent advanced functions such as automated translation, entry updates, and consistency checks.

[0016] The above description is merely an overview of the technical solutions of the embodiments of this application. In order to better understand the technical means of the embodiments of this application and to implement them in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the embodiments of this application more obvious and understandable, specific implementation methods of this application are described below. Attached Figure Description

[0017] The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings: Figure 1 A flowchart illustrating the term management method provided in an embodiment of this application is shown; Figure 2 This illustration shows a schematic diagram of the structure of the distinguishing character lookup table in the term management method provided in this application embodiment; Figure 3 A schematic diagram of the structure of the term management device provided in an embodiment of this application is shown; Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of this application is shown. Detailed Implementation

[0018] Exemplary embodiments of the present application will now be described in more detail with reference to the accompanying drawings. Although exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application may be implemented in various forms and should not be limited to the embodiments set forth herein.

[0019] Currently, when developing software applications, companies initially target the domestic market. The terms and conditions on the user interface are typically displayed in Chinese, and these terms are directly written into the corresponding project files. Furthermore, because different operating systems use different development languages, frameworks, placeholders, formats, and specifications, developers usually need to write separate project files for each operating system to ensure compatibility and allow the software application to run on various devices.

[0020] When a company's later-stage strategy requires expanding into overseas markets or modifying terms on the user interface, it needs to extract Chinese terms from the project files to update the user interface by replacing the Chinese terms in the project files. However, placeholders, line breaks, and other distinguishing characters in the terms need to conform to the operating system's development language, format, and specifications. This results in differences between terms displayed on the user interface and those in the project files, even though the terms are the same. This necessitates modifying and translating terms separately for different operating systems, making term management complex and cumbersome, and reducing the efficiency of user interface modification and translation.

[0021] Therefore, to improve the efficiency of term management, this application provides a term management method. When managing terms in a software application, firstly, multiple terms corresponding to multiple operating system versions are obtained; then, a pre-set distinguishing character lookup table is searched according to the distinguishing characters in the system version and the terms to replace the distinguishing characters in the terms with corresponding replacement characters. The distinguishing character lookup table stores the distinguishing characters included in each operating system version and the replacement characters corresponding to each distinguishing character, and the replacement characters corresponding to distinguishing characters with the same meaning are the same in different operating system versions; finally, the replaced terms are matched, and all terms are integrated into the same target document according to the matching results.

[0022] In this approach, electronic devices can replace distinguishing characters in entries with replacement characters, enabling the matching of identical entries displayed on the user interface when multiple operating system versions of entries are integrated into a single target document. This facilitates entry management. When modifications or translations are needed for entries on the user interface, the modified or translated entries are simply stored in the target document, corresponding to the original entries. The electronic device can then automatically locate the target document and replace the entries in the project file with the modified or translated ones, thereby automating user interface updates and improving the efficiency of user interface modification and translation.

[0023] Figure 1 A flowchart of a term management method provided in an embodiment of this application is shown. This method is executed by an electronic device, which may be a computer, server, or other similar device. Figure 1 As shown, the method includes the following steps: Step S110: Obtain multiple entries displayed on the same user interface under multiple operating system versions.

[0024] Operating system version refers to the system platform on which the software application runs, such as Windows, iOS, and Android. Different operating system versions may differ in font libraries, character encoding support, and text rendering engines. User interface refers to the graphical part of the software application or system that the user interacts with, including visual elements such as buttons, menus, labels, dialog boxes, and prompts.

[0025] All text content units that need to be displayed to the user on the user interface are called entries. Each entry is an independent string with a specific function and semantics. For example, "Submit" or "Cancel" displayed on a button, a menu item name "File (F)", or an error message "Network connection failed, please check settings."

[0026] Terms are typically extracted from software application project files (such as .m files, .java or .kt files, .js or .ets files) or screenshots of the interface through optical character recognition. Electronic devices can obtain terms by running different versions of the system on simulators or real devices, taking screenshots of the target user interface, and then using OCR technology to recognize the text in the images.

[0027] Of course, to ensure the accuracy of the entries, electronic devices (such as computers with PyCharm IDE and Python environment installed) directly parse the software application project files built on different operating system versions (such as iOS, Android, HarmonyOS) by executing Python scripts or dedicated tools, extracting all entry text from the source code. Specifically, step S110 may include the following steps (steps S111 to S112): Step S111: Obtain the code files corresponding to the user interface under multiple operating system versions, wherein the code files contain the display text to be displayed on the user interface.

[0028] Step S112: Extract the display text from the code file using preset filtering rules to obtain the term.

[0029] The electronic device can locate and read the source code containing the text displayed in the user interface. For example, the electronic device receives the root directory paths of one or more app projects as input. These project directories correspond to different operating system versions, such as iOS project directories, Android project directories, and HarmonyOS project directories. Then, the electronic device can traverse these specified paths to identify the code files containing the text displayed in the user interface. These code files are the original carriers of the text, such as .m (Objective-C) or .swift files on the iOS platform, .java or .kt (Kotlin) files on the Android platform, and .js or .ets (ArkTS) files on the HarmonyOS platform. These files contain directly hard-coded text for display on the user interface, such as button labels and tooltips.

[0030] Finally, the electronic device can use preset, configurable filtering rules to accurately separate the business terms that need to be modified or translated from complex code logic. Specifically, the electronic device can use a recursive function to traverse all files in the project directory. When it encounters a target code file (such as a .m file), it will open the file and read its entire content. It will then analyze the code line by line and apply a series of filtering rules to exclude text that does not need to be translated.

[0031] These filtering rules are mainly used to exclude comments in the code (such as filtering out single-line comments that start with double forward slashes / / and multi-line comments enclosed in / *...* / ), exclude debug logs (such as filtering out parameters in debug output functions, such as string constants in function calls like NSLog in iOS and Log.d in Android), and exclude resource identifiers (such as filtering out resource references like image names, color names, and layout IDs) and other text content that will not be displayed on the user interface.

[0032] Furthermore, to further refine the extraction of terms, after eliminating the aforementioned interfering items, electronic devices can use specific regular expressions to match and extract genuine business terms. For example, for iOS development, the regular expression @"{[^@]*[\u4e00-\u9fa5]+[^@]*\} can be used to match strings that begin with @"{", end with}", and contain Chinese characters in the middle. Alternatively, it can match all strings enclosed in quotation marks that contain Chinese characters (such as @"[\u4e00-\u9fa5]+").

[0033] Through steps S111 to S112, the electronic device can accurately separate business terms from the source code, providing a high-quality data starting point for subsequent steps, which helps to ensure high efficiency and high accuracy of term management.

[0034] Furthermore, to ensure the accuracy of term extraction, after the initial extraction using preset filtering rules, the results can be manually reviewed to check for erroneous extractions (such as annotations not excluded by the filtering rules) or omissions. Based on the review results, the regular expressions of the filtering rules can be adjusted and optimized until the extracted terms fully meet the requirements. Finally, the extracted terms are written into an intermediate file or data structure, such as generating "iOS terms.txt" and "Android terms.txt" respectively, to prepare for subsequent processing.

[0035] After step S110, step S120 is executed: the entries are checked one by one to obtain the distinguishing characters in the entries.

[0036] Distinguishing characters refer to those characters that are visually or semantically identical, but differ in font and encoding due to differences in operating system versions. Specifically, distinguishing characters include, but are not limited to, placeholders. For example, different operating system versions use different placeholders to represent variables; iOS uses %@, Android uses %s, and HarmonyOS may use {}; different types of spaces, such as regular spaces, non-newline spaces, and full-width spaces; and variations of hyphens / dashes, such as short dashes, long dashes, and hyphens.

[0037] Taking placeholders as an example, for the same semantic term "medium-high intensity (how many) minutes", it may be expressed as "medium-high intensity %@ minutes" on iOS, "medium-high intensity %s minutes" on Android, and "medium-high intensity {} minutes" on HarmonyOS.

[0038] Step S130: Based on the operating system version and the distinguishing characters in the entry, look up the preset distinguishing character lookup table to obtain the replacement characters corresponding to the distinguishing characters in the entry. The distinguishing character lookup table stores the distinguishing characters included in each operating system version and the replacement characters corresponding to each distinguishing character in advance. The replacement characters corresponding to distinguishing characters with the same meaning in different operating system versions are the same.

[0039] The distinguishing character lookup table is a pre-built mapping database or data result. The replacement character refers to the standardized character used to replace the distinguishing character. In this distinguishing character lookup table, distinguishing characters that represent the same meaning in different operating system versions will be mapped to the same replacement character.

[0040] by Figure 2 Taking the structure shown as an example, Figure 2 The structure of the distinguishing character lookup table is shown. In iOS, %@ is usually used to represent strings, %s is used in Android, and {} is used in HarmonyOS. In the distinguishing character lookup table, the distinguishing character %@ in iOS, %s in Android, and {} in HarmonyOS are all mapped to the same replacement character ###.

[0041] When an electronic device processes the term "medium-high intensity %@ minutes" for the iOS system, the system will look up the table using "iOS system" and "%@" as keys to obtain the replacement character "###". Similarly, when processing the term "medium-high intensity %s minutes" for the Android system, it will look up the same replacement character "###" using "Android system" and "%s" as keys. Likewise, when processing the term "medium-high intensity {} minutes" for the HarmonyOS system, it will look up the same replacement character "###" using "HarmonyOS system" and "{}" as keys.

[0042] Step S140: Replace the distinguishing characters in the entry with the corresponding replacement characters.

[0043] Taking the term "medium-high intensity (how many) minutes" on the user interface as an example, the term "medium-high intensity %@ minutes" on the iOS system is replaced with "medium-high intensity ### minutes", the term "medium-high intensity %s minutes" on the Android system is also replaced with "medium-high intensity ### minutes", and the term "medium-high intensity {} minutes" on the HarmonyOS system is also replaced with "medium-high intensity ### minutes". This normalizes terms from different operating system versions, which were originally different due to placeholders or format differences, into terms with the same text content, creating conditions for subsequent accurate matching.

[0044] Step S150: Match the terms corresponding to the multiple operating system versions after replacement, and integrate all terms into the target document according to the matching results.

[0045] After character replacement, semantically identical terms from different operating system versions should have completely identical text content. The matching process involves comparing and clustering the normalized terms. As an example, fast matching based on text hashing can be used. This involves calculating the hash value of each replaced term, and terms with the same hash value are considered a "match," meaning they are the same term. Based on the matching results, identical terms are grouped together and stored as a record in the target document. Alternatively, algorithms such as edit distance, cosine similarity, and Jaccard similarity can be used to calculate the similarity between terms and then match terms based on this similarity.

[0046] Furthermore, in order to reduce the storage space occupied by the terms, for multiple identical terms, only one can be retained in the target document. Specifically, step S150 may include the following steps (steps S151 to S153): Iterate through multiple entries and perform the following steps for each entry: Step S151: Use the term as the target term.

[0047] Step S152: Calculate the similarity between the target term and other terms among the multiple terms to determine whether the target term is the same as other terms.

[0048] Step S153: If the target term is the same as other terms, delete the other terms from the multiple terms.

[0049] After replacing the distinguishing characters, the electronic device obtains a normalized set of terms from multiple operating system versions, including iOS, Android, and HarmonyOS. The script iterates through each term in this set, setting the currently processed term as the "target term" in order to compare it with other terms in the set.

[0050] For the current target term, the electronic device can calculate its similarity to every other term in the term set and remove duplicate terms based on the similarity. As an example, the electronic device can compare each character of the term one by one and determine that the two terms are the same if the target term and another term have completely identical text content.

[0051] If the electronic device determines that target term A and term B are the same term, term B can be removed from the term set to be integrated. This ensures that in the final term set, only one record is retained as a representative for the same semantic concept, effectively reducing the storage space occupied by the target document and data redundancy.

[0052] Especially when managing large, multi-version applications, the number of entries may be in the tens of thousands, and the proportion of duplicate entries may be high. By automatically deduplicating entries through steps S151 to S153, the size of the target document can be reduced. This not only saves storage resources but also simplifies subsequent translation, modification, and other management work, improving the efficiency of entry translation and modification operations.

[0053] In the above embodiments, after the electronic device obtains entries from multiple operating system versions, it can detect distinguishing characters in the entries and replace them with the same replacement characters, enabling correct matching of entries from different operating system versions. This transforms the tedious work of manually comparing, identifying, and correcting each entry into a fully automated process, improving the efficiency of managing and maintaining entries from multiple operating system versions. Simultaneously, by generating target documents for unified management of entries, it achieves automated, efficient extraction and intelligent integration of entries from multiple operating system versions, providing a solid data foundation for subsequent advanced functions such as automated translation, entry updates, and consistency checks.

[0054] Regarding the term matching method, some embodiments provide a specific implementation method, and step S152 may specifically include the following steps: Step S210: Count the number of characters in the target term and determine the similarity of each character based on the number of characters.

[0055] Step S220: Match the characters in the target term with the characters in other terms to determine the number of identical characters between the target term and other terms.

[0056] Step S230: Calculate the first similarity between the target term and other terms based on the similarity of each character and the number of identical characters.

[0057] Step S240: If the first similarity is greater than or equal to the first preset threshold, then the target term is determined to be the same as other terms.

[0058] Among them, the electronic device first conducts a basic analysis on the target entry that currently serves as the comparison benchmark, counts the total number of characters contained in the statistical device (denoted as N), and based on this total number of characters, a basic weight model can be set for the matching process. As an example, assuming that each character occupies an equally important position in the similarity evaluation, the similarity corresponding to each character can be set to 1 / N. If there is one different character between two entries, the similarity will be deducted by at least 1 / N. For example, when comparing the target entry A as "does not include exercise and sleep time" and another entry B as "does not include exercise and sleeping time", the number of characters in the target entry A is 10, and the similarity corresponding to each character is 10%.

[0059] Next, the electronic device can compare each character in the target entry with the characters in the same sequential position in the other entry to be compared, and count the number of characters that are in the same position and exactly the same in both entries (denoted as M). For example, when comparing the target entry A as "does not include exercise and sleep time" and another entry B as "does not include exercise and sleeping time", the first character "不" in the target entry A is matched with the first character "不" in the other entry B respectively. If there is a same character, the number of same characters between the target entry A and the other entry B is incremented by 1, and then the second character is matched, and so on, to obtain the final number of same characters M = 9 between the target entry A and the other entry B. Of course, in order to improve the matching accuracy, each character in the target entry can also be compared with several characters before and after (such as 3 characters before and after or 5 characters before and after) in the same sequential position in the other entry to be compared.

[0060] Then, calculate the first similarity between the target entry and the other entry according to the similarity 1 / N corresponding to each character and the number of same characters M. The specific calculation formula can be expressed as: First similarity = , Taking the above target entry A as "does not include exercise and sleep time" and the other entry B as "does not include exercise and sleeping time" as an example, the similarity corresponding to each character is 10%, and the number of same characters between the target entry A and the other entry B is 9. Then the first similarity between the target entry A and the other entry B = 10% × 9 = 90%. Through this value, the overlapping degree of the two entries in the character sequence can be intuitively reflected.

[0061] Finally, the electronic device compares the calculated first similarity with a preset threshold (i.e., the first preset threshold), which can be configured according to the requirements for the strictness of deduplication, such as 80% or 90%. If the first similarity is greater than or equal to the first preset threshold, it is preliminarily determined that the two entries are highly similar at the character sequence level and can be considered as the same.

[0062] In the above steps, by calculating the first similarity of terms at the character sequence level, a clear, quantifiable and easy-to-implement method for term deduplication is provided. The computational complexity is low, making it suitable for scenarios with high processing speed requirements. It can quickly filter out a large number of obviously duplicate or highly similar terms.

[0063] Furthermore, although the algorithm based on sequential character matching is computationally efficient, it is highly sensitive to situations such as character order changes. In order to improve the accuracy of the judgment, the above steps S210 to S240 can be used as a preliminary quick screening, and the first preset threshold is set slightly lower (for example, set to 70%, 75%, etc.). When the first similarity is greater than the first preset threshold, it can be further combined with the edit distance algorithm, semantic recognition and other algorithms for secondary accurate calculation, forming a multi-level filtering optimization strategy that takes into account both processing speed and judgment accuracy.

[0064] As an example, in some embodiments, step S240 specifically includes the following steps: Step S310: If the first similarity is greater than or equal to the first preset threshold, then the semantic recognition algorithm is used to calculate the second similarity between the target word and other words.

[0065] Step S320: If the second similarity is greater than or equal to the second preset threshold, then the target term is determined to be the same as other terms.

[0066] The purpose of the first preset threshold is to perform a fast and low-computational-cost preliminary screening. When the first similarity of two terms reaches or exceeds the first preset threshold, it means that they have a high degree of surface similarity and are worth further precise comparison. The electronic device will automatically trigger a higher-level semantic recognition algorithm to perform secondary calculations.

[0067] Semantic recognition algorithms can be pre-trained natural language processing models. For example, word embedding models (such as Word2Vec and BERT) can be used to convert target words and other words into semantic vectors in high-dimensional space. These vectors can capture the deep semantic information of words. Then, by calculating the cosine similarity or Euclidean distance between these two semantic vectors, the degree of semantic association between the two words is quantified. This quantification result is the second similarity.

[0068] Next, the electronic device compares the obtained second similarity with a second preset threshold (e.g., 85%, 90%) that is specifically set for the semantic level and has higher requirements. If the second similarity is greater than or equal to the second preset threshold, it indicates that the two terms are not only similar in character composition, but also highly consistent in their core semantics. At this point, it can be finally determined that the target term is the same term as the other terms.

[0069] In the above embodiments, the electronic device employs a multi-level filtering optimization strategy to balance the processing speed and accuracy of word matching. The first level, character-based fast filtering, quickly eliminates a large number of obviously irrelevant words, reducing the pressure of subsequent complex calculations. The second level, semantic-based accurate recognition, solves the semantic understanding problem that simple character matching algorithms cannot overcome, improving the accuracy of deduplication and merging. Moreover, this strategy enables the electronic device to intelligently handle various complex situations (such as word order changes and synonym replacements), reducing the frequency and workload of manual intervention required due to inaccurate automated processing.

[0070] Regarding the specific management method of terms in a target document by an electronic device, some embodiments provide a specific application scenario (i.e., user interface translation). After step S150, the method further includes the following steps: Step S160: Obtain the text language and the first target translation language corresponding to the terms in the target document.

[0071] The text language corresponding to the term can be obtained through automatic recognition, user configuration, etc. Specifically, the electronic device can automatically analyze the content of the term in the target document and identify the main text language. For example, it can determine the text language of the term by character encoding range (such as \u4e00-\u9fa5 corresponding to Chinese) or by using a language detection library. The electronic device can also provide a configuration interface or configuration file to allow users to explicitly specify the source language (such as Chinese) and the first target translation language (such as English). Users can also specify multiple target translation languages. For example, the first target language includes English, German, and French, and set these languages ​​as input parameters for the translation task.

[0072] Step S170: Based on the text language and the first target translation language, use a preset translation interface to translate the entries in the target document to obtain the translated text.

[0073] The electronic device can complete the translation task by calling an external translation service. The preset translation interface can be provided by a public cloud service provider. Specifically, the electronic device can use a programming library (such as Python's pandas) to read the target document, load the terms to be translated into memory, divide these terms into multiple subtasks, and use a multi-threaded or asynchronous I / O mechanism to distribute these subtasks to concurrent threads or processes. Each concurrent thread performs the translation by calling the preset translation interface. When calling, the source text (i.e., the term), the text language, and the first target translation language are passed to the translation interface. After processing the request, the translation interface returns the translated text. The electronic device correctly receives and temporarily stores these translation results (i.e., the translated text).

[0074] Step S180: Match the translated text with the corresponding terms and store it in the target document.

[0075] The electronic device can establish an accurate correspondence between the translated text and the original term and write it back to the target document. Specifically, in order to ensure that each translated text can be correctly matched with its original term, the electronic device can attach a unique identifier (such as a term ID or an index in a list) when initiating a translation request.

[0076] For storing translated text in the target document, the electronic device can create new columns within the target document to store the translated text. For example, the original terms can be stored as columns in the target document, and an "English Translation" column can be created to the right of the "Original Terms" column, with the resulting English translation text being filled in line by line. Similarly, if multiple target languages ​​are configured (i.e., the first target translation languages ​​include multiple languages), the electronic device can sequentially create columns such as "German Translation," "French Translation," etc., and fill in the corresponding translated text. Furthermore, the electronic device can automatically generate unique keys based on the translated text and write them into the first column of the document to generate a target document containing the source terms, multilingual translations, and keys.

[0077] In the above embodiments, by translating the terms in the target document and storing the translated text and the original terms in the target document for unified management, the target document becomes a centralized, multilingual term resource library, providing a unique and accurate data source for the subsequent automated export of term files compatible with multiple operating system versions and the automated replacement of translated text back into project code.

[0078] Furthermore, in order to achieve automated updates to the user interface, in some embodiments, after step S180, the method further includes the following steps: Step S410: Obtain the code file corresponding to the user interface, the target operating system version, and the second target translation language.

[0079] The code file is the source code file (such as the .m file in an iOS project file) that needs to be updated and contains the original text of the user interface. The target operating system version is the operating system version displayed by the user interface that needs to be updated, such as iOS, Android, HarmonyOS, etc. The second target translation language is used to specify which language the user interface should be translated into (e.g., "English").

[0080] Step S420: Using preset filtering rules, extract the display text from the code file to obtain the terms to be translated.

[0081] This step is exactly the same as step S112 in principle. It is to scan and locate all the hard-coded text that needs to be replaced in the current code file. The electronic device can use the same preset filtering rules as step S112 (to exclude comments, logs, etc.). Specifically, the electronic device can extract all the original displayed text from the code file. These entries constitute the translation entries that need to be replaced.

[0082] Step S430: Locate the target document based on the term to be translated and the second target translation language, and obtain the target translation text corresponding to the term to be translated.

[0083] The electronic device can use the extracted term to be translated and the second target translation language Wie query key to search in the generated target document. It can find the target row where the term to be translated is located in the target document, determine the target column corresponding to the second target translation language, and read the content of the target row and target column from the target document to obtain the target translation text.

[0084] Step S440: Inspect the target translation text and obtain the replacement characters in the target translation text.

[0085] Step S450: Based on the target operating system version and the replacement characters in the target translated text, search the preset distinguishing character lookup table to obtain the target distinguishing characters corresponding to the replacement characters in the target translated text.

[0086] Step S460: Replace the target replacement character in the target translation text with the target distinguishing character.

[0087] In steps S130 to S140, for matching purposes, the electronic device replaces the differentiating characters for different operating system versions with standardized replacement characters (such as ###). Now, in order to correctly write the translated text back into the code corresponding to the specific operating system version, a reverse operation is required. The electronic device identifies the standardized replacement characters (i.e., ###) contained in the target translated text (such as "### people selected") obtained from the target document.

[0088] Step S450 is the reverse process of step S130. The electronic device can query the same difference character comparison table. Taking the table shown in Figure 2 as an example, the electronic device can use the target operating system version (such as iOS) and the replacement character "" as the combined query key. According to the records in the table, the corresponding target difference character can be queried as the placeholder %@ dedicated to the iOS system.

[0089] Finally, the electronic device performs string replacement to replace the standardized replacement character "" in the target translation text with the target difference character "%@" of a specific target operating system version. For example, it replaces " people selected" with "%@ people selected", so as to generate the final translation text that meets the format requirements of the target operating system version.

[0090] Step S470: Update the replaced target translation text into the code file to generate the translated user interface.

[0091] Among them, the electronic device can update the correctly formatted translation text into the source code by directly replacing hard-coded text, localizing function calls, etc. Specifically, the electronic device can find the original hard-coded text (such as the Chinese "登录") in the code file and directly replace it with the translated text (such as "Login"); the electronic device can also replace the original hard-coded text with code that calls the platform's localization API (such as Localizable.strings). Taking iOS system development as an example, the electronic device can generate the entry file Localizable.strings(English) and the original entry file Localizable.strings(Chinese,Simplified) corresponding to the user interface according to the replaced target translation text. When translating the user interface, it uses Localizable.strings(English) to replace the original entry file Localizable.strings(Chinese,Simplified) corresponding to the user interface, so as to replace "登录" in the code with login.

[0092] In the above embodiments, the final closed loop of the technical solution is achieved, realizing a high degree of automation in user interface translation and updates. It transforms the traditionally extremely time-consuming and error-prone manual work of finding and replacing text in the code into a precise and repeatable automated process. This not only frees developers from tedious labor, but also ensures the correctness of the generated code format through intelligent placeholder conversion based on mapping tables. Ultimately, with only one configuration and trigger, the entire application project's user interface can be automatically updated for a specific target language, accelerating the international release and iteration process of the application and improving the efficiency of user interface modification and translation.

[0093] According to another aspect of the embodiments of this application, a term management device is provided, such as... Figure 3 As shown, Figure 3 A schematic diagram of the structure of the term management device provided in the embodiment of this application is shown. The device 1 includes: an acquisition module 11, an inspection module 12, a search module 13, a replacement module 14, and a matching module 15.

[0094] The acquisition module 11 is used to acquire multiple terms displayed on the same user interface under multiple operating system versions. The inspection module 12 is used to inspect the terms individually and acquire the distinguishing characters in the terms. The search module 13 is used to search a preset distinguishing character lookup table based on the operating system version and the distinguishing characters in the terms, and acquire the replacement characters corresponding to the distinguishing characters in the terms. The distinguishing character lookup table stores the distinguishing characters included in each operating system version and the corresponding replacement characters for each distinguishing character, and the replacement characters corresponding to distinguishing characters with the same meaning are the same across different operating system versions. The replacement module 14 is used to replace the distinguishing characters in the terms with the corresponding replacement characters. The matching module 15 is used to match the terms corresponding to the multiple operating system versions after replacement, and integrate all terms into the target document according to the matching results.

[0095] In the above embodiments, after the electronic device obtains entries from multiple operating system versions, it can detect distinguishing characters in the entries and replace them with the same replacement characters, enabling correct matching of entries from different operating system versions. This transforms the tedious work of manually comparing, identifying, and correcting each entry into a fully automated process, improving the efficiency of managing and maintaining entries from multiple operating system versions. Simultaneously, by generating target documents for unified management of entries, it achieves automated, efficient extraction and intelligent integration of entries from multiple operating system versions, providing a solid data foundation for subsequent advanced functions such as automated translation, entry updates, and consistency checks.

[0096] According to another aspect of the embodiments of this application, an electronic device is also provided, such as... Figure 4 As shown, Figure 4The diagram shows a structural schematic of an electronic device provided in an embodiment of this application. The specific embodiments of this application do not limit the specific implementation of the electronic device.

[0097] like Figure 4 As shown, the electronic device may include a processor 21 and a memory 22.

[0098] The memory 22 is used to store the computer program 23. The memory 22 may include high-speed RAM, and may also include non-volatile memory, such as at least one disk storage device. The computer program 23 may include computer-executable instructions.

[0099] The processor 21 is used to execute the computer program 23 to implement the above-described term management method embodiment.

[0100] Processor 21 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application. The electronic device may include one or more processors of the same type, such as one or more CPUs; or it may include processors of different types, such as one or more CPUs and one or more ASICs.

[0101] This application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described term management method embodiment.

[0102] This application provides a computer program that can be executed by a processor to implement the above-described term management method embodiment.

[0103] This application provides a computer program product, which includes a computer program that, when executed by a processor, implements the above-described term management method embodiment.

[0104] In the several embodiments provided in this application, any function, if implemented as a software functional module / unit and sold or used as an independent product, can be stored in a computer-readable storage medium. Based on this understanding, all or part of the technical solution of this application can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or other electronic device) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing computer program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0105] The algorithms or displays provided herein are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems can also be used in conjunction with the teachings herein. The required structure for constructing such systems is apparent from the above description. Furthermore, the embodiments of this application are not directed to any particular programming language. It should be understood that the content of this application described herein can be implemented using various programming languages, and the above description of specific languages ​​is for the purpose of disclosing the best mode of implementation of this application.

[0106] It should be noted that the above embodiments are illustrative of this application and not restrictive, and those skilled in the art can devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. This application can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In claims enumerating several means, several units or modules of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be construed as limiting the order of execution.

[0107] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for managing entries, characterized in that, The method includes: Retrieve multiple terms displayed on the same user interface across multiple operating system versions; Each term is examined to obtain the distinguishing characters within it; According to the operating system version and the distinguishing characters in the term, a preset distinguishing character lookup table is searched to obtain the replacement character corresponding to the distinguishing character in the term. The distinguishing character lookup table stores the distinguishing characters included in each operating system version and the replacement characters corresponding to each distinguishing character in advance. The replacement characters corresponding to the distinguishing characters that represent the same meaning between different operating system versions are the same. Replace the distinguishing characters in the term with the corresponding replacement characters; The terms corresponding to the multiple replaced operating system versions are matched, and all terms are integrated into the target document based on the matching results.

2. The term management method according to claim 1, characterized in that, The acquisition of multiple terms displayed on the same user interface under multiple operating system versions specifically includes: Obtain the code files corresponding to the user interface under multiple operating system versions, wherein the code files contain display text for displaying on the user interface; The displayed text is extracted from the code file using preset filtering rules to obtain the term.

3. The term management method according to claim 2, characterized in that, The matching of the terms corresponding to the multiple replaced operating system versions specifically includes: Iterate through multiple of the aforementioned terms and perform the following steps for each term: Use the aforementioned term as the target term; Calculate the similarity between the target term and other terms among the multiple terms to determine whether the target term is the same as the other terms. If the target term is the same as the other terms, then the other terms are deleted from the plurality of terms.

4. The term management method according to claim 3, characterized in that, The step of calculating the similarity between the target term and other terms among the plurality of terms to determine whether the target term is the same as the other terms specifically includes: Count the number of characters in the target term, and determine the similarity of each character based on the number of characters; The characters in the target term are matched with the characters in other terms to determine the number of identical characters between the target term and the other terms; The first similarity between the target term and the other terms is calculated based on the similarity corresponding to each character and the number of identical characters. If the first similarity is greater than or equal to the first preset threshold, then the target term is determined to be the same as the other terms.

5. The term management method according to claim 4, characterized in that, The determination that the target term is the same as the other terms specifically includes: If the first similarity is greater than or equal to the first preset threshold, then a semantic recognition algorithm is used to calculate the second similarity between the target term and the other terms; If the second similarity is greater than or equal to the second preset threshold, then the target term is determined to be the same as the other terms.

6. The term management method according to claim 1, characterized in that, After integrating all the terms into the target document based on the matching results, the method further includes: Obtain the text language and the first target translation language corresponding to the terms in the target document; Based on the text language and the first target translation language, the terms in the target document are translated using a preset translation interface to obtain translated text; The translated text is matched with the terminology and stored in the target document.

7. The term management method according to claim 6, characterized in that, After the translated text is correlated with the term and stored in the target document, the method includes: Obtain the code file corresponding to the user interface, the target operating system version, and the second target translation language; Using preset filtering rules, the text to be displayed is extracted from the code file to obtain the terms to be translated; Based on the term to be translated and the second target translation language, the target document is searched to obtain the target translation text corresponding to the term to be translated; The target translation text is inspected to obtain the replacement characters in the target translation text; Based on the target operating system version and the replacement characters in the target translated text, a preset distinguishing character lookup table is consulted to obtain the target distinguishing characters corresponding to the replacement characters in the target translated text; Replace the target replacement character in the target translated text with the target distinguishing character; The replaced target translated text is updated in the code file to generate the translated user interface.

8. A term management device, characterized in that, The device includes: The acquisition module is used to acquire multiple terms displayed on the same user interface under multiple operating system versions; The inspection module is used to inspect each of the entries and obtain the distinguishing characters in the entries; The lookup module is used to look up a preset lookup table of distinguishing characters based on the operating system version and the distinguishing characters in the term, and obtain the replacement characters corresponding to the distinguishing characters in the term. The lookup table of distinguishing characters stores the distinguishing characters included in each operating system version and the replacement characters corresponding to each distinguishing character in advance. The replacement characters corresponding to the distinguishing characters that represent the same meaning between different operating system versions are the same. The replacement module is used to replace the distinguishing characters in the term with the corresponding replacement characters; The matching module is used to match the terms corresponding to the multiple replaced operating system versions, and to integrate all the terms into the target document based on the matching results.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the term management method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the term management method according to any one of claims 1 to 7.