Hybrid retrieval method and equipment for intelligent recommendation of welding process scheme
Through the hybrid search method combined with graph search, keyword text search and vector search, the self-attention mechanism and the Transformer model are used to perform feature fusion and reordering, which solves the problems of low efficiency and low accuracy of intelligent recommendation of welding process schemes in the existing technology, and achieves efficient and accurate recommendation of welding process schemes.
Patent Information
- Application Number
- CN202510488002.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-18
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2045-04-18
AI Technical Summary
The prior art has problems such as low efficiency, strong subjectivity and poor repeatability in the intelligent recommendation of welding process solutions, and it is difficult to meet the production requirements of efficient, accurate and automated.
A hybrid search method is adopted, combining graph search, keyword text search and vector search, and feature fusion and reordering are performed through self-attention mechanism and Transformer model to quickly and accurately retrieve context information related to user welding needs.
It realizes efficient and accurate intelligent recommendation of welding process solutions, improves search accuracy and efficiency, and meets the welding needs of complex structural parts and large-thickness materials.
Smart Images

Figure CN120013209A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of multi-layer and multi-pass welding, and in particular to a hybrid retrieval method and device for intelligently recommending welding process solutions. Background Art
[0002] The welding process is to achieve atomic bonding between two workpieces through heating, pressurization, etc., to achieve the connection of metal or non-metallic materials. The multi-layer and multi-pass welding process is to improve the welding quality and efficiency by dividing the weld into multiple layers and multiple passes, and welding layer by layer and pass by pass. It can be applied to the welding of thick plates, large components and complex structures. The multi-layer and multi-pass welding method can achieve the welding of complex structural parts and thick materials, ensuring the strength and durability of the joints, but the complexity and technical requirements of the corresponding welding process are also higher. In the multi-layer and multi-pass welding manufacturing process, the choice of welding process has a vital impact on welding quality, production cost and efficiency. However, traditional welding processes are usually manually formulated, for example, experienced welding engineers formulate welding plans one by one according to factors such as material properties, structural shape, and environmental conditions. This type of manual formulation of welding processes will have problems such as low efficiency, strong subjectivity, and poor repeatability, which is difficult to meet the current efficient, precise, and automated production requirements.
[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, the general large language model may lack authenticity and accuracy when generating results in the face of professional problems, and may produce illusions. If the expert system of welding process solutions is established by using fixed rules and parametric modeling, it will be difficult to adapt to complex and changeable welding needs, and it will not be possible to provide personalized and accurate welding solutions for different user input welding requirements. Therefore, on the basis of the large model, by using the welding process solution sample data and welding process-related rules, a vertical field large model for the generation of welding process solutions is constructed, which can generate welding process solutions with stronger professionalism and higher output quality for the welding process field.
[0004] At the same time, in order to use the big model technology to generate accurate intelligent recommendations, it is necessary to provide the Promapt template with clear task requirement information and necessary context information so that the big model can understand the task. Therefore, it is necessary to find relevant context information through a large amount of retrieval work based on the input information provided by the user, and then use the big model to generate the best recommendation results based on the retrieval 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 are not suitable for welding process information retrieval in nonlinear and diversified scenarios. Therefore, the actual retrieval efficiency and accuracy are not high. In addition, the welding process of multi-layer and multi-pass welding is relatively complex. The retrieval of welding process solutions for multi-layer and multi-pass welding requires complex associations 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 is: in response to 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, which has a simple implementation method, high retrieval efficiency and accuracy, and strong reliability and flexibility. It can quickly and accurately retrieve relevant contexts for different user welding needs, and assist large models to quickly generate accurate welding process recommendation plans.
[0006] In order to solve the above technical problems, the technical solution proposed by the present invention is: A hybrid retrieval method for intelligent recommendation of welding process schemes, comprising the following steps: Acquire the welding requirement information of the user and vectorize it to form a welding requirement vector, wherein the welding requirement vector includes a welding method, a welding type and welding parameters; A hybrid search is performed according to the welding requirement vector, wherein the hybrid search includes graph search on the welding process knowledge graph and keyword text search and vector search on the welding process vector database, wherein the vector search is to semantically match the welding requirement vector with the welding process vector database, and obtain a similar context search result set that meets the requirements according to the search results of the hybrid search; feature extraction is performed on each search result in the similar context search result set, and the features corresponding to the search results obtained by different search methods are fused using a self-attention mechanism, and the fused features are reordered using a Transformer model to obtain sorted similar context search results; The sorted similar context retrieval results are input into the pre-trained large model to obtain intelligent recommendation results for welding process solutions.
[0007] Furthermore, 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 of each welding process node in each 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. The relationship type weight is allocated according to the relationship type between the welding material and the process method. In each GAT graph attention layer, the welding process features are extracted based on the multi-head attention mechanism, and a hierarchical allocation function is defined to divide the attention heads into macro attention and micro attention heads and perform weight allocation. The macro attention is used to focus on the process sequence of the welding steps, and the micro attention head is used to focus on the material characteristics and / or the causes of defect generation; the neighbor node features of each input welding process embedded node are weighted summed to perform feature extraction to obtain the welding process features; The welding process features extracted by the multi-head attention mechanism of each graph attention layer are spliced to obtain the welding process node sequence; The welding process node sequence is linearly transformed to be mapped to the initial input dimension, and after adaptive normalization, the welding process node features are obtained by processing with a Swish activation function; A GAT feature graph is obtained from the features of each welding process node to represent a welding process knowledge graph vector, thereby constructing the welding process knowledge graph.
[0008] Furthermore, the calculation expression of the self-attention coefficient is: , in, Indicates welding process node To welding process node The attention coefficient, Indicates welding process node The neighbor nodes of Indicates welding process node Welding process node The relationship type weight, represents the linear transformation weight matrix applied at each node, represents the weight vector, express Activation function, , , They represent the input features of the i-th, j-th, and k-th welding process nodes respectively; The calculation expression of the welding process characteristics is: , , , in, It is k The linear transformation weight matrix of the attention heads, It is the welding process node To welding process node The attention coefficient, They are hierarchical allocation functions for adjusting the macro-level attention heads and micro-level attention heads, respectively, to adjust the number and allocation ratio of the corresponding attention heads. They represent macro-level attention heads and micro-level attention heads respectively. is the relation category embedding vector, is the nonlinear activation function GELU, Respectively represent i The macro-level attention head output features, micro-level attention head output features, and the fusion results of the macro-level attention head output features and micro-level attention head output features of each welding process node are shown in Figure 2. Indicates k The attention heads are macro-level attention heads. Indicates k The attention heads are micro-level attention heads; 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 the graph attention layer is: , , , in, It is The attention coefficient of the 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, It is the nonlinear activation function GELU; is the output weight matrix, It is the output of GAT. i The user welding demand vector of each welding process node, Represented by the output weight matrix right The result after transformation is express After activation The final output after the function.
[0009] Further, performing graph retrieval on the welding process knowledge graph according to the welding requirement vector includes: Extracting keywords from the welding requirement vector, and locating corresponding nodes and edges according to the extracted keywords; Based on the keyword, a subgraph is traversed in the welding process knowledge graph to search for a subgraph centered on the keyword within a preset number of hops; Adjusting the vector dimension of the subgraph obtained by searching to make it consistent with the welding requirement vector; The similarity score between the searched subgraph and the welding requirement vector is calculated using Euclidean distance and / or inverse distance.
[0010] Further, performing keyword text retrieval on the welding process vector database according to the welding requirement vector includes: Extracting keywords from the welding requirement vector; Perform keyword query on welding process documents in welding process vector database, calculate the similarity score between keywords and texts in welding process vector database, and the calculation expression is: , , , in, Indicates keywords Welding process text in welding process vector database The similarity score between Welding procedure documentation Middle Field The weight of Welding procedure documentation Middle Field part, Based on the query terms Dynamically adjusted parameters of importance in the field of welding processes, Indicates keywords In the documentation The number of occurrences in Representation Document Length, represents the average length of all documents in the welding process vector database, represents the median length of all documents in the welding process vector database, and is the adjustment parameter, is the inverse document frequency of the keyword, is the total number of documents in the welding process vector database, Indicates that it contains keywords The number of documents. Furthermore, obtaining a similar context search result set that meets the requirements based on the search results of the hybrid search includes: Respectively obtaining a graph retrieval similarity obtained by performing a graph retrieval on the welding requirement vector, a keyword retrieval similarity obtained by performing a keyword retrieval, and a vector retrieval similarity obtained by performing a vector retrieval; Weighting the graph retrieval similarity, the keyword retrieval similarity and the vector retrieval similarity to obtain a comprehensive similarity score; The search results with the highest comprehensive similarity score or greater than a preset threshold are screened out to obtain the search result set.
[0011] Furthermore, the extracting features of each search result in the similar context search result set respectively, fusing features corresponding to the search results obtained by different search methods using a self-attention mechanism, and reordering the fused features using a Transformer model includes: The search result set is normalized and repeated vectors are removed to obtain the remaining vectors. ; For the remaining vector The features of the corresponding search results of graph search, keyword text search and vector search are extracted respectively; The self-attention mechanism is used to fuse the features of the corresponding search results of graph retrieval, keyword text retrieval and vector retrieval to obtain fused features; The fused features are input into a pre-trained Transformer model encoder, in which the output of the multi-head self-attention mechanism layer is processed using a KAN 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; Adjust the remaining vector according to the search result characteristics of each welding process The search result weights corresponding to each search result in are used for re-ranking.
[0012] Furthermore, the self-attention mechanism is used to fuse the features of the corresponding search results of graph retrieval, keyword text retrieval, and vector retrieval according to the following formula to obtain the fused features: , , , in, Represents keyword text retrieval , Graph Retrieval And vector search The corresponding retrieval result feature matrix, represents the attention weight, is the retrieval feature dimension, represents the fusion feature obtained by fusion; The output of each layer of the Transformer model encoder is expressed as: , in, 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.
[0013] Furthermore, the search result characteristics of each welding process The expression is: , in, represents the weight matrix determined according to the welding requirement type, ⊙ represents element-by-element multiplication; Search result characteristics by each welding process Adjust the remaining vector The calculation expression for re-ranking the search result weights corresponding to each search result in is: , in, Represents the final reordering result, represents the learned weight matrix, is the bias term, express softmax function.
[0014] An electronic device comprises a processor and a memory, wherein the memory is used to store a computer program, and the processor is used to execute the computer program to perform the above method.
[0015] Compared with the prior art, the beneficial effect of the present invention lies in that: the present invention realizes similar context retrieval of user welding demand vector by adopting hybrid retrieval welding process fine retrieval mechanism, and forms preliminary similar context retrieval results by adopting graph retrieval, keyword text retrieval and vector retrieval according to the user's welding demand vector, and then adopts self-attention mechanism to perform deep feature fusion on the similar context retrieval results obtained by the three retrieval methods, and then reorders the fused features based on the Transformer model, and gradually refines the preliminary match into more accurate similar context, and can integrate multiple retrieval methods to quickly and accurately retrieve context information related to different user welding requirements, and can improve the retrieval accuracy while ensuring the retrieval efficiency, meet the specific information requirements of the welding process and the high fidelity of complex correlations, so as to combine the advantages of knowledge retrieval and generation technology, improve the system's adaptability to complex requirements, realize accurate optimization of welding process schemes from knowledge extraction to context generation, and provide flexible, efficient and intelligent solutions for intelligent recommendation of welding process schemes. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a schematic diagram of the implementation flow of the hybrid retrieval method for intelligent recommendation of welding process solutions in this embodiment.
[0017] Figure 2 It is a schematic diagram of the GAT network weight generation principle adopted in this embodiment.
[0018] Figure 3 It is a schematic diagram of the principle of the GAT network feature output process adopted in this embodiment. DETAILED DESCRIPTION
[0019] The present invention is further described below in conjunction with the accompanying drawings and specific preferred embodiments, but the protection scope of the present invention is not limited thereby.
[0020] 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, among which 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 welding quality and efficiency, but also reduce welding costs. The vertical field large model is a large language model optimized for specific professional fields. On the basis of the large model, by using the welding process plan sample data and welding process-related rules, a vertical field large model for the generation of welding process plans is constructed, which can generate welding process plans with stronger professionalism and higher output quality for the welding process field.
[0021] Actual user needs are often complex and diverse, and there will be long-term dependencies between process parameters, and various types of data may be highly fragmented. The traditional retrieval method that relies on knowledge bases and rule engines is suitable for standardized scenarios, while welding processes are usually nonlinear and diverse scenarios. Welding process retrieval also involves complex relationships between materials, process parameters and defects. The traditional retrieval method that relies on knowledge bases and rule engines will show significant deficiencies in the retrieval of complex welding process information in nonlinear and diverse scenarios, such as low accuracy of retrieval results, limited quality of context generation, and difficulty in adapting to user personalized needs.
[0022] The present invention realizes similar context retrieval of user welding requirement vectors by adopting a hybrid retrieval welding process fine retrieval mechanism, and forms preliminary similar context retrieval results by adopting three retrieval methods, namely graph retrieval, keyword text retrieval and vector retrieval, according to the user's welding requirement vector. 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 then the fused features are reordered based on the Transformer model, and the preliminary matching is gradually refined into more accurate similar contexts. The present invention can fuse multiple retrieval methods to quickly and accurately retrieve context information related to different user welding requirements, and can improve the retrieval accuracy while ensuring the retrieval efficiency, meet the specific information requirements of the welding process and the high fidelity of complex correlations, thereby combining the advantages of knowledge retrieval and generation technology, and can improve the system's adaptability to complex requirements, realize accurate optimization of welding process solutions from knowledge extraction to context generation, and provide a flexible, efficient and intelligent solution for intelligent recommendation of welding process solutions.
[0023] like Figure 1 As shown, the steps of the hybrid retrieval method for intelligent recommendation of welding process solutions in this embodiment include: Step S01: Obtain the welding requirement information of the user and form a welding requirement vector after vectorization. The welding requirement vector includes welding method, welding type and welding parameters.
[0024] 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 to retain useful information; preprocessing can include removing stop words, standardizing welding terms, segmentation, synonym replacement, and removing stop words irrelevant to the welding process, such as "of", "is", "how" and other words that do not affect the search results, to ensure that key information is retained. Furthermore, if the semantic ambiguity of the welding requirement is identified, the query can be rewritten according to the specific welding process involved. If the system identifies that there are specified terms or expressions in the fuzzy requirements, it can be expanded using the existing knowledge base, automatically supplementing the relevant context, and generating more precise questions; then with the help of the pre-trained large model, the dynamic interaction mechanism is used to adjust the feedback content according to the user's context and welding application scenario, so that the final reasoning and recommendation results are more in line with the complexity and sophistication of the actual welding requirements. For example, according to the necessary conditions for generating a welding process plan, check whether the user's welding requirement input is missing. If it is missing, the user is required to further supplement it, and confirm with the user that the welding requirement vector is complete and correct.
[0025] Furthermore, the user welding demand vector improved by the large model can be input into the Embedding model, and the user welding demand vector can be converted into a vector representation using the Embedding model, so as to capture the semantic or feature relationship between the data through the vector representation.
[0026] Specifically, the Embedding model includes an input layer, a word embedding layer, an encoder and an output layer connected in sequence. The input layer accesses the sliced user welding requirement data and tokenizes it, decomposes the user welding requirement data into multiple tokens, arranges each token in sequence to form a sequence, and converts each token in the sequence into a corresponding ID using a vocabulary to form a corresponding ID serialization result and output it to the word embedding layer; the word embedding layer maps the words, segments and positions in the ID serialization result to a welding requirement word vector representation of a fixed dimension, and uses the weights calculated according to the attention mechanism to perform weighted fusion to obtain a welding requirement vector, and provides it to the encoder; the encoder is based on the multi-head attention mechanism layer The welding requirement vector output by the word embedding layer is projected into a low-dimensional space for multi-head attention processing, and the processing results are fused 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 feedforward 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, and generates a welding requirement query vector, key vector and value vector through the corresponding weight matrix. Then, the results of each head are multi-head embedded and fused to generate a richer representation to capture the multi-dimensional user welding requirement vector in complex welding scenarios.
[0027] Step S02. Perform a hybrid search based on the welding requirement vector. The hybrid search includes graph search on the welding process knowledge graph and keyword text search and vector search on the welding process vector database. The vector search is to semantically match the welding requirement vector with the welding process vector database. A similar context search result set that meets the requirements is obtained based on the search results of the hybrid search. Feature extraction is performed on each search result in the similar context search result set, and the features corresponding to the search results obtained by different search methods are fused using the self-attention mechanism. The fused features are reordered using the Transformer model to obtain the sorted similar context search results.
[0028] In order to achieve efficient information retrieval, the present invention constructs two forms of welding process diagram database and welding process vector database based on knowledge graph and text data, and performs graph retrieval, keyword text retrieval and vector retrieval on the welding process diagram database and the welding process vector database according to the welding requirement vector. The retrieval results are subjected to a deep fusion strategy of Furong features based on the Transformer model, and the multi-source feature information of keyword retrieval, semantic vector retrieval and graph structure retrieval is expressed in a unified manner to construct a comprehensive feature representation of the retrieval results, which can significantly improve the accuracy and domain adaptability of the final sorting.
[0029] This embodiment first collects welding cases, rule bases, welding process standards, specifications and other documents from different data sources, converts these documents into text data and performs slicing processing, uses a pre-trained large model to extract entities and relationships from the sliced text, obtains triples and constructs a knowledge graph based on this, and for the constructed welding process knowledge graph, initializes and embeds its nodes through the trained Embedding model, and uses the improved GAT (Graph Attention Networks) network to extract features from the knowledge graph to generate a GAT feature graph, thereby representing the obtained knowledge graph vector and saving it to the welding process graph 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.
[0030] In a specific application embodiment, the following steps may be used to construct a welding process diagram database: Step S201. Input each welding process node into the GAT network, and calculate the self-attention coefficient of each welding process node in each 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. The relationship type weight is allocated according to the relationship type between the welding material and the process method.
[0031] In traditional GAT, each attention head pays uniform and unweighted attention to node features. When dealing with high-dimensional complex relationships in the welding field, the feature fidelity is insufficient and the representation ability is limited, and it is impossible to effectively distinguish the differences between key relationships and minor relationships in the welding process. In response to 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 according to specific relationship types in the welding field (such as the dependency between welding materials and process methods, the coupling between defect generation and parameters, etc.). In this way, the attention distribution of key relationships in the welding process can be significantly strengthened, while reducing the impact of minor relationships on the overall representation, thereby generating a more high-fidelity feature representation.
[0032] Specifically, the self-attention coefficient of the input welding process embedding node is first calculated. The input feature of the welding process node is ,in Indicates the number of welding process nodes, Represents the characteristic dimension of welding process nodes. In each graph attention layer, the welding process nodes are The attention coefficient is calculated. In order to achieve specific attention to the welding process relationship, this embodiment introduces a relationship type weight parameter to strengthen the key relationship and weaken the secondary relationship.
[0033] For example, for Attention heads, introducing relation weights into the GAT attention calculation formula At the same time, considering the complex characteristics of parameters in the field of welding technology, GELU is used as the activation function. By introducing an approximate Gaussian probability smoothing, GELU has smoothness when inputting small values. Compared with the original LeakyReLU, the GELU activation function can provide smoother activation characteristics, which helps to improve the convergence speed of the model. At the same time, it can partially retain negative value information, which is suitable for scenes in the field of welding technology that need to capture subtle feature differences. Finally, the softmax function is used for normalization and LeakyReLU is added to provide nonlinearity.
[0034] As an optional implementation, the calculation expression of the self-attention coefficient can be expressed as: (1) in, Indicates welding process node To welding process node The attention coefficient, Indicates welding process node The neighbor nodes of It represents the weight assigned according to the relationship type such as the dependency between welding materials and process methods or the coupling degree between defect generation and parameters. represents the linear transformation weight matrix applied at each node, represents the weight vector, express Activation function, , , They represent the input features of the i-th, j-th, and k-th welding process nodes respectively.
[0035] Step S202. In each GAT graph attention layer, welding process features are extracted based on a multi-head attention mechanism, and a hierarchical allocation function is defined to divide the attention heads into macro attention and micro attention heads and perform weight assignments. The macro attention is used to focus on the process sequence of welding steps, and the micro attention head is used to focus on material properties and / or causes of defects. The neighbor node features of each input welding process embedded node are weighted summed to extract features and obtain welding process features.
[0036] The traditional GAT multi-head attention mechanism does not consider the difference between different information levels, and the welding process contains multiple levels of information (such as macro process steps, micro material structure and defects), which may lead to feature confusion between macro information (such as process steps) and micro information (such as material structure and defects). Taking into account the above-mentioned 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 macro process steps, micro material structure and defect generation process), different levels of information are paid attention to in different attention heads. For example, the focus on the optimization of the welding step process and the focus on the details of the material properties and defect associations are modeled separately, which can optimize the allocation of attention heads on different levels of information, so that the generated features have higher semantic differentiation. For example, some attention heads can focus on the order and process optimization of the welding process steps, and other attention heads can focus on the detailed features associated with the welding material properties and defects. The GAT feature map generated in the above manner can have higher domain characteristics and semantic differentiation, ensuring that the complex correlation between processes is accurately reflected in the welding process knowledge graph vector.
[0037] 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. This embodiment further adopts a domain relationship category embedding mechanism 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 cross-process relationship categories. Relationship vectors of different categories are used to dynamically adjust the feature extraction direction of the attention head, thereby significantly improving the ability to characterize the hierarchical feature correlation between welding process entities.
[0038] Specifically, considering that the welding process knowledge graph contains complex information at the macro and micro levels, this embodiment introduces a hierarchical attention allocation strategy in the multi-head attention mechanism. In each GAT graph attention layer, the attention heads are divided into macro and micro attention heads, and weights are allocated for information at different levels. At the same time, according to the richness of different relationship categories in the welding process knowledge graph, the relationship category embedding vector is added to the attention calculation, and a hierarchical attention allocation strategy is introduced in the multi-head attention mechanism. Assigning embedding vectors , making the GAT feature graph richer and more delicate in the expression of multi-category associations, thereby achieving efficient capture of complex associations in the welding process knowledge graph.
[0039] In a specific application embodiment, Figure 2 , Figure 3As shown in Figure 2, GAT can be improved in the following ways to implement a hierarchical attention allocation mechanism and a domain relationship category embedding mechanism: a. Define a hierarchical allocation function , to divide the attention head into “process attention heads” that focus on the macro process and "microscopic attention heads" that focus on microscopic material properties ; b. For macro-level attention heads , focusing on the process sequence of welding steps, for micro-level attention heads , focusing on material properties and causes of defects; c. For each relationship type Assigning embedding vectors , by embedding it into the attention weight, each attention head can recognize and distinguish the complex correlations of these welding process relationships; d. Perform weighted summation on the neighbor node features of the input welding process embedded node and perform feature extraction. The user welding demand vector output by GAT is .
[0040] For example, the following calculation formula can be used: (2) (3) in, It is k The linear transformation weight matrix of the attention heads, It is the welding process node To welding process node The attention coefficient, are hierarchical allocation functions for adjusting the macro-level attention heads and micro-level attention heads, respectively. The hierarchical allocation functions are used to adjust the number and allocation ratio of the corresponding attention heads. They represent macro-level attention heads and micro-level attention heads respectively. is the relation category embedding vector, is the nonlinear activation function GELU, Respectively represent i The macro-level attention head output features and micro-level attention head output features of each welding process node, represents the fusion result of the macro-level attention head output features and the micro-level attention head output features, Indicates k The attention heads are macro-level attention heads. Indicates k The attention heads are micro-level attention heads.
[0041] Step S203. Concatenate the welding process features extracted by the multi-head attention mechanism of each graph attention layer to obtain a welding process node sequence.
[0042] Specifically, the welding process node features obtained by splicing the welding process features extracted by the multi-head attention mechanism of each layer of the graph attention layer can be expressed as: (4) in, It is The attention coefficient of the attention head, K is the number of attention heads of the multi-head attention mechanism, which is specifically taken as K =12, is the allocation function used to dynamically adjust the number and allocation ratio of attention heads, It is the output of GAT. i The user welding demand vector of the welding process node. By adopting the above formula, the node features can be further enhanced based on the multi-head attention mechanism. Dynamically adjust the number and distribution ratio of macro and micro attention heads to splice together the macro-level attention head output features and micro-level attention head output features of multiple attention heads to ultimately generate more expressive node features .
[0043] Step S204: linearly transform the welding process node sequence to map it to the initial input dimension, and obtain the welding process node features after adaptive normalization and Swish activation function processing.
[0044] Specifically, the output welding process node sequence can be input into a fully connected layer for linear transformation, and the high-dimensional welding process vector can be mapped to the initial input dimension, and then processed by the Swish activation function after adaptive normalization and output. For example, the calculation expression can be expressed as: (5) (6) in, It is The normalized attention coefficient of the attention heads, is the relation category embedding vector, || represents the concatenation operation, is the nonlinear activation function GELU, is the output weight matrix, Represented by the output weight matrix right The result after transformation is express After activation The final output after the function.
[0045] Step S205. Obtain a GAT feature graph from the features of each welding process node to represent the welding process knowledge graph vector, and construct a welding process knowledge graph.
[0046] Specifically, the GAT feature graph is obtained according to the obtained welding process node features, thereby representing the welding process knowledge graph vector. The welding process knowledge graph vector can be specifically expressed as follows: (7) in is the updated welding process feature matrix, which represents the embedded representation of each node in the graph. is the dimension of the output features.
[0047] This embodiment adopts the above-mentioned welding process domain knowledge graph construction method based on the improved GAT, and adopts a relationship-specific weight adjustment mechanism to target the specific needs of welding domain relationships. According to the key relationships such as the dependency between welding materials and process methods or the coupling degree between defect generation and parameters, dynamic weights are assigned to the multi-head attention mechanism, which can significantly enhance the modeling ability of key relationships and reduce the interference of secondary relationships on the overall representation; further adopts a hierarchical attention allocation mechanism, optimizes the allocation of attention heads on different levels of information according to the multi-level information characteristics of the welding process, so that the generated features have higher semantic differentiation; further adopts a domain relationship category embedding mechanism, generates independent embedding vectors for the diverse relationship categories in the welding process, guides the multi-head attention mechanism to dynamically adjust the feature extraction direction, and comprehensively captures the complex relationship types between welding process entities, which can further enhance the expression ability of complex relationships. In the above manner, the improved GAT network can be significantly improved in terms of domain feature expression, high fidelity of complex relationships, and accurate modeling of feature semantics, thereby optimizing the feature representation ability of the welding process domain knowledge graph.
[0048] Based on the constructed welding process knowledge graph and welding process vector database, after obtaining the user's welding demand vector, keywords are extracted, and a hybrid search method is used for the keywords. The three search methods of graph search, keyword search and vector search are combined to realize similar context information retrieval. Among them, graph search is used to access structural information, keyword search is used to retrieve text content, and vector search is used for fast search. When using the above three search methods for retrieval, the similarity scores are calculated respectively, and the search results of the three search methods are combined to determine whether similar contexts are retrieved. If similar contexts are retrieved, the welding process fine retrieval mechanism is further used to reorder the retrieved similar contexts to ensure that the retrieval results are gradually refined from preliminary matches to more accurate similar contexts, thereby achieving more accurate and comprehensive welding process information retrieval.
[0049] Specifically, the following steps can be followed to implement hybrid retrieval and re-rank the retrieved similar contexts: Step S211: Perform graph retrieval on the welding process knowledge graph according to the welding requirement vector.
[0050] Specifically, firstly, keywords are extracted from the welding requirement vector, and the corresponding nodes and edges related to the keywords are located according to the extracted keywords using the BFS algorithm; Then, based on the keywords, subgraph traversal is performed in the welding process knowledge graph to search for subgraphs centered on the keywords within a preset number of hops N, and to expand the relevant context; Adjust the vector dimension of the searched subgraph to make it consistent with the welding requirement vector; The similarity score between the searched subgraph and the welding requirement vector is calculated using Euclidean distance and / or inverse distance.
[0051] Optionally, for the obtained local subgraph S, a graph embedding method (Node2Vec) can be used and the vector dimension can be adjusted to be consistent with the user welding requirement vector, and then the similarity score can be calculated using the Euclidean distance and the inverse distance.
[0052] Step S212: Perform keyword search on the welding process vector database according to the welding requirement vector.
[0053] Specifically, keywords are extracted from the welding requirement vector, and a keyword retriever is used to perform keyword matching to achieve text retrieval. User questions are directly queried in the welding process vector database through welding process knowledge base documents, and the similarity scores between texts are calculated based on keywords.
[0054] Traditional BM25 is a text similarity calculation method based on probability theory optimization. The value range of the calculated similarity is usually [0, 1]. The higher the value, the higher the matching degree. Considering the complexity and professionalism of welding process, documents usually contain multiple types of information, such as material specifications, equipment parameters, process steps and quality control standards, and this information may be distributed in different parts of the document, such as title, abstract, text and appendix; In addition, in welding process queries, some terms may be more important than other terms. For example, "stainless steel" in the query "stainless steel welding" may be more important than "welding" because the material type has a significant impact on the process parameters. Therefore, this embodiment is 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 item, forming an improved algorithm BM25F+, using the improved algorithm BM25F+ to accurately realize text similarity calculation and optimize the keyword retrieval effect of welding process documents.
[0055] Specifically, this embodiment introduces a query item lower bound adjustment mechanism before IDF calculation, sets a weight lower limit for each query item, ensures that important query items are not weakened in the relevance calculation due to differences in document length, and better captures the core role of key terms such as welding methods and material characteristics. In addition, in order to reflect the field structure of the welding process document, the present invention introduces a field weight parameter to dynamically allocate the importance weights of different parts of the document (such as process description and material description) to enhance the adaptability of the retrieval model to the structural characteristics of the domain document. At the same time, considering the complexity of the length distribution of the welding process document, the present invention adjusts the mean of the document length in the traditional BM25 to a comprehensive value of the mean and the median, reduces the impact of extreme document length on the retrieval score, and more truly reflects the typical characteristics of the welding field document. Through the above method, the BM25F+ algorithm can more accurately capture the complexity and professionalism of the welding process document, greatly improve the accuracy and relevance of keyword retrieval, provide users with more demand-oriented retrieval results, and improve the practicality and user experience of the welding process field document retrieval system.
[0056] In a specific application embodiment, in the process of keyword querying the welding process document 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: (8) (9) (10) in, Indicates keywords Welding process text in welding process vector database The similarity score between Keywords for users' welding needs query, Represents the welding process document in the welding process vector database, Welding procedure documentation Middle Field The weight of Welding procedure documentation Middle Field part, Based on the query terms Dynamically adjusted parameters of importance in the field of welding processes, Indicates keywords In the documentation The number of occurrences in Representation Document The length of (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 length of all documents in the welding process vector database, and is a tuning parameter, which can be set, for example, and . is the inverse document frequency of the keyword, which is 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, Indicates that it contains keywords The number of documents. As shown in the above formula, by multiplying Previously, the entire Add a constant , a lower bound can be set for each query term to ensure that the relevance score of important query terms will not be reduced by document length. The value of can be adjusted according to welding industry standards and user welding needs. For example, if some query items are considered more important than others, these items can be assigned a higher value. At the same time, by adding a new parameter , which can take into account the diversity of document structures to represent welding process documents Middle Field By weighting the scores of multiple fields, the influence of different parts of the document on the matching score can be better reflected. In addition, in order to more accurately reflect the actual situation of welding process documents, the mean of the document length is Adjust to , which can improve the robustness and accuracy of the model when processing welding process related documents. This parameter can effectively reduce the impact of extreme values on document length, thereby more truly reflecting the characteristics of typical documents and solving the problem of different lengths of material properties and process parameter documents faced in the welding field.
[0057] Step S213: further semantically match the welding process vector database using vector search according to the user's welding requirement vector, and calculate the similarity score between the user's welding requirement vector and the welding process vector database.
[0058] Specifically, the similarity score between the welding requirement vector and the welding process vector database can be calculated by cosine similarity, and the calculation formula can be expressed as: (11) in, represents the user's welding demand vector, Represents the semantic vector of the text in the welding process vector database. The value range of cosine similarity is [0, 1]. The closer the value is to 1, the more similar the two texts are in semantics.
[0059] Step S214: Obtain a similar context search result set that meets the requirements based on the search results of the hybrid search.
[0060] In a specific application embodiment, the retrieval results of the mixed retrieval can be synthesized by weighted calculation to obtain a similar context retrieval result set that meets the requirements. The specific steps are as follows: Step S241. Obtain respectively the graph retrieval similarity obtained by graph retrieval of the welding requirement vector, the keyword retrieval similarity obtained by keyword retrieval, and the vector retrieval similarity obtained by vector retrieval.
[0061] Step S242. Weighting the graph retrieval similarity, keyword retrieval similarity and vector retrieval similarity to obtain a comprehensive similarity score; Step S243: Filter out the search results with the highest comprehensive similarity score or greater than a preset threshold to obtain a search result set.
[0062] Specifically, a weight coefficient is introduced to combine graph retrieval, keyword retrieval and vector retrieval similarity scoring , and , by weighted calculation of the similarity scores of the three, a comprehensive similarity score is formed. When it is greater than a preset value, the system considers that a similar context has been retrieved; otherwise, the system considers that a similar context has not been retrieved and can use an inference engine to perform rule-based reasoning to derive a similar context.
[0063] For example, the calculation expression of the comprehensive similarity score can be expressed as: (12) in, , and Represent the weights of graph retrieval similarity, keyword retrieval similarity, and vector retrieval similarity, respectively, satisfying By adjusting , and The value of can flexibly adjust the system's attention to graph retrieval, keyword retrieval, and vector retrieval.
[0064] Calculate the comprehensive similarity score in the above way After that, if If the value is greater than the preset value, the highest value will be returned from the welding process knowledge base. The corresponding three-part search content set.
[0065] Step S215. Perform feature extraction on each search result in the similar context search result set, and fuse the features corresponding to the search results obtained by different search methods using the self-attention mechanism. Reorder the fused features using the Transformer model to obtain the sorted similar context search results.
[0066] The preliminary result set obtained in step S214 contains a large amount of repetitive and broad content. This embodiment further adopts a welding process fine retrieval mechanism based on hybrid retrieval to ensure that the retrieval results are gradually refined from preliminary matches to more accurate similar contexts, further improving the retrieval accuracy and meeting the specific information requirements of the welding process and the high fidelity of complex correlations.
[0067] Specifically, the initial returned search content set (text data, vectors) is first standardized, the data in different forms are uniformly converted into vector form, duplicate vectors are filtered out, and the remaining vectors are stored in ,exist On this basis, welding process features are extracted, and then the Transformer-based hybrid retrieval feature deep fusion strategy is used to perform feature deep fusion. This makes it possible to deeply fuse the results obtained by welding process hybrid retrieval (graph retrieval, text retrieval and vector retrieval), construct a comprehensive retrieval result feature representation, and effectively combine the feature information from different retrieval methods to improve the accuracy of the final sorting.
[0068] In a specific application embodiment, feature extraction and feature fusion can be implemented by the following steps: Step S251: Standardize the search result set and filter out duplicate vectors to obtain the remaining vectors ; Standardize the initially returned search content set (text data, vectors), convert different forms of data into vector form, filter out duplicate vectors, and store the remaining vectors in .
[0069] Step S252. For the remaining vectors The features of the corresponding search results of graph retrieval, keyword text retrieval and vector retrieval are extracted respectively.
[0070] Step S253. Use the self-attention mechanism to fuse the features of the corresponding search results of graph retrieval, keyword text retrieval and vector retrieval to obtain fused features.
[0071] Specifically, the self-attention mechanism can be used to fuse the features of the corresponding search results of graph retrieval, keyword text retrieval, and vector retrieval to obtain the fused features according to the following formula: (13) (14) (15) in, Represents keyword text retrieval , Graph Retrieval And vector search The corresponding retrieval result feature matrix, 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.
[0072] Step S254. Input the fused features into the pre-trained Transformer model encoder. The KAN layer is used in the Transformer model encoder to process the output of the multi-head self-attention mechanism layer, and the retrieval result features of each welding process are obtained based on the feature representation processed by the self-attention mechanism and the KAN layer and the welding requirement type.
[0073] The KAN network can more accurately capture the deep correlation between material properties, process parameters and defects in the welding process by virtue of its efficient fitting ability for high-dimensional nonlinear relationships. This embodiment further introduces the KAN network to replace the original feedforward network part on the basis of the original Transformer model encoder to enhance the model's ability to express complex feature relationships of the welding process, thereby enhancing the ability to capture complex feature relationships.
[0074] Specifically, first, define the multi-head self-attention part in the Transformer model encoder structure. The specific calculation formula can be expressed as: (16) in, , The number of longs. is a linear transformation matrix used to convert the concatenated result back to the same dimension as the original input sequence.
[0075] Then use KAN to replace the traditional feedforward neural network. The specific calculation formula can be expressed as: (17) in, 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 , the output dimension is , by nin nout learnable activation function composition: (18) The output of each layer of the Transformer model encoder is expressed as: (19) in, 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.
[0076] Will Input the trained Transformer model encoder and calculate the sequence feature representation: (20) Reuse the trained Transformer model to To conduct an assessment: According to the user's demand type (such as welding method, material selection, etc.), the model conducts a detailed evaluation of the search result characteristics of each welding process, such as the search result characteristics of each welding process The expression is: (twenty one) in, represents the weight matrix determined according to the welding requirement type, ⊙ represents element-by-element multiplication; Then, according to the search result characteristics of each welding process Adjust the remaining vector The retrieval result weights corresponding to each retrieval result in the search result are re-ranked, and the retrieval result weight distribution is dynamically adjusted according to the evaluation results to better meet the user's expectations. The calculation expression is: (twenty two) in, Represents the final reordering result, represents the learned weight matrix, is the bias term, express softmax function.
[0077] Step S255. Adjust the remaining vector according to the search result characteristics of each welding process The search result weights corresponding to each search result in are used for re-ranking.
[0078] Specifically, the Transformer model finally returns ,right Sort from high to low to generate the final sorted set It is returned to the subsequent pre-trained large model to ensure that the welding process information provided in the end meets the specific information requirements of the welding process.
[0079] In this embodiment, the fused Re-sorting can better capture the complex characteristics of the welding field. Further, the KAN-based Transformer re-sorting model construction and training method can be adopted. The model is customized and trained using field-specific annotated data (such as welding materials, process parameters, defect types, etc.), which can enhance the model's sensitivity to welding-related content.
[0080] Step S03: input the sorted similar context retrieval results into the pre-trained large model to obtain intelligent recommendation results for welding process solutions.
[0081] Specifically, similar contexts and welding requirements input by the initial user can be optimized. The optimization process can include removing duplicate information, correcting errors, and unifying formats and styles: removing duplicate information between similar contexts and user welding requirements, such as describing the same welding method or process steps; then integrating the retrieved similar contexts and welding requirement vectors into a welding process description, which is then put into a Prompt template together to construct Prompt input information, which is then input into a pre-trained large model, and then adjusting the Prompt template based on the results of the large model.
[0082] 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, the welding process plan can be generated by using the optimized Prompt template through the large model to form a welding process expert system. After generating the welding process plan for a period of time, 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, and the weight of the retrieval method corresponding to the positive example is increased, and the weight of the retrieval method corresponding to the negative example is reduced.
[0083] This embodiment further provides an electronic device, including a processor and a memory, wherein the memory is used to store a computer program, and the processor is used to execute the computer program to perform the above method.
[0084] It is understandable that the above method of this embodiment can be executed by a single device, such as a computer or server, etc., and can also be applied to a distributed scenario and completed by multiple devices in cooperation with each other. In the case of a distributed scenario, one of the multiple devices can only execute one or more steps in the above method of this embodiment, and multiple devices interact 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., for executing related 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. The memory can store an operating system and other applications. When the above method of this embodiment is implemented by software or firmware, the relevant program code is stored in the memory and called and executed by the processor.
[0085] This embodiment further provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the above method is implemented.
[0086] Those skilled in the art should understand that the above-mentioned embodiments of the present invention can be provided as methods, systems, or computer program products. 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.) containing computer-usable program code. The present invention is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the functions in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0087] The above is only a preferred embodiment of the present invention, and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment, it is not intended to limit the present invention. Therefore, any simple modification, equivalent change and modification made to the above embodiment according to 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 protection of the technical solution of the present invention.
Claims
1. A hybrid retrieval method for intelligent recommendation of welding process schemes, characterized in that the steps include: Acquire the welding requirement information of the user and vectorize it to form a welding requirement vector, wherein the welding requirement vector includes a welding method, a welding type and welding parameters; A hybrid search is performed according to the welding requirement vector, wherein the hybrid search includes graph search on the welding process knowledge graph and keyword text search and vector search on the welding process vector database, wherein the vector search is to semantically match the welding requirement vector with the welding process vector database, and obtain a similar context search result set that meets the requirements according to the search results of the hybrid search; feature extraction is performed on each search result in the similar context search result set, and the features corresponding to the search results obtained by different search methods are fused using a self-attention mechanism, and the fused features are reordered using a Transformer model to obtain sorted similar context search results; The sorted similar context retrieval results are input into the pre-trained large model to obtain intelligent recommendation results for welding process solutions.
2. The hybrid retrieval method for intelligent recommendation of welding process scheme according to claim 1, characterized in that: It also includes building a welding process knowledge graph, including: Input each welding process node into the GAT network, and calculate the self-attention coefficient of each welding process node in each 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. The relationship type weight is allocated according to the relationship type between the welding material and the process method. In each GAT graph attention layer, the welding process features are extracted based on the multi-head attention mechanism, and a hierarchical allocation function is defined to divide the attention heads into macro attention and micro attention heads and perform weight allocation. The macro attention is used to focus on the process sequence of the welding steps, and the micro attention head is used to focus on the material characteristics and / or the causes of defect generation; the neighbor node features of each input welding process embedded node are weighted summed to perform feature extraction to obtain the welding process features; The welding process features extracted by the multi-head attention mechanism of each graph attention layer are spliced to obtain the welding process node sequence; The welding process node sequence is linearly transformed to be mapped to the initial input dimension, and after adaptive normalization, the welding process node features are obtained by processing with a Swish activation function; A GAT feature graph is obtained from the features of each welding process node to represent a welding process knowledge graph vector, thereby constructing the welding process knowledge graph.
3. The hybrid retrieval method for intelligent recommendation of welding process scheme according to claim 2 is characterized in that: The calculation expression of the self-attention coefficient is: , in, Indicates welding process node To welding process node The attention coefficient, Indicates welding process node The neighbor nodes of Indicates welding process node Welding process node The relationship type weight, represents the linear transformation weight matrix applied at each node, represents the weight vector, express Activation function, , , They represent the input features of the i-th, j-th, and k-th welding process nodes respectively; The calculation expression of the welding process characteristics is: , , , in, It is k The linear transformation weight matrix of the attention heads, are hierarchical allocation functions for adjusting the macro-level attention heads and micro-level attention heads, respectively. The hierarchical allocation functions are used to adjust the number and allocation ratio of the corresponding attention heads. They represent macro-level attention heads and micro-level attention heads respectively. is the relation category embedding vector, is the nonlinear activation function GELU, Respectively represent i The macro-level attention head output features and micro-level attention head output features of each welding process node, represents the fusion result of the macro-level attention head output features and the micro-level attention head output features, Indicates k The attention heads are macro-level attention heads. Indicates k The attention heads are micro-level attention heads; 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 the graph attention layer is: , , , in, It is The attention coefficient of the 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, It is the nonlinear activation function GELU; is the output weight matrix, It is the output of GAT. i The user welding demand vector of each welding process node, Represented by the output weight matrix right The result after transformation is express After activation The final output after the function.
4. The hybrid retrieval method for intelligent recommendation of welding process scheme according to claim 1, characterized in that: Performing graph retrieval on the welding process knowledge graph according to the welding requirement vector includes: Extracting keywords from the welding requirement vector, and locating corresponding nodes and edges according to the extracted keywords; Based on the keyword, a subgraph is traversed in the welding process knowledge graph to search for a subgraph centered on the keyword within a preset number of hops; Adjusting the vector dimension of the subgraph obtained by searching to make it consistent with the welding requirement vector; The similarity score between the searched subgraph and the welding requirement vector is calculated using Euclidean distance and / or inverse distance.
5. The hybrid retrieval method for intelligent recommendation of welding process scheme according to claim 1, characterized in that: Performing keyword text retrieval on the welding process vector database according to the welding requirement vector includes: Extracting keywords from the welding requirement vector; Perform keyword query on welding process documents in welding process vector database, calculate the similarity score between keywords and texts in welding process vector database, and the calculation expression is: , , , in, Indicates keywords Welding process text in welding process vector database The similarity score between Welding procedure documentation Middle Field The weight of Welding procedure documentation Middle Field part, Based on the query terms Dynamically adjusted parameters of importance in the field of welding processes, Indicates keywords In the documentation The number of occurrences in Representation Document Length, represents the average length of all documents in the welding process vector database, represents the median length of all documents in the welding process vector database, and is the adjustment parameter, is the inverse document frequency of the keyword, is the total number of documents in the welding process vector database, Indicates that it contains keywords The number of documents.
6. The hybrid retrieval method for intelligent recommendation of welding process scheme according to any one of claims 1 to 5, characterized in that: The step of obtaining a similar context search result set that meets the requirements based on the search results of the hybrid search includes: Respectively obtaining a graph retrieval similarity obtained by performing a graph retrieval on the welding requirement vector, a keyword retrieval similarity obtained by performing a keyword retrieval, and a vector retrieval similarity obtained by performing a vector retrieval; Weighting the graph retrieval similarity, the keyword retrieval similarity and the vector retrieval similarity to obtain a comprehensive similarity score; The search results with the highest comprehensive similarity score or greater than a preset threshold are screened out to obtain the search result set.
7. The hybrid retrieval method for intelligent recommendation of welding process scheme according to any one of claims 1 to 5, characterized in that: The extracting features of each search result in the similar context search result set respectively, fusing the features corresponding to the search results obtained by different search methods using a self-attention mechanism, and reordering the fused features using a Transformer model comprises: The search result set is normalized and repeated vectors are removed to obtain the remaining vectors. ; For the remaining vector The features of the corresponding search results of graph search, keyword text search and vector search are extracted respectively; The self-attention mechanism is used to fuse the features of the corresponding search results of graph retrieval, keyword text retrieval and vector retrieval to obtain fused features; The fused features are input into a pre-trained Transformer model encoder, in which the output of the multi-head self-attention mechanism layer is processed using a KAN 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; Adjust the remaining vector according to the search result characteristics of each welding process The search result weights corresponding to each search result in are used for re-ranking.
8. The hybrid retrieval method for intelligent recommendation of welding process scheme according to claim 7, characterized in that: The self-attention mechanism is used to fuse the features of the corresponding search results of graph retrieval, keyword text retrieval, and vector retrieval according to the following formula to obtain the fused features: , , , in, Represents keyword text retrieval , Graph Retrieval And vector search The corresponding search result feature matrix, represents the attention weight, is the retrieval feature dimension, represents the fusion feature obtained by fusion; The output of each layer of the Transformer model encoder is expressed as: , in, 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.
9. The hybrid retrieval method for intelligent recommendation of welding process scheme according to claim 8, characterized in that: Search result characteristics for each welding process The expression is: , in, represents the weight matrix determined according to the welding requirement type, ⊙ represents element-by-element multiplication; Search result characteristics by each welding process Adjust the remaining vector The calculation expression for re-ranking the search result weights corresponding to each search result in is: , in, Represents the final reordering result, represents the learned weight matrix, is the bias term, express softmax function.
10. An electronic device comprising a processor and a memory, wherein the memory is used to store a computer program, wherein: The processor is configured to execute the computer program to perform the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Science and technology project data intelligent retrieval recommendation method and system
CN111949677A
Method and system for enhancing RAG questions and answers through mixed retrieval method
CN118627625A
Method and system for generating enhanced knowledge questions and answers for mixed retrieval of heterogeneous database
CN119311831A
Welding process parameter recommendation method for enhancing large model by using knowledge graph retrieval
CN119578525A
Intelligent retrieval method and system for unstructured asset content based on large model
CN119646243A
Cited By
Welding quality detection method fusing welding spatio-temporal characteristics of multiple stud welding
CN120744409A
Process parameter switching method and device for multi-variety production
CN120765206A
Multi-dimensional demand profile driven adaptive manufacturing process mix recommendation method and system
CN122507945A
Multi-dimensional demand profile driven adaptive manufacturing process mix recommendation method and system
CN122507945B