Data matching method, device, equipment and storage medium

By unifying the character encoding format and eliminating preset characters between the original text to be translated and the standard original text, the problem of matching failure caused by the differences between the original text to be translated and the standard original text in intelligent scanning translation is solved, and the accuracy and efficiency of translation are improved.

CN114638241BActive Publication Date: 2024-10-01ALIBABA (CHINA) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210323005.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-30
Publication Date
2024-10-01
Estimated Expiration
2042-03-30

AI Technical Summary

Technical Problem

In intelligent scanning translation products, there may be large differences in expression between the original text to be translated and the standard original text, resulting in matching failure and affecting translation efficiency and quality.

Method used

By unifying the character encoding format and eliminating preset characters between the original text to be translated and the standard original text, differences caused by writing habits and scanning operations are eliminated, so that the original text to be translated and the standard original text are as similar in expression as possible, and then Improve matching success rate.

Benefits of technology

It effectively improves the recall rate during the data matching process, avoids matching failures, and improves the accuracy and efficiency of translation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114638241B_ABST
    Figure CN114638241B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a data matching method, device, equipment and storage medium. The data matching method includes: obtaining a translation memory, the translation memory contains a sentence pair consisting of a standard original text and a corresponding translation; the standard original text is obtained by preprocessing the initial original text, wherein the preprocessing operation includes: character encoding format unification processing and / or preset character elimination processing; the preset characters are characters that do not affect the semantic integrity; obtaining the original text to be translated, and performing a preprocessing operation on the original text to be translated to obtain the processed original text to be translated; determining the matching standard original text that matches the processed original text to be translated from the standard original text, and determining the translation corresponding to the matching standard original text as the translation result of the original text to be translated. The embodiment of the present application can effectively improve the recall rate in the data matching process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a data matching method, apparatus, device and storage medium. Background Art

[0002] Intelligent scanning and translation products are usually equipped with a translation memory and a translation model. The translation memory contains a large number of sentence pairs consisting of standard original texts and corresponding translations; the translation model is used to translate the original text to be translated obtained through scanning and OCR (Optical Character Recognition).

[0003] In order to improve translation efficiency and quality, after obtaining the original text to be translated, it is usually matched with the standard original text in the translation memory. When the match is successful, the corresponding translation is output as the translation result; if the match fails, the translation task of the original text to be translated is completed through the translation model and the translation result is output.

[0004] Affected by factors such as writing habits (such as different uppercase and lowercase writing habits, etc.) and scanning operations (such as missing spaces, repeated letters, and cross-line scanning), even if the meaning is the same, the original text to be translated and the standard text may have significant differences in expression. Therefore, how to match the original text to be translated and the standard text to accurately obtain the translation of the original text to be translated is a problem that needs to be solved urgently. Summary of the invention

[0005] In view of this, embodiments of the present application provide a data matching method, apparatus, device and storage medium to at least partially solve the above problems.

[0006] According to a first aspect of an embodiment of the present application, a data matching method is provided, comprising:

[0007] Acquire a translation memory, wherein the translation memory contains a sentence pair consisting of a standard original text and a corresponding translation; the standard original text is obtained by performing a preprocessing operation on the initial original text, wherein the preprocessing operation includes: character encoding format unification processing and / or preset character elimination processing; the preset characters are characters that do not affect semantic integrity;

[0008] Acquire the original text to be translated, and perform the preprocessing operation on the original text to be translated to obtain the processed original text to be translated;

[0009] A matching standard original text that matches the processed original text to be translated is determined from the standard original text, and a translation corresponding to the matching standard original text is determined as a translation result of the original text to be translated.

[0010] According to a second aspect of an embodiment of the present application, another data matching method is provided, which is applied to a scanning pen, comprising:

[0011] Receiving an instruction for instructing text translation; and scanning a target area containing the original text to be translated according to the instruction to obtain a target image;

[0012] Performing text recognition on the target image to obtain the original text to be translated;

[0013] Performing a preprocessing operation on the original text to be translated to obtain a processed original text to be translated; wherein the preprocessing operation includes: character encoding format unification processing and / or preset character elimination processing; the preset characters are characters that do not affect the semantic integrity;

[0014] Acquire a translation memory; the translation memory contains sentence pairs consisting of standard original texts and corresponding translated texts; the standard original texts are obtained by performing the preprocessing operation on the initial original texts;

[0015] A matching standard original text that matches the processed original text to be translated is determined from the standard original text, and a translation corresponding to the matching standard original text is output as a translation result of the original text to be translated.

[0016] According to a third aspect of an embodiment of the present application, a data matching device is provided, including:

[0017] The first memory acquisition module is used to acquire a translation memory, wherein the translation memory contains a sentence pair consisting of a standard original text and a corresponding translation; the standard original text is obtained by performing a preprocessing operation on the initial original text, wherein the preprocessing operation includes: character encoding format unification processing and / or preset character elimination processing; the preset characters are characters that do not affect semantic integrity;

[0018] The module for obtaining the original text to be translated is used to obtain the original text to be translated and perform the preprocessing operation on the original text to be translated to obtain the processed original text to be translated;

[0019] The translation result determination module is used to determine a matching standard original text that matches the processed original text to be translated from the standard original text, and determine the translation corresponding to the matching standard original text as the translation result of the original text to be translated.

[0020] According to a fourth aspect of an embodiment of the present application, another data matching device is provided, located in a scanning pen, comprising:

[0021] An instruction receiving module is used to receive an instruction for instructing text translation; and according to the instruction, scan a target area containing the original text to be translated to obtain a target image;

[0022] A text recognition module, used to perform text recognition on the target image to obtain the original text to be translated;

[0023] A preprocessing module is used to perform a preprocessing operation on the original text to be translated to obtain the processed original text to be translated; wherein the preprocessing operation includes: character encoding format unification processing and / or preset character elimination processing; the preset characters are characters that do not affect the semantic integrity;

[0024] A second memory acquisition module is used to acquire a translation memory; the translation memory contains a sentence pair consisting of a standard original text and a corresponding translation; the standard original text is obtained by performing the preprocessing operation on the initial original text;

[0025] The result output module is used to determine a matching standard original text that matches the processed original text to be translated from the standard original text, and output a translation corresponding to the matching standard original text as a translation result of the original text to be translated.

[0026] According to the fifth aspect of the embodiments of the present application, there is provided an electronic device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the data matching method described in the first aspect or the second aspect.

[0027] According to a sixth aspect of an embodiment of the present application, a computer storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the data matching method as described in the first aspect is implemented.

[0028] According to the data matching method provided by the embodiment of the present application, the standard text stored in the translation memory is obtained after the original text is processed by character encoding format unification, and / or preset characters (characters that do not affect semantic integrity) are eliminated. Correspondingly, after the original text to be translated is obtained, the same preprocessing operation (fault-tolerant operation) is also performed on the obtained original text to be translated. The above preprocessing operation can effectively eliminate the difference in the expression form of characters with the same meaning caused by factors such as writing habits and scanning operations, so that the original text to be translated and the standard text with the same meaning are as similar or identical as possible in expression form. In this way, if the original text to be translated has the same meaning as the standard text, when matching the original text to be translated and the standard text after the above processing, the situation of matching failure (which should be determined, but actually failed to determine the matching standard text) can be effectively avoided. Therefore, the embodiment of the present application can effectively improve the recall rate in the data matching process. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0030] Figure 1 A flowchart of a data matching method according to Embodiment 1 of the present application;

[0031] Figure 2 for Figure 1 A schematic diagram of an example scenario in the illustrated embodiment;

[0032] Figure 3 A flowchart of a data matching method according to Embodiment 2 of the present application;

[0033] Figure 4 A schematic diagram of a data matching process provided according to Embodiment 2 of the present application;

[0034] Figure 5 A flowchart of a data matching method according to Embodiment 3 of the present application;

[0035] Figure 6 is a structural block diagram of a data matching device according to Embodiment 4 of the present application;

[0036] Figure 7 is a structural block diagram of a data matching device according to Embodiment 5 of the present application;

[0037] Figure 8 This is a schematic diagram of the structure of an electronic device according to Embodiment 6 of the present application. DETAILED DESCRIPTION

[0038] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the embodiments of the present application should fall within the scope of protection of the embodiments of the present application.

[0039] The specific implementation of the embodiment of the present application is further explained below in conjunction with the accompanying drawings of the embodiment of the present application.

[0040] Embodiment 1

[0041] Reference Figure 1 , Figure 1The following is a flowchart of a data matching method according to Embodiment 1 of the present application. Specifically, the data matching method provided in this embodiment includes the following steps:

[0042] Step 102, obtaining a translation memory, wherein the translation memory contains sentence pairs consisting of standard original texts and corresponding translated texts; the standard original texts are obtained by preprocessing the initial original texts.

[0043] The preprocessing operation includes: character encoding format unification processing and / or preset character elimination processing; the preset characters are characters that do not affect the semantic integrity.

[0044] The translation memory can usually be pre-collected, mainly used to improve the translation speed and make up for the shortcomings of the inaccurate real-time translation results of the translation model. In the embodiment of the present application, the original text and translation contained in the translation memory can be the content that is often involved in general scenarios, such as: the original text and corresponding translation of famous sayings, the original text and corresponding translation of ancient poems, the original text and corresponding translation of network hot words, etc., or it can be content that conforms to specific scenarios, such as: the original text and translation of professional terms that are usually involved in medical scenarios, the original text and translation that are usually involved in educational scenarios, etc.

[0045] Those skilled in the art will understand that the more sentence pairs a translation memory contains, the higher the probability of eventually matching a translation result from the translation memory, and the higher the translation accuracy and speed. In addition, in order to ensure the accuracy of translation and data matching, the length of the original text to be translated is generally small, so correspondingly, the content in the translation memory is usually also a relatively concise translation sentence pair.

[0046] The original text may be a text directly collected without the preprocessing operation in this application. For example, in the case of English-formatted famous quotes, the original text may be a string containing punctuation marks, space marks, carriage return marks, and both uppercase and lowercase letters.

[0047] The character encoding format unification processing in the embodiment of the present application may refer to unifying the characters (all characters or some preset characters) in the original text into a preset character encoding format. For example: unifying all punctuation marks in the original text into the English character encoding format (such as unifying the Chinese question mark "?" in the original text into the English question mark "?"; unifying the Chinese period "." in the original text into the English period "."); for another example, unifying all uppercase character symbols in the original text into lowercase character symbols, and so on.

[0048] The preset character elimination processing may refer to the operation of deleting the characters contained in the initial original text that do not affect the semantic integrity of the original text. Furthermore, the above-mentioned characters that do not affect the semantic integrity of the original text may include at least one of the following: sentence segmentation symbols (such as commas, periods, exclamation marks, double quotes, etc.), space characters, and carriage returns.

[0049] In the embodiments of the present application, the original text and the standard text are expressed in the same language, and the translation is expressed in another language. For example, in the scenario of Chinese-English translation, the original text and the standard text can be Chinese, and the translation can be English; in the scenario of Japanese-Korean translation, the original text and the standard text can be Japanese, and the translation can be Korean, etc. In the embodiments of the present application, the specific language form of the original text (the original text and the standard text) and the corresponding translation is not limited.

[0050] Step 104, obtaining the original text to be translated, and performing a preprocessing operation on the original text to be translated to obtain the processed original text to be translated.

[0051] In the embodiment of the present application, there is no limitation on the specific method of obtaining the original text to be translated. For example, it can be a character string directly input by the user, or it can be obtained by performing text recognition (OCR) on an image, and the above-mentioned image can be obtained by optical scanning or image acquisition of a target area containing the original text to be translated.

[0052] In the embodiment of the present application, in order to ensure the accuracy of the matching results, after obtaining the original text to be translated, the preprocessing operation performed on the above-mentioned text to be translated is the same operation as the preprocessing operation performed on the initial original text in step 102, and may specifically include: character encoding format unification processing and / or preset character elimination processing; the preset characters are characters that do not affect the semantic integrity.

[0053] Step 106: determining a matching standard original text that matches the processed original text to be translated from the standard original text, and determining a translation corresponding to the matching standard original text as a translation result of the original text to be translated.

[0054] Specifically, in order to simplify the operation process, the translation memory can be searched to see whether there is a standard original text that is exactly the same as the processed original text to be translated. If so, the above-mentioned completely matched (completely identical) standard original text can be determined as the matching standard original text, and then the translation corresponding to the matching standard original text can be determined as the translation result of the original text to be translated.

[0055] In addition, since the translation memory is usually collected in advance, and the collection process requires a lot of economic and time costs, the initial original text can be encrypted (encoded) after the above-mentioned preprocessing operation to obtain a standard original text. Correspondingly, the original text to be translated after the above-mentioned processing is also encrypted (encoded), and then the standard original text is compared with the encrypted original text to be translated. The standard original text that is exactly the same as the encrypted original text to be translated is determined as the matching standard original text, and then the translation corresponding to the matching standard original text is determined as the translation result of the original text to be translated.

[0056] In the embodiments of the present application, there is no limitation on the specific encryption processing (encoding processing) method. For example, the standard original text can be processed in reverse order (that is, the characters in the original text can be inverted, such as "ABC" can be inverted to "CBA"); a preset number of characters can be inserted into the original text according to a preset insertion principle; any custom encoding method can also be used for encoding, and so on.

[0057] See also Figure 2 , Figure 2 This is a schematic diagram of a scene corresponding to the first embodiment of the present application. Figure 2 The schematic diagram shown in the figure illustrates an embodiment of the present application by taking a specific scenario as an example:

[0058] A translation memory is obtained, wherein the translation memory contains a plurality of sentence pair groups consisting of standard original texts and corresponding translations, wherein the standard original texts are obtained by preprocessing the initial original texts (character encoding format unification processing and / or preset character elimination processing; the preset characters are characters that do not affect the semantic integrity). Specifically, it includes: sentence pair group 1, which includes the standard original text: string a and the translation: string A; sentence pair group 2, which includes the standard original text: string b, the translation: string B, ...; obtaining the original text to be translated: string a', and performing the same preprocessing operation on a', thereby obtaining the processed original text to be translated a; determining the matching standard original text a that is completely identical to a from the various standard original texts contained in the translation memory, and then determining the translation A corresponding to the matching standard original text a as the translation result of the original text to be translated a'.

[0059] In the embodiment of the present application, the standard text stored in the translation memory is obtained after the original text is processed by character encoding format unification and / or preset characters (characters that do not affect semantic integrity) are eliminated. Correspondingly, after the original text to be translated is obtained, the same preprocessing operation (fault-tolerant operation) is also performed on the obtained original text to be translated. The above preprocessing operation can effectively eliminate the difference in the expression form of characters with the same meaning caused by factors such as writing habits and scanning operations, so that the original text to be translated and the standard text with the same meaning are as similar or identical as possible in expression form. In this way, if the original text to be translated has the same meaning as the standard text, when matching the original text to be translated and the standard text after the above processing, the situation of matching failure (which should be determined, but actually failed to determine the matching standard text) can be effectively avoided. Therefore, the embodiment of the present application can effectively improve the recall rate in the data matching process.

[0060] The data matching method of this embodiment can be executed by any appropriate electronic device with data processing capability, including but not limited to: a server, a mobile terminal (such as a mobile phone, a PAD, etc.) and a PC, etc.

[0061] Embodiment 2

[0062] Reference Figure 3 , Figure 3 The following is a flow chart of the steps of a data matching method according to the second embodiment of the present application. Specifically, the data matching method provided in this embodiment includes the following steps:

[0063] Step 302, obtaining a translation memory, wherein the translation memory contains sentence pairs consisting of standard original texts and corresponding translated texts; the standard original texts are obtained by performing preprocessing operations and preset encoding operations on the initial original texts.

[0064] The preprocessing operation includes: character encoding format unification processing and preset character elimination processing; the preset characters are characters that do not affect the semantic integrity. Optionally, the preset characters may include at least one of the following: a sentence break symbol, a space character, and a carriage return character.

[0065] In the embodiment of the present application, the standard original text in the translation memory is obtained by performing a preprocessing operation similar to step 102 of the first embodiment on the initial original text and then performing a preset encoding operation.

[0066] As mentioned above, since the translation memory is usually collected in advance, and the collection process requires a lot of economic and time costs, the encoding operation can be performed after the initial original text is preprocessed as described above, so as to obtain the standard original text. In this way, the security of the translation memory can be improved to avoid the risk of translation memory leakage.

[0067] In the embodiment of the present application, the specific content of the preset encoding operation is not limited. For example, it can be processed in reverse order; it can also insert a preset number of characters according to a preset insertion principle; it can also be encoded in any custom encoding method, and so on.

[0068] Optionally, in some of the embodiments, the preset encoding operation can be an encoding operation performed using a message digest algorithm (Message-Digest Algorithm 5, MD5), that is, an MD5 operation is performed to finally convert the original text into an MD5 value, thereby achieving data encryption and improving data security. In addition, since the MD5 value usually contains only a small number of bits (such as 32 bits, etc.), that is, any original text of indefinite length can be converted into a 32-bit MD5 value, thereby effectively saving storage space.

[0069] In addition, since the translation memory usually contains a large number of sentence pairs, in order to facilitate subsequent data matching and improve data search (matching) efficiency, each sentence pair can also be sorted based on the standard original text (that is, the MD5 value). Subsequently, a binary search method can be used to determine the matching standard text from multiple standard texts.

[0070] Step 304: Obtain the original text to be translated.

[0071] In the embodiment of the present application, there is no limitation on the specific method of obtaining the original text to be translated. For example, it can be a character string directly input by the user, or it can be obtained by performing text recognition (OCR) on an image, and the above-mentioned image can be obtained by optical scanning or image acquisition of a target area containing the original text to be translated.

[0072] Step 306: Eliminate the preset characters in the original text to be translated to obtain the first original text.

[0073] Specifically, corresponding to step 302, the preset characters in the embodiment of the present application are characters that do not affect the semantic integrity. Optionally, the preset characters may include at least one of the following: a sentence break symbol, a space character, and a carriage return character.

[0074] Among them, sentence punctuation symbols may include: comma, period, exclamation mark, double quotation mark, etc.

[0075] See Table 1, which is a comparative example of eliminating sentence segmentation symbols from the original text:

[0076] Table 1

[0077]

[0078] Among them, in the example of the first line, the punctuation mark "!" in the initial original text "天道酬勤!" was eliminated; in the example of the second line, the punctuation marks in the initial original text, namely the comma and the double quotes, were eliminated.

[0079] Refer to Table 2 below. Table 2 is a comparative example of eliminating null characters and carriage return characters from the initial original text:

[0080] Table 2

[0081]

[0082] Among them, in the example of the first line, the null characters in the initial original text were eliminated; in the example of the second line, the carriage return characters in the initial original text were eliminated, thus converting the original text that originally occupied two lines into a standard original text that only occupies one line.

[0083] Step 308: Adjust the punctuation marks and numeric characters in the first original text according to the preset punctuation mark encoding format and numeric character encoding format to obtain the second original text.

[0084] Specifically, for example, all the punctuation marks in the first original text can be unified into the English character encoding format. For example: unify the Chinese-format question mark "?" in the initial original text into the English-format question mark "?"; unify the Chinese-format full stop "。" in the initial original text into the English-format full stop ".", and so on.

[0085] Regarding the numeric character encoding format, for example: all the numeric characters in the first original text can be unified into a specific numeric character encoding format, such as Arabic numerals, or Roman numerals, and so on.

[0086] Refer to Table 3 below. Table 3 is a comparative example of adjusting the punctuation mark encoding format of the first original text:

[0087] Table 3

[0088]

[0089] Among them, in the example of the first line, the Chinese-format question mark "?" was adjusted to the English-format question mark "?"; in the example of the second line, the Chinese-format ellipsis "。。。" was adjusted to the English-format ellipsis "...".

[0090] Step 310: Unify the letters in the second original text into the preset letter format to obtain the processed original text to be translated; where the preset letter format is the uppercase format or the lowercase format.

[0091] Refer to Table 4 below. Table 4 is a comparative example of adjusting the letter format of the second original text:

[0092] Table 4

[0093]

[0094]

[0095] Among them, in the example of the first row, the uppercase "COOL" is adjusted to the lowercase "cool"; in the example of the second row, the uppercase letter "P" is adjusted to the lowercase letter "p".

[0096] It should be noted that, in the embodiment of the present application, the execution order of step 306-step 310 is not limited and can be set as needed. That is to say, in the embodiment of the present application, the preprocessing of eliminating preset characters can be performed first, the preprocessing of adjusting the character encoding format can be performed first, and the preprocessing of unifying the uppercase and lowercase letter formats can be performed first. The order of the above three preprocessing methods is not limited and can be set according to actual needs.

[0097] Preferably, in order to improve the preprocessing efficiency, the preprocessing of eliminating preset characters can be performed first, and then the preprocessing of adjusting the character encoding format can be performed. In this way, the number of characters to be adjusted in encoding format can be effectively reduced, thereby improving the speed of the entire preprocessing operation.

[0098] Step 312, performing a preset encoding operation on the processed original text to be translated to obtain an encoded original text to be translated.

[0099] Corresponding to step 302, in this step, the specific content of the preset encoding operation is not limited, and it can be any encoding operation the same as in step 302. For example, it can be reverse processing; it can also insert a preset number of characters according to a preset insertion principle; it can also be encoded in any custom encoding method, and so on.

[0100] Optionally, in some of the embodiments, the preset encoding operation may be an encoding operation performed using a message digest algorithm (Message-Digest Algorithm 5, MD5).

[0101] Specifically, performing the preset encoding operation on the processed original text to be translated to obtain the encoded original text to be translated may include: using an information summary algorithm to encode the processed original text to be translated to obtain the encoded original text to be translated.

[0102] Step 314, the standard original text that is completely identical to the encoded original text to be translated is determined as the matching standard original text, and the translation corresponding to the matching standard original text is determined as the translation result of the original text to be translated.

[0103] See also Figure 4 , Figure 4This is a schematic diagram of the data matching process provided according to the second embodiment of the present application. Figure 4 The data matching process provided in the second embodiment of the present application is briefly described, mainly including:

[0104] Step 1: Memory data collection and user scanning input. Memory data collection is the process of collecting the initial original text and the corresponding translation in step 302. Specifically, the commonly used relatively short initial original text and the corresponding translation in the specific application scenario can be collected first. The user scans and inputs, and the user can obtain the original text to be translated by scanning and text recognition.

[0105] Step 2: Eliminate the sentence segmentation symbols. Specifically, the sentence segmentation symbols of the collected initial original texts and the obtained original texts to be translated can be eliminated.

[0106] Step 3: Unify the symbol coding. Specifically, the symbol coding of the original text after the segmentation symbols are eliminated can be unified, and the symbol coding of the original text to be translated after the segmentation symbols are eliminated can be unified. The unified processing of the symbol coding is to adjust the punctuation marks and numeric characters in the original text after the segmentation symbols are eliminated (or the original text to be translated after the segmentation symbols are eliminated) according to the preset punctuation mark coding format and numeric character coding format.

[0107] Step 4: Unify uppercase and lowercase letters. Specifically, unify the letters of the original text after symbol coding, and unify the letters of the original text to be translated after symbol coding. Specifically, the unification of the letters can be: unify all letters into uppercase format, or unify all letters into lowercase format.

[0108] Step 5: Eliminate null characters and carriage returns. Specifically: respectively eliminate null characters and carriage returns in the original text processed in step 4; eliminate null characters and carriage returns in the original text to be translated processed in step 4 to obtain the processed original text to be translated.

[0109] Step 6: MD5 compression. Specifically: perform MD5 compression on the original text processed in step 5 to obtain a standard text, thereby obtaining a translation memory based on each standard text and the corresponding translation; perform MD5 compression on the processed text to be translated to obtain an encoded text to be translated.

[0110] Step 7: Matching. Specifically, the encoded original text to be translated is matched with each standard original text in the translation memory, so as to obtain a matching standard original text that is completely identical to the encoded original text to be translated, and then the translation corresponding to the matching standard original text is returned as the translation result.

[0111] Typically, the existing data matching process is usually based on the similarity between the standard original text in the translation memory and the original text to be translated, specifically, such as the similarity in the word dimension or the character dimension. That is, when the standard original text and the original text to be translated contain the same words or characters, or contain a large number of the same words or characters, the standard original text is considered to match the original text to be translated.

[0112] The above matching method has large errors. For example, the different word orders of the same word group when forming a sentence may lead to completely different meanings, but the similarity may be very high. At the same time, some two sentences with high similarity may have very different corresponding translations due to the presence of individual letters or different capitalization, but the similarity is very high. In other words, the above matching method often has a low matching accuracy rate and cannot guarantee that the translation corresponding to the standard original text matched from the translation memory is the correct translation of the original text to be translated under the premise of meeting the similarity threshold.

[0113] In the embodiment of the present application, after the initial original text and the original text to be translated have undergone the same preprocessing (fault-tolerant processing) and encoding operations, a successful match is determined when the encoding results of the two are exactly the same, and the translation corresponding to the matching standard original text is used as the translation result of the original text to be translated. Therefore, the recall rate in the data matching process can be effectively improved.

[0114] The data matching method of this embodiment can be executed by any appropriate electronic device with data processing capability, including but not limited to: a server, a mobile terminal (such as a mobile phone, a PAD, etc.) and a PC, etc.

[0115] Embodiment 3

[0116] Reference Figure 5 , Figure 5 The flowchart is a step flow chart of a data matching method according to the third embodiment of the present application. The application scenario of this embodiment may be: the user scans the area containing the original text to be translated through an offline scanning device (such as a scanning pen, etc.) to obtain the translation result of the original text to be translated.

[0117] Specifically, the data matching method provided in this embodiment is applied to a scanning pen and includes the following steps:

[0118] Step 502, receiving an instruction for instructing text translation; and scanning a target area containing the original text to be translated according to the instruction to obtain a target image.

[0119] Step 504: Perform text recognition on the target image to obtain the original text to be translated.

[0120] In the embodiments of the present application, there is no limitation on the specific text recognition method used when obtaining the original text to be translated, and any existing text recognition method can be selected for recognition according to actual needs.

[0121] Step 506, preprocessing the original text to be translated to obtain the processed original text to be translated; wherein the preprocessing operation includes: character encoding format unification processing and / or preset character elimination processing; the preset characters are characters that do not affect the semantic integrity.

[0122] Step 508, obtaining a translation memory; the translation memory contains sentence pairs consisting of standard original texts and corresponding translated texts; the standard original texts are obtained by preprocessing the initial original texts.

[0123] Step 510: determine a matching standard original text that matches the processed original text to be translated from the standard original text, and output a translation corresponding to the matching standard original text as a translation result of the original text to be translated.

[0124] In the embodiment of the present application, since the standard text stored in the translation memory obtained is obtained after the original text is processed by character encoding format unification, and / or preset characters (characters that do not affect semantic integrity) are eliminated, correspondingly, after the original text to be translated is obtained by scanning and text recognition, the obtained original text to be translated is also subjected to the same preprocessing operation (fault-tolerant operation). The above preprocessing operation can effectively eliminate the difference in the expression form of characters with the same meaning caused by factors such as writing habits and scanning operations, so that the original text to be translated and the standard text with the same meaning are as similar or identical as possible in expression form. In this way, if the original text to be translated has the same meaning as the standard text, when matching the original text to be translated and the standard text after the above processing, the situation of matching failure (which should be determined, but actually failed to determine the matching standard text) can be effectively avoided. Therefore, the embodiment of the present application can effectively improve the recall rate in the data matching process.

[0125] Embodiment 4

[0126] See also Figure 6 , Figure 6 1 is a structural block diagram of a data matching device according to Embodiment 4 of the present application. The data matching device provided in the embodiment of the present application includes:

[0127] The first memory acquisition module 602 is used to acquire a translation memory, which contains a sentence pair consisting of a standard original text and a corresponding translation; the standard original text is obtained by preprocessing the initial original text, wherein the preprocessing operation includes: character encoding format unification processing and / or preset character elimination processing; the preset characters are characters that do not affect the semantic integrity;

[0128] The module 604 for obtaining the original text to be translated is used to obtain the original text to be translated and perform a preprocessing operation on the original text to be translated to obtain the processed original text to be translated;

[0129] The translation result determination module 606 is used to determine a matching standard original text that matches the processed original text to be translated from the standard original text, and determine the translation corresponding to the matching standard original text as the translation result of the original text to be translated.

[0130] Optionally, in some of the embodiments, the standard original text in the translation memory is obtained after performing a preprocessing operation and a preset encoding operation on the initial original text;

[0131] The device also includes:

[0132] An encoding module is used for performing a preprocessing operation on the original text to be translated to obtain the processed original text to be translated, and then performing a preset encoding operation on the processed original text to be translated to obtain the encoded original text to be translated;

[0133] The translation result determination module 606, when executing the step of determining the matching standard text that matches the processed original text to be translated from the standard text, is specifically used to: determine the standard text that is completely the same as the encoded original text to be translated as the matching standard text.

[0134] Optionally, in some of the embodiments, the preset encoding operation is an encoding operation performed using an information digest algorithm;

[0135] The encoding module is specifically used to perform a preprocessing operation on the original text to be translated, and after obtaining the processed original text to be translated, use an information summary algorithm to encode the processed original text to be translated to obtain the encoded original text to be translated.

[0136] Optionally, in some embodiments, the preprocessing operation includes: character encoding format unification processing and preset character elimination processing; the original text to be translated acquisition module 604, when executing the step of performing the preprocessing operation on the original text to be translated to obtain the processed original text to be translated, is specifically used for:

[0137] Eliminate the preset characters in the original text to be translated to obtain the first original text;

[0138] According to the preset punctuation mark encoding format and the digital character encoding format, the punctuation marks and the digital characters in the first original text are adjusted to obtain the processed original text to be translated.

[0139] Optionally, in some embodiments, if the original text to be translated contains letters, the original text to be translated obtaining module 604, when executing the step of adjusting the punctuation marks and numeric characters in the first original text according to the preset punctuation mark encoding format and the numeric character encoding format to obtain the processed original text to be translated, is specifically used to:

[0140] According to a preset punctuation mark encoding format and a preset numeric character encoding format, the punctuation marks and numeric characters in the first original text are adjusted to obtain a second original text;

[0141] The letters in the second original text are unified into a preset letter format to obtain a processed original text to be translated; wherein the preset letter format is an uppercase format or a lowercase format.

[0142] Optionally, in some embodiments, the preset characters include at least one of the following: a sentence break symbol, a space character, and a carriage return character.

[0143] The data matching device of the embodiment of the present application is used to implement the corresponding data matching method in the above-mentioned method embodiment 1 or embodiment 2, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here. In addition, the functional implementation of each module in the data matching device of the embodiment of the present application can refer to the description of the corresponding part in the above-mentioned method embodiment 1 or embodiment 2, which will not be repeated here.

[0144] Embodiment 5

[0145] Reference Figure 7 , Figure 7 The data matching device provided in the embodiment of the present application is located in the scanning pen and includes:

[0146] The instruction receiving module 702 is used to receive an instruction for instructing text translation; and according to the instruction, scan the target area containing the original text to be translated to obtain a target image;

[0147] The text recognition module 704 is used to perform text recognition on the target image to obtain the original text to be translated;

[0148] The preprocessing module 706 is used to perform preprocessing operations on the original text to be translated to obtain the processed original text to be translated; wherein the preprocessing operations include: character encoding format unification processing and / or preset character elimination processing; the preset characters are characters that do not affect the semantic integrity;

[0149] The second memory acquisition module 708 is used to acquire a translation memory; the translation memory contains a sentence pair consisting of a standard original text and a corresponding translation; the standard original text is obtained by preprocessing the initial original text;

[0150] The result output module 710 is used to determine the matching standard original text that matches the processed original text to be translated from the standard original text, and output the translation corresponding to the matching standard original text as the translation result of the original text to be translated.

[0151] The data matching device of the embodiment of the present application is used to implement the corresponding data matching method in the aforementioned method embodiment 3, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here. In addition, the functional implementation of each module in the data matching device of the embodiment of the present application can refer to the description of the corresponding part in the aforementioned method embodiment 3, which will not be repeated here.

[0152] Embodiment 6

[0153] Reference Figure 8 , shows a schematic diagram of the structure of an electronic device according to Embodiment 6 of the present application. The specific embodiments of the present application do not limit the specific implementation of the electronic device.

[0154] like Figure 8 As shown, the electronic device may include: a processor (processor) 802 , a communication interface (Communications Interface) 804 , a memory (memory) 806 , and a communication bus 808 .

[0155] in:

[0156] The processor 802 , the communication interface 804 , and the memory 806 communicate with each other via a communication bus 808 .

[0157] The communication interface 804 is used to communicate with other electronic devices or servers.

[0158] The processor 802 is used to execute the program 810, and specifically can execute the relevant steps in the above data matching method embodiment.

[0159] Specifically, the program 810 may include program codes, which include computer operation instructions.

[0160] The processor 802 may be a CPU, or an application specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present application. The one or more processors included in the smart device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.

[0161] The memory 806 is used to store the program 810. The memory 806 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0162] Program 810 can be specifically used to enable processor 802 to perform the following operations: obtain a translation memory, which contains a sentence pair group consisting of a standard original text and a corresponding translation; the standard original text is obtained by performing a preprocessing operation on the initial original text, wherein the preprocessing operation includes: character encoding format unification processing and / or preset character elimination processing; the preset characters are characters that do not affect the semantic integrity; obtain the original text to be translated, and perform a preprocessing operation on the original text to be translated to obtain the processed original text to be translated; determine a matching standard original text that matches the processed original text to be translated from the standard original text, and determine the translation corresponding to the matching standard original text as the translation result of the original text to be translated.

[0163] Alternatively, the program 810 can be specifically used to enable the processor 802 to perform the following operations: receive an instruction for instructing text translation; and according to the instruction, scan a target area containing the original text to be translated to obtain a target image; perform text recognition on the target image to obtain the original text to be translated; perform a preprocessing operation on the original text to be translated to obtain the processed original text to be translated; wherein the preprocessing operation includes: character encoding format unification processing and / or preset character elimination processing; the preset characters are characters that do not affect the semantic integrity; obtain a translation memory; the translation memory contains a sentence pair group consisting of a standard original text and a corresponding translation; the standard original text is obtained by performing a preprocessing operation on the initial original text; determine a matching standard original text that matches the processed original text to be translated from the standard original text, and output the translation corresponding to the matching standard original text as the translation result of the original text to be translated.

[0164] The specific implementation of each step in program 810 can refer to the corresponding description of the corresponding steps and units in the above data matching method embodiment, which will not be repeated here. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described devices and modules can refer to the corresponding process description in the above method embodiment, which will not be repeated here.

[0165] Through the electronic device of this embodiment, the standard text stored in the translation memory is obtained after the original text is processed by character encoding format unification, and / or preset characters (characters that do not affect semantic integrity) are eliminated. Correspondingly, after the original text to be translated is obtained, the same preprocessing operation (fault-tolerant operation) is also performed on the obtained original text to be translated. The above preprocessing operation can effectively eliminate the difference in the expression form of characters with the same meaning caused by factors such as writing habits and scanning operations, so that the original text to be translated and the standard text with the same meaning are as similar or identical as possible in the expression form. In this way, if the original text to be translated has the same meaning as the standard text, when matching the original text to be translated and the standard text after the above processing, the situation of matching failure (which should be determined, but actually failed to determine the matching standard text) can be effectively avoided. Therefore, the embodiment of the present application can effectively improve the accuracy of data matching.

[0166] An embodiment of the present application also provides a computer program product, including computer instructions, which instruct a computing device to execute operations corresponding to any data matching method in the above-mentioned multiple method embodiments.

[0167] It should be pointed out that, according to the needs of implementation, the various components / steps described in the embodiments of the present application can be split into more components / steps, or two or more components / steps or partial operations of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of the present application.

[0168] The above-mentioned method according to the embodiment of the present application can be implemented in hardware, firmware, or implemented as software or computer code that can be stored in a recording medium (such as a CD ROM, RAM, floppy disk, hard disk or magneto-optical disk), or implemented as a computer code originally stored in a remote recording medium or a non-temporary machine-readable medium downloaded through a network and stored in a local recording medium, so that the method described herein can be stored in such software processing on a recording medium using a general-purpose computer, a special-purpose processor or programmable or special-purpose hardware (such as an ASIC or FPGA). It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code, and when the software or computer code is accessed and executed by a computer, a processor or hardware, the data matching method described herein is implemented. In addition, when a general-purpose computer accesses the code for implementing the data matching method shown here, the execution of the code converts the general-purpose computer into a special-purpose computer for executing the data matching method shown here.

[0169] Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present application.

[0170] The above implementation methods are only used to illustrate the embodiments of the present application, and are not limitations on the embodiments of the present application. Ordinary technicians in the relevant technical field can make various changes and modifications without departing from the spirit and scope of the embodiments of the present application. Therefore, all equivalent technical solutions also belong to the scope of the embodiments of the present application. The scope of patent protection of the embodiments of the present application should be limited by the claims.

Claims

1. A data matching method, comprising: Acquire a translation memory database, wherein the translation memory database contains sentence pairs consisting of standard original texts and corresponding translations; The standard original text is obtained by preprocessing the original text, wherein the preprocessing operation includes: character encoding format unification processing and / or preset character elimination processing; the preset characters are characters that do not affect the semantic integrity; Acquire the original text to be translated, and perform the preprocessing operation on the original text to be translated to obtain the processed original text to be translated; A matching standard original text that matches the processed original text to be translated is determined from the standard original text, and a translation corresponding to the matching standard original text is determined as a translation result of the original text to be translated.

2. The method according to claim 1, wherein: The standard original text in the translation memory is obtained after preprocessing and pre-coding the initial original text; After performing the preprocessing operation on the original text to be translated to obtain the processed original text to be translated, the method further includes: Performing the preset encoding operation on the processed original text to be translated to obtain the encoded original text to be translated; The step of determining, from the standard original text, a matching standard original text that matches the processed original text to be translated comprises: The standard original text that is completely identical to the encoded original text to be translated is determined as the matching standard original text.

3. The method according to claim 2, wherein: The preset encoding operation is an encoding operation performed using an information digest algorithm; The performing the preset encoding operation on the processed original text to be translated to obtain the encoded original text to be translated includes: The processed original text to be translated is encoded by using an information summary algorithm to obtain the encoded original text to be translated.

4. The method according to claim 1, wherein: The pre-processing operation includes: character encoding format unification processing and preset character elimination processing; The performing the preprocessing operation on the original text to be translated to obtain the processed original text to be translated includes: Eliminating the preset characters in the original text to be translated to obtain a first original text; According to a preset punctuation mark encoding format and a preset numeric character encoding format, the punctuation marks and numeric characters in the first original text are adjusted to obtain a processed original text to be translated.

5. The method according to claim 4, wherein: If the original text to be translated contains letters, adjusting the punctuation marks and numeric characters in the first original text according to a preset punctuation mark encoding format and a numeric character encoding format to obtain the processed original text to be translated includes: According to a preset punctuation mark encoding format and a preset numeric character encoding format, the punctuation marks and numeric characters in the first original text are adjusted to obtain a second original text; The letters in the second original text are unified into a preset letter format to obtain a processed original text to be translated; wherein the preset letter format is an uppercase format or a lowercase format.

6. The method according to claim 1, wherein: The preset characters include at least one of the following: a sentence break symbol, a space character, and a carriage return character.

7. A data matching method, applied to a scanning pen, comprising: receiving an instruction for instructing to translate a text; and scanning the target area containing the original text to be translated according to the instruction to obtain a target image; Performing text recognition on the target image to obtain the original text to be translated; Performing a preprocessing operation on the original text to be translated to obtain a processed original text to be translated; wherein the preprocessing operation includes: character encoding format unification processing and / or preset character elimination processing; the preset characters are characters that do not affect the semantic integrity; Acquire a translation memory; the translation memory contains sentence pairs consisting of standard original texts and corresponding translated texts; the standard original texts are obtained by performing the preprocessing operation on the initial original texts; A matching standard original text that matches the processed original text to be translated is determined from the standard original text, and a translation corresponding to the matching standard original text is output as a translation result of the original text to be translated.

8. A data matching device, comprising: A first memory acquisition module is used to acquire a translation memory, wherein the translation memory contains sentence pairs consisting of a standard original text and a corresponding translation; The standard original text is obtained by preprocessing the original text, wherein the preprocessing operation includes: character encoding format unification processing and / or preset character elimination processing; the preset characters are characters that do not affect the semantic integrity; The module for obtaining the original text to be translated is used to obtain the original text to be translated and perform the preprocessing operation on the original text to be translated to obtain the processed original text to be translated; The translation result determination module is used to determine a matching standard original text that matches the processed original text to be translated from the standard original text, and determine the translation corresponding to the matching standard original text as the translation result of the original text to be translated.

9. A data matching device, located in a scanning pen, comprising: An instruction receiving module, used for receiving an instruction for instructing text translation; and scanning the target area containing the original text to be translated according to the instruction to obtain a target image; A text recognition module, used to perform text recognition on the target image to obtain the original text to be translated; A preprocessing module is used to perform a preprocessing operation on the original text to be translated to obtain the processed original text to be translated; wherein the preprocessing operation includes: character encoding format unification processing and / or preset character elimination processing; the preset characters are characters that do not affect the semantic integrity; A second memory acquisition module is used to acquire a translation memory; the translation memory contains a sentence pair consisting of a standard original text and a corresponding translation; the standard original text is obtained by performing the preprocessing operation on the initial original text; The result output module is used to determine a matching standard original text that matches the processed original text to be translated from the standard original text, and output a translation corresponding to the matching standard original text as a translation result of the original text to be translated.

10. An electronic device comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform an operation corresponding to the data matching method according to any one of claims 1 to 6, or to perform an operation corresponding to the data matching method according to claim 7.

11. A computer storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the data matching method according to any one of claims 1 to 6 is implemented, or the data matching method according to claim 7 is implemented.

12. A computer program product, comprising computer instructions, wherein the computer instructions instruct a computing device to perform operations corresponding to the data matching method as described in any one of claims 1 to 6, or to perform operations corresponding to the data matching method as described in claim 7.