A method and system for recognizing device data based on OCR and generating a data form
By combining OCR, PCA, and SVM with a BiLSTM+Attention model, device data forms are automatically identified and generated, solving the problems of inaccurate and wasteful data caused by manual entry, and achieving efficient collection and classification of device information.
Patent Information
- Application Number
- CN202211480189.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-24
- Publication Date
- 2026-01-16
- Estimated Expiration
- 2042-11-24
AI Technical Summary
Manually entering equipment nameplate information cannot identify metadata or extract data feature attributes, resulting in inaccurate standard classification metadata information, wasting manpower costs, and failing to achieve data classification.
OCR technology is used in combination with PCA and SVM for device data recognition. A data model is generated through BiLSTM+Attention model to dynamically generate data forms, thereby achieving automated data entry and classification.
It has enabled automated collection and classification of equipment information, improved the accuracy of data identification, reduced labor costs, and ensured the integrity and accuracy of data standard classification.
Smart Images

Figure CN115719495B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data recognition, in particular to a method and system for recognizing equipment data based on OCR and generating a data form. BACKGROUND
[0002] OCR (optical character recognition) is a process of recognizing characters printed on paper by an electronic device (such as a scanner or a digital camera), and then translating the shapes into computer characters by character recognition methods; that is, scanning text materials, and then analyzing and processing image files to obtain character and layout information. How to debug or use auxiliary information to improve the recognition accuracy is the most important topic of OCR. The main indicators to measure the performance of an OCR system are: rejection rate, misrecognition rate, recognition speed, user interface friendliness, product stability, ease of use, and feasibility.
[0003] At present, for some large-scale manufacturers and procurement units that need to purchase a large number of equipment, each piece of equipment has its own nameplate information. The traditional information input method is to manually collect goods, check goods, record equipment nameplate information on site, and manually analyze and input metadata into a data storage system. Manual data input cannot recognize metadata and cannot extract data feature attributes, resulting in inaccurate standard classification metadata information, which not only wastes labor costs but also does not achieve data classification. SUMMARY
[0004] In view of the deficiencies of the prior art, the present application provides a method and system for recognizing equipment data based on OCR and generating a data form, which solves the problem of inaccurate standard classification metadata information caused by manual data input that cannot recognize metadata and cannot extract data feature attributes, which not only wastes labor costs but also does not achieve data classification.
[0005] To achieve the above purpose, the present application is implemented by the following technical scheme: a method for recognizing equipment data based on OCR and generating a data form, comprising the following steps:
[0006] Step 1: receiving picture information to be processed, processing by a picture processing module, then extracting a feature code by PCA and sending it to an SVM simulation test, judging the belonging category according to the SVM output item, identifying and outputting classification sample data;
[0007] Step 2: scanning the classification sample data in step 1, obtaining a template character library based on OCR technology, obtaining a feature value by SnowNLP technology, establishing a BiLSTM+Attention model, naming the recognized data, generating a data model and outputting;
[0008] Third step: receiving data model, obtaining data table header field, judging whether the current type of data standard business data table exists, and finally outputting data standard business data;
[0009] Fourth step: receiving data standard business data, and dynamically generating data standard form.
[0010] Further, the processing of the picture information in the first step specifically includes the following steps:
[0011] S1, the picture processing module receives a picture containing equipment nameplate information to be processed, and the picture is collected by a photographing device;
[0012] S2, based on the PCA technology, the feature code of each sample is extracted, and the feature code is sent to the SVM training;
[0013] S3, based on the PCA technology, the feature code of the image to be classified is generated, and the feature code of the image to be classified is sent to the SVM simulation test;
[0014] S4, according to the SVM output item, the belonging category is judged, and the output target is identified.
[0015] Further, the step of sending the feature code to the SVM training in S2 specifically includes the following steps:
[0016] S21, generating an input item according to the sample feature code, and generating a corresponding output item according to the sample belonging category;
[0017] S22, the input item and the output item are sent to the SVM training, and the image features are learned.
[0018] Further, the step of generating a data model in the second step specifically includes the following steps:
[0019] S1, receiving and scanning the classified sample data in the first step;
[0020] S2, obtaining a template character library according to the OCR technology, labeling the obtained data in key-value pairs, and identifying the Key value in the template;
[0021] S3, training through SnowNLP technology to obtain feature values;
[0022] S4, the data in S3 is trained by a supervised learning method, the data set generated by S3 is calculated to obtain the data type corresponding to each word entry, and the data type is added to the word entry;
[0023] S5, based on the result of S4, a BiLSTM+Attention model is established, the recognized data is named, the key value of the model data field is determined, and the data model is output.
[0024] Further, the S1 receives the classification sample data and scans specifically includes:
[0025] S11, all images are stored in a multi-dimensional array in order, and each pixel of the image data is divided by 255 to convert to a value of 0 to 1;
[0026] S12, mean-variance normalization processing is performed on the image, each image is subtracted by the mean value of the data and divided by the variance of the data set, and the data set is additionally subjected to certain data enhancement;
[0027] S13, the picture text information is identified by OCR scanning technology.
[0028] Further, the template character library in the S2 includes standard characters and features of the standard characters;
[0029] The Character-Based Generative Model algorithm is used in the S3 to perform word segmentation vector training and extract information commonality data;
[0030] In the S5, when the BiLSTM+Attention model is established, the Boson named entity recognition data is used for named entity recognition.
[0031] Further, the third step of judging whether the current type of data standard business data table exists specifically includes the following steps:
[0032] S1, receiving model data and obtaining the table header field of the data;
[0033] S2, judging whether the current type of data standard business data table exists, if not, creating a data standard business table and recording in the database;
[0034] If yes, check whether the business data exists, if not, record in the database;
[0035] If not, discard the data;
[0036] S3, outputting the data standard business data.
[0037] Further, the fourth step of dynamically generating a data standard form specifically includes the following steps:
[0038] S1, obtaining standard business data by calling an Api interface;
[0039] S2, rendering the standard data to an information system through a UI component and outputting an information form.
[0040] Further, before receiving the model data in the third step, the data model generated in the second step is converted into a json format.
[0041] A system for recognizing device data based on OCR and generating a data form, comprising:
[0042] A picture processing module, through which picture information to be processed is received, a feature code is extracted through PCA and sent to SVM simulation testing, and a belonging category is judged according to an SVM output item, and a classification sample data is output after identification;
[0043] A data model generation module, configured to scan the classification sample data, acquire a template character library based on OCR technology, acquire a feature value through SnowNLP technology, establish a BiLSTM+Attention model, name the recognized data, generate a data model and output;
[0044] A business module, configured to receive the data model, acquire a data table header field, judge whether a data standard business data table of a current type exists, and finally output data standard business data;
[0045] A WEB end, configured to receive the data standard business data and dynamically generate a data standard form.
[0046] The present application has the following beneficial effects:
[0047] In the data center implementation scenario, device information is collected from multiple levels and multiple dimensions, device physical data is collected, image recognition model training is performed, image processing, character recognition, feature data extraction and dimension reduction classification, data calculation and other processes are performed, metadata is extracted and stored in a database, data is rendered to an informationization interface through the mode of dynamically generating a form, thereby solving the problem that in the prior art, manual data entry cannot recognize metadata and cannot extract data feature attributes, leading to inaccurate standard classification metadata information, which not only wastes human cost but also does not realize data classification.
[0048] Of course, implementing any product of the present application does not necessarily need to achieve all the advantages described above at the same time. BRIEF DESCRIPTION OF DRAWINGS
[0049] Figure 1 A method flowchart of the present application;
[0050] Figure 2 A sampling nameplate schematic diagram of the present application;
[0051] Figure 3 A SnowNLP tokenizer segmentation processing result schematic diagram of the present application;
[0052] Figure 4 A processing result schematic diagram of the present application after data type is added to a word entry;
[0053] Figure 5A schematic diagram of a processing result of data modeling of the present application;
[0054] Figure 6 A schematic diagram of a processing result of data model conversion to json format of the present application;
[0055] Figure 7 A schematic diagram of a data form of the present application. DETAILED DESCRIPTION
[0056] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0057] In the description of the present application, it should be understood that the terms "opening", "upper", "lower", "thickness", "top", "middle", "length", "inner", "periphery" and the like indicate the orientation or positional relationship, which are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the components or elements referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as a limitation of the present application.
[0058] Referring to Figures 1-7 The embodiment of the present application provides a technical solution: a method for generating a data form based on OCR recognition of device data, comprising the following steps:
[0059] Step 1: receiving image information to be processed, processing through an image processing module, then extracting a feature code through PCA and sending it to an SVM simulation test, judging the category according to the SVM output item, identifying and outputting the classification sample data;
[0060] Step 2: scanning the classification sample data in step 1, obtaining a template font library based on OCR technology, obtaining a characteristic value through SnowNLP technology, establishing a BiLSTM+Attention model, naming the recognized data, generating a data model and outputting;
[0061] Step 3: receiving the data model, obtaining the data table header field, judging whether the current type of data standard business data table exists, and finally outputting the data standard business data;
[0062] Step 4: receiving the data standard business data, dynamically generating a data standard form.
[0063] Specifically, the processing of the image information in step 1 includes the following steps:
[0064] S1, the picture processing module receives a picture containing equipment nameplate information that needs to be processed, and the picture is collected by a photographing device;
[0065] S2, based on the PCA technology, the feature code of each sample is extracted, and the feature code is sent to the SVM training;
[0066] S3, based on the PCA technology, the feature code of the image to be classified is generated, and the feature code of the image to be classified is sent to the SVM simulation test;
[0067] S4, according to the SVM output item, the belonging category is judged, and the output target is identified.
[0068] In the embodiment, the equipment information nameplate is collected by a photographing device, the picture to be processed is uploaded to the picture processing module, the image data is classified and processed, the sample image feature code and the feature code of the image to be classified are extracted by the PCA technology, then the feature code is sent to the SVM for training, the image features of each category are learned, finally the image of unknown category is sent to the SVM simulation test, and the type thereof is automatically recognized;
[0069] Then the feature code of the image to be classified is generated by the PCA technology, and is sent to the SVM for simulation test as an input item, and the type thereof is automatically recognized by the SVM.
[0070] Specifically, the step of sending the feature code to the SVM training in S2 specifically includes the following steps:
[0071] S21, generating an input item according to the sample feature code, and generating a corresponding output item according to the category to which the sample belongs;
[0072] S22, sending the input item and the output item to the SVM training, and learning the image features.
[0073] In the embodiment, the step of sending the feature code to the SVM training specifically includes: first extracting the feature code of each sample image by the PCA technology, generating an input item according to the sample feature code, generating a corresponding output item according to the category to which the sample belongs, inputting the input item and the output item into the SVM for training, and learning the image features.
[0074] Specifically, the step of generating a data model in the second step specifically includes the following steps:
[0075] S1, receiving the classified sample data in the first step and scanning;
[0076] S2, obtaining a template character library according to the OCR technology, labeling the obtained data in a key-value pair, and identifying the Key value in the template;
[0077] S3, training by the SnowNLP technology to obtain a feature value;
[0078] S4, the data in S3 is trained by a supervised learning method, the data set generated by S3 is calculated to correspond to the data type of each word entry, and the data type is added to the word entry;
[0079] S5, based on the result of S4, a BiLSTM+Attention model is established and the data is analyzed, the recognized data is named, the key value of the model data field is determined, and the data model is output;
[0080] The template character library in S2 includes standard characters and features of standard characters;
[0081] In S3, Character-Based Generative Model algorithm is used for word segmentation vector training to extract information common data;
[0082] In S5, when establishing the BiLSTM+Attention model, Boson named entity recognition data is used for named entity recognition.
[0083] In the embodiment, after receiving the classification sample data, the key value in the template is identified by scanning the result, the above data is processed by SnowNLP word segmentation technology, Character-Based Generative Model algorithm is used for word segmentation vector training, and information common data is extracted, so that the target data is processed;
[0084] Through supervised learning, the data set generated by using SnowNLP word segmentation technology is trained, the data type corresponding to the value of each word entry is calculated, and the data type is added to the word entry. BiLSTM+Attention model is established, Boson named entity recognition data is used for named entity recognition, the recognized data is named, a data model is generated, the BiLSTM+Attention model is analyzed, the key value of the model data field is determined, and the data model is output.
[0085] Specifically, S1 receives classification sample data and scans specifically including:
[0086] S11, all images are stored in a multi-dimensional array according to the order, and each pixel of the image data is divided by 255 to convert to a value of 0 to 1;
[0087] S12, mean and variance normalization processing is performed on the image, each image is subtracted by the mean value of the data value and divided by the variance of the data set, and the data set is subjected to certain data enhancement;
[0088] S13, the picture text information is recognized by OCR scanning technology.
[0089] In the embodiment, all images are stored in a multi-dimensional array in order, the image data is divided by 255 to convert to 0 to 1 value, then the images are subjected to mean variance normalization, each image is subtracted from the mean value of the data and divided by the variance of the data set, and the data set is subjected to certain data enhancement. The picture text information is recognized by the OCR scanning technology to obtain a template character library, wherein the template character library includes standard characters and features of the standard characters, and the scanned result is subjected to identification of related key-value pairs to identify the Key value in the template.
[0090] Specifically, the step of judging whether the data standard business data table of the current type exists in the third step specifically includes the following steps:
[0091] S1, receiving model data and obtaining the table header field of the data;
[0092] S2, judging whether the data standard business data table of the current type exists, if not, creating a data standard business table and recording in the database;
[0093] If yes, verifying whether the business data exists, if not, recording in the database;
[0094] If not, discarding the data;
[0095] S3, outputting the data standard business data.
[0096] In the embodiment, in the process, it is needed to judge whether the data standard business data table of the current type exists, if not, a data standard business table is created and recorded in the database; on the contrary, it is needed to further verify whether the business data exists, when not, the database is recorded, otherwise the data is discarded, and finally the data standard business data is outputted.
[0097] Specifically, the fourth step of dynamically generating a data standard form specifically includes the following steps:
[0098] S1, obtaining standard business data by calling an Api interface;
[0099] S2, rendering the standard data to an information system by a UI component and outputting an information form
[0100] In the embodiment, the Api interface standard business is called to obtain data, the front-end component is rendered to a form by a UI component, a data form is dynamically generated, the form is displayed by an information system, and the data standard classification is complete and accurate.
[0101] Specifically, before the step of receiving model data in the third step, the data model generated in the second step is converted into a json format.
[0102] In the embodiment, the data model is converted into a json format, transmitted to the service module, and data entry is performed by the service module.
[0103] A system for recognizing device data based on OCR and generating a data form, comprising:
[0104] A picture processing module, through which picture information to be processed is received, a feature code is extracted through PCA and sent to SVM simulation testing, and classified sample data is output after identification according to an SVM output item;
[0105] A data model generation module, configured to scan the classified sample data, obtain a template font library based on OCR technology, obtain a characteristic value through SnowNLP technology, establish a BiLSTM+Attention model, name the recognized data, generate a data model, and output the data model;
[0106] A service module, configured to receive the data model, obtain a data table header field, determine whether a data standard business data table of a current type exists, and finally output data standard business data.
[0107] A WEB end, configured to receive the data standard business data and dynamically generate a data standard form.
[0108] In the embodiment, the picture processing module receives picture information to be processed, extracts a feature code through PCA and sends it to SVM simulation testing, and classified sample data is output after identification according to an SVM output item; then the data model generation module scans the classified sample data, obtains a template font library based on OCR technology, obtains a characteristic value through SnowNLP technology, establishes a BiLSTM+Attention model, names the recognized data, generates a data model, and outputs the data model.
[0109] The service module receives the data model, obtains a data table header field, determines whether a data standard business data table of a current type exists, and finally outputs data standard business data; and the WEB end receives the data standard business data and dynamically generates a data standard form.
[0110] The procurement personnel reach the procurement equipment site, collect equipment information nameplates through photographing equipment, upload the pictures that need to be processed to the picture processing module, classify the image data, extract the sample image feature code and the to-be-classified image feature code through the PCA technology, then send the feature code to the SVM for training, the SVM is a generalized linear classifier for binary classification of data in a supervised learning manner, the decision boundary is a maximum margin hyperplane solved for the learning samples, and the image features of each class are learned, and finally the image of unknown class is sent to the SVM simulation test to automatically identify its type, which specifically includes: first, extract the feature code of each sample image through the PCA technology, generate the input item according to the sample feature code, and generate the corresponding output item according to the class to which the sample belongs, and input the input item and the output item into the SVM for training, and learn the image features;
[0111] Then the feature code of the to-be-classified image is generated through the PCA technology, and is sent to the SVM for simulation test, and the SVM automatically identifies its type and determines the device type;
[0112] As shown in Figure 2 , the sample image feature code is extracted by the PCA technology as "computer" and "ThinkCentre", then the feature code is sent to the SVM for training, the image features are learned, finally the image of unknown class is sent to the SVM simulation test, and the type of the image is automatically identified, and the device type is determined as: computer, model: ThinkCentre.
[0113] All images are stored in a multidimensional array in order, the image data of each pixel is divided by 255 to convert to a value of 0 to 1, then the image is subjected to mean and variance normalization processing, each image is subtracted from the mean value of the data and divided by the variance of the data set, and the data set is subjected to certain data enhancement. The picture text information is identified by the OCR scanning technology, and the template character library is obtained, wherein the template character library includes standard characters and features of the standard characters, and the scanned results are identified by related key-value pairs, and the Key value in the template is identified;
[0114] The above data is subjected to SnowNLP word segmentation technology for word segmentation processing, the Character-Based Generative Model algorithm is used for word segmentation vector training, common data of information is extracted, so that the target data is processed, and the key data extracted is as shown in Figure 3 .
[0115] SnowNLP is a python library that can conveniently process Chinese text content, and unlike TextBlob, all algorithms here are implemented by themselves, and some trained dictionaries are provided.
[0116] Character-Based Generative Model algorithm application, based on Generator generator (neural network), defines a probability distribution, extracts keywords through Character-Based algorithm, and calculates sample data model to be generated by the generator.
[0117] Through supervised learning method, the data set generated by adopting SnowNLP word segmentation technology is trained, the value corresponding to each word is calculated, and the data type is appended to the word, and the data is as shown in Figure 4 .
[0118] Based on the above results, Character-Based Generative Model model is established, Boson named entity recognition data is used for named entity recognition, the recognized data is named entity recognized, data model is generated, BiLSTM+Attention model is used for analysis, key value of model data field is determined, data model is output, and the results are as shown in Figure 5 .
[0119] The data model is converted into json format and passed to the service module, and the service module performs data entry. If the data exists, the data is discarded, and if the data does not exist, the data is added. The data format is as shown in Figure 6 .
[0120] In this process, it is necessary to determine whether the current type of data standard business data table exists. If it does not exist, create a data standard business table and enter the database. On the contrary, it is necessary to further verify whether the business data exists. When it does not exist, it can be entered into the database, otherwise the data is discarded, and finally the data standard business data is output.
[0121] The Api interface standard business data is called to obtain data, the front-end component is rendered form through UI component, the data form is dynamically generated, and the information system displays the form, as shown in Figure 7 .
[0122] It should be noted that in this paper, relationship terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between the entities or operations. Moreover, the term "includes", "contains" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or equipment.
[0123] The preferred embodiments of the application disclosed above are only to facilitate the elucidation of the application. The preferred embodiments do not describe all the details of the application and limit the application to the specific embodiments. Obviously, many modifications and variations can be made in light of the teachings above. The description is chosen and described in order to provide the best illustration of the application and its practical application to those skilled in the art and to enable those skilled in the art to best utilize the application. The application is limited only by the claims and their full scope and equivalents.
Claims
1. A method for recognizing device data based on OCR and generating a data form, characterized by: It comprises the following steps: The first step is to receive the picture information to be processed, process it through the picture processing module, then extract the feature code through PCA and send it to the SVM simulation test, judge the category according to the SVM output item, identify the output classification sample data; The second step is to scan the classification sample data in the first step, obtain the template character library based on the OCR technology, obtain the characteristic value through the SnowNLP technology, establish the BiLSTM+Attention model, name the recognized data, generate the data model and output; The third step is to receive the data model, obtain the data table header field, judge whether the data standard business data table of the current type exists, and finally output the data standard business data; The fourth step is to receive the data standard business data, and dynamically generate the data standard form; The second step of generating the data model specifically comprises the following steps: S1, receive the classification sample data in the first step and scan; S2, obtain the template character library according to the OCR technology, label the obtained data in key-value pairs, and identify the Key value in the template; S3, train through the SnowNLP technology to obtain the characteristic value; S4, train the data set generated by S3 through the supervised learning method, calculate the data type corresponding to the value of each word, and append the data type to the word; S5, based on the result of S4, establish the BiLSTM+Attention model and analyze the data, name the recognized data, determine the key value of the model data field, and output the data model; The template character library in S2 includes standard characters and characteristics of the standard characters; In S3, the Character-Based Generative Model algorithm is used for word segmentation vector training to extract common data of information; In S5, when establishing the BiLSTM+Attention model, Boson named entity recognition data is used for named entity recognition.
2. The method of claim 1, wherein: The first step of processing the picture information specifically comprises the following steps: S1, the picture processing module receives the picture containing the equipment nameplate information to be processed, and the picture is collected by a photographing device; S2, extract the feature code of each sample based on the PCA technology, and send the feature code to the SVM training; S3, generate the feature code of the image to be classified based on the PCA technology, and send the feature code of the image to be classified to the SVM simulation test; S4, judge the category according to the SVM output item, and identify the output target.
3. The method of claim 2, wherein: In S2, the feature code is sent to the SVM training, which specifically comprises the following steps: S21, generate the input item according to the sample feature code, and generate the corresponding output item according to the sample category; S22, send the input item and the output item to the SVM training, and learn the image features.
4. The method of claim 1, wherein: S1 receives the classification sample data and scans, which specifically comprises: S11, store all images in a multidimensional array in order, divide each pixel of the image data by 255, and convert it to a value of 0 to 1; S12, mean variance normalization processing is performed on the image, each image is subtracted by the mean value of the data value and divided by the variance of the data set, and the data set is additionally subjected to data enhancement; S13, the picture text information is recognized by an OCR scanning technology.
5. The method of claim 1, wherein: The third step of judging whether the data standard business data table of the current type exists specifically comprises the following steps: S1, receiving model data and obtaining the table header field of the data; S2, judging whether the data standard business data table of the current type exists, if not, creating a data standard business table and recording in a database; If yes, checking whether the business data exists, if not, recording in the database; If yes, discarding the data; S3, outputting the data standard business data.
6. The method of claim 1, wherein: The fourth step of dynamically generating a data standard form specifically comprises the following steps: S1, obtaining standard business data by calling an Api interface; S2, rendering the standard data to an information system by a UI component and outputting an information form.
7. The method of claim 1, wherein: Before receiving the model data in the third step, the data model generated in the second step is converted into a json format.
8. A system for recognizing device data based on OCR and generating a data form, for performing the method of any one of claims 1 to 7, characterized in that: It comprises: A picture processing module, which receives picture information to be processed through the picture processing module, extracts a feature code through PCA and sends it into an SVM simulation test, judges the belonging category according to the SVM output item, and outputs classified sample data after marking; A data model generation module, which is used for scanning classified sample data, obtaining a template font library based on an OCR technology, obtaining a characteristic value through SnowNLP technology, establishing a BiLSTM+Attention model, naming the recognized data, generating a data model and outputting; A business module, which is used for receiving data model, obtaining a data table header field, judging whether the data standard business data table of the current type exists, and finally outputting data standard business data; A WEB end, which is used for receiving data standard business data and dynamically generating a data standard form.
Citation Information
Patent Citations
Building classification and extraction models based on electronic forms
US20170109610A1
System and method for information extraction with character level features
US20200250417A1