A method of converting opcua data to internet of things standard data
By converting OPC UA server data into IoT standard data through the OPCUA protocol, the mapping problem of node data on the IoT platform is solved, enabling unified display and reliable access of device data.
Patent Information
- Application Number
- CN202410667409.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-28
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2044-05-28
AI Technical Summary
Existing technologies struggle to effectively map node data from OPC UA servers to IoT platforms, especially when dealing with complex data types and standardized IoT data formats.
Device data is collected and converted into standard IoT data format using the OPCUA protocol. OPCUA nodes are mapped to IoT device attributes, including node mapping for both simple and complex data types, and JSON objects are generated to populate attribute field values.
It achieves accurate mapping and unified display of OPC UA server device data on the IoT platform, solves the problems of data source and organization structure, and supports reliable access of industrial equipment to the IoT.
Smart Images

Figure CN118474184B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of mapping and conversion between OPCUA data and IoT devices, and more particularly to a method for converting OPCUA data into IoT standard data. Background Technology
[0002] The Internet of Things (IoT) technology integrates technologies from the electronics, communications, and computer fields to enable interconnection of things on the basis of the internet. The IoT is the foundation for the interconnection of everything and the basis for future applications such as smart factories, smart cities, smart communities, and smart homes.
[0003] OPC Unified Architecture (OPC UA) is a new technology created by the OPC Foundation that is more secure, reliable, and neutral (vendor-independent) for transmitting raw data and pre-processed information from the manufacturing floor to production planning or Enterprise Resource Planning (ERP) systems. Using OPC UA technology, all the necessary information can reach every authorized application and every authorized person anytime, anywhere.
[0004] OPC UA is manufacturer-independent, applications can communicate with it, developers can use it to develop applications in different programming languages, and it is supported on different operating systems. OPC UA makes up for the shortcomings of existing OPC applications and adds important features such as platform independence, scalability, high availability, and Internet services.
[0005] Today, OPC UA has become a bridge connecting enterprise-grade computers with embedded automation components—independent of Microsoft, UNIX, or other operating systems.
[0006] In the Internet of Things (IoT), devices need to be connected and displayed, which requires device modeling. This unifies the various parameters and attributes of devices across different IoT platforms, constructing a standardized device data model. This model allows for the centralized display of device parameters, creating a mapping of the real device onto the IoT platform.
[0007] The data in the OPCUA server corresponds to individual nodes, with each node representing a piece of data. We need to map these nodes from the OPCUA server to an IoT platform or gateway, organizing them into a standardized device object—a collection of device data.
[0008] IoT platforms typically construct device data models using various data structures, ranging from simple int, float, double, String, date, and boolean to complex data types such as JSON objects, arrays, and JSON arrays. Matching these data types with nodes in OPCUA and mapping OPCUA nodes to complex, nested data types presents a challenge. Furthermore, standardizing this OPCUA data into a unified IoT data format is also a significant challenge. Summary of the Invention
[0009] To address the aforementioned technical issues, this invention provides a method for converting OPCUA data into IoT standard data. The aim is to map device data from the OPCUA server to the IoT platform and report the data.
[0010] The technical solution of this invention is:
[0011] A method for converting OPCUA data into IoT standard data, wherein the OPCUA protocol is used to collect device data and convert the data in OPCUA into the standard data format of the IoT platform, thereby reporting the standard format data to the cloud platform.
[0012] The mapping between OPCUA nodes and IoT device attributes includes node mapping for simple data types (int, long, float, double, String, Boolean, enum, date) and node mapping for complex data types (struct, array). IoT standard data generation includes initializing JSON and populating attribute field values.
[0013] Furthermore,
[0014] The mapping feature between OPCUA nodes and IoT devices is that the organizational structure of products and devices in the IoT is mapped according to the organizational relationship between OPCUA devices' groups and items, and a group of OPCUA data nodes of the same real device is mapped to device attributes in the IoT platform.
[0015] The characteristic of converting opcua data into IoT standard data is that a set of attributes of a group of real devices is used to form a JSON object, which receives real data and populates the data into the fields of the corresponding attributes.
[0016] Furthermore,
[0017] The mapping of opcua nodes to IoT device attributes includes the following steps:
[0018] (1) Mapping organizational structure
[0019] The equipment model is organized as follows:
[0020] Product → Equipment → Attribute. An item is a collection of products, while a product is a collection of equipment with the same characteristics.
[0021] For OCPUA, the OPC object includes server, group, and item; server is mapped to an item, group is mapped to a product and device, and item is mapped to an attribute.
[0022] (2) Mapping Items
[0023] Each OPCUA server is uniquely identified by its address and mapped to a project.
[0024] (3) Mapping products and equipment
[0025] Each server's groups are created according to the organizational relationships of products and devices in the Internet of Things.
[0026] (4) Mapping device properties
[0027] Each item in a group maps its node ID to a specific attribute identifier of the device in the IoT product.
[0028] Furthermore,
[0029] Mapping device attributes involves different data types. Different data types necessitate different strategies when storing attribute nodes, requiring different storage methods for the device attribute definitions on the IoT platform.
[0030] For data types without a parent-child hierarchy, the definition of IoT device attributes should include at least the following:
[0031] ④ Attribute identifiers in the Internet of Things
[0032] ⑤ In OPCUA, the node ID used to locate the source of specific data.
[0033] ⑥ Data types (int, float, double, long, boolean, date, String)
[0034] Mapped storage can be achieved by mapping attribute identifiers in the Internet of Things (IoT) to node IDs in OPCUA.
[0035] For data types with parent-child hierarchical relationships, the definition of IoT device attributes must include at least the following:
[0036] ⑧ Attribute Identifiers (in the Internet of Things)
[0037] 9. Node ID (in OPCUA, used to locate the source of specific data)
[0038] ⑩ Data types (int, float, double, long, boolean, date, String)
[0039] Is it a root attribute?
[0040] Parent node identifier
[0041] Number of elements (when used as the root property of an array type)
[0042] Element index (a sub-property of array type)
[0043] When the data type is array, set the number of elements and set the root property to true;
[0044] Set the parent node identifier, element index, and root attribute to false.
[0045] When the type is struct, set the root property to true.
[0046] Set the parent node identifier, and set the root attribute to false.
[0047] Furthermore,
[0048] Generation of IoT standard data
[0049] ④ Construct an empty JSON object with fields for each device attribute, and set the values to empty;
[0050] ⑤ OPCUA data matching: Matching is performed based on attribute identifiers and OPCUA nodes;
[0051] ⑥ Fill in the positions of the JSON objects mentioned above
[0052] c) Data types without a parent-child hierarchy: directly find the corresponding field in the JSON object.
[0053] d) Data types with parent-child hierarchical relationships:
[0054] i. Arrays: Find and fill elements using data type, identifier, element index, and parent node identifier.
[0055] Fill the child attributes under the corresponding parent node;
[0056] ii.Struct type: Find and populate the child attributes under the corresponding parent node by using the data type, identifier, and parent node identifier.
[0057] The beneficial effects of this invention are
[0058] This invention enables one-to-one matching of device attributes in the OPCUA server and organizes them into a model mapping of real devices by setting device attributes through an IoT platform. This invention can accurately map each real device, avoiding the loss of organizational structure due to the overly granular node data in the OPCUA server, and solving the problem of difficulty in finding the true source and function of data. Therefore, it provides a feasible and reasonable solution for manufacturers using OPCUA to connect their devices to IoT platforms, helping industrial equipment to better connect to and utilize the Internet of Things. Attached Figure Description
[0059] Figure 1 This is a schematic diagram of the workflow of the present invention;
[0060] Figure 2 This is a schematic diagram illustrating the overall analysis of the present invention. Detailed Implementation
[0061] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0062] This invention provides a method for converting OPCUA data into IoT standard data. It refers to a method that uses the OPCUA protocol to collect device data and converts the data from OPCUA into the standard data format of the IoT platform, thereby reporting the standard format data to the cloud platform. This invention consists of two parts: mapping OPCUA nodes to IoT device attributes and generating IoT standard data. The mapping of OPCUA nodes to IoT device attributes includes mapping nodes of simple data types (int, long, float, double, String, Boolean, enum, date) and mapping nodes of complex data types (struct, array). The generation of IoT standard data includes initializing JSON and filling in the values of attribute fields.
[0063] 1. OPCUA node and IoT device attribute mapping
[0064] The mapping of opcua nodes to IoT device attributes includes the following steps:
[0065] (I) Mapping Organizational Structure
[0066] Taking mainstream IoT platforms as an example, device models are typically organized as follows:
[0067] Product → Equipment → Attribute. An item is a collection of products, while a product is a collection of equipment with the same characteristics.
[0068] For OCPUA, the basic OPC objects include server, group, and item. server is mapped to an item, group to a product and device, and item to an attribute.
[0069] (II) Mapping Items
[0070] Each OPCUA server is uniquely identified by its address and mapped to a project.
[0071] (III) Mapped Products and Equipment
[0072] Each server's groups are created according to the organizational relationships between products and devices in the Internet of Things (IoT). For example, if product A → device B, then group A → group B is created. The node ID of the group...
[0073] (iv) Mapping device attributes
[0074] Each item in a group maps its node ID to a specific attribute identifier of the device in the IoT product.
[0075] 2. Storage of device attributes
[0076] When mapping device attributes in step 1, different data types are involved. Different data types require different strategies when storing attribute nodes, necessitating different storage methods for the device attribute definitions on the IoT platform.
[0077] (a) Storage of simple data types (without parent-child hierarchical relationships)
[0078] When defining the attributes of IoT devices, at least the following content must be included:
[0079] ⑦ Attribute Identifiers (in the Internet of Things)
[0080] ⑧ Node ID (in OPCUA, used to locate the source of specific data)
[0081] ⑨ Data types (int, float, double, long, boolean, date, String)
[0082] By mapping attribute identifiers in the Internet of Things (IoT) to node IDs in OPCUA, mapped storage can be achieved. (II) Storage of complex data types.
[0083] When defining the attributes of IoT devices, at least the following content must be included:
[0084] Attribute identifiers (in the Internet of Things)
[0085] Node ID (in OPCUA, used to locate the source of specific data)
[0086] Data types (int, float, double, long, boolean, date, String)
[0087] Is it a root attribute?
[0088] a) For a struct type: structA:{B,C}, then A is the root attribute, and B and C are child attributes.
[0089] Parent node identifier
[0090] Number of elements (when used as the root property of an array type)
[0091] 21. Element index (a sub-property of an array type)
[0092] When the data is an array, such as A:[B,C]
[0093] A needs to have its element count set, so the root property should be set to true.
[0094] B and C need to set the parent node identifier, element index, and the root attribute to false.
[0095] When the type is struct, such as A:{B:1,C:2}
[0096] A needs to have its root property set to true.
[0097] B and C need to set a parent node identifier, and the root attribute should be set to false.
[0098] 3. Generation of IoT standard data
[0099] ② Construct an empty JSON object with fields for each device attribute, and set the values to empty.
[0100] ③ OPCUA data matching: Matching is performed based on attribute identifiers and OPCUA nodes.
[0101] ④ Fill in the positions of the JSON objects mentioned above
[0102] a) Simple data types: Directly find the fields corresponding to the JSON object.
[0103] b) Complex data types:
[0104] i. Array: Find and populate the child attributes under the corresponding parent node by data type, identifier, element index, and parent node identifier.
[0105] ii.ii.Struct type: by data type, identifier, parent node identifier.
[0106] The above description is merely a preferred embodiment of the present invention and is used only to illustrate the technical solution of the present invention, and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.
Claims
1. A method for converting OPCUA data into IoT standard data, characterized in that, The data in OPCUA is mapped to the device attributes of the IoT platform through the node ID, and the OPCUA data is organized into the IoT standard data format to realize the uplink of device data in OPCUA to the IoT platform. The mapping of opcua nodes to IoT device attributes includes the following steps: (1) Mapping organizational structure The equipment model is organized as follows: Product → Equipment → Attribute. An item is a collection of products, while a product is a collection of equipment with the same characteristics. For OCPUA, the OPC object includes server, group, and item; server is mapped to project, group to product and device, and item to property, respectively. (2) Mapping Project Each OPCUA server is uniquely identified by its address and mapped to a project. (3) Mapping products and equipment Each server's groups are created according to the organizational relationships of products and devices in the Internet of Things; (4) Mapping device attributes Each item in a group maps its node ID to a specific attribute identifier of the device in the IoT product. The generation of IoT standard data includes the following steps: Construct an empty JSON object with fields for each device attribute, and set the values to empty; OPCUA data matching is performed based on attribute identifiers and OPCUA nodes. Fill in the positions of the JSON objects mentioned above.
2. The method according to claim 1, characterized in that, This includes two aspects: mapping OPCUA nodes to IoT devices and converting OPCUA data into IoT standard data. The mapping between the OPCUA nodes and IoT devices maps the organizational structure of products and devices in the IoT according to the organizational relationship between the OPCUA devices' groups and items, and maps a group of OPCUA data nodes of the same real device to device attributes in the IoT platform. The opcua data is converted into IoT standard data, and a set of attributes of a group of real devices is formed into a JSON object. The real data is received and the data is filled into the fields of the corresponding attributes.
3. The method according to claim 1, characterized in that, When mapping device attributes, different data types are involved; different data types require different strategies when storing attribute nodes, and different storage methods are used to store device attribute definitions on the IoT platform.
4. The method according to claim 3, characterized in that, For data types without a parent-child hierarchy, the definition of IoT device attributes should include at least the following: Attribute identifiers in the Internet of Things The node ID used in opcua to locate the source of specific data. Data types include int, float, double, long, boolean, date, and String. Mapped storage can be achieved by mapping attribute identifiers in the Internet of Things (IoT) to node IDs in OPCUA.
5. The method according to claim 3, characterized in that, For data types with parent-child hierarchical relationships, the definition of IoT device attributes must include at least the following: Attribute identifiers in the Internet of Things In opcua, a node ID is used to locate the source of specific data. Data types include int, float, double, long, boolean, date, and String. Is it a root attribute? Parent node identifier Number of elements, when the root property of an array type Element index, array type sub-property When the data type is array, set the number of elements and set the root property to true; Set the parent node identifier, element index, and root attribute to false. When the type is struct, set the root property to true. Set the parent node identifier, and set the root attribute to false.
6. The method according to claim 1, characterized in that, Fill the positions in the JSON object mentioned above, specifically including: For data types without a parent-child hierarchy: directly find the corresponding field in the JSON object. Data types with parent-child hierarchical relationships: Arrays: Find and populate child attributes under the corresponding parent node by data type, identifier, element index, and parent node identifier; Struct type: Finds and populates child attributes under the corresponding parent node by using data type, identifier, and parent node identifier.
Citation Information
Patent Citations
Internet of things gateway supporting equipment access verification, system and equipment access verification method
CN111901230A
Method for designing OPC UA gateway for graphical online modeling
CN112688865A