Multi-industry protocol universal adaptation and integration methods, devices, equipment and storage media
By constructing structured configuration files and dynamically loading adapter instances, and utilizing parallel scheduling and OPC UA standardized address space, the problem of low data integration efficiency of heterogeneous industrial devices is solved, achieving efficient and flexible data integration and real-time data interaction.
Patent Information
- Application Number
- CN202611552723.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-09
- Publication Date
- 2026-11-17
AI Technical Summary
In existing technologies, the data integration efficiency of heterogeneous industrial equipment is low, and the fragmentation and duplication of each link affect the efficiency of industrial data integration, system deployment efficiency, and maintainability.
By acquiring the device communication protocol specifications and device data point mapping tables of heterogeneous industrial equipment in the field, a structured static configuration file is constructed to realize the dynamic loading of adapter instance registration and acquisition task templates. The parallel scheduling mechanism drives protocol adaptation, and data mapping and encapsulation are performed based on the OPC UA standardized address space to form an automated and dynamic processing chain.
It significantly improves the deployment efficiency of data integration for heterogeneous industrial equipment, shortens the system construction and adjustment cycle, enhances the system's adaptability and maintainability to changes in the production site, simplifies the integration complexity of upper-layer applications, and improves the convenience and real-time performance of cross-system data interaction.
Smart Images

Figure CN123123482A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial communication technology, and more specifically, to a method, apparatus, device, and storage medium for multi-industry protocol universal adaptation and integration. Background Technology
[0002] With the rapid development of the Industrial Internet and intelligent manufacturing, there is a need for interconnectivity and data sharing among a vast number of heterogeneous industrial devices on the production floor. Industrial sites widely deploy various sensors, frequency converters, programmable logic controllers (PLCs) from different manufacturers. These devices employ a wide variety of communication protocols, including Modbus, Profinet, EtherNet / IP, CANopen, and various proprietary protocols. Unifying and standardizing the operational data from these heterogeneous devices is a fundamental prerequisite for building industrial control platforms, digital twin systems, and conducting big data analytics.
[0003] In related technologies, protocol conversion gateways are commonly used. However, since each new protocol requires separate development of conversion logic, the various links are fragmented and work is repetitive, which affects the efficiency of data integration of heterogeneous industrial devices. Summary of the Invention
[0004] The problem addressed by this invention is how to improve the efficiency of data integration between heterogeneous industrial devices.
[0005] To address the aforementioned issues, this invention provides a method, apparatus, device, and storage medium for multi-industry protocol universal adaptation and integration.
[0006] In a first aspect, the present invention provides a method for universal adaptation and integration of multiple industrial protocols, comprising: Obtain the device communication protocol specifications and device data point mapping table of heterogeneous industrial equipment in the field; A structured static configuration file is constructed using a data dictionary based on the device communication protocol specification and the device data point mapping table, and the static configuration file is stored in the configuration storage directory to trigger the corresponding configuration change event; The runtime data structure is obtained through model instantiation and dynamic loading based on the static configuration file, wherein the runtime data structure includes an adapter instance and a data acquisition task template; In response to the configuration change event, the adapter instance is registered to the adapter registry, and the collection task template is appended to the task queue; Based on the runtime data structure, standardized device data is obtained through protocol adaptation driven by a parallel scheduling mechanism. The parallel scheduling mechanism drives each acquisition task to execute concurrently according to its respective acquisition cycle based on the protocol instance information in the adapter registry and the task scheduling information in the task queue. Based on a pre-defined OPC UA standardized address space template library, template matching and mapping are performed on the standardized device data to obtain the OPC UA address space; In response to a request initiated by an external client, standardized service data for external clients to access is obtained through standardized encapsulation based on the OPC UA address space.
[0007] Optionally, the step of constructing a structured static configuration file through a data dictionary based on the device communication protocol specification and the device data point mapping table includes: According to the device communication protocol specification, a protocol description configuration file is obtained through structured extraction and JSON formatting; Based on the device data point mapping table, a device point table configuration file is obtained through structured extraction and JSON formatting; The protocol description configuration file and the device point table configuration file are stored in the configuration storage directory and the static configuration file is generated.
[0008] Optionally, obtaining the runtime data structure based on the static configuration file through model instantiation and dynamic loading includes: An adapter instance is obtained by instantiating the protocol engine according to the protocol description configuration file; The data acquisition task template is obtained by task-based construction based on the device point table configuration file.
[0009] Optionally, obtaining standardized device data through protocol adaptation driven by a parallel scheduling mechanism based on the runtime data structure includes: Based on the frame structure template linked list and frame buffer in the adapter instance and the register address and number of data points in the acquisition task template, a request message is generated by the message grouping engine. In response to the request message, standardized device data is obtained by verifying and parsing the original response byte stream obtained from the adapter instance port, the frame structure template linked list in the adapter instance, and the data point identifiers in the acquisition task template to the intra-frame byte offset mapping table through the message parsing engine.
[0010] Optionally, the step of performing template matching and mapping on the standardized device data to obtain the OPC UA address space includes: Based on the device identification information in the standardized device data, an instantiated template is obtained by matching from the OPC UA standardized address space template library; Based on each data point in the standardized equipment data, node-based data is obtained through data mapping and transformation; The OPC UA address space is constructed based on the instantiated template and the nodeized data.
[0011] Optionally, obtaining node-based data through data mapping and transformation based on each data point in the standardized equipment data includes: Based on each data point in the standardized equipment data, each data point is mapped to the corresponding node in the instantiated template through data mapping transformation to obtain the original value corresponding to each data point of the located target node; The original values corresponding to the data points are converted to be compatible with data types to obtain the corresponding typed values. The typified values are converted into engineering values to obtain the corresponding node-based data.
[0012] Optionally, the requests initiated by the external client include read requests, write requests, subscription requests, and browse requests; the standardized service data for external client access obtained through standardized encapsulation based on the OPC UA address space includes: In response to the read request, node data is read from the OPC UA address space via the read service and returned, resulting in read service response data; In response to the write request, the write service performs verification and write to the target node in the OPC UA address space to obtain write service response data; In response to the subscription request, dead-zone filtering and timed publishing are performed on the monitoring items in the OPC UA address space through the subscription service to obtain the subscription notification data stream; In response to the browsing request, the browsing service extracts node reference records from the reference relationship table of the OPC UA address space and returns them to obtain the browsing service response data; The standardized service data is composed of the read service response data, the write service response data, the subscription notification data stream, and the browse service response data.
[0013] Secondly, the present invention provides a multi-industry protocol universal adaptation and integration device, comprising: The acquisition module is used to acquire the device communication protocol specifications and device data point mapping table of heterogeneous industrial equipment in the field; The construction module is used to construct a structured static configuration file through a data dictionary based on the device communication protocol specification and the device data point mapping table, and store the static configuration file in the configuration storage directory to trigger the corresponding configuration change event; The loading module is used to obtain a runtime data structure based on the static configuration file through model instantiation and dynamic loading, wherein the runtime data structure includes an adapter instance and a collection task template; The update module is used to respond to the configuration change event by registering the adapter instance to the adapter registry and appending the collection task template to the task queue. An adaptation module is used to obtain standardized device data by means of protocol adaptation driven by a parallel scheduling mechanism based on the runtime data structure. The parallel scheduling mechanism drives each acquisition task to be executed concurrently according to its respective acquisition cycle based on the protocol instance information in the adapter registry and the task scheduling information in the task queue. The mapping module is used to perform template matching and mapping on the standardized device data based on a preset OPC UA standardized address space template library to obtain the OPC UA address space; The encapsulation module is used to respond to requests initiated by external clients by encapsulating standardized service data for external clients to access through standardized encapsulation based on the OPC UA address space.
[0014] Thirdly, the present invention provides an electronic device, including a memory and a processor; The memory is used to store computer programs; The processor is configured to implement the multi-industry protocol universal adaptation and integration method as described in the first aspect when executing the computer program.
[0015] Fourthly, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the multi-industry protocol universal adaptation and integration method as described in the first aspect.
[0016] The beneficial effects of the multi-industry protocol universal adaptation and integration method of the present invention are as follows: By acquiring the device communication protocol specifications and device data point mapping tables of heterogeneous industrial equipment in the field, it is possible to accurately capture the private communication details and data characteristics of various heterogeneous devices, providing a complete and accurate original basis for subsequent configuration generation. This avoids repeated verification and correction due to missing information from the source, significantly improving the efficiency of the preliminary preparation. Based on the device communication protocol specifications and device data point mapping tables, a structured static configuration file is constructed through a data dictionary and stored in the configuration storage directory. At the same time, corresponding configuration change events are triggered, transforming the scattered and unstructured device description information into a unified and parsable static configuration carrier. Furthermore, the event-triggered method realizes the proactive perception and immediate response to configuration changes, and the subsequent update process can be started without manual intervention, thereby greatly shortening the latency time from device access to system response. Based on this, a runtime data structure containing adapter instances and acquisition task templates is obtained through model instantiation and dynamic loading according to the static configuration file. This allows the static description to be automatically transformed into directly executable memory objects during system runtime, avoiding redundant development caused by hard coding and ensuring a high degree of consistency between the data structure and configuration content. This lays a solid data foundation for the efficient scheduling and flexible adaptation of subsequent acquisition tasks. Subsequently, in response to configuration change events, the adapter instance is registered to the adapter registry, and the acquisition task template is appended to the task queue. This enables automatic application of new devices or configuration changes, allowing the system to dynamically expand its acquisition capabilities during operation and incorporate new heterogeneous devices without downtime or restart. This significantly enhances the system's adaptability and deployment efficiency in the face of frequent changes in the production environment. Based on this runtime data structure, protocol adaptation is driven by a parallel scheduling mechanism. This mechanism, based on protocol instance information in the adapter registry and task scheduling information in the task queue, drives each acquisition task to execute concurrently according to its respective acquisition cycle. This allows acquisition requirements from devices with different protocols and at different frequencies to be processed independently and in parallel, avoiding cycle conflicts and time waste caused by serial execution, and making full use of system resources. This significantly improves the overall throughput of multi-source heterogeneous data acquisition while ensuring the real-time requirements of each device. Subsequently, based on a pre-defined OPC UA standardized address space template library, template matching and mapping are performed on the standardized device data to obtain the OPC UA address space. Using the standardized node model and mapping rules of the pre-defined template library, automated conversion of heterogeneous device data to a unified information model is achieved. This eliminates the need to design a separate address space structure for each device, greatly reducing the manual workload and error risk of semantic mapping and accelerating the data semanticization process.Ultimately, in response to requests from external clients, standardized service data is obtained through standardized encapsulation based on the OPC UA address space, enabling external clients to obtain standardized, semantically clear data responses through a unified OPC UA interface. This eliminates the need to concern themselves with communication differences and data structure changes in underlying devices, simplifying the integration complexity of upper-layer applications and improving the convenience and real-time performance of cross-system data interaction. Through the complete closed-loop process of acquisition, construction, instantiation, registration and queuing, parallel scheduling, template mapping, and standardized encapsulation, an automated and dynamic processing chain is formed from heterogeneous device access to unified service output. Each step is closely linked and progressively transforms, effectively eliminating inefficient steps such as repeated configuration, manual coding, downtime adjustments, and repetitive modeling in traditional integration processes. This comprehensively improves the deployment efficiency of industrial heterogeneous device data integration, shortens the system construction and adjustment cycle, and enhances the system's immediate response capability and maintainability to changes in the field. Attached Figure Description
[0017] Figure 1 This is a flowchart illustrating a method for universal adaptation and integration of multiple industrial protocols according to an embodiment of the present invention. Figure 2 This is a schematic diagram of the structure of a multi-industry protocol universal adaptation and integration device according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0018] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Although some embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present invention. It should be understood that the accompanying drawings and embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of protection of the present invention.
[0019] It should be understood that the various steps described in the method embodiments of the present invention may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.
[0020] The term "comprising" and its variations as used herein are open-ended, meaning "including but not limited to"; the term "based on" means "at least partially based on"; the term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments"; and the term "optionally" means "optional embodiments". Definitions of other terms will be given in the following description. It should be noted that the concepts of "first," "second," etc., mentioned in this invention are used only to distinguish different devices, modules, or units, and are not intended to limit the order of functions performed by these devices, modules, or units or their interdependencies.
[0021] It should be noted that the terms "a" and "a plurality of" used in this invention are illustrative rather than restrictive. Those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0022] The names of the messages or information exchanged between the multiple devices in the embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of these messages or information.
[0023] In related technologies, protocol conversion gateways are commonly used to achieve data integration of heterogeneous industrial equipment. Deployed as middleware between field devices and the host system, the protocol conversion gateway converts input messages from different protocols into data formats that meet the requirements of the target system through processes such as protocol identification, data extraction, format conversion, and data forwarding. However, the communication protocols used by various devices in the industrial field differ substantially in terms of message frame structure definition, data type encoding rules, byte order, verification algorithm types, and transport layer handshake procedures. Each new protocol type requires full-process development based on its complete communication specifications, including link layer parameter adaptation, message parsing and framing logic encoding, data type mapping rule definition, and exception handling mechanism construction. Furthermore, there is a lack of reuse mechanisms between these stages, meaning existing results cannot be utilized by new protocol access. In addition, the functional boundaries of protocol conversion gateways are usually limited to format conversion; standardized representation and information model construction after data acquisition still require manual configuration, and the connection between each stage relies on manual intervention. The aforementioned fragmented implementation method requires repeated development of the entire chain from underlying adaptation to data mapping when adding new protocols or devices, which restricts the deployment efficiency and long-term maintainability of industrial heterogeneous equipment data integration systems.
[0024] To address the problems existing in the aforementioned related technologies, this embodiment provides a method, apparatus, device, and storage medium for multi-industry protocol universal adaptation and integration.
[0025] like Figure 1As shown, an embodiment of the present invention provides a method for universal adaptation and integration of multiple industrial protocols, comprising: S110: Obtain the device communication protocol specifications and device data point mapping table of heterogeneous industrial equipment in the field.
[0026] Specifically, obtaining the device communication protocol specifications and device data point mapping tables of heterogeneous industrial equipment in the field is the first step in building a multi-protocol universal adaptation module, aiming to provide the original basis for subsequent configuration parsing and data standardization. The device communication protocol specifications define the communication rules and message frame structures for device interaction with the outside world. This typically involves physical layer parameters, such as interface type, baud rate, data bits, stop bits, checksum method, and transmission mode; link layer parameters, such as local address, polling interval, retries, response timeout, and maximum number of bytes per frame; and message frame structure definitions, including field names, field types, starting byte offset, field byte length, and checksum algorithms. The device data point mapping table defines the content and interpretation method of specific data points within the device. Each data point typically includes information such as data point name, globally unique identifier, register address, data type, number of bytes occupied, byte order, scaling factor, offset, engineering units, range upper and lower limits, read / write permissions, and acquisition group identifier. By systematically acquiring and organizing the aforementioned device communication protocol specifications and device data point mapping tables, complete data input is provided for subsequently constructing structured static configuration files in JSON key-value pair format.
[0027] S120: A structured static configuration file is constructed using a data dictionary based on the device communication protocol specification and the device data point mapping table, and the static configuration file is stored in the configuration storage directory to trigger the corresponding configuration change event.
[0028] Specifically, based on the device communication protocol specifications and the device data point mapping table, a structured static configuration file is constructed using a data dictionary and stored in the configuration storage directory to trigger corresponding configuration change events. The data dictionary construction process extracts key parameters according to the device communication protocol specifications. These parameters include: physical layer parameters (interface type, baud rate, data bits, stop bits, parity check, flow control, and transmission mode); appended IP address, port number, and timeout for TCP; and appended identifier and mask for CAN bus. Link layer parameters include local address, polling interval, retry count, retry timeout, response timeout, and maximum number of bytes per frame. The message frame structure definition contains an array of field descriptors, each containing a field name, field type, start byte offset, field byte length, fixed value, and byte order. Computational fields are appended with the verification algorithm type and the start and end field names. The above content is used to generate a protocol description configuration file in JSON key-value pair format, with a globally unique protocol identifier stored in the file header. Simultaneously, based on the description information of each data point in the device data point mapping table, including data point name, globally unique identifier, register address, data type, number of bytes occupied, byte order, scaling factor, offset, engineering units, upper and lower limits of the measurement range, read and write permissions, acquisition group identifier, read and write function code, and enumeration mapping table, a device point table configuration file is generated in the format of a data point descriptor array, and the device type identifier is stored at the beginning of the file. The protocol description configuration file and the device point table configuration file together constitute a structured static configuration file, which are stored independently in the configuration storage directory. After the file is written, the operating system automatically generates corresponding configuration change events, including add events, modify events, and delete events, which are captured by the file listening thread and trigger the subsequent configuration loading and engine initialization process.
[0029] S130, a runtime data structure is obtained through model instantiation and dynamic loading based on the static configuration file, wherein the runtime data structure includes an adapter instance and a data acquisition task template.
[0030] Specifically, the model instantiation and dynamic loading process is executed by the protocol configuration parser and is completed in two stages. The first stage loads the protocol description configuration file in the static configuration file. The parser first reads the globally unique protocol identifier in the header of the protocol description configuration file and searches the adapter registry. If a match is found, it is determined to be a duplicate loading and the file is skipped. If no match is found, its configuration content is loaded in sequence: the interface type is read and the corresponding port opening function is called to obtain the port handle, the link layer parameters are written to the instance field, the field descriptor array is read and sorted in ascending order by the starting byte offset to build a frame structure template linked list, a frame buffer of the maximum number of bytes per frame is requested and the linked list is traversed to pre-fill the fixed values of fixed fields according to the offset, and finally, the adapter instance containing the protocol identifier, port handle, frame structure template linked list and frame buffer is written to the adapter registry with the protocol identifier as the key. In the second stage, the device point table configuration file in the static configuration file is loaded. The parser first checks whether the device type identifier at the beginning of the device point table configuration file is consistent with the protocol identifier loaded in the first stage. If they are inconsistent, the loading is terminated and a binding error is returned. If they are consistent, the data point descriptors are traversed and grouped according to the acquisition group identifier. For each group, the starting address and number of consecutive registers are calculated to generate an acquisition task template. The acquisition task template includes the group identifier, the number of data points, the function code, the starting address, the number of consecutive registers, and the mapping table from the data point identifier to the intra-frame byte offset. Finally, all acquisition task templates are appended to the task queue of the main scheduling thread in sequence. This completes the construction and loading of the runtime data structure.
[0031] S140, in response to the configuration change event, register the adapter instance to the adapter registry and append the collection task template to the task queue.
[0032] Specifically, this process is executed by the file listening thread. The file listening thread repeatedly calls the directory change notification function to obtain the event list, traverses each event object and reads its action type field, and processes them according to the event type. When the action type of the event object is "add" or "modify", it is determined to be a protocol access event. The file listening thread first reads the protocol identifier in the configuration file and checks whether the protocol identifier already exists in the adapter registry. If a match is found, the event is skipped. If not, the aforementioned model instantiation and dynamic loading process is triggered to construct an adapter instance containing the protocol identifier, port handle, frame structure template linked list and frame buffer, and generate the corresponding acquisition task template. Then, under the protection of a mutex lock, the adapter instance is inserted into the adapter registry with the protocol identifier as the key, and the acquisition task templates are appended to the main scheduling thread's task queue in sequence. After releasing the mutex lock, the protocol access is completed. When the action type of the event object is deletion, it is determined to be a protocol deletion event. Under the protection of a mutex lock, the file listening thread deletes the corresponding adapter instance from the adapter registry using the file protocol identifier as the key. Subsequently, the main scheduling thread automatically skips the collection tasks pointing to the deleted instance during the next scan of the task queue. At the same time, the port handle of that instance is closed according to the transmission mode. TCP performs a handshake and then closes, and the serial port closes its handle, completing the protocol deletion. Through the above dynamic registration and deregistration mechanism, plug-and-play new protocols and online removal of existing protocols are achieved.
[0033] S150, Based on the runtime data structure, standardized device data is obtained through protocol adaptation driven by a parallel scheduling mechanism. The parallel scheduling mechanism drives each acquisition task to execute concurrently according to its respective acquisition cycle based on the protocol instance information in the adapter registry and the task scheduling information in the task queue.
[0034] Specifically, after the runtime data structure is ready, the parallel scheduling phase begins. This mechanism is built on a multi-threaded or coroutine pool. The core scheduler continuously polls the task queue, extracting task scheduling information for each acquisition task, such as acquisition period, timeout threshold, priority, and target adapter identifier. Simultaneously, it queries the adapter registry, which maintains metadata for all registered protocol instances, including protocol type, connection parameters, session state, and retry policy. The scheduler matches the specific protocol implementation to the adapter ID bound to the task and submits the task to the concurrent execution unit based on its acquisition period, such as seconds, milliseconds, or minutes. This allows different acquisition tasks to be triggered independently and in parallel, preventing long-cycle tasks from blocking short-cycle tasks. During execution, each task instance dynamically activates its corresponding adapter, which then resolves the protocol according to its built-in protocol parsing logic, such as Modbus / TCP or OPC. The system interacts with target devices using UA, CANopen, MQTT, and other methods to complete connection authentication, command encapsulation, data reading, and raw message unpacking. Simultaneously, it combines rules defined in the template, such as field mapping, unit conversion, and filtering algorithms, to transform heterogeneous raw data into standardized device data in a unified format in real time. This data may include unified timestamps, data quality stamps, and engineering unit values, and is then pushed to the subsequent data bus or storage module. This parallel scheduling mechanism also supports task priority preemption, dynamic addition and removal of tasks, and automatic retry of faults. This ensures that in multi-source, high-frequency acquisition scenarios, the system can adapt to the real-time requirements of the production environment with high throughput and low latency, ultimately providing upper-layer applications with a clean, consistent, and traceable device data stream.
[0035] S160, Based on the preset OPC UA standardized address space template library, template matching and mapping are performed on the standardized device data to obtain the OPC UA address space.
[0036] Specifically, after obtaining standardized equipment data, the process enters the OPC UA address space construction phase. Its core relies on a pre-defined OPC UA standardized address space template library. This template library uses UANodeSet or XML format to predefine a general node model covering various industrial equipment, subsystems, and typical data points, including object types (such as equipment, channels, alarms), variable types (analog, digital, arrays), data types, reference structures (such as organizations HasComponent, HasProperty), and view levels. It also reserves dynamic placeholders (such as equipment identifier, variable name, engineering unit, sampling period, dead zone, and other parameters) for subsequent filling. When standardized device data is pushed in, the template matching engine quickly retrieves and matches the corresponding template instance from the template library based on the device type code, metadata tags, or custom naming rules carried in the data. It extracts node mapping rules, such as mapping data fields to specific node IDs, browsing names, data types, or access levels. Subsequently, the mapping executor fills the template placeholders with real-time values, statuses, and attribute values from the standardized data according to the rules, and dynamically generates or updates nodes in the OPC UA address space. For example, it creates a root object node by device ID, and attaches variable nodes (setting minimum / maximum ranges, engineering units, read / write permissions), method nodes (for remote control), and child object nodes (such as sensor sub-components) under it. At the same time, it establishes hierarchical references and semantic references, such as HasModbusRegister associations, and supports recursive expansion of complex data structures (structures, arrays) to ensure that the semantics of each data point are accurately expressed in the OPC UA information model. Furthermore, this mapping process supports incremental updates, regenerating relevant nodes only when data changes or template versions are modified, avoiding the overhead of full reconstruction. It also utilizes event and alarm definitions in the template to automatically bind condition trigger rules, ultimately forming a complete OPC UA address space that conforms to the OPCUA specification, is browsable, subscribing to, and has type safety. This provides a standardized, unified data access interface for upper-layer monitoring systems (such as SCADA, MES, or cloud platforms), while also taking into account real-time performance, scalability, and interoperability requirements.
[0037] S170, in response to a request initiated by an external client, standardized service data for external clients to access is obtained through standardized encapsulation based on the OPC UA address space.
[0038] Specifically, when external clients, such as SCADA systems, MES platforms, data analytics applications, or third-party device management tools, initiate service requests via the OPC UA protocol, covering operations such as reading real-time variable values, writing setting parameters, subscribing to data change notifications, calling remote methods, or browsing the address space structure, the system first quickly locates the node in the constructed OPC UA address space based on the node identifier (such as NodeId or browsing path) carried in the request. It then retrieves the node's predefined metadata, including data type, access level, engineering units, value range, historical archiving strategy, and its mapping relationship with the underlying device data source. Subsequently, the request processing engine, based on the mapping rules in the node metadata, obtains the corresponding standardized device data from the runtime data structure or real-time data cache, or converts the write request into control instructions for the target adapter. Simultaneously, it performs authentication and permission verification using the access control lists (ACLs) and session security contexts defined in the address space to ensure the operation is legal and compliant. After obtaining the raw data or completing the operation, it strictly adheres to the OPC protocol. The UA specification standardizes and encapsulates data, such as assembling numerical values, status codes, source timestamps, server timestamps, quality flags (e.g., good, bad, uncertain), and optional extended attributes into a standard DataValue structure. For method calls, it encapsulates them into call response messages, and for subscriptions, it continuously pushes NotificationMessages containing changing data at set publication intervals, and uses the OPC UA binary protocol or the UANodeSet format based on HTTPS / JSON for serialization. Finally, the encapsulated standardized service data is returned to the external client through the OPC UA communication stack. This allows the client to obtain a unified data response with clear semantics, type safety, timestamps, and quality flags without having to deal with the heterogeneous communication protocols (e.g., Modbus, Profibus, CANopen) or data format differences of the underlying devices. This enables seamless integration into enterprise-level information systems, such as ERP and cloud big data platforms, while also meeting the real-time, reliability, and security requirements under high-concurrency access.
[0039] In this embodiment, by acquiring the device communication protocol specifications and device data point mapping tables of heterogeneous industrial equipment in the field, the private communication details and data characteristics of various heterogeneous devices can be accurately captured. This provides a complete and accurate original basis for subsequent configuration generation, avoiding repeated verification and correction due to missing information from the source, and significantly improving the efficiency of the preliminary preparation. Based on the device communication protocol specifications and device data point mapping tables, a structured static configuration file is constructed through a data dictionary and stored in the configuration storage directory. At the same time, corresponding configuration change events are triggered, transforming the scattered and unstructured device description information into a unified and parsable static configuration carrier. Furthermore, the event-triggered method enables proactive perception and immediate response to configuration changes, allowing the subsequent update process to be initiated without manual intervention, thereby greatly shortening the latency from device access to system response. On this basis, based on the static configuration file, a runtime data structure containing adapter instances and acquisition task templates is obtained through model instantiation and dynamic loading. This allows the static description to be automatically converted into directly executable memory objects during system runtime, avoiding redundant development caused by hard coding and ensuring a high degree of consistency between the data structure and configuration content. This lays a solid data foundation for the efficient scheduling and flexible adaptation of subsequent acquisition tasks. Subsequently, in response to configuration change events, the adapter instance is registered to the adapter registry, and the acquisition task template is appended to the task queue. This enables automatic application of new devices or configuration changes, allowing the system to dynamically expand its acquisition capabilities during operation. New heterogeneous devices can be incorporated without downtime or restart, significantly enhancing the system's adaptability and deployment efficiency in the face of frequent changes in the production environment. Based on this runtime data structure, protocol adaptation is driven by a parallel scheduling mechanism. This mechanism, based on protocol instance information in the adapter registry and task scheduling information in the task queue, drives each acquisition task to execute concurrently according to its respective acquisition cycle. This allows devices with different protocols and acquisition needs at different frequencies to be processed independently and in parallel. This avoids cycle conflicts and time waste caused by serial execution, while fully utilizing system resources. Therefore, while ensuring the real-time requirements of each device, the overall throughput of multi-source heterogeneous data acquisition is significantly improved. Subsequently, based on the pre-set OPC UA standardized address space template library, template matching and mapping are performed on the standardized device data to obtain the OPC UA address space. With the help of the standardized node model and mapping rules of the pre-set template library, the automatic conversion of heterogeneous device data to a unified information model is realized. There is no need to design a separate address space structure for each device, which greatly reduces the manual workload and error risk of semantic mapping and accelerates the data semanticization process.Ultimately, in response to requests from external clients, standardized service data is obtained through standardized encapsulation based on the OPC UA address space, enabling external clients to obtain standardized, semantically clear data responses through a unified OPC UA interface. This eliminates the need to concern themselves with communication differences and data structure changes in underlying devices, simplifying the integration complexity of upper-layer applications and improving the convenience and real-time performance of cross-system data interaction. Through the complete closed-loop process of acquisition, construction, instantiation, registration and queuing, parallel scheduling, template mapping, and standardized encapsulation, an automated and dynamic processing chain is formed from heterogeneous device access to unified service output. Each step is closely linked and progressively transforms, effectively eliminating inefficient steps such as repeated configuration, manual coding, downtime adjustments, and repetitive modeling in traditional integration processes. This comprehensively improves the deployment efficiency of industrial heterogeneous device data integration, shortens the system construction and adjustment cycle, and enhances the system's immediate response capability and maintainability to changes in the field.
[0040] Optionally, the step of constructing a structured static configuration file through a data dictionary based on the device communication protocol specification and the device data point mapping table includes: According to the device communication protocol specification, a protocol description configuration file is obtained through structured extraction and JSON formatting; Based on the device data point mapping table, a device point table configuration file is obtained through structured extraction and JSON formatting; The protocol description configuration file and the device point table configuration file are stored in the configuration storage directory and the static configuration file is generated.
[0041] In this optional embodiment, based on the physical layer parameters in the device communication protocol specification, including interface type, baud rate, data bits, stop bits, checksum method, flow control method, and transmission mode, the TCP protocol appends IP address, port number, and timeout; the CAN bus appends identifier and mask; and the link layer parameters, including local address, polling interval, number of retries, retry timeout, response timeout, and maximum number of bytes per frame, and the message frame structure definition, including field name, field type, start byte offset, field byte length, fixed value, and byte order, and appending checksum algorithm type and checksum start and end field names to computed fields, a protocol description configuration file is generated in JSON key-value pair format, and a globally unique protocol identifier is stored in the file header. Simultaneously, based on the device data point mapping table, a device point table configuration file is obtained through structured extraction and JSON formatting. Based on the description information of each data point in the device data point mapping table, including data point name, globally unique identifier, register address, data type, number of bytes occupied, byte order, scaling factor, offset, engineering units, upper and lower limits of range, read / write permissions, acquisition group identifier, read / write function code, and enumeration mapping table, a device point table configuration file is generated in the format of a data point descriptor array, with the device type identifier stored at the beginning of the file. Finally, the protocol description configuration file and the device point table configuration file are stored in the configuration storage directory, generating the static configuration file. After the file is written, the operating system automatically generates a corresponding configuration change event, which is captured by the file listening thread and triggers the subsequent configuration loading and engine initialization process. This configuration file construction method decouples the protocol adaptation logic from the specific protocol content, allowing for the addition or modification of protocols only requiring editing of the configuration file without changing the program code, effectively improving the system's scalability and configuration flexibility.
[0042] Optionally, obtaining the runtime data structure based on the static configuration file through model instantiation and dynamic loading includes: An adapter instance is obtained by instantiating the protocol engine according to the protocol description configuration file; The data acquisition task template is obtained by task-based construction based on the device point table configuration file.
[0043] In this optional embodiment, during the protocol engine instantiation process, the protocol configuration parser reads the globally unique protocol identifier in the header of the protocol description configuration file and searches the adapter registry. If a match is found, it is determined to be a duplicate load and the file is skipped. If no match is found, the interface types in the physical layer parameter block are loaded sequentially and the corresponding port opening function is called to obtain the port handle. The local address, polling interval, retry count, and response timeout parameters in the link layer parameter block are written into the instance field. The field descriptor array in the message frame structure definition block is read and sorted in ascending order by the starting byte offset to construct a frame structure template linked list. A frame buffer of the maximum number of bytes per frame is requested and the linked list is traversed to pre-fill the fixed values of the fixed fields according to the offset. Finally, the adapter instance containing the protocol identifier, port handle, frame structure template linked list, and frame buffer is written into the adapter registry with the protocol identifier as the key, thus completing the protocol engine instantiation. During the task-oriented construction process, the protocol configuration parser reads the device type identifier from the header of the device point table configuration file and performs a consistency check with the loaded protocol identifier. If they do not match, loading is terminated and a binding error is returned. If they match, the data point descriptors are traversed and grouped according to the acquisition group identifier. For each group, the starting address and number of consecutive registers are calculated to generate an acquisition task template. The acquisition task template includes the group identifier, the number of data points, the function code, the starting address, the number of consecutive registers, and a mapping table from the data point identifier to the intra-frame byte offset. Finally, all acquisition task templates are appended sequentially to the main scheduling thread's task queue, completing the task-oriented construction of the acquisition task. Through this method, the static configuration file is reconstructed into an adapter instance and acquisition task template in memory. A registry mechanism manages the lifecycle of multiple protocol instances, and a task queue mechanism organizes the scheduling of acquisition tasks. This achieves unified initialization and centralized management of multi-protocol adaptation resources, avoiding duplicate loading and resource conflicts.
[0044] Optionally, obtaining standardized device data through protocol adaptation driven by a parallel scheduling mechanism based on the runtime data structure includes: Based on the frame structure template linked list and frame buffer in the adapter instance and the register address and number of data points in the acquisition task template, a request message is generated by the message grouping engine. In response to the request message, standardized device data is obtained by verifying and parsing the original response byte stream obtained from the adapter instance port, the frame structure template linked list in the adapter instance, and the data point identifiers in the acquisition task template to the intra-frame byte offset mapping table through the message parsing engine.
[0045] In this optional embodiment, a request message is generated by the message framing engine based on the frame structure template linked list and frame buffer in the adapter instance and the register address and number of data points in the acquisition task template. During the framing process, the message framing engine first fills the frame buffer with byte 0x00 to clear it, then traverses the frame structure template linked list, refills the fixed values of each fixed field into the corresponding offset positions, writes the local address, function code, register address, and number of data points to the corresponding offset positions, then traverses the frame structure template linked list again, locates the byte range for each calculated field according to the check start and end field names and extracts the corresponding byte segments, calls the specified check function to perform calculations, rearranges the calculation results in byte order and writes them into the offset position of the check field, finally takes the maximum value of the sum of the offset and length of all fields as the effective frame length, extracts the byte stream of this length, and calls the write function corresponding to the adapter instance port handle to send the request message. In response to request messages, the system uses the raw response byte stream obtained from the adapter instance port, the frame structure template linked list in the adapter instance, and the data point identifiers in the acquisition task template to the intra-frame byte offset mapping table. The message parsing engine performs verification and parsing to obtain standardized device data containing device-level fields such as device identifier, device model, manufacturer code, and device type code, as well as data point-level fields such as data point identifier, name, original value, type, unit, timestamp, and status code. This data is then written to a unified data buffer. By using a frame template linked list to drive framing and parsing, a sliding window to position the frame header, and a configurable verification algorithm to ensure message integrity, the system achieves unified construction and flexible parsing of multi-protocol messages, avoiding repetitive development work caused by writing separate packet assembly and disassembly code for each protocol. This method records the single standardized data generated during framing and parsing, and after each acquisition task is continuously executed according to its own acquisition cycle by a parallel scheduling mechanism, it converges into a continuous standardized device data stream.
[0046] Optionally, the step of performing template matching and mapping on the standardized device data to obtain the OPC UA address space includes: Based on the device identification information in the standardized device data, an instantiated template is obtained by matching from the OPC UA standardized address space template library; Based on each data point in the standardized equipment data, node-based data is obtained through data mapping and transformation; The OPC UA address space is constructed based on the instantiated template and the nodeized data.
[0047] Optionally, obtaining node-based data through data mapping and transformation based on each data point in the standardized equipment data includes: Based on each data point in the standardized equipment data, each data point is mapped to the corresponding node in the instantiated template through data mapping transformation to obtain the original value corresponding to each data point of the located target node; The original values corresponding to the data points are converted to be compatible with data types to obtain the corresponding typed values. The typified values are converted into engineering values to obtain the corresponding node-based data.
[0048] Specifically, based on the device identification information in the standardized device data, instantiated templates are obtained from the OPC UA standardized address space template library. A three-level matching strategy is executed during the matching process: The first level is exact matching, where the device model string in the standardized device data is compared character-by-character with the device model field of each template in the template library. An exact match is considered successful when the two strings have the same length and all corresponding characters are identical. The second level is multi-dimensional feature-weighted matching, where, if exact matching fails, feature vectors are constructed from the device manufacturer code, device type code, register mapping rules, number of data points, data type distribution, and address space structure in the standardized device data. These vectors are then used to calculate the overall matching degree with all templates in the same category, and the template with the highest overall matching degree exceeding a preset threshold is selected as the matching result. The third level is default template matching, where, if the first two levels fail, a default general template pre-set for the device category is used, or a blank template containing only basic object nodes is generated. Upon successful matching, template instantiation is performed, replacing device placeholders such as device name, manufacturer, firmware version, and serial number in the template with actual device information, loading it into the memory cache, and obtaining the instantiated template. Based on the data points in the standardized equipment data, node-based data is obtained through data mapping and transformation. During the mapping process, the register address of each data point is compared node by node with the address mapping table in the instantiated template to determine the target node corresponding to each data point. Subsequently, the data type of the data point is checked for compatibility with the data type declared by the target node. If a compatible conversion path exists, data type promotion is automatically performed, including UINT16 to Int32, FLOAT32 to Double, UINT16 to Boolean, etc. If conversion is not possible, an exception is marked. Then, the target node range mapping parameters predefined in the template are read, including four values: the lower and upper limits of the original value and the lower and upper limits of the engineering value. The original value of the data point is converted into the engineering value according to the linear mapping formula. For enumerated data points, the enumeration code is converted into a meaning string according to the enumeration mapping table in the equipment point table configuration. Finally, node-based data is obtained, which contains the node value and status code corresponding to each data point.
[0049] The linear mapping formula satisfies: Y=(XX min ) / (X max -Xmin )×(Y max -Y min )+Y min ; Where Y is the converted engineering value, and X is the original value of the data point. min X represents the lower limit of the original value corresponding to this data point. max Y represents the upper limit of the original value corresponding to this data point. min Y represents the lower limit of the engineering value corresponding to this data point. max This represents the upper limit of the engineering value corresponding to this data point. The formula calculates the value of the original value X within the original value interval [X...]. min X max The position within ] is mapped proportionally to the engineering value range [Y]. min Y max The corresponding position within the range is used to complete the linear conversion from the original value to the engineering value.
[0050] Further, based on the instantiated template and the nodeized data, the OPC UA address space is constructed. During address space construction, firstly, according to the node definitions and reference relationship table in the instantiated template, the OPC UA interface is called to create the device object root node, device information child nodes, data variable nodes, method nodes, and event nodes layer by layer, completing the basic construction of the address space. Then, verification and governance are performed on the constructed address space nodes, including node identifier uniqueness verification, data type validity verification, and data quality filtering. Node identifier uniqueness verification checks whether each node identifier is duplicated, and appends an incrementing sequence number suffix to duplicate identifiers to ensure global uniqueness. Data type validity verification checks whether the node declaration type belongs to the OPC UA standard type set; for types that do not belong, it falls back to the standard base type. Data quality filtering includes status code anomaly judgment, over-range judgment, and transition judgment, ultimately obtaining the complete OPC UA address space.
[0051] In this optional embodiment, a three-level matching degradation strategy is used to ensure that device models with different levels of standardization can obtain a definite template matching path. Automatic mapping and conversion are used to achieve standardized mapping from device data points to OPC UA nodes. Automatic verification and governance are used to ensure the global uniqueness, type legality, and numerical validity of address space node data. This enables the automatic construction of the OPC UA address space during device access without manual intervention.
[0052] Optionally, the requests initiated by the external client include read requests, write requests, subscription requests, and browse requests; the standardized service data for external client access obtained through standardized encapsulation based on the OPC UA address space includes: In response to the read request, node data is read from the OPC UA address space via the read service and returned, resulting in read service response data; In response to the write request, the write service performs verification and write to the target node in the OPC UA address space to obtain write service response data; In response to the subscription request, dead-zone filtering and timed publishing are performed on the monitoring items in the OPC UA address space through the subscription service to obtain the subscription notification data stream; In response to the browsing request, the browsing service extracts node reference records from the reference relationship table of the OPC UA address space and returns them to obtain the browsing service response data; The standardized service data is composed of the read service response data, the write service response data, the subscription notification data stream, and the browse service response data.
[0053] Specifically, in response to a read request initiated by an external client, the read service reads node data from the OPC UA address space and returns it, resulting in read service response data. The read service processes each node identifier in the read request sequentially: first, it performs a binary search in the address space index table; if a match is found, it reads a triplet containing the current value, source timestamp, and status code from the node variable cache; otherwise, it returns a node-not-found status code. Next, it reads the node's access level attribute and the requester's permission bits and performs a bitwise comparison; if read permission is granted, it continues; otherwise, it returns an access denied status code. Finally, it assembles the triplet with the current server timestamp into a response entry. After all requests are processed, all response entries are assembled into a read response message and returned to the client, with an audit log recorded. In response to a write request initiated by an external client, the write service performs verification and write operations on the target node in the OPC UA address space, resulting in write service response data. The write service performs four layers of validation for each write target: First, address validation checks if the node identifier exists in the index table; if not, an address error is returned. Second, permission validation reads the node's access level attribute and compares it bit-by-bit with the requester's permission bits; if write permissions are not present, permission denial is returned. Third, data type conversion validation automatically performs implicit type promotion for compatible paths and returns a type mismatch error for incompatible paths if the written value is inconsistent with the node's data type. Finally, value range validation returns an out-of-range error if the written value exceeds the node's value range. After all validations pass, the written value, new timestamp, and status code are updated to the node variable cache. The service scans all active subscriptions for monitoring items that monitor the node identifier, pushes the change notification into the corresponding subscription's notification queue, returns a write response message, and records an audit log. In response to subscription requests from external clients, the subscription service performs dead-zone filtering and periodic publishing on monitoring items in the OPC UA address space to obtain a subscription notification data stream. The subscription service is implemented in two phases: subscription creation and data publishing. In the creation phase, an auto-incrementing counter generates a globally unique identifier for each subscription and registers it in the memory registry. Each monitoring item and its dead-zone threshold are registered in the global sampling timer scheduler table. In the data publishing phase, the sampling timer iterates through all expired monitoring items at the end of each cycle, reads the current value triplet from the variable cache of the corresponding node, and compares it with the last reported value of that monitoring item using dead-zone filtering. If the status code changes, reporting is triggered regardless of whether the value changes. If the status code remains unchanged but the value change exceeds the dead-zone threshold, reporting is triggered. If the status code remains unchanged and the value change does not exceed the dead-zone threshold, reporting is skipped. Data changes meeting the reporting conditions are assembled into notification items and pushed into the notification queue of the corresponding subscription. When the publishing interval timer arrives, notification items not exceeding the maximum number of notifications per packet are retrieved from the notification queue, assembled into a notification message, and pushed to the client. If the notification queue is empty, a keep-alive message is sent to maintain subscription activity. If the subscription expires and the client has not renewed, the subscription resources are automatically released.In response to a browsing request initiated by an external client, the browsing service extracts node reference records from the OPC UA address space reference table and returns them, resulting in browsing service response data. Based on the starting node, browsing direction, and node category filter mask in the browsing request, the browsing service extracts the corresponding set of node reference records from the address space reference table, filtering out nodes that the requester does not have access to. It then extracts the descriptive metadata of each target node, including node identifier, browsing name, display name, node category, and type definition, assembling them into reference description entries. If the number of extracted reference description entries does not exceed the single return limit, a browsing response message is returned directly. If the single return limit is exceeded, the first N reference descriptions are returned first, carrying a continuous point identifier, allowing the client to initiate a resume request based on this identifier to obtain the remaining nodes until all have been returned. Standardized service data is constructed based on the read service response data, write service response data, subscription notification data stream, and browsing service response data. The above four types of services are based on the OPC UA address space and provide unified access to device data through four standardized interfaces: read, write, subscribe, and browse. This enables external clients to read, write, monitor in real time, and traverse the address space of device data using the standard OPC UA protocol, without having to worry about the differences in the underlying device's communication protocol.
[0054] like Figure 2 As shown, an embodiment of the present invention provides a multi-industry protocol universal adaptation and integration device, comprising: The acquisition module is used to acquire the device communication protocol specifications and device data point mapping table of heterogeneous industrial equipment in the field; The construction module is used to construct a structured static configuration file through a data dictionary based on the device communication protocol specification and the device data point mapping table, and store the static configuration file in the configuration storage directory to trigger the corresponding configuration change event; The loading module is used to obtain a runtime data structure based on the static configuration file through model instantiation and dynamic loading, wherein the runtime data structure includes an adapter instance and a collection task template; The update module is used to respond to the configuration change event by registering the adapter instance to the adapter registry and appending the collection task template to the task queue. An adaptation module is used to obtain standardized device data by means of protocol adaptation driven by a parallel scheduling mechanism based on the runtime data structure. The parallel scheduling mechanism drives each acquisition task to be executed concurrently according to its respective acquisition cycle based on the protocol instance information in the adapter registry and the task scheduling information in the task queue. The mapping module is used to perform template matching and mapping on the standardized device data based on a preset OPC UA standardized address space template library to obtain the OPC UA address space; The encapsulation module is used to respond to requests initiated by external clients by encapsulating standardized service data for external clients to access through standardized encapsulation based on the OPC UA address space.
[0055] The model inference device in this embodiment is used to implement the multi-industry protocol universal adaptation and integration method as described above. Its advantages over the prior art are the same as the advantages of the multi-industry protocol universal adaptation and integration method over the prior art, and will not be repeated here.
[0056] like Figure 3 As shown, an electronic device 300 provided in this embodiment of the invention includes a memory 310 and a processor 320; the memory 310 is used to store a computer program; the processor 320 is used to implement the multi-industry protocol universal adaptation and integration method as described above when the computer program is executed.
[0057] Alternatively, an electronic device 300 includes a memory 310 and a processor 320 coupled to the memory 310; the memory 310 is configured to store a computer program; and the processor 320 is configured to perform the following operations when the computer program is executed: Obtain the device communication protocol specifications and device data point mapping table of heterogeneous industrial equipment in the field; A structured static configuration file is constructed using a data dictionary based on the device communication protocol specification and the device data point mapping table, and the static configuration file is stored in the configuration storage directory to trigger the corresponding configuration change event; The runtime data structure is obtained through model instantiation and dynamic loading based on the static configuration file, wherein the runtime data structure includes an adapter instance and a data acquisition task template; In response to the configuration change event, the adapter instance is registered to the adapter registry, and the collection task template is appended to the task queue; Based on the runtime data structure, standardized device data is obtained through protocol adaptation driven by a parallel scheduling mechanism. The parallel scheduling mechanism drives each acquisition task to execute concurrently according to its respective acquisition cycle based on the protocol instance information in the adapter registry and the task scheduling information in the task queue. Based on a pre-defined OPC UA standardized address space template library, template matching and mapping are performed on the standardized device data to obtain the OPC UA address space; In response to a request initiated by an external client, standardized service data for external clients to access is obtained through standardized encapsulation based on the OPC UA address space.
[0058] This invention provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the multi-industry protocol universal adaptation and integration method described above.
[0059] Alternatively, a non-volatile computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to perform the following operations: Obtain the device communication protocol specifications and device data point mapping table of heterogeneous industrial equipment in the field; A structured static configuration file is constructed using a data dictionary based on the device communication protocol specification and the device data point mapping table, and the static configuration file is stored in the configuration storage directory to trigger the corresponding configuration change event; The runtime data structure is obtained through model instantiation and dynamic loading based on the static configuration file, wherein the runtime data structure includes an adapter instance and a data acquisition task template; In response to the configuration change event, the adapter instance is registered to the adapter registry, and the collection task template is appended to the task queue; Based on the runtime data structure, standardized device data is obtained through protocol adaptation driven by a parallel scheduling mechanism. The parallel scheduling mechanism drives each acquisition task to execute concurrently according to its respective acquisition cycle based on the protocol instance information in the adapter registry and the task scheduling information in the task queue. Based on a pre-defined OPC UA standardized address space template library, template matching and mapping are performed on the standardized device data to obtain the OPC UA address space; In response to a request initiated by an external client, standardized service data for external clients to access is obtained through standardized encapsulation based on the OPC UA address space.
[0060] The present invention will now be described an electronic device 300 that can serve as a server or client of the present invention, which is an example of a hardware device that can be applied to various aspects of the present invention. Electronic device 300 is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic device 300 can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0061] Electronic device 300 includes a computing unit that can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) or a computer program loaded from a storage unit into random access memory (RAM). The RAM may also store various programs and data required for device operation. The computing unit, ROM, and RAM are interconnected via a bus. Input / output (I / O) interfaces are also connected to the bus.
[0062] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc. In this application, the units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of the embodiments of the present invention according to actual needs. Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated units can be implemented in hardware or as software functional units.
[0063] While the present invention has been disclosed above, its scope of protection is not limited thereto. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the present invention, and all such changes and modifications will fall within the scope of protection of the present invention.
Claims
1. A method for universal adaptation and integration of multiple industrial protocols, characterized in that, include: Obtain the device communication protocol specifications and device data point mapping table of heterogeneous industrial equipment in the field; A structured static configuration file is constructed using a data dictionary based on the device communication protocol specification and the device data point mapping table, and the static configuration file is stored in the configuration storage directory to trigger the corresponding configuration change event; The runtime data structure is obtained through model instantiation and dynamic loading based on the static configuration file, wherein the runtime data structure includes an adapter instance and a data acquisition task template; In response to the configuration change event, the adapter instance is registered to the adapter registry, and the collection task template is appended to the task queue; Based on the runtime data structure, standardized device data is obtained through protocol adaptation driven by a parallel scheduling mechanism. The parallel scheduling mechanism drives each acquisition task to execute concurrently according to its respective acquisition cycle based on the protocol instance information in the adapter registry and the task scheduling information in the task queue. Based on a pre-defined OPC UA standardized address space template library, template matching and mapping are performed on the standardized device data to obtain the OPC UA address space; In response to a request initiated by an external client, standardized service data for external clients to access is obtained through standardized encapsulation based on the OPC UA address space.
2. The multi-industry protocol universal adaptation and integration method according to claim 1, characterized in that, The structured static configuration file, constructed using a data dictionary based on the device communication protocol specification and the device data point mapping table, includes: According to the device communication protocol specification, a protocol description configuration file is obtained through structured extraction and JSON formatting; Based on the device data point mapping table, a device point table configuration file is obtained through structured extraction and JSON formatting; The protocol description configuration file and the device point table configuration file are stored in the configuration storage directory and the static configuration file is generated.
3. The multi-industry protocol universal adaptation and integration method according to claim 2, characterized in that, The step of obtaining the runtime data structure through model instantiation and dynamic loading based on the static configuration file includes: An adapter instance is obtained by instantiating the protocol engine according to the protocol description configuration file; The data acquisition task template is obtained by task-based construction based on the device point table configuration file.
4. The multi-industry protocol universal adaptation and integration method according to claim 3, characterized in that, The process of obtaining standardized device data through protocol adaptation driven by a parallel scheduling mechanism based on the runtime data structure includes: Based on the frame structure template linked list and frame buffer in the adapter instance and the register address and number of data points in the acquisition task template, a request message is generated by the message grouping engine. In response to the request message, standardized device data is obtained by verifying and parsing the original response byte stream obtained from the adapter instance port, the frame structure template linked list in the adapter instance, and the data point identifiers in the acquisition task template to the intra-frame byte offset mapping table through the message parsing engine.
5. The multi-industry protocol universal adaptation and integration method according to claim 1, characterized in that, The step of obtaining the OPC UA address space by template matching and mapping of the standardized device data includes: Based on the device identification information in the standardized device data, an instantiated template is obtained by matching from the OPC UA standardized address space template library; Based on each data point in the standardized equipment data, node-based data is obtained through data mapping and transformation; The OPC UA address space is constructed based on the instantiated template and the nodeized data.
6. The multi-industry protocol universal adaptation and integration method according to claim 5, characterized in that, The step of obtaining node-based data through data mapping and transformation based on each data point in the standardized equipment data includes: Based on each data point in the standardized equipment data, each data point is mapped to the corresponding node in the instantiated template through data mapping transformation to obtain the original value corresponding to each data point of the located target node; The original values corresponding to the data points are converted to be compatible with data types to obtain the corresponding typed values. The typified values are converted into engineering values to obtain the corresponding node-based data.
7. The multi-industry protocol universal adaptation and integration method according to claim 1, characterized in that, The requests initiated by the external client include read requests, write requests, subscription requests, and browse requests; the standardized service data for external client access obtained through standardized encapsulation based on the OPC UA address space includes: In response to the read request, node data is read from the OPC UA address space via the read service and returned, resulting in read service response data; In response to the write request, the write service performs verification and write to the target node in the OPC UA address space to obtain write service response data; In response to the subscription request, dead-zone filtering and timed publishing are performed on the monitoring items in the OPC UA address space through the subscription service to obtain the subscription notification data stream; In response to the browsing request, the browsing service extracts node reference records from the reference relationship table of the OPC UA address space and returns them to obtain the browsing service response data; The standardized service data is composed of the read service response data, the write service response data, the subscription notification data stream, and the browse service response data.
8. A multi-industry protocol universal adaptation and integration device, characterized in that, include: The acquisition module is used to acquire the device communication protocol specifications and device data point mapping table of heterogeneous industrial equipment in the field; The construction module is used to construct a structured static configuration file through a data dictionary based on the device communication protocol specification and the device data point mapping table, and store the static configuration file in the configuration storage directory to trigger the corresponding configuration change event; The loading module is used to obtain a runtime data structure based on the static configuration file through model instantiation and dynamic loading, wherein the runtime data structure includes an adapter instance and a collection task template; The update module is used to respond to the configuration change event by registering the adapter instance to the adapter registry and appending the collection task template to the task queue. An adaptation module is used to obtain standardized device data by means of protocol adaptation driven by a parallel scheduling mechanism based on the runtime data structure. The parallel scheduling mechanism drives each acquisition task to be executed concurrently according to its respective acquisition cycle based on the protocol instance information in the adapter registry and the task scheduling information in the task queue. The mapping module is used to perform template matching and mapping on the standardized device data based on a preset OPC UA standardized address space template library to obtain the OPC UA address space; The encapsulation module is used to respond to requests initiated by external clients by encapsulating standardized service data for external clients to access through standardized encapsulation based on the OPC UA address space.
9. An electronic device, characterized in that, Including memory and processor; The memory is used to store computer programs; The processor is configured to implement the multi-industry protocol universal adaptation and integration method as described in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the multi-industry protocol universal adaptation and integration method as described in any one of claims 1 to 7.
