Hybrid Retrieval Method and Device for Intelligent Recommendation of Welding Process Plans

Through mixed search methods and self-attention mechanism, combined with graph search, keyword text search and vector search, a welding process knowledge graph and vector database were constructed, which solved the problems of low search efficiency and low accuracy in multi-layer multi-channel welding processes, and achieved efficient and accurate welding process solutions recommendations.

CN120013209BActive Publication Date: 2025-07-18XIANGJIANG LAB
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510488002.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-18
Publication Date
2025-07-18
Estimated Expiration
2045-04-18

AI Technical Summary

Technical Problem

The prior art has low search efficiency and low accuracy in the multi-layer multi-pass welding process, which is difficult to adapt to complex and changeable welding needs, and cannot provide personalized and accurate welding solutions.

Method used

Using a hybrid search method, combining graph search, keyword text search and vector search, features fusion and reordering are performed through self-attention mechanism and Transformer model, welding process knowledge graph and vector database are constructed to generate accurate welding process solutions.

Benefits of technology

It realizes rapid and accurate retrieval of contextual information related to user welding needs, improves retrieval accuracy and efficiency, adapts to the specific information needs and complex relationships of complex welding processes, and provides flexible and efficient welding process solutions recommendations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120013209B_ABST
    Figure CN120013209B_ABST
Patent Text Reader

Abstract

The present invention discloses a hybrid retrieval method and device for intelligent recommendation of welding process plans. The method steps include: obtaining the welding requirement information of the user and vectorizing it to form a welding requirement vector; performing hybrid retrieval according to the welding requirement vector, and the hybrid retrieval includes performing graph retrieval on the welding process knowledge graph and performing keyword text retrieval and vector retrieval on the welding process vector database respectively, extracting features from each retrieval result in the similar context retrieval result set, and using the self-attention mechanism to perform feature fusion on the features corresponding to the retrieval results obtained by different retrieval methods, and using the Transformer model to re-rank the fused features; inputting the sorted similar context retrieval results into a pre-trained large model to obtain the intelligent recommendation result of the welding process plan. The present invention has the advantages of simple implementation method, high retrieval efficiency and accuracy, strong reliability and flexibility, etc.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of multi-layer and multi-pass welding, and particularly to a hybrid retrieval method and device for intelligent recommendation of welding process plans. Background Art

[0002] Welding process is to make two workpieces achieve atomic bonding through heating, pressure application, etc., so as to realize the connection of metal or non-metal materials. The multi-layer and multi-pass welding process is to divide the weld seam into multiple layers and multi-pass weld beads, and perform welding layer by layer and bead by bead to improve the welding quality and efficiency, which can be applied to the welding of thick plates, large components and complex structures. The multi-layer and multi-pass welding method can realize the welding of complex structural parts and thick materials, ensuring the strength and durability of the joints. However, the complexity and technical requirements of the corresponding welding process are also higher. In the manufacturing process of multi-layer and multi-pass welding, the selection of welding process has a crucial impact on welding quality, production cost and efficiency. However, traditional welding processes are usually formulated manually. For example, experienced welding engineers formulate welding plans one by one according to factors such as material properties, structural shapes, and environmental conditions. This manual way of formulating welding processes has problems such as low efficiency, strong subjectivity, and poor repeatability, and it is difficult to meet the current requirements of high-efficiency, precise, and automated production.

[0003] Using large model technology to generate the optimal welding process for different welding requirements can not only effectively improve welding quality and efficiency, but also reduce welding costs. However, when facing problems in professional fields, the results generated by general large language models may lack authenticity and accuracy, and may produce hallucinations. If an expert system for welding process plans is established by using fixed rules and parametric modeling, there will be problems in adapting to complex and changeable welding requirements, and it is impossible to provide personalized and precise welding solutions for different user input welding requirements. Therefore, on the basis of large models, by using welding process plan sample data and welding process related rules, a vertical domain large model for welding process plan generation can be constructed, which can generate welding process plans with stronger professionalism and higher output quality for the welding process field.

[0004] Meanwhile, in order to utilize large model technology to generate accurate intelligent recommendations, it is necessary to provide clear task requirement information and necessary context information to the Promapt template so that the large model can understand the task. Therefore, it is necessary to search for relevant context information through a large amount of retrieval work based on the input information provided by the user, and then use the large model based on the retrieval results to generate the best recommendation results. Therefore, the context information retrieval method is the key to determining the efficiency and accuracy of intelligent recommendations. In the prior art, the retrieval methods for context information are usually traditional knowledge bases and rule engines. Such methods have certain practicality in standardized scenarios, but they are not suitable for the retrieval of welding process information in non-linear and diverse scenarios. Therefore, the actual retrieval efficiency and accuracy are not high. Moreover, the welding process of multi-layer and multi-pass welding is relatively complex. Retrieving the welding process plan for multi-layer and multi-pass welding requires considering the complex relationships between materials, process parameters, and defects. Traditional knowledge bases and rule engines cannot quickly and accurately retrieve relevant context information, which will affect the accuracy and reliability of intelligent recommendations. Summary of the Invention

[0005] The technical problem to be solved by the present invention lies in: aiming at the technical problems existing in the prior art, the present invention provides a hybrid retrieval method and device for intelligent recommendation of welding process plans with simple implementation method, high retrieval efficiency and accuracy, and strong reliability and flexibility, which can quickly and accurately retrieve relevant context for different user welding requirements and assist the large model to quickly generate accurate welding process recommendation plans.

[0006] To solve the above technical problems, the technical solution proposed by the present invention is as follows:

[0007] A hybrid retrieval method for intelligent recommendation of welding process plans, the steps include:

[0008] Obtain the welding requirement information of the user and vectorize it to form a welding requirement vector, where the welding requirement vector includes welding method, welding type, and welding parameters;

[0009] Perform hybrid retrieval according to the welding requirement vector. The hybrid retrieval includes graph retrieval of the welding process knowledge graph and keyword text retrieval and vector retrieval of the welding process vector database respectively. The vector retrieval is to perform semantic matching between the welding requirement vector and the welding process vector database, and obtain a set of similar context retrieval results that meet the requirements according to the retrieval results of the hybrid retrieval; extract features from each retrieval result in the set of similar context retrieval results respectively, and use the self-attention mechanism to fuse the features corresponding to the retrieval results obtained by different retrieval methods, and re-rank the fused features using the Transformer model to obtain the sorted similar context retrieval results;

[0010] Input the sorted similar context retrieval results into a pre-trained large model to obtain intelligent recommendation results for welding process plans.

[0011] Furthermore, it also includes constructing a welding process knowledge graph, including:

[0012] Input each welding process node into the GAT network, and calculate the self-attention coefficient for each welding process node in each layer of the graph attention layer. The self-attention coefficient is calculated based on the input features of the welding process node and the relationship type weight, and uses GELU as the activation function. The relationship type weight is assigned according to the relationship type between the welding material and the process method;

[0013] Extract welding process features based on the multi-head attention mechanism in each layer of the GAT graph attention layer. Define a hierarchical allocation function to divide the attention heads into macro attention heads and micro attention heads and assign weights. The macro attention is used to focus on the process sequence of the welding steps, and the micro attention heads are used to focus on material properties and / or defect generation reasons; perform weighted summation on the neighbor node features of each input welding process embedding node for feature extraction to obtain the welding process features;

[0014] Concatenate the welding process features extracted by the multi-head attention mechanism in each layer of the graph attention layer to obtain a welding process node sequence;

[0015] Perform a linear transformation on the welding process node sequence to map it to the initial input dimension, and after adaptive normalization, process it through the Swish activation function to obtain welding process node features;

[0016] Obtain a GAT feature map from each of the welding process node features to represent the welding process knowledge graph vector, and construct the welding process knowledge graph.

[0017] Furthermore, the calculation expression of the self-attention coefficient is:

[0018] ,

[0019] where, represents the attention coefficient from welding process node to welding process node , represents the neighbor nodes of welding process node , represents the relationship type weight between welding process node and welding process node , represents the linear transformation weight matrix applied to each node, represents the weight vector, denote activation function, , , respectively denote the input features of the \(i\)-th, \(j\)-th, and \(k\)-th welding process nodes;

[0020] The calculation expression of the welding process feature is:

[0021] ,

[0022] ,

[0023] ,

[0024] wherein, is the linear transformation weight matrix of the k -th attention head, is the attention coefficient from the welding process node to the welding process node , are the hierarchical allocation functions for adjusting the macro-level attention head and the micro-level attention head respectively, used to adjust the number and allocation ratio of the corresponding attention heads, respectively denote the macro-level attention head and the micro-level attention head, is the relationship category embedding vector, is the non-linear activation function GELU, respectively denote the output features of the macro-level attention head, the output features of the micro-level attention head, and the fusion result of the output features of the macro-level attention head and the output features of the micro-level attention head of the i -th welding process node, denotes that the k -th attention head is a macro-level attention head, denotes that the k -th attention head is a micro-level attention head;

[0025] The calculation expression of the welding process node feature obtained by splicing the welding process features extracted by the multi-head attention mechanism of each layer of graph attention layer is:

[0026] ,

[0027] ,

[0028] ,

[0029] wherein, is the attention coefficient of the -th attention head, An allocation function for adjusting the number and allocation ratio of attention heads K represents the number of attention heads, and || represents the concatenation operation is the non-linear activation function GELU; is the output weight matrix is the i th user welding requirement vector of the welding process node output by GAT represents the result after transformation of by the output weight matrix represents after activation function's final output

[0030] Furthermore, graph retrieval of the welding process knowledge graph according to the welding requirement vector includes:

[0031] Extract keywords from the welding requirement vector, and locate the corresponding nodes and edges according to the extracted keywords;

[0032] Based on the keywords, perform subgraph traversal in the welding process knowledge graph to search for subgraphs within a preset number of hops and centered on the keywords;

[0033] Adjust the vector dimension of the searched subgraph to be consistent with the welding requirement vector;

[0034] Use Euclidean distance and / or reverse distance to calculate the similarity score between the searched subgraph and the welding requirement vector.

[0035] Furthermore, keyword text retrieval of the welding process vector database according to the welding requirement vector includes:

[0036] Extract keywords from the welding requirement vector;

[0037] Perform keyword queries on the welding process documents in the welding process vector database, calculate the similarity score between the keyword and the text in the welding process vector database, and the calculation expression is:

[0038] ,

[0039] ,

[0040] ,

[0041] wherein represents the similarity score between the keyword and the welding process text in the welding process vector database ​It is a welding process document The weight of the field in is a welding process document The field part of is a parameter dynamically adjusted based on the importance of the query term in the field of welding processes Indicates the keyword in the document The number of occurrences Indicates the document length of Indicates the average length of all documents in the welding process vector database Indicates the median of the lengths of all documents in the welding process vector database and are adjustment parameters is the inverse document frequency of the keyword is the total number of documents in the welding process vector database Indicates the number of documents containing the keyword

[0042] Furthermore, the obtaining of the set of similar context retrieval results that meet the requirements according to the retrieval results of hybrid retrieval includes:

[0043] Respectively obtain the graph retrieval similarity obtained by performing graph retrieval on the welding requirement vector, the keyword retrieval similarity obtained by performing keyword retrieval, and the vector retrieval similarity obtained by performing vector retrieval;

[0044] Weight the graph retrieval similarity, the keyword retrieval similarity, and the vector retrieval similarity to obtain a comprehensive similarity score;

[0045] Screen out the retrieval results with the highest or greater than the preset threshold of the comprehensive similarity score to obtain the set of retrieval results.

[0046] Furthermore, the feature extraction is respectively performed on each retrieval result in the set of similar context retrieval results, and the features corresponding to the retrieval results obtained by different retrieval methods are fused using the self-attention mechanism, and the fused features are re-ranked using the Transformer model, including:

[0047] Perform normalization processing on the set of retrieval results and screen out duplicate vectors to obtain the remaining vectors ;

[0048] For the retrieval results in the remaining vectors respectively extract the features of the retrieval results corresponding to graph retrieval, keyword text retrieval, and vector retrieval;​

[0049] The self-attention mechanism is used to fuse the features of the retrieval results corresponding to graph retrieval, keyword text retrieval, and vector retrieval to obtain fused features;

[0050] The fused features are input into a pre-trained Transformer model encoder. In the Transformer model encoder, the KAN layer is used to process the output of the multi-head self-attention mechanism layer, and the retrieval result features of each welding process are obtained according to the feature representation after being processed by the self-attention mechanism and the KAN layer and the welding requirement type;

[0051] Adjust the remaining vectors according to the retrieval result features of each welding process The retrieval result weights corresponding to the retrieval results in are re-ranked.

[0052] Furthermore, the self-attention mechanism is used to fuse the features of the retrieval results corresponding to graph retrieval, keyword text retrieval, and vector retrieval according to the following formula to obtain fused features:

[0053] ,

[0054] ,

[0055] ,

[0056] where, represents the retrieval result feature matrix corresponding to keyword text retrieval , graph retrieval and vector retrieval corresponding retrieval result feature matrix, represents the attention weight, is the retrieval feature dimension, represents the fused features obtained by fusion;

[0057] The output of each layer of the Transformer model encoder is expressed as:

[0058] ,

[0059] where, represents the output of the Transformer model encoder, represents the output of the multi-layer self-attention mechanism, represents the output of the KAN layer.

[0060] Furthermore, the retrieval result feature of each welding process is expressed as:

[0061] ,

[0062] Among them, represents the weight matrix determined according to the type of welding requirement, and ⊙ represents element-wise multiplication;

[0063] Adjust the remaining vector according to the retrieval result characteristics of each welding process to reorder the retrieval result weights corresponding to each retrieval result in The calculation expression is:

[0064] ,

[0065] Among them, represents the final reordering result, represents the learned weight matrix, is the bias term, represents softmax function.

[0066] An electronic device includes a processor and a memory. The memory is used to store a computer program, and the processor is used to execute the computer program to perform the above method.

[0067] Compared with the prior art, the beneficial effects of the present invention are as follows: The present invention realizes the similar context retrieval of the user's welding requirement vector through a fine-grained retrieval mechanism for welding processes using hybrid retrieval. By using three retrieval methods, namely graph retrieval, keyword text retrieval, and vector retrieval, based on the user's welding requirement vector, a preliminary similar context retrieval result is formed. Then, the self-attention mechanism is used to perform deep feature fusion on the similar context retrieval results obtained by the three retrieval methods, and the fused features are reordered based on the Transformer model, gradually refining from the preliminary matching to a more accurate similar context. It can quickly and accurately retrieve context information related to different user welding requirements by integrating multiple retrieval methods, improve the retrieval accuracy while ensuring the retrieval efficiency, meet the specific information requirements of welding processes and the high fidelity of complex association relationships. Therefore, by combining the advantages of knowledge retrieval and generation technologies, it can improve the system's adaptability to complex requirements, realize the precise optimization of welding process plans from knowledge extraction to context generation, and provide a flexible, efficient, and intelligent solution for the intelligent recommendation of welding process plans. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] Figure 1 is a schematic flow chart of the implementation of the hybrid retrieval method for intelligent recommendation of welding process plans in this embodiment.

[0069] Figure 2 is a schematic diagram of the principle of generating weights of the GAT network used in this embodiment.

[0070] Figure 3 It is a schematic diagram of the principle of the GAT network feature output process adopted in this embodiment. Specific implementation manners

[0071] The present invention will be further described below in conjunction with the accompanying drawings of the specification and specific preferred embodiments, but the protection scope of the present invention is not limited thereby.

[0072] The welding process of multi-layer and multi-pass welding is relatively complex, involving welding methods, welding positions, welding materials, joint forms, and welding parameters, etc. Among them, welding parameters include various types of parameters, such as welding current, welding voltage, welding speed, welding diameter and other parameters. Using large model technology to generate the optimal welding process for different welding requirements can not only effectively improve the welding quality and efficiency, but also reduce the welding cost. A vertical domain large model is a large language model optimized for a specific professional field. On the basis of the large model, by using welding process plan sample data and welding process-related rules, a vertical domain large model for generating welding process plans is constructed, which can generate welding process plans with stronger professionalism and higher output quality for the welding process field.

[0073] Actual user requirements are often complex and diverse, and there will be long-term dependencies between process parameters. All kinds of data may be highly fragmented. The traditional retrieval method relying on knowledge bases and rule engines is applicable to standardized scenarios, while the welding process is usually a non-linear and diverse scenario. Welding process retrieval also involves complex associations between materials, process parameters and defects. The traditional retrieval method relying on knowledge bases and rule engines will show significant deficiencies in retrieving complex welding process information in the face of non-linear and diverse scenarios, such as problems like low accuracy of retrieval results, limited quality of context generation, and difficulty in adapting to user personalized needs.

[0074] The present invention realizes the similar context retrieval of the user's welding requirement vector through a fine retrieval mechanism for the welding process using hybrid retrieval. By retrieving according to the user's welding requirement vector using three retrieval methods: graph retrieval, keyword text retrieval, and vector retrieval, a preliminary similar context retrieval result is formed. Then, the self-attention mechanism is used to perform deep feature fusion on the similar context retrieval results obtained by the three retrieval methods, and the fused features are re-ranked based on the Transformer model, gradually refining from the preliminary matching to a more accurate similar context. It can quickly and accurately retrieve context information related to different user welding requirements by integrating multiple retrieval methods, improve the retrieval accuracy while ensuring the retrieval efficiency, meet the specific information requirements of the welding process and the high fidelity of complex association relationships. Thus, by combining the advantages of knowledge retrieval and generation technologies, it can improve the system's adaptability to complex requirements, realize the precise optimization of the welding process plan from knowledge extraction to context generation, and provide a flexible, efficient, and intelligent solution for the intelligent recommendation of welding process plans.

[0075] As Figure 1 shown, the steps of the hybrid retrieval method for the intelligent recommendation of welding process plans in this embodiment include:

[0076] Step S01. Obtain the user's welding requirement information, vectorize it to form a welding requirement vector, and the welding requirement vector includes welding methods, welding types, welding parameters, etc.

[0077] Specifically, after the user inputs the welding requirement vector, it can first be cleaned and preprocessed. For example, the redundant symbols, special characters, and noise data irrelevant to the welding process in the user's welding requirements can be automatically removed through data cleaning, and the useful information can be retained; the preprocessing can include removing stop words, standardizing welding terms, word segmentation, synonym replacement, and removing stop words irrelevant to the welding process, such as words like "of", "is", "how", etc. that do not affect the retrieval results, to ensure that the key information is retained. Further, if the semantics of the welding requirement are identified as ambiguous, the query can also be rewritten according to the specific welding process involved. If the system identifies the existence of specified terms or expressions in the fuzzy requirement, the existing knowledge base can be used to expand it, automatically supplement the relevant context, and generate a more accurate question; then, with the help of a pre-trained large model, using the dynamic interaction mechanism, the feedback content can be adjusted according to the user's context and welding application scenario, so that the final inference and recommendation results are more in line with the complexity and fineness of the actual welding requirements. For example, according to the necessary conditions for generating the welding process plan, check whether there are any missing parts in the user's welding requirement input. If there are any missing parts, require the user to further supplement them and confirm with the user that the welding requirement vector is complete and correct.

[0078] Furthermore, the user's welding requirement vector refined by the large model can be input into the Embedding model. The Embedding model is used to convert the user's welding requirement vector into a vector representation, and capture the semantic or feature relationships between data through the vector representation.

[0079] Specifically, the Embedding model includes an input layer, a word embedding layer, an encoder, and an output layer connected in sequence. The sliced user welding requirement data is accessed by the input layer and tokenized. The user welding requirement data is decomposed into multiple tokens, and the tokens are arranged in sequence. Each token in the sequence is converted into a corresponding ID using a vocabulary, forming a corresponding ID serialization result and outputting it to the word embedding layer. The word embedding layer maps words, segments, and positions in the ID serialization result to a fixed-dimensional welding requirement word vector representation, and performs weighted fusion using weights calculated according to the attention mechanism to obtain a welding requirement vector, which is provided to the encoder. The encoder projects the welding requirement vector output by the word embedding layer into a low-dimensional space based on the multi-head attention mechanism layer for multi-head attention processing, and fuses the processing results to generate a welding requirement vector representation. The encoder is composed of multiple encoding layers with the same structure but different parameters stacked in sequence. Each encoding layer contains a multi-head attention mechanism layer and a feed-forward neural network layer. The multi-head attention mechanism layer projects the user welding requirement output vector of the word embedding layer into multiple low-dimensional spaces for multi-head attention processing. Each head maintains a separate Q / K / V weight matrix, generates a welding requirement query vector, key vector, and value vector through the corresponding weight matrix, and then performs multi-head embedding fusion on the results of each head to generate a richer representation, capturing the multi-dimensional user welding requirement vector in complex welding scenarios.

[0080] Step S02. Perform hybrid retrieval according to the welding requirement vector. The hybrid retrieval includes graph retrieval on the welding process knowledge graph and keyword text retrieval and vector retrieval on the welding process vector database respectively. The vector retrieval is to perform semantic matching between the welding requirement vector and the welding process vector database, and obtain a set of similar context retrieval results that meet the requirements according to the retrieval results of the hybrid retrieval. Feature extraction is performed on each retrieval result in the set of similar context retrieval results, and the features corresponding to the retrieval results obtained by different retrieval methods are fused using the self-attention mechanism. The fused features are reordered using the Transformer model to obtain the sorted set of similar context retrieval results.

[0081] To achieve efficient information retrieval, the present invention constructs two forms of a welding process diagram database and a welding process vector database based on a knowledge graph and text data. According to the welding requirement vector, graph retrieval, keyword text retrieval, and vector retrieval are respectively performed on the welding process diagram database and the welding process vector database. For the retrieval results, a feature depth fusion strategy based on the Transformer model is adopted to uniformly express the multi-source feature information of keyword retrieval, semantic vector retrieval, and graph structure retrieval, and a comprehensive retrieval result feature representation is constructed, which can significantly improve the accuracy and domain adaptability of the final ranking.

[0082] In this embodiment, welding cases, rule bases, welding process standards, specifications and other documents from different data sources are first collected, these documents are converted into text data and sliced, a pre-trained large model is used to extract entities and relationships from the sliced text, triples are obtained and a knowledge graph is constructed based on this. For the constructed welding process knowledge graph, the nodes are initialized and embedded through a trained Embedding model, and an improved GAT (Graph Attention Networks) network is used to extract features from the knowledge graph to generate a GAT feature map, thereby representing and obtaining the knowledge graph vector, which is saved to the welding process diagram database; when constructing the welding process vector database, the sliced welding process text data can be converted into a high-dimensional welding process vector representation through the Embedding model to obtain a knowledge base vector, and then the obtained welding process knowledge base vector and its corresponding text data are stored in the welding process vector database to complete the comprehensive construction of the welding process knowledge base.

[0083] In a specific application embodiment, the following steps can be used to construct the welding process diagram database:

[0084] Step S201. Input each welding process node into the GAT network, and calculate the self-attention coefficient for each welding process node in each layer of the graph attention layer. The self-attention coefficient is calculated based on the input features of the welding process node and the relationship type weight and uses GELU as the activation function. The relationship type weight is allocated according to the relationship type between the welding material and the process method.

[0085] In the traditional GAT, the attention of each attention head to node features is uniform and unweighted, resulting in insufficient feature fidelity and limited representation ability when dealing with high-dimensional complex relationships in the welding field. It is unable to effectively distinguish the differences between key relationships and secondary relationships in the welding process. To meet the specific requirements of relationships in the welding field, this embodiment improves the multi-head attention mechanism of the GAT network. By adopting a relationship-specific weight adjustment mechanism, dynamic weights are assigned to different attention heads based on specific relationship types in the welding field (such as the dependence between welding materials and process methods, the coupling degree between defect generation and parameters, etc.). In this way, the attention distribution of key relationships in the welding process can be significantly strengthened, while the impact of secondary relationships on the overall representation can be reduced, thereby generating a more high-fidelity feature representation.

[0086] Specifically, first, the self-attention coefficient of the input welding process embedded nodes is calculated. The input feature of the welding process node is , where represents the number of welding process nodes, represents the feature dimension of the welding process node. In each layer of the graph attention layer, the attention coefficient of the welding process node pair is calculated. To achieve specific attention to welding process relationships, this embodiment introduces a relationship type weight parameter to strengthen key relationships and weaken secondary relationships.

[0087] For example, for the th attention head, the relationship weight is introduced into the GAT attention calculation formula. Considering the complex characteristics of parameters in the welding process field, GELU is used as the activation function. By introducing an approximate Gaussian probability smoothing, GELU has smoothness when the input value is small. Compared with the original LeakyReLU, using the GELU activation function can provide a smoother activation characteristic, which helps to improve the model convergence speed. At the same time, it can partially retain negative value information, which is suitable for scenarios in the welding process field that need to capture subtle feature differences. Finally, the softmax function is used for normalization and LeakyReLU is added to provide non-linearity.

[0088] As an alternative implementation, the calculation expression of the self-attention coefficient can be expressed as:

[0089] (1)

[0090] where, represents the attention coefficient from the welding process node to the welding process node , represents the neighbor nodes of the welding process node , Represents the weight assigned according to the relationship types such as the dependence of welding materials and process methods or defects and the coupling degree of parameters. Represents the linear transformation weight matrix applied at each node. Represents the weight vector. Represents The activation function. 、 、 Respectively represent the input features of the i-th, j-th, and k-th welding process nodes.

[0091] Step S202. Extract welding process features based on the multi-head attention mechanism in each layer of the GAT graph attention layer. Define a hierarchical allocation function to divide the attention heads into macro attention heads and micro attention heads and perform weight allocation. The macro attention is used to focus on the process sequence of welding steps, and the micro attention heads are used to focus on material properties and / or defect generation reasons; perform weighted summation on the neighbor node features of each input welding process embedding node to extract welding process features.

[0092] The traditional GAT multi-head attention mechanism does not consider the differences in different information levels, while the welding process contains multiple levels of information (such as macroscopic process steps, microscopic material structures, and defects), which may lead to feature confusion between macroscopic information (such as process steps) and microscopic information (such as material structures and defects). Considering the above multi-level information characteristics of the welding process, this embodiment further adopts a hierarchical attention allocation mechanism. According to the multi-level information characteristics of the welding process (including macroscopic process steps, microscopic material structures, and defect generation processes), different levels of information are respectively focused on in different attention heads. For example, the attention to the optimization of the welding step process and the focus on the details related to material properties and defect associations are respectively modeled, which can optimize the allocation of attention heads on different levels of information and make the generated features have higher semantic discrimination. For example, some attention heads can focus on the sequence and process optimization of welding process steps, and other attention heads focus on the detailed features related to the association between welding material properties and defects. The GAT feature map generated in the above way can have higher domain characteristics and semantic discrimination, ensuring the accurate reflection of the complex correlations between processes in the welding process knowledge graph vector.

[0093] The welding process knowledge graph contains a large number of diverse relationship categories, such as the association between welding methods and defect types, the impact of material selection on the process, etc. Traditional GAT cannot directly capture the richness of such relationship categories in multi-head attention, which may lead to insufficient expression of complex relationships. In this embodiment, a domain relationship category embedding mechanism is further adopted to map different categories of relationships in the welding process into independent embedding vectors, and use this to guide the multi-head attention mechanism to perform cross-processing of relationship categories. The relationship vectors of different categories are used to dynamically adjust the feature extraction direction of the attention heads, thereby significantly improving the ability to depict the hierarchical feature correlation between welding process entities.

[0094] Specifically, considering that the welding process knowledge graph contains complex information at the macroscopic and microscopic levels, this embodiment introduces a hierarchical attention allocation strategy in the multi-head attention mechanism. In each layer of the GAT graph attention layer, the attention heads are divided into macroscopic and microscopic attention heads, and weight allocation is performed for different levels of information. At the same time, considering the richness of different relationship categories in the welding process knowledge graph, the relationship category embedding vectors are added to the attention calculation, and an embedding vector is allocated for each relationship type , so that the GAT feature map is more rich and delicate in the expression of multi-category associations, thereby achieving efficient capture of complex associations in the welding process knowledge graph.

[0095] In a specific application embodiment, as Figure 2 , Figure 3 shown, the following method can be used to improve GAT to implement the hierarchical attention allocation mechanism and the domain relationship category embedding mechanism:

[0096] a. Define a hierarchical allocation function to divide the attention heads into "process attention heads" that focus on the macroscopic process and "microscopic attention heads" that focus on microscopic material properties ;

[0097] b. For the macroscopic-level attention heads , focus on the process sequence of welding steps. For the microscopic-level attention heads , focus on material properties and the causes of defect generation;

[0098] c. Allocate an embedding vector for each relationship type , and by embedding it into the attention weights, enable each attention head to recognize and distinguish the complex correlations of these welding process relationships;

[0099] d. Perform weighted summation on the neighbor node features of the input welding process embedding nodes for feature extraction. Finally, the user welding requirement vector output by GAT is 。

[0100] For example, the following calculation formula can be adopted:

[0101] (2)

[0102] (3)

[0103] Wherein, is the linear transformation weight matrix of the k th attention head, is the attention coefficient from the welding process node to the welding process node ; are the hierarchical allocation functions for adjusting the macro-level attention head and the micro-level attention head respectively, and the hierarchical allocation function is used to adjust the number and allocation ratio of the corresponding attention heads, represent the macro-level attention head and the micro-level attention head respectively, is the relationship category embedding vector, is the non-linear activation function GELU, represent the output features of the macro-level attention head and the output features of the micro-level attention head of the i th welding process node respectively, represents the fusion result of the output features of the macro-level attention head and the output features of the micro-level attention head, indicates that the k th attention head is a macro-level attention head, indicates that the k th attention head is a micro-level attention head.

[0104] Step S203. Concatenate the welding process features extracted by the multi-head attention mechanism of each layer of graph attention layer to obtain a welding process node sequence.

[0105] Specifically, the welding process node features obtained after concatenating the welding process features extracted by the multi-head attention mechanism of each layer of graph attention layer can be expressed as:

[0106] (4)

[0107] Wherein, is the attention coefficient of the th attention head, K is the number of attention heads of the multi-head attention mechanism, which is specifically taken as K = 12 in this embodiment, is the allocation function for dynamically adjusting the number and allocation ratio of attention heads, is the output of GAT at thei The user welding requirement vector of a welding process node. By adopting the above formula, the node features can be further enhanced based on the multi-head attention mechanism. Through dynamically adjusting the number and allocation ratio of macro and micro attention heads to splice the macro-level attention head output features and micro-level attention head output features output by multiple attention heads together, and finally generating more expressive node features .

[0108] Step S204. Linearly transform the welding process node sequence to map it to the initial input dimension, and after adaptive normalization, process it through the Swish activation function to obtain the welding process node features.

[0109] Specifically, the output welding process node sequence can be input into a fully connected layer for linear transformation to map the high-dimensional welding process vector to the initial input dimension, and output after being processed through the Swish activation function after adaptive normalization. For example, the calculation expression can be represented as:

[0110] (5)

[0111] (6)

[0112] where is the normalized attention coefficient of the th attention head, is the relation category embedding vector, || represents the splicing operation, is the non-linear activation function GELU, is the output weight matrix, represents the result after transforming through the output weight matrix , represents after being activated function and the final output.

[0113] Step S205. Obtain the GAT feature map from each welding process node feature to represent the welding process knowledge graph vector, and construct the welding process knowledge graph.

[0114] Specifically, obtain the GAT feature map according to the obtained welding process node features, so as to represent the welding process knowledge graph vector. The welding process knowledge graph vector can be specifically represented in the following form:

[0115] (7)

[0116] where is the updated welding process feature matrix, representing the embedding representation of each node in the graph, is the dimension of the output feature.

[0117] In this embodiment, by adopting the above method for constructing a knowledge graph of the welding process field based on the improved GAT, aiming at the specific requirements of the relationships in the welding field, a relationship-specific weight adjustment mechanism is adopted. Key relationships such as the coupling degree with parameters are generated according to the dependence or defects of welding materials and process methods, and dynamic weights are assigned to the multi-head attention mechanism, which can significantly strengthen the modeling ability of key relationships and reduce the interference of secondary relationships on the overall representation. Further, a hierarchical attention allocation mechanism is adopted. According to the multi-level information characteristics of the welding process, the allocation of attention heads on different levels of information is optimized, so that the generated features have higher semantic discrimination. Further, a domain relationship category embedding mechanism is adopted. By generating independent embedding vectors for diverse relationship categories in the welding process, it guides the multi-head attention mechanism to dynamically adjust the feature extraction direction and comprehensively capture the complex relationship types among welding process entities, which can further improve the expression ability of complex relationships. Through the above methods, the improved GAT network can achieve significant improvements in domain characteristic expression, high fidelity of complex relationships, and accurate modeling of feature semantics, thereby optimizing the feature representation ability of the knowledge graph of the welding process field.

[0118] Based on the constructed knowledge graph of the welding process and the welding process vector database, after obtaining the welding demand vector of the user, keywords are extracted, and a hybrid retrieval method is adopted for the keywords, combining three retrieval methods: graph retrieval, keyword retrieval, and vector retrieval to achieve similar context information retrieval. Among them, graph retrieval is used for accessing structural information, keyword retrieval is used for retrieving text content, and vector retrieval is used for fast searching. When using the above three retrieval methods for retrieval, the similarity scores are calculated respectively, and the retrieval results of the three retrieval methods are comprehensively judged to determine whether similar context is retrieved. If similar context is retrieved, a welding process fine retrieval mechanism is further used to re-rank the retrieved similar context, ensuring that the retrieval results are gradually refined from the initial match to more accurate similar context, so as to achieve more accurate and comprehensive welding process information retrieval.

[0119] Specifically, the hybrid retrieval and the re-ranking of the retrieved similar context can be implemented according to the following steps:

[0120] Step S211. Perform graph retrieval on the knowledge graph of the welding process according to the welding demand vector.

[0121] Specifically, first, keywords are extracted from the welding demand vector, and the BFS algorithm etc. is used to locate the corresponding nodes and edges related to the extracted keywords.

[0122] Then, based on the keywords, perform a subgraph traversal in the welding process knowledge graph to search for subgraphs centered on the keywords within a preset number of hops N and expand the relevant context;

[0123] Adjust the vector dimension of the searched subgraph to make it consistent with the welding requirement vector;

[0124] Use the Euclidean distance and / or the inverted distance to calculate the similarity score between the searched subgraph and the welding requirement vector.

[0125] Optionally, for the obtained local subgraph S, the graph embedding method (Node2Vec) can be adopted, the vector dimension can be adjusted to be consistent with the user's welding requirement vector, and then the similarity score can be calculated through the Euclidean distance and the inverted distance.

[0126] Step S212. Perform keyword retrieval on the welding process vector database according to the welding requirement vector.

[0127] Specifically, extract keywords from the welding requirement vector, use a keyword retriever to perform keyword matching to achieve text retrieval, directly query the keywords in the welding process vector database through the welding process knowledge base document for the user's question, and calculate the similarity score between texts based on the keywords.

[0128] Traditional BM25 is a text similarity calculation method optimized based on probability theory. The value range of the calculated similarity is usually [0, 1], and the higher the value, the higher the matching degree. Considering the complexity and professionalism of the welding process, the document usually contains various types of information, such as material specifications, equipment parameters, process steps, and quality control standards, and these information may be distributed in different parts of the document, such as the title, abstract, text, and appendix; in addition, in the welding process query, some terms may be more important than others. For example, "stainless steel" in the query of "stainless steel welding" may be more important than "welding" because the material type has a significant impact on the process parameters. Therefore, in this embodiment, based on the original BM25 algorithm and combined with the particularity of the welding process field, considering the document field structure and dynamically adjusting the weight according to the importance of the query items, an improved algorithm BM25F+ is formed, and the improved algorithm BM25F+ is used to accurately calculate the text similarity and optimize the keyword retrieval effect of the welding process document.

[0129] Specifically, in this embodiment, a query term lower bound adjustment mechanism is introduced before IDF calculation to set a lower weight limit for each query term, ensuring that important query terms are not weakened due to document length differences in relevance calculation, thereby better capturing the core role of key terms such as welding methods and material properties. In addition, to reflect the field structure of welding process documents, the present invention introduces a field weight parameter to dynamically allocate the importance weights of different parts of the document (such as process descriptions and material specifications), so as to enhance the adaptability of the retrieval model to the structural characteristics of domain documents. At the same time, considering the complexity of the length distribution of welding process documents, the present invention adjusts the average document length in the traditional BM25 to a combined value of the average and the median, reducing the impact of extreme document lengths on the retrieval score, thereby more truly reflecting the typical characteristics of documents in the welding field. Through the above methods, the BM25F+ algorithm can more accurately capture the complexity and professionalism of welding process documents, greatly improving the accuracy and relevance of keyword retrieval, providing retrieval results that better meet the needs of users, and enhancing the practicality and user experience of the document retrieval system in the welding process field.

[0130] In a specific application embodiment, during the process of keyword querying of welding process documents in the welding process vector database, the similarity score between the keyword and the text in the welding process vector database can be calculated according to the following formula, and the calculation expression is:

[0131] (8)

[0132] (9)

[0133] (10)

[0134] Among them, represents the similarity score between the keyword and the welding process text in the welding process vector database, is the keyword for the user's welding requirement query, represents the welding process document in the welding process vector database, is the welding process document in the field weight, is the welding process document in the field part, is based on the query term dynamically adjusted parameter for importance in the welding process field, represents the keyword in the document appearance times, represents the document The length (i.e., the number of words in the document), represents the average length of all documents in the welding process vector database, represents the median of the lengths of all documents in the welding process vector database, and are adjustment parameters, for example, can be set to and . is the inverse document frequency of the keyword, used to measure the importance of the keyword in the entire knowledge base, is the total number of documents in the welding process vector database, represents the number of documents containing the keyword .

[0135] As shown in the above formula, by adding a constant before multiplying the entire , a lower bound can be set for each query term to ensure that the relevance score of important query terms will not be reduced due to the document length. . The value of can be adjusted according to the industry standards in the welding field and the welding requirements of users. For example, if some query terms are considered more important than others, higher values are assigned to these terms. At the same time, by introducing a new parameter , the diversity of the document structure can be considered, which is used to represent the weight of the field in the welding process document . By performing weighted summation on the scores of multiple fields, the influence of different parts of the document on the matching score can be better reflected. In addition, to more accurately reflect the real situation of the welding process document, by adjusting the mean of the document length to , the robustness and accuracy of the model when processing welding process-related documents can be improved. By introducing the parameter of the median

[0136]

[0137] , the influence of extreme values on the document length can be effectively reduced, thus more truly reflecting the characteristics of typical documents, and the problem of uneven lengths of material property and process parameter documents faced in the welding field can be solved. Specifically, the similarity score between the welding demand vector and the welding process vector database can be calculated by cosine similarity, and the calculation formula can be expressed as:

[0138] (11)

[0139] Among them, represents the welding requirement vector of the user, represents the semantic vector of the text in the welding process vector database. The value range of the cosine similarity is [0, 1]. The closer the value is to 1, the more similar the two texts are semantically.

[0140] Step S214. Obtain a set of similar context retrieval results that meet the requirements according to the retrieval results of the hybrid retrieval.

[0141] In a specific application embodiment, a weighted calculation method can be used to comprehensively process the retrieval results of the hybrid retrieval to obtain a set of similar context retrieval results that meet the requirements. The specific steps are as follows:

[0142] Step S241. Respectively obtain the graph retrieval similarity obtained by performing graph retrieval on the welding requirement vector, the keyword retrieval similarity obtained by performing keyword retrieval, and the vector retrieval similarity obtained by performing vector retrieval.

[0143] Step S242. Weight the graph retrieval similarity, the keyword retrieval similarity, and the vector retrieval similarity to obtain a comprehensive similarity score;

[0144] Step S243. Screen out the retrieval results with the highest comprehensive similarity score or greater than a preset threshold to obtain a set of retrieval results.

[0145] Specifically, to combine the similarity scores of graph retrieval, keyword retrieval, and vector retrieval, weight coefficients , and are introduced. By weighted calculation of the similarity scores of the three, a comprehensive similarity score is formed. When is greater than the preset value, the system considers that similar context has been retrieved; otherwise, the system considers that no similar context has been retrieved, and a rule-based inference engine can be used to infer similar context.

[0146] For example, the calculation expression of the comprehensive similarity score can be expressed as:

[0147] (12)

[0148] Among them, , and represent the weights of the graph retrieval similarity, the keyword retrieval similarity, and the vector retrieval similarity respectively, and satisfy . By adjusting the values of , and , the attention degree of the system to graph retrieval, keyword retrieval, and vector retrieval can be flexibly adjusted.

[0149] Calculate the comprehensive similarity score in the above manner After that, if is greater than the preset value, the highest corresponding set of three parts of retrieval content will be returned from the welding process knowledge base

[0150] Step S215. Extract features from each retrieval result in the similar context retrieval result set respectively, and use the self-attention mechanism to fuse the features corresponding to the retrieval results obtained by different retrieval methods. Then use the Transformer model to re-rank the fused features to obtain the sorted similar context retrieval results

[0151] The preliminary result set obtained through step S214 contains a large amount of repetitive and broad content. In this embodiment, a fine-grained retrieval mechanism for welding processes based on hybrid retrieval is further adopted to ensure that the retrieval results are gradually refined from preliminary matching to more accurate similar contexts, further improving the retrieval accuracy and meeting the specific information requirements of welding processes and the high fidelity of complex association relationships

[0152] Specifically, first standardize the initially returned retrieval content set (text data, vectors), convert different forms of data into vector form uniformly, screen out duplicate vectors, and store the remaining vectors in , and on the basis of , perform welding process feature extraction, and then adopt a deep fusion strategy for hybrid retrieval features based on Transformer for deep feature fusion, so that the results obtained from the hybrid retrieval of welding processes (graph retrieval, text retrieval, and vector retrieval) can be deeply fused, construct a comprehensive representation of retrieval result features, effectively combine the feature information from different retrieval methods, and improve the accuracy of the final ranking

[0153] In a specific application embodiment, feature extraction and feature fusion can be implemented by the following steps

[0154] Step S251. Standardize the retrieval result set and screen out duplicate vectors to obtain the remaining vectors ;

[0155] Standardize the initially returned retrieval content set (text data, vectors), convert different forms of data into vector form uniformly, screen out duplicate vectors, and store the remaining vectors in .

[0156] Step S252. For the retrieval results in the remaining vectors , extract the features corresponding to the retrieval results of graph retrieval, keyword text retrieval, and vector retrieval respectively

[0157] Step S253. Use the self-attention mechanism to fuse the features of the retrieval results corresponding to graph retrieval, keyword text retrieval, and vector retrieval to obtain fused features.

[0158] Specifically, the self-attention mechanism can be used to fuse the features of the retrieval results corresponding to graph retrieval, keyword text retrieval, and vector retrieval according to the following formula to obtain fused features:

[0159] (13)

[0160] (14)

[0161] (15)

[0162] Among them, represents the retrieval result feature matrix corresponding to keyword text retrieval , graph retrieval , and vector retrieval , represents the attention weight, is the retrieval feature dimension, represents the fused features obtained by fusion, realizing the weighted fusion of the three retrieval result features.

[0163] Step S254. Input the fused features into the pre-trained Transformer model encoder. In the Transformer model encoder, the KAN layer is used to process the output of the multi-head self-attention mechanism layer, and the retrieval result features of each welding process are obtained according to the feature representation processed by the self-attention mechanism and the KAN layer and the welding requirement type.

[0164] With its efficient fitting ability for high-dimensional non-linear relationships, the KAN network can more accurately capture the deep correlation relationships among material properties, process parameters, and defects in the welding process. In this embodiment, further, on the basis of the original Transformer model encoder, the KAN network is introduced to replace the original feed-forward network part to enhance the model's ability to express complex feature relationships in the welding process, thereby enhancing the ability to capture complex feature relationships.

[0165] Specifically, first, define the multi-head self-attention part in the Transformer model encoder structure. The specific calculation formula can be expressed as:

[0166] (16)

[0167] Among them, , is the number of multi-heads. is a linear transformation matrix used to convert the concatenated result back to the same dimension as the original input sequence.

[0168] Then, KAN is used to replace the traditional feed-forward neural network, and its specific calculation formula can be expressed as:

[0169] (17)

[0170] where, is the output from the multi-head self-attention mechanism, represents the i-th layer of the entire KAN network. The input dimension of each layer of KAN is and the output dimension is , consists of nin nout learnable activation functions as follows:

[0171] (18)

[0172] Then, the output of each layer of the Transformer model encoder is represented as:

[0173] (19)

[0174] where, represents the output of the Transformer model encoder, represents the output of the multi-layer self-attention mechanism, represents the output of the KAN layer.

[0175] Input into the trained Transformer model encoder to calculate the sequence feature representation:

[0176] (20)

[0177] Then, use the trained Transformer model to evaluate :

[0178] According to the user's demand type (such as welding method, material selection, etc.), the model refines and evaluates the features of each welding process retrieval result. For example, the expression of the features of each welding process retrieval result is:

[0179] (21)

[0180] where, represents the weight matrix determined according to the welding demand type, and ⊙ represents element-wise multiplication;

[0181] Then, according to the retrieval result features of each welding process Adjust the remaining vector For the retrieval result weights corresponding to each retrieval result in, perform re - sorting, and dynamically adjust the retrieval result weight distribution according to the evaluation results to better meet the user's expectations. The calculation formula is:

[0182] (22)

[0183] Among them, represents the final re - sorted result, represents the learned weight matrix, is the bias term, represents softmax function.

[0184] Step S255. Adjust the remaining vector according to the retrieval result features of each welding process For the retrieval result weights corresponding to each retrieval result in to perform re - sorting.

[0185] Specifically, the finally returned by the Transformer model is sorted from high to low for to generate the final sorted set which is returned to the subsequent pre - trained large model to ensure that the welding process information finally provided meets the specific information requirements of the welding process.

[0186] In this embodiment, by adopting the Rerank mechanism to re - sort the fused , it can better capture the complex features in the welding field. Further, a method for building and training a Transformer re - sorting model based on KAN can be adopted. The model is customized and trained using domain - specific annotation data (such as welding materials, process parameters, defect types, etc.) for training, which can enhance the sensitivity of the model to welding - related content.

[0187] Step S03. Input the sorted similar context retrieval results into the pre - trained large model to obtain the intelligent recommendation result of the welding process plan.

[0188] Specifically, the similar context can be optimized with the initial welding requirements input by the user. The optimization process can include removing duplicate information, correcting errors, unifying formats and styles: removing duplicate information between the similar context and the user's welding requirements, such as the same description of welding methods or process steps, etc.; then integrating the retrieved similar context with the welding requirement vector into a welding process description, and then inputting it into the Prompt template together to construct the Prompt input information, and inputting it into the pre - trained large model, and then adjusting the Prompt template according to the results of the large model.

[0189] Furthermore, the welding process knowledge base can be updated and the retrieval process can be dynamically adjusted according to the welding process plan generated by the pre-trained large model. Specifically, an optimized Prompt template can be used to generate a welding process plan through the large model, forming a welding process expert system. After a period of generating the welding process plan, user feedback information is collected, and the weights of graph retrieval, keyword text retrieval, and vector retrieval are adjusted according to the user feedback information to improve the retrieval effect. For example, the information that the user is satisfied with is used as a positive example, and the information that the user is not satisfied with is used as a negative example, increasing the weight of the retrieval method corresponding to the positive example and decreasing the weight of the retrieval method corresponding to the negative example.

[0190] This embodiment further provides an electronic device, including a processor and a memory. The memory is used to store a computer program, and the processor is used to execute the computer program to perform the method as described above.

[0191] It can be understood that the above method of this embodiment can be executed by a single device, such as a computer or a server, etc., or can also be applied to a distributed scenario where multiple devices cooperate with each other to complete. In the case of a distributed scenario, one of the multiple devices can only execute one or more of the above steps of this embodiment, and the multiple devices interact with each other to complete the above method. The processor can be implemented in the form of a general-purpose CPU, a microprocessor, an application-specific integrated circuit, or one or more integrated circuits, etc., and is used to execute relevant programs to implement the above method of this embodiment. The memory can be implemented in the form of a read-only memory ROM, a random access memory RAM, a static storage device, and a dynamic storage device, etc. The memory can store an operating system and other application programs. When implementing the above method of this embodiment through software or firmware, the relevant program codes are stored in the memory and are called and executed by the processor.

[0192] This embodiment further provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, it implements the method as described above.

[0193] Those skilled in the art should understand that the above embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code. The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the embodiments of the present invention. It should be understood that each flow and / or block in the flowchart and / or block diagram, as well as the combination of flows and / or blocks in the flowchart and / or block diagram, can be realized by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the functions specified in the process Figure 1 one process or multiple processes and / or blocks Figure 1 These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including instruction means that implement the functions specified in the process Figure 1 one process or multiple processes and / or blocks Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process. Thus, the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in the process Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks

[0194] The above are only the preferred embodiments of the present invention and do not impose any form of limitation on the present invention. Although the present invention has been disclosed above with the preferred embodiments, it is not intended to limit the present invention. Therefore, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention shall fall within the scope of the protection of the technical solution of the present invention.

Claims

1. A hybrid retrieval method for intelligent recommendation of welding process plans, characterized in that the steps Including: Obtain the welding requirement information of the user and vectorize it to form a welding requirement vector, where the welding requirement vector includes welding method, welding type, and welding parameters; Perform hybrid retrieval according to the welding requirement vector. The hybrid retrieval includes graph retrieval of the welding process knowledge graph and keyword text retrieval and vector retrieval of the welding process vector database respectively. The vector retrieval is to perform semantic matching between the welding requirement vector and the welding process vector database, and obtain a set of similar context retrieval results that meet the requirements according to the retrieval results of the hybrid retrieval; perform feature extraction on each retrieval result in the set of similar context retrieval results, and use the self-attention mechanism to fuse the features corresponding to the retrieval results obtained by different retrieval methods, and use the Transformer model to reorder the fused features to obtain the sorted similar context retrieval results; Input the sorted similar context retrieval results into a pre-trained large model to obtain an intelligent recommendation result of the welding process plan; It also includes constructing a welding process knowledge graph, including: Input each welding process node into the GAT network, and calculate the self-attention coefficient for each welding process node in each layer of the graph attention layer. The self-attention coefficient is calculated based on the input features of the welding process node and the relationship type weight using GELU as the activation function, and the relationship type weight is assigned according to the relationship type between the welding material and the process method; Extract welding process features based on the multi-head attention mechanism in each layer of the GAT graph attention layer. Define a hierarchical allocation function to divide the attention heads into macro attention and micro attention heads and assign weights. The macro attention is used to focus on the process sequence of the welding steps, and the micro attention heads are used to focus on material characteristics and / or defect generation reasons; perform weighted summation on the neighbor node features of each input welding process embedding node to perform feature extraction to obtain the welding process features; Concatenate the welding process features extracted by the multi-head attention mechanism in each layer of the graph attention layer to obtain a welding process node sequence; Perform a linear transformation on the welding process node sequence to map it to the initial input dimension, and after adaptive normalization, process it through the Swish activation function to obtain welding process node features; Obtain a GAT feature map from each of the welding process node features to represent the welding process knowledge graph vector, and construct the welding process knowledge graph.

2. The hybrid retrieval method for intelligent recommendation of welding process plans according to claim 1, characterized in that The calculation expression of the self-attention coefficient is: , Among them, represents the attention coefficient from the welding process node to the welding process node ; represents the neighbor nodes of the welding process node ; represents the relationship type weight between the welding process node and the welding process node ; represents the weight matrix of the linear transformation applied to each node, represents the weight vector, represents the activation function, , , represent the input features of the i-th, j-th, and k-th welding process nodes respectively; The calculation expression of the welding process feature is: , , , Among them, is the linear transformation weight matrix of the k th attention head, are the hierarchical allocation functions for adjusting the macro-level attention head and the micro-level attention head respectively. The hierarchical allocation function is used to adjust the number and allocation ratio of the corresponding attention heads, represent the macro-level attention head and the micro-level attention head respectively, is the relationship category embedding vector, is the non-linear activation function GELU, represent the output features of the macro-level attention head and the output features of the micro-level attention head of the i th welding process node respectively, represents the fusion result of the output features of the macro-level attention head and the output features of the micro-level attention head, represents that the k th attention head is a macro-level attention head, represents that the k th attention head is a micro-level attention head; The calculation expression of the welding process node features obtained after concatenating the welding process features extracted by the multi-head attention mechanism in each layer of the graph attention layer is: , , , Among them, is the attention coefficient of the th attention head, is the allocation function used to adjust the number and allocation ratio of attention heads, K represents the number of attention heads, || represents the concatenation operation, is the non-linear activation function GELU; is the output weight matrix, is the user welding requirement vector of the i th welding process node output by GAT, represents the result after transformation of through the output weight matrix , represents after activation function of the final output.

3. The hybrid retrieval method for intelligent recommendation of welding process plans according to claim 1, characterized in that, The graph retrieval of the welding process knowledge graph according to the welding requirement vector includes: Extract keywords from the welding requirement vector, and locate the corresponding nodes and edges according to the extracted keywords; Perform subgraph traversal in the welding process knowledge graph based on the keywords, and search for subgraphs centered on the keywords within a preset number of hops; Adjust the vector dimension of the retrieved sub-graph to be consistent with the welding requirement vector; Calculate the similarity score between the retrieved sub-graph and the welding requirement vector using Euclidean distance and / or reverse distance.

4. The hybrid retrieval method for intelligent recommendation of welding process plans according to claim 1, characterized in that, Performing keyword text retrieval on the welding process vector database according to the welding requirement vector includes: Extract keywords from the welding requirement vector; Query keywords in the welding process documents in the welding process vector database, calculate the similarity score between the keywords and the text in the welding process vector database, and the calculation expression is: , , , Among them, represents the keyword and the similarity score between the welding process text in the welding process vector database is the weight of the field in the welding process document is a part of the field in the welding process document is a parameter dynamically adjusted based on the importance of the query keyword in the welding process field, represents the keyword in the document the number of occurrences, represents the document length, represents the average length of all documents in the welding process vector database, represents the median of the lengths of all documents in the welding process vector database, and are adjustment parameters, is the inverse document frequency of the keyword, is the total number of documents in the welding process vector database, represents the number of documents containing the keyword is 5. The hybrid retrieval method for intelligent recommendation of welding process plans according to any one of claims 1 to 4, characterized in that, The obtaining the set of similar context retrieval results that meet the requirements according to the retrieval results of the hybrid retrieval includes: Obtain the graph retrieval similarity obtained by performing graph retrieval on the welding requirement vector, the keyword retrieval similarity obtained by performing keyword retrieval, and the vector retrieval similarity obtained by performing vector retrieval, respectively; Weight the graph retrieval similarity, the keyword retrieval similarity, and the vector retrieval similarity to obtain a comprehensive similarity score; Filter out the retrieval results with the highest comprehensive similarity score or greater than a preset threshold to obtain the set of retrieval results.

6. The hybrid retrieval method for intelligent recommendation of welding process plans according to any one of claims 1 to 4, characterized in that The extracting features from each retrieval result in the set of similar context retrieval results respectively, and fusing the features corresponding to the retrieval results obtained by different retrieval methods using the self-attention mechanism, and re-ranking the fused features using the Transformer model includes: Normalize the retrieved result set and filter out duplicate vectors to obtain the remaining vectors ; For the remaining vectors in the retrieval results, extract the features of the retrieval results corresponding to figure retrieval, keyword text retrieval, and vector retrieval respectively; Use the self-attention mechanism to fuse the features of the retrieval results corresponding to graph retrieval, keyword text retrieval, and vector retrieval to obtain fused features; Input the fused features into the pre-trained Transformer model encoder. In the Transformer model encoder, the KAN layer is used to process the output of the multi-head self-attention mechanism layer, and according to the feature representation after being processed by the self-attention mechanism and the KAN layer and the welding requirement type, obtain the retrieval result features of each welding process; Adjust the residual vector according to the retrieval result features of each welding process The retrieval result weights corresponding to the retrieval results in are re - sorted.

7. The hybrid retrieval method for intelligent recommendation of welding process plans according to claim 6, characterized in that, Use the self-attention mechanism to fuse the features of the retrieval results corresponding to graph retrieval, keyword text retrieval, and vector retrieval according to the following formula to obtain fused features: , , , Among them, represents keyword text retrieval , figure retrieval and vector retrieval corresponding retrieval result feature matrix, represents the attention weight, is the retrieval feature dimension, represents the fused feature obtained by fusion; The output of each layer of the Transformer model encoder is represented as: , Among them, represents the output of the Transformer model encoder, represents the output of the multi-layer self-attention mechanism, represents the output of the KAN layer.

8. The hybrid retrieval method for intelligent recommendation of welding process plans according to claim 7, characterized in that Retrieval result features of each welding process The expression is as follows: , Among them, represents the weight matrix determined according to the type of welding requirement, and ⊙ represents element-wise multiplication; According to the retrieval result characteristics of each welding process Adjust the remaining vectors The calculation expression for re - sorting by adjusting the retrieval result weights corresponding to each retrieval result in it is as follows: , Among them, represents the final reordering result, represents the learned weight matrix, is the bias term, represents softmax function.

9. An electronic device, comprising a processor and a memory, the memory being used for storing a computer program, characterized in that, The processor is configured to execute the computer program to execute the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Method and system for enhancing RAG questions and answers through mixed retrieval method

    CN118627625A

  • Welding process parameter recommendation method for enhancing large model by using knowledge graph retrieval

    CN119578525A