A device semantic reasoning system and method based on a large model and ontology mapping

By using a device semantic reasoning system based on large models and ontology mapping, the problems of low efficiency and poor accuracy in processing semantic relationships between devices in the Industrial Internet of Things are solved. This system enables efficient and intelligent device data reasoning and query generation, and improves the standardization and real-time performance of semantic interoperability.

CN120911625BActive Publication Date: 2025-12-26CHINA JILIANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511445924.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-11
Publication Date
2025-12-26
Estimated Expiration
2045-10-11

AI Technical Summary

Technical Problem

Existing technologies suffer from low efficiency and poor accuracy in processing semantic relationships between devices in the Industrial Internet of Things (IIoT), failing to meet the demands for real-time performance and intelligent decision-making. Furthermore, existing semantic reasoning methods lack flexibility and cannot cope with the complexity of device data environments.

Method used

A device semantic reasoning system based on large models and ontology mapping is adopted. A domain ontology library is constructed by acquiring OPC UA standard ontology and device manufacturer information. Combined with node metadata of edge devices, a semantic reasoning module is constructed by using an SBERT pre-trained encoder for semantic matching and reasoning. A large language model LLM is used to verify high-confidence bidirectional correspondence and mapping relationship.

Benefits of technology

It significantly improves the standardization and intelligence of device semantic interoperability, realizes lightweight real-time data conversion and efficient semantic response, ensures the accuracy and simplicity of output results, and reduces resource consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120911625B_ABST
    Figure CN120911625B_ABST
Patent Text Reader

Abstract

The application discloses a device semantic reasoning system and method based on a large model and ontology mapping, wherein the device semantic reasoning system based on the large model and the ontology mapping comprises a first acquisition module, a second acquisition module and a matching module.The first acquisition module is used for acquiring an OPC UA standard ontology and field information provided by a device manufacturer, and constructing a field ontology library according to the acquired standard ontology and the field information.The second acquisition module is used for acquiring node metadata of an edge device collected by an edge side OPC UA server, and generating triples conforming to an RDF grammar according to the acquired node metadata.The matching module is used for performing semantic matching on the field ontology library and the triples conforming to the RDF grammar through an ontology mapping module, and constructing a semantic reasoning module according to a semantic correspondence generated by matching.The application adopts a three-level dynamic matching mechanism (text similarity, rule matching and large model backup), and solves the problem of heterogeneous industrial device terminology.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of semantic reasoning, and in particular to a device semantic reasoning system and method based on a large model and ontology mapping. BACKGROUND

[0002] With the rapid development of industrial internet of things (IIoT) and intelligent manufacturing, industrial devices generate a variety of data. Devices from different manufacturers often use different standards, formats and semantics, which results in low efficiency and poor accuracy of data processing, and cannot meet the needs of real-time and intelligent decision-making. Traditional data query methods mainly rely on SQL queries, but these methods cannot handle the semantic relationships and context dependencies between devices. As the number of devices increases, the complexity of data is also increasing, and the limitations of traditional methods are gradually emerging.

[0003] To solve these problems, semantic reasoning technology is proposed. Through semantic reasoning, the relationships between device data can be deduced to improve the accuracy of data processing. Existing semantic reasoning methods mostly rely on manually constructed rules or fixed models, which makes them less flexible and unable to cope with the complexity of device data environments. In recent years, semantic reasoning methods combining large language models and ontology mapping have gradually attracted attention. These methods can achieve more efficient and intelligent reasoning and query generation in device data processing. However, there are still many challenges in real-time, semantic matching and reasoning accuracy.

[0004] Therefore, in view of the above technical problems, the present application provides a device semantic reasoning system and method based on a large model and ontology mapping. SUMMARY

[0005] The purpose of the present application is to overcome the defects of the prior art and provide a device semantic reasoning system and method based on a large model and ontology mapping, which can efficiently solve the problems of low efficiency and poor reasoning accuracy in traditional methods, and provide flexible and intelligent device data reasoning and query generation technology.

[0006] To achieve the above purpose, the present application adopts the following technical solutions:

[0007] A device semantic reasoning system based on a large model and ontology mapping, comprising:

[0008] A first acquisition module for acquiring an OPC UA standard ontology and field information provided by a device manufacturer, and constructing a field ontology library according to the acquired standard ontology and field information;

[0009] A second acquisition module for acquiring node metadata of edge devices collected by an edge side OPC UA server, and generating triples conforming to RDF syntax from the acquired node metadata;

[0010] The matching module is configured to perform semantic matching on the triples in the RDF syntax and the domain ontology library through an ontology mapping module, and construct a semantic reasoning module according to the semantic correspondence generated by the matching.

[0011] Further, the matching module specifically includes:

[0012] The definition module is configured to take the triples in the RDF syntax as source data, and take the standard ontology in the domain ontology library as target ontology.

[0013] The extraction module is configured to extract information related to entity data from the source data to obtain source entity e S , and construct a first entity term inverted index table; and extract information related to entity data from the target ontology to obtain target entity e T , and construct a second entity term inverted index table.

[0014] The processing module is configured to process the source terms in the first entity term inverted index table and the target terms in the second entity term inverted index table based on an SBERT pre-training encoder, to obtain source term vectors v(ω S ) corresponding to the source terms and target term vectors v(ω T ) corresponding to the target terms, and store the source term vectors v(ω S ) and the target term vectors v(ω T ) in corresponding source-side vector libraries and target-side vector libraries, respectively.

[0015] The construction module is configured to construct a target entity candidate list of the source entity and a source entity candidate list of the target entity according to the source term vectors v(ω S ) and the target term vectors v(ω T ).

[0016] The mapping module is configured to determine a mapping relationship between the source entity e S and the target entity e T according to the target entity candidate list and the source entity candidate list , and construct a semantic reasoning module according to the mapping relationship.

[0017] Further, the source term vectors v(ω S ) corresponding to the source terms and the target term vectors v(ω T ) corresponding to the target terms obtained in the processing module are represented as:

[0018] v(ω S )=SBERT(ω S ). ​​

[0019] v(ω T )=SBERT(ω T );

[0020] Where, ω S ω T These represent the source term and the target term, respectively.

[0021] Furthermore, in the construction module, based on the source term vector v(ω) S ), target term vector v(ω) T Construct a candidate list of target entities for the source entity. Specifically:

[0022] For source entity e S Each source term ω in S , calculate source term ω S With all target terms ω in the target side vector library T cosine similarity y w (ω S ,ω T );

[0023] Based on similarity y w (ω S ,ω T In all target terms ω T The top k most similar target term vectors v(ω) are selected from the data. T ), to obtain each source term ω S Source term candidate set ;

[0024] According to each source term ω S Source term candidate set Construct all source terms ω S The candidate set is used to obtain the source entity e. S Target entity candidate set ;

[0025] For target entity e T Calculate source entity e S With target entity e T Entity-level similarity y e (e S ,e T ), to select the target entity candidate set Target entities in the similarity y e (e S ,e T Sort the results in descending order to obtain the candidate list of target entities for the source entities. .

[0026] Furthermore, in the construction module, based on the source term vector v(ω) S ), target term vector v(ω) T Construct a candidate list of source entities for the target entity. Specifically:

[0027] For target entity e T Each target term ω T Calculate the target term ω T With all source terms ω in the source side vector library S cosine similarity y w (ω T ,ω S );

[0028] Based on similarity y w (ω T ,ω S ) in all source terms ω S Select the k most similar source term vectors v(ω) from the middle S ), to obtain each target term ω T Target term candidate set ;

[0029] According to each target term ω T Target term candidate set Construct all target terms ω T The candidate set is used to obtain the target entity e. T Source entity candidate set ;

[0030] For source entity e S Calculate the target entity e T With source entity e S Entity-level similarity y e (e T ,e S ), to select the source entity candidate set Source entities in the similarity y e (e T ,e S Sort the results in descending order to obtain the candidate list of target entities for the source entities. .

[0031] Furthermore, the mapping module determines the source entity e. S With target entity e T The mapping relationship between them is as follows:

[0032] For each source entity e S Obtain the candidate list of target entities for the source entity. For each target entity e T, obtain a source entity candidate list of the target entity ;

[0033] determine whether each source entity e S , the target entity e T satisfies the bidirectional correspondence, if not, discard the current candidate pair, pop the next candidate target entity e from the source entity's target entity candidate list T , and re-perform bidirectional identification; if yes, determine whether it satisfies the high-confidence bidirectional HCB correspondence, if yes, directly add the current candidate pair (e S , e T ) to the final mapping set, and terminate the search for the current source entity e S ; if not, trigger a large language model LLM prompt;

[0034] determine the mapping relationship between the source entity e S and the target entity e T according to the large language model LLM prompt.

[0035] Further, the condition for bidirectional correspondence is that the source entity e S is in the target entity's source entity candidate list , and the target entity e T is in the source entity's target entity candidate list .

[0036] Further, the condition for high-confidence bidirectional HCB correspondence is that the source entity e S is the highest priority candidate in the target entity's source entity candidate list , and the target entity e T is the highest priority candidate in the source entity's target entity candidate list .

[0037] Further, the mapping module according to the mapping relationship constructs a semantic reasoning module, specifically:

[0038] According to the determined mapping relationship, obtain the mapping set, convert the five-tuple form of the mapping set into the triple form of the RDF syntax, store the mapping set in the form of the converted triple form in the RDF library, and generate a semantic reasoning module by combining the stored mapping set with the large language model LLM.

[0039] Correspondingly, a device semantic reasoning method based on a large model and ontology mapping is also provided, which is used to implement the device semantic reasoning system based on a large model and ontology mapping. The semantic reasoning method comprises:

[0040] S1. Receiving the natural language question input by the client, the semantic reasoning module extracts the RDF triple corresponding to the natural language question, and performs inference analysis on the edge device data to obtain the edge device state or the result of the related query;

[0041] S2. The semantic reasoning module returns the obtained edge device state or the result of the related query to the client in the form of natural language.

[0042] Compared with the prior art, the system solves the semantic heterogeneity problem between the device terminology and the standard ontology in the industrial scene, and significantly improves the standardization and intelligent level of device semantic interoperability; the overall framework of the designed semantic reasoning method based on large model and ontology mapping includes an ontology mapping module and a semantic reasoning module, which effectively realizes the alignment of basic terminology through text feature similarity matching, verifies the consistency of the structure of HCB, and makes a final decision on complex ambiguous cases through a large model, forming a gradual semantic fusion closed loop; secondly, relying on the edge-cloud collaborative architecture, the lightweight real-time data conversion is realized on the edge side, the ontology mapping and hybrid reasoning are intelligently executed on the cloud side, which significantly reduces the resource consumption while ensuring the timeliness of the semantic response; finally, the large model and semantic web technology are deeply integrated, through the accurate conversion from natural language to SPARQL, multi-source knowledge reasoning and humanized result generation, the accuracy and simplicity of the output result are guaranteed. BRIEF DESCRIPTION OF DRAWINGS

[0043] Figure 1 is a device semantic reasoning system structure diagram provided by embodiment one based on a large model and ontology mapping;

[0044] Figure 2 is a device semantic reasoning system schematic diagram provided by embodiment one based on a large model and ontology mapping;

[0045] Figure 3 is a device semantic reasoning method flowchart provided by embodiment two based on a large model and ontology mapping. DETAILED DESCRIPTION

[0046] The embodiments of the present application will be described in detail below with specific, concrete examples. Those skilled in the art can easily understand other advantages and effects of the present application from the disclosure in the specification. The present application can also be implemented or applied by different specific embodiments, and the details in the specification can be modified or changed based on different views and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.

[0047] The purpose of the present application is to provide a device semantic reasoning system and method based on a large model and ontology mapping to overcome the defects of the prior art.

[0048] Embodiment One

[0049] The embodiment provides a device semantic reasoning system based on a large model and ontology mapping, as shown in the accompanying drawings, comprising: Figures 1-2

[0050] The first acquisition module is configured to acquire an OPC UA standard ontology and field information provided by a device manufacturer, and construct a field ontology library according to the acquired standard ontology and field information.

[0051] The second acquisition module is configured to acquire node metadata of an edge device collected by an edge side OPC UA server, and generate triples conforming to an RDF syntax according to the acquired node metadata.

[0052] The matching module is configured to perform semantic matching on the field ontology library and the triples conforming to the RDF syntax through an ontology mapping module, and construct a semantic reasoning module according to a semantic correspondence generated by the matching.

[0053] In the first acquisition module, the OPC UA standard ontology and the field information provided by the device manufacturer are acquired, and the field ontology library is constructed according to the acquired standard ontology and field information.

[0054] Collecting standard ontology: the OPC UA foundation provides rich standard ontologies in its public resources, covering OPC UA information models and various device classification standards. These standard ontologies are like a treasure trove of industrial device knowledge, detailing the common attributes of various industrial devices, such as device type, model, operating parameters, and their relationships, such as connection methods between devices, control relationships, etc.

[0055] Supplementing device classification and attribute information: relying solely on the standard ontology provided by the OPC UA foundation may not fully meet the needs of specific business scenarios. Therefore, the standard ontology needs to be supplemented and improved according to the device manuals and technical documents of device manufacturers. The materials of device manufacturers usually contain more detailed classification information and attribute descriptions for specific devices, such as unique functional characteristics of a specific model of a certain brand device, special operating parameter ranges, etc. Integrating these information into the standard ontology can make the ontology library more accurately reflect the diversity of devices involved in actual business and their unique attributes, and construct a field ontology library that meets the specific business needs.

[0056] ​Quality Verification: To ensure the quality of the constructed domain ontology library, a team of domain experts can perform quality verification. With their professional knowledge and practical experience in the relevant field, domain experts can conduct a rigorous review of the consistency and accuracy between the standard ontology and the domain ontology library. They can check for deviations in concept definitions, errors in attribute relationships, and other issues to ensure that the domain ontology library accurately and truly maps industrial equipment and their relationships.

[0057] In the second acquisition module, the edge-side OPC UA server collects the node metadata of the edge devices and generates triples conforming to the RDF syntax from the acquired node metadata (device, attribute, attribute value).

[0058] Starting the automation node crawler and acquiring node metadata: The edge-side OPC UA server, as the starting point of data collection, will start an automation node crawler like Lion². This crawler uses the Browse service of OPC UA to perform a recursive traversal operation on the address space of edge devices. In this process, it can dynamically acquire various metadata of nodes, including NodeId (the unique identifier of the node, used to accurately locate the device or its attributes), BrowseName (the name of the node, which helps humans identify the category of the device or attribute), DataType (data type, which specifies the format of the data stored in the node, such as integer, float, string, etc.), Value (the actual value of the node, which is the current state data or attribute value of the device, such as the current temperature reading of a temperature sensor), Timestamp (timestamp, which records the update time of the data value, used to ensure the timeliness of the data). At the same time, the crawler continuously monitors node change events and updates in a timely manner once it detects changes in node data, ensuring real-time collection and dynamic updating of edge device data, and ensuring the accuracy and timeliness of the acquired data.

[0059] Extracting key fields using lightweight parser: For each node data acquired by the crawler, a lightweight parser such as OPC UA SDK is used for processing. The main function of the parser is to accurately extract the key triple fields from the node data: Subject (subject) corresponds to the NodeId of the node, which represents a specific device or a certain part of the device; Predicate (predicate) corresponds to the BrowseName of the node, which describes a certain attribute or feature that the subject has; Object (object) corresponds to the Value of the node, which is the specific value of the attribute. Through this extraction process, the original node data is transformed into triple components with clear semantic roles.

[0060] The extracted Subject, Predicate, and Object are combined according to the requirements of the RDF syntax to form RDF triples that meet the semantic specifications, such as (Device 1, Temperature, 25℃). Such triples clearly express the properties and corresponding values of a specific device, achieving semantic representation of device data. During the combination process, invalid data such as DataType conflicts (e.g., the DataType of a node is an integer, but the actual value is a string) are logged and discarded to ensure the quality and reliability of the generated RDF triples.

[0061] In the matching module, the domain ontology library and the RDF triples are semantically matched through the ontology mapping module, and the semantic reasoning module is constructed based on the matching semantic correspondence.

[0062] The matching module specifically includes a definition module, an extraction module, a processing module, a construction module, and a mapping module.

[0063] The definition module uses RDF triples as source data and the standard ontology in the domain ontology library as the target ontology.

[0064] The RDF triples (Subject: device entity identifier, Predicate: attribute name, Object: attribute value) generated by the device data are obtained from the edge RDF converter, and the RDF triples are defined as device source data. The standard ontology data (including device type definition, attribute specification, and hierarchical relationship) is loaded from the domain ontology library, and the standard ontology data is defined as the target ontology.

[0065] The extraction module extracts information related to entity data from the source data to obtain the source entity e S , and constructs a first entity term inverted index table. The information related to entity data is extracted from the target ontology to obtain the target entity e T , and a second entity term inverted index table is constructed.

[0066] Each RDF triple defines the source data, which includes Subject (device entity identifier): representing a device individual, Predicate (attribute name): describing a certain characteristic or state of the device, and Object (attribute value): providing the specific value of the attribute. Then, the device entity identifier (Subject part) is extracted from the source data, which is the source entity e S .

[0067] The target ontology includes device type definition, attribute specification, and hierarchical relationship, etc. T ; wherein the target entity e T is a specific instance or object in the target ontology, which is a specific device or device attribute, and has a clear semantic definition in the target ontology, such as "temperature sensor" or "temperature" attribute.

[0068] In this embodiment, the source entity e S The construction of the first entity term inverted index table is specifically as follows:

[0069] The terms associated with the source entity e S include BrowseName: the name of the device node (for example, temperature sensor), Value: the value of the device attribute (for example, 25°C), and annotation text: the description information of the device node (for example, a sensor for monitoring the temperature of the device). The extracted terms are preprocessed, such as text cleaning, lexical analysis, and semantic enhancement, to improve the accuracy of semantic matching, and then an empty dictionary or hash table is created. For each term, it is associated with the corresponding source entity e S ; the term is stored as a key and the source entity e S is stored as a value in the index. If a term corresponds to multiple source entities, the values are stored as a list. Finally, the first entity term inverted index table is obtained, and the set of terms Ω(e S ) associated with each source entity e S is recorded, including BrowseName, Value, and annotation text.

[0070] In this embodiment, the target entity e T The construction of the second entity term inverted index table is specifically as follows:

[0071] The terms associated with the target entity e T include label: the standard name of the target entity (for example, TemperatureSensor), synonym: other possible names of the target entity (for example, temperature control sensor), and attribute description text: attribute description of the target entity (for example, a standard sensor for monitoring the temperature of the device). The extracted terms are preprocessed, such as text cleaning, lexical analysis, and semantic enhancement, to improve the accuracy of semantic matching, and then an empty dictionary or hash table is created. For each term, it is associated with the corresponding target entity e T ; the term is stored as a key and the target entity e T is stored as a value in the index. If a term corresponds to multiple target entities, the values are stored as a list. Finally, the second entity term inverted index table is obtained, and the set of terms Ω(e T ) associated with each target entity e T), including labels, synonyms, and attribute description texts.

[0072] a processing module for processing the source terms in the first entity term inverted index table and the target terms in the second entity term inverted index table based on the SBERT pre-training encoder respectively, obtaining source term vectors v(ω S ) corresponding to the source terms and target term vectors v(ω T ) corresponding to the target terms, and storing the source term vectors v(ω S ) and the target term vectors v(ω T ) in corresponding source-side vector libraries and target-side vector libraries respectively.

[0073] All relevant source terms ω S such as "temperature sensor" and "25℃" are extracted from the first entity term inverted index table of the source entity e S , and all target terms ω T such as "TemperatureSensor" and "temperature control sensor" are extracted from the second entity term inverted index table of the target entity e T .

[0074] The SBERT model is loaded, which can be loaded and used using a ready-made library (such as sentence-transformers). Each term is taken as input, and a corresponding d-dimensional vector is generated by the SBERT model, i.e., a source term vector v(ω S ) corresponding to a source term and a target term vector v(ω T ) corresponding to a target term, which is represented as:

[0075] v(ω S ) = SBERT(ω S ) ;

[0076] v(ω T ) = SBERT(ω T ) ;

[0077] Finally, the source term vector v(ω S ) of the source term ω S is stored in the source-side vector library (edge device term vector), and the target term v(ω T ) of the target term ω T is stored in the target-side vector library (standard ontology term vector).

[0078] A construction module is configured to construct a target entity candidate list of the source entity and a source entity candidate list of the target entity based on the source term vector v(ω S ) and the target term vector v(ω T ) respectively. ​ .

[0079] In this embodiment, based on the source term vector v(ω) S ), target term vector v(ω) T Construct a candidate list of target entities for the source entity. Specifically:

[0080] For source entity e S Each source term ω in S Retrieve all target terms ω from the target side vector library T , calculate source term ω S With all target terms ω T cosine similarity y w (ω S ,ω T ), represented as:

[0081]

[0082] Only retain similarity y w (ω S ,ω T The target term ω is higher than the threshold τ (let τ = 0.75). T And find the top-k (let k=5) most similar target term vectors v(ω) T ), to obtain each source term ω S Source term candidate set , represented as:

[0083]

[0084] All source terms ω S The candidate sets of source terms are merged to obtain the source entity e. S Target entity candidate set , represented as:

[0085]

[0086] Where i represents the i-th source term.

[0087] For each candidate target entity e T Calculate source entity e S With target entity e T Entity-level similarity y e (e S ,e T ), represented as:

[0088]

[0089] Wherein, Ω(eS ) represents the source entity e S The set of all terms; Ω(e T ) represents the target entity e T The set of all terms is used to calculate the maximum similarity value between all source and target term pairs.

[0090] Target entity candidate set Target entities in the similarity y e (e S ,e T Sort in descending order, as follows:

[0091]

[0092] After sorting, an ordered sequence is formed, which is the candidate list of target entities for the source entities. .

[0093] In this embodiment, based on the source term vector v(ω) S ), target term vector v(ω) T Construct a candidate list of source entities for the target entity. Specifically:

[0094] For target entity e T Each target term ω in T Retrieve all source terms ω from the source side vector library. S Calculate the target term ω T With all source terms ω S cosine similarity y w (ω T ,ω S ), represented as:

[0095]

[0096] Only retain similarity y w (ω T ,ω S Source term ω exceeding the threshold τ (let τ = 0.75) S And find the top-k (let k=5) most similar source term vectors v(ω) S ), to obtain each target term ω T Target term candidate set , represented as:

[0097]

[0098] All target terms ω T Target term candidate set The merging process yields the target entity e. Ta set of source entity candidates , denoted as:

[0099]

[0100] where j represents the jth target term.

[0101] For each candidate source entity e S , calculate the entity-level similarity y T between the target entity e S and the source entity e e (e T , e S ), denoted as:

[0102]

[0103] where Ω(e S ) represents the set of all terms of the source entity e S ; Ω(e T ) represents the set of all terms of the target entity e T , and the maximum similarity value between all target term and source term pairs is taken.

[0104] Sort the source entities in the set of source entity candidates in descending order of similarity y e (e T , e S ), denoted as:

[0105]

[0106] After sorting, an ordered sequence is formed, which is the source entity candidate list of the target entity .

[0107] A mapping module is configured to determine the mapping relationship between the source entity e S and the target entity e T according to the target entity candidate list and the source entity candidate list , and construct a semantic reasoning module according to the mapping relationship.

[0108] In this embodiment, the mapping relationship between the source entity e S and the target entity e T is determined as follows:

[0109] For each source entity e S , retrieve the ordered target entity candidate list of the source entity from the database, which contains the most similar target entity candidate to the source entity e S ; for each target entity e TRetrieve an ordered list of candidate source entities for the target entity from the database. This includes the target entity e T The most similar source entity candidate.

[0110] Determine each source entity e S Target entity e T Does it satisfy the two-way correspondence condition, where the two-way correspondence condition is the source entity e? S Appear in the source entity candidate list In the middle, and the target entity e T Appear in the target entity candidate list In, it is represented as:

[0111]

[0112] If the bidirectional correspondence is not satisfied, the current candidate pair will be discarded, and the candidate pair will be removed from the target entity candidate list. The next candidate target entity e is popped from the middle. T Then, the bidirectional identification process is repeated until a candidate pair that meets the bidirectional identification criteria is found.

[0113] If a bidirectional correspondence is satisfied, then it is further determined whether a high-confidence bidirectional correspondence (HCB correspondence) is satisfied, where the HCB correspondence condition is the source entity e. S Is it in the source entity candidate list? The highest priority candidate in the list, and the target entity e T Is it in the target entity candidate list? The highest priority candidate in the process, i.e., the one that determines Is it? The maximum value in, and Is it? The maximum value in is represented as:

[0114]

[0115]

[0116] If the HCB correspondence is satisfied, then the current candidate pair (e) is directly added. S e T Add it to the final mapping set M and terminate the mapping of the current source entity e. S The search, i.e., no longer processes the source entity e. S Other candidate target entities, i.e., no large language model LLM query is required.

[0117] If the bidirectional correspondence is met but the HCB correspondence is not met, a large language model (LLM) prompt is triggered, the system generates the prompt using a predefined template, the LLM prompt template is designed using zero-shot, only containing the ontology name and entity label, then the LLM makes a binary decision, only outputting "yes" or "no".

[0118] If the LLM output is "yes", the current candidate pair (e S , e T ) is added to the final mapping set M, and the search for the current source entity e S is terminated.

[0119] If the LLM output is "no", the next candidate target entity e T is popped from the target entity candidate list , and the process of retrieval-bidirectional correspondence-HCB correspondence-prompt is repeated until the mapping relationship is determined.

[0120] It should be noted that the LLM prompt template can use existing templates, which are not limited in the present embodiment. Because the large model is only used for the final judgment, it is equivalent to the large model confirming the similarity of two words based on the existing prompt template. In addition, the aforementioned correspondence recognition can solve most of the matching problems, which greatly reduces the calling range of LLM. LLM is not involved in the whole system, but as an "edge case processor" cooperates with the retrieval and recognition steps, through the prompt, it realizes efficient fusion.

[0121] According to the determined mapping relationship, the final mapping set M is finally output, and the content is the semantic correspondence five-tuple <id, e S , r, e T , c>. Wherein, id is the identification, e S is the source entity, r is the semantic relationship (equivalence relationship), e T is the target entity, and c is the confidence (i.e. the similarity score of the two). Extract <e S , r, e T > in the five-tuple, convert it into RDF triple <source ontology, semantic relationship (equivalence), target ontology>, and store the mapping set converted into RDF triple in the cloud RDF library for subsequent semantic reasoning and query.

[0122] The stored mapping set is combined with the large language model (LLM) to generate a semantic reasoning module.

[0123] The semantic reasoning module receives real-time data of the device and SPARQL query language converted by the large language model LLM in addition to the mapping relationship. The large language model LLM is contained in the semantic reasoning module, and the semantic reasoning module mainly includes the large language model LLM and the Jena reasoning engine. The remaining user-end questions, device real-time data and mapping relationship are inputs of the module, and the module finally outputs to the user end in the form of natural language.

[0124] The embodiment adopts a three-level dynamic matching mechanism (text similarity, rule matching, and large model backup) to solve the problem of heterogeneous industrial equipment terminology. After matching, a semantic correspondence relationship is generated. This relationship is temporarily stored in the form of a five-tuple structure <id, source entity, relationship, target entity, confidence>, and is finally converted into an RDF triple <source ontology, semantic relationship, target ontology> and stored in the cloud RDF database, providing a standardized mapping basis for subsequent semantic reasoning.

[0125] Embodiment Two

[0126] The embodiment provides a device semantic reasoning method based on a large model and ontology mapping, which is used to implement a device semantic reasoning system based on a large model and ontology mapping of embodiment one, as shown in Figure 3 The semantic reasoning method includes the following steps:

[0127] S1. Receive the natural language question input by the client, and the semantic reasoning module extracts the RDF triple data corresponding to the natural language question and performs reasoning analysis on the edge device data to obtain the edge device state or the result of the related query.

[0128] After the client inputs the natural language question, the semantic reasoning module receives the RDF triple data extracted by the edge RDF converter based on the question, and performs reasoning analysis on the device data based on the mapping rules of the three-level dynamic matching mechanism to obtain the device state or the result of the related query. The specific process is as follows:

[0129] S11. The client inputs a natural language question (such as “What is the temperature of device 1?” or “Is the device state normal?”) through an interactive interface;

[0130] S12. Use the P-Tuning v2 fine-tuned large language model to automatically convert the natural language question into SPARQL query language according to the preset prompt embedding and a small amount of labeled data, and input the generated SPARQL query to the Jena reasoning engine for reasoning. The reasoning process includes the following steps:

[0131] S121. The Jena inference engine loads the stored mapping triples of source entities and target entities from the cloud RDF repository, which help the inference module to determine the semantic mapping between the source data (device data) and the target ontology (standard ontology);

[0132] S122. The Jena inference engine also receives real-time device data (such as device temperature, status, attribute values, etc.) converted into RDF triples provided by the edge RDF converter;

[0133] S123. Based on the input SPARQL query, real-time device data and mapping relationship, the Jena inference engine performs inference operation, analyzes data through inference rules and deduces the query result.

[0134] S2. The semantic inference module returns the obtained edge device state or the result of the related query to the client in the form of natural language, and the specific process is as follows:

[0135] S21. Return the inference result to the SPARQL query, and pass the SPARQL query result to the P-Tuning v2 fine-tuned large model;

[0136] S22. The P-Tuning v2 fine-tuned large model converts the SPARQL query result into natural language output to the client according to the prompt module.

[0137] Compared with the prior art, the system solves the problem of semantic heterogeneity between device terminology and standard ontology in industrial scenarios, and significantly improves the standardization and intelligent level of device semantic interoperability; the overall framework of the designed semantic inference method based on large model and ontology mapping includes an ontology mapping module and a semantic inference module, which effectively realizes text feature similarity matching to realize basic terminology alignment, HCB corresponding verification structure consistency, large model bottom decision complex ambiguity case, and forms a gradual semantic fusion closed loop; secondly, relying on the edge-cloud collaborative architecture, the lightweight real-time data conversion is realized on the edge side, the ontology mapping and hybrid reasoning are intelligently executed on the cloud side, which significantly reduces resource consumption while ensuring the timeliness of semantic response; finally, the large model and semantic web technology are deeply integrated, through accurate conversion from natural language to SPARQL, multi-source knowledge reasoning and humanized result generation, the accuracy and simplicity of the output result are guaranteed.

[0138] Note that the above merely describes preferred embodiments of the present application and the principles of the technology applied. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and that various obvious changes, modifications and substitutions can be made without departing from the scope of the present application. Therefore, although the present application has been described in detail through the above embodiments, the present application is not limited to the above embodiments, and can include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the claims.

Claims

1. A large model and ontology mapping based device semantic reasoning system, characterized in that, The application relates to a device semantic reasoning method based on a large model and an ontology mapping. The first acquisition module is used for acquiring an OPC UA standard ontology and field information provided by a device manufacturer, and constructing a field ontology library according to the acquired standard ontology and field information; The second acquisition module is used for acquiring node metadata of edge devices collected by an edge side OPC UA server, and generating triples conforming to an RDF grammar according to the acquired node metadata; The matching module is used for performing semantic matching on the field ontology library and the triples conforming to the RDF grammar through an ontology mapping module, and constructing a semantic reasoning module according to a semantic correspondence generated by matching; The matching module specifically comprises: The definition module is used for taking the triples conforming to the RDF grammar as source data, and taking the standard ontology in the field ontology library as target ontology; An extracting module is configured to extract information related to the entity data from the source data to obtain source entity e S , and construct a first entity term inverted index table; extract information related to the entity data from the target ontology to obtain target entity e T , and construct a second entity term inverted index table; The processing module is used for processing the source terms in the first entity term inverted index table and the target terms in the second entity term inverted index table based on the SBERT pre-training encoder respectively, obtaining a source term vector v(ω S ) corresponding to the source terms and a target term vector v(ω T ) corresponding to the target terms, and storing the source term vector v(ω S ) and the target term vector v(ω T ) in corresponding source-side vector libraries and target-side vector libraries respectively. A constructing module is configured to construct a source entity candidate list of a target entity according to a source term vector v(ω S ), a target term vector v(ω T ) respectively , a target entity candidate list of a source entity ; The mapping module is used to map the target entity candidate list. Source entity candidate list Determine the source entity e S With target entity e T The mapping relationship between them is used to construct a semantic reasoning module.

2. The device semantic reasoning system based on large model and ontology mapping according to claim 1, characterized in that, The source term vector v(ω S ) corresponding to the source term in the processing module is obtained, and the target term vector v(ω T ) corresponding to the target term is obtained, and is expressed as: v(ω S )=SBERT(ω S ) v(ω T )=SBERT(ω T ) wherein ω S , ω T respectively denote source and target terms.

3. The device semantic reasoning system based on large model and ontology mapping according to claim 2, characterized in that, The source entity candidate list is constructed according to the source term vector v(ω S ) and the target term vector v(ω T ) Specifically: For each source term ω S in the source entity e S , a cosine similarity y S (ω T ,ω w ) is calculated between the source term ω S and all target terms ω T in the target side vector library; According to the similarity y w (ω S ,ω T ) in all target terms ω T , the top k most similar target term vectors v(ω T ) are screened out, obtaining the source term candidate set S of each source term ω ; According to each source term ω S a source term candidate set Constructing a candidate set of all source terms ω S , resulting in a target entity candidate set of source entities e S ;​ For the target entity e T , calculate the entity-level similarity y e (e S ,e T ) between the source entity e S and the target entity e T , sort the target entities in the target entity candidate set in descending order of similarity y e (e S ,e T ), and obtain a target entity candidate list of the source entity.

4. The device semantic reasoning system based on large model and ontology mapping according to claim 3, characterized in that, The source entity candidate list of the target entity is constructed according to the source term vector v(ω S ) and the target term vector v(ω T ) Specifically: For target entity e T Each target term ω T Calculate the target term ω T With all source terms ω in the source side vector library S cosine similarity y w (ω T ,ω S ); According to the similarity y w , (ω T , ω S ) in all source terms ω S , the top k most similar source term vectors v(ω S ) are screened out for each target term ω T , to obtain a target term candidate set ; According to each target term ω T a target term candidate set Constructing a candidate set of all target terms ω T , get the source entity candidate set of target entity e T ;​ For the source entity e S , calculate the entity-level similarity y T (e S ,e e ) between the target entity e T and the source entity e S , sort the source entities in the source entity candidate set in descending order of the similarity y e (e T ,e S ), and obtain a target entity candidate list of the source entity .

5. The device semantic reasoning system based on large model and ontology mapping according to claim 1, characterized in that, The mapping module determines the mapping relationship between the source entity e S and the target entity e T is specifically: For each source entity e S , obtain a list of target entity candidates for the source entity ; for each target entity e T , obtain a list of source entity candidates for the target entity ; determine whether each source entity e S , target entity e T satisfies bidirectional correspondence, if yes, discard the current candidate pair, pop the next candidate target entity e from the source entity's target entity candidate list , and re-perform bidirectional identification; if no, determine whether it satisfies high-confidence bidirectional HCB correspondence, if yes, directly add the current candidate pair (e S , e T ) to the final mapping set, and terminate the search for the current source entity e S ; if no, trigger a large language model LLM prompt; determining a mapping relationship between the source entity e and the target entity e according to a large language model LLM prompt. S T determining a mapping relationship between the source entity e and the target entity e according to a large language model LLM prompt.​ 6. The large model and ontology mapping based device semantic reasoning system of claim 5, wherein, The condition of the bidirectional correspondence is that the source entity e S is in the source entity candidate list of the target entity e and the target entity e T is in the target entity candidate list of the source entity e .

7. The large model and ontology mapping based device semantic reasoning system of claim 6, wherein, The high-confidence bidirectional HCB corresponds to the condition that the source entity e S is the highest priority candidate in the source entity candidate list for the target entity, and the target entity e T is the highest priority candidate in the target entity candidate list for the source entity.

8. The device semantic reasoning system based on large model and ontology mapping according to claim 1, characterized in that, The mapping module specifically comprises: According to the determined mapping relationship, a mapping set is obtained, the mapping set is converted into a triple form conforming to the RDF grammar, the mapping set in the triple form after conversion is stored in an RDF library, and the stored mapping set is combined with a large language model LLM to generate a semantic reasoning module.

9. A large model and ontology mapping-based device semantic reasoning method, characterized by, The application further relates to a device semantic reasoning system based on a large model and an ontology mapping. S1. Receiving a natural language question input by a client, extracting RDF triples corresponding to the natural language question by the semantic reasoning module, and performing reasoning analysis on edge device data to obtain an edge device state or a result of a related query; S2. Returning the edge device state or the result of the related query obtained by the semantic reasoning module to the client in the form of natural language.

Citation Information

Patent Citations

  • Equipment data domain ontology construction and application method

    CN116226395A

  • Entity matching method and system based on combination of multiple strategies and multiple large language models

    CN118467606A