An intelligent design method for automatic straightening machines for shaft parts based on knowledge engineering
By building a rule library, ontology library and case library, combining Drools and ANSYS simulation, and using hybrid distance metric and NSGA-II algorithm to optimize parameters, the problem of insufficient design accuracy of automatic straightening machines for shaft parts in traditional design methods is solved, and efficient and accurate intelligent design is achieved.
Patent Information
- Application Number
- CN202510929831.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-07
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2045-07-07
AI Technical Summary
Traditional knowledge engineering technology is difficult to effectively solve the design accuracy problem of automatic straightening machines for shaft parts, especially when faced with non-standard parts and insufficient expert experience, the accuracy and efficiency of the design results are difficult to guarantee.
An intelligent design method based on knowledge engineering is adopted to build a rule base, ontology base and case base. Combined with the Drools rule engine, Spacy library, Protege tool and ANSYS simulation, intelligent design is achieved by optimizing parameters through a hybrid distance measurement mechanism and NSGA-II algorithm.
The design efficiency and accuracy of the automatic straightening machine for shaft parts are improved, design errors and trial-and-error costs are reduced, and the reliability and accuracy of the design results are ensured.
Smart Images

Figure CN120408870B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent digital straightening machines, and more particularly to an intelligent design method of an automatic straightening machine for shaft parts based on knowledge engineering. Background Art
[0002] With the rapid development of the manufacturing industry, the precision requirements for component manufacturing are becoming increasingly higher. Shaft parts are an indispensable part of the assembly. The design accuracy of the automatic straightening machine for shaft parts directly affects the overall performance and work efficiency of the assembly. However, due to the wide variety of shaft parts and the increasing use of new materials and alloys, traditional straightening machine design methods are unable to efficiently meet the needs of part straightening.
[0003] Traditional knowledge engineering techniques extract and reuse knowledge, combining past experience with theory to solve current problems. While this can be effective in some scenarios, the accuracy of inference results is often difficult to guarantee due to the difficulty in accurately extracting expert experience and the difficulty in covering non-standard part straightening conditions in automatic straightening machines for shaft parts. This leads to difficulties in ensuring the accuracy of the straightening machine's design results. Therefore, how to quickly design an automatic straightening machine for non-standard shaft parts that meets straightening requirements is an urgent problem that technicians in this field need to solve. Summary of the Invention
[0004] In view of this, the present invention provides an intelligent design method for an automatic straightening machine for shaft parts based on knowledge engineering. In order to overcome the above-mentioned difficulties, the present invention provides the following technical solutions:
[0005] An intelligent design method for an automatic straightening machine for shaft parts based on knowledge engineering includes the following steps:
[0006] Step 1: Acquire knowledge and build a knowledge base:
[0007] The knowledge acquisition method is: collect the knowledge involved in the design process of automatic straightening machine for shaft parts by referring to national standards, industry specifications, design manuals, relevant literature, etc.
[0008] Step 2: Build a knowledge base including rule base, ontology base and case base:
[0009] Step 2.1, establish the rule base of the automatic straightening machine for shaft parts:
[0010] The specific process of building a rule library for an automatic straightening machine for shaft parts is as follows: Building a rule library using the Drools rule engine: Building a rule library by using the Drools rule engine to write IF-THEN rules based on industry rules, national rules, design manuals, etc. The rule library is divided into logical rules, calculation rules, and constraint rules. Logical rules include material rules, geometric rules, and equipment rules. Material rules include straightening strategies for controlling different materials. Geometric rules include the impact of the geometric features of shaft parts on the process. Equipment rules include limiting process parameters based on the capabilities of the straightening machine equipment. Calculation rules are rules for key parameters derived from material mechanics formulas or empirical models. Constraint rules include setting the allowable range or environmental restrictions for process parameters such as temperature and humidity.
[0011] When adding new rules to the rule base, the Rete algorithm is introduced to detect conflicting rules. Rules in the rule base are divided into Alpha nodes, Beta nodes, and Terminal nodes. Alpha nodes are atomic condition nodes, and their content is the noun phrases in the IF structure in the rule base. Beta nodes are condition combination matches, and their content is the mutual matching of noun phrases in the atomic condition nodes. Terminal nodes are rule actions, and their content is the THEN action in the rule. New rules generated by the online learning module are divided into Alpha nodes, Beta nodes, and Terminal nodes using the Rete algorithm. When multiple Beta nodes are passed, the corresponding Terminal nodes are compared and the rules are output for manual verification.
[0012] Step 2.2, create the shaft parts automatic straightening machine body library:
[0013] The specific process for constructing an ontology library for automatic straightening machines for shaft parts involves: The ontology's coverage is determined by summarizing patents, literature, expert experience, and other fields related to straightening machine design and materials science. The Spacy library is used to extract noun phrases and structured data from unstructured data (e.g., "aspect ratios exceeding 30 require segmented pressurization") as concepts. The ontology editing tool Protege is used to assign shaft parts, materials, process parameters, and equipment to class names. The relevant attributes of the concepts are formalized as class data attributes, and the relationships between concepts are treated as class object attributes. The ontology is encoded in OWL format. Finally, the Pellet inference engine is used to detect logical contradictions (e.g., a part type is simultaneously defined as "unstraightenable" and "requires straightening").
[0014] Step 2.3, create a case library for automatic straightening machines for shaft parts:
[0015] The specific process for constructing a case library for an automatic straightening machine for shaft parts involves collecting data from past straightening records, specialized test cases for new materials, and virtual cases generated by ANSYS simulation. Numerical features extracted from these cases include structured data such as diameter, aspect ratio, and yield strength. Time series data includes unstructured data such as pressure-time curves and pressure-time-temperature curves. Text data includes structured data such as material type, pressurization strategy, and heat treatment status. MySQL is used to store structured data, Neo4j to store structured data on concept relationships, and MinIO to store unstructured data such as pressure-displacement curves.
[0016] Step 3. Input the relevant parameters of the automatic straightening machine for shaft parts:
[0017] The specific parameters are material properties (type, yield strength, elastic modulus, etc.), geometric parameters (shaft outer diameter, length, wall thickness, straightness error, etc.), process goals (result straightness, surface roughness, maximum spring rate, etc.) and environmental constraints (temperature, humidity, equipment tonnage, etc.)
[0018] Step 4: Generate basic process parameters based on the user input parameters and the rules in the rule library after parameter preprocessing. Combined with the case library, similar cases are screened through the hybrid distance measurement mechanism to fine-tune the parameters. The specific steps are as follows:
[0019] Step 4.1: Preprocessing of input parameters:
[0020] The input parameters are standardized, and missing values of the input parameters are matched with default values in the ontology library. The output parameters and the concept association of the ontology library are output by triggering the IF-THEN rules.
[0021] Step 4.2: Combine the case library and use the hybrid distance measurement mechanism to filter similar cases and fine-tune the parameters:
[0022] After generating basic process parameters by calling the rules in the rule base, the process parameters are used to select the most similar cases in the case library through the nearest neighbor algorithm to fine-tune and reference the parameters. The nearest neighbor algorithm uses a hybrid distance expression, including weighted Euclidean distance for numerical features, dynamic time warping distance for chart data sequence features, and cosine similarity distance for text features to screen similar cases. The hybrid distance expression is as follows:
[0023] D=αD 数值 +βD 序列 +γD 文本 ;
[0024] Where α, β, and γ are the weights of each feature. α, β, and γ are dynamically configured according to feature sensitivity analysis, which is obtained by training the XGBoost model on historical cases.
[0025] Step 4.2.1: The weighted Euclidean distance of the numerical features is to select the features that have a significant impact on the straightening results (material yield strength, shaft diameter, aspect ratio) and encode them to measure the distance of the numerical features. The weighted Euclidean distance expression of the numerical features is as follows:
[0026]
[0027] Where, ω i is the weight of the i-th parameter, x i ,y i is the i-th numerical feature in both cases.
[0028] Step 4.2.2: Dynamic Time Warping of Chart Data Series Features The distance between chart data series features is measured by solving the problem of inconsistent sequence lengths through dynamic time warping. The distance between chart data series features is constructed by constructing s by similar actions in two cases. x =[x1, x2...x m ] and s y =[y1,y2...y n ]Construct an m×n matrix, each element (i, j) represents x i ,y i The local distance is obtained by calculating the cumulative local distance starting from (1, 1). The expression of the dynamic time warping distance of the chart data sequence feature is as follows:
[0029]
[0030] Where S x , S y The sequence data for the two cases.
[0031] Step 4.2.3: The cosine similarity distance of text features is mapped into a binary vector by one-hot encoding the text information of the relationship between concepts and the cosine similarity is used to measure the feature distance. The expression of the cosine similarity distance of text features is as follows:
[0032]
[0033] Where, v x , v y For text vector
[0034] Step 4.2.4: The process of dynamically obtaining weights α, β, and γ is:
[0035] Construct a training set: Extract 100 complete historical cases from the case library. Each case includes input features: numerical features, sequence features, and text features. The key performance indicators of the straightening results include: straightness error and rebound rate.
[0036] Preprocess the features: numerical features: use weighted Euclidean distance expression for processing; sequence features: extract mean, variance, extreme value and perform DTW alignment before standardization; text features: map them into semantic vectors through the ontology library and then reduce the dimension.
[0037] Training XGBoost sensitivity analysis model: Establishing a multi-output XGBoost regression model that simultaneously predicts straightness error and rebound rate, three types of feature combinations [F num , F seq , F text ] is composed of a combination of (F value, F 序列 , F 文本 ) is used as input, and the loss function expression is as follows:
[0038]
[0039] Where y i is the true straightness error and spring rate corresponding to the i-th feature, is the straightness error and rebound rate predicted by the model, λ is the global regularization strength used to control the regularization strength as a whole, and ||Ω|| represents the regularization term expression of the model complexity as follows:
[0040]
[0041] Where T is the number of leaf nodes in the decision tree, ω j is the weight value of the jth leaf node, γ is the penalty coefficient for the number of leaf nodes used to control the tree complexity, and λ ω The regularization coefficient of the leaf node weights to prevent overfitting.
[0042] Feature Sensitivity Analysis: For a trained XGBoost model, we use its built-in feature importance calculation function. This method uses gain-based importance, which is essentially the sum of the loss function reduction (i.e., gradient boost) caused by the feature when it is used for splitting across all trees. This is more in line with the nature of XGBoost, which is based on gradient boosted trees.
[0043] Calculate the gain value of each input feature for each target variable, where the gain expression is as follows,
[0044]
[0045] Where M is the number of splits of each input feature in all trees, L split For each input feature f, the loss value before splitting, L left L is the loss value of the left node after the split for each input feature f. right The loss value of each input feature f at the right node after the split.
[0046] Calculate feature class sensitivity:
[0047] For numerical feature classes (F 数值 ) is calculated as F 数值 All sub-features F in num The average value S of the gain value of the target vector 数值 .
[0048] For numerical feature classes (F 序列 ) is calculated as F 序列 All sub-features F in seq The average value S of the gain value of the target vector 序列 .
[0049] For numerical feature classes (F 文本 ) is calculated as F 文本 All sub-features F in text The average value S of the gain value of the target vector 文本 .
[0050] Sum the importance scores of each feature and calculate the weight coefficient. The expression is as follows:
[0051]
[0052] Step 5. Import the fine-tuning parameters into SolidWorks and use equations to drive model adjustments:
[0053] By pre-designing the core components of an automatic straightening machine for shaft parts in SolidWorks software, dimension annotations are bound to parameter variables and assembly relationships are defined. A script reads user input and infers parameters to replace variable values in the template to generate the model.
[0054] Step 6: Simulate and verify the model of the automatic straightening machine for shaft parts:
[0055] The frame stress (σ max ≤0.8σ b ) and shaft deformation. Kinematic simulation is used to verify whether the hydraulic lever stroke covers the entire length of the shaft. The stability of the pressurization process is determined by comparing key process indicators in the rule library with simulation results to determine whether they meet process standards.
[0056] Step 7: Based on the simulation verification results, the NSGA-II algorithm is used to perform multi-objective optimization on the straightening force F, support spacing S, mold radius R, holding time T, and pressurization speed V:
[0057] Step 7.1: Use the multi-objective optimization NSGA-II algorithm to solve the multi-objective optimization model of the automatic straightening machine for shaft parts; retrieve solution strategies for similar failure cases through the case library to provide references for parameter fine-tuning. Call the key process indicators in the rule library, calculate the overrun ratio and deviation value, establish the optimization model, and use the NSGA-II algorithm to search for the Pareto optimal solution in the parameter space. The mathematical model is as follows:
[0058]
[0059] Where X is the decision variable. In this embodiment, the straightening force F, support spacing S, mold arc radius R, holding time T, and pressurization speed V are selected as the parameters of the automatic straightening machine for shaft parts to be optimized. max is the maximum stress obtained by simulation, σ b is the allowable stress of the material, D is the diameter of the shaft, F max is the maximum tonnage of the straightening machine, f(F) is the target straightening force function, and Δ(F, S, R, T, V) is the target straightness error function. The expression is as follows,
[0060]
[0061] Where Δ1 is the straightness after straightening obtained by simulation, Δ r is the target straightness.
[0062] Step 7.2: The steps for solving the multi-objective optimization model are:
[0063] Step 7.2.1: Input the original parameters (straightening force F, support spacing S, mold arc radius R, holding time T, and pressurization speed V) and establish trigger conditions (simulation failure), including stress exceeding the limit, springback exceeding the limit, and collision during motion simulation.
[0064] Step 7.2.2: Define the dominance relationships among individuals in the evolving population
[0065] Step 7.2.3: Normalize the input parameters. The expression is as follows:
[0066]
[0067] Where, F max is the maximum tonnage of the straightening machine, F min is the minimum straightening force obtained from the empirical formula.
[0068] Step 7.2.4: Initialize the population and set the planned generation number Gen = 1: Randomly generate 90 population individuals within the set range and 10 most similar successful cases found by the case library according to the nearest neighbor algorithm, and evaluate the fitness of the initialized population by simulation and calculation of the objective function.
[0069] Step 7.2.5: Determine whether the first generation of subpopulations has been generated. If so, set the evolutionary generation number Gen = 2. Otherwise, perform non-dominated sorting, selection, crossover, and mutation on the initialized population to generate the first generation of subpopulations and set the evolutionary generation number Gen = 2. Merge the parent and child populations into a new population and fill the population from low to high according to the non-dominated hierarchy. At the same hierarchy, select from high to low according to the congestion until 100 positions are filled. Simulate and calculate the objective function and then start iteration. Repeat the cycle until the number of iterations G is reached. max , and finally the process parameters corresponding to the optimal target are obtained from the algorithm solution set.
[0070] Step 7.2.6: The specific process of performing non-dominated sorting and selection, normal distribution crossover, and mutation on the initialized population to generate the first generation of subpopulation and make the evolutionary generation number Gen = 2 is as follows:
[0071] Non-dominated sorting: The population is divided into two layers according to the Pareto dominance relationship. The first layer (Front 1) is the solution that is not dominated by any other individual, and the second layer (Front 2) is the solution that is only dominated by Front 1.
[0072] Selection: Random league selection is used to randomly select 2 individuals from the population each time, and the individual with a higher level (or a higher crowding degree when in the same level) is selected as the parent.
[0073] Crossover: The offspring is generated using the operator that simulates binary crossover (SBX). The expression is as follows:
[0074]
[0075] Where p 1,k+1 is the k+1th generation individual generated after crossover, p 1,k is an individual of the kth generation selected, p 2,k is another individual of the kth generation selected, β q1 is the uniform distribution factor, which is calculated as follows,
[0076]
[0077] Where u is a random number in the range [0, 1) and η is the crossover index.
[0078] Mutation: A polynomial mutation operator is used to generate new individuals. The expression is as follows:
[0079] p k+1 =p k +(p kmax -p kmin )Δ i ;
[0080] Where p k is the selected k-th generation individual; p k+1 It is p k The k+1th generation individuals obtained through mutation operation;
[0081] p kmax and p kmin are the upper and lower bounds of the decision variables respectively; Δ i The calculation formula is as follows,
[0082]
[0083] Where r k is a uniformly distributed random number in [0, 1]; η1 is the variation distribution index.
[0084] Step 8: Specific process of updating the knowledge base of the online learning module:
[0085] Data collection and preprocessing: By collecting real-time sensor data (pressure, displacement, temperature), process parameters (straightening force, pressurization time, holding time), and screening similar cases in the case library through the nearest neighbor algorithm, the collected data is processed for missing items, and incomplete records are filled or deleted based on similar cases. After that, the data is subjected to wavelet transformation to eliminate abnormal fluctuations. The processed raw data (pressure, displacement, material type) is uniquely encoded to extract key features (maximum rebound, straightness error of straightening), and the continuous data (straightening force value, temperature) is binned. Generate a transaction data set according to a single instance, where each transaction is a collection of feature items.
[0086] Scan and update the data set: Scan new data every 24 hours, compare the data distribution of the new and old windows each time, and update the data to generate a new transaction data set when the difference value exceeds the threshold.
[0087] Processing of frequent item lists: For the newly added transaction dataset, calculate the support of each transaction in the transaction dataset in the new dataset, and filter out low-frequency items by removing items with support less than 0.05. Then generate a frequent item list. The transaction support expression is as follows:
[0088]
[0089] FP-Tree construction and adjustment module: Sort the frequent item list in descending order of frequency, increase the node count along the path in sequence, and create a new branch and update the node count if the path does not exist.
[0090] Recursively mine the FP-Tree: Starting from the bottom item, trace back its prefix path to generate conditional pattern bases. Recursively build subtrees for each conditional pattern base, and filter out valid rules based on confidence and lift.
[0091] Update the knowledge base: Convert the generated valid rules into IF-THEN rules and avoid rule conflicts by detecting contradictory rules through the Rete algorithm.
[0092] Through the above technical solutions, it can be seen that the present invention discloses an intelligent design method for an automatic straightening machine for shaft parts based on knowledge engineering. Compared with the existing technology, it has the following beneficial effects: the present invention adopts a combination of knowledge engineering theory and modern design theory to perform parametric design of the automatic straightening machine for shaft parts, which helps to improve the design efficiency of the automatic straightening machine for shaft parts, and has more efficient design efficiency of the automatic straightening machine for shaft parts. At the same time, it is more accurate and reliable in reasoning about unknown parameters, reducing design errors and trial and error costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0093] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0094] Figure 1 This is a schematic diagram of the intelligent design process of the automatic straightening machine for shaft parts provided by the present invention.
[0095] Figure 2 A schematic diagram of the process of writing the rule base provided by the present invention.
[0096] Figure 3 This is a schematic diagram of the process of writing the ontology library provided by the present invention.
[0097] Figure 4 A flowchart diagram is provided for the case library provided by the present invention.
[0098] Figure 5 This is a flow chart of the online learning module provided by the present invention. DETAILED DESCRIPTION
[0099] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0100] The present invention discloses an intelligent design method for an automatic straightening machine for shaft parts based on knowledge engineering. Figure 1 , the specific steps are:
[0101] Step 1: Acquire knowledge and build a knowledge base:
[0102] The knowledge acquisition method is: collect the knowledge involved in the design process of automatic straightening machine for shaft parts by referring to national standards, industry specifications, design manuals, relevant literature, etc.
[0103] Step 2: Build a knowledge base including rule base, ontology base and case base:
[0104] Step 2.1, establish the rule base of the automatic straightening machine for shaft parts:
[0105] See Figure 2 The specific process of constructing the rule base of the automatic straightening machine for shaft parts is as follows: Build the rule base through the Drools rule engine: Use the Drools rule engine to write IF-THEN rules to build the rule base based on industry rules, national rules, design manuals, etc. The rule base is divided into logical rules, calculation rules, and constraint rules. . Logical rules include material rules, geometric rules, and equipment rules. Material rules include straightening strategies for controlling different materials. Geometric rules include the impact of the geometric features of shaft parts on the process. Equipment rules include limiting process parameters based on the capabilities of the straightening machine equipment. Calculation rules are rules for key parameters derived based on material mechanics formulas or empirical models. Constraint rules include setting the allowable range or environmental restrictions of process parameters such as temperature and humidity.
[0106] When adding new rules to the rule base, the Rete algorithm is introduced to detect conflicting rules. Rules in the rule base are divided into Alpha nodes, Beta nodes, and Terminal nodes. Alpha nodes are atomic condition nodes, and their content is the noun phrases in the IF structure in the rule base. Beta nodes are condition combination matches, and their content is the mutual matching of noun phrases in the atomic condition nodes. Terminal nodes are rule actions, and their content is the THEN action in the rule. New rules generated by the online learning module are divided into Alpha nodes, Beta nodes, and Terminal nodes using the Rete algorithm. When multiple Beta nodes are passed, the corresponding Terminal nodes are compared and the rules are output for manual verification.
[0107] Step 2.2, create the shaft parts automatic straightening machine body library:
[0108] See also Figure 3 The specific process of constructing the ontology library of the automatic straightening machine for shaft parts is as follows: the coverage of the ontology is determined by summarizing patents, literature, expert experience, and other fields in the design and processing of straightening machines and materials science. By using the Spacy library to extract noun phrases and structured data from unstructured data (such as the need for segmented pressurization when the aspect ratio exceeds 30), the ontology editing tool Protege is used to take shaft parts, materials, process parameters, and equipment as class names, and the relevant attributes of the concepts are formalized as data attributes of the class. The relationship between concepts is taken as the object attributes of the class, and the ontology is encoded in the form of OWL. Finally, the Pellet reasoning engine is used to detect logical contradictions (such as a certain type of parts being defined as "unstraightenable" and "needs straightening" at the same time).
[0109] Step 2.3, create a case library for automatic straightening machines for shaft parts:
[0110] See also Figure 4 The specific process for constructing a case library for automatic straightening machines for shaft parts is as follows: past straightening records, specialized test cases for new materials, and virtual cases generated by ANSYS simulations are used as data sources for the case library. Numerical features extracted from the cases include structured data such as diameter, aspect ratio, and yield strength. Time series data includes unstructured data such as pressure-time curves and pressure-time-temperature curves. Text data includes structured data such as material type, pressurization strategy, and heat treatment status. MySQL is used to store structured data, Neo4j to store structured data on the relationships between concepts, and MinIO to store unstructured data such as pressure-displacement curves.
[0111] Step 3. Input the relevant parameters of the automatic straightening machine for shaft parts:
[0112] The specific parameters are material properties (type, yield strength, elastic modulus), geometric parameters (shaft outer diameter, length, wall thickness, straightness error), process goals (result straightness, surface roughness, maximum spring rate) and environmental constraints (temperature, humidity, equipment tonnage).
[0113] Step 4: Generate basic process parameters based on the user input parameters and the rules in the rule library after parameter preprocessing. Combined with the case library, select similar cases through the hybrid distance measurement mechanism to fine-tune the parameters. The specific steps are as follows:
[0114] Step 4.1: Preprocessing of input parameters:
[0115] The input parameters are standardized, and missing values of the input parameters are matched with default values in the ontology library. The output parameters and the concept association of the ontology library are output by triggering the IF-THEN rules.
[0116] Step 4.2: Combine the case library and use the hybrid distance measurement mechanism to filter similar cases and fine-tune the parameters:
[0117] See also Figure 4 After calling the rules in the rule base to generate basic process parameters, the process parameters are used to select the most similar cases in the case library through the nearest neighbor algorithm to fine-tune and reference the parameters. The nearest neighbor algorithm uses a hybrid distance expression, including the weighted Euclidean distance for numerical features, the dynamic time warping distance for chart data sequence features, and the cosine similarity distance for text features to screen similar cases. The hybrid distance expression is as follows:
[0118] D=αD 数值 +βD 序列 +γD 文本 ;
[0119] Where α, β, and γ are the weights of each feature. α, β, and γ are dynamically configured according to feature sensitivity analysis, which is obtained by training the XGBoost model on historical cases.
[0120] Step 4.2.1: The weighted Euclidean distance of the numerical features is to select the features that have a significant impact on the straightening results (material yield strength, shaft diameter, aspect ratio) and encode them to measure the distance of the numerical features. The weighted Euclidean distance expression of the numerical features is as follows:
[0121]
[0122] Where, ω i is the weight of the i-th parameter, x i ,y i is the i-th numerical feature in both cases.
[0123] Step 4.2.2: Dynamic Time Warping of Chart Data Series Features The distance between chart data series features is measured by solving the problem of inconsistent sequence lengths through dynamic time warping. The distance between chart data series features is constructed by constructing s by similar actions in two cases. x =[x1, x2…x m ] and s y =[y1,y2...y n ]Construct an m×n matrix, each element (i, j) represents x i ,y i The local distance is obtained by calculating the cumulative local distance starting from (1, 1). The expression for the characteristic distance of the chart data series is as follows:
[0124]
[0125] Where S x , S y For the sequence data in the two cases
[0126] Step 4.2.3: The cosine similarity distance of text features is mapped into a binary vector by one-hot encoding the text information of the relationship between concepts and the cosine similarity is used to measure the feature distance. The expression of the cosine similarity distance of text features is as follows:
[0127]
[0128] Where, v x , v y is a text vector.
[0129] Step 4.2.4: The process of dynamically obtaining weights α, β, and γ is:
[0130] Construct a training set: Extract 100 complete historical cases from the case library. Each case includes input features: numerical features, sequence features, and text features. The key performance indicators of the straightening results include: straightness error and rebound rate.
[0131] Preprocess the features: numerical features: use weighted Euclidean distance expression for processing; sequence features: extract mean, variance, extreme value and perform DTW alignment and then standardize; text features: map to semantic vectors through ontology library and then reduce dimension
[0132] Training XGBoost sensitivity analysis model: Establishing a multi-output XGBoost regression model that simultaneously predicts straightness error and rebound rate, three types of feature combinations [F num , F seq , F text ] is composed of a combination of (F 数值 , F 序列 , F 文本 ) is used as input, and the loss function expression is as follows:
[0133]
[0134] Where yi is the true straightness error and springback rate corresponding to the i-th feature, is the straightness error and rebound rate predicted by the model, λ is the global regularization strength used to control the regularization strength as a whole, and ||Ω|| represents the model complexity regularization term, which is expressed as follows:
[0135]
[0136] Where T is the number of leaf nodes in the decision tree, ω j is the weight value of the jth leaf node, γ is the penalty coefficient for the number of leaf nodes used to control the tree complexity, and λ ω The regularization coefficient of the leaf node weights to prevent overfitting.
[0137] Feature Sensitivity Analysis: For a trained XGBoost model, we use its built-in feature importance calculation function. This method uses gain-based importance, which is essentially the sum of the loss function reduction (i.e., gradient boost) caused by the feature when it is used for splitting across all trees. This is more in line with the nature of XGBoost, which is based on gradient boosted trees.
[0138] Calculate the gain value of each input feature for each target variable, where the gain expression is as follows,
[0139]
[0140] Where M is the number of splits of each input feature in all trees, L split For each input feature f, the loss value before splitting, L left L is the loss value of the left node after the split for each input feature f. right The loss value of each input feature f at the right node after the split.
[0141] Calculate feature class sensitivity:
[0142] For numerical feature classes (F 数值 ) is calculated as F 数值 All sub-features F in num The average value S of the gain value of the target vector 数值 .
[0143] For numerical feature classes (F 序列 ) is calculated as F 序列 All sub-features F in seq The average value S of the gain value of the target vector 序列 .
[0144] For numerical feature classes (F 文本 ) is calculated as F 文本 All sub-features F in text The average value S of the gain value of the target vector 文本 .
[0145] Sum the importance scores of each feature and calculate the weight coefficient. The expression is as follows:
[0146]
[0147] Step 5. Import the fine-tuning parameters into SolidWorks and use equations to drive model adjustments:
[0148] By pre-designing the core components of an automatic straightening machine for shaft parts in SolidWorks software, dimension annotations are bound to parameter variables and assembly relationships are defined. A script reads user input and infers parameters to replace variable values in the template to generate the model.
[0149] Step 6: Simulate and verify the model of the automatic straightening machine for shaft parts:
[0150] The frame stress (σ max ≤0.8σ b ), shaft deformation. Use kinematic simulation to verify whether the hydraulic lever stroke can cover the entire length of the shaft and whether the pressurization process is stable. By calling the key process indicators in the rule library and comparing them with the simulation results, determine whether the process standards are met.
[0151] Step 7: Based on the simulation verification results, the NSGA-II algorithm is used to perform multi-objective optimization on the straightening force F, support spacing S, mold radius R, holding time T, and pressurization speed V:
[0152] Step 7.1: Use the multi-objective optimization NSGA-II algorithm to solve the multi-objective optimization model of the automatic straightening machine for shaft parts; retrieve solution strategies for similar failure cases through the case library to provide references for parameter fine-tuning. Call the key process indicators in the rule library, calculate the overrun ratio and deviation value, establish the optimization model, and use the NSGA-II algorithm to search for the Pareto optimal solution in the parameter space. The mathematical model is as follows:
[0153]
[0154] Where X is the decision variable. In this embodiment, the straightening force F, support spacing S, mold arc radius R, holding time T, and pressurization speed V are selected as the parameters of the automatic straightening machine for shaft parts to be optimized. max is the maximum stress obtained by simulation, σ b is the allowable stress of the material, D is the diameter of the shaft, F max is the maximum tonnage of the straightening machine, f(F) is the target straightening force function, and Δ(F, S, R, T, V) is the target straightness error function. The expression is as follows,
[0155]
[0156] Where Δ1 is the straightness after straightening obtained by simulation, Δ r is the target straightness.
[0157] Step 7.2: The steps for solving the multi-objective optimization model are:
[0158] Step 7.2.1: Input the original parameters (straightening force F, support spacing S, mold arc radius R, holding time T, pressurization speed V), and establish trigger conditions (simulation failure), including stress exceeding the limit, rebound exceeding the limit, motion simulation collision, etc.
[0159] Step 7.2.2: Define the dominance relationships among individuals in the evolving population.
[0160] Step 7.2.3: Normalize the input parameters. The expression is as follows:
[0161]
[0162] Where, F max is the maximum tonnage of the straightening machine, F min This is the minimum straightening force obtained from the empirical formula, and the other four parameters can be deduced similarly.
[0163] Step 7.2.4: Initialize the population and set the planned generation number Gen = 1: Randomly generate 90 population individuals within the set range and 10 most similar successful cases found by the case library according to the nearest neighbor algorithm, and evaluate the fitness of the initialized population by simulation and calculation of the objective function.
[0164] Step 7.2.5: Determine whether the first generation of subpopulations has been generated. If so, set the evolutionary generation number Gen = 2. Otherwise, perform non-dominated sorting, selection, crossover, and mutation on the initialized population to generate the first generation of subpopulations and set the evolutionary generation number Gen = 2. Merge the parent population and the child population into a new population, and fill the population from low to high according to the non-dominated hierarchy. Select from high to low according to the congestion degree at the same hierarchy until 100 positions are filled. Simulate and calculate the objective function, then start iteration. Repeat the cycle until the number of iterations G is reached. max , and finally the process parameters corresponding to the optimal target are obtained from the algorithm solution set.
[0165] Step 7.2.6: The specific process of performing non-dominated sorting and selection, normal distribution crossover, and mutation on the initialized population to generate the first generation of subpopulation and make the evolutionary generation number Gen = 2 is as follows:
[0166] Non-dominated sorting: The population is divided into two layers according to the Pareto dominance relationship. The first layer (Front1) is the solution that is not dominated by any other individual, and the second layer (Front2) is the solution that is only dominated by Front1.
[0167] Selection: Random league selection is used to randomly select 2 individuals from the population each time, and the individual with a higher level (or a higher crowding degree when in the same level) is selected as the parent.
[0168] Crossover: The offspring is generated using the operator that simulates binary crossover (SBX). The expression is as follows:
[0169]
[0170] Where p 1,k+1 is the k+1th generation individual generated after crossover, p 1,k is an individual of the kth generation selected, p 2,k is another individual of the kth generation selected, β q1 is the uniform distribution factor, which is calculated as follows,
[0171]
[0172] Where u is a random number in the range [0,1) and η is the crossover index.
[0173] Mutation: A polynomial mutation operator is used to generate new individuals. The expression is as follows:
[0174] P k+1 =p k +(p kmax -p kmin )Δ i ;
[0175] Where p k is the selected k-th generation individual; p k+1 It is p k The k+1th generation individuals obtained by mutation operation; p kmax and p kmin are the upper and lower bounds of the decision variables respectively; Δ i The calculation formula is as follows,
[0176]
[0177] Where r k is a uniformly distributed random number in [0,1]; η1 is the variation distribution index.
[0178] Step 8: Specific process of updating the knowledge base of the online learning module:
[0179] See also Figure 5, data collection and preprocessing: by collecting real-time sensor data (pressure, displacement, temperature), process parameters (straightening force, pressurization time, holding time), and screening similar cases in the case library through the nearest neighbor algorithm, the collected data is processed for missing items, and incomplete records are filled or deleted based on similar cases. After that, the data is eliminated based on abnormal fluctuations based on wavelet transform. The processed raw data (pressure, displacement, material type) is uniquely encoded to extract key features (maximum rebound, straightness error), and the continuous data (straightening force value, temperature) is binned. Generate a transaction data set according to a single instance, where each transaction is a collection of feature items.
[0180] Scan and update the data set: Scan new data every 24 hours, compare the data distribution of the new and old windows each time, and update the data to generate a new transaction data set when the difference value exceeds the threshold.
[0181] Processing of frequent item lists: For the newly added transaction dataset, calculate the support of each transaction in the transaction dataset in the new dataset, and filter out low-frequency items by removing items with support less than 0.05. Then generate a frequent item list. The transaction support expression is as follows:
[0182]
[0183] FP-Tree construction and adjustment module: Sort the frequent item list in descending order of frequency, increase the node count along the path in sequence, and create a new branch and update the node count if the path does not exist.
[0184] Recursively mine the FP-Tree: Starting from the bottom item, trace back its prefix path to generate conditional pattern bases. Recursively build subtrees for each conditional pattern base, and filter out valid rules based on confidence and lift.
[0185] Update the knowledge base: Convert the generated valid rules into IF-THEN rules and avoid rule conflicts by detecting contradictory rules through the Rete algorithm.
Claims
1. An intelligent design method for an automatic straightening machine for shaft parts based on knowledge engineering, characterized in that: The knowledge base constructed by this method includes: the rule base uses the Drools rule engine to write logical rules, calculation rules and constraint rules in the form of IF-THEN, and detects conflicts of newly added rules through the Rete algorithm; the ontology base uses the Spacy library to extract noun phrases and structured data from unstructured data as concepts, and uses the ontology editing tool Protege to encode the ontology in the form of OWL; the case base uses past calibration records, new material test data and ANSYS virtual cases, and the data storage uses MySQL to manage numerical features, Neo4j to manage structured data of the relationship between concepts, and MinIO to manage timing curves; based on the user input parameters, the rules in the rule base are called after parameter preprocessing to generate basic process parameters, and the case base is combined with the hybrid distance measurement Expressions are used to screen similar cases and fine-tune parameters. The hybrid distance measurement expression includes the weighted Euclidean distance of numerical features, the dynamic time warping distance of chart data sequence features, and the cosine similarity distance of text features. The weight coefficients are dynamically configured through the XGBoost sensitivity analysis model; the fine-tuning parameters are imported into SolidWorks, adjusted by the equation-driven model, and then analyzed and verified by the finite element software ANSYS; based on the simulation verification results, the NSGA-II algorithm is used to perform multi-objective optimization of the straightening force F, support spacing S, mold radius R, holding time T, and pressurizing speed V; sensor data is collected through the online learning module, and association rules are mined through the FP-Growth algorithm. Rete conflict detection is used to determine whether new rules can be generated to realize dynamic updating of the knowledge base.
2. The intelligent design method of an automatic straightening machine for shaft parts based on knowledge engineering according to claim 1 is characterized in that: The specific steps of generating basic process parameters by calling the rules in the rule base after parameter preprocessing based on the user input parameters, and screening similar cases through the hybrid distance measurement mechanism in combination with the case base to fine-tune the parameters are as follows: (1) Preprocessing of input parameters; (2) Combined with the case library, similar cases are screened and parameters are fine-tuned through a hybrid distance measurement mechanism: The most similar cases are screened in the case library through the nearest neighbor algorithm to fine-tune and reference the basic process parameters. The nearest neighbor algorithm uses a hybrid distance expression, including the weighted Euclidean distance of numerical features, the dynamic time warping distance of chart data sequence features, and the cosine similarity distance of text features to screen similar cases. The hybrid distance expression is as follows: D=αD 数值 +βD 序列 +γD 文本 ; Where α, β, and γ are the weights of each feature. α, β, and γ are dynamically configured according to feature sensitivity analysis, which is obtained by training the XGBoost model on historical cases.
3. The intelligent design method of an automatic straightening machine for shaft parts based on knowledge engineering according to claim 2 is characterized in that: The weighted Euclidean distance of the numerical features is to select the features that have a significant impact on the straightening result and encode them to measure the distance of the numerical features. The expression of the weighted Euclidean distance of the numerical features is as follows: Where ω i is the weight of the i-th parameter, x i ,y i is the i-th numerical feature in both cases; The dynamic time warping distance of the chart data sequence features is measured by solving the problem of inconsistent sequence lengths through dynamic time warping. The distance expression of the dynamic time warping of the chart data sequence features is as follows: Where s x , s y For the sequence data in two cases; The cosine similarity distance of text features is achieved by mapping the text information of the relationship between concepts into a binary vector through one-hot encoding and measuring the feature distance using cosine similarity. The expression of the cosine similarity distance of text features is as follows: Where, v x , v y is a text vector.
4. The intelligent design method of the automatic straightening machine for shaft parts based on knowledge engineering according to claim 2 is characterized in that The process of dynamically acquiring the weights α, β, and γ is as follows: Construct a training set; Preprocess the features; Train the XGBoost sensitivity analysis model; Sensitivity analysis of features; The importance scores of each class of features are summed up and the weight coefficient is calculated.
5. The intelligent design method of an automatic straightening machine for shaft parts based on knowledge engineering according to claim 1 is characterized in that: The multi-objective optimization of the straightening force F, support spacing S, mold radius R, holding time T, and pressurization speed V using the NSGA-II algorithm based on the simulation verification results is solved by using the multi-objective optimization NSGA-II algorithm to solve the multi-objective optimization model of the automatic straightening machine for shaft parts. The established mathematical model is: Where X is the decision variable, and the straightening force F, support spacing S, mold arc radius R, holding time T, and pressurizing speed V are selected as the parameters of the automatic straightening machine for shaft parts to be optimized, σ max is the maximum stress obtained by simulation, σ b is the allowable stress of the material, D is the diameter of the shaft, F max is the maximum tonnage of the straightening machine, f(F) is the target straightening force function, Δ(F, S, R, T, V) is the target straightness error function, and the expression is as follows: Where Δ1 is the straightness after straightening obtained by simulation, Δ r is the target straightness.
6. The intelligent design method of an automatic straightening machine for shaft parts based on knowledge engineering according to claim 1 is characterized in that: The online learning module collects sensor data, mines association rules through FP-Growth, and updates the knowledge base through Rete conflict detection. The specific process is as follows: (1) Data collection and preprocessing; (2) Scan and update the data set; (3) Processing of frequent item lists; (4) FP-Tree construction and adjustment module; (5) Recursively mine the FP-Tree; (6) Update of knowledge base.
Citation Information
Patent Citations
Use method of combat knowledge system and combat decision auxiliary method
CN113255916A
Production line dynamic process knowledge base construction method and process scheme generation method
CN118296165A