A method and device for constructing a simplified and traditional Chinese conversion tool

By constructing a simplified traditional Chinese conversion array and a simplified traditional Chinese conversion array, simplified Chinese characters and traditional Chinese characters are stored in the corresponding array, solving the problem of low conversion efficiency caused by the large simplified traditional Chinese font library in the existing technology, and achieving efficient simplified traditional Chinese conversion.

CN114254591BActive Publication Date: 2025-04-25HUBEI TIANRONGXIN NETWORK SECURITY TECH CO LTD +3
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111580581.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-22
Publication Date
2025-04-25
Estimated Expiration
2041-12-22

AI Technical Summary

Technical Problem

In the existing simplified and traditional Chinese conversion methods, the larger the simplified and traditional Chinese font library, the longer the search conversion time, resulting in a decrease in conversion efficiency.

Method used

By configuring the simplified Chinese font library and the traditional Chinese font library, we build a simplified Chinese conversion array and a simplified Chinese conversion array, obtain simplified Chinese and traditional Chinese characters of the same Chinese character, and store Chinese characters of different fonts into the corresponding array to improve the conversion speed.

Benefits of technology

The conversion speed of simplified traditional Chinese is improved, and the conversion rate is not affected by the size of simplified traditional Chinese font library, while ensuring the conversion accuracy, thereby improving the conversion efficiency of simplified traditional Chinese is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114254591B_ABST
    Figure CN114254591B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a method and device for constructing a simplified-traditional conversion tool, which relates to the field of data processing technology. The method for constructing the simplified-traditional conversion tool includes: configuring a simplified character library and a traditional character library; then constructing a simplified-traditional conversion array and a traditional-simplified conversion array; obtaining the simplified and traditional characters of the same Chinese character in the simplified character library and the traditional character library; then determining the Chinese character whose simplified and traditional characters are different as the target Chinese character; finally storing the traditional character of the target Chinese character in the simplified-traditional conversion array, and storing the simplified character of the target Chinese character in the traditional-simplified conversion array, which can improve the simplified-traditional conversion speed, and the conversion rate is not affected by the size of the simplified-traditional character library, and the conversion accuracy is guaranteed while ensuring the conversion rate, which is conducive to improving the simplified-traditional conversion efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a method and device for constructing a simplified-traditional conversion tool. Background Art

[0002] Simplified-Traditional conversion is an important part of data leakage prevention security technology. Because Chinese is divided into simplified and traditional, by converting Chinese texts into simplified and traditional, it is possible to maximize the detection of illegal data and effectively prevent data leakage. At present, the main implementation method for simplified-Traditional conversion is to create a hashmap of simplified and traditional characters, such as using the map in C++STL to store the simplified and traditional Chinese character library, and to achieve the function of simplified-Traditional conversion by searching for the simplified and traditional characters that need to be converted in the map structure and then replacing them. However, in practice, it is found that in the existing method, the larger the simplified and traditional character library, the longer the search and conversion time, thereby reducing the efficiency of simplified-Traditional conversion. Summary of the invention

[0003] The purpose of the embodiments of the present application is to provide a method and device for constructing a simplified-traditional conversion tool, which can improve the simplified-traditional conversion speed, and the conversion rate is not affected by the size of the simplified-traditional character library. The conversion accuracy is guaranteed while ensuring the conversion rate, which is beneficial to improving the simplified-traditional conversion efficiency.

[0004] The first aspect of the embodiment of the present application provides a method for constructing a simplified Chinese-Traditional Chinese conversion tool, comprising:

[0005] Configure simplified Chinese and traditional Chinese character libraries;

[0006] Construct the simplified-traditional conversion array and the traditional-simplified conversion array;

[0007] Obtaining the simplified Chinese character and the traditional Chinese character of the same Chinese character in the simplified Chinese character library and the traditional Chinese character library;

[0008] Determine the Chinese character that is different from the simplified Chinese character and the traditional Chinese character as the target Chinese character;

[0009] The traditional Chinese characters of the target Chinese characters are stored in the traditional-simplified conversion array, and the simplified Chinese characters of the target Chinese characters are stored in the traditional-simplified conversion array.

[0010] In the above implementation process, a simplified Chinese character library and a traditional Chinese character library are configured; then a simplified-traditional conversion array and a traditional-simplified conversion array are constructed; in the simplified Chinese character library and the traditional Chinese character library, the simplified Chinese character and the traditional Chinese character of the same Chinese character are obtained; then the Chinese character whose simplified Chinese character and traditional Chinese character are different are determined as the target Chinese character; finally, the traditional Chinese character of the target Chinese character is stored in the simplified-traditional conversion array, and the simplified Chinese character of the target Chinese character is stored in the traditional-simplified conversion array, which can improve the simplified-traditional conversion speed, and the conversion rate is not affected by the size of the simplified-traditional character library. The conversion accuracy is guaranteed while the conversion rate is guaranteed, which is beneficial to improving the simplified-traditional conversion efficiency.

[0011] Furthermore, the step of storing the traditional Chinese characters of the target Chinese characters into the simplified-traditional conversion array comprises:

[0012] Obtaining a first encoding value of the traditional Chinese character of the target Chinese character, and obtaining a first decimal value corresponding to the first encoding value;

[0013] Calculating a first difference between the first decimal value and a preset value;

[0014] Determine the first position of the traditional Chinese character of the target Chinese character in the simplified-traditional conversion array according to the first difference;

[0015] The traditional Chinese character of the target Chinese character is stored in the simplified-traditional conversion array according to the first position.

[0016] Furthermore, the step of storing the simplified Chinese character of the target Chinese character into the traditional-simplified conversion array comprises:

[0017] Obtaining a second encoding value of the simplified Chinese character of the target Chinese character, and obtaining a second decimal value corresponding to the second encoding value;

[0018] Calculating a second difference between the second decimal value and a preset value;

[0019] Determine a second position of the simplified Chinese character of the target Chinese character in the traditional-simplified conversion array according to the second difference;

[0020] According to the second position, the simplified Chinese character of the target Chinese character is stored in the traditional-simplified conversion array.

[0021] Furthermore, after storing the simplified Chinese characters of the target Chinese characters in the traditional-simplified conversion array, the method further comprises:

[0022] Obtain the characters to be detected and the requirements for conversion between simplified and traditional Chinese characters in the target data;

[0023] According to the simplified-traditional conversion requirement, the simplified-traditional conversion array or the traditional-simplified conversion array is determined as the application conversion array;

[0024] Convert the text to be detected into simplified Chinese or traditional Chinese according to the application conversion array to obtain converted text;

[0025] When it is detected that the converted text is a sensitive text, the target data is intercepted.

[0026] Furthermore, the text to be detected is converted into a simplified Chinese character according to the application conversion array to obtain a converted text, including:

[0027] Obtain the Chinese character encoding value of the text to be detected;

[0028] Calculate the difference between the Chinese character encoding value and a preset value;

[0029] Determine the position of the to-be-detected text in the application conversion array according to the difference;

[0030] The converted text corresponding to the text to be detected is extracted according to the position.

[0031] A second aspect of an embodiment of the present application provides a device for constructing a simplified Chinese-Traditional Chinese conversion tool, the device for constructing the simplified Chinese-Traditional Chinese conversion tool comprising:

[0032] A configuration unit, used for configuring a simplified Chinese character library and a traditional Chinese character library;

[0033] A construction unit, used to construct a simplified-traditional conversion array and a traditional-simplified conversion array;

[0034] An acquisition unit, used for acquiring the simplified Chinese character and the traditional Chinese character of the same Chinese character from the simplified Chinese character library and the traditional Chinese character library;

[0035] A determination unit, used for determining the Chinese character that is different from the simplified Chinese character and the traditional Chinese character as a target Chinese character;

[0036] A first storage unit, used for storing the traditional Chinese character of the target Chinese character into the simplified-traditional conversion array;

[0037] The second storage unit is used to store the simplified Chinese character of the target Chinese character in the traditional-simplified conversion array.

[0038] In the above implementation process, the configuration unit configures the simplified Chinese character library and the traditional Chinese character library; then the construction unit constructs the simplified-traditional conversion array and the traditional-simplified conversion array; the acquisition unit obtains the simplified Chinese character and the traditional Chinese character of the same Chinese character in the simplified Chinese character library and the traditional Chinese character library; the determination unit then determines the Chinese character that is different in simplified Chinese character and traditional Chinese character as the target Chinese character; finally, the first storage unit stores the traditional Chinese character of the target Chinese character in the simplified-traditional conversion array, and the second storage unit stores the simplified Chinese character of the target Chinese character in the traditional-simplified conversion array, which can improve the simplified-traditional conversion speed, and the conversion rate is not affected by the size of the simplified-traditional character library. The conversion accuracy is guaranteed while the conversion rate is guaranteed, which is beneficial to improving the simplified-traditional conversion efficiency.

[0039] Furthermore, the first deposit unit includes:

[0040] A first acquisition subunit is used to acquire a first encoding value of the traditional Chinese character of the target Chinese character, and acquire a first decimal value corresponding to the first encoding value;

[0041] A first calculation subunit, configured to calculate a first difference between the first decimal value and a preset value;

[0042] A first determining subunit, configured to determine a first position of the traditional Chinese character of the target Chinese character in the simplified-traditional conversion array according to the first difference;

[0043] The first storage subunit is used to store the traditional Chinese character of the target Chinese character into the simplified-traditional conversion array according to the first position.

[0044] Furthermore, the second deposit unit includes:

[0045] A second acquisition subunit is used to acquire a second encoding value of the simplified Chinese character of the target Chinese character, and acquire a second decimal value corresponding to the second encoding value;

[0046] A second calculation subunit, used for calculating a second difference between the second decimal value and a preset value;

[0047] A second determining subunit is used to determine a second position of the simplified Chinese character of the target Chinese character in the traditional-simplified conversion array according to the second difference;

[0048] The second storage subunit is used to store the simplified Chinese character of the target Chinese character into the traditional-simplified conversion array according to the second position.

[0049] A third aspect of an embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the method for constructing a simplified-traditional conversion tool as described in any one of the first aspect of the embodiments of the present application.

[0050] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium storing computer program instructions. When the computer program instructions are read and executed by a processor, the method for constructing a simplified-traditional conversion tool described in any one of the first aspect of the embodiment of the present application is executed. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0052] Figure 1 A flowchart of a method for constructing a simplified Chinese-Traditional Chinese conversion tool provided in an embodiment of the present application;

[0053] Figure 2 A schematic diagram of the structure of a device for constructing a simplified Chinese to traditional Chinese conversion tool provided in an embodiment of the present application;

[0054] Figure 3 A schematic diagram of the practical application principle of a simplified-traditional Chinese conversion tool provided in an embodiment of the present application. DETAILED DESCRIPTION

[0055] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0056] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0057] Example 1

[0058] Please see Figure 1 , Figure 1 A flowchart of a method for constructing a simplified Chinese-traditional Chinese conversion tool is provided for an embodiment of the present application. The method for constructing the simplified Chinese-traditional Chinese conversion tool includes:

[0059] S101. Configure a simplified Chinese character library and a traditional Chinese character library.

[0060] In the embodiment of the present application, the execution subject of the method can be a computing device such as a computer or a server, and no limitation is made in this embodiment.

[0061] In the embodiment of the present application, the execution subject of the method can also be a smart device such as a smart phone, a tablet computer, etc., and there is no limitation on this in the present embodiment.

[0062] In the embodiment of the present application, a character library file with one-to-one correspondence between simplified and traditional Chinese is pre-configured, and the character library file includes a simplified character library and a traditional character library. Currently, there are 20,902 basic commonly used Chinese characters, and the Unicode encoding range is 0x4E00-0x9FA5, which is not limited to the embodiment of the present application.

[0063] S102, constructing a simplified-traditional conversion array and a traditional-simplified conversion array.

[0064] In the embodiment of the present application, two arrays are constructed, and the array elements in the array are two bytes, and the default value is 0, which is used to store Unicode (UCS2 encoding) Chinese data.

[0065] S103: Obtain the simplified Chinese character and the traditional Chinese character of the same Chinese character from the simplified Chinese character library and the traditional Chinese character library.

[0066] S104, determining the Chinese characters that are different in simplified Chinese and traditional Chinese as target Chinese characters.

[0067] In the embodiment of the present application, the simplified Chinese character library and the traditional Chinese character library are compared to see whether the simplified Chinese character and the traditional Chinese character of the same Chinese character are the same. If the simplified Chinese character and the traditional Chinese character are the same, they are not entered into the two arrays constructed above.

[0068] In the embodiment of the present application, if the simplified Chinese character and the traditional Chinese character are different, the Chinese character is determined as the target Chinese character.

[0069] S105: Obtain a first encoding value of the traditional Chinese character of the target Chinese character, and obtain a first decimal value corresponding to the first encoding value.

[0070] In the embodiment of the present application, the first encoding value may specifically be UCS2 encoding.

[0071] S106: Calculate a first difference between the first decimal value and a preset value.

[0072] In the embodiment of the present application, the preset value may specifically be 0x4E00, which is -45568 when converted into decimal, and this embodiment of the present application is not limited to this.

[0073] In the embodiment of the present application, the first difference is the first encoding value of the traditional Chinese character minus the decimal value of 0x4E00.

[0074] S107, determining the first position of the traditional Chinese character of the target Chinese character in the simplified-traditional conversion array according to the first difference.

[0075] S108. Store the traditional Chinese character of the target Chinese character into the simplified-traditional conversion array according to the first position.

[0076] In the embodiment of the present application, the above steps S105 to S108 are implemented to store the traditional Chinese characters of the target Chinese characters into the simplified-traditional conversion array.

[0077] In the embodiment of the present application, in the simplified-traditional conversion array, the traditional Chinese character corresponding to the target Chinese character is stored in the position corresponding to the decimal value of the simplified Chinese character encoding value minus 0x4E00 in the array.

[0078] S109, obtaining a second encoding value of the simplified Chinese character of the target Chinese character, and obtaining a second decimal value corresponding to the second encoding value.

[0079] In the embodiment of the present application, the second encoding value may specifically be UCS2 encoding.

[0080] S110, calculating a second difference between the second decimal value and the preset value.

[0081] S111. Determine the second position of the simplified Chinese character of the target Chinese character in the traditional-simplified conversion array according to the second difference.

[0082] S112. Store the simplified version of the target Chinese character into the traditional-simplified conversion array according to the second position.

[0083] In the embodiment of the present application, in the traditional-simplified conversion array, the simplified character corresponding to the target Chinese character is stored in the position corresponding to the decimal value of the traditional character encoding value minus 0x4E00 in the array.

[0084] In the embodiment of the present application, the above steps S109 to S112 are implemented to store the simplified Chinese characters of the target Chinese characters in the traditional-simplified conversion array.

[0085] In the embodiment of the present application, an array is a simplified-traditional conversion array, the array subscript is the decimal value of the simplified character encoding value minus 0x4E00, and the data element is the traditional character corresponding to the simplified character.

[0086] In the embodiment of the present application, another array is a traditional-simplified conversion array, the array subscript is the decimal value of the traditional character encoding value minus 0x4E00, and the data element is the simplified character corresponding to the simplified character.

[0087] S113, obtaining the characters to be detected and the simplified and traditional Chinese conversion requirements in the target data.

[0088] In the embodiment of the present application, the Chinese characters in the target data are converted from simplified to traditional Chinese according to the conversion requirements. If the conversion requirement is to convert simplified Chinese characters into traditional Chinese, the decimal number 0x4E00 is subtracted from the text to be detected, and then the decimal number subscript is searched in the corresponding simplified to traditional conversion array to see if it is non-zero. If it is non-zero, the value of the address array is the traditional Chinese character corresponding to the text to be detected; the conversion from traditional Chinese to simplified Chinese is similar, except that the value is searched from the array corresponding to the conversion from traditional Chinese to simplified Chinese.

[0089] S114. Determine the simplified-to-traditional conversion array or traditional-to-simplified conversion array as the application conversion array according to the simplified-to-traditional conversion requirement.

[0090] S115. Perform simplified-to-traditional conversion on the text to be detected according to the application conversion array to obtain the converted text.

[0091] As an optional implementation manner, performing simplified-to-traditional conversion on the text to be detected according to the application conversion array to obtain the converted text includes:

[0092] Obtain the Chinese character encoding value of the text to be detected;

[0093] Calculate the difference between the Chinese character encoding value and a preset value;

[0094] Determine the position of the text to be detected in the application conversion array according to the difference;

[0095] Extract the converted text corresponding to the text to be detected according to the position.

[0096] S116. When it is detected that the converted text is sensitive text, intercept the target data.

[0097] In the embodiment of the present application, this method can solve the problem that in the simplified-to-traditional conversion, the larger the font library capacity, the more accurate the conversion result, but the lower the conversion rate. It can realize the mutual conversion between simplified and traditional Chinese characters in the shortest time, and the conversion rate is not affected by the size of the simplified and traditional Chinese character libraries, and can ensure the conversion accuracy while ensuring the conversion rate.

[0098] In the embodiment of the present application, for example, when the data keyword that actually needs to prevent leakage is the two characters "China", and when the data to be detected is "日記", first subtract 0x4E00 from the Unicode encoding value 0x65E5 corresponding to the character "日" to get the decimal data 6117, and find the value corresponding to the subscript 6117 in the array for converting traditional Chinese to simplified Chinese. It is found that it is the default value 0, so no conversion is required. Perform the same processing on the character "記", and it is found that the value in the corresponding array is non-zero, so use this value to replace the character "記". Finally, the text to be detected will be modified to "日记", which will be detected and intercepted by the system, as Figure 3 shown.

[0099] In the embodiment of the present application, this method generates a double array with subscripts being the decimal values obtained by subtracting 0x4E00 from the encoding values because the Unicode encoding of common Chinese characters is continuous from 0x4E00 to 0x9FA5. And the time complexity of querying through the subscript in the array is the lowest, which can greatly improve the conversion rate between simplified Chinese characters and traditional Chinese characters;

[0100] In the embodiment of the present application, the method can be used in various systems that require simplified and traditional Chinese conversion to improve the performance of the system while improving the efficiency of simplified and traditional Chinese conversion.

[0101] In the embodiment of the present application, the method can improve the accuracy of data leakage prevention by converting between simplified and traditional Chinese.

[0102] It can be seen that the method for constructing the simplified-traditional conversion tool described in this embodiment can improve the simplified-traditional conversion speed, and the conversion rate is not affected by the size of the simplified-traditional character library. The conversion accuracy is guaranteed while ensuring the conversion rate, which is beneficial to improving the simplified-traditional conversion efficiency.

[0103] Example 2

[0104] Please see Figure 2 , Figure 2 This is a schematic diagram of a structure of a device for constructing a simplified Chinese to traditional Chinese conversion tool provided in an embodiment of the present application. Figure 2 As shown, the construction device of the simplified-traditional conversion tool includes:

[0105] Configuration unit 210, used to configure simplified Chinese character library and traditional Chinese character library;

[0106] A construction unit 220, used to construct a simplified-traditional conversion array and a traditional-simplified conversion array;

[0107] The acquisition unit 230 is used to acquire the simplified Chinese character and the traditional Chinese character of the same Chinese character in the simplified Chinese character library and the traditional Chinese character library;

[0108] A determination unit 240, configured to determine a Chinese character whose simplified Chinese character and traditional Chinese character are different as a target Chinese character;

[0109] The first storage unit 250 is used to store the traditional Chinese characters of the target Chinese characters into the simplified-traditional conversion array;

[0110] The second storage unit 260 is used to store the simplified Chinese character of the target Chinese character in the traditional-simplified conversion array.

[0111] As an optional implementation, the first deposit unit 250 includes:

[0112] The first acquisition subunit 251 is used to acquire a first encoding value of the traditional Chinese character of the target Chinese character, and acquire a first decimal value corresponding to the first encoding value;

[0113] A first calculation subunit 252, configured to calculate a first difference between a first decimal value and a preset value;

[0114] A first determining subunit 253 is used to determine the first position of the traditional Chinese character of the target Chinese character in the simplified-traditional conversion array according to the first difference;

[0115] The first storage subunit 254 is used to store the traditional Chinese character of the target Chinese character into the simplified-traditional conversion array according to the first position.

[0116] As an optional implementation, the second deposit unit 260 includes:

[0117] The second acquisition subunit 261 is used to acquire the second encoding value of the simplified Chinese character of the target Chinese character, and acquire the second decimal value corresponding to the second encoding value;

[0118] A second calculation subunit 262, configured to calculate a second difference between the second decimal value and the preset value;

[0119] A second determining subunit 263 is used to determine the second position of the simplified Chinese character of the target Chinese character in the traditional-simplified conversion array according to the second difference;

[0120] The second storage subunit 264 is used to store the simplified Chinese character of the target Chinese character into the traditional-simplified conversion array according to the second position.

[0121] As an optional implementation, the acquisition unit 230 is further used to acquire the characters to be detected and the simplified / traditional conversion requirements in the target data after storing the simplified characters of the target Chinese characters in the traditional / simplified conversion array;

[0122] The determination unit 240 is further configured to determine the simplified-traditional conversion array or the traditional-simplified conversion array as the application conversion array according to the simplified-traditional conversion requirement;

[0123] The construction device of the simplified-traditional conversion tool also includes:

[0124] A conversion unit 270, configured to convert the detected character into a simplified or traditional character according to the application conversion array to obtain a converted character;

[0125] The interception unit 280 is used to intercept the target data when it is detected that the converted text is a sensitive text.

[0126] As an optional implementation, the conversion unit 270 includes:

[0127] The third acquisition subunit 271 is used to obtain the Chinese character encoding value of the text to be detected;

[0128] The third calculation subunit 272 is used to calculate the difference between the Chinese character encoding value and the preset value;

[0129] The third determining subunit 273 is used to determine the position of the to-be-detected text in the application conversion array according to the difference;

[0130] The extraction subunit 274 is used to extract the conversion text corresponding to the to-be-detected text according to the position.

[0131] In the embodiment of the present application, the device can solve the problem that the larger the font library capacity, the more accurate the conversion result, but the lower the conversion rate in the conversion between simplified and traditional Chinese. The conversion between simplified and traditional Chinese characters can be achieved in the shortest time, and the conversion rate is not affected by the size of the simplified and traditional Chinese font library, and the conversion accuracy can be guaranteed while ensuring the conversion rate.

[0132] In the embodiments of the present application, the explanation of the construction device of the simplified-traditional conversion tool can refer to the description in Embodiment 1, and no further elaboration will be given in this embodiment.

[0133] It can be seen that the construction device of the simplified-traditional conversion tool described in this embodiment can improve the simplified-traditional conversion speed, and the conversion rate is not affected by the size of the simplified-traditional character library. The conversion accuracy is guaranteed while ensuring the conversion rate, which is beneficial to improving the simplified-traditional conversion efficiency.

[0134] An embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the method for constructing a simplified-traditional conversion tool in Embodiment 1 of the present application.

[0135] The embodiment of the present application provides a computer-readable storage medium storing computer program instructions. When the computer program instructions are read and executed by a processor, the method for constructing a simplified-traditional conversion tool in Embodiment 1 of the present application is executed.

[0136] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0137] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0138] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0139] The above description is only an embodiment of the present application and is not intended to limit the scope of protection of the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application. It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.

[0140] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0141] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

Claims

1. A method for constructing a simplified Chinese to traditional Chinese conversion tool, characterized in that: include: Configure simplified Chinese and traditional Chinese character libraries; Construct the simplified-traditional conversion array and the traditional-simplified conversion array; Obtaining the simplified Chinese character and the traditional Chinese character of the same Chinese character in the simplified Chinese character library and the traditional Chinese character library; Determine the Chinese character that is different from the simplified Chinese character and the traditional Chinese character as the target Chinese character; Storing the traditional Chinese characters of the target Chinese characters in the traditional-simplified conversion array, and storing the simplified Chinese characters of the target Chinese characters in the traditional-simplified conversion array; The step of storing the traditional Chinese characters of the target Chinese characters into the simplified-traditional conversion array comprises: Obtaining a first encoding value of the traditional Chinese character of the target Chinese character, and obtaining a first decimal value corresponding to the first encoding value; Calculating a first difference between the first decimal value and a preset value; Determine the first position of the traditional Chinese character of the target Chinese character in the simplified-traditional conversion array according to the first difference; The traditional Chinese character of the target Chinese character is stored in the simplified-traditional conversion array according to the first position.

2. The method for constructing a simplified Chinese to traditional Chinese conversion tool according to claim 1, characterized in that: The step of storing the simplified Chinese character of the target Chinese character into the traditional-simplified conversion array comprises: Obtaining a second encoding value of the simplified Chinese character of the target Chinese character, and obtaining a second decimal value corresponding to the second encoding value; Calculating a second difference between the second decimal value and a preset value; Determine a second position of the simplified Chinese character of the target Chinese character in the traditional-simplified conversion array according to the second difference; According to the second position, the simplified Chinese character of the target Chinese character is stored in the traditional-simplified conversion array.

3. The method for constructing a simplified Chinese to traditional Chinese conversion tool according to claim 1, characterized in that: After storing the simplified Chinese characters of the target Chinese characters in the traditional-simplified conversion array, the method further comprises: Obtain the characters to be detected and the requirements for conversion between simplified and traditional Chinese characters in the target data; According to the simplified-traditional conversion requirement, the simplified-traditional conversion array or the traditional-simplified conversion array is determined as the application conversion array; Convert the text to be detected into simplified Chinese or traditional Chinese according to the application conversion array to obtain converted text; When it is detected that the converted text is a sensitive text, the target data is intercepted.

4. The method for constructing a simplified Chinese-Traditional Chinese conversion tool according to claim 3, characterized in that: The text to be detected is converted into a simplified Chinese character according to the application conversion array to obtain a converted text, including: Obtain the Chinese character encoding value of the text to be detected; Calculate the difference between the Chinese character encoding value and a preset value; Determine the position of the to-be-detected text in the application conversion array according to the difference; The converted text corresponding to the text to be detected is extracted according to the position.

5. A device for constructing a simplified Chinese-traditional Chinese conversion tool, characterized in that: The construction device of the simplified / traditional conversion tool comprises: A configuration unit, used for configuring a simplified Chinese character library and a traditional Chinese character library; A construction unit, used to construct a simplified-traditional conversion array and a traditional-simplified conversion array; An acquisition unit, used for acquiring the simplified Chinese character and the traditional Chinese character of the same Chinese character from the simplified Chinese character library and the traditional Chinese character library; A determination unit, used for determining the Chinese character that is different from the simplified Chinese character and the traditional Chinese character as a target Chinese character; A first storage unit, used for storing the traditional Chinese character of the target Chinese character into the simplified-traditional conversion array; A second storage unit is used to store the simplified Chinese character of the target Chinese character in the traditional-simplified conversion array; Wherein, the first deposit unit comprises: A first acquisition subunit is used to acquire a first encoding value of the traditional Chinese character of the target Chinese character, and acquire a first decimal value corresponding to the first encoding value; A first calculation subunit, configured to calculate a first difference between the first decimal value and a preset value; A first determining subunit, configured to determine a first position of the traditional Chinese character of the target Chinese character in the simplified-traditional conversion array according to the first difference; The first storage subunit is used to store the traditional Chinese character of the target Chinese character into the simplified-traditional conversion array according to the first position.

6. The device for constructing a simplified Chinese-Traditional Chinese conversion tool according to claim 5, characterized in that: The second deposit unit comprises: A second acquisition subunit is used to acquire a second encoding value of the simplified Chinese character of the target Chinese character, and acquire a second decimal value corresponding to the second encoding value; A second calculation subunit, used for calculating a second difference between the second decimal value and a preset value; A second determining subunit is used to determine a second position of the simplified Chinese character of the target Chinese character in the traditional-simplified conversion array according to the second difference; The second storage subunit is used to store the simplified Chinese character of the target Chinese character into the traditional-simplified conversion array according to the second position.

7. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the method for constructing a simplified-traditional conversion tool as described in any one of claims 1 to 4.

8. A readable storage medium, characterized in that: The readable storage medium stores computer program instructions, and when the computer program instructions are read and executed by a processor, the method for constructing a simplified-traditional conversion tool according to any one of claims 1 to 4 is executed.

Citation Information

Patent Citations

  • Quick-action Chinese character complex form-simplified from exchanging system

    CN1349184A