Knowledge graph construction and embedding method in welding process field

By constructing and embedding a knowledge graph in the field of welding technology, and using quaternions for embedding learning, the lack of knowledge graph embedding methods in the field of welding technology is solved, and the intelligence and automation of welding process robots are realized.

CN121638423APending Publication Date: 2026-03-10BEIJING INST OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-19
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

In existing knowledge graph applications in the field of welding technology, there is a lack of effective embedding methods, which leads to a lack of reliable knowledge support for downstream task outputs, unreliable generated data, and difficulty in achieving intelligent and automated welding processes.

Method used

A knowledge graph construction and embedding method in the field of welding technology is adopted. By collecting and organizing welding technology knowledge text, setting prompt words for entity and relation extraction, a knowledge graph is constructed, and quaternions are used for embedding learning representation. The representation model is trained to obtain the final knowledge graph embedding for downstream tasks.

Benefits of technology

It effectively expresses the semantic and structural features of knowledge graphs in the field of welding technology, enhances the embedding representation capability of knowledge graphs, helps the intelligent development of the welding field, and promotes the intelligent application of welding process robots.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121638423A_ABST
    Figure CN121638423A_ABST
Patent Text Reader

Abstract

The invention discloses a knowledge graph construction and embedding method in the field of a welding process, which makes up the blank of a knowledge graph embedding method in the field of the welding process, realizes the embedding of a knowledge graph by means of quaternion, and effectively expresses knowledge of a graph structure as a vector which is easy to understand by a computer. The method can effectively express the semantic and structural characteristics of the knowledge graph in the welding process field, improves the embedding expression capability of the graph, assists the downstream task application of the welding field in combination with a computer, and promotes the intelligent development of the welding process field.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial intelligence and knowledge representation technology, specifically to a method for embedding and representing a knowledge graph of relationships in the field of welding processes, applicable to process knowledge management and intelligent decision support in welding industrial robots and intelligent manufacturing systems. Background Technology

[0002] With the development of Industry 4.0 and intelligent manufacturing, the transformation and upgrading of the manufacturing industry has placed significant demands on the intelligence of industrial robots. Welding, as a key manufacturing process, urgently needs to improve its automation and intelligence levels. Traditional welding processes rely on expert experience, resulting in problems such as knowledge fragmentation, low reuse rates, and strong subjectivity in parameter selection. In recent years, knowledge graphs, due to their powerful knowledge organization and reasoning capabilities, have been widely used in process knowledge modeling, effectively enhancing the intelligence of welding industrial robots.

[0003] Existing knowledge graph applications for welding processes mostly involve constructing knowledge graphs and designing retrieval methods to achieve simple knowledge queries and searches, or using large models to achieve community text summarization. However, these methods are merely simple applications of knowledge graphs and fail to reflect the commutative, one-to-many, and many-to-one characteristics of relationships between nodes. While commonly used knowledge graph combined with large language models possesses powerful generation capabilities and can alleviate the "illusion" problem to some extent, in a specialized field like welding processes, the lack of a reasonable and effective knowledge graph embedding method leads to unreliable knowledge support in downstream tasks, generating unreliable data and still prone to "illusions," making it difficult to perfectly integrate the two. Therefore, to fully explore the role of knowledge graphs in the welding process domain, combined with downstream structures such as large language models, it is necessary to perform embedding representation learning on knowledge graphs. There is an urgent need for a welding process domain knowledge graph embedding method that can deeply integrate domain-specific knowledge, preserve complex semantic structures, and support downstream intelligent applications. Summary of the Invention

[0004] To address the lack of knowledge graph embedding methods in the welding process field, this invention proposes a knowledge graph construction and embedding method for the welding process field. This method constructs a knowledge graph for the welding process field and embeds it into downstream tasks, thereby enhancing the intelligence of welding process robots.

[0005] A method for constructing and embedding a knowledge graph in the field of welding processes, comprising: Step S1, Knowledge Collection and Organization in the Welding Field: Collect and organize the welding process knowledge texts to be constructed. The text types include welding process knowledge manuals, actual welding processing data, and welding field papers; the text content includes welding types, weldment types, and processing conditions. Step S2, set prompt words for entity and relation extraction: set prompt words for entity and relation extraction in the welding process domain, including the set of entity types, the set of relation types, and other additional information contained in the knowledge graph to be constructed, and extract knowledge from the collected knowledge text through the large model; Step S3: Construct a knowledge graph for the welding process domain: Integrate the extracted entities, relationships, and additional information, use the head and tail entities of the triples as nodes of the knowledge graph, the relationships as edges between nodes, and add additional information as attributes describing the nodes and relationships to the nodes and relationships to construct a knowledge graph for the welding process domain. Step S4: Embedding learning representation of welding process domain knowledge graph based on quaternions: Set the initial embedding representation of knowledge graph entities and relations, train the representation model, and obtain the final embedding of welding process domain knowledge graph for downstream tasks.

[0006] Preferably, step S2 specifically includes: Step S2.1: Construct a prompt word template. The prompt word defines the entity types and relation types to be extracted from the text. The entity types include information that needs to be specified in the welding process, including "welding method", "workpiece material", "welding voltage", "welding current", and "welding speed". Define the relation types to be extracted from the text. To describe the various logical relationships between process parameters and welding process, and between workpiece attributes and processing effects in the field of welding process, set the relation types to include "influence", "cause", and "parameter is". Step S2.2: Add output format requirements to the prompt word template, requiring that the extracted additional information be added as attributes to nodes and relationships, and methods for handling non-existent and inaccurate information, and merge nodes with the same or similar semantics to eliminate redundancy. Step S2.3: Add an example of welding process domain knowledge extraction to the prompt word template.

[0007] Preferably, step S3 includes: Step S3.1: Select Neo4j, a graph database, as the platform for knowledge graph construction and storage; Step S3.2: Store the entities extracted in step S2 as head nodes and tail nodes in the knowledge graph, and store the extracted relationships as edges in the knowledge graph. Step S3.3: Store the additional information corresponding to each entity and relation extracted in step S2 as the attributes of nodes and edges.

[0008] Preferably, step S4 specifically includes: Step S4.1: Obtain the nodes and relationships in the knowledge graph of the welding process domain as samples in the training set. Set the initial embedding vector for the embedding representation of all nodes and relationships to be learned. The initial embedding vector is set to the format of a quaternion. Step S4.2: The head node embedding vector is rotated to obtain the predicted tail node embedding vector by calculating the Hamiltonian product with the relation embedding vector. The error between the predicted and actual embedding vectors of the tail node is calculated using the inner product. The scoring function for knowledge graph embedding is then set. Step S4.3: Treat the training objective as a classification task and learn the model parameters by minimizing the regularized logistic loss; Step S4.4: Train the model parameters using backpropagation loss and adaptive gradient method, starting from the initial embedding vector and iterating until the preset number of iterations is reached to obtain the trained embedding representation model.

[0009] Preferably, the initial embedding vector is set to a quaternion format:

[0010]

[0011]

[0012] in, These are the embedding vectors of the head node, relation, and tail node, respectively. yes dimensional vector, , are the coefficients of the real and imaginary parts of the quaternion-form embedded vector. It is the dimension of the vector embedding. It is the imaginary unit of a quaternion; In the above formula The initialization is as follows:

[0013]

[0014]

[0015]

[0016] in, It is in the interval The number of random samples in the middle, These are unit quaternions without real parts. middle coefficient, It is in the interval The number of random samples.

[0017] The preferred method for calculating the scoring function is as follows:

[0018]

[0019]

[0020] in, It is a relation embedding vector Length, It is the Hamiltonian product.

[0021] A preferred expression for the regularized logistic loss function is:

[0022] in, It is the embedding vector of the head node, tail node, and relation. It is the embedding vector of the relation. Indicated by and This relates to the head node and the tail node. It is a set of triples in the knowledge graph of the welding process field. It is a set of negative samples of triplets, which are generated by randomly replacing the head entity or the tail entity. It is an indicator function; its value is 1 when the triplet is a positive sample and -1 when the triplet is a negative sample. and It is the regularization coefficient; It is the 2-norm of the embedding space.

[0023] Preferably, when the knowledge graph needs to be updated, steps S2 to S4 are repeated.

[0024] A knowledge graph construction and embedding system in the field of welding technology includes: The knowledge acquisition module is used to collect and organize knowledge in the field of welding technology. The prompt word setting module is used to set prompt words for entity and relation extraction; The knowledge graph construction module is used to build a knowledge graph in the field of welding processes. The embedded representation module is used to embed and represent the knowledge graph of the welding process domain based on quaternions.

[0025] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described method.

[0026] The present invention has the following beneficial effects: This invention fills the gap in knowledge graph embedding methods in the field of welding technology. It uses quaternions to embed knowledge graphs, effectively representing graph-structured knowledge as vectors that are easy for computers to understand. This invention can effectively express the semantic and structural features of knowledge graphs in the field of welding processes, improve the embedding representation capability of the graphs, help the welding field combine with downstream computer tasks, and promote the intelligent development of the welding process field. Attached Figure Description

[0027] Figure 1 This is a flowchart of a knowledge graph construction and embedding method in the field of welding process according to the present invention; Figure 2 This is a visualization result of the knowledge graph in the field of welding process extracted by this invention; Figure 3 This is a schematic diagram of the embedding representation implemented by the embedding method of the present invention. Detailed Implementation

[0028] The embodiments of the present invention will be described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.

[0029] A method for constructing and embedding a knowledge graph in the field of welding technology includes the following steps: Step S1, Knowledge Collection and Organization in the Welding Process Field: Collect and organize the welding process field knowledge texts to be constructed. The text types include, but are not limited to, welding process knowledge manuals, actual welding processing data, and welding field papers. The text content includes, but is not limited to, welding types, weldment types, and processing conditions.

[0030] Step S2, set prompts for entity and relation extraction: Set prompts for entity and relation extraction in the welding process domain, including the set of entity types, the set of relation types, and other additional information contained in the knowledge graph to be constructed, and extract knowledge from the collected knowledge text through a large model.

[0031] Step S3: Construct a knowledge graph for the welding process domain: Integrate the extracted entities, relationships, and additional information, using the head and tail entities of the triples as nodes in the knowledge graph, the relationships as edges between nodes, and the additional information as attributes describing the nodes and relationships, and add them to the nodes and relationships to construct the knowledge graph for the welding process domain.

[0032] Step S4: Embedding representation of welding process domain knowledge graph based on quaternions: Set initial embedding representation of knowledge graph entities and relations, train representation model, and obtain final embedding of welding process domain knowledge graph for downstream tasks.

[0033] Specifically, step S2 includes: Step S2.1: Construct a prompt word template. The prompt word defines the entity types and relation types to be extracted from the text. The entity types include information that needs to be specified in the welding process, including but not limited to "welding method", "workpiece material", "welding voltage", "welding current", "welding speed", etc. The relation types to be extracted from the text are defined to describe the various logical relationships between process parameters and welding process, workpiece attributes and processing effects in the field of welding process. The relation types are set to include but not limited to "affect", "cause", "parameter is", etc. Step S2.2: Add output format requirements to the prompt word template, requiring that the extracted additional information be added as attributes to nodes and relationships, and methods for handling non-existent and inaccurate information, and merge nodes with the same or similar semantics to eliminate redundancy. Step S2.3: Add an example of welding process domain knowledge extraction to the prompt word template; Step S3 includes: Step S3.1: Select Neo4j, a graph database, as the platform for knowledge graph construction and storage; Step S3.2: Store the entities extracted in step S2 as head nodes and tail nodes in the knowledge graph, and store the extracted relationships as edges in the knowledge graph. Step S3.3: Store the additional information corresponding to each entity and relation extracted in step S2 as the attributes of nodes and edges.

[0034] Specifically, step S4 includes: Step S4.1: Obtain the nodes and relationships in the knowledge graph of the welding process domain as samples in the training set. Set initial embedding vectors for the embedding representations of all nodes and relationships to be learned. The initial embedding vectors are set to the format of quaternions.

[0035]

[0036]

[0037] in, These are the embedding vectors of the head node, relation, and tail node, respectively. yes dimensional vector, , are the coefficients of the real and imaginary parts of the quaternion-form embedded vector. It is the dimension of the vector embedding. It is the imaginary unit of a quaternion; In the above formula The initialization is as follows:

[0038]

[0039]

[0040]

[0041] in, It is in the interval The number of random samples in the middle, These are unit quaternions without real parts. middle coefficient, It is in the interval The number of random samples in the middle; Step S4.2: The head node embedding vector is multiplied by the relation embedding vector using the Hamiltonian product, rotated to obtain the predicted tail node embedding vector, and the error between the predicted and actual tail node embedding vectors is calculated using the inner product. The scoring function for knowledge graph embedding is then set, and the scoring function is calculated as follows:

[0042]

[0043]

[0044] in, It is a relation embedding vector Length, It is the Hamiltonian product; Step S4.3: Treat the training objective as a classification task, and learn the model parameters by minimizing the following regularized logistic loss, which is the embedded representation of the welding process domain knowledge graph:

[0045] in, It is the embedding vector of the head node, tail node, and relation. It is the embedding vector of the relation. Indicated by and This relates to the head node and the tail node. It is a set of triples in the knowledge graph of the welding process field. It is a set of negative samples of triplets, which are generated by randomly replacing the head entity or the tail entity. It is an indicator function; its value is 1 when the triplet is a positive sample and -1 when the triplet is a negative sample. and It is the regularization coefficient; It is the 2-norm of the embedding space.

[0046] Step S4.4: Train the model parameters using backpropagation loss and the adaptive gradient method (Adam), iterating from the initial embedding vector until a preset number of iterations is reached to obtain the trained embedding representation model for downstream tasks; when the knowledge graph needs to be updated, steps S2 to S4 can be repeated.

[0047] Example: Implementation, for example Figure 1 As shown, a method for constructing and embedding a knowledge graph in the field of welding technology includes the following steps: Step S1, Knowledge Collection and Organization in the Welding Field: Collect and organize the welding process knowledge texts to be constructed. The text types include, but are not limited to, welding process knowledge manuals, actual welding processing data, and welding field papers. The text content includes, but is not limited to, welding types, weldment types, and processing conditions.

[0048] Step S2, set prompts for entity and relation extraction: Set prompts for entity and relation extraction in the welding process domain, including the set of entity types, the set of relation types, and other additional information contained in the knowledge graph to be constructed, and extract knowledge from the collected knowledge text through a large model.

[0049] Step S2.1: Construct a prompt word template. The prompt word defines the entity types and relation types to be extracted from the text. The entity types include information that needs to be specified in the welding process, including but not limited to "welding method", "workpiece material", "welding voltage", "welding current", "welding speed", etc. The relation types to be extracted from the text are defined to describe the various logical relationships between process parameters and welding process, workpiece attributes and processing effects in the field of welding process. The relation types are set to include but not limited to "affect", "cause", "parameter is", etc. Specifically, the prompt words are set as follows: “ You are a professional information extraction assistant in the field of welding processes. Please carefully read the input text and accurately extract the following two types of information: entities and relationships between entities. The output must be in structured JSON format, containing two fields: entities and relationships.

[0050] Entity Types: Please identify the following entity types. Each entity is a node containing the fields id (unique identifier), type, value, and attributes: Welding method: refers to the specific welding method or technology, such as "MIG welding", "TIG welding", "laser welding", etc.

[0051] Workpiece material: The type of material to be welded, such as "low carbon steel", "304 stainless steel", "6061 aluminum alloy", etc.

[0052] Welding voltage: The voltage value used during the welding process, usually with units (such as V), such as "28V" or "22.5V".

[0053] Welding current: The current value used during welding, usually with units (such as A), such as "180A" or "200mA".

[0054] Welding speed: The speed at which the welding torch or workpiece moves, such as "0.5 m / min" or "12 mm / s".

[0055] Shielding gas: The type of shielding gas used in the welding process, such as "pure argon" or "Ar + 2% CO2".

[0056] Welding wire type: The grade or specification of the welding wire used, such as "ER70S-6" or "Φ1.2mm".

[0057] Preheating temperature: The temperature at which the workpiece is heated before welding, such as "150°C".

[0058] Interpass temperature: The highest permissible temperature between layers during multi-layer welding, such as "200°C".

[0059] Heat input: Energy input per unit length of weld, such as "1.5 kJ / mm".

[0060] Welding position: The spatial position of the welding operation, such as "flat welding", "vertical welding", "horizontal welding", etc.

[0061] Joint type: The geometric form of the welded joint, such as "butt joint", "corner joint", "lap joint", etc.

[0062] Bevel type: Pre-processed bevel shape, such as "V-shaped bevel" or "U-shaped bevel".

[0063] Process standards: The welding process specifications or standards referenced, such as "ISO 15614-1" or "AWS D1.1".

[0064] Note: All numerical parameters (such as voltage, current, speed, etc.) should have their values ​​and units extracted completely.

[0065] Relation Types: Each relationship must include the following fields: type, from (header node ID), to (tail node ID), and attributes. Impact: Indicates how a parameter or condition affects another parameter, effect, or performance. For example: "Excessive current affects penetration depth."

[0066] Caused to: Indicates a causal relationship, that is, a certain factor directly causes a certain result or defect. For example: "Impurity of the protective gas causes porosity".

[0067] The parameter is a specific value that represents a certain process parameter. For example, "28V is the welding voltage".

[0068] "Belongs to a process": This indicates that a certain parameter, material, or gas is a component of a specific welding process. For example, "ER70S-6 belongs to the MIG welding process."

[0069] "Applied to": Indicates a process or parameter used for a specific material or joint. For example: "TIG welding is applied to stainless steel."

[0070] Decision: Indicates that one factor determines the choice or outcome of another factor. For example: "The plate thickness determines the beveling type."

[0071] Limitation: This indicates that a certain condition sets an upper or lower limit on another parameter. For example: "Heat input limits interlayer temperature".

[0072] " Step S2.2: Add output format requirements to the prompt word template, requiring that the extracted additional information be added as attributes to nodes and relationships, and methods for handling non-existent and inaccurate information, and merge nodes with the same or similar semantics to eliminate redundancy. Specifically, the prompt word template is set as follows: “ The attributes field of a node should include contextual information such as the source sentence, numerical range, and condition description.

[0073] Merge nodes with the same or similar semantics. For example: "TIG welding" and "tungsten inert gas welding" are now combined into "TIG welding".

[0074] If the text only mentions a concept but not a specific value (such as "adjust the appropriate welding speed"), then the entity will not be extracted.

[0075] The format requirements for knowledge extraction results are as follows: { "entities": [ { "id": 1, "type": "Welding method", "value": "TIG welding", "attributes": { "sources": ["TIG welding of 304 stainless steel"], Note: Also known as tungsten inert gas welding. } }, { "id": 2, "type": "welding current", "value": "120A", "attributes": { "sources": ["Welding current set to 120A"], "unit": "A", "value_type": "Set value" } } ], "relations": [ { "type": "The parameter is", "from": 2, "to": 1, "attributes": { "sources": ["Welding current set to 120A"], "confidence": 0.95 } }, { "type": "cause", "from": 2, "to": 3, "attributes": { "sources": ["Excessive current will lead to excessive penetration"], "condition": "Current > 150A", "confidence": 0.8 } } ] } " Step S2.3: Add an example of welding process domain knowledge extraction to the prompt word template; Specifically, the suggested prompts are shown in the following example: “ Example input: When performing TIG welding on 304 stainless steel, pure argon is used as the shielding gas, the welding current is set to 120A, the voltage is 18V, and the welding speed is controlled at 8cm / min. Excessive current will result in excessive penetration, affecting the weld appearance. This process conforms to AWS D1.1 standards.

[0076] Example output: { "entities": [ { "id": 1, "type": "workpiece material", "value": "304 stainless steel", "attributes": { "sources": ["When performing TIG welding on 304 stainless steel"] } }, { "id": 2, "type": "Welding method", "value": "TIG welding", "attributes": { "sources": ["When performing TIG welding on 304 stainless steel"], Note: Full name: Tungsten Inert Gas Welding } }, { "id": 3, "type": "protective gas", "value": "pure argon gas", "attributes": { "sources": ["Using pure argon as the protective gas"] } }, { "id": 4, "type": "welding current", "value": "120A", "attributes": { "sources": ["Welding current set to 120A"], "unit": "A" } }, { "id": 5, "type": "welding voltage", "value": "18V", "attributes": { "sources": ["Voltage is 18V"], "unit": "V" } }, { "id": 6, "type": "Welding speed", "value": "8 cm / min", "attributes": { "sources": ["Welding speed controlled at 8 cm / min"], "unit": "cm / min } }, { "id": 7, "type": "Process Standard", "value": "AWS D1.1", "attributes": { "sources": ["This process conforms to AWS D1.1 standard"] } } ], "relations": [ { "type": "Applies to", "from": 2, "to": 1, "attributes": { "sources": ["When performing TIG welding on 304 stainless steel"] } }, { "type": "belongs to the craft", "from": 3, "to": 2, "attributes": { "sources": ["Using pure argon as the protective gas"] } }, { "type": "The parameter is", "from": 4, "to": 2, "attributes": { "sources": ["Welding current set to 120A"] } }, { "type": "The parameter is", "from": 5, "to": 2, "attributes": { "sources": ["Voltage is 18V"] } }, { "type": "The parameter is", "from": 6, "to": 2, "attributes": { "sources": ["Welding speed controlled at 8 cm / min"] } }, { "type": "cause", "from": 4, "to": 8, "attributes": { "sources": ["Excessive current will lead to excessive penetration"], "condition": "Current > 100A" } }, { "type": "impact", "from": 8, "to": 9, "attributes": { "sources": ["Affects the appearance and shape of the weld"] } }, { "type": "belongs to the craft", "from": 7, "to": 2, "attributes": { "sources": ["This process conforms to AWS D1.1 standard"] } } ] }” Step S3: Construct a knowledge graph for the welding process domain: Integrate the extracted entities, relationships, and additional information, using the head and tail entities of the triples as nodes in the knowledge graph, the relationships as edges between nodes, and the additional information as attributes describing the nodes and relationships, and add them to the nodes and relationships to construct the knowledge graph for the welding process domain.

[0077] Step S3.1: Select Neo4j, a graph database, as the platform for knowledge graph construction and storage; Step S3.2: Store the entities extracted in step S2 as head nodes and tail nodes in the knowledge graph, and store the extracted relationships as edges in the knowledge graph. Step S3.3: Store the additional information corresponding to each entity and relation extracted in step S2 as the attributes of nodes and edges.

[0078] The visualization results of the constructed welding process domain knowledge graph are as follows: Figure 2 As shown.

[0079] Step S4: Embedding representation of welding process domain knowledge graph based on quaternions: Set initial embedding representation of knowledge graph entities and relations, train representation model, and obtain final embedding of welding process domain knowledge graph for downstream tasks.

[0080] Step S4.1: Obtain the nodes and relationships in the welding process domain knowledge graph constructed in step S3. Use all the triple sets as samples in the training set, and set initial embedding vectors for all the node and relationship embedding representations to be learned. For example... Figure 3 The embedded representation diagram shown is based on the quaternion structure. The head node, relation, and tail node are set as quaternion vectors to express the property that the tail node is obtained by rotating the head node. The initial embedded vector setting format is as follows:

[0081]

[0082]

[0083] in, These are the embedding vectors of the head node, relation, and tail node, respectively. yes A quaternion vector is the coefficient of the real and imaginary parts of an embedded vector. It is the dimension of the vector embedding. It is the imaginary unit of a quaternion.

[0084] In the above formula The initialization is as follows:

[0085]

[0086]

[0087]

[0088] in, It is in the interval The number of random samples in the middle, These are unit quaternions without real parts. middle coefficient, It is in the interval The number of random samples; Step S4.2: The head node embedding vector is multiplied by the relation embedding vector using Hamiltonian product, rotated to obtain the predicted tail node embedding vector, and the error between the predicted and actual tail node embedding vectors is calculated using the inner product. The scoring function for knowledge graph embedding is then set, and the scoring function is calculated as follows:

[0089]

[0090]

[0091] in, It is a relation embedding vector Length, It is the Hamiltonian product; Step S4.3: Treat the training objective as a classification task, and learn the model parameters by minimizing the following regularized logistic loss, which is the embedded representation of the welding process domain knowledge graph:

[0092] in, It is a set of triples in the knowledge graph of the welding process field. It is a set of negative samples of triplets, which are generated by randomly replacing the head entity or the tail entity. It is an indicator function; its value is 1 when the triplet is a positive sample and -1 when the triplet is a negative sample. It is the regularization coefficient; It is the 2-norm of the embedding space; Step S4.4: Train the model parameters using backpropagation loss and adaptive gradient method. Iterate from the initial embedding vector until the preset number of iterations is reached to obtain the trained embedding representation model. The specific training environment configuration is shown in Table 1. The training results can be used for downstream tasks. When the knowledge graph needs to be updated, repeat steps S2 to S4.

[0093] Table 1 Training Environment Configuration

[0094] The above description, in conjunction with the accompanying drawings, provides a detailed example of a specific embodiment of the present invention. However, the present invention is not limited to the above-described embodiment. Within the scope of knowledge possessed by those skilled in the art, various changes can be made without departing from the spirit of the present invention.

Claims

1. A method for constructing and embedding a knowledge graph in the field of welding processes, characterized by, Comprise: Step S1, welding field knowledge collection and arrangement: collect and arrange the text of the welding process field knowledge to be constructed, the text type includes welding process knowledge manual, actual welding processing data, welding field paper; the text content includes welding type, welding part type, processing condition; Step S2, set the prompt word of entity and relationship extraction: set the prompt word of entity and relationship extraction in the field of welding process, including the entity type set, the relationship type set and the other additional information set contained in the knowledge graph to be constructed, and extract the knowledge from the collected knowledge text by a large model; Step S3, construct the knowledge graph of welding process field: integrate the extracted entity, relationship and additional information, take the head entity and tail entity of the triple as the node of the knowledge graph, take the relationship as the edge between the nodes, and add the additional information as the attribute of the node and the relationship on the node and the relationship, to construct the knowledge graph of welding process field; Step S4, embed learning representation of the knowledge graph of welding process field based on quaternion: set the initial embedding representation of the knowledge graph entity and relationship, train the representation model, and obtain the final embedding of the knowledge graph of welding process field, which is used for downstream tasks. 2.The method of claim 1, wherein, The step S2 specifically comprises: Step S2.1, construct a prompt word template, define the entity type and relationship type needed to be extracted from the text in the prompt word, the entity type includes the information needed to be clearly defined in the welding process, including "welding method", "workpiece material", "welding voltage", "welding current", "welding speed"; define the relationship type needed to be extracted from the text, set the relationship type to describe various logical relationships between process parameters and welding process, workpiece attributes and processing effect in the field of welding process, including "influence", "cause", "parameter is"; Step S2.2, add the format requirement of output result in the prompt word template, require to add the extracted additional information as the attribute on the node and the relationship, and the method of processing non-existent and inaccurate information, merge the nodes with the same or similar semantics to eliminate redundancy; Step S2.3, add the example of welding process field knowledge extraction in the prompt word template. 3.The method of claim 1, wherein, The step S3 comprises: Step S3.1, select the graph database Neo4j as the platform of knowledge graph construction and storage; Step S3.2, store the entity extracted in step S2 as the head node and tail node in the knowledge graph, and store the relationship extracted as the edge in the knowledge graph; Step S3.3, store the additional information corresponding to each entity and relationship extracted in step S2 as the attribute of the node and the edge. 4.The method of claim 1, wherein, The step S4 specifically comprises: Step S4.1, obtain the node and relationship in the knowledge graph of welding process field as the sample in the training set, set the initial embedding vector for the node and relationship to be learned, and set the initial embedding vector to the format of quaternion; Step S4.2, the head node embedding vector is rotated into the predicted tail node embedding vector by calculating the Hamilton product with the relation embedding vector, and the error between the predicted embedding vector and the actual embedding vector of the tail node is calculated by using the inner product to set the score function of the knowledge graph embedding; Step S4.3, the training target is regarded as a classification task, and the model parameters are learned by minimizing the regularized logistic loss; Step S4.4, the model parameters are trained by backpropagating the loss and the adaptive gradient method, and iteration is performed from the initial embedding vector until a preset iteration number is reached to obtain the trained embedding representation model. 5.The method of claim 4, wherein, The initial embedding vector is set in the format of quaternion: wherein, are embedding vectors for head node, relation, tail node respectively, is is a vector, is a coefficient of real and imaginary parts of the quaternion form embedding vector, is a dimension of vector embedding, is a quaternion imaginary unit; In the above formulae are initialized as follows: wherein is a number randomly sampled in the interval is a number randomly sampled in the interval are coefficients of are coefficients of are coefficients of is a number randomly sampled in the interval is a number randomly sampled in the interval 6.The method of claim 5, wherein, The score function is calculated as follows: wherein, is a relational embedding vector is the length of the vector, is a Hamilton product.

7. The method of claim 6, wherein the welding process domain knowledge graph is constructed and embedded by, The regularized logistic loss function is represented as: wherein, are embedding vectors of head nodes, tail nodes and relations, is an embedding vector of a relation, denotes that and are relations with head nodes and tail nodes, is a set of triples of a welding process field knowledge graph, is a set of negative samples of triples, and the negative samples are obtained by randomly replacing head entities or tail entities; is an indicator function, and the value is 1 when the triple is a positive sample, and the value is -1 when the triple is a negative sample; and are regularization coefficients; is a 2-norm of an embedding space.

8. The method of claim 1-7, wherein, When the knowledge graph needs to be updated, steps S2 to S4 are repeatedly executed.

9. A knowledge graph construction and embedding system in the field of welding processes, characterized in that, Comprise: A knowledge acquisition module for collecting and organizing welding process field knowledge; A prompt word setting module for setting prompt words for entity and relation extraction; A graph construction module for constructing a welding process field knowledge graph; An embedding representation module for embedding representation of the welding process field knowledge graph based on quaternion.

10. A computer-readable storage medium having stored thereon a computer program, characterized in that, When the program is executed by the processor, the method of any one of claims 1-8 is implemented.