Tolerance visualization calculation method, computer device and storage medium
Patent Information
- Application Number
- CN202611212228.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-11
- Publication Date
- 2026-10-30
AI Technical Summary
[0004]有鉴于此,本发明实施例提供了一种公差的可视化计算方法、计算机设备及存储介质,以解决现有技术中未实现从目标设计参数输入、智能匹配推荐、自动计算、实例可视化辅助理解、状态持久化恢复到可视化结果输出的一体化闭环流程,导致设计过程依赖人工查表与经验判断、多标准切换割裂、状态易丢失,设计效率低且易出错的问题
[0018]本发明实施例基于偏差对候选标准值进行排序并选取偏差最小者作为最优推荐结果,使得匹配结果具有明确的量化依据,偏差最小即代表该候选标准值的实际配合范围与用户要求范围最为接近。在此基础上,当多个候选标准值的偏差相等时,进一步依次按照间隙覆盖度优先、常用等级优先、配合制度偏差系列优先以及中间值接近度优先的多级优先级规则进行逐级排序,直至分出先后顺序,使得在偏差相同的情况下仍能通过层次化的判定逻辑产生唯一且合理的最优推荐结果,从而本发明实施例通过多级优先规则实现了更精细、更符合工程实际的排序与推荐。
Smart Images

Figure CN123013325A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of visualization computing technology, specifically to a method for visualizing tolerances, computer equipment, and storage media. Background Technology
[0002] In mechanical design, process planning, and quality inspection, hole-shaft fit tolerances and geometric tolerances jointly affect assembly performance, manufacturing costs, and product reliability. Currently, engineering technicians mainly obtain tolerance values by consulting national standard manuals or using tolerance lookup tools based on Excel spreadsheets and simple web interfaces.
[0003] However, existing tools only support a forward query mode where users select a tolerance grade and then view the value. Users must know the tolerance grade in advance to query. When engineers only know the expected clearance range or deviation requirements, they still need to rely on personal experience to try repeatedly or manually compare multiple grades. They cannot obtain the optimal grade recommendation based on the design goals. Moreover, the query of hole and shaft fit tolerances, general tolerances and geometric tolerances belong to different standard manuals or software modules. Users need to switch between multiple tools and cannot complete the entire design process from querying the fit grade to calculating the specific tolerance value in one tool. The query and calculation functions are independent of each other, lacking an effective inter-module jump mechanism and status management. Parameters need to be repeatedly entered in multiple iterations, resulting in a fragmented design process. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a method for visually calculating tolerances, a computer device, and a storage medium to solve the problems in the prior art that fail to realize an integrated closed-loop process from target design parameter input, intelligent matching and recommendation, automatic calculation, instance visualization to aid understanding, persistent state recovery to visual result output, resulting in the design process relying on manual table lookup and experience judgment, fragmented switching between multiple standards, easy loss of state, low design efficiency, and easy errors.
[0005] In a first aspect, embodiments of the present invention provide a method for visually calculating tolerances, the method comprising: Obtain the target design parameters and label the target design parameters with input mode labels; Design elements are extracted from the target design parameters, and candidate standard values corresponding to the design elements are determined. The deviation between the target design parameters and the candidate standard values is determined based on the input mode labels. The candidate standard values are sorted based on the deviation to determine the optimal recommendation result, and a custom protocol link carrying complete context information is generated for the optimal recommendation result. In response to triggering the custom protocol link, the user is redirected to a calculation page, where the standard tolerance value is determined based on the target design parameters.
[0006] This invention transforms the traditional tolerance design method, which relies on manual table lookups and trial-and-error based on experience, into a goal-driven, intelligent matching integrated calculation method. Users do not need to know the tolerance grade in advance; they only need to input the desired clearance range or deviation requirement, and the system can automatically match and recommend the optimal tolerance grade, lowering the design threshold and reducing reliance on personal experience. Furthermore, a custom protocol link enables one-click navigation between the matching results and the calculation page, and automatic parameter transfer, eliminating the need for manual recording and repetitive input, ensuring the continuity of the design process. Simultaneously, it integrates the entire design process for mating tolerances, general tolerances, and geometric tolerances within a single tool, avoiding the need to switch between multiple standard manuals.
[0007] In conjunction with the first aspect, in one implementation, obtaining the target design parameters and labeling the target design parameters with input mode labels includes: The target design parameters are parsed to identify the data format type of the target design parameters; Based on the data format type, the target design parameters are divided into one of the following: numerical range mode, standard level mode, text description mode, or fuzzy input mode. Label the target design parameters with the input mode labels corresponding to the data format type.
[0008] This invention parses the target design parameters to identify their data format type, and classifies the input into one of the following modes based on the data format: numerical range mode, standard level mode, text description mode, or fuzzy input mode. Then, it labels the target design parameters with the corresponding input mode labels, enabling the system to automatically identify the form in which the user submits the design requirements. Users do not need to know the tolerance level in advance or strictly follow a specific input format, which significantly reduces the threshold for users' professional knowledge. At the same time, it provides a label basis for subsequent invocation of differentiated matching strategies based on different input modes.
[0009] In conjunction with the first aspect or its corresponding implementation, in one implementation, the method further includes: If the data format type is classified as a text description mode, then text description keywords are extracted from the target design parameters; Using the keywords in the text description as an index, search for the numerical range that matches the keywords in the semantic mapping table; The found numerical range is used to replace the textual description keywords as the input value of the target design parameter, and a replacement confidence score is generated.
[0010] This invention extracts keywords from the target design parameters in a textual description pattern and uses these keywords as indexes to search for matching numerical ranges in a semantic mapping table for replacement. Simultaneously, it generates replacement confidence scores, enabling users to describe design requirements in natural language and drive the system to complete subsequent quantitative matching calculations. Users do not need to master standard tolerance grade codes or precise numerical ranges; they can initiate the matching process using only engineering terminology. This significantly reduces the requirements for users' mastery of technical terms, allowing even inexperienced engineers to quickly complete tolerance design. Furthermore, the generation and output of replacement confidence scores allow users to intuitively judge the reliability of the semantic conversion results. When the confidence score is low, timely manual confirmation or correction is possible. Compared to existing technologies that lack a quantifiable conversion mechanism between textual descriptions and numerical parameters, requiring users to manually convert them by consulting standard manuals, this invention effectively bridges the gap between natural language requirements and quantitative design parameters, improving the system's adaptability to diverse user input methods and the reliability of design results.
[0011] In conjunction with the first aspect, in one implementation, the step of extracting design elements from the target design parameters and determining candidate standard values corresponding to the design elements includes: The positioning parameters are extracted from the target design parameters, and the corresponding data size range is determined based on the positioning parameters; The standard values within the data size range are extracted as the candidate standard values.
[0012] This invention extracts positioning parameters from target design parameters, automatically determines the corresponding data size range based on these positioning parameters, and extracts all standard values within the size range as candidate standard values. This enables the system to automatically complete the initial screening of standard data based on the basic dimensions input by the user, realizing automatic mapping and data retrieval from design dimensions to candidate standard values. This provides a complete and accurate data foundation for subsequent intelligent deviation calculation and optimal matching, reducing the range assignment errors and candidate level omissions that may occur during manual table lookup.
[0013] In conjunction with the first aspect, in one implementation, determining the deviation between the target design parameter and the candidate standard value based on the input pattern label includes: Based on the input mode label, the current matching type is determined, which includes hole-shaft fit matching and geometric tolerance matching; When the matching type is hole-shaft fit matching, the lower limit deviation value and the upper limit deviation value are calculated based on the actual fit range corresponding to the candidate standard value and the user requirement range in the target design parameters, and the sum of the lower limit deviation value and the upper limit deviation value is taken as the deviation. When the matching type is geometric tolerance matching, the difference between the candidate standard value and the main parameter value in the target design parameters is calculated as the deviation.
[0014] This invention determines the current matching type as hole-shaft fit matching or geometric tolerance matching based on the input mode label, and employs differentiated deviation calculation methods for different matching types. This allows the system to automatically adapt the corresponding matching logic based on the user's input format. When the matching type is hole-shaft fit matching, the system calculates the lower and upper limits of the deviation between the actual fit range of the candidate standard value and the user-required range, and sums these two values as the total deviation, fully reflecting the overall deviation between the actual range and the target range on both sides. When the matching type is geometric tolerance matching, since the matching dimension is a single value rather than a range, the system directly calculates the difference between the candidate standard value and the main parameter value as the deviation. Through differentiated deviation calculation methods, the same matching framework can cover different types of tolerance design scenarios, allowing users to complete different types of tolerance matching tasks without switching between different tools.
[0015] In conjunction with the first aspect or its corresponding implementation, in one implementation, after calculating the lower limit deviation value and the upper limit deviation value, the method further includes: When both the lower limit deviation value and the upper limit deviation value are zero, it is determined that the candidate standard value and the target design parameter are a two-sided match, and the deviation is zero. When the lower limit deviation is zero or the upper limit deviation is zero, it is determined that the candidate standard value and the target design parameter are a one-sided match, and the deviation is non-zero.
[0016] After calculating the lower and upper deviation values, this embodiment of the invention further determines whether the matching type between the candidate standard value and the target design parameter is a two-sided match or a one-sided match. This allows the system to not only calculate the deviation of each candidate level for ranking but also output qualitative judgment results on the matching attributes between each candidate level and the design requirements. In other words, by outputting visual matching attribute labels, users can intuitively understand the matching characteristics of each candidate level, providing richer decision-making reference information for the final level selection.
[0017] In conjunction with the first aspect, in one implementation, ranking the candidate standard values based on the deviation to determine the optimal recommendation result includes: The candidate standard values are sorted based on the deviation, and the candidate standard value with the smallest deviation is selected as the optimal recommendation result. When multiple candidate standard values have the same deviation, they are sorted according to the following priority rules until a priority order is determined: gap coverage priority, common level priority, coordination system deviation series priority, and median value proximity priority.
[0018] This invention sorts candidate standard values based on deviation and selects the one with the smallest deviation as the optimal recommendation result. This provides a clear quantitative basis for the matching result, as the smallest deviation indicates that the actual matching range of the candidate standard value is closest to the user's required range. Furthermore, when multiple candidate standard values have equal deviations, they are further sorted according to a multi-level priority rule: gap coverage priority, common level priority, matching system deviation series priority, and median value proximity priority, until a specific order is determined. This ensures that even with the same deviation, a unique and reasonable optimal recommendation result can be generated through hierarchical judgment logic. Thus, this invention achieves more refined sorting and recommendation that better reflects engineering practice through multi-level priority rules.
[0019] In conjunction with the first aspect, in one implementation, generating a custom protocol link carrying complete contextual information for the optimal recommendation result includes: Extract at least one size parameter from the optimal recommendation result; The size parameters are encoded into a Uniform Resource Identifier according to a custom protocol format, and the Uniform Resource Identifier is embedded into the comprehensive visualization report of the current interface to form a triggerable custom protocol link.
[0020] The embodiments of the present invention encode complete matching context information in a single link, so that the parameter passing between the matching result and detailed calculation does not rely on database queries or global variables, and all information can be passed through the link itself, reducing the coupling degree and implementation complexity of the system.
[0021] In conjunction with the first aspect or its corresponding implementation, in one implementation, the step of redirecting to the computing page in response to triggering the custom protocol link includes: Parse the size parameters carried in the custom protocol link; The target design parameters are obtained based on the size parameters obtained from the analysis, and then the user is redirected to the calculation page.
[0022] This invention encodes complete matching context information into the link itself. Parameters can be fully recovered by parsing the link, without relying on backend storage or global variables, thus decoupling the matching results from the calculation page. The accuracy and completeness of parameter transmission are guaranteed by the link encoding mechanism, avoiding errors that may occur during manual transcription. Furthermore, the links can be bookmarked and reused, further facilitating the sharing and retrospection of design solutions.
[0023] In conjunction with the first aspect or its corresponding implementation, in one implementation, parsing the size parameter carried in the custom protocol link includes: When parsing the size parameters carried in the custom protocol link, if the custom protocol link is missing level information, an input dialog box is generated and displayed on the current page. The input dialog box is used to prompt the user to supplement the missing level information. When parsing the size parameters carried in the custom protocol link, if the basic size is missing in the custom protocol link, the default value is used to replace the basic size; When parsing the size parameters carried in the custom protocol link, if the custom protocol link is missing a matching system, the default matching system is used instead of the matching system. When parsing the size parameters carried in the custom protocol link, if the gap range is missing in the custom protocol link, a general recommended value is used to replace the gap range.
[0024] Through the aforementioned fault-tolerance mechanism, this invention can complete the jump and calculation process as much as possible even when the link parameters are incomplete, avoiding direct termination of operations due to missing parameters, thus improving the system's fault tolerance and user experience. Furthermore, the differentiated handling strategies for various missing parameters fully consider the impact of different parameters on the calculation results, achieving a reasonable balance between convenience and accuracy.
[0025] In conjunction with the first aspect, in one implementation, determining the standard tolerance value based on the target design parameters in the calculation page includes: Geometric tolerance design elements are extracted from the target design parameters. These geometric tolerance design elements include geometric tolerance type, master parameter value, and tolerance grade. The definition of principal parameters and the rules for dividing size ranges are determined based on the geometric tolerance type. Using the main parameter value as an index, locate the corresponding size range under the size range division rule, and determine the standard tolerance value that matches the tolerance grade from the tolerance value table.
[0026] This invention, through its embodiments, extracts geometric tolerance design elements from target design parameters on the calculation page, determines the corresponding principal parameter definitions and size interval division rules based on the geometric tolerance type, and then uses the principal parameter values as indexes to locate size intervals and determine standard tolerance values from the tolerance value table. This fully automates the process of determining geometric tolerance values. Users do not need to consult standard manuals to find principal parameter definitions, manually determine size interval assignments, or compare tolerance value tables line by line. The entire calculation process from parameter input to standard tolerance value output is automatically completed, significantly shortening the geometric tolerance design time and avoiding potential positioning errors and numerical misinterpretations that may occur during manual table lookups and interval assignment determination.
[0027] In conjunction with the first aspect or its corresponding implementation, in one implementation, the method further includes: A separate pop-up window is generated in response to the operation of viewing an instance of the current geometric tolerance type; The independent pop-up window displays a standardized schematic diagram of the master parameters and technical description text corresponding to the geometric tolerance type. The technical description text includes definitions, master parameter descriptions, typical application scenarios, and measurement methods.
[0028] Through the above-described example viewing function, this invention allows users to intuitively understand the definition of the main parameters for the current geometric tolerance type via a pop-up window before inputting main parameter values. This ensures the accuracy of subsequent main parameter inputs and effectively reduces parameter input errors caused by misunderstandings of concepts. Simultaneously, the pop-up format allows users to obtain auxiliary information without leaving the current calculation page, ensuring the continuity of the design process.
[0029] In conjunction with the first aspect, in one embodiment, the method further includes: The target design parameters, the optimal recommendation result, and the interface state of the current interface are serialized into a memory state object. The current interface is either a matching result display interface or a calculation page. The matching result display interface is an interface for determining the deviation between the target design parameters and the candidate standard values. The memory state object is bound and stored with the current user session.
[0030] This invention serializes the target design parameters, optimal recommendation results, and the current interface state into a memory state object and binds it to the current user session for storage. This allows the system to automatically save complete context information during multiple design iterations. When the user returns from the calculation page to the matching result display interface, the input parameters, recommendation results, and interface control states do not need to be reset, allowing the user to directly continue their previous work progress. This achieves automatic saving and restoration of the state when switching between different pages within the same session, reducing repetitive input operations during parameter adjustments, ensuring the continuity of multiple design iterations, and significantly improving work efficiency in complex design tasks.
[0031] In a second aspect, embodiments of the present invention provide a computer device, including: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to perform the tolerance visualization calculation method of the first aspect or any corresponding embodiment described above.
[0032] Thirdly, embodiments of the present invention provide a computer-readable storage medium storing computer instructions for causing a computer to perform the tolerance visualization calculation method of the first aspect or any corresponding embodiment described above. Attached Figure Description
[0033] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0034] Figure 1 This is a flowchart illustrating a method for visually calculating tolerances according to some embodiments of the present invention; Figure 2 This is a schematic diagram of the architecture of a tolerance visualization calculation system according to some embodiments of the present invention; Figure 3 This is yet another flowchart illustrating a method for visually calculating tolerances according to some embodiments of the present invention. Figure 4 This is a structural block diagram of a tolerance visualization calculation device according to an embodiment of the present invention; Figure 5 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. Detailed Implementation
[0035] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0036] According to an embodiment of the present invention, a method for visually calculating tolerances is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0037] This embodiment provides a method for visually calculating tolerances, which is applied to a tolerance visualization calculation system. Figure 1 This is a flowchart of a method for visually calculating tolerances according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps: Step S101: Obtain the target design parameters and label the target design parameters with input mode labels.
[0038] Step S102: Extract design elements from the target design parameters, determine the candidate standard values corresponding to the design elements, and determine the deviation between the target design parameters and the candidate standard values based on the input mode labels.
[0039] Step S103: Sort the candidate standard values based on the bias to determine the optimal recommendation result, and generate a custom protocol link carrying complete context information for the optimal recommendation result.
[0040] Step S104: In response to triggering a custom protocol link, redirect to the calculation page, and determine the standard tolerance value based on the target design parameters on the calculation page.
[0041] The tolerance visualization calculation method provided in this embodiment obtains target design parameters and labels the input mode, supporting multiple input formats such as numerical ranges, standard levels, and text descriptions. This allows users to query based on design targets without prior knowledge of the tolerance level, thus solving the problem of low design efficiency caused by existing technologies that only support forward table lookups and cannot recommend levels based on design targets. Furthermore, by extracting design elements from the target design parameters and determining corresponding candidate standard values, and calculating the deviation between the target design parameters and candidate standard values based on the input mode labels, the optimal recommendation result is determined based on deviation ranking. This makes the matching process quantifiable and reproducible, solving the problem of relying on experience and inconsistent results when manually comparing multiple levels. Moreover, by generating a custom protocol link with complete contextual information for the optimal recommendation result, and automatically redirecting to the calculation page and determining the standard tolerance value based on the target design parameters when the link is triggered, automatic parameter transfer and one-click redirection are achieved between the matching result and detailed calculation. This solves the problem of fragmented design processes caused by independent query and calculation functions and repeated parameter input in multiple iterations in existing tools. In summary, the embodiments of the present invention will inevitably achieve reverse intelligent recommendation from design goals to tolerance levels, automatic calculation and visualization output of matching results, and automatic transfer of context between modules, and ultimately improve the overall efficiency and consistency of tolerance design.
[0042] The steps described above will be explained in detail below.
[0043] Figure 2 This is a schematic diagram of the architecture of a tolerance visualization calculation system according to some embodiments of the present invention. Figure 2 As shown, the system adopts a layered architecture design, which includes, from bottom to top, a data storage layer, a data service layer, a core business layer, an extended function layer, and a user interface layer.
[0044] The data storage layer stores the standard data upon which the system depends for operation. This layer uses JSON format to store structured data from multiple standard manuals. JSON (JavaScript Object Notation) is a lightweight data-interchange format that organizes data using key-value pairs, offering good readability and cross-platform compatibility. The data storage layer uses size ranges as the primary key, storing the corresponding tolerance grades and their upper and lower deviation values or tolerance values, providing the raw data source for upper-layer data services.
[0045] The data service layer sits above the data storage layer and includes the data engine module and the protocol parser.
[0046] The data engine module is used to pre-configure and structure standard data in the standard manual. It uses format conversion functions to uniformly convert the original heterogeneous data in the storage layer into a standardized key-value pair structure from size range to tolerance value, establishes a lightweight index database, and builds a size range caching mechanism to improve the response speed of repeated queries.
[0047] The protocol parser is used to intercept and parse custom protocol links with custom protocol formats. Integrated into the text browsing control in the user interface layer, the protocol parser intercepts and parses custom protocol links by overriding the link trigger callback method. When a user triggers a custom protocol link, the protocol parser extracts all encoded parameters from the link, including hole tolerance grade code, shaft tolerance grade code, basic dimension value, fit system, and clearance range, and passes the parsed parameters to the corresponding module in the core business layer.
[0048] The core business layer includes an intelligent matching module, a query and recommendation module, a visualization and computing module, and a status management module.
[0049] The intelligent matching module receives target design parameters, calculates the deviation from standard tolerance values, and automatically recommends the optimal matching result using a multi-level priority judgment rule. Specifically, the intelligent matching module includes a tolerance grade matching submodule and a fit grade matching submodule, used to match the corresponding tolerance grade based on the user-input deviation value, and to match the corresponding hole-shaft fit grade based on the user-input clearance range, respectively. The deviation value algorithm submodule implements the deviation calculation logic in the aforementioned embodiments, including the calculation of the lower limit deviation value and the upper limit deviation value, and the determination of the total deviation.
[0050] The query recommendation module is used to execute matching queries based on the query conditions entered by the user, generate matching results and output the results through a custom protocol format, thereby realizing the automatic transfer of parameters between the matching results interface and the calculation page.
[0051] The visualization calculation module is used to dynamically generate comprehensive visualization reports based on the intelligent matching results, including automatic generation of tolerance tables, clearance analysis, and determination of fit properties.
[0052] The state management module is used to implement the state persistence and restoration functions in the aforementioned embodiments, including parameter storage, context management, and state restoration. After each user operation, this module serializes the target design parameters, optimal recommendation results, and interface state into an in-memory state object, binds it to the current user session for storage, and automatically restores the interface state when the user returns.
[0053] The extended functionality layer includes a general tolerance module and a geometric tolerance module, which are used to extend the functionality of the core business layer.
[0054] The general tolerance module automatically calculates general tolerances for linear dimensions based on standard manuals. After the user inputs the basic dimension and selects the tolerance grade, the module automatically locates the corresponding dimension range, reads the corresponding tolerance value, and outputs the symmetrical tolerance zone and limit dimensions.
[0055] The geometric tolerance module matches the standard tolerance values for the corresponding size range based on the user-selected geometric tolerance type, main parameter values, and tolerance grade. Simultaneously, this module integrates an instance visualization function, generating an independent pop-up window to display a standardized schematic diagram of the main parameters and technical explanatory text in response to the user's instance viewing operation.
[0056] The user interface layer is the top layer of the system, providing a graphical user interface for user interaction with various functional modules. This layer includes at least a matching result display interface and a calculation page. The matching result display interface shows the deviation determination results between the target design parameters and candidate standard values, as well as the optimal recommendation results, and embeds a custom protocol link for users to trigger. The calculation page displays detailed standard tolerance calculation results after the user triggers the custom protocol link, and provides a function to view geometric tolerance examples.
[0057] In the layered architecture described above, the layers communicate with each other through standardized interfaces. The layers have clear responsibilities and good loose coupling. Upper-layer modules call the services provided by lower-layer modules, and modules in the same layer pass context through a protocol parser, which makes the system have good maintainability and scalability.
[0058] In step S101, the target design parameters are obtained, and input mode labels are assigned to the target design parameters.
[0059] In one optional implementation, the target design parameters are obtained, and input mode labels are assigned to the target design parameters, including: The target design parameters are parsed to identify their data format type; Based on the data format type, the target design parameters are divided into one of the following: numerical range mode, standard level mode, text description mode, or fuzzy input mode. Design parameter annotations for the target and input mode labels corresponding to the data format type.
[0060] In this embodiment, the target design parameters are various design requirements information input by the user during the tolerance design process. They can be in the form of any one of the following: numerical range, standard grade code, text description, or fuzzy numerical value.
[0061] To facilitate the system's subsequent recognition of user intent and invocation of corresponding matching logic, the target design parameters need to be parsed and labeled with their input pattern tags. Specifically, after obtaining the target design parameters entered by the user in the input control, the system first parses their format. For example, regular expression matching can be used to perform pattern recognition on the input content. Regular expressions are rule expressions used to describe string matching patterns. There is a pre-defined regular expression rule library that matches numerical range formats, standard level formats, text description formats, and fuzzy input formats. By using predefined matching rules, the format type of the input content can be quickly determined.
[0062] Next, based on the data format type, the target design parameters are categorized into one of the following: numerical range mode, standard level mode, text description mode, or fuzzy input mode. Specifically, based on the parsing results of the target design parameters, they are assigned to the corresponding input mode category.
[0063] If the target design parameters contain connecting symbols indicating a range, such as "~" or "-", and both sides of the symbol are numerical values, then it is classified as a numerical range mode. For example, if the user inputs "20~50" or "20-50", it belongs to the numerical range mode, which indicates that the user expects the gap range to be from 20 micrometers (μm) to 50 micrometers (μm).
[0064] If the target design parameters include standard tolerance grade codes representing hole-shaft fits, such as "H7 / g6" or "H8 / f7", where the letter part represents the basic deviation code (e.g., H represents the basic deviation of the hole, g and f represent the basic deviation of the shaft), and the number part represents the tolerance grade (e.g., grade 7, grade 6, etc.), then it is classified as a standard grade pattern.
[0065] If the target design parameters are Chinese terms indicating the type of fit, such as "slight interference," "transition fit," or "clearance fit," then they are classified as textual descriptions. These terms need to correspond to different fit categories specified in the standard. Clearance fits ensure that the minimum limit size of the hole is greater than or equal to the maximum limit size of the shaft. Interference fits ensure that the maximum limit size of the hole is less than or equal to the minimum limit size of the shaft. Transition fits are in between and may result in either clearance or interference.
[0066] If the target design parameters contain numerical values but also contain vague modifiers such as "about" or "around", for example, "about 30 micrometers (μm)", then it is classified as a fuzzy input mode.
[0067] Furthermore, based on the input mode categories into which the target design parameters are categorized, corresponding input mode labels are added to the target design parameters. This enables the system to invoke appropriate matching strategies and deviation calculation methods based on different input mode categories. Input mode labels can be implemented using enumeration types or string types. For example, "NUM_RANGE" represents the numerical range mode, "STD_GRADE" represents the standard grade mode, "TEXT_DESC" represents the text description mode, and "FUZZY_INPUT" represents the fuzzy input mode.
[0068] In this embodiment, the target design parameters are parsed to identify their data format type. Based on the data format type, the input is categorized into one of the following modes: numerical range mode, standard grade mode, text description mode, or fuzzy input mode. The target design parameters are then labeled with corresponding input mode tags, enabling the system to automatically identify the form in which the user submits the design requirements. Users can directly input known tolerance grade codes for quick queries, or input numerical ranges when only knowing the expected clearance range. Even in the conceptual design stage, users can initiate the matching process using natural language descriptions such as "slight interference." Compared to existing technologies that only allow selection of fixed input formats via drop-down menus and require users to have prior knowledge of tolerance grade codes for queries, this embodiment eliminates the need for users to know the tolerance grade beforehand or strictly adhere to a specific input format. This significantly lowers the barrier to entry for user expertise and provides a tagging basis for subsequently invoking differentiated matching strategies based on different input modes.
[0069] In one alternative implementation, the method further includes: If the data format type is classified as text description mode, then extract text description keywords from the target design parameters; Using the keywords in the text description as an index, search for the numerical range that matches the keywords in the semantic mapping table; The found numerical range is replaced with the keywords of the text description as the input value of the target design parameter, and the replacement confidence score is generated.
[0070] In this embodiment, when the target design parameters are classified as text description mode, it indicates that the user is describing their design requirements in natural language.
[0071] To ensure that the user's text descriptions can be recognized by the system and used for subsequent quantitative matching calculations, the text descriptions need to be converted into corresponding numerical ranges, and the reliability of the conversion needs to be provided. Specifically, natural language processing is performed on the target design parameters to extract keywords from the text descriptions. These keywords are words that characterize the fit type or design intent, including but not limited to "clearance fit," "transition fit," "interference fit," and their sub-types such as "slight interference," "medium interference," and "large clearance." Matching and extraction can be performed based on a preset keyword library for fit types. This library stores various fit-related words and their synonyms and near-synonyms. For example, when the user inputs "I want a small clearance between the shaft and the hole," the keyword "clearance" is extracted; when the user inputs "slight interference is needed," the keyword "slight interference" is extracted; and when the user inputs "transition fit," the keyword "transition fit" is extracted. If keywords cannot be recognized, the user can be prompted to re-enter or the default matching strategy can be used.
[0072] Next, using the textual description keywords as indexes, the system searches for numerical ranges that match the textual description keywords in the semantic mapping table. This semantic mapping table is a built-in database with pre-defined mapping relationships between textual descriptions and numerical ranges. This mapping table can be pre-built based on the definitions of fit classifications in standard manuals and the typical gap / interference ranges corresponding to each type of fit. The semantic mapping table uses the textual description keywords as index fields and the corresponding numerical ranges as value fields for storage.
[0073] For example, the numerical range for "gap fit" is (0, +∞) μm (micrometers), the numerical range for "transition fit" includes values from negative to positive, and the numerical range for "interference fit" is (-∞, 0) μm (micrometers). For sub-types, the numerical range for "slight interference" is (-10, 0) μm (micrometers), and the numerical range for "medium interference" is (-30, -10) μm (micrometers). The system uses the extracted keywords as indexes to search in this mapping table to obtain the corresponding numerical ranges.
[0074] Next, the found numerical ranges are replaced with the keywords in the text description as input values for the target design parameters, and a replacement confidence score is generated. Specifically, the found numerical ranges are used as input values for the target design parameters for subsequent deviation calculations and matching sorting. Simultaneously, a replacement confidence score needs to be generated and output to the interface for user reference. The replacement confidence score is a quantitative indicator representing the accuracy of the matching between the keywords in the text description and the index items in the semantic mapping table.
[0075] This embodiment can calculate the text similarity between the text description keywords and each standard keyword in the semantic mapping table, determine the standard keyword with the highest similarity as the matching result, and use the similarity value as the replacement confidence.
[0076] Text similarity can be calculated using any of the following methods: string similarity based on edit distance, cosine similarity based on word vectors, or semantic similarity based on a semantic understanding model. Edit distance refers to the minimum number of single-character edits required to convert one string to another, suitable for measuring the similarity between spelling variants or abbreviations. Word vectors are a distributed representation method that maps words to a high-dimensional vector space. Semantically similar words are closer in the vector space, and the cosine similarity between two word vectors can be used to measure the semantic closeness between words, suitable for measuring the similarity between synonyms or near-synonyms. For example, the edit distance between "gap" and "gap fit" is close, indicating high similarity and a correspondingly high replacement confidence; the semantic distance between "loosen up a bit" and any standard keyword is far, resulting in a correspondingly low replacement confidence.
[0077] The calculated similarity value is used as the replacement confidence score output, ranging from 0 to 1. When the similarity is lower than a preset threshold, such as 0.6, a prompt can be issued, suggesting that the user confirm or manually correct the mapping result. If the highest similarity is still lower than the preset threshold, the matching result is marked as "low confidence," and the top N candidate mappings with the highest similarity are displayed for the user to choose from. Through the above text similarity-based calculation method, it is not necessary to pre-set a confidence value for every possible user input. Instead, the confidence score is dynamically generated by calculating the similarity between the input keywords and standard keywords, thereby covering any natural language input from the user and possessing stronger generalization ability and flexibility.
[0078] In this embodiment, keywords are extracted from the target design parameters of the textual description pattern, and the matching numerical ranges are searched for in the semantic mapping table using these keywords as indexes for replacement. Simultaneously, a replacement confidence score is generated, enabling users to describe design requirements in natural language and drive the system to complete subsequent quantitative matching calculations. Users do not need to master standard tolerance grade codes or precise numerical ranges; they can initiate the matching process using only engineering terminology, significantly reducing the requirements for users' mastery of technical terms and allowing even inexperienced engineers to quickly complete tolerance design. Furthermore, the generation and output of the replacement confidence score allows users to intuitively judge the reliability of the semantic conversion results. When the confidence score is low, manual confirmation or correction can be performed promptly. Compared to the shortcomings of existing technologies where there is no quantifiable conversion mechanism between textual descriptions and numerical parameters, and users can only manually convert them by consulting standard manuals, this invention achieves an effective bridge from natural language requirements to quantitative design parameters, improving the system's adaptability to diverse user input methods and the reliability of design results.
[0079] In step S102, design elements are extracted from the target design parameters, and candidate standard values corresponding to the design elements are determined. The deviation between the target design parameters and the candidate standard values is determined based on the input mode label.
[0080] The system extracts design elements from the target design parameters and determines the corresponding candidate standard values for each design element. Then, based on the input mode labels, it determines the deviation between the target design parameters and each candidate standard value. Design elements are key parameter information extracted from the target design parameters and used for subsequent matching calculations. For hole-shaft fit design scenarios, design elements at least include positioning parameters and user-required ranges; positioning parameters are used to locate the corresponding data size range in the national standard database.
[0081] In one optional implementation, design elements are extracted from the target design parameters, and candidate standard values corresponding to the design elements are determined, including: Extract positioning parameters from the target design parameters, and determine the corresponding data size range based on the positioning parameters; Extract the standard values within the data size range as candidate standard values.
[0082] Specifically, the positioning parameters are first extracted from the target design parameters. These positioning parameters are the basic dimensions used to locate the data size range in the standard database. The basic dimension refers to the theoretical size value given in the design, which is the reference size for determining the tolerance value. For example, "50" in 50mm is the basic dimension. The standard manual divides the basic dimensions into several continuous and non-overlapping size ranges according to their numerical values, such as "greater than 18mm to 30mm", "greater than 30mm to 50mm", "greater than 50mm to 80mm", etc. Each size range corresponds to a set of standard tolerance values.
[0083] Using the basic size as an index, the system finds the size range to which the basic size belongs, according to the size range division rules specified in the standard manual. For example, when the user enters a basic size of 25mm, it is positioned in the size range of "greater than 18mm to 30mm"; when the basic size is 50mm, it is positioned in the size range of "greater than 30mm to 50mm". If the basic size is exactly equal to the range boundary value, such as 30mm, it is processed according to the range assignment rules specified in the standard manual, that is, the boundary value is assigned to the upper or lower limit range.
[0084] Next, using the located size range as the search condition, all standard values within that range are extracted from the standard database as candidate standard values. The standard database is a built-in database containing standard data specified in the standard manual. It stores each tolerance grade corresponding to that range, along with its upper and lower deviation values, using the size range as the primary key. Standard values are the deviation values specified in the standard manual, corresponding to a specific size range and tolerance grade. Candidate standard values are the set of standard values corresponding to all tolerance grades within that size range. For example, when the size range "greater than 30mm to 50mm" is located, all standard tolerance grades within that range, such as d5, d6, d7, e5, e6, e7, f5, f6, f7, g5, g6, h5, and h6, are extracted as candidate standard values, along with their corresponding upper and lower deviation values. All extracted candidate standard values serve as the data basis for subsequent deviation calculations and matching sorting.
[0085] In this embodiment, by extracting positioning parameters from the target design parameters, the corresponding data size range is automatically determined based on these positioning parameters, and all standard values within this size range are extracted as candidate standard values. This allows the system to automatically complete the initial screening of standard data based on the user-input basic dimensions. Users no longer need to manually consult numerous size range tables in the standard manual to determine which range their design dimensions belong to, nor do they need to know which tolerance grades are available within that range. The system can automatically locate and recall all relevant candidate standard values, automating the steps that previously required manually consulting the standard manual for range positioning and candidate grade screening. This achieves automatic mapping and data retrieval from design dimensions to candidate standard values, providing a complete and accurate data foundation for subsequent intelligent deviation calculation and optimal matching, reducing potential errors in range assignment and candidate grade omissions caused by manual table lookups.
[0086] In one optional implementation, determining the deviation between the target design parameter and the candidate standard value based on the input mode label includes: The current matching type is determined based on the input mode label. Matching types include hole-shaft fit matching and geometric tolerance matching. When the matching type is hole-shaft fit matching, the lower limit deviation value and the upper limit deviation value are calculated based on the actual fit range corresponding to the candidate standard value and the user requirement range in the target design parameters, and the sum of the lower limit deviation value and the upper limit deviation value is taken as the deviation. When the matching type is geometric tolerance matching, the difference between the candidate standard value and the main parameter value in the target design parameter is calculated as the deviation.
[0087] In this embodiment, the deviation is a numerical index used to quantify the degree of matching between each candidate standard value and the target design parameter. The smaller the deviation, the closer the candidate standard value is to the user's design requirements. Since different types of matching requirements have different data structures, matching dimensions, and deviation calculation logic, the system needs to determine the current matching type based on the input mode label and call the corresponding deviation calculation method. The input mode label is the label marked in step S101, which is used to characterize the user's input data format type. It indirectly reflects the user's matching requirement type. For example, when the user inputs a numerical range or standard grade code, the matching requirement is hole-shaft fit matching; when the user inputs geometric tolerance type and main parameter value, the matching requirement is geometric tolerance matching.
[0088] Specifically, the current matching type is determined based on the tag type corresponding to the input pattern tag. The input pattern tags include, but are not limited to, numerical range mode, standard level mode, text description mode, and fuzzy input mode.
[0089] Specifically, when the input mode label is a numerical range mode or a text description mode, the matching type is hole-shaft fit matching, for example, the user inputs a clearance requirement of "20~50" μm; when the input mode label is a numerical range mode but the input content contains keywords related to geometric tolerances, the matching type is geometric tolerance matching, for example, the user inputs "cylindricity, 50mm, grade 6", etc. If the user inputs a standard grade mode, in addition to performing hole-shaft fit matching, the corresponding standard value can be directly determined based on the grade code and the calculation result can be output, without the need for deviation calculation and sorting recommendations.
[0090] When the matching type is hole-shaft fit matching, the lower limit deviation value and the upper limit deviation value are calculated based on the actual fit range corresponding to the candidate standard value and the user requirement range in the target design parameters, and the sum of the lower limit deviation value and the upper limit deviation value is taken as the deviation.
[0091] Specifically, when the matching type is hole-shaft fit, the target design parameter is the user-desired fit clearance range or upper / lower deviation range, and the candidate standard values are the standard upper deviation and standard lower deviation values corresponding to each fit grade. In hole-shaft fits, each fit grade has a corresponding standard upper deviation and standard lower deviation, which constitute the actual fit range corresponding to that fit grade, i.e., from the actual minimum clearance to the actual maximum clearance. Example: Actual minimum clearance = Bore deviation - Shaft deviation Actual maximum clearance = upper hole deviation - lower shaft deviation The upper deviation is the maximum allowable deviation of the dimension, i.e., the difference between the maximum limit dimension and the basic dimension; the lower deviation is the minimum allowable deviation of the dimension, i.e., the difference between the minimum limit dimension and the basic dimension. The clearance is the difference between the hole size and the shaft size; a positive difference indicates clearance, and a negative difference indicates interference.
[0092] Obtain the actual fit range of the candidate standard value and the user requirement range in the target design parameters. The actual fit range of the candidate standard value is from the actual minimum clearance to the actual maximum clearance, and the user requirement range in the target design parameters is from the expected minimum clearance to the expected maximum clearance. Compare the actual fit range and the user requirement range.
[0093] Specifically, the difference between the lower limit of the user-required range (i.e., the expected minimum clearance in this embodiment) and the lower limit of the actual fit range (i.e., the actual minimum clearance in this embodiment) is calculated to obtain the lower limit deviation value; the difference between the upper limit of the user-required range (i.e., the expected maximum clearance in this embodiment) and the upper limit of the actual fit range (i.e., the actual maximum clearance in this embodiment) is calculated to obtain the upper limit deviation value, i.e.: Lower limit deviation value = Expected minimum gap - Actual minimum gap Upper limit deviation = Expected maximum clearance - Actual maximum clearance The sum of the lower limit deviation and the upper limit deviation is taken as the total deviation of the candidate standard value. The smaller the total deviation, the closer the actual fit range of the candidate standard value is to the user's required range. For example, if the actual fit range of a candidate fit grade is 9~50μm, and the user's required range is 20~50μm, then the lower limit deviation is the difference between 20 and 9, which is 11μm; the upper limit deviation is the difference between 50 and 50, which is 0μm. Therefore, the total deviation is the sum of 11 and 0, which is 11μm. The lower limit deviation can be positive or negative. A positive value indicates that the actual minimum clearance is less than the user's required minimum clearance, meaning the lower limit of the actual fit range is too tight. A negative value indicates that the actual minimum clearance is greater than the user's required minimum clearance, meaning the lower limit of the actual fit range is too loose.
[0094] When the matching type is geometric tolerance matching, the difference between the candidate standard value and the main parameter value in the target design parameter is calculated as the deviation.
[0095] Specifically, when the matching type is geometric tolerance matching, the main parameter value in the target design parameters is the key dimensional parameter input by the user to determine the geometric tolerance value, including but not limited to length, diameter, etc. The candidate standard value is the standard geometric tolerance value corresponding to each size range and tolerance grade in the national standard database.
[0096] Since geometric tolerance matching is a single-value matching dimension, rather than a range matching in hole-shaft fits, the difference between each candidate standard value and the main parameter value in the target design parameters can be directly calculated, and this difference is used as the deviation. For example, if the user inputs a cylindricity main parameter value of 50mm, and the candidate standard value for a certain size range is 4μm, the difference is 46μm. It should be noted that the deviation calculation methods for geometric tolerance matching and hole-shaft fit matching are different. The former compares the difference between a single value, while the latter calculates the deviation between two ranges. This allows the system to effectively quantify the degree of matching between the candidate standard value and the user's requirements under different matching types.
[0097] In this embodiment, the current matching type is determined to be either hole-shaft fit matching or geometric tolerance matching based on the input mode label. Different deviation calculation methods are used for different matching types, enabling the system to automatically adapt the corresponding matching logic according to the user's input format. When the matching type is hole-shaft fit matching, the system calculates the lower and upper limits of the deviation between the actual fit range of the candidate standard value and the user-required range, and sums these two values as the total deviation, fully reflecting the overall deviation between the actual range and the target range on both sides. When the matching type is geometric tolerance matching, since the matching dimension is a single numerical value rather than a range, the difference between the candidate standard value and the main parameter value is directly calculated as the deviation. Compared to the shortcomings of existing technologies that only support deviation calculation for a single type and cannot simultaneously address both hole-shaft fit and geometric tolerance matching needs within the same tool, this embodiment, through differentiated deviation calculation methods, allows the same matching framework to cover different types of tolerance design scenarios. Users can complete different types of tolerance matching tasks without switching between different tools.
[0098] In one alternative implementation, after calculating the lower limit deviation value and the upper limit deviation value, the method further includes: When both the lower limit deviation value and the upper limit deviation value are zero, the candidate standard value is determined to be a two-sided match with the target design parameter, and the deviation is zero. When the lower limit deviation is zero or the upper limit deviation is zero, the candidate standard value is determined to be a one-sided match with the target design parameter, and the deviation is non-zero.
[0099] During the hole-shaft fit matching process, after calculating the lower and upper limits of the deviation values for each candidate standard value, the matching type between the candidate standard value and the target design parameters can be further determined based on the values of these two deviation values. Matching types include two-sided matching and one-sided matching. The determination results for two-sided and one-sided matching are used to assist users in understanding the attribute characteristics of the matching results and to help users determine the positional relationship between the standard fit range and the design requirement range.
[0100] Specifically, when both the lower and upper deviation values are zero, it indicates that the lower limit of the actual matching range of the candidate standard value equals the lower limit of the user-required range, and the upper limit of the actual matching range equals the upper limit of the user-required range. In other words, the actual matching range of the candidate standard value is completely consistent with the user-required range, and both sides are precisely matched. At this point, the candidate standard value is determined to be a two-sided match with the target design parameter, with an actual deviation of zero. Therefore, this candidate standard value is considered a perfectly matched ideal recommendation result.
[0101] When the lower limit deviation is zero but the upper limit deviation is not zero, it indicates that the lower limit of the actual matching range of the candidate standard value is equal to the lower limit of the user's required range, but the upper limit is not equal to the upper limit of the user's required range. The actual matching range deviates from the user's requirements on one side. In this case, the candidate standard value is determined to be a one-sided match.
[0102] Similarly, when the upper limit deviation is zero but the lower limit deviation is not zero, it indicates that the upper limit of the actual matching range of the candidate standard value is equal to the upper limit of the user-required range, but the lower limit is not equal to the lower limit of the user-required range. The actual matching range deviates from the user's requirements on one side, and the candidate standard value is also determined to be a one-sided match.
[0103] When both the lower limit deviation value and the upper limit deviation value are not zero, it indicates that there is a deviation between the actual matching range of the candidate standard value and the user's required range on both sides. At this time, the candidate standard value is judged to be a two-sided mismatch.
[0104] The above judgment results can be output to the results display interface to visually represent the matching attributes of each candidate standard value, making it easier for users to intuitively understand the degree of conformity between each candidate level and the design requirements. For example, a candidate level of two-sided matching can be labeled as "perfect match", a candidate level of one-sided matching can be labeled as "half match (lower limit precision / upper limit precision)", and a candidate level of two-sided mismatch can be labeled as "offset match".
[0105] In this embodiment, after calculating the lower and upper deviation values, the matching type between the candidate standard values and the target design parameters is further determined as either a two-sided or one-sided match. This allows the system to not only calculate the deviation of each candidate level for ranking but also output qualitative judgment results on the matching attributes between each candidate level and the design requirements. Compared to the shortcomings of existing technologies that only output deviation values and whose users cannot intuitively judge the degree of conformity between candidate levels and design requirements, this embodiment outputs visualized matching attribute labels, enabling users to intuitively understand the matching characteristics of each candidate level and providing richer decision-making reference information for the final level selection.
[0106] In step S103, the candidate standard values are sorted based on the bias to determine the optimal recommendation result, and a custom protocol link carrying complete contextual information is generated for the optimal recommendation result.
[0107] In one alternative implementation, candidate criterion values are ranked based on bias to determine the optimal recommendation result, including: The candidate standard values are sorted based on the bias, and the candidate standard value with the smallest bias is selected as the optimal recommendation result. When multiple candidate standard values have the same deviation, they are sorted according to the following priority rules until a priority order is determined: gap coverage priority, common level priority, coordination system deviation series priority, and median value proximity priority.
[0108] In this embodiment, when the deviations of the candidate standard values are different, they are sorted from smallest to largest, and the one with the smallest deviation is the optimal recommendation. However, in practical applications, multiple candidate standard values often have the same or similar deviation values. For example, in hole-shaft fit matching, both fit grades H7 / g6 and H6 / f5 may well meet the user's clearance requirements, and their total deviation values may be very close or even equal. When the deviations of multiple candidate standard values are equal or similar, the deviation values alone cannot distinguish between superior and inferior ones. Therefore, it is necessary to use priority rules for comprehensive sorting to ensure the rationality and practicality of the recommendation results.
[0109] Specifically, firstly, based on the deviation calculated in step S102, all candidate standard values are sorted in ascending order of deviation. When the deviation of a candidate standard value is significantly smaller than that of other candidate standard values, that candidate standard value is directly selected as the optimal recommendation result.
[0110] When multiple candidate standard values have the same deviation, the system sorts them sequentially according to priority rules until the order of the candidate standard values can be distinguished. Priority rules may include priority based on gap coverage, priority based on common level, priority based on the series of deviations of the coordination system, and priority based on the proximity of the median value.
[0111] When prioritizing candidate standard values based on clearance coverage, the first step is to compare the inclusion relationship between the actual fit range and the user-required range for each candidate standard value. Clearance coverage characterizes the degree to which the actual fit range of a candidate standard value covers the user-required range. When the actual fit range of a candidate standard value completely covers the user-required range (i.e., actual minimum clearance ≤ user-required minimum clearance, and actual maximum clearance ≥ user-required maximum clearance), it indicates that the candidate standard value has the highest clearance coverage. Since complete coverage of the actual fit range means that the fit level can ensure that the usage requirements are met throughout the entire clearance range of the design requirements, it has better design safety and should be given priority.
[0112] When prioritizing commonly used tolerance grades, the first step is to compare whether each candidate standard value belongs to a commonly used tolerance grade recommended in the standard manual. For example, the standard manual specifies preferred tolerance grades such as IT6, IT7, and IT8. These grades offer good process economy and versatility in tooling and measuring instruments. Based on the list of commonly used grades specified in the standard manual, candidate standard values are screened, and those belonging to commonly used grades are prioritized.
[0113] When prioritizing the deviation series according to the fit system, the standard deviation series under the corresponding fit system is selected first. For example, because holes in the H deviation series under the hole-basis system are easy to machine and measure, and shafts in the h deviation series under the shaft-basis system also have technological advantages, when the user selects the hole-basis system, the hole deviation series with the basic deviation symbol H is selected first; while when the user selects the shaft-basis system, the shaft deviation series with the basic deviation symbol h is selected first.
[0114] When the above priority rules still cannot distinguish between them, the candidate standard value is sorted according to its proximity to the median value. In this case, the difference between the median value of the actual matching range of each candidate standard value and the median value of the user's required range is calculated. The smaller the difference, the closer the two are. Candidate standard values with higher median value proximity are prioritized. In this embodiment, the median value is calculated using the following formula: The median value is equal to (the lower limit plus the upper limit) / 2.
[0115] The priority rules described above can be applied sequentially according to the default configuration, or the application order can be adjusted according to the user's selection. The highest priority rule has decisive weight, and the next level rule is applied only when the highest priority rule cannot distinguish the candidate standard values. Through the step-by-step filtering of the above multi-level priority rules, a unique ranking result can be determined among multiple candidate standard values with equal deviations.
[0116] In this embodiment, candidate standard values are sorted based on deviation, and the one with the smallest deviation is selected as the optimal recommendation result. This provides a clear quantitative basis for the matching result, as the smallest deviation indicates that the actual matching range of the candidate standard value is closest to the user's required range. Furthermore, when multiple candidate standard values have equal deviations, they are further sorted according to a multi-level priority rule: gap coverage priority, common level priority, matching system deviation series priority, and median value proximity priority, until a specific order is determined. This ensures that even with identical deviations, a unique and reasonable optimal recommendation result can still be generated through hierarchical judgment logic. Compared to existing technologies that only sort based on a single dimension of deviation and lack further distinguishing criteria when multiple candidate level deviations are similar, this embodiment achieves a more refined sorting and recommendation that better reflects engineering practice through multi-level priority rules.
[0117] In one alternative implementation, a custom protocol link carrying complete contextual information is generated for the optimal recommendation result, including: Extract at least one size parameter from the optimal recommendation result; The size parameters are encoded into Uniform Resource Identifiers according to a custom protocol format, and the Uniform Resource Identifiers are embedded into the comprehensive visualization report of the current interface to form a triggerable custom protocol link.
[0118] After determining the optimal recommendation result, a custom protocol link carrying complete context information is generated for the optimal recommendation result. The custom protocol link is a Uniform Resource Identifier using a non-standard protocol format, which is used to realize the automatic transfer of parameters and seamless page jump between the matching result interface and the calculation page.
[0119] Specifically, the dimensional parameters used to uniquely represent the matching result are first extracted from the optimal recommendation results. For hole-shaft mating scenarios, the dimensional parameters include, but are not limited to, the hole tolerance grade code, the shaft tolerance grade code, the basic dimension value, the fit system, the lower limit of the clearance, and the upper limit of the clearance. For geometric tolerance matching scenarios, the dimensional parameters include, but are not limited to, the geometric tolerance type, the main parameter value, and the tolerance grade.
[0120] Next, the extracted size parameters are encoded into Uniform Resource Identifiers (URIs) according to a custom protocol format. The custom protocol is a proprietary protocol defined by this invention and distinct from standard network protocols. Specifically, the size parameters can be concatenated according to a predefined parameter order and separators to form a complete URI. This URI is then embedded into the comprehensive visualization report of the current interface, forming a triggerable custom protocol link.
[0121] In the graphical user interface, this custom protocol link is presented as a clickable hyperlink. Clicking the link triggers subsequent navigation and calculation processes. In this way, complete matching context information is encoded within a single link, eliminating the need for database queries or global variables in parameter passing between matching results and detailed calculations. All information can be transferred solely through the link itself, reducing system coupling and implementation complexity.
[0122] In this embodiment, at least one size parameter is extracted from the optimal recommendation result and encoded into a Uniform Resource Identifier (URI) according to a custom protocol format. This URI is then embedded into the comprehensive visualization report of the current interface to form a triggerable custom protocol link, enabling the complete matching context information to be transmitted via a single link. Compared to the shortcomings of existing technologies that require storing intermediate results in a database, global variables, or passing parameters between pages to transfer parameters between query results and detailed calculations, this embodiment achieves complete information transmission from matching results to the calculation page without relying on backend storage or temporary caching. All necessary parameters are encoded in the link, reducing system coupling and implementation complexity. Furthermore, users only need to click the link to trigger a page jump and automatically import all context information, eliminating the need for manual recording and re-entry of any parameters. This significantly shortens the operation path, and the link itself can be bookmarked, shared, or embedded in documents, making the dissemination and reuse of the design solution more convenient.
[0123] In step S104, in response to triggering a custom protocol link, the user is redirected to the calculation page, where the standard tolerance value is determined based on the target design parameters.
[0124] In one alternative implementation, in response to triggering a custom protocol link, redirection to the computing page includes: Parse the size parameters carried in a custom protocol link; The target design parameters are obtained from the dimensional parameters obtained from the analysis, and then the user is redirected to the calculation page.
[0125] Specifically, the system intercepts user-triggered events for custom protocol links using a custom protocol parser and parses the size parameters carried in the link. The custom protocol parser is a protocol interception and parsing module integrated into the graphical user interface framework. It intercepts all link click events at the system level by triggering callback methods through custom protocol links. When a user clicks a custom protocol link, the system first obtains the complete URL string of the custom protocol link and determines whether its protocol header is a custom protocol. If so, the custom protocol parser takes over the processing flow, instead of handing it over to the system's default protocol handler.
[0126] The custom protocol parser reverse-parses the URL string according to the encoding rules defined in step S103, mapping the parsed dimensional parameters to the input parameter format required by the calculation page, thereby recovering the complete target design parameters. Taking the hole-shaft mating scenario as an example, the hole tolerance grade code "H6", shaft tolerance grade code "f5", basic size "25", and mating system "hole-basis system" are mapped to the corresponding values of the "hole tolerance grade", "shaft tolerance grade", "basic size", and "matting system" input controls on the calculation page; the lower clearance limit "18" and the upper clearance limit "32" serve as verification information to assist the user in confirmation.
[0127] After parameter mapping is completed, the user is redirected from the current interface displaying the matching results and containing a link to the custom protocol to the calculation page. During the redirection, the mapped target design parameters are automatically filled into the corresponding input controls on the calculation page, ensuring that the user can directly see the calculation results without any additional operation after the page loads.
[0128] In this embodiment, by parsing the size parameters carried in the custom protocol link and restoring the target design parameters based on the parsed size parameters, the user is redirected to the calculation page. This allows the user to simply click the link to complete the transition from the matching results interface to the calculation page and automatically fill in all parameters, without the need for manual recording or re-entry of any data. Compared to the shortcomings of existing technologies where users need to manually switch between different modules and repeatedly enter the same parameters, or where the system relies on database storage for intermediate results for parameter transfer, this embodiment encodes the complete matching context information into the link itself. Parameters can be completely restored by parsing the link, without relying on backend storage and global variables, thus decoupling the matching results from the calculation page. The accuracy and completeness of parameter transfer are guaranteed by the link encoding mechanism, avoiding errors that may occur during manual transcription. Furthermore, the link can be bookmarked and reused, further facilitating the sharing and retrospection of design schemes.
[0129] In one alternative implementation, parsing the size parameters carried in the custom protocol link includes: When parsing the size parameters carried in a custom protocol link, if the custom protocol link is missing level information, an input dialog box is generated and displayed on the current page. The input dialog box is used to prompt the user to supplement the missing level information. When parsing the size parameters carried in a custom protocol link, if the basic size is missing in the custom protocol link, the default value is used instead of the basic size; When parsing the size parameters carried in a custom protocol link, if the custom protocol link is missing a mating system, the default mating system will be used instead. When parsing the size parameters carried in a custom protocol link, if the gap range is missing in the custom protocol link, a generally recommended value is used to replace the gap range.
[0130] In practical applications, the generation of custom protocol links depends on the completeness of the parameters in the matching results. However, due to different user input patterns, such as when a user directly inputs "H7 / g6" using the standard level mode, the system does not have a defined range of user input, and the matching results may lack some parameter information, resulting in empty or missing fields in the generated link. Furthermore, parameters may also be omitted during manual editing or dissemination of the link. To enhance the robustness of the system and user experience, this embodiment provides differentiated fault-tolerance mechanisms for different parameter missing scenarios.
[0131] Specifically, if the custom protocol link is missing grade information, an input dialog box will be generated and displayed on the current page to prompt the user to supplement the missing grade information. Grade information refers to the hole tolerance grade code and shaft tolerance grade code; missing grade information will prevent the system from performing subsequent detailed tolerance calculations. Therefore, when the parser detects that the hole grade field or shaft grade field in the link is empty, it determines that grade information is missing.
[0132] Since the tolerance grade information is a core expression of the user's design intent, the system cannot reasonably replace it with a default value. Therefore, the system generates a modal input dialog box and displays it on the current page. This input dialog box includes hole tolerance grade input controls and shaft tolerance grade input controls, and can prompt the user with messages such as "Hole / shaft tolerance grade information is missing in the link. Please complete it before continuing." After the user completes the grade information and clicks "Confirm," the system uses the user's input value as a parameter to continue executing subsequent jumps and calculation processes. If the user cancels the completion, the jump process terminates and returns to the current interface.
[0133] In another feasible embodiment, if the basic size is missing in the custom protocol link, a default value is used instead. The basic size refers to the theoretical size value given in the design, which is used to locate the corresponding data size range in the standard database. When the parser detects that the basic size field in the link is empty, it determines that a basic size is missing.
[0134] Compared to hierarchical information, basic dimensions are less sensitive to design intent, and the system can use default values instead. Default values are system-preset reference values that cover the commonly used dimension ranges in most mechanical designs, providing effective calculation results in most scenarios. For example, the system uses a default value of 50mm to replace missing basic dimensions, while simultaneously displaying a status bar message to the user: "Basic dimensions have adopted the default value of 50mm; please confirm whether modification is needed." The user can then manually correct the value on the redirected calculation page.
[0135] In another feasible embodiment, if a mating system is missing in the custom protocol link, a default mating system is used instead. The mating system includes hole-basis and shaft-basis systems, which determine the selection rules for the basic deviations of the hole and shaft. When the parser detects that the mating system field in the link is empty, it determines that a mating system is missing.
[0136] For example, the default fit system "hole-basis" can be used to replace the missing fit system, and a status bar message will appear indicating "The fit system has been set to the default value 'hole-basis'. Please confirm whether you need to modify it." Users can manually correct the fit system on the subsequent calculation page.
[0137] In another feasible embodiment, if a gap range is missing in a custom protocol link, a generally recommended value is used instead. The gap range includes a lower gap limit and an upper gap limit, which reflect the user's design requirements. When the parser detects that either the lower gap limit field or the upper gap limit field in the link is empty, it determines that a gap range is missing.
[0138] At this point, the system retrieves the universally recommended value for the size range to which the basic size belongs from the standard database as a replacement. The universally recommended value is the standard clearance range corresponding to the commonly used fit grades within that size range. After replacing the missing clearance range with the universally recommended value, this value can be marked as "System Recommended," and the status bar will prompt the user that "The clearance range has adopted the system recommended value; please confirm whether it needs to be modified." The user can manually correct it on the calculation page after redirection.
[0139] In this embodiment, differentiated fault-tolerance strategies are implemented for four scenarios—missing level information, missing basic dimensions, missing coordination mechanisms, and missing gap ranges—when parsing custom protocol links. This ensures that the system can still complete the jump and calculation process as much as possible even when link parameters are incomplete, avoiding direct termination of operations due to missing parameters. Specifically, level information is a core calculation parameter; when missing, the system proactively prompts the user to supplement it via a pop-up window, ensuring that key design intent is not lost. Basic dimensions, coordination mechanisms, and gap ranges are auxiliary parameters or parameters with certain generality; when missing, default values or generally recommended values are automatically used to replace them, ensuring that the process can still proceed, while the user is prompted for confirmation via a status bar. Compared to the shortcomings of existing technologies that terminate operations or require users to re-enter parameters upon missing parameters, this embodiment achieves a reasonable balance between convenience and accuracy through differentiated fault-tolerance strategies. It ensures that core parameters are not omitted while minimizing user interruptions and repetitive work, improving system robustness and user experience.
[0140] In one alternative implementation, determining the standard tolerance value based on the target design parameters in the calculation page includes: Extract geometric tolerance design elements from the target design parameters. Geometric tolerance design elements include geometric tolerance type, master parameter value, and tolerance grade. The definition of principal parameters and the rules for dividing size ranges are determined based on the geometric tolerance type; Using the main parameter value as an index, locate the corresponding size range under the size range division rules, and determine the standard tolerance value that matches the tolerance grade from the tolerance value table.
[0141] After the user triggers a custom protocol link to jump to the calculation page, the system determines the standard tolerance value based on the target design parameters on the calculation page. The target design parameters may contain different types of design elements, including hole and shaft fit design elements and geometric tolerance design elements.
[0142] When the target design parameters include geometric tolerance design elements, extract the geometric tolerance design elements from the target design parameters. The geometric tolerance design elements include geometric tolerance type, master parameter value, and tolerance grade.
[0143] Geometric tolerance types are user-specified geometric tolerance categories, including but not limited to straightness, flatness, roundness, cylindricity, parallelism, perpendicularity, angularity, coaxiality, symmetry, circular runout, and total runout. The above geometric tolerance types are classified according to standard manuals. Different types correspond to different main parameter definitions and size range division rules. For example, they can be divided into tables B1, B2, B3, and B4. Among them, table B1 corresponds to straightness and flatness; table B2 corresponds to roundness and cylindricity; table B3 corresponds to parallelism, perpendicularity, and angularity; and table B4 corresponds to coaxiality, symmetry, circular runout, and total runout.
[0144] The principal parameter values are the key dimensional parameters used to determine the geometric tolerance values. Different types of geometric tolerances have different principal parameter definitions. For example, the principal parameter in Table B1 is the length of the measured feature; the principal parameter in Table B2 is the diameter of the measured feature; the principal parameter in Table B3 is either the length or diameter of the measured feature; and the principal parameter in Table B4 is either the diameter, width, or length of the measured feature. The tolerance grades are the geometric tolerance grades specified in the standard manual, with Tables B1, B3, and B4 listing grades 1 to 12, and Table B2 additionally supporting grade 0.
[0145] The aforementioned geometric tolerance design elements can originate from the original target design parameters input by the user, such as the user directly inputting "cylindricity, 50mm, grade 6", or they can originate from the target design parameters encoded in the custom protocol link and recovered through step S104.
[0146] Next, based on the geometric tolerance type, the standard table category to which it belongs is determined from the preset configuration, thereby determining the corresponding main parameter definition and size range division rules, providing a basis for subsequent size range positioning and tolerance value lookup. Different types of geometric tolerances are subject to different main parameter definitions and size range division rules. Specifically, the standard manual specifies the size range division rules for various geometric tolerances. For example, the size range of table B2 is divided into the size range of the main parameter diameter d, which is divided into multiple continuous intervals such as "d≤10mm", "10mm<d≤16mm", "16mm<d≤m25mm", "25mm<d≤40mm", "40mm<d≤63mm", "63mm<d≤100mm", "100mm<d≤160mm", "160mm<d≤250mm", "250mm<d≤400mm", and "400mm<d≤630mm".
[0147] Next, using the primary parameter value as an index, the system searches for the size range to which the primary parameter value belongs, according to the defined size range division rules. For example, for roundness, if the primary parameter value is 50mm, the system locates the range "40mm<d≤63mm" in the size range division rules of table B2. The assignment of size range boundary values can be handled according to the assignment rules specified in the standard manual; that is, boundary values are usually assigned to the upper limit range.
[0148] After locating the size range, the system uses this size range and the user-specified tolerance grade as joint search criteria to find the corresponding standard tolerance value in the standard database. The standard tolerance value is the geometric tolerance value specified in the standard manual, corresponding to a specific size range and tolerance grade. For example, for roundness, with the main parameter d = 50mm and the tolerance grade being 6, the corresponding standard tolerance value of 4μm is found in the tolerance value table in B2.
[0149] The determined standard tolerance value and its unit are output to the result display area of the calculation page. At the same time, the corresponding accuracy level description and application scenario suggestions can also be output, such as "general accuracy level, suitable for most mechanical parts" or "suitable for rotating parts with medium accuracy requirements", for user reference.
[0150] In this embodiment, geometric tolerance design elements are extracted from the target design parameters on the calculation page. Based on the geometric tolerance type, the corresponding principal parameter definition and size range division rules are determined. Then, the size range is located using the principal parameter value as an index, and the standard tolerance value is determined from the tolerance value table. This fully automates the process of determining geometric tolerance values. Users only need to provide three elements: geometric tolerance type, principal parameter value, and tolerance grade. There is no need to consult standard manuals to find principal parameter definitions, manually determine size range assignments, or compare tolerance value tables line by line. The entire calculation process from parameter input to standard tolerance value output is automatically completed. Compared to existing technologies where engineers need to repeatedly consult multiple standard manuals and compare different size ranges and tolerance grades to determine geometric tolerance values, this embodiment integrates the previously scattered manual steps of table lookup, location, and comparison into an automated system process. This significantly shortens the geometric tolerance design time and avoids potential location errors and numerical misinterpretations during manual table lookup and range assignment determination.
[0151] In one alternative implementation, the method further includes: A separate pop-up window is generated in response to the operation of viewing an instance of the current geometric tolerance type; A separate pop-up window displays a standardized schematic diagram of the master parameters corresponding to the geometric tolerance type and technical specification text. The technical specification text includes definitions, master parameter descriptions, typical application scenarios, and measurement methods.
[0152] In the design process of geometric tolerances, standard manuals specify more than ten types of geometric tolerances, each with its own distinct primary parameter definition. For example, the primary parameter for straightness is the length of the measured feature, the primary parameter for roundness is the diameter of the measured feature, and the primary parameter for parallelism may be either length or diameter. These primary parameter definitions can be quite abstract for inexperienced engineers, easily leading to errors in parameter input or misunderstandings of design intent.
[0153] To assist users in accurately understanding the meaning of the main parameters of various geometric tolerances, this embodiment provides an instance viewing function on the geometric tolerance calculation page. Specifically, after selecting the geometric tolerance type on the geometric tolerance calculation page, users can trigger the instance viewing operation on this page. As an optional triggering method, a "View Instance" control button is provided on the page. Clicking this control button will trigger the generation of an independent pop-up window. The independent pop-up window is a separate window from the current calculation page, floating above the main window. Users can view the instance information without leaving the current calculation page. After viewing, closing the pop-up window allows users to continue the current operation without affecting the data status already entered on the calculation page.
[0154] The generated pop-up window displays a standardized master parameter diagram corresponding to the current geometric tolerance type. This diagram is a vector graphic drawn based on the annotation examples specified in the standard manual, visually illustrating the definition of the master parameters for that geometric tolerance type. For example, for straightness, the diagram indicates the length of the measured feature; for roundness, it indicates the diameter; and for perpendicularity, it indicates the length. Since different types of geometric tolerances have different master parameter definitions, only the currently selected geometric tolerance type needs to be retrieved from the preset diagram database for display, eliminating the need for additional user input.
[0155] Furthermore, the master parameter diagram can be in vector graphics format, supporting lossless scaling to ensure clear display on devices with different resolutions. The diagram includes standardized dimensioning styles, clearly indicating the location and method of the master parameter annotations, helping users accurately understand which length "L" refers to and which diameter "d" refers to, thus avoiding parameter input errors caused by misunderstandings of the master parameter definitions.
[0156] In addition, a separate pop-up window can simultaneously display the technical specification text for the current geometric tolerance type. Specifically, using the currently selected geometric tolerance type as an index, the corresponding technical specification text is retrieved from a preset specification text library for display. The specification text library uses the geometric tolerance type as the primary key and stores the corresponding definition, main parameter description, application scenarios, and measurement methods. The technical specification text must include at least the following: the definition, main parameter description, typical application scenarios, and measurement methods for the geometric tolerance type, such as "Straightness is an indicator that limits the variation of an actual straight line from its ideal straight line," "Applicable to machine tool guideways, precision shaft parts, etc.," and "Using indicator method, image method, etc."
[0157] In this embodiment, an independent pop-up window is generated in response to the user's action of viewing an instance of the current geometric tolerance type. This pop-up displays a standardized schematic diagram of the corresponding main parameters and technical description text, allowing the abstract definition of geometric tolerance main parameters to be presented intuitively. Users can directly view the main parameter diagram and detailed description of the current tolerance type on the calculation page without consulting a standard manual, accurately understanding the specific meaning and annotation location of the main parameters. Compared to the shortcomings of existing technologies where the definition of geometric tolerance main parameters is abstract, difficult for engineers to accurately understand from text alone, and prone to confusion during annotation, this embodiment combines diagrams and text, enabling users to intuitively confirm the parameter definition before inputting the main parameter value. This effectively reduces input and annotation errors caused by conceptual misunderstandings. Furthermore, the pop-up format allows users to obtain auxiliary information without leaving the current calculation page, ensuring the continuity of the design process.
[0158] In one alternative implementation, the method further includes: The target design parameters, the optimal recommendation results, and the current interface state are serialized into a memory state object. The current interface is either the matching result display interface or the calculation page. The matching result display interface is the interface for determining the deviation between the target design parameters and the candidate standard values. Bind the memory state object to the current user session for storage.
[0159] During tolerance design, users often need to go through multiple rounds of iterative design. For example, they might first adjust the gap range in the matching interface to obtain different optimal recommended results, then jump to the calculation page to view detailed tolerance values, and then return to the matching interface to modify parameters and rematch. In these multiple iterations, if the interface is restored to its initial blank state each time the user returns, the user will need to re-enter all parameters, resulting in a lot of repetitive work. To solve this problem, the system automatically saves the current interface state after each user operation, so that the context can be quickly restored when the user returns.
[0160] Therefore, in this embodiment, after each user operation, a state saving process is triggered to collect and serialize the key data in the current session into a memory state object. The current interface is either a matching result display interface or a calculation page. The matching result display interface determines the deviation between the target design parameters and the candidate standard values and displays the ranking results. This interface includes the user-input query parameters, drop-down menu options, the comprehensive visualization report output by the system, and the availability status of each control. The calculation page is the page accessed in step S104, used to determine the standard tolerance value based on the target design parameters. This page includes the selection of geometric tolerance type, input of main parameter values and tolerance grades, and display of calculation results.
[0161] A memory state object is a data object stored in memory. Its data structure includes at least the following fields: a parameter field that stores the target design parameters, a recommendation result field that stores the optimal recommendation result, an interface field that stores the interface identifier, a control field that stores the interface control status, and a time field that stores the timestamp.
[0162] The target design parameters can include fields such as basic dimensions, fit regime, clearance range, geometric tolerance type, main parameter value, and tolerance grade. The optimal recommendation result fields can include the optimal fit grade, corresponding deviation, and matching degree. The interface field of the interface identifier is used to record whether the current interface is a matching result display interface or a calculation page. The control field of the interface control status is used to record the current value of each input box on the interface, the current option of the drop-down menu, the checked status of the checkboxes, the HTML content of the result display area, and the available / unavailable status of the buttons.
[0163] Serialization is the process of converting structured data in memory into a storable or transmissible format so that it can be deserialized and restored to its original data structure.
[0164] A user session refers to a complete interaction between a user and the system, from opening the system to closing it. It is identified by a unique session identifier generated by the system when the user starts the system. The system uses this session identifier as the key and a serialized memory state object as the value to store it in a memory cache.
[0165] When a new user action occurs within the same session, such as when the user modifies query parameters and re-executes the match, the system replaces the original memory state object under that session identifier with the updated memory state object, ensuring that the latest interface state is always saved. When the system detects that the user session has ended, such as when the user closes the system, the system can decide, based on the configuration, whether to persist the memory state object to disk to support cross-session recovery, or to directly release memory resources.
[0166] In this embodiment, by serializing the target design parameters, optimal recommendation results, and the current interface state into a memory state object and binding it to the current user session for storage, the system can automatically save complete context information during multiple design iterations. When the user returns from the calculation page to the matching result display interface, the input parameters, recommendation results, and interface control states do not need to be reset, and the previous work progress can be directly continued. Compared with the shortcomings of existing technologies, such as independent query, calculation, and analysis modules, repeated input of the same parameters by users in multiple iterations, and the inability to save historical results leading to repetitive work, this embodiment realizes automatic saving and restoration of the state when switching between different pages within the same session. This reduces the repetitive input operations of users during repeated parameter adjustments, ensures the continuity of multiple design iterations, and significantly improves the work efficiency in complex design tasks.
[0167] Figure 3 This is yet another flowchart illustrating a method for visually calculating tolerances according to some embodiments of the present invention, showing the complete processing from user input to result output in a hole-shaft mating scenario. For example... Figure 3 As shown, the process includes the following steps: First, the user inputs the target design parameters through input controls in the user interface layer. The target design parameters include at least basic dimensions, fit regime, and fit requirements. The fit requirements can be any of the user's desired clearance range, upper / lower deviation values, or standard grade codes; the system supports automatic recognition of multiple input formats.
[0168] The validity of the target design parameters input by the user is validated, including at least the following aspects: checking whether the basic dimensions are positive and within a reasonable range; checking whether the lower limit of the gap range is less than or equal to the upper limit; checking whether the upper deviation is greater than or equal to the lower deviation; and checking whether the input values conform to the preset format requirements. If the input is invalid, such as a negative basic dimension, a lower limit of the gap greater than the upper limit, or the input containing non-numeric characters, an error message is generated and displayed on the interface, prompting the user to correct the input parameters and resubmit.
[0169] If the input is valid, the fit system is determined based on the user's input. Fit systems include hole-basis system and shaft-basis system. In the hole-basis system, the basic deviation of the hole is zero, i.e., the lower deviation of the hole is 0. Different types of fits are obtained by changing the basic deviation of the shaft. In the shaft-basis system, the basic deviation of the shaft is zero, i.e., the upper deviation of the shaft is 0. Different types of fits are obtained by changing the basic deviation of the hole. Users can select the fit system through drop-down menus or option buttons in the input interface. If the user does not explicitly select a system, the system defaults to the hole-basis system.
[0170] Next, based on the basic size input by the user, the corresponding data size range is searched in the standard database. The standard database contains pre-defined size range divisions as specified in the standard manual, with each size range divided according to the numerical range of the basic size. Using the basic size as an index, the size range list is traversed to find the size range to which the basic size belongs. For cases where the basic size falls on the boundary value of the range, the allocation rules specified in the standard manual are applied.
[0171] Furthermore, using the located size range as the search key, all fit grades within that range are extracted from the standard database as a candidate fit grade list. For hole-shaft fit matching scenarios, the fit grade is composed of the hole tolerance grade and the shaft tolerance grade. Each fit grade in the candidate fit grade list is traversed, and the deviation between each fit grade and the user requirements is calculated.
[0172] Specifically, the upper hole deviation, lower hole deviation, upper shaft deviation, and lower shaft deviation corresponding to the fit grade are read from the standard database, and the actual fit range of the fit grade is calculated. When the calculation result is negative, it indicates that the fit is an interference fit, that is, the shaft size is larger than the hole size; when the calculation result is positive, it indicates that the fit is a clearance fit, that is, the hole size is larger than the shaft size; if the minimum clearance is negative and the maximum clearance is positive, it is a transition fit.
[0173] The system compares the calculated actual fit range with the user-required fit range. Specifically, the difference between the lower limit of the user-required range and the lower limit of the actual fit range is calculated as the lower limit deviation value; the difference between the upper limit of the user-required range and the upper limit of the actual fit range is calculated as the upper limit deviation value; and the sum of the lower limit deviation value and the upper limit deviation value is the total deviation value for that fit level. This total deviation value characterizes the degree of matching between the fit level and the user's requirements; the smaller the total deviation value, the higher the degree of matching. The current fit level and its corresponding total deviation value are recorded in the results list for subsequent sorting.
[0174] Next, determine if all candidate matching levels have been traversed. If not, return to the next matching level; if so, sort all matching levels in ascending order based on their total deviation value. The matching level with the smallest deviation value is the one that best matches the user's requirements. When multiple matching levels have the same deviation value, further sort them according to a multi-level priority rule until a priority order is determined.
[0175] Based on the ranking results, a comprehensive visualization report is generated. This report, in HTML format, includes the optimal recommendation result and its corresponding fit grade code, actual fit range, deviation from user requirements, matching score, and fit property determination. Simultaneously, the system embeds a custom protocol link within the report, allowing users to jump to a detailed tolerance calculation page with a single click. The generated HTML results are then rendered in the results display area of the user interface, completing the entire process from user input to result output.
[0176] This embodiment also provides a tolerance visualization calculation device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0177] This embodiment provides a tolerance visualization calculation device, such as... Figure 4 As shown, it includes: The parameter acquisition module 401 is used to acquire the target design parameters and label the target design parameters with input mode labels.
[0178] The deviation determination module 402 is used to extract design elements from the target design parameters, determine the candidate standard values corresponding to the design elements, and determine the deviation between the target design parameters and the candidate standard values based on the input mode label.
[0179] The link generation module 403 is used to sort candidate standard values based on bias to determine the optimal recommendation result and generate a custom protocol link carrying complete context information for the optimal recommendation result.
[0180] The tolerance calculation module 404 is used to respond to the triggering of a custom protocol link, jump to the calculation page, and determine the standard tolerance value based on the target design parameters on the calculation page.
[0181] In one embodiment, the parameter acquisition module 401 includes: The parameter parsing unit is used to parse the target design parameters in order to identify the data format type of the target design parameters.
[0182] The pattern labeling unit is used to classify the target design parameters into one of the following modes based on the data format type: numerical range mode, standard level mode, text description mode, or fuzzy input mode; and to label the target design parameters with the input mode labels corresponding to the data format type.
[0183] In one embodiment, the parameter acquisition module 401 further includes: The keyword extraction unit extracts text description keywords from the target design parameters if the data format type is classified as text description mode.
[0184] The confidence generation unit is used to search for numerical ranges that match the textual description keywords in the semantic mapping table, replace the textual description keywords with the found numerical ranges as input values for the target design parameters, and generate replacement confidence scores.
[0185] In one embodiment, the deviation determination module 402 includes: The parameter extraction unit is used to extract positioning parameters from the target design parameters, determine the corresponding data size range based on the positioning parameters, and extract the standard values under the data size range as candidate standard values.
[0186] In one embodiment, the deviation determination module 402 further includes: The type matching unit is used to determine the current matching type based on the input mode label. The matching types include hole-shaft fit matching and geometric tolerance matching.
[0187] The first deviation determination unit is used to calculate the lower limit deviation value and the upper limit deviation value based on the actual fit range corresponding to the candidate standard value and the user requirement range in the target design parameters when the matching type is hole-shaft fit matching, and to take the sum of the lower limit deviation value and the upper limit deviation value as the deviation.
[0188] The second deviation determination unit is used to calculate the difference between the candidate standard value and the main parameter value in the target design parameters as the deviation when the matching type is geometric tolerance matching.
[0189] In one embodiment, the first deviation determination unit further includes: The deviation sub-judgment unit is used to determine that the candidate standard value and the target design parameter are a two-sided match and the deviation is zero when both the lower limit deviation value and the upper limit deviation value are zero; and to determine that the candidate standard value and the target design parameter are a one-sided match and the deviation is non-zero when either the lower limit deviation value or the upper limit deviation value is zero.
[0190] In one implementation, the link generation module 403 includes: The first sorting unit is used to sort the candidate standard values based on the deviation and select the candidate standard value with the smallest deviation as the optimal recommendation result.
[0191] The second sorting unit is used to sort multiple candidate standard values according to the following priority rules when the deviations are equal, until a priority order is determined: gap coverage priority, common level priority, coordination system deviation series priority, and median value proximity priority.
[0192] In one implementation, the link generation module 403 includes: The link generation unit is used to extract at least one size parameter from the best recommendation results; encode the size parameter into a Uniform Resource Identifier according to a custom protocol format; embed the Uniform Resource Identifier into the comprehensive visualization report of the current interface to form a triggerable custom protocol link.
[0193] In one implementation, the tolerance calculation module 404 includes: The page redirection unit is used to parse the size parameters carried in the custom protocol link; obtain the target design parameters based on the parsed size parameters, and redirect to the calculation page.
[0194] In one implementation, the page navigation unit includes: The dimension parsing subunit is used to generate and display an input dialog box on the current page when parsing dimension parameters carried in a custom protocol link. If the custom protocol link is missing level information, the input dialog box is used to prompt the user to supplement the missing level information.
[0195] The default value replacement subunit is used when parsing the size parameters carried in a custom protocol link. If the custom protocol link is missing a basic size, the default value will be used instead of the basic size. When parsing the size parameters carried in a custom protocol link, if the custom protocol link is missing a mating system, the default mating system will be used instead of the mating system. When parsing the size parameters carried in a custom protocol link, if the custom protocol link is missing a gap range, the generally recommended value will be used instead of the gap range.
[0196] In one implementation, the tolerance calculation module 404 includes: The tolerance calculation unit is used to extract geometric tolerance design elements from the target design parameters. The geometric tolerance design elements include geometric tolerance type, main parameter value, and tolerance grade. Based on the geometric tolerance type, the main parameter definition and size interval division rules are determined. Using the main parameter value as an index, the corresponding size interval is located under the size interval division rules, and the standard tolerance value matching the tolerance grade is determined from the tolerance value table.
[0197] In one embodiment, the apparatus further includes: The data display module generates an independent pop-up window in response to the viewing operation of the current geometric tolerance type instance. The independent pop-up window displays the standardized schematic diagram of the main parameters and the technical specification text corresponding to the geometric tolerance type. The technical specification text includes definition description, main parameter description, typical application scenarios and measurement methods.
[0198] In one embodiment, the apparatus further includes: The storage module is used to serialize the target design parameters, the optimal recommendation results, and the current interface state into a memory state object. The current interface is either the matching result display interface or the calculation page. The matching result display interface is the interface for determining the deviation between the target design parameters and the candidate standard values. The memory state object is bound to the current user session for storage.
[0199] In this embodiment, the tolerance visualization computing device is presented in the form of a functional unit. Here, a unit refers to an ASIC circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above-mentioned functions.
[0200] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.
[0201] This invention also provides a computer device having the above-described features. Figure 4 A visualization calculation device for the tolerances shown.
[0202] The following is a detailed reference. Figure 5The diagram illustrates a structural schematic suitable for implementing a computer device according to embodiments of the present invention. The computer device may include a processor (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes based on a program stored in a read-only memory (i.e., ROM 502) or a program loaded from memory 508 into random access memory (i.e., RAM 503). The RAM 503 also stores various programs and data required for the operation of the computer device. The processor 501, ROM 502, and RAM 503 are interconnected via a bus 504. Input / output (i.e., I / O interface 505) is also connected to the bus 504.
[0203] Typically, the following devices can be connected to I / O interface 505: input devices 506 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 507 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; memory devices 508 including, for example, magnetic tapes, hard disks, etc.; and communication devices 509. Communication device 509 allows the computer device to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 5 Computer equipment with various devices is shown, but it should be understood that it is not required to implement or have all of the devices shown, and more or fewer devices may be implemented or have instead.
[0204] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 509, or installed from a memory 508, or installed from a ROM 502. When the computer program is executed by the processor 501, it performs the functions defined in the tolerance visualization calculation method of the embodiments of the present invention.
[0205] Figure 5 The computer device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of the present invention.
[0206] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as recordable on a storage medium, or implemented as computer code originally stored on a remote storage medium or a non-transitory machine-readable storage medium and subsequently stored on a local storage medium after being downloaded via a network. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium may also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the tolerance visualization calculation method shown in the above embodiments is implemented.
[0207] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.
[0208] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A method for visually calculating tolerances, characterized in that, The method includes: Obtain the target design parameters and label the target design parameters with input mode labels; Design elements are extracted from the target design parameters, and candidate standard values corresponding to the design elements are determined. The deviation between the target design parameters and the candidate standard values is determined based on the input mode labels. The candidate standard values are sorted based on the deviation to determine the optimal recommendation result, and a custom protocol link carrying complete context information is generated for the optimal recommendation result. In response to triggering the custom protocol link, the user is redirected to a calculation page, where the standard tolerance value is determined based on the target design parameters.
2. The method according to claim 1, characterized in that, The process of obtaining target design parameters and labeling the target design parameters with input mode labels includes: The target design parameters are parsed to identify the data format type of the target design parameters; Based on the data format type, the target design parameters are divided into one of the following: numerical range mode, standard level mode, text description mode, or fuzzy input mode. Label the target design parameters with the input mode labels corresponding to the data format type.
3. The method according to claim 2, characterized in that, The method further includes: If the data format type is classified as a text description mode, then text description keywords are extracted from the target design parameters; Using the keywords in the text description as an index, search for the numerical range that matches the keywords in the semantic mapping table; The found numerical range is used to replace the textual description keywords as the input value of the target design parameter, and a replacement confidence score is generated.
4. The method according to claim 1, characterized in that, The step of extracting design elements from the target design parameters and determining the candidate standard values corresponding to the design elements includes: The positioning parameters are extracted from the target design parameters, and the corresponding data size range is determined based on the positioning parameters; The standard values within the data size range are extracted as the candidate standard values.
5. The method according to claim 1, characterized in that, Determining the deviation between the target design parameter and the candidate standard value based on the input pattern label includes: Based on the input mode label, the current matching type is determined, which includes hole-shaft fit matching and geometric tolerance matching; When the matching type is hole-shaft fit matching, the lower limit deviation value and the upper limit deviation value are calculated based on the actual fit range corresponding to the candidate standard value and the user requirement range in the target design parameters, and the sum of the lower limit deviation value and the upper limit deviation value is taken as the deviation. When the matching type is geometric tolerance matching, the difference between the candidate standard value and the main parameter value in the target design parameters is calculated as the deviation.
6. The method according to claim 5, characterized in that, After calculating the lower and upper deviation values, the method further includes: When both the lower limit deviation value and the upper limit deviation value are zero, it is determined that the candidate standard value and the target design parameter are a two-sided match, and the deviation is zero. When the lower limit deviation is zero or the upper limit deviation is zero, it is determined that the candidate standard value and the target design parameter are a one-sided match, and the deviation is non-zero.
7. The method according to claim 1, characterized in that, The step of sorting the candidate standard values based on the deviation to determine the optimal recommendation result includes: The candidate standard values are sorted based on the deviation, and the candidate standard value with the smallest deviation is selected as the optimal recommendation result. When multiple candidate standard values have the same deviation, they are sorted according to the following priority rules until a priority order is determined: gap coverage priority, common level priority, coordination system deviation series priority, and median value proximity priority.
8. The method according to claim 1, characterized in that, The step of generating a custom protocol link carrying complete contextual information for the optimal recommendation result includes: Extract at least one size parameter from the optimal recommendation result; The size parameters are encoded into a Uniform Resource Identifier according to a custom protocol format, and the Uniform Resource Identifier is embedded into the comprehensive visualization report of the current interface to form a triggerable custom protocol link.
9. The method according to claim 8, characterized in that, The response to triggering the custom protocol link and redirecting to the calculation page includes: Parse the size parameters carried in the custom protocol link; The target design parameters are obtained based on the size parameters obtained from the analysis, and then the user is redirected to the calculation page.
10. The method according to claim 9, characterized in that, The parsing of the size parameter carried in the custom protocol link includes: When parsing the size parameters carried in the custom protocol link, if the custom protocol link is missing level information, an input dialog box is generated and displayed on the current page. The input dialog box is used to prompt the user to supplement the missing level information. When parsing the size parameters carried in the custom protocol link, if the basic size is missing in the custom protocol link, the default value is used to replace the basic size; When parsing the size parameters carried in the custom protocol link, if the custom protocol link is missing a matching system, the default matching system is used instead of the matching system. When parsing the size parameters carried in the custom protocol link, if the gap range is missing in the custom protocol link, a general recommended value is used to replace the gap range.
11. The method according to claim 1, characterized in that, The step of determining the standard tolerance value based on the target design parameters on the calculation page includes: Geometric tolerance design elements are extracted from the target design parameters. These geometric tolerance design elements include geometric tolerance type, master parameter value, and tolerance grade. The definition of principal parameters and the rules for dividing size ranges are determined based on the geometric tolerance type. Using the main parameter value as an index, locate the corresponding size range under the size range division rule, and determine the standard tolerance value that matches the tolerance grade from the tolerance value table.
12. The method according to claim 11, characterized in that, The method further includes: A separate pop-up window is generated in response to the operation of viewing an instance of the current geometric tolerance type; The independent pop-up window displays a standardized schematic diagram of the master parameters and technical description text corresponding to the geometric tolerance type. The technical description text includes definitions, master parameter descriptions, typical application scenarios, and measurement methods.
13. The method according to claim 1, characterized in that, The method further includes: The target design parameters, the optimal recommendation result, and the interface state of the current interface are serialized into a memory state object. The current interface is either a matching result display interface or a calculation page. The matching result display interface is an interface for determining the deviation between the target design parameters and the candidate standard values. The memory state object is bound and stored with the current user session.
14. A computer device, characterized in that, include: A memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, the processor executing the computer instructions to perform the method of any one of claims 1 to 13.
15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a computer to perform the method of any one of claims 1 to 13.
