Three-coordinate report extraction and analysis method and equipment for part manufacturing and medium
Through automated three-coordinate report data extraction and analysis methods, traditional manual analysis is solved, which is time-consuming and error-prone, and efficient and accurate data processing and analysis is achieved, suitable for different enterprises and equipment brands.
Patent Information
- Application Number
- CN202510142892.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-10
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2045-02-10
AI Technical Summary
The analysis method of traditional three-coordinate reporting relies on manual data export, which is time-consuming and labor-intensive, and is prone to errors in the case of large data volumes.
A three-coordinate report extraction and analysis method for component manufacturing is proposed. By obtaining report files and determining the data extraction template, element data in the report is automatically extracted, and summarized and displayed based on the extracted data.
It realizes automated data extraction and analysis of three-coordinate reports, reduces manual labor, improves data processing efficiency and accuracy, and adapts to data extraction from different enterprises and equipment brands.
Smart Images

Figure CN119578394A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data analysis, and specifically to a three-coordinate report extraction and analysis method, equipment and medium for parts manufacturing. Background Art
[0002] Three-coordinate report refers to the report that measures and records the shape, size and position of the workpiece through high-precision three-coordinate measuring instruments during the machining process. Three-coordinate report analysis is of great significance to mechanical machining, and can help companies improve machining accuracy, quality and efficiency, reduce costs and improve product reliability.
[0003] In traditional solutions, three-coordinate reports are usually in PDF format. Traditional analysis methods generally use manual data export methods, which requires a lot of time and manpower. In addition, when the amount of report data is large, manual analysis is prone to errors. Summary of the invention
[0004] In order to solve the above problems, this application proposes a three-coordinate report extraction and analysis method for parts manufacturing, including: Obtaining a report file corresponding to a three-coordinate report, and determining a data extraction template corresponding to the report file; the data extraction template at least includes a horizontal coordinate interval corresponding to each element data in the report file; Determine a text box in the report file, and extract the content in the horizontal axis interval in the text box based on the data extraction template; According to the data extraction template, the extracted content is stored as corresponding element data; The element data are summarized and displayed.
[0005] In one example, before determining the data extraction template corresponding to the report file, the method further includes: For a report file corresponding to a three-coordinate report, determine each element data contained in the three-coordinate report, and determine an alignment method of the element data; For each element data, determine the corresponding horizontal coordinate interval to be determined according to its position order in the text box of the report file; According to the alignment mode of the element data, a corresponding interval is selected in the horizontal coordinate pending interval selection as the horizontal coordinate interval corresponding to the element data.
[0006] In one example, the method further includes: For each element data, determine the corresponding upper limit coordinate and lower limit coordinate according to its horizontal coordinate interval; According to the position sequence of the element data, the interval range between the element data is determined by the upper limit coordinate of the previous element data and the lower limit coordinate of the next element data; For the interval range, according to the alignment modes respectively corresponding to the element data on both sides thereof, a first preset reasonable range corresponding to the interval range is determined; If the interval range exceeds the first preset reasonable range, the horizontal axis interval of the previous element data and / or the horizontal axis interval of the next element data are modified; wherein the priority of modification is from high to low as follows: the horizontal axis interval of the element data whose interval range on the other side matches the corresponding first preset reasonable range is shifted to the other side; the horizontal axis interval is reduced to match the horizontal axis interval of the element data whose interval range matches the corresponding second preset reasonable range; and it is reported and modified manually.
[0007] In one example, determining a text box in the report file, and extracting content in the horizontal axis interval in the text box based on the data extraction template specifically includes: Parsing the report file to determine the position coordinates of the text box in the report file; In the position coordinates corresponding to the text box, each preset vertical coordinate interval is used as a component of a single size information, and within the vertical coordinate interval, the content in the horizontal coordinate interval is extracted through file parsing according to the data extraction template; If the extraction is successful, the extracted content is used as the corresponding element data; If the extraction fails, the OCR recognition is used to extract and recognize the content, and the extracted content is used as the corresponding element data.
[0008] In one example, each preset vertical axis interval is used as a component of a single size information, specifically including: For each preset vertical coordinate interval, obtain the uniform mark corresponding to the current first vertical coordinate interval; If the consistency mark of the first vertical coordinate interval is the same as the consistency mark of the previous second vertical coordinate interval, and the vertical coordinate difference between the first vertical coordinate interval and the second vertical coordinate interval is lower than the preset maximum error value, the first vertical coordinate interval and the second vertical coordinate interval are consistent with each other to update the value of the first vertical coordinate interval to the value of the second vertical coordinate interval.
[0009] In one example, for each preset vertical coordinate interval, obtaining a uniform mark corresponding to the current first vertical coordinate interval specifically includes: For each preset vertical axis interval, the content extracted from the current first vertical axis interval is parsed in real time to obtain a first parsing result; and a second parsing result of the previous second vertical axis interval is obtained; wherein the first parsing result and the second parsing result include the parsing results of each element data in each horizontal axis interval; Comparing the formats of the parsing results of the element data in the same position sequence in the first parsing result and the second parsing result; If there are multiple different formats in the comparison result, the first vertical axis interval is assigned the same uniform mark as the second vertical axis interval.
[0010] In one example, extracting the content in the horizontal axis interval in the text box based on the data extraction template specifically includes: Starting content extraction from the lower limit coordinate of the horizontal axis interval corresponding to the data extraction template, and determining the first character extracted; Determine a first spacing distance between the first character and the lower limit coordinate of the horizontal axis interval; If the first interval distance is lower than the preset distance, lowering the lower limit coordinate of the horizontal axis interval, and re-extracting the content until the first interval distance is higher than the preset distance; Continue with content extraction and determine the height of each character; If there is a designated character whose height is higher than the preset height, determining whether the designated character is a text character or a graphic character; If the designated character is a graphic character, convert the graphic character into a corresponding text character and then continue to extract the content; If there are multiple consecutive designated characters that are all text characters, then according to the number of the designated characters, the lower limit coordinate of the horizontal axis interval is increased, and content extraction is performed; Extracting the content until the last character is identified, and determining a second interval distance between the last character and the upper limit coordinate of the horizontal axis interval; If the first interval distance is lower than a preset distance, the lower limit coordinate of the horizontal axis interval is increased, and content extraction is continued until the second interval distance is higher than a preset distance.
[0011] In one example, the method further includes: If there are multiple consecutive size information, and the same single element data exists in each size information, and the horizontal axis interval corresponding to the single element data is adjusted, then in the remaining size information, the horizontal axis interval corresponding to the same single element data is adjusted; Here, based on the adjusted upper limit coordinates and lower limit coordinates in the horizontal axis intervals of a plurality of continuous size information that have been adjusted, the upper limit coordinates and lower limit coordinates of the horizontal axis intervals of the remaining size information are adjusted respectively.
[0012] On the other hand, the present application also proposes a three-coordinate report extraction and analysis device for parts manufacturing, comprising: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the three-coordinate report extraction and analysis method for component manufacturing as described in any of the above examples.
[0013] On the other hand, the present application also proposes a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured as: a three-coordinate report extraction and analysis method for component manufacturing as described in any of the above examples.
[0014] The three-coordinate report extraction and analysis method for parts manufacturing proposed in this application can bring the following beneficial effects: Through the data extraction template, there is no need to manually check the PDF report page by page and extract data manually. The element data in the three-coordinate report can be automatically extracted, and a large number of reports can be processed in a short time, which reduces the degree of manual labor, reduces labor costs, speeds up the data processing process, and improves overall work efficiency.
[0015] It avoids negligence, misreading, transcription errors, etc. that may occur when manually extracting data, ensures that the extracted data is consistent with the original report, improves the accuracy and reliability of the data, and provides a more accurate basis for subsequent analysis and decision-making.
[0016] By setting corresponding data extraction templates for different enterprises and equipment brands, the corresponding extraction of element data can be achieved, thus adapting to different enterprises and equipment brands and having high versatility. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings: Figure 1 It is a flow chart of a three-coordinate report extraction and analysis method for parts manufacturing in an embodiment of the present application; Figure 2 This is a schematic diagram of a three-coordinate report in one scenario in an embodiment of the present application; Figure 3 This is a line graph summarized and displayed in one case in the embodiment of the present application; Figure 4 This is a bar chart summarized and displayed in one case in the embodiment of the present application; Figure 5 A schematic diagram of some graphic characters in one scenario in an embodiment of the present application; Figure 6 This is a schematic diagram of a part of the training set in one scenario in an embodiment of the present application; Figure 7 This is a schematic diagram of a three-coordinate report extraction and analysis device for parts manufacturing in an embodiment of the present application. DETAILED DESCRIPTION
[0018] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0019] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.
[0020] like Figure 1 As shown, the embodiment of the present application provides a three-coordinate report extraction and analysis method for component manufacturing, including: S101: Acquire a report file corresponding to a three-coordinate report, and determine a data extraction template corresponding to the report file; the data extraction template at least includes a horizontal coordinate interval corresponding to each element data in the report file.
[0021] Generally speaking, different companies and different equipment brands have different formats for their corresponding three-dimensional reports, so you can pre-set corresponding data extraction templates for different companies, equipment brands, etc. When obtaining a report file, you can determine the corresponding pre-set data extraction template based on the source of the report file.
[0022] The three-coordinate report contains multiple dimension information, and each dimension information may contain multiple element data. Each horizontal line of data except the first line can be regarded as the same dimension information (also called dimension type), which has the same vertical coordinate range (that is, Y coordinate) in the three-coordinate report. In this vertical coordinate area, different horizontal coordinate ranges correspond to the element data of different products under this dimension information.
[0023] The vertical data in each column except the first column corresponds to the same product or component (hereinafter referred to as product). Different vertical axis intervals correspond to different products. The same product has the same horizontal axis interval in the three-coordinate report. In this horizontal axis interval, different vertical axis intervals correspond to the element data of the product or component under different size information.
[0024] Based on this, for the convenience of representation, in the same vertical axis interval, the data recorded in different horizontal axis intervals are regarded as different element data. Each element data represents the data of different products under the corresponding size information.
[0025] like Figure 2 As shown in the figure, it is a schematic diagram of a three-coordinate report under an example. The dimension information may include: shape tolerance (FORM), distance measurement (DM), X coordinate, Y coordinate (wherein, X coordinate and Y coordinate refer to the records in the measurement data, not their position information in the three-coordinate report), etc. Of course, the dimension information may also include dimension name, dimension measured value, dimension theoretical value, dimension upper tolerance, dimension lower tolerance and other data. Each dimension information contains multiple element data (for example, the shape tolerance FORM includes multiple element data such as 0.0002, 0.0000, 0.0500, 0.0000, etc.), and the horizontal coordinate interval of each element data is different.
[0026] Furthermore, the data extraction template can be manually pre-set, for example, manually through the historical data of the three-coordinate report of the corresponding enterprise or equipment brand, by summarizing the rules and combining expert experience, to set the horizontal axis interval corresponding to each element data. However, this setting method is not only time-consuming and labor-intensive, but also prone to errors.
[0027] Based on this, when setting the data extraction template, for the report file corresponding to the three-coordinate report, determine the element data contained in the three-coordinate report, and determine the alignment of the element data. Among them, the alignment methods mainly include left alignment, right alignment, center alignment, etc. In this application, left alignment and right alignment are mainly used as examples. Center alignment is essentially no different from left alignment and right alignment, but it is more centered in the horizontal axis interval.
[0028] Since the data content in the three-coordinate report varies in length, especially when the text box is too long, it is difficult to give a reasonable range for the horizontal axis interval, and there is a situation where data is missed or data is serialized. To ensure the accuracy of data extraction, select the corresponding horizontal axis interval according to the alignment of the specific data text box. Here, the horizontal axis intervals corresponding to left alignment and right alignment can be called Left_X_Pos coordinates and Right_X_Pos coordinates respectively.
[0029] For each element data, determine its corresponding horizontal coordinate interval according to its position order in the text box of the report file. The horizontal coordinate interval is obtained by dividing the horizontal coordinate of the entire text box equally (or weighted equally) according to the conventional table size in the text box (which can be obtained based on the historical report files of the enterprise or brand). Each horizontal coordinate interval is closely connected, and all the horizontal coordinate intervals together constitute the entire horizontal coordinate of the text box.
[0030] At this time, according to the alignment of the element data, select the corresponding interval in the horizontal coordinate interval selection as the horizontal coordinate interval corresponding to the element data. For example, assuming that there are three horizontal coordinate intervals, corresponding to the ranges: a~b, c~d, e~f, for the current element data, its position order is third, and select e~f as its corresponding horizontal coordinate interval. Then, according to its own alignment mode of right alignment, select the right area g~h in the horizontal coordinate interval (where h is close to f, and in some cases, g~f can also be directly selected) as its corresponding horizontal coordinate interval.
[0031] For example, as shown in Table 1 below, in one case, when the dimension name is left-aligned, the data text box coordinates use the Left_X_Pos coordinates, and the final horizontal axis range is 70~90. The measured value of the dimension is right-aligned, the data text box coordinates use the Right_X_Pos coordinates, and the final horizontal axis range is 180~200. The theoretical value of the dimension is right-aligned, the data text box coordinates use the Right_X_Pos coordinates, and the final horizontal axis range is 240~260. The upper tolerance value of the dimension is right-aligned, the data text box coordinates use the Right_X_Pos coordinates, and the final horizontal axis range is 295~315. The lower tolerance value of the dimension is right-aligned, the data text box coordinates use the Right_X_Pos coordinates, and the final horizontal axis range is 350~370.
[0032] Table 1
[0033] Furthermore, after obtaining the data extraction template, in order to prevent unreasonable setting of the horizontal axis interval, the data extraction template can be checked accordingly.
[0034] For each element data, the corresponding upper limit coordinate and lower limit coordinate are determined according to its horizontal coordinate interval, wherein the upper limit coordinate and the lower limit coordinate refer to the left endpoint coordinate and the right endpoint coordinate in the horizontal coordinate interval, respectively.
[0035] According to the position sequence of element data, the interval range between each element data is determined by the upper limit coordinate of the previous element data and the lower limit coordinate of the next element data. For example, if the previous element data is the dimension name, its corresponding horizontal axis range is 70~90, and the lower limit coordinate is 90, and the next element data is the measured dimension value, its corresponding horizontal axis range is 180~200, and the upper limit coordinate is 180. At this time, the interval range is 180-90=90.
[0036] For the interval range, the first preset reasonable range corresponding to the interval range is determined according to the alignment methods corresponding to the element data on both sides. When the previous element data is left-aligned and the next element data is right-aligned, the first preset reasonable range between the two is the highest. When the alignment methods of the element data on both sides are the same, the first preset reasonable range between the two is medium. When the previous element data is right-aligned and the next element data is left-aligned, the first preset reasonable range between the two is the lowest. Of course, if center alignment, average alignment and other methods are taken into consideration, more detailed settings can also be made.
[0037] At this time, if the interval range exceeds the first preset reasonable range, it means that the currently set horizontal axis interval may not be reasonable enough, and the horizontal axis interval of the previous element data and / or the horizontal axis interval of the next element data should be modified.
[0038] Among them, the modification priority is from high to low: the horizontal axis interval of the element data whose interval range on the other side meets the corresponding first preset reasonable range is translated to the other side. At this time, let the previous element data be A, the next element data be B, and the next element data of element data B be C. Assuming that the interval range on the other side of the next element data B (that is, the interval range between element data B and element data C) meets the corresponding first preset reasonable range Assuming that the interval range of the previous element data on the other side (that is, between the previous element data and the previous element data) meets the first preset reasonable range, the horizontal axis interval of the element data B is translated to the other side (that is, the side close to the element data C). Of course, if the interval ranges of the element data on both sides of the current interval range meet the first preset reasonable range, the interval range on the other side that exceeds the first preset reasonable range can be selected for translation. In this way, corresponding adjustments can be made without reducing the horizontal axis interval, making the range setting more reasonable.
[0039] If the element data on both sides do not meet the condition, or, after maximum adjustment, the current interval range still cannot meet the condition of the preset interval range, the horizontal axis interval can be further narrowed to meet the corresponding second preset reasonable range (of course, the preset reasonable range of the horizontal axis interval and the preset reasonable range of the interval range are different and are pre-set respectively, so they are distinguished and described here by the first and the second). At this time, an upper limit of the reduction can be set so that the narrowed horizontal axis interval can still meet the corresponding second preset reasonable range.
[0040] If the problem is still difficult to solve using this method, you can report it and make manual modifications.
[0041] S102: Determine a text box in the report file, and extract the content in the horizontal axis interval in the text box based on the data extraction template.
[0042] Specifically, when actually extracting the content, the report file is first parsed to determine the position coordinates of the text boxes in the report file.
[0043] In the position coordinates corresponding to the text box, each preset vertical coordinate interval (the preset vertical coordinate interval is usually divided manually, or divided according to data in the historical records) is used as a component of a single size information.
[0044] The data in the same vertical coordinate range is regarded as a group of data of the same dimension information. Taking the example above, the text with Left_X_Pos coordinate in the range of 70~90 is the dimension name, the text with Right_X_Pos coordinate in the range of 180~200 is the dimension measured value, the text with Right_X_Pos coordinate in the range of 240~260 is the dimension measured value, the text with Right_X_Pos coordinate in the range of 295~315 is the dimension measured value, and the text with Right_X_Pos coordinate in the range of 350~370 is the dimension measured value.
[0045] In the vertical axis interval, the content in the horizontal axis interval is extracted through file parsing according to the data extraction template.
[0046] At this time, taking the report file as a PDF file as an example, the extracted content includes the content of each text box in the PDF file, and the data includes the label content of the text box, the Y coordinate of the text box (determined by a preset vertical coordinate interval), and the X coordinate of the text box (including Left_X_Pos and Right_X_Pos, determined by the horizontal coordinate interval). PDF parsing technology of multiple programming languages can be used here, such as Python and C#. When one programming language fails to parse some PDF files, another language is used for parsing. The two language parsing complements each other and can ensure the normal parsing of most report files. The final result diagram extracted can be shown in Table 2 below, which gives the extraction result under an example.
[0047] Table 2
[0048] If the extraction is successful through file parsing, the extracted content will be used as the corresponding element data, and each horizontal axis interval corresponds to one element data.
[0049] If the extraction fails, the OCR recognition is used to extract and recognize the content, and the extracted content is used as the corresponding element data.
[0050] Furthermore, due to the large variety of data in the three-coordinate report, there are some special cases that need to be processed. For example, for some very long data, it is necessary to display them in multiple lines. At this time, the vertical coordinate intervals (that is, Y coordinates) of the same line of data may be different. At this time, a corresponding consistency mark is set for each vertical coordinate interval in advance. Different vertical coordinate intervals with the same consistency mark actually belong to the same line of data. The setting of the consistency mark can be automatically set based on the repeatability of the data.
[0051] For example, during the data extraction process, the content is parsed in real time. For each preset vertical axis interval, the content extracted from the current first vertical axis interval is parsed in real time to obtain a first parsing result; and the second parsing result of the previous second vertical axis interval is obtained; wherein the first parsing result and the second parsing result include the parsing results of each element data in each horizontal axis interval.
[0052] The formats of the parsed results of the element data in the same position order in the first parsed result and the second parsed result are compared. For example, the element data in the first position order in the first parsed result is compared with the element data in the first position order in the second parsed result.
[0053] If there are multiple different formats (the format may include the number of digits of the data, the position of the decimal point, the data description method, etc.) in the comparison result (the specific values of the multiple formats here can be set based on the needs, for example, set to 2 or more), it is considered that the element data in the two vertical axis intervals belong to the same data, which is probably caused by the data process wrapping and continuing to display. Therefore, at this time, the first vertical axis interval is given the same consistency mark as the second vertical axis interval.
[0054] After the uniform mark is set, for each preset vertical coordinate interval, the uniform mark corresponding to the current first vertical coordinate interval is obtained.
[0055] If the consistency mark of the first vertical coordinate interval is the same as the consistency mark of the previous second vertical coordinate interval, and the vertical coordinate difference between the first vertical coordinate interval and the second vertical coordinate interval is lower than the preset maximum error value (for example, set to 3 to prevent the incorrect setting of the consistency mark), the first vertical coordinate interval and the second vertical coordinate interval are consistent with each other to update the value of the first vertical coordinate interval to the value of the second vertical coordinate interval, that is, the first vertical coordinate interval and the second vertical coordinate interval are merged into the same vertical coordinate interval.
[0056] Among them, if there are multiple second vertical coordinate intervals, as long as the vertical coordinate difference between the first second vertical coordinate interval and the first vertical coordinate interval in these multiple second vertical coordinate intervals is lower than the preset maximum error value, the first vertical coordinate interval can be merged with these multiple second vertical coordinate intervals. If it is higher than the preset maximum error value, it can be reported for manual processing.
[0057] In addition, there may be a situation where a text box is extracted into multiple text boxes. In this case, the Left_X_Pos coordinates can be used to judge and splice them into one text box. The difference in the spliced coordinates is allowed to be less than 1.5 times the character width. Then the spliced text boxes are deleted to avoid repeated extraction of data.
[0058] S103: According to the data extraction template, the extracted content is stored as corresponding element data.
[0059] For the raw data parsed from the PDF file, the type of each element data set in the data extraction template is used to parse and classify the raw data, and the dimension name, measured value, theoretical value, upper tolerance, lower tolerance and other contents of each dimension are parsed out in a loop, and the data are summarized and exported to a table file and imported into the database for storage.
[0060] S104: Summarize and display the element data.
[0061] For the element data collected in the database, data analysis is performed and summarized and displayed. The qualified status of various dimensions of various workpieces can be displayed, such as Figure 3 and Figure 4 As shown, line graphs and bar graphs are made to facilitate intuitive viewing of the quality of each size of the workpiece, which is used to monitor the processing quality of the workpiece. When unstable quality of a certain size is detected (for example, out-of-tolerance data, or frequent qualified data near the limit difference), an early warning is issued, and technical and quality personnel conduct problem analysis, investigation and resolution to avoid a large number of dimensional out-of-tolerance situations.
[0062] Through the data extraction template, there is no need to manually check the PDF report page by page and extract data manually. The element data in the three-coordinate report can be automatically extracted, and a large number of reports can be processed in a short time, which reduces the degree of manual labor, reduces labor costs, speeds up the data processing process, and improves overall work efficiency.
[0063] It avoids negligence, misreading, transcription errors, etc. that may occur when manually extracting data, ensures that the extracted data is consistent with the original report, improves the accuracy and reliability of the data, and provides a more accurate basis for subsequent analysis and decision-making.
[0064] By setting corresponding data extraction templates for different enterprises and equipment brands, the corresponding extraction of element data can be achieved, thus adapting to different enterprises and equipment brands and having high versatility.
[0065] In one embodiment, some special situations may be encountered when extracting content. For example, the horizontal axis interval is set improperly, resulting in failure to extract all content, or the font size of some characters changes due to system failure or software abnormality, or some characters are displayed in the form of graphic characters, which are difficult to directly recognize.
[0066] Based on this, when extracting content, the content extraction starts from the lower limit coordinate of the horizontal axis interval corresponding to the data extraction template, and the first extracted character is determined. The character can be determined by real-time parsing of the file during the content extraction process.
[0067] A first spacing distance between the first character and the lower limit coordinate of the horizontal coordinate interval is determined, which can be determined by the horizontal distance spacing between the position of the leftmost pixel point of the first character and the lower limit coordinate.
[0068] If the first interval distance is lower than the preset distance, it means that the first character currently recognized is too close to the edge and there may be other characters before it. Therefore, the lower limit coordinate of the horizontal axis interval is lowered, that is, the lower limit coordinate is moved to the left, and the content is extracted again until the first interval distance is higher than the preset distance.
[0069] Then continue to extract the content and determine the height of each character (of course, the height of the first character must also be determined). If the height of the specified character is higher than the preset height, determine whether the specified character is a text character or a graphic character. Figure 5 As shown in the figure, the graphic characters on the left represent position, and the graphic characters on the right represent flatness. Of course, coaxiality, parallelism, verticality, straightness, cylindricity, and roundness can all be assigned corresponding graphic characters. The recognition of graphic characters can be achieved using corresponding image recognition algorithms or deep learning neural networks. For example, Figure 6 As shown, some images of the position degree training set are provided, and various geometric tolerance images are extracted and transformed. A total of 100,000 images are constructed as the training set and 10,000 images are constructed as the test set.
[0070] If the specified character is recognized as a graphic character, it is considered reasonable that its height is high, and the content extraction continues after the graphic character is converted into the corresponding text character through a neural network.
[0071] If there are multiple consecutive specified characters that are all text characters, it is considered that the font size of the current character is set larger than the regular font size. At this time, the space it occupies in the three-coordinate report is also larger, and the horizontal axis interval needs to be widened. According to the number of specified characters, the lower limit coordinate of the horizontal axis interval is increased (generally speaking, no matter how large the font size of the specified character is set, it will not be higher than the corresponding vertical axis interval, so only the number is considered. The larger the number, the larger the increased interval), and then content extraction is performed.
[0072] Through content extraction, until the last character is identified, and similarly to the first character, the second interval distance between the last character and the upper limit coordinate of the horizontal axis interval is determined. If the first interval distance is lower than the preset distance, it is considered that there may be other characters after the last character, and the lower limit coordinate of the horizontal axis interval is similarly increased, and content extraction is continued until the second interval distance is higher than the preset distance.
[0073] Furthermore, if there are multiple consecutive size information, and the same single element data exists in each size information, and the horizontal axis interval corresponding to the single element data is adjusted, it is considered that the horizontal axis interval of the single element data is set unreasonably. At this time, in the remaining size information, the horizontal axis interval corresponding to the same single element data is adjusted.
[0074] When adjusting the remaining size information, the upper limit coordinate and the lower limit coordinate of the horizontal coordinate interval of the remaining size information are adjusted based on the upper limit coordinate and the lower limit coordinate of the horizontal coordinate interval of the multiple size information that have been adjusted. For example, the upper limit coordinate and the lower limit coordinate of the horizontal coordinate interval of the multiple size information that have been adjusted are respectively averaged or maximized, and used as the adjustment content of the upper limit coordinate and the lower limit coordinate of the horizontal coordinate interval of the remaining size information.
[0075] like Figure 7 As shown, the embodiment of the present application also proposes a three-coordinate report extraction and analysis device for parts manufacturing, including: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the three-coordinate report extraction and analysis method for component manufacturing as described in any of the above embodiments.
[0076] The embodiment of the present application further proposes a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured as: the three-coordinate report extraction and analysis method for component manufacturing described in any of the above embodiments.
[0077] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0078] The devices and media provided in the embodiments of the present application correspond one-to-one to the methods. Therefore, the devices and media also have similar beneficial technical effects as the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.
[0079] The above is only the embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the present application.
Claims
1. A three-coordinate report extraction and analysis method for parts manufacturing, characterized in that: include: Obtain a report file corresponding to a three-coordinate report, and determine a data extraction template corresponding to the report file; The data extraction template at least includes the horizontal axis interval corresponding to each element data in the report file; Determine a text box in the report file, and extract the content in the horizontal axis interval in the text box based on the data extraction template; According to the data extraction template, the extracted content is stored as corresponding element data; The element data are summarized and displayed.
2. The three-coordinate report extraction and analysis method for parts manufacturing according to claim 1 is characterized in that: Before determining the data extraction template corresponding to the report file, the method further includes: For a report file corresponding to a three-coordinate report, determine each element data contained in the three-coordinate report, and determine an alignment method of the element data; For each element data, determine the corresponding horizontal coordinate interval to be determined according to its position order in the text box of the report file; According to the alignment mode of the element data, a corresponding interval is selected in the horizontal coordinate pending interval selection as the horizontal coordinate interval corresponding to the element data.
3. The three-coordinate report extraction and analysis method for parts manufacturing according to claim 2 is characterized in that: The method further comprises: For each element data, determine the corresponding upper limit coordinate and lower limit coordinate according to its horizontal coordinate interval; According to the position sequence of the element data, the interval range between the element data is determined by the upper limit coordinate of the previous element data and the lower limit coordinate of the next element data; For the interval range, according to the alignment modes respectively corresponding to the element data on both sides thereof, a first preset reasonable range corresponding to the interval range is determined; If the interval range exceeds the first preset reasonable range, the horizontal axis interval of the previous element data and / or the horizontal axis interval of the next element data are modified; wherein the priority of modification is from high to low as follows: the horizontal axis interval of the element data whose interval range on the other side matches the corresponding first preset reasonable range is shifted to the other side; the horizontal axis interval is reduced to match the horizontal axis interval of the element data whose interval range matches the corresponding second preset reasonable range; and it is reported and modified manually.
4. The three-coordinate report extraction and analysis method for parts manufacturing according to claim 1 is characterized in that: Determine a text box in the report file, and extract the content in the horizontal axis interval in the text box based on the data extraction template, specifically including: Parsing the report file to determine the position coordinates of the text box in the report file; In the position coordinates corresponding to the text box, each preset vertical coordinate interval is used as a component of a single size information, and within the vertical coordinate interval, the content in the horizontal coordinate interval is extracted through file parsing according to the data extraction template; If the extraction is successful, the extracted content is used as the corresponding element data; If the extraction fails, the OCR recognition is used to extract and recognize the content, and the extracted content is used as the corresponding element data.
5. The three-coordinate report extraction and analysis method for parts manufacturing according to claim 4 is characterized in that: Each preset vertical axis interval is used as a component of a single size information, specifically including: For each preset vertical coordinate interval, obtain the uniform mark corresponding to the current first vertical coordinate interval; If the consistency mark of the first vertical coordinate interval is the same as the consistency mark of the previous second vertical coordinate interval, and the vertical coordinate difference between the first vertical coordinate interval and the second vertical coordinate interval is lower than the preset maximum error value, the first vertical coordinate interval and the second vertical coordinate interval are consistent with each other to update the value of the first vertical coordinate interval to the value of the second vertical coordinate interval.
6. The three-coordinate report extraction and analysis method for parts manufacturing according to claim 5 is characterized in that: For each preset vertical coordinate interval, obtaining the uniform mark corresponding to the current first vertical coordinate interval specifically includes: For each preset vertical axis interval, the content extracted from the current first vertical axis interval is parsed in real time to obtain a first parsing result; and a second parsing result of the previous second vertical axis interval is obtained; wherein the first parsing result and the second parsing result include the parsing results of each element data in each horizontal axis interval; Comparing the formats of the parsing results of the element data in the same position sequence in the first parsing result and the second parsing result; If there are multiple different formats in the comparison result, the first vertical axis interval is assigned the same uniform mark as the second vertical axis interval.
7. The three-coordinate report extraction and analysis method for parts manufacturing according to claim 1 is characterized in that: Extracting the content in the horizontal axis interval in the text box based on the data extraction template specifically includes: Starting content extraction from the lower limit coordinate of the horizontal axis interval corresponding to the data extraction template, and determining the first character extracted; Determine a first spacing distance between the first character and the lower limit coordinate of the horizontal axis interval; If the first interval distance is lower than the preset distance, lowering the lower limit coordinate of the horizontal axis interval, and re-extracting the content until the first interval distance is higher than the preset distance; Continue with content extraction and determine the height of each character; If there is a designated character whose height is higher than the preset height, determining whether the designated character is a text character or a graphic character; If the designated character is a graphic character, convert the graphic character into a corresponding text character and then continue to extract the content; If there are multiple consecutive designated characters that are all text characters, then according to the number of the designated characters, the lower limit coordinate of the horizontal axis interval is increased, and content extraction is performed; Extracting the content until the last character is identified, and determining a second interval distance between the last character and the upper limit coordinate of the horizontal axis interval; If the first interval distance is lower than a preset distance, the lower limit coordinate of the horizontal axis interval is increased, and content extraction is continued until the second interval distance is higher than a preset distance.
8. The three-coordinate report extraction and analysis method for parts manufacturing according to claim 7 is characterized in that: The method further comprises: If there are multiple consecutive size information, and the same single element data exists in each size information, and the horizontal axis interval corresponding to the single element data is adjusted, then in the remaining size information, the horizontal axis interval corresponding to the same single element data is adjusted; Here, based on the adjusted upper limit coordinates and lower limit coordinates in the horizontal axis intervals of a plurality of continuous size information that have been adjusted, the upper limit coordinates and lower limit coordinates of the horizontal axis intervals of the remaining size information are adjusted respectively.
9. A three-coordinate report extraction and analysis device for parts manufacturing, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the three-coordinate report extraction and analysis method for component manufacturing as described in any one of claims 1 to 8.
10. A non-volatile computer storage medium storing computer executable instructions, characterized in that: The computer executable instructions are configured as: a three-coordinate report extraction and analysis method for component manufacturing as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Method, equipment and medium for mining PDF (Portable Document Format) file
CN114116616A
Product quality data processing method and device, computer equipment and storage medium
CN118260240A
Table recognition method and apparatus, computer device, and storage medium
WO2020232872A1