Engineering energy industry equipment document and drawing position number automatic extraction system
The automated processing system enables rapid and accurate extraction of equipment document and drawing location numbers, solving the problem of heavy and inaccurate manual marking workload, improving data processing efficiency and accuracy, and reducing costs.
Patent Information
- Application Number
- CN202411673311.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-10-14
- Estimated Expiration
- 2044-11-21
AI Technical Summary
In digital factories, the association between the position numbers of equipment documents and drawings requires manual marking, which is labor-intensive and inaccurate.
The invention provides an automatic extraction system for the bit number of equipment documents and drawings in the engineering energy industry, which includes a document and drawing uploading module, a preprocessing module, an OCR module, a bit number information extraction module, a bit number position positioning module and an accuracy matching module. The automatic processing realizes the fast and accurate extraction of bit numbers.
It improves data processing speed and efficiency, reduces manual intervention and errors, reduces labor costs, and enhances data accuracy and timeliness.
Smart Images

Figure CN119559654B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of engineering energy industry, and particularly relates to an engineering energy industry equipment document and drawing position number automatic extraction system. BACKGROUND
[0002] In the management process of a digital factory, various types of material documents need to be associated with two-dimensional drawings and three-dimensional models, so that relevant equipment parameters, documents, drawings, etc. can be viewed through the equipment. This association is mainly performed in the form of equipment position numbers, but because it is unknown which position numbers are included in the documents and drawings, manual selection and marking of the position numbers are required, which is a very large workload and is not accurate enough. SUMMARY
[0003] Therefore, it is necessary to provide an engineering energy industry equipment document and drawing position number automatic extraction system in view of the above technical problems.
[0004] In a first aspect, the application provides an engineering energy industry equipment document and drawing position number automatic extraction system, comprising:
[0005] A document drawing uploading module is configured to upload a to-be-processed file to the system, wherein the file comprises a document and / or a drawing.
[0006] A document drawing preprocessing module is configured to preprocess the uploaded file to obtain a target file.
[0007] A document drawing OCR module is configured to perform OCR identification on the target file, extract text in the file, and obtain text information.
[0008] A position number information extraction module is configured to match the text information according to a preset rule, and extract to obtain position number information that meets the preset rule.
[0009] A position number position positioning module is configured to position the position number information to a position number position of the target file to obtain position number position information.
[0010] A position number accuracy rate matching module is configured to perform similarity matching between the position number information and position numbers in an existing position number library to obtain position number information with the highest similarity.
[0011] An extraction result storage module is configured to store the position number information with the highest similarity and the corresponding position number position information.
[0012] In some implementations, the document drawing preprocessing module is configured to preprocess the uploaded file to obtain a target file, comprising:
[0013] The document drawing preprocessing module is used to smooth the noise points in the document using a filtering algorithm to obtain a first intermediate file;
[0014] The document drawing preprocessing module is configured to detect the smeared area of the first intermediate file by using an opening operation, and restore the smeared area by using adjacent pixel interpolation or fuzzy filling to obtain a second intermediate file;
[0015] The document drawing preprocessing module is used to process the residual stains in the background of the second intermediate file using an adaptive threshold segmentation method to obtain a third intermediate file;
[0016] The document drawing preprocessing module is used to detect the straight line features of the third intermediate file using Hough transform to obtain the deflection angle of the third intermediate file;
[0017] The document drawing preprocessing module is used to adjust the third intermediate file according to the deflection angle of the third intermediate file to obtain a target file.
[0018] In some implementations, the document drawing OCR module is used to perform OCR recognition on the target file, extract text from the file, and obtain text information, including:
[0019] The document drawing OCR module is used to identify the position of the text area in the target file using an edge detection algorithm;
[0020] The document drawing OCR module is used to extract the text in the text area to obtain text information.
[0021] In some practicable embodiments, the bit number information extraction module is configured to match the text information according to preset rules and extract bit number information that meets the preset rules, including:
[0022] The bit number information extraction module is used to construct the preset rule, wherein the preset rule represents a regular expression;
[0023] The bit number information extraction module is used to match the text information according to the preset rules to obtain text information that meets the preset rules;
[0024] The bit number information extraction module is used to extract text information that meets the preset rules to obtain bit number information that meets the preset rules.
[0025] In some practicable manners, the bit number position locating module is used to locate the bit number information at the bit number position of the target file to obtain the bit number position information, including:
[0026] The bit number position positioning module is used to map the bit number information back to the coordinate system of the target file to obtain the coordinates of the bit number information in the coordinate system;
[0027] The position number location module is used to construct a marking layer with a coordinate system on the target file;
[0028] The bit number position positioning module is used to mark the corresponding coordinate position on the marking layer according to the coordinates of the bit number information in the coordinate system, so as to obtain the marking layer of the bit number position information.
[0029] In some practicable embodiments, the bit number accuracy matching module is configured to perform similarity matching between the bit number information and the bit numbers in an existing bit number library to obtain the bit number information with the highest similarity, including:
[0030] The position number accuracy matching module is used to calculate the distance between each position number information and the position numbers in the existing position number library using the edit distance to obtain a distance result;
[0031] The position number accuracy matching module is used to determine the position number information with the highest similarity based on the distance result.
[0032] In some practicable manners, the extraction result storage module is used to store the bit number information with the highest similarity and the corresponding bit number position information, including:
[0033] The extraction result storage module is used to obtain the bit number information with the highest similarity and the corresponding bit number position information;
[0034] The extraction result storage module is used to form structured data from the bit number information with the highest similarity and the corresponding bit number position information to obtain a key-value pair;
[0035] The extraction result storage module is used to store key-value pairs.
[0036] In a second aspect, the present application provides a method for automatically extracting device documentation and drawing reference numbers in the engineering energy industry, which is applied to the aforementioned automatic extraction system for device documentation and drawing reference numbers in the engineering energy industry. The method comprises:
[0037] Uploading files to be processed to the system, wherein the files include documents and / or drawings;
[0038] Preprocessing the uploaded file to obtain a target file;
[0039] Performing OCR on the target file to extract text from the file and obtain text information;
[0040] According to the preset rules, the text information is matched and extracted to obtain the bit number information that meets the preset rules;
[0041] Positioning the bit number information at the bit number position of the target file to obtain bit number position information;
[0042] Perform similarity matching between the bit number information and the bit numbers in the existing bit number library to obtain the bit number information with the highest similarity;
[0043] The bit number information with the highest similarity and the corresponding bit number position information are stored.
[0044] In a third aspect, the present application provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, it implements the steps of the aforementioned method for automatically extracting position numbers from equipment documents and drawings in the engineering energy industry.
[0045] In a fourth aspect, the present application provides a computer storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the aforementioned method for automatically extracting position numbers from equipment documents and drawings in the engineering energy industry.
[0046] Beneficial effects: The present application provides an automatic extraction system for position numbers of equipment documents and drawings in the engineering energy industry. The system includes: a document and drawing uploading module for uploading files to be processed to the system, wherein the files include documents and / or drawings; a document and drawing preprocessing module for preprocessing the uploaded files to obtain a target file; a document and drawing OCR module for performing OCR recognition on the target file, extracting text from the file, and obtaining text information; a position number information extraction module for matching the text information according to preset rules and extracting it to obtain position number information that meets the preset rules; a position number position positioning module for locating the position number information to the position number position of the target file to obtain position number position information; a position number accuracy matching module for performing similarity matching between the position number information and the position numbers in the existing position number library to obtain the position number information with the highest similarity; an extraction result storage module for storing the position number information with the highest similarity and the corresponding position number position information. The above modules can quickly and accurately extract key position numbers from large amounts of data through automated means, greatly improving the speed and efficiency of data processing. It also reduces manual intervention and reduces errors and delays caused by human factors. Automated extraction reduces reliance on manual labor, thereby reducing labor costs. At the same time, it enhances data accuracy, reduces the risk of data errors and omissions, and ensures the timeliness and accuracy of data. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the conventional technology, the following briefly introduces the drawings required for use in the embodiments or the conventional technology descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0048] Figure 1 This is a flow chart of a system for automatically extracting bit numbers from equipment documents and drawings in the engineering energy industry in one embodiment;
[0049] Figure 2 This is a schematic diagram of the file list uploaded to the server;
[0050] Figure 3 This is a schematic diagram before file processing;
[0051] Figure 4 This is a schematic diagram after file processing;
[0052] Figure 5 Schematic diagram of forming a double-layer PDF;
[0053] Figure 6 A schematic diagram of extracting the bit number information in the system according to the extraction rules;
[0054] Figure 7 A schematic diagram for marking the identified bit number at the original file position;
[0055] Figure 8 A schematic diagram for locating the position of the bit number;
[0056] Figure 9 Schematic diagram of bit number information comparison;
[0057] Figure 10 Schematic diagram saved for extraction results;
[0058] Figure 11 The present invention is a flowchart of a method for automatically extracting position numbers from equipment documents and drawings in the engineering energy industry in one embodiment. DETAILED DESCRIPTION
[0059] To facilitate understanding of the present application, the present application will be described more fully below with reference to the accompanying drawings. The accompanying drawings provide embodiments of the present application. However, the present application may be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to make the disclosure of the present application more thorough and comprehensive.
[0060] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The term "and / or" as used herein includes any and all couplings of one or more of the associated listed items.
[0061] It will be understood that the terms "first," "second," etc. used herein may be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish a first element from another element.
[0062] The following are some explanations of some terms involved in this application to facilitate understanding of this application:
[0063] Median filtering is a nonlinear digital filtering technique commonly used to remove noise from images. It replaces the value of each pixel in an image with the median of its neighboring pixels. A "neighborhood" can be a 3x3, 5x5, or other pixel area. Median filtering removes noise while preserving edge information, thus preserving edge and texture details better than linear filters (such as mean filters).
[0064] Gaussian blur is a linear image filtering technique that uses a Gaussian function as a weight to smooth an image. It effectively reduces noise and detail in an image, giving it a softer appearance. It works by replacing each pixel value in an image with the weighted average of its neighboring pixel values, where the weights are determined by a Gaussian distribution, with pixels closer to the center receiving a larger weight.
[0065] Opening is a basic concept in mathematical morphology. It is a combined operation consisting of two basic operations: erosion and dilation. The definition of opening is to first perform an erosion operation on the image and then perform a dilation operation on the eroded result. The applications of opening in image processing mainly include: Eliminating small objects: It can remove small noise points or small objects in the image, because these small objects will be completely eliminated during the erosion process. Separating objects: Separating adjacent objects at thin places, because erosion will disconnect narrow connected parts. Smoothing boundaries: Smoothing the edges of larger objects without significantly changing their area, because the dilation operation will fill the small holes and breaks left after erosion.
[0066] Adaptive threshold segmentation is an image segmentation technique used to separate the foreground and background in an image. Unlike traditional global threshold segmentation methods, adaptive threshold segmentation does not use a single fixed threshold to process the entire image. Instead, it calculates a threshold for each pixel or local area in the image, which better adapts to local changes in the image, such as noise.
[0067] The Hough Transform is a feature extraction technique used primarily for shape detection in images, particularly for detecting lines, circles, and other curves. It maps image space to parameter space, using a voting mechanism to identify specific shapes.
[0068] Affine transformation is a linear transformation in two-dimensional space that preserves the collinearity of points in an image and the angles between straight lines.
[0069] Canny edge detection is a commonly used edge detection algorithm that aims to identify areas with significant intensity changes in an image.
[0070] Tesseract is an open-source optical character recognition (OCR) engine used to extract text from images into editable text. Tesseract is widely used in various OCR tasks, including document digitization, image text extraction, and data entry.
[0071] Regular Expressions (RE) are powerful text processing tools used to search, replace, check, or parse text that matches specific patterns (rules). A regular expression consists of a series of characters, which can be common characters (such as letters a to z), special characters, or a combination of both.
[0072] The edit distance (Levenshtein distance) is a way to measure the difference between two strings. It is defined as the minimum number of single-character editing (insertion, deletion, or substitution) operations required to transform one string into another.
[0073] First, this application provides a system for automatically extracting reference numbers from equipment documents and drawings in the engineering and energy industry. This system uses computer processing and algorithms to extract the correct reference number information from historical documents and drawings. After extraction, the document is associated with a specific piece of equipment, ensuring that all associated information is available during subsequent equipment queries.
[0074] like Figure 1 As shown, a system for automatically extracting equipment document and drawing number in the engineering energy industry includes:
[0075] The document and drawing upload module is used to upload files to be processed to the system, wherein the files include documents and / or drawings.
[0076] Specifically, the document and drawing upload module ensures that files are successfully uploaded to the system for storage and are ready for subsequent processing. Users can select files to upload from their local device. The system supports a variety of common formats, including PDF, JPG, PNG, TIFF, and others. Before uploading, the system performs a preliminary check of the file type and size. For example, it checks whether the file format is supported and whether the file size is within the system's processing capabilities. If the file does not meet the requirements, the system prompts the user to reselect.
[0077] For example, a user selects "Equipment Maintenance Manual.pdf" and "Tag Designation Drawing.jpg" from a local folder. The system verifies that both files conform to supported formats and are within the system's permitted size, passing verification. The system then uploads the two files to the server via a secure channel and stores them in the system's file storage directory. The system displays a notification indicating that "Equipment Maintenance Manual.pdf" and "Tag Designation Drawing.jpg" have been successfully uploaded, along with detailed file information. The user can confirm the upload and proceed to the next step.
[0078] The document drawing preprocessing module is used to preprocess the uploaded files to obtain the target files.
[0079] Specifically, the method for preprocessing the uploaded file to obtain the target file may include the following:
[0080] The document drawing preprocessing module is used to use a filtering algorithm to smooth the noise points in the file to obtain a first intermediate file.
[0081] Specifically, the image is processed using filtering algorithms such as median filtering or Gaussian blurring to reduce scattered noise and small particle interference. The resulting first intermediate file has significantly reduced noise levels and a smooth image, making it suitable for subsequent processing.
[0082] The document drawing preprocessing module is used to detect the smeared area of the first intermediate file by using an opening operation, and restore the smeared area by using adjacent pixel interpolation or fuzzy filling to obtain a second intermediate file.
[0083] Specifically, an opening operation is applied to the first intermediate file to detect smeared areas. This operation eliminates small black areas and restores the smeared areas through neighboring pixel interpolation or fuzzy fill methods, ensuring clear content. The resulting second intermediate file contains the restored smeared areas, resulting in a better visual experience.
[0084] The document drawing preprocessing module is used to process the residual stains in the background of the second intermediate file using an adaptive threshold segmentation method to obtain a third intermediate file.
[0085] Specifically, an adaptive thresholding method is applied to the second intermediate file to separate and remove residual background stains. The adaptive thresholding method dynamically adjusts based on the local characteristics of the image, ensuring accurate separation of background and foreground. The resulting third intermediate file removes background stains, resulting in a cleaner overall image.
[0086] The document drawing preprocessing module is used to detect the straight line features of the third intermediate file by using Hough transform to obtain the deflection angle of the third intermediate file.
[0087] Specifically, the Hough transform algorithm is used to detect straight line features in the third intermediate file and calculate the image's deflection angle. The Hough transform effectively identifies straight lines, even in noisy backgrounds. This deflection angle information is then used in subsequent correction steps.
[0088] The document drawing preprocessing module is used to adjust the third intermediate file according to the deflection angle of the third intermediate file to obtain a target file.
[0089] Specifically, the third intermediate file is rotation-corrected based on the detected deflection angle. Affine or rotation transformations are used to ensure horizontal alignment of the drawing content. The resulting target file is clear and aligned, making it suitable for further information extraction and analysis.
[0090] For example, if a user uploads a PDF file of an engineering drawing, it contains the following questions:
[0091] There is some minor noise (such as dust from scanning).
[0092] Some parts of the drawing are blurred (for example, manually marked parts).
[0093] The overall drawing is tilted by 3 degrees.
[0094] Processing process of engineering drawing PDF files:
[0095] Noise smoothing:
[0096] The system applies median filtering to process the drawing, removes scattered dust noise, and generates a first intermediate file.
[0097] Smear area detection and repair:
[0098] The system detects the smeared area and repairs it by interpolating neighboring pixels to generate a second intermediate file.
[0099] Background stain processing:
[0100] Adaptive threshold segmentation method is used to remove residual stains in the background of the drawing and generate a third intermediate file.
[0101] Deflection angle detection:
[0102] The Hough transform recognizes that the deflection angle of the drawing is 3 degrees and records this information.
[0103] Image Adjustment:
[0104] The system performs rotation correction on the drawing according to a 3-degree deflection angle to obtain the final target file.
[0105] It should be noted that the document drawing preprocessing module can also use other conventional processing methods for preprocessing the file (for example, using edge detection (such as Canny edge detection) to supplement the repair of the smeared area, or using image enhancement technology to improve the contrast of the drawing) so that the processed file can clearly display the content in the file.
[0106] The document drawing OCR module is used to perform OCR recognition on the target file, extract the text information in the file, and obtain the bit number information;
[0107] Specifically, performing OCR on the target file, extracting text information from the file, and obtaining the bit number information may include the following methods:
[0108] The document drawing OCR module is used to identify the position of the text area in the target file using an edge detection algorithm;
[0109] The document drawing OCR module is used to extract the text in the text area to obtain text information.
[0110] It should be noted that after obtaining the target file in the aforementioned steps, it is necessary to perform text recognition on the target file in order to obtain text information. First, the target file is converted into an image, and then the edge detection algorithm (such as Canny edge detection) is used to identify the position of the text area in the image, and the position of the text area is determined so that the OCR engine can focus on these areas for recognition, avoiding the recognition of the entire image and wasting resources. Next, according to the position of the text area, the image is divided into separate text lines or words for easy recognition one by one. Then, an OCR engine (such as Tesseract) is used to identify each text candidate area and convert the text in the image into text. Next, the recognition results are corrected and formatted, such as correcting recognition errors, merging line information, etc., and finally the text information is extracted. Among them, correcting recognition errors, merging line information, etc. can include the following steps:
[0111] During OCR recognition, low-confidence words or phrases are marked as potential errors. These marked words or phrases are then passed as input to the larger model for correction suggestions. By pre-setting common OCR error patterns (such as similar character substitutions: 0 and O, 1 and I, etc.), potential error areas are marked, further improving the efficiency of the larger model's corrections.
[0112] Based on the potentially incorrect words that need correction, the paragraph or sentence in which they appear is extracted and provided context to the large model. The large model can then incorporate semantic understanding to ensure that the recommended corrections are consistent with the context. Furthermore, for specialized terminology in engineering documents (such as tag numbers and device names), custom dictionaries or domain vocabularies can be used to help the large model identify proprietary terms and prioritize recommendations consistent with the industry terminology of the engineering documents.
[0113] Using the large model, potentially incorrect spellings of words are corrected to obtain corrected text information.
[0114] The corrected text information is compared with the original text information, and the comparison results are used as adjustment parameters of the large model to adjust and train the large model.
[0115] For example, assuming that the OCR recognition result contains an error such as "BL10O1E" caused by similar characters, the correction process of the large model is as follows:
[0116] Detection error: The OCR recognition module found that "BL10O1E" did not match the existing bit pattern and marked it as low confidence.
[0117] Input context: The system inputs the sentence containing "Position number: BL10O1E" along with the context into the large model, and prompts the model to be corrected according to the standard position number mode.
[0118] Large model output: The large model generates a correction suggestion, replacing "BL10O1E" with "BL1001E".
[0119] User confirmation: The system displays the corrected results to the user for confirmation. If the user confirms that they are correct, the model records the correction pattern to provide a reference for automatic correction of similar errors.
[0120] The bit number information extraction module is used to match the text information according to preset rules and extract the bit number information that meets the preset rules.
[0121] Specifically, the method for matching the text information according to the preset rules and extracting the bit number information that meets the preset rules may include the following methods:
[0122] The bit number information extraction module is used to construct the preset rule, wherein the preset rule represents a regular expression.
[0123] The bit number information extraction module is used to match the text information according to the preset rules to obtain text information that meets the preset rules.
[0124] The bit number information extraction module is used to extract text information that meets the preset rules to obtain bit number information that meets the preset rules.
[0125] It should be noted that pre-set rules for matching bit number information are constructed by defining regular expressions. These rules ensure accurate identification and extraction of bit number information that meets the standards. The pre-set rules are then matched against the text information obtained through OCR recognition, and the regular expression is applied to the text information to find all matching strings. After a bit number is successfully matched, the information is extracted and stored as bit number information that meets the pre-set rules for subsequent use or analysis.
[0126] The bit number position positioning module is used to reversely locate the bit number position of the target file based on the target bit number information.
[0127] Specifically, according to the target bit number information, reverse positioning to the bit number position of the target file may include the following methods:
[0128] The bit number position positioning module is used to map the bit number information back to the coordinate system of the target file to obtain the coordinates of the bit number information in the coordinate system.
[0129] The position number location module is used to construct a marking layer with a coordinate system on the file.
[0130] The bit number position positioning module is used to mark the corresponding coordinate position on the marking layer according to the coordinates of the bit number information in the coordinate system, so as to obtain the marking layer of the bit number position information.
[0131] It should be noted that by setting the bit number position information at the bit number position of the target file, the exact position of the bit number information in the original file can be determined. First, in the aforementioned steps, the matched bit number information has been obtained, so that the extracted bit number information is associated with the exact position in the document or drawing of the target file. That is to say, the coordinates corresponding to the bit number information are obtained on the target file. Next, a marking layer is constructed, and the coordinates corresponding to the bit number information are also displayed on the marking layer. In this way, the marking layer will display the bit number information on the target file at the same position, thereby ensuring that the bit number information is correctly positioned on the document or drawing. Specifically, a rectangular box or other shaped annotation can be drawn on the annotation layer to highlight the position of the bit number, and a text annotation of the bit number information can be added in or next to the annotation box to provide more contextual information.
[0132] It should also be noted that during the OCR recognition process, in addition to extracting text information, the bounding box (Bounding Box) of each character or string is also recorded, that is, the coordinate position of the character in the image. These coordinates usually include: the x coordinate (x) of the upper left corner, the y coordinate (y) of the upper left corner, the width (width), and the height (height). Next, the position of the file number information is mapped to the annotation layer with a coordinate system by translation or scaling, so as to obtain the corresponding coordinate position on the annotation layer, so as to present the number information and obtain the annotation layer of the number position information. The annotation layer can facilitate users to view, edit, and confirm the coordinates of the number information.
[0133] Through the above method, the bit number information can be accurately mapped to the rotated file coordinate system, ensuring the accuracy and availability of the bit number information, so that it can be effectively queried and used in the rotated file context.
[0134] It should also be noted that since the target file is rotated and then recognized by OCR in the aforementioned steps, in this step, the coordinates corresponding to the position number information on the target file do not need to be rotated, only translation and / or scaling are required.
[0135] The position number accuracy matching module is used to perform similarity matching between the target position number information and the position numbers in the existing position number library to obtain the position number information with the highest similarity.
[0136] Specifically, performing similarity matching between the target bit number information and the bit numbers in the existing bit number library to obtain the bit number information with the highest similarity may include the following steps:
[0137] The position number accuracy matching module is used to calculate the distance between each position number information and the position numbers in the existing position number library using the edit distance to obtain a distance result;
[0138] The position number accuracy matching module is used to determine the position number information with the highest similarity based on the distance result.
[0139] It should be noted that first, for each bit number in the bit number library, the edit distance algorithm is used to calculate its distance to the target bit number information. The results of each comparison are recorded and usually stored in a table or dictionary, with the target bit number as the key and the edit distance as the value. Next, based on the edit distance results, the bit number with the smallest edit distance to the target bit number information is selected, because a smaller edit distance means a higher similarity. A threshold can be set so that two bits are only considered similar when the edit distance is less than or equal to this threshold. From the recorded edit distance results, the bit number corresponding to the smallest value is found, and the bit number with the highest similarity is the bit number.
[0140] For example, there are the following tag libraries and target tag information:
[0141] Tags in the tag library: ["T12010", "T12012", "T12020", "T13011", "T12011"].
[0142] Target number information: "T12011".
[0143] Use the edit distance to calculate the similarity between the target reference designator and each reference designator in the reference designator library:
[0144] The edit distance between "T12010" and "T12011" is 1 (replace the last character "0" with "1").
[0145] The edit distance between "T12012" and "T12011" is also 1 (replace the last character "2" with "1").
[0146] The edit distance between "T12020" and "T12011" is 2 ("20" needs to be replaced with "1" and "1").
[0147] The edit distance between "T13011" and "T12011" is 2 (the first character "3" needs to be replaced with "1" and "2").
[0148] The edit distance between "T12011" and "T12011" is 0.
[0149] Based on the above calculation results, we can obtain the most similar tag information. If "T12011" does not exist in the tag library, then "T12010" and "T12012" both have a minimum edit distance of 1 with the target tag "T12011." If we set the threshold to 1, both tags are considered similar to the target tag. If no threshold is set, the tag with the smallest edit distance can be selected as the most similar tag, or if the distances are the same, all candidate tags can be provided for further manual confirmation.
[0150] Through the above method, the bit number accuracy matching module can effectively identify the bit number with the highest similarity to the target bit number information from the bit number library.
[0151] The extraction result storage module is used to store the bit number information with the highest similarity.
[0152] Specifically, storing the bit number information with the highest similarity may include the following steps:
[0153] The extraction result storage module is used to obtain the bit number information with the highest similarity and the corresponding bit number position information;
[0154] The extraction result storage module is used to form structured data from the bit number information with the highest similarity and the corresponding bit number position information to obtain a key-value pair;
[0155] The extraction result storage module is used to store key-value pairs.
[0156] It should be noted that after completing the matching process of the bit number information, the system will obtain a set of matching results, including the bit number information with the highest similarity and its position in the target file. Next, the extraction result storage module will organize the extracted bit number information and position information into a structured data format, such as a key-value pair, for easy storage and retrieval. First, build a data structure, which can be a dictionary or a JSON object, containing necessary keys, such as bit number text, similarity score, location information, etc. Next, fill the collected information (the bit number information with the highest similarity, and the corresponding bit number position information) into the data structure to form a key-value pair. Finally, the formed key-value pair is stored in a persistent storage system, such as a database or file system, for long-term storage and subsequent access.
[0157] By storing data in a structured data format using key-value pairs, the organization of tag and location information is clearer and more organized. This facilitates quick location and access to specific data items, allowing for quick retrieval of relevant values by key without having to traverse the entire dataset. This helps maintain data consistency and reduces data redundancy and inconsistency. Key-value pairs ensure that each data item has a unique identifier, preventing data conflicts.
[0158] Embodiment
[0159] As shown in Figure 2 1, the selected file is uploaded to the server, and the system lists the list of files that have been uploaded.
[0160] 2, the system automatically processes the uploaded document, as shown in Figure 3 , including decontamination, correction, correction, and black dot removal. The processed scanned file is shown in Figure 4 .
[0161] As shown in Figure 5 3, the OCR recognition is performed on the document and drawing, and the text information in the scanned image is extracted. The text information is integrated with the original PDF to form a double-layer PDF.
[0162] As shown in Figure 6 4, the system extracts the site number information according to the extracted rules. The system can configure the extraction rules in the background, and the extraction rules include regular expression configuration information. Figure 6 In the figure, the selected area is the extracted site number information.
[0163] As shown in Figure 7 5, the system can match the site number in the document and drawing according to different extraction rules, and mark the recognized site number in the original position.
[0164] As shown in Figure 8 6, the system performs positioning information on the specific recognized site number in the PDF according to the recognized site number, so as to facilitate the user to know the position of the site number. Figure 8 In the figure, the site number information corresponds to the positioning information of the specific recognized site number in the PDF.
[0165] As shown in Figure 9 7, the extracted site number information is matched with the site number information in the system site number library, and the high similarity is arranged at the top for the user to confirm. Figure 9 In the figure, the selected area is the matched information in the site number library.
[0166] As shown in Figure 10 8, the confirmed site number after the above steps will be retained, and the relationship between the document or drawing and the site number will be established. In the later digital factory, clicking a device can call the related document or drawing content through the site number. Figure 10 In the figure, the selected area is the file associated with the device.
[0167] In summary, the present application provides an engineering energy industry device document and drawing site number automatic extraction method, which has the following beneficial effects:
[0168] 1. Improve work efficiency
[0169] Automated processing: Intelligent tag extraction can quickly and accurately extract key tags from large amounts of data through automated means, greatly improving the speed and efficiency of data processing.
[0170] Reduced manual intervention: Traditional manual extraction methods are not only time-consuming and labor-intensive, but also prone to errors. Intelligent tag extraction reduces manual intervention, minimizing errors and delays caused by human factors.
[0171] 2. Reduce costs
[0172] Labor costs: Automated extraction reduces reliance on manual labor, thereby reducing labor costs. Enterprises can devote more human resources to more valuable tasks.
[0173] Time cost: Fast data processing capabilities mean that companies can obtain the information they need more quickly, thereby shortening decision cycles and response times.
[0174] 3. Enhance data accuracy
[0175] High-precision identification: Intelligent tag extraction technology is usually based on advanced algorithms and models, which can accurately identify and extract the target tag, reducing the risk of data errors and omissions.
[0176] Real-time update: For data that needs to be processed in real time, intelligent tag extraction technology can extract and update data in real time to ensure the timeliness and accuracy of the data.
[0177] like Figure 11 As shown, in a second aspect, the present application provides a method for automatically extracting device documentation and drawing position numbers in the engineering energy industry, which is applied to the aforementioned automatic extraction system for device documentation and drawing position numbers in the engineering energy industry. The method includes:
[0178] Uploading files to be processed to the system, wherein the files include documents and / or drawings;
[0179] Preprocessing the uploaded file to obtain a target file;
[0180] Performing OCR on the target file to extract text from the file and obtain text information;
[0181] According to the preset rules, the text information is matched and extracted to obtain the bit number information that meets the preset rules;
[0182] Positioning the bit number information at the bit number position of the target file to obtain bit number position information;
[0183] Perform similarity matching between the bit number information and the bit numbers in the existing bit number library to obtain the bit number information with the highest similarity;
[0184] The bit number information with the highest similarity and the corresponding bit number position information are stored.
[0185] In a third aspect, the present application provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, it implements the steps of the aforementioned method for automatically extracting position numbers from equipment documents and drawings in the engineering energy industry.
[0186] In a fourth aspect, the present application provides a computer storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the aforementioned method for automatically extracting position numbers from equipment documents and drawings in the engineering energy industry.
[0187] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0188] The various embodiments in the present disclosure are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments.
[0189] The scope of protection of the present disclosure is not limited to the above-described embodiments. Obviously, those skilled in the art may make various modifications and variations to the present disclosure without departing from the scope and spirit of the present disclosure. If such modifications and variations fall within the scope of the claims of the present disclosure and their equivalents, the present disclosure is intended to include such modifications and variations.
Claims
1. An automatic extraction system for equipment documents and drawings in the engineering energy industry, characterized in that the system include: A document and drawing upload module is used to upload files to be processed to the system, wherein the files include documents and / or drawings; The document drawing preprocessing module is used to preprocess the uploaded file to obtain the target file; The document and drawing OCR module is used to perform OCR recognition on the target document, extract the text in the document, and obtain text information; during OCR recognition, low-confidence words or phrases are marked as potential errors; based on the potentially incorrect words that need to be corrected, the paragraphs or sentences in which they are located are extracted to provide context to the large model; using the large model, the spelling of the potentially incorrect words is corrected to obtain corrected text information; the corrected text information is compared with the original text information, and the comparison results are used as adjustment parameters for the large model to adjust and train the large model; A bit number information extraction module is used to match the text information according to preset rules and extract the bit number information that meets the preset rules; The bit number position locating module is used to locate the bit number information at the bit number position of the target file to obtain the bit number position information. Specifically, the module includes: mapping the bit number information back to the coordinate system of the target file to obtain the coordinates of the bit number information in the coordinate system; constructing a marking layer with a coordinate system on the target file; and marking the corresponding coordinate positions on the marking layer according to the coordinates of the bit number information in the coordinate system to obtain the marking layer of the bit number position information. The position number accuracy matching module is used to perform similarity matching on the position number information with the position numbers in the existing position number library to obtain the position number information with the highest similarity. Specifically, the module includes: using the edit distance to calculate the distance between each position number information and the position numbers in the existing position number library to obtain a distance result; and determining the position number information with the highest similarity based on the distance result; The extraction result storage module is used to store the bit number information with the highest similarity and the corresponding bit number position information; specifically includes: obtaining the bit number information with the highest similarity and the corresponding bit number position information; forming the bit number information with the highest similarity and the corresponding bit number position information into structured data, obtaining key-value pairs and storing them.
2. The automatic extraction system for equipment documents and drawings in the engineering energy industry according to claim 1 is characterized in that: The document drawing preprocessing module is used to preprocess the uploaded file to obtain the target file, including: The document drawing preprocessing module is used to smooth the noise in the document using a filtering algorithm to obtain a first intermediate file; The document drawing preprocessing module is configured to detect the smeared area of the first intermediate file by using an opening operation, and restore the smeared area by using adjacent pixel interpolation or fuzzy filling to obtain a second intermediate file; The document drawing preprocessing module is used to process the residual stains in the background of the second intermediate file using an adaptive threshold segmentation method to obtain a third intermediate file; The document drawing preprocessing module is used to detect the straight line features of the third intermediate file using Hough transform to obtain the deflection angle of the third intermediate file; The document drawing preprocessing module is used to adjust the third intermediate file according to the deflection angle of the third intermediate file to obtain a target file.
3. A method for automatically extracting position numbers from equipment documents and drawings in the engineering energy industry, characterized in that: The system for automatically extracting position numbers from equipment documents and drawings in the engineering energy industry, as applied to any one of claims 1-2, comprises: Uploading files to be processed to the system, wherein the files include documents and / or drawings; Preprocessing the uploaded file to obtain a target file; Performing OCR on the target file to extract text from the file and obtain text information; According to the preset rules, the text information is matched and extracted to obtain the bit number information that meets the preset rules; Positioning the bit number information at the bit number position of the target file to obtain bit number position information; Perform similarity matching between the bit number information and the bit numbers in the existing bit number library to obtain the bit number information with the highest similarity; The bit number information with the highest similarity and the corresponding bit number position information are stored.
4. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method for automatically extracting position numbers from equipment documents and drawings in the engineering energy industry as described in claim 3 are implemented.
5. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for automatically extracting position numbers from equipment documents and drawings in the engineering energy industry as described in claim 3 are implemented.
Citation Information
Patent Citations
Text recognition method and system based on paper document and computer medium
CN112418204A
PID drawing identification and reconstruction system based on end-to-end deep learning
CN117373051A