Character loading method, character file generation method, and related device

By building a new binary text file format, rearranging key values ​​and multilingual text, and encrypting the feature code, the problem of excessive size and inability to encrypt the multilingual resource files in the prior art is solved, and more efficient storage and stronger confidentiality are achieved.

WO2025113377A1PCT designated stage expired Publication Date: 2025-06-05BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/134192
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-11-28
Filing Date
2024-11-25
Publication Date
2025-06-05

AI Technical Summary

Technical Problem

The prior art uses JSON or XML formats when storing and calling multilingual resource copy, resulting in the resource file being too large and unable to be encrypted, affecting storage efficiency and file confidentiality.

Method used

By constructing a new binary text file format, re-arrange the key-value feature code and the separator between multilingual text to generate compact binary files and encrypt the feature code.

Benefits of technology

It effectively reduces the storage space of multilingual resource files, reduces resource consumption for data processing, and ensures the confidentiality of files.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024134192_05062025_PF_FP_ABST
    Figure CN2024134192_05062025_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the present disclosure is a character loading method, comprising: in response to an event of loading a target character, acquiring a binary character file to be decoded, wherein the binary character file comprises feature codes of key values and multi-language characters corresponding to the key values, the key values are used for expressing semantics of the multi-language characters, and there is a first separator between any adjacent feature codes of the key values and any adjacent multi-language characters; on the basis of the target character and the binary file, determining a feature code of a key value corresponding to the target character and a corresponding multi-language character; and loading the target character on the basis of the feature code of the key value corresponding to the target character and the corresponding multi-language character. On the basis of the character loading method, further provided in the present disclosure are a character file generation method, a character loading apparatus, a character file generation apparatus, an electronic device, a storage medium and a program product.
Need to check novelty before this filing date? Find Prior Art

Description

Text loading method, text file generation method and related equipment

[0001] This application claims priority to the Chinese invention patent application entitled “Text loading method, text file generation method and related equipment” filed on November 28, 2023, with application number 202311607672.4. The entire contents of that application are incorporated by reference into this application. Technical Field

[0002] The present application relates to the technical field of computer document configuration, and in particular to a text loading method, a text file generation method, and related equipment. Background Art

[0003] Multilingual resources refer to multilingual support for a single project. With the deepening of economic globalization, projects or programs need to be usable in language environments around the world. Therefore, projects need to configure language resources corresponding to the language systems of the release location, such as Simplified Chinese, Traditional Chinese, English, French, Japanese, and so on. Furthermore, after configuring multiple language resources, it is necessary to be able to flexibly switch between different languages ​​to reduce development costs for adapting to different regions.

[0004] Currently, different languages ​​can usually be stored in a cloud server or locally to provide access. When the language needs to be switched, the corresponding file can be directly called. However, since multilingual resource texts are currently stored and called directly through formats such as JavaScript Object Notation (JSON) or Extensible Markup Language (XML), and because the above formats are not compact enough, the resource files will take up too much space when stored and called. In addition, because the above formats are plain text, the resource files cannot be encrypted. Summary of the Invention

[0005] In view of this, the embodiments of the present disclosure provide a text loading method, a text file generation method and related equipment, which can effectively reduce the storage volume of resource files and can realize encryption of resource files.

[0006] According to some embodiments of the present disclosure, the above-mentioned text loading method may include: in response to an event of loading a target text, obtaining a binary text file to be decoded; the binary text file includes a feature code of a key value and a multilingual text corresponding to the key value; wherein the key value is used to express the semantics of the multilingual text; there is a first separator between any adjacent feature codes of the key value and any adjacent multilingual text; based on the target text and the binary file, determining the feature code of the key value corresponding to the target text and the corresponding multilingual text; loading the target text based on the feature code of the key value corresponding to the target text and the corresponding multilingual text.

[0007] Based on the above-mentioned text loading method, an embodiment of the present disclosure provides a text loading device, including:

[0008] An acquisition module is configured to, in response to an event of loading a target text, acquire a binary text file to be decoded; the binary text file includes a feature code of a key value and a multilingual text corresponding to the key value; wherein the key value is used to express the semantics of the multilingual text; and a first separator exists between any adjacent feature codes of the key value and any adjacent multilingual text;

[0009] A first determining module is configured to determine a feature code of a key value corresponding to the target text and a corresponding multilingual text based on the target text and the binary file;

[0010] The loading module is used to load the target text according to the feature code of the key value corresponding to the target text and the corresponding multilingual text.

[0011] In addition, according to some embodiments of the present disclosure, the method for generating the above-mentioned text file may include: determining key values ​​and multilingual text corresponding to different languages ​​from the acquired multilingual text; the key values ​​are used to express the semantics of the multilingual text; extracting feature codes of the key values, and separating each of the feature codes by a first separator; separating each of the multilingual text by the first separator; and generating a binary text file based on the feature codes, the multilingual text and the first separator.

[0012] Based on the above-mentioned method for generating a text file, an embodiment of the present disclosure provides a device for generating a text file, including:

[0013] A second determining module is configured to determine key values ​​and multilingual text corresponding to different languages ​​from the acquired multilingual text; the key values ​​are used to express the semantics of the multilingual text;

[0014] An extraction module, configured to extract a feature code of the key value and separate each feature code by a first separator;

[0015] a separation module, configured to separate each of the multilingual characters by the first separator;

[0016] A generating module is used to generate a binary text file according to the feature code, the multilingual text and the first separator.

[0017] In addition, an embodiment of the present disclosure further provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above method when executing the program.

[0018] An embodiment of the present disclosure further provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the above method.

[0019] An embodiment of the present disclosure further provides a computer program product, comprising computer program instructions, which enable the computer to execute the above method when the computer program instructions are executed on a computer.

[0020] The above-mentioned text loading method, text file generation method and related equipment, when loading text, do not use the traditional JSON or XML format to call or store the multilingual resource file when generating the binary text file, but instead construct a new text file generation method, and separate the feature code and the multilingual text by a first separator and rearrange them, so that during the loading process, the size of the called multilingual resource file can be effectively reduced, and the resources consumed by data processing can be reduced. It can be seen that through the above-mentioned reconstruction of the format of the multilingual resource file, the processed multilingual resource text can be effectively arranged compactly, which can greatly reduce the storage space occupied by the multilingual resource text, and can effectively solve the problem of the multilingual resource text occupying too much storage space, thereby effectively reducing the size of the resource file called during the text loading process, and effectively reducing the resource consumption when processing data. In addition, since the format of the text file is reconstructed, the key value can be encrypted accordingly and reflected in the form of a feature code, which can effectively ensure the confidentiality of the multilingual resource text file. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in this application or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are merely embodiments of this application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0022] FIG1 shows an implementation process of a text loading method according to some embodiments of the present disclosure;

[0023] FIG2 shows a schematic diagram of a partial structure of a binary text file according to some embodiments of the present disclosure;

[0024] FIG3 shows the implementation process of the method for generating a text file according to an embodiment of the present disclosure;

[0025] FIG4 shows the internal structure of the text loading device according to an embodiment of the present disclosure;

[0026] FIG5 shows the internal structure of the device for generating a text file according to an embodiment of the present disclosure;

[0027] FIG6 shows a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0028] In order to make the objectives, technical solutions and advantages of the present disclosure more clearly understood, the present disclosure is further described in detail below in conjunction with specific embodiments and with reference to the accompanying drawings.

[0029] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present application should have the usual meanings understood by people with ordinary skills in the field to which this application belongs. The "first", "second" and similar words used in the embodiments of the present application do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0030] As mentioned above, when storing and calling multilingual resource documents, they are stored and called directly in formats such as JSON or XML. However, due to the lack of compactness of these formats, the resource files are too large when stored and called. Furthermore, because these formats are plain text and cannot be encrypted, the confidentiality of these files cannot be effectively guaranteed.

[0031] To this end, some embodiments of the present disclosure provide a text loading method that can effectively reduce the size of the multilingual resource files called during the loading process, reducing the resources consumed by data processing. Furthermore, the loaded binary text files can implement encryption of key values, effectively ensuring the confidentiality of the multilingual resource text files. In embodiments of the present disclosure, the above-mentioned text loading method can be implemented by an electronic device with computing capabilities.

[0032] FIG1 shows the implementation process of the text loading method described in some embodiments of the present disclosure. As shown in FIG1 , the method may include the following steps:

[0033] In step 102, in response to an event of loading a target text, a binary text file to be decoded is obtained.

[0034] In an embodiment of the present disclosure, the above-mentioned event of loading the target text can be the first time a program or project loads a language and text resource, or it can be the replacement of a language and text resource. For example, if the program or project is opened for the first time, it will load the main language by default, and the event of loading the target text at this time is the event of loading the main language and text. It should be noted that, for different regions, those skilled in the art can also set different main languages ​​in a targeted manner. If the user opens the program and the language of the program at this time is not the language required by the user, or the user has a need to change the language and text, then the event of loading the target text at this time is the language and text corresponding to the language of the target text specified by the user. The present disclosure does not make corresponding restrictions on the language type in the above-mentioned event of loading the target text.

[0035] Referring to FIG2 , a partial structural diagram of a binary text file according to some embodiments of the present disclosure is shown.

[0036] The binary text file of the present disclosure is described below with reference to FIG2 .

[0037] In an embodiment of the present disclosure, the above-mentioned binary text file includes a feature code of a key value and multilingual text corresponding to the key value; wherein the key value is used to express the semantics of the multilingual text; and there is a first separator between any adjacent feature codes of the key value and any adjacent multilingual text.

[0038] In an embodiment of the present disclosure, the characteristic code of the key value is obtained by encrypting the key value. The key value is extracted from the singular main language text resource in the multilingual text resource file, and is used to express the semantics of the multilingual text. For example, when the key value is "name", the multilingual text can be "John" or "John". After the key value is extracted, in some embodiments of the present disclosure, the key value is hexadecimal processed, and then the key value is encrypted using the Message-Digest Algorithm 5 (MD5) algorithm, and then the encrypted key value is separated by the first separator and arranged in sequence to obtain the key value. Similarly, the corresponding key value in the code also needs to undergo the above processing, so that in the subsequent loading process, there is no need to decode the key value again, and the encrypted characters can be directly compared, which can effectively shorten the loading process time and improve loading efficiency.

[0039] The MD5 algorithm is a message digest algorithm, a type of hash algorithm. Under normal circumstances, its result is a 32-bit hexadecimal string. The main characteristic of the MD5 algorithm is its irreversibility: the MD5 value for the same data is always the same, but different data will have different MD5 values. Using the MD5 algorithm to encrypt the key value mentioned above effectively compresses the key value, as the calculated MD5 value is fixed for data of any length. Furthermore, it effectively ensures the key value's recognizability and resistance to modification. Any modification to the original data will result in a significant difference in the resulting MD5 value. Therefore, when comparing keys, the MD5 codes corresponding to different keys will not be identical, leading to key value recognition errors. Furthermore, if someone maliciously tampered with a key value, the corresponding MD5 code would be unrecognizable, effectively preventing malicious tampering. Furthermore, the MD5 algorithm's computational process is relatively simple, so using it to encrypt keys does not consume a lot of resources. It should be noted that the algorithm used in the present disclosure to encrypt key values ​​is not limited to the MD5 algorithm. It is theoretically feasible to use other encryption algorithms, as long as the encryption results obtained for different key values ​​are different and the encrypted results are not too lengthy. Because key values ​​are encrypted not only to ensure the confidentiality of multilingual files, but also to reduce the storage space they occupy, if an encryption algorithm with an overly long encryption result is selected, the technical effect of reducing the space occupied cannot be achieved. However, if the space occupied issue is not a concern, it is only necessary to ensure the uniqueness of the key value encryption. The present disclosure does not make corresponding restrictions on the encryption algorithm used for key values.

[0040] In the embodiment of the present disclosure, the feature code of each key value is separated by a first separator.

[0041] In some embodiments of the present disclosure, the first delimiter may be "\0". The advantage of this first delimiter is that it is short. This delimiter is used to separate the key-value signatures and then the key-value signatures are simply arranged to form a "key1\0key2\0..." format. Compared with the formats in the prior art, the formats of the embodiments of the present disclosure are relatively concise. This relatively simple arrangement effectively shortens the space occupied by the key-values. Combined with the corresponding encryption algorithm mentioned above, the embodiments of the present disclosure only use concise delimiters to separate the key-values ​​after compressing them once, thereby constructing a key-value format. This reduces the storage space occupied by the key-values ​​in both dimensions, thus saving storage resources to a great extent.

[0042] In the embodiment of the present disclosure, for each language in the multi-language text, each corresponding key value has a corresponding language, and the first separator exists between each language.

[0043] For multilingual text, since this part records the final text, it cannot be encrypted during the processing. If it is encrypted, if it is not decrypted during the loading process, the target text cannot be displayed normally to the user. If this part of the text is decrypted, a lot of extra workload will be added, which is unnecessary. Therefore, in the embodiment of the present disclosure, the multilingual text is not encrypted, but only adjacent multilingual texts are separated by the first separator, and all the multilingual texts are arranged in sequence. The format constructed by the above arrangement method reduces the spacing between texts compared to the format in the prior art, thereby effectively reducing the space occupied by multilingual texts.

[0044] In an embodiment of the present disclosure, the binary text file further includes: a meta-information field for recording the position and length of the feature code, as well as the position and length of the different language characters in the multilingual text; and a second delimiter for separating the feature code from the multilingual text. The meta-information field records information about the key value and the multilingual text, specifically including their corresponding positions and lengths. Because multilingual text can include text corresponding to multiple languages, it is necessary to quickly find the multilingual text corresponding to the target text during the loading process of the multilingual text resource. Therefore, after writing the positions and lengths corresponding to the different language characters into the meta-information field in the aforementioned step, the key value and the multilingual text corresponding to the target text can be quickly found during the subsequent loading process, effectively reducing language loading time and thereby effectively improving the user experience when switching languages. The feature code of the key value and the multilingual text are separated by the second delimiter. During the storage of multilingual text, in order to effectively distinguish the feature code of the key value and the multilingual text, a corresponding delimiter is set between the two.

[0045] In an embodiment of the present disclosure, the above-mentioned second separator can be a "DATA" character. In addition to separating the key-value feature code and multilingual text, the use of this character as the second separator can also play a certain identification role. For example, this character is used to identify that subsequent fields are all multilingual text. The above-mentioned second separator field is not limited to the examples given above, and those skilled in the art can set the corresponding second separator on their own. In addition, a second separator can be included between the meta-information field and the key-value feature code, such as using the "keys" character to perform corresponding separation of the meta-information field and the key-value feature code. Similarly, the above-mentioned characters can not only play a role in separating the meta-information field and the feature code, but also play a certain identification role for the feature code, such as using this character to identify the subsequent field as a feature code. Similarly, the above-mentioned second separator is not limited to the "keys" character, and those skilled in the art can set this character on their own.

[0046] In the embodiment of the present disclosure, the binary text file also includes a file header. The file header can display the actual usage of the file. In the computing set, the file header is a piece of data used to describe the content and format of the file. Different file formats have different file header formats. The file header content usually contains information such as the file type, version, encoding method, file size, etc. to facilitate computer identification and processing of files. Since the embodiment of the present disclosure constructs a new format for multilingual text resource files, a new file header is created for this format to describe the detailed information of the corresponding file.

[0047] In step 104, based on the target text and the binary file, a feature code of a key value corresponding to the target text and the corresponding multilingual text are determined.

[0048] In the embodiment of the present disclosure, determining the feature code of the key value corresponding to the target text and the corresponding multilingual text based on the target text and the binary file includes: reading the position and length of the feature code recorded in the meta-information field, and reading the position and length of the multilingual text corresponding to the language of the target text, to obtain the feature code corresponding to the target text and the multilingual text corresponding to the target text.

[0049] As previously mentioned, binary text files include a meta-information field that records the location and length of the signature code, as well as the location and length of the multi-language text. Therefore, during the determination process, the meta-information field can be used to obtain the signature code and the multi-language text corresponding to the target text's language. Since the locations and lengths of these signature codes and multi-language texts are recorded accordingly, during the loading process, only the corresponding location and length need to be obtained to quickly find the corresponding signature code or multi-language text. This effectively shortens the time it takes to find the signature code or multi-language text, and thus effectively shortens the time it takes to load multi-language text resources.

[0050] In the embodiment of the present disclosure, the above-mentioned process of reading the corresponding feature code and reading the corresponding multilingual text can be read in parallel, that is, the feature code and the corresponding multilingual text are read at the same time. This can effectively shorten the time spent on determining the feature code and the corresponding multilingual text of the key value corresponding to the target text, thereby effectively reducing the time for loading the corresponding multilingual resources.

[0051] In step 106, the target text is loaded according to the feature code of the key value corresponding to the target text and the corresponding multilingual text.

[0052] After determining the feature code of the key value corresponding to the target text and the corresponding multilingual text in the above steps, the target text can be loaded according to the above-determined feature code and the corresponding multilingual text. The loading process is the matching process of the key value and the multilingual text. Those skilled in the art should know this, so it will not be repeated here.

[0053] The above-mentioned text loading method, when loading text, does not use the traditional JSON or XML format to call or store the multilingual resource file because the generated binary text file does not use the traditional JSON or XML format to call or store the multilingual resource file. Instead, a new text file generation method is constructed, and the feature code and multilingual text are separated by the first separator and rearranged. Therefore, during the loading process, the size of the called multilingual resource file can be effectively reduced, and the resources consumed by data processing can be reduced.

[0054] In addition, an embodiment of the present disclosure also discloses a method for generating a text file, which can make the processed multilingual resource text arranged compactly, and can greatly reduce the storage space occupied by the multilingual resource text. In addition, since the storage format of the multilingual resource text is reconstructed, the key value can be encrypted accordingly and reflected in the form of a feature code, thereby effectively ensuring the confidentiality of the multilingual resource text file.

[0055] FIG3 shows the implementation process of the method for generating a text file according to an embodiment of the present disclosure. As shown in FIG3 , the method may include the following steps:

[0056] In step 302, key values ​​and multilingual texts corresponding to different languages ​​are determined from the obtained multilingual text; the key values ​​are used to express the semantics of the multilingual texts.

[0057] In an embodiment of the present disclosure, determining the key value from the acquired multilingual document includes: determining a target language text corresponding to the target language from the multilingual document; and determining the key value based on the target language text.

[0058] In an embodiment of the present disclosure, the multilingual text files to be processed include text files corresponding to different languages, and one language needs to be determined as the target language because only the key value of the target language needs to be extracted in the subsequent process.

[0059] In an embodiment of the present disclosure, the multilingual text includes a first language text; wherein the first language text is used to represent a word in singular form; and determining key values ​​and multilingual text corresponding to different languages ​​from the acquired multilingual text includes: determining key values ​​and multilingual text corresponding to different languages ​​from the first language text.

[0060] In the embodiment of the present disclosure, because the number of plural words is small, and the process of extracting key values ​​for plural words is more complicated, if all types of text files are extracted, a lot of unnecessary workload will be added in the subsequent processing process. Therefore, in the embodiment of the present disclosure, only key values ​​and language texts are extracted for singular words, and for plural words, since their number is small, they do not need to be processed and will not take up too much storage space. Therefore, they can be packaged separately and can be directly called and loaded in the subsequent loading process.

[0061] Therefore, in the embodiment of the present disclosure, key values ​​may be extracted only for singular words in the target language, while when extracting multilingual text, it is necessary to extract singular words in all languages.

[0062] In the embodiment of the present disclosure, the language characters corresponding to each language correspond to the key values ​​one by one.

[0063] In step 304, the feature codes of the key values ​​are extracted, and each feature code is separated by a first separator.

[0064] In an embodiment of the present disclosure, extracting the characteristic code of the key value includes: encrypting the key value using a preset encryption algorithm to obtain the characteristic code of the key value. The encryption algorithm mentioned here can be consistent with the encryption algorithm in the aforementioned text loading method, and the arrangement relationship between the characteristic code of the key value and the first separator is also described in detail in the aforementioned text loading method, so it will not be repeated here. The aforementioned characteristic code can be the encryption result obtained after encryption.

[0065] In step 306, each of the multi-language characters is separated by the first separator.

[0066] In the embodiments of the present disclosure, the corresponding description of the first separator and the corresponding description of the language text corresponding to different languages ​​separated by the first separator refer to the corresponding description in the aforementioned text loading method, and will not be repeated here. With respect to the above arrangement by language type, when arranging the language text corresponding to different languages, they are arranged according to the language type, and the language text of the same language type is positioned adjacent or close to each other, which facilitates quick search when loading text.

[0067] In step 308, a binary text file is generated according to the feature code, the multilingual text, and the first separator.

[0068] In an embodiment of the present disclosure, the binary text file includes a meta-information field; the method further includes: writing the corresponding positions of the feature code and the multi-language text after being arranged in a preset manner into the meta-information field; and writing the feature code and the length of the multi-language text into the meta-information field. Similarly, the description of the meta-information field can refer to the corresponding description of the aforementioned text loading method part, which will not be repeated here. Corresponding to the aforementioned text loading method, during the loading process, the corresponding key value and multi-language text are obtained by reading the corresponding positions and lengths of the feature code and the multi-language text in the meta-information field after being arranged in a preset manner, so as to realize the loading of multi-language text resources. Accordingly, in the process of generating a text file, the aforementioned corresponding positions and lengths need to be written into the meta-information field in advance for reading in the subsequent loading process.

[0069] In an embodiment of the present disclosure, the binary text file further includes a second separator; the feature code and the multilingual text are separated by the second separator. The generation of a binary text file based on the feature code, the multilingual text and the first separator includes: arranging the meta information field, the feature code, the first separator, the second separator and the multilingual text in a preset manner, and performing binary operations to obtain the binary text file. The aforementioned binary text may include a file header. The description of the file header can also refer to the corresponding description of the aforementioned text loading method, which will not be repeated here. The above-mentioned preset arrangement can be arranged in the order of file header, meta information field, second separator, feature code, second separator, and multilingual text. Of course, the above-mentioned arrangement is only exemplary and does not mean that the present disclosure is limited to the above-mentioned one arrangement. After all fields are arranged in a preset manner, binary operations are performed on all arranged fields to finally obtain a binary text file.

[0070] The above-described text file generation method restructures the overall format and significantly shortens the spacing between key-value signatures and multilingual text to create a new format. This effectively compacts the processed multilingual resource text, significantly reducing the storage space occupied by the multilingual resource text and effectively resolving the issue of excessive storage space occupied by multilingual resource text. Furthermore, due to the restructured text file format, the key-values ​​can be encrypted and represented as signatures, effectively ensuring the confidentiality of the multilingual resource text file.

[0071] It should be noted that the method of the embodiment of the present application can be performed by a single device, such as a computer or server. The method of this embodiment can also be applied in a distributed scenario and performed by multiple devices working together. In such a distributed scenario, one of the multiple devices may only perform one or more steps of the method of the embodiment of the present application, and the multiple devices will interact with each other to complete the method.

[0072] It should be noted that the above description is limited to some embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in an order different from that described in the above embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0073] Corresponding to the above-mentioned text loading method, the embodiment of the present disclosure further discloses a text loading device. FIG4 shows the internal structure of the text loading device described in the embodiment of the present disclosure. As shown in FIG4 , the device may include:

[0074] The acquisition module 402 is configured to, in response to an event of loading a target text, acquire a binary text file to be decoded; the binary text file includes a key value feature code and a multilingual text corresponding to the key value; wherein the key value is used to express the semantics of the multilingual text; and a first separator exists between any adjacent key value feature codes and any adjacent multilingual text;

[0075] A first determining module 404 is configured to determine a key-value feature code and a corresponding multilingual text corresponding to the target text based on the target text and the binary file;

[0076] The loading module 406 is configured to load the target text according to the feature code of the key value corresponding to the target text and the corresponding multilingual text.

[0077] In some embodiments of the present disclosure, the binary text file further includes:

[0078] The meta-information field is used to record the position and length of the feature code, and the position and length of different languages ​​in the multi-language text;

[0079] The second separator is used to separate the feature code and the multilingual text.

[0080] In some embodiments of the present disclosure, the first determining module 404 may include:

[0081] A reading unit is used to read the position and length of the feature code recorded in the meta-information field, and read the position and length of the multilingual text corresponding to the language of the target text, to obtain the feature code corresponding to the target text and the multilingual text corresponding to the target text.

[0082] In some embodiments of the present disclosure, the reading unit may include:

[0083] The position and length of the feature code recorded in the meta-information field are read in parallel, as well as the position and length of the multilingual text corresponding to the language of the target text, to obtain the feature code corresponding to the target text and the multilingual text corresponding to the target text.

[0084] In some embodiments of the present disclosure, the fixed character string includes a second separator; the key value and the multilingual text are separated by the second separator.

[0085] In some embodiments of the present disclosure, the characteristic code of the key value is obtained by encrypting the key value.

[0086] The specific implementation of each of the above modules can be referenced in the aforementioned methods and accompanying drawings, and will not be repeated here. For ease of description, the above device is described as functionally divided into various modules and described separately. Of course, when implementing the present disclosure, the functions of each module can be implemented in the same or multiple software and / or hardware.

[0087] The device of the above embodiment is used to implement the corresponding text loading method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.

[0088] Corresponding to the above-mentioned method for generating a text file, an embodiment of the present disclosure further discloses a device for generating a text file. FIG5 shows the internal structure of the device for generating a text file according to an embodiment of the present disclosure. As shown in FIG5 , the device may include:

[0089] The second determining module 502 is configured to determine key values ​​and multilingual text corresponding to different languages ​​from the acquired multilingual text; the key values ​​are used to express the semantics of the multilingual text;

[0090] An extraction module 504 is configured to extract feature codes of the key values ​​and separate each feature code by a first separator;

[0091] A separation module 506, configured to separate each of the multilingual characters using the first separator;

[0092] The generating module 508 is configured to generate a binary text file according to the feature code, the multilingual text and the first separator.

[0093] In some embodiments of the present disclosure, the extraction module 504 includes:

[0094] A first determining unit, configured to determine a target language text corresponding to a target language from the multilingual copy;

[0095] The second determining unit is configured to determine the key value based on the target language.

[0096] In some embodiments of the present disclosure, the multilingual text includes a first language text; wherein the first language text is used to represent a word in a singular form;

[0097] The second determining module 502 may include:

[0098] The third determining unit is configured to determine key values ​​and multilingual text corresponding to different languages ​​from the first language text.

[0099] In some embodiments of the present disclosure, the binary text file includes a meta information field;

[0100] The device further comprises:

[0101] a position writing module, configured to write the feature code and the multilingual text into the meta information field at corresponding positions after the feature code and the multilingual text are arranged in a preset manner;

[0102] The length writing module is used to write the feature code and the length of the multilingual text into the meta information field.

[0103] In some embodiments of the present disclosure, the binary text file further includes a second separator; the feature code and the multilingual text are separated by the second separator.

[0104] In some embodiments of the present disclosure, the generating module 508 includes:

[0105] The binary unit is used to arrange the meta information field, the feature code, the first separator, the second separator and the multilingual text in a preset manner, and perform binary operations to obtain the binary text file.

[0106] The specific implementation of each of the above modules can be referenced in the aforementioned methods and accompanying drawings, and will not be repeated here. For ease of description, the above device is described as functionally divided into various modules and described separately. Of course, when implementing the present disclosure, the functions of each module can be implemented in the same or multiple software and / or hardware.

[0107] The device of the above embodiment is used to implement the corresponding text file generation method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.

[0108] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and runnable on the processor, wherein when the processor executes the program, the text loading method and the text file generation method described in any of the above embodiments are implemented.

[0109] FIG6 shows a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present disclosure. The device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other within the device via the bus 1050.

[0110] The processor 1010 can be implemented using a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.

[0111] The memory 1020 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage devices, dynamic storage devices, etc. The memory 1020 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1020 and is called and executed by the processor 1010.

[0112] The input / output interface 1030 is used to connect input / output modules to implement information input and output. The input / output modules can be configured as components within the device (not shown in the figure) or can be externally connected to the device to provide corresponding functions. Input devices may include a keyboard, mouse, touch screen, microphone, various sensors, etc., and output devices may include a display, speaker, vibrator, indicator light, etc.

[0113] The communication interface 1040 is used to connect to a communication module (not shown) to enable communication between the device and other devices. The communication module can communicate via a wired method (such as USB, network cable, etc.) or a wireless method (such as mobile network, WiFi, Bluetooth, etc.).

[0114] The bus 1050 comprises a pathway for transmitting information between the various components of the device (eg, the processor 1010 , the memory 1020 , the input / output interface 1030 , and the communication interface 1040 ).

[0115] It should be noted that although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040, and the bus 1050, in a specific implementation, the device may also include other components necessary for normal operation. In addition, it will be understood by those skilled in the art that the above device may only include the components necessary to implement the embodiments of this specification, and does not necessarily include all the components shown in the figure.

[0116] The electronic device of the above embodiment is used to implement the corresponding text loading method and text file generation method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0117] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable the computer to execute the text loading method and text file generation method described in any of the above embodiments.

[0118] The computer-readable media of this embodiment include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.

[0119] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the text loading method and text file generation method described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0120] Based on the same inventive concept, corresponding to the text loading method and text file generation method described in any of the above embodiments, the present disclosure also provides a computer program product, which includes computer program instructions. In some embodiments, the computer program instructions can be executed by one or more processors of a computer so that the computer and / or the processor executes the text loading method and text file generation method. Corresponding to the execution subject corresponding to each step in each embodiment of the text loading method and text file generation method, the processor that executes the corresponding step may belong to the corresponding execution subject.

[0121] The computer program product of the above embodiment is used to enable the computer and / or the processor to execute the text loading method and text file generation method described in any of the above embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0122] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present application (including the claims) is limited to these examples. Within the scope of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present application as described above, which are not provided in detail for the sake of simplicity.

[0123] In addition, for simplicity of description and discussion, and in order not to make the embodiment of the application difficult to understand, the known power supply / ground connection with integrated circuit (IC) chip and other components may or may not be shown in the accompanying drawings provided. In addition, the device can be shown in the form of a block diagram to avoid making the embodiment of the application difficult to understand, and this also takes into account the following fact, that is, the details of the embodiment of these block diagram devices are highly dependent on the platform to be implemented in the embodiment of the application (that is, these details should be fully within the scope of understanding of those skilled in the art). When specific details (for example, circuit) are set forth to describe exemplary embodiments of the application, it will be apparent to those skilled in the art that the embodiment of the application can be implemented without these specific details or when these specific details are changed. Therefore, these descriptions should be considered to be illustrative rather than restrictive.

[0124] Although the present invention has been described in conjunction with specific embodiments thereof, many alternatives, modifications, and variations of these embodiments will be apparent to those skilled in the art based on the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may utilize the embodiments discussed.

[0125] The embodiments of the present application are intended to cover all such substitutions, modifications, and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the scope of protection of this application.

Claims

1. A method for loading text, comprising: In response to an event of loading a target text, obtaining a binary text file to be decoded; The binary text file includes a key value feature code and multilingual text corresponding to the key value; wherein the key value is used to express the semantics of the multilingual text; and a first separator exists between any adjacent key value feature codes and any adjacent multilingual text; Determine, according to the target text and the binary file, a feature code of a key value corresponding to the target text and a corresponding multilingual text; The target text is loaded according to the feature code of the key value corresponding to the target text and the corresponding multilingual text.

2. The method according to claim 1, wherein: The binary text file also includes: The meta information field is used to record the position and length of the feature code, and the position and length of different languages ​​in the multi-language text; The second separator is used to separate the feature code and the multilingual text.

3. The method according to claim 2, wherein: The step of determining the feature code of the key value corresponding to the target text and the corresponding multilingual text according to the target text and the binary file includes: The position and length of the feature code recorded in the meta-information field are read, and the position and length of the multilingual text corresponding to the language of the target text are read to obtain the feature code corresponding to the target text and the multilingual text corresponding to the target text.

4. The method according to claim 3, wherein: The step of reading the position and length of the feature code recorded in the meta information field, and reading the position and length of the multilingual text corresponding to the language of the target text, to obtain the feature code corresponding to the target text and the multilingual text corresponding to the target text, includes: The position and length of the feature code recorded in the meta-information field are read in parallel, and the position and length of the multilingual text corresponding to the language of the target text are read to obtain the feature code corresponding to the target text and the multilingual text corresponding to the target text.

5. The method according to claim 1, wherein: The characteristic code of the key value is obtained by encrypting the key value.

6. A method for generating a text file, comprising: Determining key values ​​and multilingual texts corresponding to different languages ​​from the acquired multilingual text; the key values ​​are used to express the semantics of the multilingual texts; Extracting feature codes of the key values, and separating each feature code by a first separator; Separate each of the multilingual characters by the first separator; A binary text file is generated according to the feature code, the multilingual text and the first separator.

7. The method according to claim 6, wherein: Determining the key value from the obtained multilingual text includes: Determining the target language text corresponding to the target language from the multilingual copy; The key value is determined based on the target language.

8. The method according to claim 6 or 7, wherein: The multilingual copy includes a first language copy; wherein the first language copy is used to represent a word in singular form; The step of determining the key value and the multilingual text corresponding to different languages ​​from the obtained multilingual copy includes: Determine the key value and the multilingual text corresponding to different languages ​​from the first language copy.

9. The method according to claim 6, wherein: The binary text file includes a meta information field; The method further comprises: Writing the feature code and the multilingual text into the meta information field at corresponding positions after arranging them in a preset manner; The feature code and the length of the multi-language text are written into the meta information field.

10. The method according to claim 9, wherein: The binary text file also includes a second separator; the feature code and the multilingual text are separated by the second separator.

11. The method according to claim 10, wherein: The step of generating a binary text file according to the feature code, the multilingual text and the first separator includes: The meta information field, the feature code, the first separator, the second separator and the multilingual text are arranged in a preset manner, and a binary operation is performed to obtain the binary text file.

12. The method according to claim 6, wherein: The extracting the feature code of the key value includes: encrypting the key value using a preset encryption algorithm to obtain the feature code of the key value.

13. A text loading device, comprising: An acquisition module, used for acquiring a binary text file to be decoded in response to an event of loading a target text; The binary text file includes a key value feature code and multilingual text corresponding to the key value; wherein the key value is used to express the semantics of the multilingual text; and a first separator exists between any adjacent key value feature codes and any adjacent multilingual text; A first determination module, used for determining a feature code of a key value corresponding to the target text and a corresponding multilingual text according to the target text and the binary file; The loading module is used to load the target text according to the feature code of the key value corresponding to the target text and the corresponding multilingual text.

14. The device according to claim 13, wherein: The binary text file also includes: The meta information field is used to record the position and length of the feature code, and the position and length of different languages ​​in the multi-language text; The second separator is used to separate the feature code and the multilingual text.

15. The device according to claim 14, wherein: The first determining module comprises: The reading unit is used to read the position and length of the feature code recorded in the meta-information field, and read the position and length of the multilingual text corresponding to the language of the target text, so as to obtain the feature code corresponding to the target text and the multilingual text corresponding to the target text.

16. A device for generating a text file, comprising: A second determination module is used to determine key values ​​and multilingual texts corresponding to different languages ​​from the acquired multilingual text; the key values ​​are used to express the semantics of the multilingual texts; An extraction module, used for extracting the feature code of the key value, and separating each feature code by a first separator; A separation module, used for separating each of the multilingual characters by the first separator; A generating module is used to generate a binary text file according to the feature code, the multilingual text and the first separator.

17. The device according to claim 16, wherein: The extraction module comprises: A first determining unit, configured to determine a target language text corresponding to a target language from the multilingual copy; The second determining unit is used to determine the key value based on the target language.

18. The device according to claim 16, wherein: The multilingual copy includes a first language copy; wherein the first language copy is used to represent a word in singular form; The second determining module comprises: The third determining unit is used to determine key values ​​and multilingual texts corresponding to different languages ​​from the first language text.

19. The device according to claim 16, wherein: The binary text file includes a meta information field; The device further comprises: A position writing module, used for writing the feature code and the multilingual text into the meta information field at corresponding positions after the feature code and the multilingual text are arranged in a preset manner; The length writing module is used to write the length of the feature code and the multi-language text into the meta information field.

20. The device according to claim 16, wherein: The binary text file also includes a second separator; the feature code and the multilingual text are separated by the second separator.

21. The device according to claim 20, wherein: The generation module comprises: The binary unit is used to arrange the meta information field, the feature code, the first separator, the second separator and the multi-language text in a preset manner, and perform binary operations to obtain the binary text file.

22. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 12 is implemented.

23. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to enable a computer to execute the method according to any one of claims 1 to 12.

24. A computer program product, comprising computer program instructions, which, when executed on a computer, cause the computer to execute the method according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • Character loading method, character file generation method and related equipment

    CN120066631A

  • Multi-language processing method and device

    CN110262800A

  • Text processing method and device and electronic equipment

    CN115129406A

  • Software interface multi-language generation method and device and computing equipment

    CN115686693A

  • Common multi-language text management in a business-oriented software framework

    US20140172409A1