Multi-source heterogeneous OPC UA equipment semantic reasoning method based on ontology mapping
Through the event-like semantic similarity calculation method based on ontology mapping and supplementary knowledge of OWL, combined with the automatic reasoning of Apache Jena engine, the problem of semantic interoperability between OPC UA devices is solved, and efficient device information query and heterogeneous device integration are achieved. , overcome the complexity and high cost problems of the prior art.
Patent Information
- Application Number
- CN202411282936.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-13
- Publication Date
- 2025-01-03
AI Technical Summary
Semantic interoperability between OPC UA devices is difficult to achieve, resulting in the challenge of understanding and interpreting data and information between different devices and systems in industrial production, and existing methods are complex and time-consuming, and cannot effectively solve the identification of new access devices. question.
Using an event-like semantic similarity calculation method based on ontology mapping, the OPC UA information model is converted into a resource description framework triple, using OWL for knowledge supplementation, and combining with Apache Jena engine for information query and reasoning, device type classification and information are realized Automatic construction of the model.
It improves the accuracy and efficiency of information query of OPC UA equipment, supports the integration of heterogeneous devices, simplifies the solution process of semantic interoperability problems, and reduces the complexity and cost of manually constructing information models.
Smart Images

Figure CN119250061A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a semantic reasoning method for OPC UA multi-source heterogeneous devices, and in particular to an event-ontology-mapping-based SemanticSimilarity Calculation (ESSC) method. Background Art
[0002] With the rise of Industry 4.0, communication between devices is becoming increasingly important. In the era of the Internet of Everything, OPC UA emerges as a unified architecture for communication on the open platform of Industry 4.0. OPC UA is a unified communication protocol that facilitates communication between devices and systems from different vendors without having to care about the details of the underlying implementation. OPC UA standardizes and unifies communications from the field level to the information level, adding metadata to each data object to describe its type, structure, and characteristics. However, interoperability issues may still arise between OPC UA products from different vendors, which poses a challenge when integrating devices from different manufacturers. Therefore, OPC UA meets the requirements of syntactic interoperability at the information layer, but the semantic interoperability of the information layer remains undetermined. Based on the above analysis, a method is needed to solve interoperability at the semantic level for the information model of OPC UA.
[0003] The OPC UA information model is essentially a triple knowledge base, consisting of nodes and edges that represent the relationships between nodes. The data organization of this information model is similar to a knowledge graph, so that the OPC UA information model can be formally regarded as a special knowledge graph, called the Information Model Knowledge Graph (IMKG). Then, a task that calculates the semantic similarity of event classes can be used to calculate the similarity of the explained concepts between data objects and finally confirm whether they belong to the same category. Based on the above analysis results, the ontology mapping of events is performed to support the integration of heterogeneous devices. The unseen components and attributes of the newly connected equipment are linked to the corresponding IMKG, thereby realizing the automatic online construction of the OPC UA information model of the newly connected equipment in the open manufacturing environment.
[0004] The biggest obstacle to the widespread adoption of IoT and automation systems is semantic interoperability. Industry organizations are trying to implement semantic data models that cover a wide range of industries and systems, for example, the Object Management Organization and the global standard protocol and Schema.org. However, they are based on industry segmentation and are not formally defined at the semantic level. In this case, the solution to semantic interoperability is to add meaning to the data. However, data from smart devices is stored and transmitted in multiple formats, with inconsistent and non-standardized naming conventions, so there are limited descriptions to understand their meaning. Currently, there is a considerable literature on solving the interoperability problem from a semantic level. The early approach of manually building OPC UA information models was cumbersome, error-prone, and costly, which hindered the widespread industrial application of different devices.
[0005] There are several challenges in implementing semantic reasoning methods for OPC UA multi-source heterogeneous devices. First, in industrial production, different devices and systems need to be able to understand and interpret each other's data and information, but due to the lack of unified semantic standards, such interoperability is difficult to achieve. Second, there are a large number of different types of devices in industrial environments, and the data formats and communication protocols of these devices vary, making them difficult to integrate. Finally, when processing large-scale industrial data, data management and query efficiency are also important challenges.
[0006] The process of dealing with multi-source heterogeneous data fusion is the problem of device classification. The similarity of the interpretation concepts between data objects is calculated by using a model that calculates the semantic similarity of event classes to confirm whether they belong to the same category. Event ontology mapping is then performed to support the integration of heterogeneous devices. The main problem at present is that the semantic calculation is too complicated, resulting in a long ontology mapping time. Most similarity calculation methods do not combine the semantic similarity calculation of event class nodes with the semantic similarity calculation of node relationships to balance text diversity, which does not solve the problem of identifying newly accessed devices well. Therefore, it is necessary to provide a method that combines the semantic similarity calculation of event category nodes with the semantic similarity calculation of node relationships. Summary of the invention
[0007] In view of the deficiencies of the above-mentioned prior art, the present invention provides a query reasoning method for device information in open production control and unified architecture based on ontology mapping. The method extracts the information model of the OPC UA server as a resource description framework triple, and uses the Web Ontology Language (OWL) to supplement the meaning of the data to establish the OPC UA ontology. Then, an event-ontology-mapping-based Semantic Similarity Calculation (ESSC) is used to merge and classify various data objects. The content of the invention includes: construction of an OPC UA information model based on RDF; a knowledge supplement method of the OPC UA information model based on OWL; a device type classifier implemented based on the ESSC similarity calculation method; and an OPC UA device information query method based on the Apache Jena query reasoning engine. The purpose of the present invention is achieved through the following technical solutions. The method comprises the following steps:
[0008] 1) Collect the OPC UA server information model using an automatic node crawler;
[0009] 2) Based on 1), the normalized data is passed into the ontology builder to construct the ontology;
[0010] 3) Based on 2), the OWL knowledge completion model is used to supplement the ontology knowledge of the graph-structured OPC UA information model;
[0011] 4) Based on 3), a semantic similarity calculation method ESSC of event-type ontology mapping is used to merge and classify various data objects;
[0012] 5) Based on 4), the specific resource description framework query language SPARQL about the OPC UA device information is input into the automatic reasoning engine of the Apache Jena engine for information query. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 Schematic diagram of device information query method;
[0014] Figure 2 ESSC algorithm execution flow chart;
[0015] Figure 3 ESSC structural similarity algorithm execution flow chart. DETAILED DESCRIPTION
[0016] The features and exemplary embodiments of various aspects of the present invention will be described in detail below. The following description covers many specific details in order to provide a comprehensive understanding of the present invention. However, it will be apparent to those skilled in the art that the present invention can be implemented without the need for some of these specific details. The following description of the embodiments is merely to provide a clearer understanding of the present invention by illustrating examples of the present invention. The present invention is by no means limited to any specific configuration and algorithm proposed below, but covers any modification, replacement and improvement of related elements, parts and algorithms without departing from the spirit of the present invention.
[0017] The following will refer to the attached Figure 1 A device information query method based on OPC UA according to an embodiment of the present invention is described, and the specific steps are as follows:
[0018] In the first step, the OPC UA server information model is collected using an automatic node crawler.
[0019] First, you need to configure the OPC UA server node in the cluster and develop a data node collector to obtain data from the OPC UA server. In order to store historical data and hot data for other applications, a database is established in MySQL according to node classification, and historical data is stored according to device category, which improves the efficiency of historical data query. The recently collected and converted data is cached in memory through the Redis cache database, which improves the client's request efficiency. In the system, the main thread needs to complete protocol conversion, historical data storage, hot data storage, logs, and alarms, but the execution efficiency of the main thread is very low and the delay of protocol conversion is large. In order to solve this problem, RabbitMQ message middleware is used to decouple historical storage, hot data storage, and other functions from protocol conversion, which improves the execution efficiency of the system main thread and improves the system throughput.
[0020] In the second step, the normalized data in the first step is passed into the vector construction model for feature extraction training.
[0021] First, all entities and relations are required to be embedded into a continuous vector space. After embedding, a text sequence of a given length n can be represented as an embedding matrix is the character embedding of character i, and the embedding dimension is d. If the text length exceeds n, it is truncated; otherwise, it is padded with zeros. Then, the embedding matrix C is convolved and the convolution kernel is used to extract local information features; the feature a1 can be obtained as:
[0022] a1=f(k·c i:i+h-1 )
[0023] Where f(·) is the activation function. i:i+h-1represents the embedding matrix C extracted from the i-th row to the i+h-1th row of c. h represents the window size, are filters that extract different feature maps, is a bias term.
[0024] After the matrix is scanned by the convolution kernel, the feature map a=[a1,a2,…,a n-h+1 ]. In order to simplify the feature description, it is necessary to further extract representative features. The 1-MAX pooling strategy is adopted to select the maximum value from the feature map a obtained by the convolution layer.
[0025] a′=max(a)
[0026] Where a' represents the maximum value of feature map a. The features obtained in the pooling layer are connected to form a feature vector. This feature vector contains different types of information and is used to calculate semantic similarity. Finally, the feature vector is input into the fully connected layer to calculate device similarity.
[0027] The third step is to use the OWL knowledge completion model to supplement the ontology knowledge of the graph-structured OPC UA information model.
[0028] In order to realize the heterogeneous device integration architecture based on OPC UA, an automatic information model construction method based on the device type recognition model of ESSC similarity calculation method and open world knowledge completion on IMKG is proposed. The automatic construction process of OPC UA information model first collects the data frame of the newly accessed device, and then inputs the word list of the data frame into the trained device type recognition model to obtain the device type. At the same time, the device type is obtained by calculating the similarity of the event class, and then the unknown entity is linked to the corresponding IMKG through the open world knowledge completion model. Finally, the information model of the device is extracted from the IMKG.
[0029] In the fourth step, the semantic similarity calculation method ESSC of event-type ontology mapping was used to merge and classify various data objects.
[0030] An event class is an abstract concept that can be defined as a six-tuple consisting of an action a, an object o, the time of the event t, the location of the event p, and the state of the event s. It can also represent a group of events with common characteristics, for example, C1 = {e 11 ,e 12 ,…,e1n} and C2={e 21 ,e 22 ,…,e 2n}, where n and m represent the number of elements in C1 and C2. A classic set similarity algorithm is proposed to calculate the ontology similarity. The similarity between C1 and C2 is expressed as So (C1,C2), that is:
[0031]
[0032] Among them C 1i represents the i-th element in C1, C 2j represents the jth element in C2. S e (C1,C2) represents the element similarity of C1 and C2. It is calculated by multiplying the syntactic similarity and semantic similarity by their weights respectively and then adding them together. That is:
[0033] S e (C1,C2)=δ q S q (C1,C2)+δ t S t (C1,C2)
[0034] Among them, δ q and δ t is the weight of syntactic similarity and semantic similarity, and δ q +δ t =1. In addition, S q (C1,C2) and S t (C1, C2) represents the syntactic similarity and semantic similarity between C1 and C2, respectively, which are obtained from the following formulas.
[0035]
[0036] Among them, φ(C 1i ,C 2j ) are two elements C 1i and C 2j The longest common substring between them, l(·) represents the length of the event. When calculating semantic similarity, it is important to understand the concept of sememe. Sememe is the smallest semantic unit in a language, which is the basic element that constitutes vocabulary and language meaning. The formula for calculating semantic similarity is as follows:
[0037]
[0038] Among them, C1 and C2 are two groups of semes, |C1| and |C2| are the number of semes in these two groups, is the number of semantically related sememes in the two groups, is the number of pairs in the semantic set that have a semantic relationship. Finally, the semantic similarity between C1 and C2 is denoted as S(C1,C2), and its formula is as follows:
[0039]
[0040] Among them, η k Indicates the degree of influence of each part on the whole system. The final similarity is calculated by multiplying the values of each similarity formula by their respective weights and then adding them together. In order to avoid deviations caused by human factors, the present invention uses a sigmoid function (σ(x)) to calculate the weight, that is:
[0041]
[0042] Among them, x is the value of syntactic similarity or semantic similarity, -5 is a constant that controls the smoothness of the curve, which helps to avoid generating abnormal values, and -α is a parameter that controls the position of the symmetric center of the curve. The execution flow chart of the ESSC algorithm is shown in Figure 1 , the execution flow chart of ESSC structural similarity algorithm is as follows Figure 2 shown.
[0043] In the fifth step, the specific resource description framework query language SPARQL about the OPC UA device information is input into the automatic reasoning engine of the Apache Jena engine for information query.
[0044] To answer the question "Which variables belong to a certain machine?", a significant problem will arise in the OWL model without semantic reasoning. The components located at the third layer in the knowledge graph cannot be classified into the equipment types at the first layer. This means that the relationship between superclasses and subclasses must be manually annotated, which leads to an increase in data volume and increased query difficulty. Therefore, class hierarchy reasoning and reverse reasoning are introduced to ensure the completeness of the query. By using the OWL reasoning engine, subclasses within OPC UA nodes can be automatically identified as superclasses without explicitly specifying the relationship between them.
[0045] When the equipment encounters an abnormal event, the architecture queries the problem and issues an abnormal alarm. The architecture can remind the staff to switch from automatic mode to manual mode, helping to prevent abnormal situations from occurring during the production process.
[0046] Technical contribution of the present invention
[0047] Solving the interoperability problem of OPC UA devices from the semantic level is the biggest obstacle to the widespread application of the Internet of Things and automation systems. The various protocols currently proposed are based on industry segmentation and are not formally defined at the semantic level. In this case, the solution to semantic interoperability is to increase the meaning of data. Data from smart devices are stored and transmitted in multiple formats, with inconsistent naming conventions and low standardization, resulting in limited descriptions to understand their meaning. At present, quite a number of methods are studying to solve the interoperability problem from the semantic level. In the early days, the method of manually constructing OPC UA information models was adopted, but this method was cumbersome, error-prone, and costly, which hindered the widespread application of different devices in industry. On this basis, experts mapped the data format used for exchange in the communication protocol to the OPC UA information model to achieve compatibility. However, none of the above methods effectively solves the interoperability problem at the semantic level and cannot be widely promoted in industrial production. The present invention proposes an OPC UA device information query reasoning method based on ontology mapping to solve the semantic interoperability problem in industrial production. The method can overcome the above problems and achieve OPC UA device information query with higher accuracy and efficiency. Compared with existing work, the main contributions of the present invention are as follows:
[0048] (1) The present invention extracts the OPC UA information model and converts it into a graphical structure. Then, the webpage ontology language is used to supplement the meaning of the data, providing a clear structure and an effective interpretation of the meaning of the data object.
[0049] (2) The present invention designs a model for calculating semantic similarity of event classes. It calculates the similarity of interpretation concepts between data objects to confirm whether they belong to the same category. Then event ontology mapping is performed to support the integration of heterogeneous devices.
[0050] (3) The present invention can infer and query the information of multi-source heterogeneous devices of OPC UA by inputting specific SPARQL queries into the automatic reasoning mechanism of the Apache Jena engine.
[0051] (4) The present invention uses a reasoning query method to integrate multi-source heterogeneous OPC UA information models, which not only improves the accuracy of the overall information model, but also enhances the ability of information query and reasoning.
[0052] The present invention is a query reasoning method for equipment information in an open production control and unified rack based on ontology mapping proposed above. It should be understood that the detailed description of the technical solution of the present invention with the help of the preferred embodiment is illustrative rather than restrictive. A person of ordinary skill in the art can modify the technical solutions recorded in each example based on reading the specification of the present invention, or make equivalent replacements for some of the technical features therein, however, these modifications or replacements do not make the essence of the corresponding technical solution deviate from the spirit and scope of the technical solutions of each example of the present invention.
Claims
1. A method for querying device information in OPC UA (Object Linking and Embedding for Process Control Unified Architecture) based on ontology mapping, characterized in that Supporting cross-platform and semantic integration, the method includes the following steps: 1) Use an automatic node crawler to collect OPC UA sample server data, which includes information models such as machine tools, woodworking tools, and robot arms; 2) The processed data in 1) is passed to the ontology automatic builder Lion, which constructs the ontology based on the industry standard Ontology Design Pattern (ODP); the Resource Description Framework (RDF) and Web Ontology Language (OWL) created by the builder are used to map and construct the ontology of the data in the OPC UA server; 3) Based on 2), various data objects are merged and classified using the event-ontology-mapping-based Semantic Similarity Calculation (ESSC); 4) extracting the classification results obtained in 3) into a subclass for each category; then storing these extracted events in Apache Jena, a database tool specifically used to store and manage triple data, and providing them to the inference engine; Then, SPARQL queries are used instead of OPC UA queries to support various interaction methods such as human-machine interfaces.
2. The method according to claim 1, characterized in that The OPC UA-based simulation server constructs an ontology model of the OPC UA information model, including: The OPC UA information model is standardized; the standardized OPC UA information model data is passed into the automatic ontology builder for ontology mapping and construction. On this basis, the semantic similarity calculation method of event-type ontology mapping is used to calculate the similarity of the ontology, so as to obtain the complete ontology structure of the OPC UA information model.
3. The method according to claim 1, characterized in that Use the automatic node crawler to collect data from the OPC UA sample server, including: Understand and analyze the operating status and performance indicators of various industrial equipment; obtain data such as equipment parameter settings, operating status, diagnostic information, and control instructions, and then standardize and normalize the data; on this basis, obtain the basic data of the final OPC UA node information.
4. The method according to claim 2 and claim 3, characterized in that The converting of OPC UA information model data into a resource description framework language comprises: The RDF language can describe the device's parameter settings, operating status, diagnostic information, and control instructions, etc., providing a higher level of interoperability and flexibility, making data exchange between different systems more convenient and efficient.
5. The method according to claim 2, characterized in that: The converting of the OPC UA information model resource description framework language into the Web ontology language includes: This operation can fully understand and analyze the operating status and performance indicators of various industrial equipment; after converting the information model into Web ontology language, the data becomes more semantic and structured, which is convenient for cross-platform and cross-domain sharing and integration.
6. The method according to claim 2, characterized in that The semantic similarity calculation method based on event class ontology mapping includes: Obtain the OPC UA server information model dataset; classify the nodes in different machine information models into six categories, and calculate the grammatical similarity, semantic similarity, and structural similarity respectively; and obtain the final OPC UA node similarity calculation results.
7. The method according to claim 6, characterized in that The ESSC-based merging and classification of various data objects include: Various data objects are merged and classified, and the event class is divided into a six-tuple for splitting. Then the semantic similarity, grammatical similarity and structural similarity of the event class are calculated, and finally the similarity result of the event class is obtained.
8. The method according to claim 1, characterized in that: The graph structured and supplemented OPC UA data model for reasoning and querying includes: Extract events stored in Apache Jena; use SPARQL queries instead of OPC UA queries to support a variety of interactions.
