A data entry method, device and electronic equipment
By using Optical Character Recognition (OCR) technology to process paper documents, the system can recognize and convert data in a specified format into sub-images, solving the problem of slow data entry speed and achieving efficient and accurate data entry.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-28
- Publication Date
- 2026-03-17
AI Technical Summary
In existing technologies, the input speed of paper documents into online databases is slow, resulting in a lot of time consumption, and manual input has the problem of data accuracy.
The image to be entered is processed using optical character recognition (OCR) technology. It recognizes data in a specified format and converts it into a sub-image to be replaced. The specified data is replaced using a specified placeholder. The user indicates the target data to be entered into the preset input area in the target result.
It improved the accuracy of data entry, avoided data garbled characters and errors, increased the data entry speed, and reduced manual intervention.
Smart Images

Figure CN114998911B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to a data entry method, apparatus, and electronic device. Background Technology
[0002] Currently, with the rapid development of technology, storing paper documents in online databases has become an important way to preserve them. Examples include documents, newspapers, classic works, and exam questions.
[0003] Because paper documents may contain various complex text contents such as formulas and characters, manual data entry is usually performed to ensure the accuracy of the data when it is entered into the online database. However, manual data entry is slow and time-consuming.
[0004] Therefore, how to improve the data entry speed while ensuring the accuracy of data entry has become an urgent problem to be solved. Summary of the Invention
[0005] The purpose of this invention is to provide a data entry method, apparatus, and electronic device to improve data entry speed while ensuring accuracy. The specific technical solution is as follows:
[0006] In a first aspect, embodiments of the present invention provide a data entry method applied to an electronic device, the method comprising:
[0007] Obtain the image to be entered;
[0008] The image to be entered is subjected to optical character recognition (OCR) processing to obtain the recognition result of the image to be entered;
[0009] Convert the specified data in the recognition result that belongs to the specified format into the sub-image to be replaced;
[0010] The specified data is replaced with a specified placeholder associated with the sub-image to be replaced to obtain the target result;
[0011] Enter the target data indicated by the user in the target result into the preset input area.
[0012] Optionally, in one specific implementation, converting the specified data in the recognition result that belongs to a specified format into the sub-image to be replaced includes:
[0013] The specified data in the recognition results that belong to a specified format are converted to obtain transition data that belongs to a preset format; and the transition data is converted to obtain the sub-image to be replaced.
[0014] Optionally, in one specific implementation, inputting the target data indicated by the user in the target result into a preset input area includes:
[0015] When a user-sent data selection operation is detected, the target data indicated by the data selection operation in the target result is determined;
[0016] When the user sends a data entry operation, the target data is input into the preset entry area.
[0017] Optionally, in one specific implementation, the recognition result includes: each data in the image to be entered and the position information of each data;
[0018] Before inputting the target data indicated by the user in the target result into the preset input area, the method further includes:
[0019] Based on the location information of each data point, each data point in the target result is labeled with a specified type.
[0020] The step of determining the target data indicated by the data selection operation in the target result when a data selection operation sent by a user is detected includes:
[0021] When a user performs a specified operation on each target marker in the target result, the data marked by the target marker is determined as the target data.
[0022] Optionally, in one specific implementation, before performing optical character recognition (OCR) processing on the image to be entered to obtain the recognition result of the image to be entered, the method further includes:
[0023] Determine whether the specified data in the specified format exists in the image to be entered;
[0024] The step of performing optical character recognition (OCR) processing on the image to be entered to obtain the recognition result of the image to be entered includes:
[0025] If the image to be entered contains specified data in the specified format, then an OCR with the specified format recognition function is used to recognize the image to be entered, and the recognition result of the image to be entered is obtained.
[0026] Optionally, in one specific implementation, the method further includes:
[0027] The data in the input area is stored in the designated storage space.
[0028] Optionally, in one specific implementation, the method further includes:
[0029] The data in the input area is modified based on the modification command sent by the user.
[0030] Optionally, in one specific implementation, the method is applied to a browser in the electronic device; the image format of the sub-image to be replaced is an image format supported by the browser.
[0031] Secondly, embodiments of the present invention provide a data input device applied to an electronic device, the device comprising:
[0032] Image acquisition module, used to acquire the image to be entered;
[0033] An image recognition module is used to perform optical character recognition (OCR) processing on the image to be entered, and obtain the recognition result of the image to be entered;
[0034] An image conversion module is used to convert specified data in the recognition result that belongs to a specified format into a sub-image to be replaced;
[0035] The result acquisition module is used to replace the specified data with a specified placeholder associated with the sub-image to be replaced, and obtain the target result.
[0036] The data entry module is used to input the target data indicated by the user in the target result into the preset entry area.
[0037] Optionally, in one specific implementation, the image conversion module is specifically used for:
[0038] The specified data in the recognition results that belong to a specified format are converted to obtain transition data that belongs to a preset format; and the transition data is converted to obtain the sub-image to be replaced.
[0039] Optionally, in one specific implementation, the data entry module includes:
[0040] The selection submodule is used to determine the target data indicated by the data selection operation in the target result when a data selection operation sent by the user is detected.
[0041] The data entry submodule is used to input the target data into a preset data entry area when the user sends a data entry operation.
[0042] Optionally, in one specific implementation, the recognition result includes: each data point in the image to be entered and the position information of each data point; the device further includes a marking module:
[0043] The marking module is used to mark each piece of data in the target result with a specified type based on the location information of each piece of data before the target data indicated by the user in the target result is input into the preset input area.
[0044] The selection submodule is specifically used to: when it detects that the user has performed a specified operation on each target marker in the target result, determine the data marked by the target marker as the target data.
[0045] Optionally, in one specific implementation, the device further includes a judgment module:
[0046] The judgment module is used to determine whether the specified data in the specified format exists in the image to be entered before performing optical character recognition (OCR) processing on the image to be entered to obtain the recognition result of the image to be entered.
[0047] The image recognition module is specifically used to: if the image to be entered contains specified data in the specified format, then use an OCR with the specified format recognition function to recognize the image to be entered, and obtain the recognition result of the image to be entered.
[0048] Optionally, in one specific implementation, the device further includes a storage module:
[0049] The storage module is used to store the data in the input area into a designated storage space.
[0050] Optionally, in one specific implementation, the device further includes a modification module:
[0051] The modification module is used to modify the data in the input area based on the modification command sent by the user.
[0052] Optionally, in one specific implementation, the device is applied to a browser in the electronic device; the image format of the sub-image to be replaced is an image format supported by the browser.
[0053] Thirdly, embodiments of the present invention provide an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0054] Memory, used to store computer programs;
[0055] When a processor executes a program stored in memory, it implements the steps of any of the data entry methods provided in the first aspect above.
[0056] Fourthly, embodiments of the present invention provide a computer-readable medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of any of the data entry methods provided in the first aspect.
[0057] Fifthly, embodiments of the present invention provide a computer program product containing instructions that, when run on a computer, cause the computer to perform the steps of any of the data entry methods described in the first aspect.
[0058] Beneficial effects of the embodiments of the present invention:
[0059] As can be seen from the above, the data entry method provided by the embodiments of the present invention is applied to electronic devices. When entering data into an image, firstly, the image to be entered is acquired, and then optical character recognition (OCR) processing is performed on the image to be entered, thereby obtaining the recognition result of the image to be entered. In this way, the specified data in the recognition result belonging to a specified format can be converted into a sub-image to be replaced. Then, the specified data is replaced by a specified placeholder associated with the sub-image to be replaced to obtain the target result. Furthermore, the target data indicated by the user in the target result can be input into a preset input area.
[0060] Based on this, applying the solution provided in this embodiment of the invention, for specified data belonging to a specified format, the specified data can be replaced using the sub-image to be replaced. That is, for specified data such as formulas and characters in a specified format, image recognition can be performed on the specified data to obtain the sub-image to be replaced, and then the specified data can be replaced using the sub-image to be replaced. This avoids data garbled characters and errors during data entry, thereby improving the accuracy of data entry. Furthermore, users can select the data to be entered from the target results based on their own needs, further improving the data entry speed. Attached Figure Description
[0061] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other embodiments can be obtained based on these drawings.
[0062] Figure 1 A flowchart illustrating the first data entry method provided in an embodiment of the present invention;
[0063] Figure 2A flowchart illustrating the second data entry method provided in this embodiment of the invention;
[0064] Figure 3 A flowchart illustrating the third data entry method provided in this embodiment of the invention;
[0065] Figure 4 A flowchart illustrating the fourth data entry method provided in this embodiment of the invention;
[0066] Figure 5 An illustration of a designated area provided by the present invention;
[0067] Figure 6 A diagram illustrating a specific embodiment of the present invention;
[0068] Figure 7(a) is a flowchart of a specific embodiment of the present invention;
[0069] Figure 7(b) is a schematic diagram of the specific process of steps three, four and five in Figure 7(a);
[0070] Figure 8 A flowchart illustrating the fifth data entry method provided in this embodiment of the invention;
[0071] Figure 9 A flowchart illustrating the sixth data entry method provided in this embodiment of the invention;
[0072] Figure 10 This is a schematic diagram of the structure of a data entry device provided in an embodiment of the present invention;
[0073] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0074] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art based on this application are within the scope of protection of the present invention.
[0075] Currently, with the rapid development of technology, saving paper documents by entering them into online databases has become a crucial method for preserving these materials. Examples include documents, newspapers, classic works, and exam questions. Because paper documents may contain various complex textual content such as formulas and characters, manual data entry is typically used to ensure accuracy. However, manual entry is slow and time-consuming. Therefore, improving the data entry speed while maintaining accuracy has become a pressing issue.
[0076] To address the aforementioned technical problems, embodiments of the present invention provide a data entry method.
[0077] This method is applicable to various application scenarios that require inputting paper-based materials into online databases, such as inputting exam questions into an online question bank, or inputting historical documents into databases related to historical documents. Furthermore, this method can be applied to various electronic devices such as laptops, tablets, and desktop computers (hereinafter referred to as electronic devices). Therefore, this embodiment of the invention does not limit the application scenarios or the executing entity of this method.
[0078] This method can be applied to a browser on an electronic device, to a specified application installed on the electronic device, or to a dedicated electronic device for data entry. The embodiments of this invention do not specifically limit its application in this regard.
[0079] The data entry method provided in this embodiment of the invention may include the following steps:
[0080] Obtain the image to be entered;
[0081] The image to be entered is subjected to optical character recognition (OCR) processing to obtain the recognition result of the image to be entered;
[0082] Convert the specified data in the recognition result that belongs to the specified format into the sub-image to be replaced;
[0083] The specified data is replaced with a specified placeholder associated with the sub-image to be replaced to obtain the target result;
[0084] Enter the target data indicated by the user in the target result into the preset input area.
[0085] As can be seen from the above, the data entry method provided by the embodiments of the present invention is applied to electronic devices. When entering data into an image, firstly, the image to be entered is acquired, and then optical character recognition (OCR) processing is performed on the image to be entered, thereby obtaining the recognition result of the image to be entered. In this way, the specified data in the recognition result belonging to a specified format can be converted into a sub-image to be replaced. Then, the specified data is replaced by a specified placeholder associated with the sub-image to be replaced to obtain the target result. Furthermore, the target data indicated by the user in the target result can be input into a preset input area.
[0086] Based on this, applying the solution provided in this embodiment of the invention, for specified data belonging to a specified format, the specified data can be replaced using the sub-image to be replaced. That is, for specified data such as formulas and characters in a specified format, image recognition can be performed on the specified data to obtain the sub-image to be replaced, and then the specified data can be replaced using the sub-image to be replaced. This avoids data garbled characters and errors during data entry, thereby improving the accuracy of data entry. Furthermore, users can select the data to be entered from the target results based on their own needs, further improving the data entry speed.
[0087] The following is a detailed description of a data entry method provided by an embodiment of the present invention, with reference to the accompanying drawings.
[0088] Figure 1 This is a flowchart illustrating a data entry method provided in an embodiment of the present invention, as shown below. Figure 1 As shown, the method includes the following steps S101-S105:
[0089] S101: Obtain the image to be entered.
[0090] In the data entry process across various application scenarios, such as documents, newspapers, classic works, and test papers, electronic devices can first acquire the image to be entered.
[0091] For example, an electronic device with image acquisition capabilities can directly photograph the paper documents to be entered, thereby acquiring the image to be entered. Alternatively, the electronic device can acquire the image to be entered obtained by other electronic devices from image acquisition of the paper documents. This embodiment of the invention does not specifically limit the scope of these limitations.
[0092] S102: Perform optical character recognition (OCR) processing on the image to be entered to obtain the recognition result of the image to be entered.
[0093] After obtaining the above-mentioned image to be entered, optical character recognition (OCR) processing can be performed on the image to obtain the recognition result of the image to be entered.
[0094] Among them, the aforementioned Optical Character Recognition (OCR) refers to the process of scanning text documents and then analyzing and processing image files to obtain text and layout information.
[0095] Optionally, the recognition results may include the data content and location information of each row in the image to be entered.
[0096] In some cases, the image to be entered may contain formulas, characters, etc., which are easily misidentified. Therefore, when performing OCR recognition on the image to be entered, it can be determined whether to use OCR with specified format recognition function to recognize the image to be entered based on whether such formulas, characters, etc. exist in the image to be entered. This avoids situations such as garbled characters or errors when using OCR to recognize the image to be entered, which would otherwise require manual operation to correct such garbled characters or errors, reducing data entry efficiency and increasing labor costs.
[0097] Alternatively, in one specific implementation, such as Figure 2 As shown, a data entry method provided in an embodiment of the present invention may further include the following step S106:
[0098] S106: Determine whether the specified data in the specified format exists in the image to be entered;
[0099] Accordingly, step S102 above may include the following step S1021:
[0100] S1021: If the image to be entered contains specified data in a specified format, then an OCR with specified format recognition function is used to recognize the image to be entered, and the recognition result of the image to be entered is obtained.
[0101] In this specific implementation, after obtaining the image to be entered, it can be determined whether the image to be entered contains specified data in a specified format.
[0102] Optionally, a specified label can be added to the image to be entered that contains specified data in a specified format. Therefore, after the image to be entered is obtained, the label can be recognized. When the specified label is recognized, the image to be entered can be recognized by an OCR with specified format recognition function.
[0103] For example, before entering data for test papers in subjects such as mathematics, physics, and chemistry, specific tags are added to the images to be entered for these subjects. Therefore, after obtaining the images to be entered for each subject's test paper, the tags can be recognized on the images to be entered. When the specified tags are recognized, OCR with specified format recognition function is used to recognize the images to be entered.
[0104] If the image to be entered contains specified data in a specified format, then an OCR with specified format recognition function is used to recognize the image to be entered, thereby obtaining the recognition result of the image to be entered.
[0105] This avoids the problem of garbled characters and errors in the recognition results when using OCR to recognize the above-mentioned images, which is caused by the fact that OCR does not have the function of recognizing specified formats. This improves the efficiency of data entry and reduces labor costs.
[0106] S103: Convert the specified data in the recognition result that belongs to the specified format into the sub-image to be replaced.
[0107] After obtaining the recognition results of the above-mentioned image to be entered, it is possible to determine the specified data in the above-mentioned recognition results that belongs to the specified format, and convert the above-mentioned specified data into the sub-image to be replaced.
[0108] For example, the specified data in the above-mentioned specified format can be specified data containing LATEX (Lattex) characters. This embodiment of the invention does not specifically limit this. LATEX is a typesetting system developed by American computer scientist Leslie Lamport, suitable for typesetting large papers and inputting mathematical formulas.
[0109] Optionally, embodiments of the present invention can be applied to browsers in electronic devices. Therefore, the image format of the sub-image to be replaced is an image format supported by the browser in the electronic device.
[0110] For example, the image format supported by the browser in the electronic device is TIFF (Tagged Image File Format). If the sub-image to be replaced is in JPEG (Joint Photographic Experts Group) format, the browser will not support viewing the sub-image to be replaced.
[0111] TIFF format is a file format primarily used to store images, including photographs and artwork. JPEG format is used to display images and other continuous-tone image files, and is the most commonly used image file format.
[0112] Alternatively, in one specific implementation, such as Figure 3 As shown, step S103 above may include the following step S1031:
[0113] S1031: Convert the specified data in the recognition result that belongs to the specified format to obtain transition data that belongs to the preset format; and perform image conversion on the transition data to obtain the sub-image to be replaced.
[0114] In this specific implementation, after obtaining the recognition result of the image to be entered, the specified data in the recognition result that belongs to the specified format can be converted to obtain the transition data that belongs to the preset format. Then, the transition data can be converted to obtain the sub-image to be replaced by the specified data.
[0115] For example, if the preset format is MATHML (Mathematics Markup Language) characters, then the data containing LATEX characters in the recognition results can be converted into MATHML characters, and the formula image can be called to perform image conversion on the above MATHML characters to obtain the sub-image to be replaced in SVG (Scalable Vector Graphics) format.
[0116] S104: Replace the specified data with the specified placeholder of the associated sub-image to be replaced to obtain the target result.
[0117] After obtaining the sub-image to be replaced with the specified data, the association between the specified placeholder and the sub-image to be replaced with the specified data can be established.
[0118] In this way, after obtaining the sub-image to be replaced by the specified data based on the aforementioned transition data, the specified data can be replaced by the specified placeholder associated with the specified sub-image to be replaced, based on the established association between the specified placeholder and the specified sub-image to be replaced, thereby obtaining the target result of the image to be entered.
[0119] In other words, the sub-image to be replaced by the specified data is linked to the page containing the OCR recognition result through the associated specified placeholder.
[0120] For example, when using a browser to execute the data entry method provided in this embodiment of the invention, placeholders can be specified. The tag links the specified data to the sub-image to be replaced to the HTML (Hyper Text Markup Language) page.
[0121] For example, Table 1 is a specified table representing the relationship between specified data in a specified format, transition data in a preset format, sub-images to be replaced, and specified placeholders.
[0122] Table 1 shows a portion of the tables specified above.
[0123] Table 1
[0124] Specified data in a specified format Transition data in preset format Sub-image to be replaced Specify placeholder A a <![CDATA[T A ]]> <![CDATA[Z A ]]> B b <![CDATA[T B ]]> <![CDATA[Z B ]]> C c <![CDATA[T C ]]> <![CDATA[Z C ]]>
[0125] In this process, after converting the specified data A to obtain transition data a in a preset format, image conversion can be performed on the transition data a to obtain the sub-image T to be replaced by the specified data A. A Therefore, it is possible to establish information about the specified placeholder Z. A The sub-image T to be replaced with specified data A A The correlation relationship is then used to identify the sub-image T to be replaced. A The specified placeholder Z A Replace the specified data A; after converting the specified data B to obtain transition data b in a preset format, the transition data b can be converted into an image to obtain the sub-image T to be replaced by the specified data B. B Therefore, it is possible to establish information about the specified placeholder Z. B The sub-image T to be replaced with specified data B B The correlation relationship is then used to identify the sub-image T to be replaced. B The specified placeholder Z B Replace the specified data B; after converting the specified data C to obtain transition data c in a preset format, the transition data c can be converted into an image to obtain the sub-image T to be replaced by the specified data C. C Therefore, it is possible to establish information about the specified placeholder Z. C The sub-image T to be replaced with specified data C C The correlation relationship is then used to identify the sub-image T to be replaced. C The specified placeholder Z C Replace the specified data C above.
[0126] Thus, after obtaining the sub-image to be replaced, we can use Table 1 above to determine the designated placeholder associated with the sub-image to be replaced, and then use the designated placeholder to replace the designated data to obtain the target result.
[0127] S105: Input the target data indicated by the user in the target result into the preset input area.
[0128] After obtaining the target result of the image to be entered, the target result can be output to the user. After receiving the target result, the user can select target data from the target result. Thus, after receiving the target data indicated by the user in the target result, the target data indicated in the target result is input into the preset input area.
[0129] Optionally, users can select all the content in the above-mentioned images to be entered for data entry.
[0130] Optionally, users can select a portion of the image to be entered for data entry.
[0131] This avoids having to perform steps S101-S105 multiple times on the same image when entering data for only part of the image, thereby improving the speed of data entry.
[0132] Alternatively, in one specific implementation, such as Figure 4 As shown, step S105 above may include the following steps S1051-S1052:
[0133] S1051: When a data selection operation sent by a user is detected, the target data indicated by the data selection operation in the target result is determined;
[0134] S1052: When a user sends a data entry operation, the target data is entered into the preset entry area.
[0135] In this specific implementation, after obtaining the target result of the image to be entered, the target result can be sent to the user. When a data selection operation sent by the user is detected, the target data indicated by the data selection operation in the target result is determined, and when a data entry operation sent by the user is detected, the target data is input into a preset entry area.
[0136] Optionally, in one specific implementation, the recognition result includes: each data in the image to be entered and the position information of each data; before inputting the target data indicated by the user in the target result into the preset input area in step S105 above, the following step 11 may be included:
[0137] Step 11: Based on the location information of each data point, label each data point in the target result with a specified type;
[0138] Accordingly, step S105 above may include the following step 1051:
[0139] Step 1051: When it is detected that the user performs a specified operation on each target marker in the target result, the data marked by the target marker is determined as the target data.
[0140] In this specific implementation, after obtaining the target result of the image to be entered, the position information of each data in the image to be entered in the recognition result of the image to be entered can be used to mark each data in the target result with a specified type. Thus, when it is detected that the user performs a specified operation on each target mark in the target result, the data marked by the target mark is determined as the target data.
[0141] Optionally, data selection operations may include point selection and selection of a specified area by drawing a box.
[0142] For example, such as Figure 5 The diagram shown is an illustration of a designated area provided by the present invention. Figure 5 In the middle, 500 refers to a specified area 500, and the data within this specified area 500 is the target data; Figure 5 Each 501 in the target result is a piece of data with a specified type of label added. Therefore, based on the user's click operation, each piece of data with a specified type of label can be directly selected as the target data.
[0143] In this way, once the target data is determined, the target data can be entered into the preset input area when a data entry operation sent by the user is detected.
[0144] Optionally, the data entry operation described above may include a copy-paste operation. Upon detecting a copy-paste operation sent by the user, the target data is copied and then pasted into a preset data entry area.
[0145] Optionally, when inputting target data into a preset input area, the target data can be sorted in a specified order and automatically assigned a new serial number, thereby avoiding a large amount of manual intervention and further improving the speed of data input.
[0146] For example, such as Figure 6 The illustration shown is a specific embodiment of the present invention. In the above... Figure 5In the test paper, after detecting a user's selection of a specified area, the system uses the question options within the specified area 500 indicated by the selection as the target data. Upon detecting a copy-paste operation, the system copies the question options from the specified area 500 and pastes them into a preset input area 600. Within the input area 600, the question options are sorted in a specified order, and new serial numbers are automatically assigned to them.
[0147] For ease of understanding, Figure 7(a) shows a flowchart of a specific embodiment of the present invention.
[0148] In Figure 7(a), step one is: clicking on the page to upload an image of a test paper, and step two is: the image is successfully uploaded and displayed on the left side of the page, which is the acquisition of the image to be entered in this embodiment of the invention.
[0149] Step 3 in Figure 7(a): Call OCR to recognize the content in the image, obtain the content of each line and the corresponding coordinate information, which is the optical character recognition OCR processing of the image to be entered in this embodiment of the invention, and obtain the recognition result of the image to be entered. The recognition result includes: each data in the image to be entered and the position information of each data.
[0150] Step 4 in Figure 7(a): Parse the content data of each row, convert the formula content involved into a formula image that can be recognized by the browser, which is the format conversion of the specified data in the recognition result that belongs to the specified format in the embodiment of the present invention to obtain the transition data that belongs to the preset format; and perform image conversion on the transition data to obtain the sub-image to be replaced in the image format supported by the browser.
[0151] Step 5 in Figure 7(a): Package the parsing results of the recognition into relevant data and send the response to the browser. This is the embodiment of the present invention, which replaces the specified data in the recognition result with the sub-image to be replaced to obtain the target result.
[0152] Step 6 in Figure 7(a): Based on the data coordinate information provided by the browser, the specific position of each line of content is obtained, and each line of content is circled in red. This is the position information based on each data in the embodiment of the present invention. Each data in the target result is marked with a specified type.
[0153] Step 7 in Figure 7(a): The user selects the range by moving the mouse and locks the target row. This is the embodiment of the present invention, which determines the data marked by the target marker as the target data when it detects that the user has performed a specified operation on each target marker in the target result.
[0154] In step eight of Figure 7(a), the user can input ctrl+c / command+c to copy the target line content in the browser, and in step nine, the user can click on the text box area of the editor and input ctrl+v / command+v to paste the content. This means that when the copy and paste operation sent by the user is detected, the target data is copied and pasted into the preset input area in this embodiment of the invention.
[0155] On the browser page, the user clicks the image upload button to upload an image of a test paper. Upon successful upload, the image is displayed in the designated image display area on the left side of the page. Then, OCR can be used to perform content recognition on the image, obtaining each line of content and its corresponding coordinates. Furthermore, data parsing can be performed on each line, converting any formulas into browser-recognizable formula images. Finally, the parsed results can be packaged and sent to the browser.
[0156] In this way, the exact location of each line of content can be determined based on the data coordinate information provided by the browser, and each line of content can be circled in red. Users can use the mouse to circle the selected area, thereby locking the target line for data entry. Then, users can copy the target line content by pressing Ctrl+C / Command+C, and paste the content by pressing Ctrl+V / Command+V, thus completing the data entry for the target line in the above image.
[0157] For example, as shown in Figure 7(b), it is a schematic diagram of the specific process of steps three, four and five in Figure 7(a) above.
[0158] In Figure 7(b), the determination of the recognition mode based on the subject is the determination of whether the image to be entered contains specified data in a specified format according to the present invention.
[0159] In Figure 7(b), the query OCR returns a character array to find the formula character content (Letax format). If the image to be entered contains specified data in a specified format, then the OCR with specified format recognition function is used to recognize the image to be entered to obtain the recognition result of the image to be entered.
[0160] The formula character content in Figure 7(b) is replaced with a specified placeholder, which is the specified placeholder replacement for specified data in this embodiment of the invention;
[0161] The formula format conversion in Figure 7(b): Letax→MATHML is a method of converting specified data in the recognition result that belongs to a specified format in an embodiment of the present invention to obtain transitional data that belongs to a preset format;
[0162] The MATHML formula list after record conversion in Figure 7(b), as well as the position of the Letx formula list and the corresponding position of the MATHML formula list, are the specified tables used in this embodiment of the invention to characterize the association relationship between specified data in a specified format, transition data in a preset format, sub-images to be replaced, and specified placeholders.
[0163] Figure 7(b) shows the call to the formula conversion service, which batch converts MATHML formulas into img(image, picture) tags. This embodiment of the invention uses the specified placeholders associated with the sub-images to be replaced to replace the specified data.
[0164] In Figure 7(b), the specified placeholder is replaced with the formula img tag according to the location information. This is an embodiment of the present invention that uses the specified placeholder associated with the sub-image to be replaced to replace the specified data in the recognition result; in Figure 7(b), character concatenation is performed, and the returned result is the target result obtained in this embodiment of the present invention.
[0165] Users select the appropriate recognition mode based on the subject. If the image does not contain a formula, the user can query the OCR-returned character array, concatenate the characters, and return the result. If the image contains a formula, the user can query the OCR-returned character array, find the formula character content (Letax format), replace the formula character content with a specified placeholder, and then convert the formula character content from Letax format to MATHML format using formula format conversion.
[0166] The program records the list of converted MATHML formulas. Based on the recorded positions of the Letx formulas and their corresponding MATHML formulas, it calls a formula conversion service to batch convert MATHML formulas into img tags. This allows the program to replace specified placeholders with formula img tags based on the aforementioned position information. It also enables the replacement of characters in the corresponding formula text with Letx format using formula img tags. Finally, the program concatenates the characters and returns the result.
[0167] As can be seen from the above, the data entry method provided by the embodiments of the present invention is applied to electronic devices. When entering data into an image, firstly, the image to be entered is acquired, and then optical character recognition (OCR) processing is performed on the image to be entered, thereby obtaining the recognition result of the image to be entered. In this way, the specified data in the recognition result belonging to a specified format can be converted into a sub-image to be replaced. Then, the specified data is replaced by a specified placeholder associated with the sub-image to be replaced to obtain the target result. Furthermore, the target data indicated by the user in the target result can be input into a preset input area.
[0168] Based on this, applying the solution provided in this embodiment of the invention, for specified data belonging to a specified format, the specified data can be replaced using the sub-image to be replaced. That is, for specified data such as formulas and characters in a specified format, image recognition can be performed on the specified data to obtain the sub-image to be replaced, and then the specified data can be replaced using the sub-image to be replaced. This avoids data garbled characters and errors during data entry, thereby improving the accuracy of data entry. Furthermore, users can select the data to be entered from the target results based on their own needs, further improving the data entry speed.
[0169] In some cases, the entered data can be stored in a designated storage space so that it can be retrieved directly from the designated storage space when used later, avoiding the need to repeatedly enter the same data.
[0170] Alternatively, in one specific implementation, such as Figure 8 As shown, this is a data entry method provided by an embodiment of the present invention. This method may further include the following step S801:
[0171] S801: Store the data in the input area into the specified storage space.
[0172] In this specific implementation, after the target data is input into the preset input area, the data in the input area can be stored in the specified storage space.
[0173] Optionally, after each input is made into the above input area, the data in the above input area can be stored in the specified storage space.
[0174] Optionally, for an image to be entered, after all the target data selected in the image to be entered into the above-mentioned entry area, all the data in the above-mentioned entry area can be stored in the specified storage space.
[0175] Optionally, a specified storage space can be used to store one type of data.
[0176] In some cases, after the target data is entered into the preset input area, the data in the input area may contain errors. Therefore, in order to improve the accuracy of data entry, if there are errors in the data in the input area, the erroneous data can be modified.
[0177] Based on this, in one optional implementation, such as Figure 9 As shown, this is a data entry method provided by an embodiment of the present invention. This method may further include the following step S901:
[0178] S901: Modify the data in the input area based on the modification command sent by the user.
[0179] In this specific implementation, after the target data is input into the preset input area, if there are errors in the data in the input area, the erroneous data in the input area can be modified based on the modification command sent by the user, thereby improving the accuracy of data input.
[0180] Optionally, the data entry method provided in this embodiment of the invention is applied to a browser in an electronic device; the image format of the sub-image to be replaced is an image format supported by the browser.
[0181] Corresponding to the data entry method provided in the above embodiments of the present invention, the present invention also provides a data entry device.
[0182] Figure 10 This is a schematic diagram of the structure of a data entry device provided in an embodiment of the present invention, as shown below. Figure 10 As shown, the device may include the following modules:
[0183] Image acquisition module 1010 is used to acquire the image to be entered;
[0184] The image recognition module 1020 is used to perform optical character recognition (OCR) processing on the image to be entered, and obtain the recognition result of the image to be entered;
[0185] Image conversion module 1030 is used to convert specified data of a specified format in the recognition result into a sub-image to be replaced;
[0186] The result acquisition module 1040 is used to replace the specified data with a specified placeholder associated with the sub-image to be replaced, so as to obtain the target result.
[0187] The data entry module 1050 is used to input the target data indicated by the user in the target result into a preset entry area.
[0188] As can be seen from the above, the data entry method provided by the embodiments of the present invention is applied to electronic devices. When entering data into an image, firstly, the image to be entered is acquired, and then optical character recognition (OCR) processing is performed on the image to be entered, thereby obtaining the recognition result of the image to be entered. In this way, the specified data in the recognition result belonging to a specified format can be converted into a sub-image to be replaced. Then, the specified data is replaced by a specified placeholder associated with the sub-image to be replaced to obtain the target result. Furthermore, the target data indicated by the user in the target result can be input into a preset input area.
[0189] Based on this, applying the solution provided in this embodiment of the invention, for specified data belonging to a specified format, the specified data can be replaced using the sub-image to be replaced. That is, for specified data such as formulas and characters in a specified format, image recognition can be performed on the specified data to obtain the sub-image to be replaced, and then the specified data can be replaced using the sub-image to be replaced. This avoids data garbled characters and errors during data entry, thereby improving the accuracy of data entry. Furthermore, users can select the data to be entered from the target results based on their own needs, further improving the data entry speed.
[0190] Optionally, in one specific implementation, the image conversion module 1030 is specifically used for:
[0191] The specified data in the recognition results that belong to a specified format are converted to obtain transition data that belongs to a preset format; and the transition data is converted to obtain the sub-image to be replaced.
[0192] Optionally, in one specific implementation, the data entry module 1050 includes:
[0193] The selection submodule is used to determine the target data indicated by the data selection operation in the target result when a data selection operation sent by the user is detected.
[0194] The data entry submodule is used to input the target data into a preset data entry area when the user sends a data entry operation.
[0195] Optionally, in one specific implementation, the recognition result includes: each data point in the image to be entered and the position information of each data point; the device further includes a marking module:
[0196] The marking module is used to mark each piece of data in the target result with a specified type based on the location information of each piece of data before the target data indicated by the user in the target result is input into the preset input area.
[0197] The selection submodule is specifically used to: when it detects that the user has performed a specified operation on each target marker in the target result, determine the data marked by the target marker as the target data.
[0198] Optionally, in one specific implementation, the device further includes a judgment module:
[0199] The judgment module is used to determine whether the specified data in the specified format exists in the image to be entered before performing optical character recognition (OCR) processing on the image to be entered to obtain the recognition result of the image to be entered.
[0200] The image recognition module 1020 is specifically used to: if the image to be entered contains specified data in the specified format, then use an OCR with the specified format recognition function to recognize the image to be entered, and obtain the recognition result of the image to be entered.
[0201] Optionally, in one specific implementation, the device further includes a storage module:
[0202] The storage module is used to store the data in the input area into a designated storage space.
[0203] Optionally, in one specific implementation, the device further includes a modification module:
[0204] The modification module is used to modify the data in the input area based on the modification command sent by the user.
[0205] Optionally, in one specific implementation, the device is applied to a browser in the electronic device; the image format of the sub-image to be replaced is an image format supported by the browser.
[0206] Corresponding to the data entry method provided in the above embodiments of the present invention, the present invention also provides an electronic device, such as... Figure 11 As shown, it includes a processor 1101, a communication interface 1102, a memory 1103, and a communication bus 1104. The processor 1101, communication interface 1102, and memory 1103 communicate with each other via the communication bus 1104.
[0207] Memory 1103 is used to store computer programs;
[0208] The processor 1101, when executing the program stored in the memory xx3, implements the steps of any of the data entry methods provided in the above embodiments of the present invention.
[0209] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0210] The communication interface is used for communication between the aforementioned electronic devices and other devices.
[0211] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0212] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0213] In another embodiment of the present invention, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements the steps of any of the above data entry methods.
[0214] In another embodiment of the present invention, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the data entry methods described above.
[0215] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).
[0216] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0217] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device embodiments, electronic device embodiments, computer-readable storage medium embodiments, and computer program product embodiments are basically similar to the method embodiments, and therefore the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0218] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.
Claims
1. A data entry method, characterized by, The method is applied to an electronic device, and the method comprises: obtaining an image to be input; performing optical character recognition (OCR) processing on the image to be input to obtain a recognition result of the image to be input; converting specified data in the recognition result that belongs to a specified format into a sub-image to be replaced; replacing the specified data with a specified placeholder associated with the sub-image to be replaced to obtain a target result; wherein the sub-image to be replaced of the specified data is linked to a page where the recognition result after OCR is located through the associated specified placeholder; inputting target data indicated by a user in the target result into a preset input area; wherein the inputting of the target data indicated by the user in the target result into the preset input area comprises: when detecting a data selection operation sent by the user, determining target data indicated by the data selection operation in the target result; when detecting a data input operation sent by the user, inputting the target data into the preset input area; the method further comprises: modifying data in the input area based on a modification instruction sent by the user.
2. The method of claim 1, wherein, the converting of the specified data in the recognition result that belongs to the specified format into the sub-image to be replaced comprises: performing format conversion on the specified data in the recognition result that belongs to the specified format to obtain transition data that belongs to a preset format; and performing image conversion on the transition data to obtain the sub-image to be replaced.
3. The method of claim 1, wherein, the recognition result comprises each data in the image to be input and position information of each data; before the inputting of the target data indicated by the user in the target result into the preset input area, the method further comprises: based on the position information of each data, performing a specified type of marking on each data in the target result; the determining of the target data indicated by the data selection operation in the target result when detecting the data selection operation sent by the user comprises: when detecting a specified operation performed by the user on each target mark in the target result, determining data marked by the target mark as target data.
4. The method of claim 1, wherein, before the performing of the optical character recognition (OCR) processing on the image to be input to obtain the recognition result of the image to be input, the method further comprises: judging whether there is specified data in the specified format in the image to be input; the performing of the optical character recognition (OCR) processing on the image to be input to obtain the recognition result of the image to be input comprises: if there is specified data in the specified format in the image to be input, performing recognition on the image to be input by using an OCR with the specified format recognition function to obtain the recognition result of the image to be input.
5. The method of claim 1, wherein, the method further comprises: storing data in the input area into a specified storage space.
6. The method according to any one of claims 1 to 5, characterized in that, the method is applied to a browser in the electronic device; and an image format of the sub-image to be replaced is an image format supported by the browser.
7. A data entry device, characterized by The device is applied to an electronic device, and the device comprises: an image obtaining module configured to obtain an image to be input; An image recognition module is configured to perform optical character recognition (OCR) on the image to be inputted to obtain a recognition result of the image to be inputted. An image conversion module is configured to convert specified data in the recognition result in a specified format into a sub-image to be replaced. A result obtaining module is configured to replace the specified data with a specified placeholder associated with the sub-image to be replaced to obtain a target result, wherein the sub-image to be replaced of the specified data is linked to a page where the recognition result after OCR is located through the specified placeholder. A data input module is configured to input target data indicated by a user in the target result into a preset input area. The data input module includes: A selection sub-module is configured to determine target data indicated by a data selection operation of the user in the target result when the data selection operation is detected. An input sub-module is configured to input the target data into the preset input area when a data input operation of the user is detected. The device further includes a modification module. The modification module is configured to modify data in the input area based on a modification instruction of the user.
8. The apparatus of claim 7, wherein, The image conversion module is specifically configured to: perform format conversion on the specified data in the recognition result in the specified format to obtain transition data in a preset format, and perform image conversion on the transition data to obtain the sub-image to be replaced.
9. The apparatus of claim 7, wherein, The recognition result includes each data and position information of each data in the image to be inputted, and the device further includes a marking module. The marking module is configured to mark each data in the target result in a specified type based on the position information of each data before the target data indicated by the user in the target result is inputted into the preset input area. The selection sub-module is specifically configured to determine data marked by each target mark in the target result as target data when a specified operation of the user on each target mark in the target result is detected.
10. The apparatus of claim 7, wherein, The device further includes a judgment module. The judgment module is configured to judge whether there is specified data in the specified format in the image to be inputted before performing OCR on the image to be inputted to obtain the recognition result of the image to be inputted. The image recognition module is specifically configured to perform recognition on the image to be inputted by using an OCR with the specified format recognition function to obtain the recognition result of the image to be inputted if there is specified data in the specified format in the image to be inputted.
11. The apparatus of claim 7, wherein, The device further includes a storage module. The storage module is configured to store data in the input area into a specified storage space.
12. The device of any one of claims 7-11, wherein, The device is applied to a browser in the electronic device, and an image format of the sub-image to be replaced is an image format supported by the browser.
13. An electronic device, comprising: The device includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus. The memory is configured to store a computer program. A processor for implementing the method steps of any one of claims 1-6 when the processor executes a program stored on a memory.
14. A computer-readable storage medium, characterized in that, A computer program stored in the computer readable storage medium, the computer program being executed by a processor to implement the method steps of any one of claims 1-6.
Citation Information
Patent Citations
Data replacement method and system
CN104715497A