Multilingual data processing method and device, computer device and storage medium
Patent Information
- Application Number
- CN202310784523.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-28
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2043-06-28
AI Technical Summary
应用程序的开发方通常需要根据不同的语种规范对软件分别进行本地化处理,且现有技术中,通常是通过在软件编译过程中将不同语种的界面资源、字体文件及语音文件一并打包进应用程序对应的软件中,以实现其本地化处理,该方法存可扩展性差、可移植性不强,且操作过程繁琐复杂,效率低等问题
[0021] The target data of this invention includes target terms, target fonts, and target speech determined according to the target language. After confirming the validity of the target data, the language of the object to be set is switched based on the target data. Thus, after the language switching processing based on the aforementioned valid target data, this invention achieves the recognition and conversion of multiple languages (converting the language corresponding to at least one language to be switched to the language corresponding to at least one target language), thereby meeting the language needs of different users, improving user understanding and experience, and ultimately increasing user satisfaction and usage rate. Furthermore, this invention only performs language switching processing on the object to be set when the target data is valid, thus ensuring the accuracy and reliability of the language data processing and avoiding misunderstandings and incorrect decisions caused by errors in the language data. In addition, this invention does not require packaging all language resource files into the object to be set during the compilation process. It only needs to determine a portion of the target data according to the setting instructions using the font setting module, term setting module, and speech setting module, and then directly perform dynamic language switching processing after confirming that all of it is valid, thereby improving the scalability and flexibility of multilingual data processing.
Smart Images

Figure CN116631376B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information processing technology, and in particular to a multilingual data processing method, apparatus, computer equipment, and storage medium. Background Technology
[0002] In today's globalized world, multilingual support for applications has gradually become an essential feature. To meet the diverse language needs of users in different regions or countries, application developers typically need to localize the software according to different language specifications. Current technology usually achieves localization by packaging interface resources, font files, and voice files for different languages into the application during the compilation process. However, this method suffers from poor scalability, limited portability, and is cumbersome, complex, and inefficient. Summary of the Invention
[0003] Therefore, it is necessary to provide a multilingual data processing method, apparatus, computer equipment, and storage medium to address the aforementioned technical problems, so as to improve the scalability and flexibility of multilingual data processing and achieve its portability.
[0004] A multilingual data processing method, comprising:
[0005] Receive a setting instruction to switch the language of an object to be set, the setting instruction including at least one target language and at least one language data to be switched to corresponding to the object to be set;
[0006] The font data in the language data to be switched is obtained through the font setting module, and the target font corresponding to the font data is determined according to the target language.
[0007] The terminology setting module determines the target terminology corresponding to the language data to be switched based on the target language.
[0008] The voice data in the language data to be switched is obtained through the voice setting module, and the target voice corresponding to the voice data is determined according to the target language and the target vocabulary.
[0009] Target data is generated based on the target font, the target words, and the target speech; the validity of the target data is then determined.
[0010] If the target data is valid, then the language switching process is performed on the object to be set according to the target data.
[0011] A multilingual data processing device, comprising:
[0012] The setting instruction receiving module is used to receive setting instructions for switching the language of the object to be set. The setting instructions include at least one target language and at least one language data to be switched to, which are corresponding to the object to be set.
[0013] The target font determination module is used to obtain font data from the language data to be switched through the font setting module, and determine the target font corresponding to the font data according to the target language.
[0014] The target term determination module is used to determine, through the term setting module, the target term corresponding to the language data to be switched, based on the target language;
[0015] The target speech determination module is used to obtain speech data from the language data to be switched through the speech setting module, and determine the target speech corresponding to the speech data according to the target language and the target vocabulary.
[0016] The target data judgment module is used to generate target data based on the target font, the target word, and the target speech, and to determine whether the target data is valid.
[0017] The processing module is used to perform language switching processing on the object to be set according to the target data if the target data is valid.
[0018] A computer device includes a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, wherein the processor implements the above-described multilingual data processing method when executing the computer-readable instructions.
[0019] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described multilingual data processing method.
[0020] In the aforementioned multilingual data processing method, apparatus, computer equipment, and storage medium, a setting instruction for switching the language of an object to be set is received. The setting instruction includes at least one target language and at least one language data to be switched, corresponding to the object to be set. The following steps are taken: A font setting module acquires font data from the language data to be switched, and a target font corresponding to the font data is determined based on the target language; a term setting module determines a target term corresponding to the language data to be switched based on the target language; a voice setting module acquires voice data from the language data to be switched, and a target voice corresponding to the voice data is determined based on the target language and the target term; target data is generated based on the target font, the target term, and the target voice, and the validity of the target data is determined; if the target data is valid, language switching processing is performed on the object to be set based on the target data.
[0021] The target data of this invention includes target terms, target fonts, and target speech determined according to the target language. After confirming the validity of the target data, the language of the object to be set is switched based on the target data. Thus, after the language switching processing based on the aforementioned valid target data, this invention achieves the recognition and conversion of multiple languages (converting the language corresponding to at least one language to be switched to the language corresponding to at least one target language), thereby meeting the language needs of different users, improving user understanding and experience, and ultimately increasing user satisfaction and usage rate. Furthermore, this invention only performs language switching processing on the object to be set when the target data is valid, thus ensuring the accuracy and reliability of the language data processing and avoiding misunderstandings and incorrect decisions caused by errors in the language data. In addition, this invention does not require packaging all language resource files into the object to be set during the compilation process. It only needs to determine a portion of the target data according to the setting instructions using the font setting module, term setting module, and speech setting module, and then directly perform dynamic language switching processing after confirming that all of it is valid, thereby improving the scalability and flexibility of multilingual data processing. Attached Figure Description
[0022] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 This is a flowchart illustrating a multilingual data processing method according to an embodiment of the present invention;
[0024] Figure 2 This is a schematic diagram of a multilingual data processing device according to an embodiment of the present invention;
[0025] Figure 3 This is a schematic diagram of a computer device according to an embodiment of the present invention. Detailed Implementation
[0026] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0027] In one embodiment, such as Figure 1 As shown, a multilingual data processing method is provided, including the following steps S10-S60.
[0028] S10. Receive a setting instruction to switch the language of the object to be set, the setting instruction including at least one target language and at least one language data to be switched corresponding to the object to be set.
[0029] Understandably, the object to be set can be an application or a module within an application. The language switching command can be an instruction to switch the language type (i.e., the language itself, such as Chinese, English, Russian, German, etc.), which can be entered via voice input or through a preset display interface. The language data to be switched can be the data corresponding to the object to be set that requires language type conversion (switching the language type in the language data to be switched to the target language).
[0030] In one specific embodiment, if the object to be set is a text containing English and Russian, the language switching setting instruction is to switch English and Russian to Chinese. At this time, Chinese is the target language. The text corresponding to English in the text is one of the language data to be switched, and the text corresponding to Russian is another language data to be switched.
[0031] S20. Obtain the font data from the language data to be switched through the font setting module, and determine the target font corresponding to the font data according to the target language.
[0032] Understandably, font data refers to the font information in the language data to be switched to that corresponding to the target language (some or all of the language data to be switched may not require font information conversion). Here, font information can be the font size, shape, color, and appearance (such as bold, Song, ARVO, etc.). In a specific embodiment, if the object to be set is a text containing English and Russian, and the language switching setting instruction is to switch English and Russian to Chinese (the target language), then the font data of the characters corresponding to English in the text (the font data corresponding to one of the language data to be switched) and the font data of the characters corresponding to Russian (the font data corresponding to the other language data to be switched) will be obtained.
[0033] The font setting module can be used to set the font size, shape, color, and appearance according to pre-defined font setting rules. It can also be used to identify (e.g., obtain the font size, shape, color, and appearance; obtain font data from the language data to be switched) and process (e.g., load a preset font into the font data to obtain the target term). Here, the pre-defined font setting rules can be font setting rules that match the target font. In this invention, each language corresponds to one font setting rule. Specifically, the pre-defined font setting rules are obtained according to the target language, and the obtained font setting module sets the font data, thus determining the set font data as the target font.
[0034] S30. The term setting module determines the target term corresponding to the language data to be switched based on the target language.
[0035] Understandably, the term setting module can be used to identify (e.g., obtain the language data to be switched in the object to be set, corresponding to each language type) and process (e.g., determine the target term corresponding to the language data to be switched). Specifically, the term setting module obtains the language data to be switched in the object to be set, and determines the target term corresponding to the language data to be switched based on the target language in the setting instruction.
[0036] S40. Obtain the voice data in the language data to be switched through the voice setting module, and determine the target voice corresponding to the voice data according to the target language and the target vocabulary.
[0037] Understandably, voice data refers to the data in the language to be switched that needs to be voice-read aloud in the target language. In a specific embodiment, if the object to be set is a text containing English and Russian, and the language switching setting instruction is to switch English and Russian to Chinese (the target language), and the text needs to be read aloud in Chinese, then the voice data of the text corresponding to English (the voice data corresponding to one of the language to be switched) and the font data of the text corresponding to Russian (the voice data corresponding to the other language to be switched) will be obtained.
[0038] The voice setting module refers to a module that recognizes (e.g., determines the voice data in the language data to be switched) and processes (e.g., plays the target voice according to pre-set playback rules) the voice data in the object to be set. Specifically, the voice setting module obtains the voice data in the language data to be switched of the object to be set, and determines the target voice corresponding to the voice data according to the target language.
[0039] S50. Generate target data based on the target font, the target word, and the target speech, and determine whether the target data is valid.
[0040] Understandably, the validity of the target data can be determined based on a pre-set judgment rule. Here, the judgment rule for the target data can be based on the data identifier and the actual data volume of the target data. After the target data is generated, each data identifier and the actual data volume corresponding to each data identifier in the target data are obtained. If the total number of data identifiers is less than the maximum number of data identifiers, and in the preset data volume matching library (the data volume matching library contains multiple data identifiers, each data identifier corresponding to a data volume), the actual data volume corresponding to each data identifier matches the data volume corresponding to that data identifier in the data volume matching library one by one (the actual data volume is less than or equal to the data volume corresponding to that data identifier in the data volume matching library), then the target data is determined to be valid. If the total number of data identifiers is greater than or equal to the maximum number of data identifiers, or if the actual data volume corresponding to a data identifier does not match the data identifier in the preset data volume matching library (the actual data volume is greater than the data volume corresponding to that data identifier in the data volume matching library), then the target data is determined to be invalid.
[0041] S60. If the target data is valid, then the language switching process is performed on the object to be set according to the target data.
[0042] Specifically, if the target data is valid, the font data, language data to be switched, and voice data of the object to be set are set according to the target data. Specifically, firstly, the replacement word corresponding to the language data to be switched is determined from all target words corresponding to the target language, and then the language data to be switched is replaced with the aforementioned replacement word. After that, the target font is loaded into the part of the language data to be switched that corresponds to the font data after the above replacement, and the part of the language data to be switched that corresponds to the voice data after the replacement is voice-read aloud. If the target data is invalid, all target data is deleted, and S10-S60 are re-executed after receiving the next setting instruction.
[0043] The target data of this invention includes target terms, target fonts, and target speech determined according to the target language. After confirming the validity of the target data, the language of the object to be set is switched based on the target data. Thus, after the language switching processing based on the aforementioned valid target data, this invention achieves the recognition and conversion of multiple languages (converting the language corresponding to at least one language to be switched to the language corresponding to at least one target language), thereby meeting the language needs of different users, improving user understanding and experience, and ultimately increasing user satisfaction and usage rate. Furthermore, this invention only performs language switching processing on the object to be set when the target data is valid, thus ensuring the accuracy and reliability of the language data processing and avoiding misunderstandings and incorrect decisions caused by errors in the language data. In addition, this invention does not require packaging all language resource files into the object to be set during the compilation process. It only needs to determine a portion of the target data according to the setting instructions using the font setting module, term setting module, and speech setting module, and then directly perform dynamic language switching processing after confirming that all of it is valid, thereby improving the scalability and flexibility of multilingual data processing.
[0044] In one embodiment, step S20, namely, obtaining font data from the language data to be switched through the font setting module and determining the target font corresponding to the font data according to the target language, includes:
[0045] S201. Obtain the font identifier corresponding to each of the target fonts through the font setting module, and call the preset font associated with the font identifier from the font library; the font library contains multiple preset fonts, and each font identifier corresponds to one preset font. Understandably, each language corresponds to one font identifier. The font library can be a pre-set font library corresponding to the language switching setting command and the object to be set, based on actual needs. In the font library, each font identifier corresponds to one preset font, and each preset font corresponds to at least one font identifier. For example, if the language switching setting command is to switch to Chinese, and the font corresponding to Chinese in the font library is KaiTi, then calling the preset font associated with the font identifier from the font library is KaiTi. Here, the preset font includes, but is not limited to, preset font size, shape, color, and appearance.
[0046] S202. The language data to be switched that is different from the preset font being called is determined as font data, the preset font being called is recorded as the target font, and the target font is cached in the first cache space. That is, if the preset font being called is KaiTi, and if the fonts in the font data to be switched include KaiTi, HeiTi, and SongTi, then since HeiTi and SongTi are different from KaiTi, the data parts in the language data to be switched that correspond to HeiTi and SongTi are all font data.
[0047] Understandably, the first cache space can be a pre-set space for caching the target font. Caching the target font in the first cache space can improve the efficiency of subsequent processing of the target font. In this embodiment, the preset font is called according to the font identifier corresponding to the target language, which improves the accuracy of the target font determination, thereby improving user satisfaction and usage rate; then, the target font is cached in the first cache space, which greatly shortens the font setting processing time, thereby improving system performance and response speed.
[0048] In one embodiment, step S203, namely caching the target font to the first cache space, includes:
[0049] S2031. Traverse the first cache space and determine whether the cached font information in the first cache space is the same as the target font.
[0050] S2032. If the cached font information is different from the target font, then after releasing the first cache space, the target font is cached in the first cache space.
[0051] Specifically, the first cache space is traversed, and it is determined whether the cached font information in the first cache space is the same as the target font. If the cached font information is different from the target font, the first cache space is released and the target font is cached in the first cache space; if the cached font information is the same as the target font, the cached font information is saved.
[0052] This embodiment significantly shortens the processing time for subsequent font settings by releasing the first cache space and caching the target font in the first cache space when the cached font information in the first cache space is different from the target font, thereby improving system performance and response speed.
[0053] In one embodiment, step S30, namely, determining the target term corresponding to the language data to be switched through the term setting module according to the target language, includes:
[0054] S301. Obtain the term identifier corresponding to each of the target languages through the term setting module. Each language corresponds to one term identifier. Understandably, the font identifier and the term identifier may be the same or different.
[0055] S302. The term setting module retrieves preset terms associated with each term identifier from the term library and records all the retrieved preset terms as target terms. The term library contains multiple preset terms, and each term identifier corresponds to one preset term. Understandably, the term library can be a pre-set term library corresponding to the setting instruction and the object to be set, based on actual needs. The term library contains multiple preset terms, each term identifier corresponds to one preset term, and each preset term corresponds to at least one term identifier.
[0056] This embodiment achieves multilingual recognition by acquiring term identifiers associated with each target language, then calling preset terms associated with each term identifier from the term library, and recording all acquired preset terms as target terms. This facilitates the subsequent conversion of data to be switched into the target language based on the acquired preset terms, improving the accuracy of term conversion and thus increasing user satisfaction and usage rate.
[0057] In one embodiment, the term library includes a local term library and an external term library; the external term library contains multiple first preset terms associated with different first identifiers; the local term library contains multiple second preset terms associated with different second identifiers; step S302, namely, retrieving preset terms associated with each term identifier from the term library and recording all the retrieved preset terms as target terms, includes:
[0058] S3021. Obtain the total number of all the aforementioned term identifiers.
[0059] S3022. Traverse the external thesaurus, record the first identifier in the external thesaurus that is the same as the term identifier as the first target identifier, and call the first preset term associated with each first target identifier. Understandably, in this embodiment, the external thesaurus is an extension of the local thesaurus, and the external thesaurus can pre-store languages according to the language switching setting instructions.
[0060] S3023. When the number of the first target identifiers is less than the total number, the remaining identifiers are confirmed, and the remaining identifiers refer to other term identifiers besides the first target identifiers.
[0061] S3024. Traverse the local terminology database, record the second identifier in the local terminology database that is the same as the remaining identifier as the second target identifier, and call the second preset term associated with each second target identifier. Understandably, in this embodiment, the local terminology database is a basic database storing commonly used languages.
[0062] S3025. If the sum of the number of the first target identifiers and the number of the second target identifiers equals the total number, then all the first preset terms and the second preset terms called are determined as target terms.
[0063] Specifically, the total number of all the term identifiers is obtained, the external term library is traversed, and the first identifiers in the external term library that are the same as the term identifiers are recorded as the first target identifiers. The first preset terms associated with each first target identifier are called, and the number of first target identifiers is obtained. If the number of first target identifiers is equal to the total number, the first preset terms are determined as target terms. If the number of first target identifiers is less than the total number, the remaining identifiers are confirmed, the local term library is traversed, and the second identifiers in the local term library that are the same as the remaining identifiers are recorded as the second target identifiers. The second preset terms associated with each second target identifier are called. If the sum of the number of first target identifiers and the number of second target identifiers is equal to the total number, all the called first preset terms and second preset terms are determined as target terms. If the sum of the number of first target identifiers and the number of second target identifiers is not equal to the total number, the data is invalid, and steps S3021-S3025 are re-executed, or after prompting a setting failure, the system waits to receive the next setting instruction. Understandably, in this embodiment, the external thesaurus is an extension of the local thesaurus. The external thesaurus can pre-store various common languages according to the language switching settings. Therefore, the external thesaurus is traversed first, followed by the internal thesaurus (the internal thesaurus stores the niche language types corresponding to local dialects. Therefore, in most usage scenarios, the external thesaurus may be sufficient to meet the usage requirements. Thus, dividing it into two thesauruses can reduce the workload of retrieval). If the target language is not found in the external thesaurus, the internal thesaurus can be traversed directly for querying.
[0064] This embodiment obtains the total number of all term identifiers, first traversing the external term database to confirm the number of the first target identifier and the first preset term, and then traversing the internal term database to confirm the number of the second target identifier and the second preset term. The sum of the number of the first target identifier and the number of the second target identifier determines whether the target term has been successfully obtained, thereby improving the language recognition rate. By expanding the external term database and the local term database, language resources are enriched, the system's language adaptability and user experience are improved, language processing time and cost are reduced, and processing efficiency is increased.
[0065] In one embodiment, step S40, namely, obtaining the voice data from the language data to be switched through the voice setting module, and determining the target voice corresponding to the voice data based on the target language and the target vocabulary, includes:
[0066] S401. Obtain the voice identifier corresponding to the target language through the voice setting module. Each language corresponds to one voice identifier. Understandably, the font identifier, word identifier, and voice identifier mentioned above may be the same or different.
[0067] S402. The voice setting module retrieves preset voice information associated with the voice identifier from the voice library and records all the retrieved preset voice information as the target voice. The voice library contains multiple preset voice information, and each voice identifier corresponds to one preset voice information. Understandably, the voice library can be a pre-set voice library corresponding to the setting command and the object to be set, based on actual needs. In the voice library, each voice identifier corresponds to one preset voice information, and each preset voice information corresponds to at least one voice identifier. The preset voice information can be a preset voice file.
[0068] S404. The language data to be switched with the voice broadcast marker is determined as voice data. The target voice corresponding to the voice data is determined based on the target term and the invoked preset voice information, and the target voice is cached in the second cache space. Understandably, the voice data can be the data in the language data to be switched from the object to be set that requires voice broadcasting (this type of data is marked with a voice broadcast marker, which can be directly determined by the voice setting module based on the aforementioned voice broadcast marker). Specifically, the voice setting module obtains the voice data with the voice broadcast marker from the language data to be switched from the object to be set (if all data in the language data to be switched requires voice broadcasting, then all language data to be switched is obtained; if some data in the language data to be switched requires voice broadcasting, then some language data to be switched is obtained).
[0069] Understandably, the second cache space can be a pre-set space for caching the target speech. Caching the target speech in the second cache space can improve the efficiency of subsequent processing of the target speech. For example, if the target language is Chinese, firstly, from the target words called according to Chinese in step S30 above, a replacement word corresponding to the language data to be switched (e.g., semantically the same) is determined, and then the language data to be switched is replaced with the above replacement word; then, the speech playback word corresponding to the speech data is determined, and then, from the called preset speech information, the preset speech information matching the speech playback word is determined (this can be done by numbering the preset words in the word library and the preset speech information in the speech library, and the corresponding preset words and preset speech information have the same number, so as long as the number is the same, it is the same preset word and preset speech information; or a text information can be marked on the preset speech information, and the text information can be matched with the preset words, and the similarity exceeds a preset threshold to be considered a match), and then, the matched preset speech information is determined as the target speech corresponding to the speech playback word.
[0070] This embodiment improves language adaptability and accuracy by calling multiple preset voice information and combining them with target words to determine the target voice corresponding to the voice data, thereby increasing user satisfaction and usage rate; caching the target voice to the second cache space significantly shortens the processing time for subsequent voice settings, thereby improving system performance and response speed.
[0071] In one embodiment, step S404, namely, caching the target speech into the second cache space, includes:
[0072] S4041. Traverse the second cache space and determine whether the cached voice information in the second cache space is the same as the target voice.
[0073] S4042. If the cached voice information is different from the target voice, then after releasing the second cache space, the target voice is cached in the second cache space.
[0074] Specifically, the second cache space is traversed to determine whether the cached audio information in the second cache space is the same as the target audio. If the cached audio information is different from the target audio, the second cache space is released and the target audio is cached in the second cache space; if the cached audio information is the same as the target audio, the cached audio information is saved.
[0075] This embodiment significantly shortens the processing time for subsequent voice settings by releasing the second cache space and caching the target voice when the cached voice information in the second cache space is different from the target voice, thereby improving system performance and response speed.
[0076] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0077] In one embodiment, a multilingual data processing apparatus is provided, which corresponds one-to-one with the multilingual data processing methods described in the above embodiments. For example... Figure 1 As shown, the multilingual data processing device includes a setting instruction receiving module 10, a target font determination module 20, a target word determination module 30, a target speech determination module 40, a target data judgment module 50, and a processing module 60. Detailed descriptions of each functional module are as follows:
[0078] Setting instruction receiving module 10 is used to receive setting instructions for switching the language of the object to be set, the setting instructions including at least one target language and at least one language data to be switched to corresponding to the object to be set;
[0079] The target font determination module 20 is used to obtain font data from the language data to be switched through the font setting module, and determine the target font corresponding to the font data according to the target language.
[0080] The target term determination module 30 is used to determine, through the term setting module, the target term corresponding to the language data to be switched, based on the target language;
[0081] The target speech determination module 40 is used to obtain speech data from the language data to be switched through the speech setting module, and determine the target speech corresponding to the speech data according to the target language and the target vocabulary.
[0082] The target data judgment module 50 is used to generate target data based on the target font, the target word and the target speech, and to judge whether the target data is valid.
[0083] The processing module 60 is configured to perform language switching processing on the object to be set based on the target data if the target data is valid.
[0084] Preferably, the target font determination module 20 includes:
[0085] The preset font calling unit is used to obtain the font identifier corresponding to each of the target fonts through the font setting module, and call the preset font associated with the font identifier from the font library; the font library contains multiple preset fonts, and each font identifier corresponds to one preset font;
[0086] The target font recording unit is used to determine the language data to be switched that is different from the preset font being called as font data, record the preset font being called as the target font, and cache the target font in the first cache space.
[0087] The aforementioned target font recording unit includes:
[0088] The target font determination subunit is used to traverse the first cache space and determine whether the cached font information in the first cache space is the same as the target font.
[0089] The first cache space subunit is used to cache the target font in the first cache space after releasing the first cache space if the cached font information is different from the target font.
[0090] Preferably, the target term determination module 30 includes:
[0091] The term identifier acquisition unit is used to acquire term identifiers corresponding to each of the target languages through the term setting module;
[0092] The target term recording unit is used to retrieve preset terms associated with each term identifier from the term library through the term setting module, and record all the obtained preset terms as target terms; the term library contains multiple preset terms, and each term identifier corresponds to one preset term.
[0093] The aforementioned target term record unit includes:
[0094] The term identifier total number acquisition subunit is used to acquire the total number of all the term identifiers;
[0095] The first preset term invocation subunit is used to traverse the external term library, record the first identifier in the external term library that is the same as the term identifier as the first target identifier, and invoke the first preset term associated with each first target identifier;
[0096] The remaining identifier confirmation subunit is used to confirm the remaining identifiers when the number of the first target identifiers is less than the total number, wherein the remaining identifiers refer to other term identifiers besides the first target identifiers;
[0097] The second preset term invocation subunit is used to traverse the local term library, record the second identifier in the local term library that is the same as the remaining identifier as the second target identifier, and invoke the second preset term associated with each second target identifier;
[0098] The target term determination subunit is used to determine all the first preset terms and the second preset terms called as target terms if the sum of the number of the first target identifiers and the number of the second target identifiers is equal to the total number.
[0099] Preferably, the target speech determination module 40 includes:
[0100] A voice identifier acquisition unit is used to acquire a voice identifier corresponding to the target language through a voice setting module;
[0101] The target voice recording unit is used to retrieve preset voice information associated with the voice identifier from the voice library through the voice setting module, and record all the acquired preset voice information as target voice; the voice library contains multiple preset voice information, and each voice identifier corresponds to one preset voice information;
[0102] The target speech conversion unit is used to determine the language data to be switched with the speech broadcast mark as speech data, determine the target speech corresponding to the speech data according to the target words and the preset speech information called, and cache the target speech in the second cache space.
[0103] The aforementioned target speech conversion unit includes:
[0104] The target speech determination subunit is used to traverse the second cache space and determine whether the cached speech information in the second cache space is the same as the target speech.
[0105] The second cache space subunit is used to cache the target speech in the second cache space after releasing the second cache space if the cached speech information is different from the target speech.
[0106] Specific limitations regarding the multilingual data processing device can be found in the limitations of the multilingual data processing method described above, and will not be repeated here. Each module in the aforementioned multilingual data processing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0107] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 3 As shown, the computer device includes a processor, memory, network interface, display screen, and input device connected via a system bus. The processor provides computing and control capabilities. The memory includes a readable storage medium and internal memory. The non-volatile storage medium stores the operating system and computer-readable instructions. The internal memory provides an environment for the operation of the operating system and computer-readable instructions in the readable storage medium. The network interface is used to communicate with an external server via a network connection. When the computer-readable instructions are executed by the processor, they implement a multilingual data processing method. The readable storage medium provided in this embodiment includes both non-volatile and volatile readable storage media.
[0108] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the multilingual data processing method described in the above embodiment.
[0109] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the multilingual data processing method described in the above embodiment.
[0110] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing related hardware with computer-readable instructions. These computer-readable instructions can be stored in a non-volatile readable storage medium or a volatile readable storage medium. When executed, these computer-readable instructions can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0111] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0112] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A multilingual data processing method, characterized in that, include: Receive a setting instruction to switch the language of an object to be set, the setting instruction including at least one target language and at least one language data to be switched to corresponding to the object to be set; The font data in the language data to be switched is obtained through the font setting module, and the target font corresponding to the font data is determined according to the target language. The terminology setting module determines the target terminology corresponding to the language data to be switched based on the target language. The voice data in the language data to be switched is obtained through the voice setting module, and the target voice corresponding to the voice data is determined according to the target language and the target vocabulary. Target data is generated based on the target font, the target words, and the target speech, and it is determined whether the target data is valid; wherein, each data identifier in the target data and its corresponding actual data volume are obtained, the total number of data identifiers and the maximum number of data identifiers are compared, and the actual data volume is matched with the data volume corresponding to that data identifier in the data volume matching library; If the target data is valid, then the language of the object to be set is switched according to the target data; The step of determining the target term corresponding to the language data to be switched through the term setting module according to the target language includes: The terminology setting module obtains the terminology identifiers corresponding to each of the target languages. The term setting module retrieves preset terms associated with each term identifier from the term library and records all the retrieved preset terms as target terms; the term library contains multiple preset terms, and each term identifier corresponds to one preset term; The terminology database includes a local terminology database and an external terminology database; the external terminology database contains multiple first preset terms associated with different first identifiers; the local terminology database contains multiple second preset terms associated with different second identifiers; The step of retrieving preset terms associated with each term identifier from the term library and recording all the retrieved preset terms as target terms includes: Obtain the total number of all the aforementioned term identifiers; The external thesaurus is traversed, and the first identifier in the external thesaurus that is the same as the term identifier is recorded as the first target identifier. The first preset term associated with each first target identifier is then called. The external thesaurus is an extension of the local thesaurus, and the external thesaurus pre-stores multiple common languages according to the language switching setting instructions. When the number of the first target identifiers is less than the total number, the remaining identifiers are identified, and the remaining identifiers refer to other term identifiers besides the first target identifiers. The local dictionary is traversed, and the second identifier that is the same as the remaining identifier in the local dictionary is recorded as the second target identifier. The second preset dictionary associated with each second target identifier is then called. The internal dictionary stores the niche language types corresponding to the local dialect. If the sum of the number of the first target identifiers and the number of the second target identifiers equals the total number, then all the first preset terms and the second preset terms that are invoked will be determined as target terms.
2. The multilingual data processing method as described in claim 1, characterized in that, The step of obtaining font data from the language data to be switched through the font setting module, and determining the target font corresponding to the font data according to the target language, includes: The font setting module obtains the font identifier corresponding to each target font and calls the preset font associated with the font identifier from the font library; the font library contains multiple preset fonts, and each font identifier corresponds to one preset font; The language data to be switched, which is different from the font of the preset font called, is determined as font data. The preset font called is recorded as the target font, and the target font is cached in the first cache space.
3. The multilingual data processing method as described in claim 2, characterized in that, The step of caching the target font to the first cache space includes: Traverse the first cache space to determine whether the cached font information in the first cache space is the same as the target font; If the cached font information is different from the target font, then after releasing the first cache space, the target font is cached in the first cache space.
4. The multilingual data processing method as described in claim 1, characterized in that, The step of obtaining voice data from the language data to be switched through the voice setting module, and determining the target voice corresponding to the voice data based on the target language and the target vocabulary, includes: The voice identifier corresponding to the target language is obtained through the voice setting module; The voice setting module retrieves preset voice information associated with the voice identifier from the voice library and records all the retrieved preset voice information as the target voice; the voice library contains multiple preset voice information, and each voice identifier corresponds to one preset voice information; The language data to be switched with the voice broadcast mark is identified as voice data. The target voice corresponding to the voice data is determined according to the target word and the preset voice information called, and the target voice is cached in the second cache space.
5. The multilingual data processing method as described in claim 4, characterized in that, The step of caching the target speech into the second cache space includes: Traverse the second cache space to determine whether the cached speech information in the second cache space is the same as the target speech; If the cached voice information is different from the target voice, then after releasing the second cache space, the target voice is cached in the second cache space.
6. A multilingual data processing device, characterized in that, include: The setting instruction receiving module is used to receive setting instructions for switching the language of the object to be set. The setting instructions include at least one target language and at least one language data to be switched to, which are corresponding to the object to be set. The target font determination module is used to obtain font data from the language data to be switched through the font setting module, and determine the target font corresponding to the font data according to the target language. The target term determination module is used to determine, through the term setting module, the target term corresponding to the language data to be switched, based on the target language; The target speech determination module is used to obtain speech data from the language data to be switched through the speech setting module, and determine the target speech corresponding to the speech data according to the target language and the target vocabulary. The target data judgment module is used to generate target data based on the target font, the target word, and the target speech, and to judge whether the target data is valid; wherein, each data identifier in the target data and its corresponding actual data volume are obtained, the total number of data identifiers and the maximum number of data identifiers are compared, and the actual data volume is compared with the data volume corresponding to the data identifier in the data volume matching library; The processing module is used to perform language switching processing on the object to be set according to the target data if the target data is valid; The target term determination module includes: The term identifier acquisition unit is used to acquire term identifiers corresponding to each of the target languages through the term setting module; The target term recording unit is used to retrieve preset terms associated with each term identifier from the term library through the term setting module, and record all the retrieved preset terms as target terms; the term library contains multiple preset terms, and each term identifier corresponds to one preset term; The aforementioned target term record unit includes: The term identifier total number acquisition subunit is used to acquire the total number of all the term identifiers; The first preset term invocation subunit is used to traverse the external term library, record the first identifier in the external term library that is the same as the term identifier as the first target identifier, and call the first preset term associated with each first target identifier; wherein, the external term library is an extension library of the local term library, and the external term library pre-stores multiple common languages according to the language switching setting instructions; The remaining identifier confirmation subunit is used to confirm the remaining identifiers when the number of the first target identifiers is less than the total number, wherein the remaining identifiers refer to other term identifiers besides the first target identifiers; The second preset term invocation subunit is used to traverse the local term library, record the second identifier in the local term library that is the same as the remaining identifier as the second target identifier, and invoke the second preset term associated with each second target identifier; wherein, the internal term library stores the niche language types corresponding to the local dialect; The target term determination subunit is used to determine all the first preset terms and the second preset terms called as target terms if the sum of the number of the first target identifiers and the number of the second target identifiers is equal to the total number.
7. A computer device comprising a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, characterized in that, When the processor executes the computer-readable instructions, it implements the multilingual data processing method as described in any one of claims 1 to 5.
8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the multilingual data processing method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Language switching method and device and text saving method
CN114691266A
Webpage translation method and related equipment
CN114791987A