A method for constructing a knowledge graph in the field of numerical control programming

By constructing a knowledge graph in the field of CNC programming, the problems of low efficiency and difficulty in ensuring quality in CNC programming are solved, achieving efficient knowledge management and decision support, and improving programming efficiency and quality.

CN115221333BActive Publication Date: 2026-05-08JIANGSU UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
JIANGSU UNIV OF SCI & TECH
Filing Date
2022-06-14
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

In the field of CNC programming, poor integration of manufacturing systems and semantic interoperability lead to low programming efficiency and unreliable quality. Programmers are far from the production site, resulting in wasted time on rework. The lack of effective knowledge mining methods leads to wasted resources.

Method used

We construct a knowledge graph for the CNC programming domain, collect and build local ontology, general ontology and semantic rules through a top-down approach, extract knowledge and perform fusion and reasoning using multiple strategies, and design reasonable storage models and visualization methods to achieve efficient knowledge management and decision support.

Benefits of technology

It improves the efficiency and quality of CNC programming, reduces the programming cycle, enables efficient use and intuitive display of knowledge, and supports programmers in making better decisions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115221333B_ABST
    Figure CN115221333B_ABST
Patent Text Reader

Abstract

The application discloses a kind of numerical control programming field knowledge graph construction method, steps are as follows: numerical control programming knowledge collection and classification;Numerical control programming field knowledge graph mode layer construction;Numerical control programming field knowledge graph data layer construction;Numerical control programming knowledge knowledge fusion and reasoning;Numerical control programming knowledge graph knowledge storage;Numerical control programming field knowledge graph visualization.The application analyzes the representation form of numerical control programming field knowledge, proposes a variety of strategies Knowledge extraction method, effectively covers the entire numerical control programming field.Therefore, the numerical control programming field knowledge graph constructed based on the application is larger in scale, and the knowledge is more complete.The application uses the knowledge reasoning method based on ontology and semantic rules to mine the semantic relationship between the constructed numerical control programming knowledge graph, which ensures the knowledge quality of the constructed knowledge graph and further expands the scale of the numerical control programming field knowledge graph.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to knowledge graphs, and in particular to a method for constructing a knowledge graph in the field of CNC programming. Background Technology

[0002] Although the integration of digital manufacturing systems such as CAD (Computer-Aided Design) and CAM (Computer-Aided Manufacturing) has enabled seamless integration of product design and manufacturing processes, achieving collaborative and parallel product development and effectively reducing product R&D cycles, some prominent issues in the field of CNC programming still severely constrain product development cycles. Specifically, the time spent on CNC programming and preparation in manufacturing enterprises far exceeds the machining time. This indicates that programming efficiency and quality have become key factors affecting product manufacturing cycles.

[0003] The main factors limiting the efficiency and quality of CNC programming are:

[0004] (1) The existing manufacturing systems of enterprises have poor integration and semantic interoperability. Most of the enterprise's production process documents are stored in independent databases. These multi-source heterogeneous data lack standardized interfaces and unified representation methods, resulting in difficulties in managing manufacturing process documents and unclear process content. In addition, due to the existence of information silos between CAD / CAPP (Computer Aided Process Plan) / CAM, the management of design information, process information and manufacturing information is chaotic, requiring CNC programmers to spend a lot of time filtering and extracting process information during the CNC programming stage. These factors lead to problems such as low CNC programming efficiency and inability to guarantee the quality of CNC programs.

[0005] (2) The CNC programming system and programmers are far from the production site, and often cause unnecessary rework of CNC programs due to a lack of understanding of the actual production situation in the workshop, which wastes time, reduces efficiency, and even causes scrap. In the traditional CNC programming process, programmers need to rely on their personal cognition and production experience to select appropriate CNC programming parameters for machining features and design reasonable tool paths. For some complex part features, this CNC programming method brings great difficulties and challenges, mainly because CNC programming is a knowledge-intensive task involving a series of decision-making activities, most of which rely heavily on the programmer's long-term production experience and knowledge accumulation.

[0006] (3) Enterprises have accumulated a large number of CAM numerical control programming cases in the actual production process. These cases, as the most direct carrier of programming information, contain rich knowledge and experience and are valuable manufacturing resources for enterprises. However, enterprises lack effective knowledge mining methods and often rely on manual querying and retrieval to achieve the reuse of programming cases, resulting in low resource utilization and serious waste of resources.

[0007] A knowledge graph is a directed graph-structured semantic knowledge base, a semantic network that describes objective facts in the form of a graph. Nodes in the graph represent entities or attributes, while edges represent various semantic relationships between entities. The basic unit of a knowledge graph is a triple in the form of "entity-relationship-entity". A set of triples can describe a specific relationship, and interconnected triples form a vast semantic network that can easily describe complex relationships between things. Currently, with its powerful knowledge storage, retrieval, and reasoning capabilities, knowledge graphs have been widely applied in the internet field and have begun to see initial applications in the industrial sector. Summary of the Invention

[0008] Purpose of the invention: The purpose of this invention is to provide a method for constructing a knowledge graph in the field of CNC programming, thereby assisting CNC programmers in making programming decisions with good visualization effects, and effectively reducing the complexity and cycle time of CNC programming.

[0009] Technical solution: The present invention provides a method for constructing a knowledge graph in the field of CNC programming, comprising the following steps:

[0010] (1) Collection of CNC programming knowledge: Specifically, it includes the collection of process information, equipment status, personnel information, programming experience and knowledge, and programming case studies.

[0011] Knowledge collection in the field of CNC programming refers to the collection of all knowledge that directly or indirectly affects the CNC programming process using various collection methods such as automatic, semi-automatic, and manual methods. This includes using IIoT (Intelligent Interconnection of Things) to collect information on workshop equipment status and workpiece clamping on the control panel; collecting programming process data from PLM (Product Lifecycle Management) systems such as Team Center; collecting expert advice and programmer experience; collecting historical CAM CNC programming cases from the enterprise database; and collecting knowledge on the technical level and operating habits of operators.

[0012] (2) Construction of knowledge graph pattern layer in CNC programming; specifically including local ontology construction, CAM domain general ontology construction, and semantic rule construction;

[0013] The CNC programming domain knowledge graph constructed in this invention belongs to the domain knowledge graph category, and its construction method is a top-down approach. Therefore, the prerequisite for constructing the CNC programming domain knowledge graph is to construct its schema layer. Constructing the schema layer involves building local ontologies, building a general ontology for the CAM CNC programming domain, and constructing CNC programming semantic rules, among other things. The specific construction process of the schema layer is as follows:

[0014] (2.1) Constructing a Local Ontology: The local ontology refers to the 4M1E local ontology; constructing a 4M1E local ontology refers to constructing a local ontology based on factors affecting CNC programming, such as Man, Machine, Material, Method, and Environment; among them, the Man local ontology refers to the local ontology established through the experience of CNC programmers, the capabilities of operators, suggestions from domain experts, and the processing intentions of enterprise managers; the Machine local ontology refers to the local ontology constructed based on machine tool information, CNC system information, tool information, and fixture information; the Material local ontology refers to the local ontology constructed based on processing feature information and material information; the Method local ontology refers to the local ontology constructed based on CNC machining methods, tool path methods, entry and exit methods, tool avoidance methods, and coordinate system setting methods; and the Environment ontology refers to the local ontology constructed based on workshop processing environment information, specifically the local ontology constructed based on tool status, machine tool status, workbench environment, and workbench working conditions.

[0015] (2.2) Construct a general ontology in the field of CAM numerical control programming.

[0016] (2.3) Constructing semantic rules for CNC programming; for example, using the SWRL (Semantic Web Rule Language) language to construct semantic rules for CNC programming.

[0017] (3) Construction of knowledge graph data layer in CNC programming; specifically including structured data knowledge extraction method based on relational database mapping, unstructured text data knowledge extraction method based on NLP and knowledge extraction method based on CAM CNC programming cases.

[0018] For the collected multi-source heterogeneous CNC programming knowledge, this invention adopts a variety of knowledge extraction methods based on different knowledge representation types, including a structured data knowledge extraction method based on relational database mapping, an unstructured data knowledge extraction method based on natural language processing, and a knowledge extraction method based on CAM CNC programming cases.

[0019] In step (3), the structured data knowledge extraction method based on relational database mapping is specifically as follows:

[0020] (3.1) Establish CNC process information database, workshop status information database, and operator information database respectively using the collected CNC programming knowledge;

[0021] (3.2) Establish a relational database storage model and store the data of these CNC process information databases, workshop status information databases, and operator information databases in a relational database (such as Oracle, MySQL, SQL Server). Use the primary key and foreign key mechanism of the relational database to set the relationship between the data.

[0022] (3.3) The constructed local ontology and database mapping protocols such as R2RML are used to perform ontology relation mapping on the established relational database to obtain a programming dynamic information knowledge set in the form of RDF;

[0023] (3.4) Based on the collected unstructured CNC programming knowledge, a CNC programming text dataset was constructed; at the same time, technicians manually classified the entities and relationships of the current CNC programming knowledge.

[0024] (3.5) Text data preprocessing; construct a dataset for triple extraction from the text dataset. After the text dataset is preprocessed, each line in the text will be used as an extraction sample.

[0025] (3.6) Train NLP entity recognition model and NLP relation recognition model; use entity and relation classification results and preprocessed text dataset to train NLP-based entity and relation extraction models respectively.

[0026] (3.7) Apply the trained entity and relation recognition models to extract triples from the text dataset. The results extracted by the NLP entity extraction model correspond to the head and tail nodes of the triples, and the results extracted by the NLP relation extraction model correspond to the relationship between the head and tail nodes of the triples.

[0027] (3.8) The local ontology in the pattern layer is used to verify the extracted triple knowledge. Since the trained NLP algorithm model cannot guarantee 100% accuracy, it is inevitable that some redundant and erroneous knowledge will be extracted. Therefore, the local ontology is used to verify the knowledge.

[0028] (3.9) Construct a knowledge graph of CNC programming experience using the verified triplet.

[0029] In step (3), the knowledge extraction method based on CAM CNC programming cases is specifically as follows:

[0030] (3.10) Establish a historical CNC machining case library.

[0031] (3.11) Extract machining feature information and CNC programming operations from historical CNC machining cases; where machining feature information refers to the geometric feature information, topological information and feature process information of machining features; CNC programming operations refer to the CNC programming operations established in CAM software such as NX, CATIA, PowerMill, etc., based on the machining features.

[0032] (3.12) Perform cluster analysis on the historical processing feature information set; apply this method to find the most typical processing feature information unit in the enterprise's historical processing features.

[0033] (3.13) Based on the clustering results, extract the central sample of each class as the typical processing feature information unit of that class.

[0034] (3.14) Construct feature-operation information units; use feature information units to match the operations of corresponding CAM CNC programming cases to construct feature-operation information units.

[0035] (3.15) Use the constructed local ontology to extract knowledge from feature-operation information units.

[0036] (3.16) Construct a knowledge graph of CAM numerical control programming cases using the extracted triplet relationships.

[0037] (4) Local knowledge graph knowledge fusion and knowledge reasoning; specifically including local knowledge graph knowledge fusion and knowledge reasoning based on general ontology and rules.

[0038] Because the data extracted from CNC programming is heterogeneous and source-dependent, the local knowledge graphs obtained through multi-strategy extraction inevitably contain some ambiguity, redundancy, and even errors, requiring knowledge fusion processing. Furthermore, these local knowledge graphs contain rich semantic relationships among the CNC programming knowledge, necessitating in-depth mining. Therefore, this invention employs local knowledge graph knowledge fusion to eliminate redundant, ambiguous, and erroneous CNC programming knowledge and applies knowledge reasoning methods to uncover the implicit semantic relationships between CNC programming knowledge.

[0039] Step (4) specifically involves:

[0040] (4.1) Local knowledge graph fusion; Local knowledge graph fusion mainly refers to matching entities in the graph. It uses probabilistic models, machine learning and other methods to determine whether entities in the same or different local knowledge graphs point to the same object to align entities.

[0041] (4.2) Apply the constructed general ontology and SWRL rules of CNC programming to perform knowledge reasoning on the fused knowledge graph.

[0042] (5) Knowledge storage of CNC programming domain knowledge graph: Based on the characteristics of the knowledge in the constructed CNC programming domain knowledge graph and the actual usage requirements, a storage mode for the CNC programming domain knowledge graph was designed, including dynamic storage and persistent storage.

[0043] Step (5) specifically involves:

[0044] (5.1) The graph knowledge obtained by extracting dynamic programming information from the relational database is stored in a temporary model; the dynamic programming information is stored in the relational database and often changes dynamically with the changes in machining characteristics. Therefore, it should be extracted at any time when the CNC programming knowledge graph is used. Therefore, the graph knowledge obtained from this data source should be stored in a temporary data model.

[0045] (5.2) The CNC programming knowledge graph obtained from case extraction and natural language text extraction is stored in a persistent model; this knowledge is mainly experiential knowledge generated in early project work and is not affected by objective factors. Therefore, this invention stores this graph knowledge in a persistent storage model, such as graph databases like Neo4j, TDB, and OrientDB.

[0046] (6) Knowledge visualization of knowledge graph in the field of CNC programming.

[0047] To ensure data security, graph databases storing CNC programming knowledge graphs are generally not directly exposed to users. Furthermore, using graph database interfaces to retrieve CNC programming knowledge stored in the graph database places high technical demands on users. To conveniently and intuitively display the constructed CNC programming knowledge graph, this invention provides a visualization method for CNC programming knowledge graphs.

[0048] The specific steps (6) are as follows:

[0049] (6.1) Build a query interface and input query content; develop a query interface in the front-end web page to accept user query requests.

[0050] (6.2) Analyze query intent; In the backend system developed in Java, natural language processing algorithms and regular expressions are used to analyze the user's query intent and extract key information from the user's input.

[0051] (6.3) Construct a query statement and perform the query.

[0052] (6.4) Determine the query result. If the query result is not empty, send the query result to the front end; if the query result is empty, prompt that the query information does not exist.

[0053] (6.5) Front-end visualization: The data received by the front end is organized into data formats that are compatible with visualization plugins such as D3 and Echarts, thereby realizing the visualization of CNC programming knowledge graph; Clicking on a node in the front-end visualization graph interface generates a click event, which automatically constructs the query information statement of the node and generates the attribute information graph of the node.

[0054] A computer storage medium storing a computer program, which, when executed by a processor, implements the aforementioned method for constructing a knowledge graph in the field of numerical control programming.

[0055] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described method for constructing a knowledge graph in the field of numerical control programming.

[0056] Beneficial effects: Compared with the prior art, the present invention has the following advantages:

[0057] 1. This invention analyzes the representation of knowledge in the field of CNC programming and proposes a variety of knowledge extraction methods based on the storage type of knowledge, which can effectively cover the entire field of CNC programming. Therefore, the knowledge graph of CNC programming constructed based on this invention is larger in scale and more complete in knowledge types.

[0058] 2. The knowledge fusion step of the present invention in the knowledge graph of the constructed CNC programming field eliminates redundant and ambiguous entity information, ensuring the knowledge quality of the constructed knowledge graph, and uses knowledge reasoning based on ontology and semantic rules to mine the implicit relationships between the constructed CNC programming knowledge graphs, further expanding the scale of the CNC programming field knowledge graph.

[0059] 3. This invention analyzes the actual use of CNC programming knowledge and designs a reasonable CNC programming knowledge graph knowledge storage mode. This mode ensures the effective use of CNC knowledge while reducing the storage requirements.

[0060] 4. This invention visualizes the knowledge graph, which helps users to intuitively and clearly understand the complex relationships between CNC programming knowledge, making it easier for CNC programmers to better and faster understand the current CNC programming task, and thus assisting programmers in making CNC programming decisions. Attached Figure Description

[0061] Figure 1 This is a flowchart of a knowledge graph construction method in the field of CNC programming according to the present invention;

[0062] Figure 2 This is a flowchart of knowledge extraction from relational database mapping;

[0063] Figure 3 This is a flowchart of text knowledge extraction based on natural language processing.

[0064] Figure 4 This is a flowchart for extracting knowledge from CAM (Computer-Aided Design) CNC (Computer-Aided Design)

[0065] Figure 5 It is a flowchart of knowledge integration and reasoning in the field of CNC programming;

[0066] Figure 6 It is a knowledge graph visualization flowchart in the field of CNC programming. Detailed Implementation

[0067] The technical solution of the present invention will be further described below with reference to the accompanying drawings.

[0068] This invention proposes a method for constructing a knowledge graph in the field of CNC programming, comprising six parts: knowledge collection in the field of CNC programming, construction of the pattern layer of the knowledge graph in the field of CNC programming, construction of the data layer of the knowledge graph in the field of CNC programming, knowledge fusion and knowledge reasoning of the local knowledge graph, knowledge storage of the knowledge graph in the field of CNC programming, and knowledge visualization of the knowledge graph in the field of CNC programming.

[0069] like Figure 1 As shown, the specific implementation steps of the knowledge graph construction method in the field of CNC programming of the present invention are as follows:

[0070] (1) Knowledge collection in the field of CNC programming;

[0071] Knowledge collection in the field of CNC programming refers to the collection of all knowledge that directly or indirectly affects the CNC programming process using various collection methods such as automatic, semi-automatic, and manual methods. This includes using IIoT (Intelligent Interconnection of Things) to collect information on workshop equipment status and workpiece clamping on the control panel; collecting programming process data from PLM (Product Lifecycle Management) systems such as Team Center; collecting expert advice and programmer experience; collecting historical CAM CNC programming cases from the enterprise database; and collecting knowledge on the technical level and operating habits of operators.

[0072] (2) Construction of the knowledge graph pattern layer in the field of CNC programming;

[0073] The CNC programming domain knowledge graph constructed in this invention belongs to the domain knowledge graph category, and its construction method is a top-down approach. Therefore, the prerequisite for constructing the CNC programming domain knowledge graph is to construct its schema layer. Constructing the schema layer includes building local ontologies, building a general ontology for the CAM CNC programming domain, and building CNC programming semantic rules. The specific construction process of the schema layer is as follows:

[0074] (2.1) Constructing a Local Ontology; In this invention, a local ontology refers to a 4M1E local ontology. Constructing a 4M1E local ontology means constructing a local ontology based on factors influencing CNC programming, such as Man, Machine, Material, Method, and Environment. Specifically, the Man local ontology is a local ontology built upon the experience of CNC programmers, the capabilities of operators, suggestions from domain experts, and the processing intentions of enterprise management; the Machine local ontology is a local ontology constructed based on machine tool information, CNC system information, tool information, and fixture information; the Material local ontology is a local ontology constructed based on processing feature information and material information; the Method ontology is a local ontology constructed based on CNC machining methods, toolpath methods, entry and exit methods, tool avoidance methods, and coordinate system setting methods; and the Environment ontology is a local ontology constructed based on workshop processing environment information, specifically based on tool status, machine tool status, and workbench environment.

[0075] (2.2) Construct a general ontology for the CAM numerical control programming field;

[0076] (2.3) Constructing semantic rules for CNC programming; for example, using the SWRL (Semantic Web Rule Language) language to construct semantic rules for CNC programming.

[0077] (3) Construction of the data layer of the knowledge graph in the field of CNC programming;

[0078] To address the diverse and heterogeneous CNC programming knowledge collected from various sources, this invention employs multiple knowledge extraction strategies based on different knowledge representation types. These include structured data knowledge extraction methods based on relational database mapping and unstructured data knowledge extraction methods based on natural language processing (such as...). Figure 3 (as shown) and knowledge extraction methods based on CAM CNC programming cases (such as...) Figure 4 (As shown).

[0079] Structured data knowledge extraction methods based on relational database mapping (such as...) Figure 2The specific workflow is as follows: (3.1) Utilize the collected CNC programming knowledge to establish a CNC process information database, a workshop status information database, and an operator information database.

[0080] (3.2) Establish a relational database storage model and store this data in relational databases such as Oracle, MySQL, and SQL Server. Use primary keys and foreign keys in relational databases to set the relationships between data.

[0081] (3.3) The constructed local ontology and database mapping protocols such as R2RML (RDB to RDF Mapping Language) are used to perform ontology relation mapping on the established database to obtain a programming dynamic information knowledge set in the form of RDF.

[0082] Unstructured data knowledge extraction methods based on natural language processing (such as...) Figure 3 The specific workflow (as shown) is as follows:

[0083] (3.4) Based on the collected unstructured CNC programming knowledge, a CNC programming text dataset was constructed; at the same time, technicians manually classified the entities and relationships of the current CNC programming knowledge.

[0084] (3.5) Text data preprocessing; This step aims to construct a dataset from the text dataset that can be used for triple extraction. After the text dataset is preprocessed, each line in the text will be used as an extraction sample.

[0085] (3.6) Train NLP entity recognition model and NLP relation recognition model; use entity and relation classification results and preprocessed text dataset to train NLP-based entity and relation extraction models respectively.

[0086] (3.7) Apply the trained entity and relation recognition models to extract triples from the text dataset. The results extracted by the NLP entity extraction model correspond to the head and tail nodes of the triples, and the results extracted by the NLP relation extraction model correspond to the relationship between the head and tail nodes of the triples.

[0087] (3.8) The local ontology in the pattern layer is used to verify the extracted triple knowledge. Since the trained NLP algorithm model cannot guarantee 100% accuracy, it is inevitable that some redundant and erroneous knowledge will be extracted. Therefore, the local ontology is used to verify the knowledge.

[0088] (3.9) Construct a knowledge graph of CNC programming experience using the verified triplet.

[0089] Knowledge extraction methods based on CAM CNC programming cases (such as...) Figure 4 The specific workflow (as shown) is as follows:

[0090] (3.10) Establish a historical CNC machining case library.

[0091] (3.11) Extract machining feature information and CNC programming operations from historical CNC machining cases; where machining feature information refers to the geometric feature information, topological information and feature process information of machining features; CNC programming operations refer to the CNC programming operations established in CAM software such as NX, CATIA, PowerMill, etc., based on the machining features.

[0092] (3.12) Perform cluster analysis on the historical processing feature information set; apply this method to find the most typical processing feature information unit in the enterprise's historical processing features.

[0093] (3.13) Based on the clustering results, extract the central sample of each class as the typical processing feature information unit of that class.

[0094] (3.14) Construct feature-operation information units; use feature information units to match the programming operations in the corresponding CAM CNC programming cases to construct feature-operation information units.

[0095] (3.15) Use the constructed local ontology to extract knowledge from feature-operation information units.

[0096] (3.16) Construct a knowledge graph of CAM numerical control programming cases using the extracted triplet relationships.

[0097] (4) Local knowledge graph knowledge fusion and knowledge reasoning

[0098] Because the data extracted from CNC programming is multi-source and heterogeneous, the local knowledge graphs obtained through multi-strategy extraction inevitably contain some ambiguity, redundancy, and even errors, requiring knowledge fusion processing. Furthermore, these local knowledge graphs contain rich semantic relationships among the CNC programming knowledge, necessitating in-depth mining. Therefore, this invention employs local knowledge graph knowledge fusion to eliminate redundant, ambiguous, and erroneous CNC programming knowledge and applies knowledge reasoning methods to mine the implicit semantic relationships between CNC programming knowledge. Figure 5 As shown, the specific workflow for this step is as follows:

[0099] (4.1) Local knowledge graph fusion; Local knowledge graph fusion mainly refers to matching entities in the graph. It uses probabilistic models, machine learning and other methods to determine whether entities in the same or different local knowledge graphs point to the same object to align entities.

[0100] (4.2) Apply the constructed general ontology and SWRL rules of CNC programming to perform knowledge reasoning on the fused knowledge graph.

[0101] (5) Knowledge storage of CNC programming domain knowledge graph; Based on the characteristics of the knowledge in the constructed CNC programming domain knowledge graph and the actual usage requirements, a storage mode for the CNC programming domain knowledge graph was designed, including dynamic storage and persistent storage. The specific workflow is as follows:

[0102] (5.1) The graph knowledge obtained by extracting dynamic programming information from the relational database is stored in a temporary model; the dynamic programming information is stored in the relational database and often changes dynamically with the changes in machining characteristics. Therefore, it should be extracted at any time when the CNC programming knowledge graph is used. Therefore, the graph knowledge obtained from this data source should be stored in a temporary data model.

[0103] (5.2) The CNC programming knowledge graph obtained from case extraction and natural language text extraction is stored in a persistent model; this knowledge is mainly experiential knowledge generated in early project work and is not affected by objective factors. Therefore, this invention stores this graph knowledge in a persistent storage model, such as graph databases like Neo4j, TDB, and OrientDB.

[0104] (6) Knowledge visualization of knowledge graph in the field of CNC programming

[0105] To ensure data security, graph databases storing CNC programming knowledge graphs are generally not directly exposed to users. Therefore, using graph database interfaces to retrieve CNC programming knowledge stored in the graph database places high technical demands on users. To conveniently and intuitively display the constructed CNC programming knowledge graph, this invention provides a visualization method for CNC programming knowledge graphs, such as... Figure 6 As shown, the specific implementation process is as follows:

[0106] (6.1) Build a query interface and input query content; develop a query interface in the front-end web page to accept user query requests.

[0107] (6.2) Analyze query intent; In the backend system developed in Java, natural language processing and regular expressions are used to analyze the user's query intent and extract key information from the user's input.

[0108] (6.3) Construct a query statement and perform the query.

[0109] (6.4) Determine the query result. If the query result is not empty, send the query result to the front end; if the query result is empty, prompt that the query information does not exist.

[0110] (6.5) Front-end visualization: The data received by the front end is organized into data formats that are compatible with visualization plugins such as D3 and Echarts, thereby realizing the visualization of CNC programming knowledge graph; Clicking on a node in the front-end visualization graph interface generates a click event, which automatically constructs the query information statement of the node and generates the attribute information graph of the node.

Claims

1. A method for constructing a knowledge graph in the field of CNC programming, characterized in that, Includes the following steps: (1) Collection of CNC programming knowledge: This includes the collection of process information, equipment status, personnel information, programming experience and knowledge, and programming case studies; (2) Construction of knowledge graph pattern layer in CNC programming; specifically including local ontology construction, CAM domain general ontology construction, and semantic rule construction; (3) Construction of knowledge graph data layer in CNC programming; specifically including structured data knowledge extraction method based on relational database mapping, unstructured text data knowledge extraction method based on NLP and knowledge extraction method based on CAM CNC programming cases; (4) Local knowledge graph knowledge fusion and knowledge reasoning; specifically including local knowledge graph knowledge fusion and knowledge reasoning based on general ontology and rules; (5) Knowledge graph storage in the field of CNC programming; (6) Knowledge visualization of CNC programming knowledge graph; Step (2) specifically involves: (2.1) Construction of Local Ontologies: The local ontology refers to the 4M1E ontology, including Man local ontology, Machine local ontology, Material local ontology, Method local ontology, and Environment local ontology; among them, Man local ontology refers to the local ontology established based on the experience of CNC programmers, the capabilities of operators, suggestions from domain experts, and the processing intentions of enterprise management personnel; Machine local ontology refers to the local ontology constructed based on machine tool information, CNC system information, tool information, and fixture information; Material local ontology refers to the local ontology constructed based on processing feature information and material information; Method local ontology refers to the local ontology constructed based on CNC machining methods, toolpath methods, entry and exit methods, tool avoidance methods, and coordinate system setting methods; Environment local ontology refers to the local ontology constructed based on workshop processing environment information, specifically the local ontology constructed based on tool status, machine tool status, and worktable conditions; (2.2) Construct a general ontology for the CAM numerical control programming field; (2.3) Constructing semantic rules for CNC programming; In step (3), the structured data knowledge extraction method based on relational database mapping is specifically as follows: (3.1) Establish CNC process information database, workshop status information database, and operator information database respectively using the collected CNC programming knowledge; (3.2) Establish a relational database storage model, store this data in a relational database, and use the primary key and foreign key of the relational database to set the relationship between the data; (3.3) The local ontology and RDF database mapping protocol is used to perform ontology relation mapping on the established database to obtain a set of programming dynamic information knowledge in the form of RDF. (3.4) Based on the collected unstructured CNC programming knowledge, a CNC programming text dataset was constructed; at the same time, technicians manually classified the entities and relationships of the current CNC programming knowledge. (3.5) Text data preprocessing; Construct a dataset for triple extraction from the text dataset. After preprocessing the text dataset, each line in the text will be used as an extraction sample. (3.6) Train NLP entity recognition model and NLP relation recognition model; use entity and relation classification results and preprocessed text dataset to train NLP-based entity and relation extraction models respectively; (3.7) Apply the trained entity and relation recognition models to extract triples from the text dataset. The results extracted by the NLP entity extraction model correspond to the head and tail nodes of the triples, and the results extracted by the NLP relation extraction model correspond to the relationship between the head and tail nodes of the triples. (3.8) The extracted triple knowledge is verified using the local ontology in the pattern layer; (3.9) Construct a knowledge graph of CNC programming experience using the verified triplet.

2. The method for constructing a knowledge graph in the field of CNC programming according to claim 1, characterized in that, In step (3), the knowledge extraction method based on CAM CNC programming cases is specifically as follows: (3.10) Establish a historical CNC machining case library; (3.11) Extract machining feature information and CNC programming operations from historical CNC machining cases; where machining feature information refers to the geometric feature information, topological information and feature process information of machining features; CNC programming operations refer to the CNC programming operations established in CAM software based on the machining features; (3.12) Perform cluster analysis on the historical processing feature information set; apply this method to identify the most typical processing feature information units in the enterprise's historical processing features; (3.13) Based on the clustering results, extract the central sample of each class as the typical processing feature information unit of that class; (3.14) Construct feature-operation information units; construct feature-operation information units by matching the programming operations in the corresponding CAM CNC programming cases using feature information units; (3.15) Use the constructed local ontology to extract knowledge from feature-operation information units; (3.16) Construct a knowledge graph of CAM numerical control programming cases using the extracted triplet relationships.

3. The method for constructing a knowledge graph in the field of CNC programming according to claim 1, characterized in that, Step (4) specifically involves: (4.1) Local knowledge graph fusion; Local knowledge graph fusion mainly refers to matching entities in the graph. It uses probabilistic models and machine learning methods to determine whether entities in the same or different local knowledge graphs point to the same object, thereby aligning the entities. (4.2) Apply the constructed general ontology and SWRL rules of CNC programming to perform knowledge reasoning on the fused knowledge graph.

4. The method for constructing a knowledge graph in the field of CNC programming according to claim 1, characterized in that, Step (5) specifically involves: (5.1) Store the graph knowledge extracted from the information dynamically programmed from the relational database in a temporary storage model; (5.2) The CNC programming knowledge graph obtained from case extraction and natural language text extraction is stored in a persistent storage model.

5. The method for constructing a knowledge graph in the field of CNC programming according to claim 1, characterized in that, The specific steps (6) are as follows: (6.1) Construct a query interface and input query content; develop a query interface in the front-end web page to accept user query requests; (6.2) Analyze the query intent; In Java-developed backend systems, natural language processing and regular expressions are used to analyze user query intent and extract key information from user input. (6.3) Construct a query statement and perform the query; (6.4) Determine the query result. If the query result is not empty, send the query result to the front end. If the query result is empty, a message will be displayed indicating that the query information does not exist. (6.5) Front-end visualization: The data received by the front end is organized into a data format that is adapted to the visualization plugin, thereby realizing the visualization of the CNC programming knowledge graph; Clicking on a node in the front-end visualization graph interface generates a click event, which automatically constructs the query information statement of the node and generates the attribute information graph of the node.

6. A computer storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements a method for constructing a knowledge graph in the field of numerical control programming as described in any one of claims 1-5.

7. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements a method for constructing a knowledge graph in the field of numerical control programming as described in any one of claims 1-5.