Extraction method of dimensional tolerance specific information
By identifying and processing specific dimensional tolerance information in the software, the problem of low efficiency in filling out inspection reports for mechanical structure products is solved, and rapid and automatic extraction of dimensional tolerance information is achieved, thereby improving inspection efficiency.
Patent Information
- Application Number
- CN202411119029.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-15
- Publication Date
- 2026-03-03
AI Technical Summary
In existing technologies, the efficiency of extracting specific information on dimensional tolerances of mechanical structural products is low, resulting in insufficient efficiency in filling out inspection reports.
By recognizing specific information such as the number of dimensional tolerances, nominal size, and upper and lower deviations in the software, and using string processing methods and regular expressions, combined with the arrangement order of dimensional tolerances in the original string, the software automatically extracts and processes specific dimensional tolerance information.
It enables the rapid generation of inspection reports, improves inspection efficiency, provides data support, and simplifies the processing flow of dimensional tolerance information.
Smart Images

Figure CN121598948A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of extracting effective information from drawings, and in particular to a method for extracting specific information about dimensional tolerances (including: number markings, nominal dimensions, and upper and lower deviations). Background Technology
[0002] For mechanical structural products, it is usually necessary to read specific information about dimensional tolerances from the drawings.
[0003] For example, the dimensional tolerance of a part is checked based on specific information about the dimensional tolerances in the drawings designed by the mechanical engineer. This information is usually manually entered into a report by the inspector as a standard, and the actual measured value of the part is compared with the standard to determine whether the part is qualified and enter it into the inspection report. However, manual entry and judgment are inefficient, and a new solution is urgently needed to improve efficiency. This invention briefly describes the difficulty in the implementation process of a solution for quickly completing inspection reports, namely, the solution to the problem of "extracting specific information about dimensional tolerances". The dimensional tolerances that need to be identified mentioned in this article include dimensional tolerances with a number (e.g., dimensional tolerances with a number of elements). ) and dimensional tolerances without quantity (e.g.: For the sake of brevity, both dimensional tolerances will be referred to as dimensional tolerances. Summary of the Invention
[0004] Purpose of the Invention: The purpose of this invention is to provide "a method for extracting specific information about dimensional tolerances," thereby enabling rapid processing of tolerance information. For example, it provides "dimensional tolerance" data support for "quickly completing inspection reports and improving inspection efficiency."
[0005] Technical solution: The "rapid completion of test reports and improvement of test efficiency" mentioned in this invention includes the following steps:
[0006] (1) The inspector selects the entire dimensional tolerance in the display area of the software through interactive means.
[0007] (2) Specific information such as the number of dimensional tolerance markings, nominal size, upper deviation, and lower deviation are all identified.
[0008] (3) Calculate the upper and lower limits that the qualified measurement data must meet.
[0009] (4) The inspector measures the actual dimensions of the parts.
[0010] (5) Check if the size detected by the inspector is between the upper and lower limits. If yes, proceed to step (6); otherwise, proceed to step (7).
[0011] (6) If the dimensions are deemed acceptable, proceed to step (8).
[0012] (7) If the dimensions are deemed unqualified, proceed to step (8).
[0013] (8) Determine whether the part has been measured. If yes, proceed to step (9); otherwise, proceed to step (4).
[0014] (9) Export all measured dimensions and whether they are qualified to the report.
[0015] Step (2), namely "a method for extracting specific information on dimensional tolerances", is also the key problem that this invention patent aims to solve. This step specifically involves:
[0016] (2.1) Receive the operation information of the dimensional tolerance selected by the user, and obtain the corresponding "raw string" from it;
[0017] (2.2) Determine whether the "original string" contains the string "±". If it does, proceed to step (2.3); otherwise, proceed to step (2.4).
[0018] (2.3) Extract the second to last number from the "original string" as the "nominal size in the size tolerance specific information", and then proceed to step (2.5);
[0019] (2.4) Extract the third-to-last number from the "original string" as the "nominal size in the size tolerance specific information", and then proceed to step (2.5);
[0020] (2.5) Obtain the starting index of the string "nominal size in dimensional tolerance specific information" in the "original string", and based on the starting index, split the "original string" into "string containing size and deviation" and "string without size and deviation";
[0021] (2.6) For “strings without dimensions and deviations”, use regular expressions to match: “number of markers in dimensional tolerance specific information”;
[0022] (2.7) Determine whether the string containing dimensions and deviations contains "±". If it does, proceed to step (2.8); otherwise, proceed to step (2.9).
[0023] (2.8) Use "±" to separate the "string with dimensions and deviations" to obtain the deviation, and add a sign to the deviation to obtain the "upper and lower deviations in the specific information of dimensional tolerances", and then go to step (2.16).
[0024] (2.9) Divide the “string with size and deviation” into “several substrings” based on the whitespace characters, and then proceed to step (2.10);
[0025] (2.10) Divide the “several substrings” into two groups in order: a number group and a symbol group;
[0026] (2.11) Determine if any number in the number group is 0. If so, proceed to step (2.12); otherwise, proceed to step (2.15).
[0027] (2.12) It can be determined that 0 is one of the upper and lower deviations; in the symbol group, the first symbol is the symbol of "the other deviation besides 0"; in the number group, the remaining number after removing the first number and 0 is the absolute value of "the other deviation besides 0".
[0028] (2.13) Determine "another deviation besides 0" based on the sign and absolute value of "another deviation besides 0";
[0029] (2.14) Determine the upper and lower deviations of the "dimensional tolerance specific information" by comparing the magnitude of 0 and "another deviation other than 0", and then proceed to step (2.16);
[0030] (2.15) The upper deviation symbol of “specific information on dimensional tolerance” corresponds to the first symbol in the symbol group, and the absolute value of the upper deviation corresponds to the second number in the number group, thus obtaining the upper deviation of “specific information on dimensional tolerance”; the lower deviation symbol of “specific information on dimensional tolerance” corresponds to the second symbol in the symbol group, and the absolute value of the lower deviation corresponds to the third number in the number group, thus obtaining the lower deviation of “specific information on dimensional tolerance”; then proceed to step (2.16);
[0031] (2.16) Create a “Dimensional Tolerance Specific Information” object with the following attributes: number marker, nominal size, upper deviation, lower deviation, and fill in the relevant data obtained and processed earlier.
[0032] A computer storage medium storing a computer program that, when executed by a processor, implements the aforementioned method for extracting specific information about dimensional tolerances.
[0033] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described method for extracting specific dimensional tolerance information.
[0034] Beneficial Effects: Compared with existing technologies, this invention has the following advantages: Relying on string processing methods and based on the inference of "the arrangement rules of the sign and absolute value of deviations" derived from self-analysis, coupled with a comprehensive solution to address "the remaining difficulties in identifying specific information about dimensional tolerances," this invention ultimately solves the problem of "extracting specific information about dimensional tolerances." This provides data support for the "solution to quickly complete inspection reports."
[0035] In addition, the relevant theories of this invention patent have been implemented into a specific software, which allows inspectors to quickly complete inspection reports. Attached Figure Description
[0036] Figure 1 A flowchart outlining the steps to "quickly complete test reports and improve test efficiency";
[0037] Figure 2 This is a flowchart of the steps of "a method for extracting specific information on dimensional tolerances" that is the focus of this invention patent. Detailed Implementation
[0038] The technical solution of the present invention will be further described below with reference to the accompanying drawings. The present invention mentions a solution for quickly completing test reports, as shown in the flowchart. Figure 1 As shown.
[0039] However, flowchart Figure 1 After step (1) "The inspector selects the entire dimensional tolerance interactively in the software's display area" is enabled, it is difficult to truly complete step (2) "The specific information such as the number of dimensional tolerance markers, nominal size, upper deviation, and lower deviation are all recognized." The difficulty mainly lies in the fact that drawings exported by general drafting software may not retain the original structure of the dimensional tolerance data. For example, dimensional tolerance... (i.e., the labeled) The number of dimensional tolerances is 4. After exporting to drawing format, the directly obtained text will usually become "4-100+\n-0.1\n 0.2" (\n represents a newline); dimensional tolerances This usually results in "0.85-0\n0.05". These cases indicate that the directly extracted dimensional tolerance information has been largely disrupted from its original structure. Only by solving this problem and realizing that "specific information about dimensional tolerances, i.e., the number markings, nominal dimensions, and upper and lower deviations are all identified", can the goal of "quickly completing inspection reports" be truly achieved.
[0040] Therefore, this invention proposes a method for identifying specific information about dimensional tolerances. The main purpose is to overcome the shortcomings of the prior art by obtaining the original string text information of dimensional tolerances in the drawings and processing it through a tolerance information extraction algorithm to obtain accurate specific information about dimensional tolerances.
[0041] To achieve the above objectives, the most crucial issue is resolving the problem of the original structure of the directly extracted dimensional tolerance string information being disrupted. For each data point, the number of dimensional tolerances is consistently placed at the beginning of the original string; the nominal size is always placed after the number. However, there is no immediately apparent pattern for the upper and lower deviations; the absolute value and sign of the upper deviation are even separated, and the lower deviation suffers from a similar problem, with its absolute value and sign also being separated. Therefore, identifying the content of the upper and lower deviations becomes paramount.
[0042] In standard drawing specifications, data is generally arranged "from top to bottom and from left to right." It is also known that the sign of the upper deviation is generally located directly above the sign of the lower deviation (e.g., for...). + is basically directly above -), and the absolute value of the upper deviation is basically directly above the absolute value of the lower deviation (e.g., for...). 0.1 is basically located directly above 0.2 (it is slightly offset in this document, but the data exported by general drafting software will be much more aligned). Therefore, we can boldly deduce that in the original string of dimensional tolerances, the order of the upper deviation sign should be before the lower deviation sign, and the order of the absolute value of the upper deviation should be before the absolute value of the lower deviation (the actual string "100+\n-0.1\n 0.2" does reflect this).
[0043] Of course, even if the order of the items in the upper and lower deviations within the dimensional tolerance string is resolved, it still doesn't mean that specific information such as "number of marks, nominal size, upper deviation, and lower deviation" can be read from the dimensional tolerance, because there are other issues to consider regarding dimensional tolerances:
[0044] a) Dimensional tolerances are divided into forms with different absolute values of upper and lower deviations (e.g.: The absolute value of the upper and lower deviations is in the same form (e.g., 100±0.1).
[0045] b) When either the upper or lower deviation is 0, the deviation is unsigned, but the other deviation will have a sign (e.g., ...). and ).
[0046] c) Dimensional tolerances may be marked with a number (e.g.: It may also not have a count marker (e.g.: ).
[0047] d) Symbols for number markers (e.g.: The "-" sign in 4- indicates the sign of the deviation (e.g., 4-). Interference from the "-" symbol in -0.2.
[0048] In summary, to solve all the above problems and complete the implementation flowchart... Figure 1 The objective of step (2) of this invention, "identifying specific dimensional tolerance details," is as shown in the flowchart. Figure 2 As shown, the following technical solution was adopted:
[0049] (2.1) Following the flowchart Figure 1 Step (1) "The inspector selects the entire dimensional tolerance in the display area of the software interactively", and continues to execute: receive the operation information of the dimensional tolerance selected by the user (i.e., the inspector) and obtain the corresponding "original string" from it.
[0050] (2.2) Determine whether the “original string” contains the string “±”. If it does, proceed to step (2.3); otherwise, proceed to step (2.4).
[0051] (2.3) Extract the second-to-last number from the "original string" as the "nominal size in the size tolerance specific information" (e.g., if the original string is "2-100±0.2", then "100" is the "nominal size in the size tolerance specific information"). Then proceed to step (2.5).
[0052] (2.4) Extract the third-to-last number from the "original string" as the "nominal size in the size tolerance specific information" (e.g., if the original string is "2-100+0.1-0.2" (i.e., the tolerance to be converted is: If "100" is the "nominal size", then proceed to step (2.5).
[0053] (2.5) Obtain the starting index of the "nominal size" string in the "specific information of size tolerance" in the "original string", and based on the starting index, split the "original string" into "string containing size and deviation" and "string without size and deviation" (e.g., split the original string "2 -100+0.1-0.2" into "100+0.1-0.2" and "2-").
[0054] (2.6) For “strings without dimensions and deviations”, use regular expressions to match: “number markers in specific information of dimensional tolerance” (e.g., “2-” separated in (2.5) is removed from the space and matched as “2-”).
[0055] (2.7) Determine whether the string containing size and deviation contains "±" (e.g., the string may be in the form of "100+0.1-0.2" or "100±0.2"). If it contains "±", proceed to step (2.8); otherwise, proceed to step (2.9).
[0056] (2.8) Use "±" to separate the "string with size and deviation" (such as "100±0.2") to obtain the deviation, and add a sign to the deviation to obtain the "upper and lower deviation in the specific information of size tolerance", and then go to step (2.16).
[0057] (2.9) Based on the whitespace characters, the “string with size and deviation” (such as “100+0.1-0.2”) is divided into “several substrings” (such as “100”, “+”, “0.1”, “-”, “0.2”), and then proceed to step (2.10).
[0058] (2.10) Separate the “several substrings” into two groups in order: a number group and a symbol group (e.g., number group: "100", "0.1", "0.2"; symbol group: "+", "-").
[0059] (2.11) Determine if any number in the number group is "0". If so, proceed to step (2.12); otherwise, proceed to step (2.15).
[0060] (2.12) (Here we assume: number group: "100", "0", "0.2"; symbol group: "-") It can be determined that "0" is one of the upper and lower deviations (according to the rule that the upper and lower deviations are written in a fixed way in dimensional tolerances, when the deviation is 0, there is no sign in front of the deviation); in the symbol group, the first symbol is the symbol of "the other deviation besides 0" (here it is "-"); in the number group, apart from the first number (i.e.: nominal size) and "0", the remaining number is the absolute value of "the other deviation besides 0" (here it is "0.2").
[0061] (2.13) Determine the “other deviation other than 0” (here: “-0.2”) based on the sign and absolute value of the “other deviation other than 0”.
[0062] (2.14) Based on the comparison of the magnitude of "0" and "another deviation other than 0", determine the upper and lower deviations of "dimensional tolerance specific information" (here, the upper deviation is determined to be "0" and the lower deviation is "-0.2"), and then proceed to step (2.16).
[0063] (2.15) Based on the aforementioned inference that "in the original string of dimensional tolerance, the order of the upper deviation sign should precede the lower deviation sign, and the order of the upper deviation absolute value should precede the lower deviation absolute value," we can deduce that: the upper deviation sign of "dimensional tolerance specific information" corresponds to the first sign in the symbol group (here: "+"), and the upper deviation absolute value corresponds to the second number in the number group (here: "0.1"), thus obtaining the upper deviation of "dimensional tolerance specific information" (here: "+0.1"). The lower deviation sign of "dimensional tolerance specific information" corresponds to the second sign in the symbol group (here: "-"), and the lower deviation absolute value corresponds to the third number in the number group (here: "0.2"), thus obtaining the lower deviation of "dimensional tolerance specific information" (here: "-0.2"). Then proceed to step (2.16).
[0064] (2.16) Create a "Dimensional Tolerance Specific Information" object with the following attributes: Quantity Marker, Nominal Size, Upper Deviation, and Lower Deviation. Fill in the corresponding relevant data obtained and processed. This will enable the control of... Figure 1 The solution provides data support for the "rapid completion of test reports".
Claims
1. A method for extracting specific information about dimensional tolerances, including quantity markings, nominal dimensions, and upper and lower deviations, specifically comprising the following steps: (1) Receive the operation information of the size tolerance selected by the user, and obtain the corresponding "raw string" from it; (2) Determine whether the "original string" contains the string "±". If it does, proceed to step (3); otherwise, proceed to step (4). (3) Extract the second to last number from the "original string" as the "nominal size in the size tolerance specific information", and then proceed to step (5); (4) Extract the third-to-last number from the "original string" as the "nominal size in the size tolerance specific information", and then proceed to step (5); (5) Obtain the starting index of the string "nominal size in specific dimensional tolerance information" in the "original string", and based on the starting index, split the "original string" into "string containing size and deviation" and "string without size and deviation"; (6) For the string "without dimensions and deviations", use regular expressions to match: "the number of markers in the specific information of dimensional tolerances"; (7) Determine whether the string containing dimensions and deviations contains "±". If it does, proceed to step (8); otherwise, proceed to step (9). (8) Use "±" to separate "string with size and deviation" to obtain the deviation, and add a sign to the deviation to obtain "upper and lower deviation in size tolerance specific information", and then go to step (16); (9) Divide the “string with size and deviation” into “several substrings” based on the whitespace characters, and then proceed to step (10); (10) Divide the "several substrings" into two groups in order: a number group and a symbol group; (11) Determine if any number in the number group is 0. If so, proceed to step (12); otherwise, proceed to step (15). (12) It can be determined that 0 is one of the upper and lower deviations; in the symbol group, the first symbol is the symbol of "the other deviation besides 0"; in the number group, excluding the first number and 0, the remaining number is the absolute value of "the other deviation besides 0"; (13) Determine the "other deviation besides 0" based on the sign and absolute value of the "other deviation besides 0"; (14) Determine the upper and lower deviations of the "dimensional tolerance specific information" by comparing the magnitude of 0 and "another deviation other than 0", and then proceed to step (16); (15) The upper deviation symbol of "specific information of dimensional tolerance" corresponds to the first symbol in the symbol group, and the absolute value of the upper deviation corresponds to the second number in the number group, thus obtaining the upper deviation of "specific information of dimensional tolerance"; the lower deviation symbol of "specific information of dimensional tolerance" corresponds to the second symbol in the symbol group, and the absolute value of the lower deviation corresponds to the third number in the number group, thus obtaining the lower deviation of "specific information of dimensional tolerance"; then proceed to step (16); (16) Create a "Dimensional Tolerance Specific Information" object with the following attributes: number marker, nominal size, upper deviation, lower deviation, and fill in the relevant data obtained and processed earlier.
2. The method for extracting specific information on dimensional tolerances according to claim 1, characterized in that, In step (2), the keyword "±" is used to distinguish the equivalence of the absolute values of the upper and lower deviations.
3. The method for extracting specific information on dimensional tolerances according to claim 1, characterized in that, In step (5), the "original string" is split and then processed by taking advantage of the sequential characteristics of the keywords.
4. The method for extracting specific information on dimensional tolerances according to claim 1, characterized in that, In step (6), regular expressions are used to match the "count marker" in "dimensional tolerance specific information".
5. The method for extracting specific information on dimensional tolerances according to claim 1, characterized in that, In step (12), the rule of "fixed upper and lower deviations in dimensional tolerances" is used.
6. The method for extracting specific information on dimensional tolerances according to claim 1, characterized in that, In step (15), the "upper and lower deviation arrangement order rule" is utilized.