An industrial data mapping and conversion system and method based on an OPC UA protocol
Through rich waveform generation, intelligent adaptation, and real-time update mechanisms, the OPC UA server addresses the diverse simulation needs of industrial automation, enabling efficient data simulation of complex industrial scenarios and improving the system's flexibility and stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGDONG SOWOTECH CO LTD
- Filing Date
- 2025-07-29
- Publication Date
- 2026-06-12
AI Technical Summary
Existing OPC UA servers in the field of industrial automation suffer from problems such as limited waveform types, poor configuration flexibility, insufficient real-time dynamism, limited scalability, weak type adaptability, and lack of waveform combination capabilities, making it difficult to meet diverse industrial simulation needs.
The system employs a waveform definition module to support multiple waveform generation modes, a node management module to achieve dynamic storage and intelligent adaptation, a timing control module to ensure real-time updates, a waveform generation module to generate multiple waveforms and support their combination, a data type conversion module to ensure safe conversion, an extended interface module to enhance system scalability, and a resource management mechanism to ensure system stability.
It achieves rich waveform generation capabilities, automated configuration, real-time data updates, and system scalability, which can meet the simulation needs of complex industrial scenarios and improve the development efficiency and quality of industrial systems.
Smart Images

Figure CN120973848B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial automation communication technology, and specifically to an industrial data mapping and conversion system and method based on the OPC UA protocol. Background Technology
[0002] In the field of industrial automation, OPC UA, as an international standard protocol for industrial communication, is widely used in factory automation, process control, energy management, and other scenarios. Its reliable, secure, and standardized communication mechanism meets the data exchange needs between industrial devices. Furthermore, during the development, testing, and verification of industrial systems, it is necessary to simulate various industrial signal data to verify system behavior. Industrial signals encompass various waveform types, including sine waves, triangle waves, square waves, and sawtooth waves, with different waveforms corresponding to different physical quantity change patterns in industrial control and monitoring. However, existing OPC UA servers have several shortcomings: limited waveform types, mostly confined to simple random numbers or incrementing values, making it difficult to meet diverse industrial simulation needs; poor configuration flexibility, unable to automatically adapt waveforms according to data types, requiring manual configuration one by one, which is cumbersome and error-prone; insufficient real-time dynamism, with simulated data updates failing to accurately reflect the data change patterns of actual industrial scenarios; limited scalability, mostly closed systems, making it difficult to customize and extend to different industrial application scenarios; weak type adaptability, insufficient ability to simulate complex data types; and a lack of waveform combination capabilities, unable to generate multiple waveform combinations through simple configuration, severely restricting its application in complex industrial scenarios. Summary of the Invention
[0003] To address the aforementioned technical issues, this application provides an industrial data mapping and conversion system and method based on the OPC UA protocol. Through innovative waveform generation algorithms, intelligent type adaptation mechanisms, and dynamic expansion architecture, it achieves high-fidelity, multi-scenario industrial data simulation capabilities.
[0004] An industrial data mapping and conversion system based on the OPC UA protocol includes: a waveform definition module configured to support multiple waveform generation modes through predefined enumeration types, including sine wave, triangle wave, square wave, sawtooth wave, random value, and timestamp modes; and a node management module that dynamically stores OPC data using a dictionary structure. The system includes: a UA node and its associated waveform configuration parameters, including waveform type, data range, and phase offset; an intelligent adaptation module configured to automatically assign a default waveform mode based on the node's data type, wherein: integer nodes are associated with a random value mode and a limited value range, floating-point nodes are associated with a sine wave mode and an amplitude parameter is configured, and string nodes are associated with a timestamp mode and a time format is defined; a timing control module configured to trigger data updates via an adjustable periodic timer and incrementally accumulate and periodically reset the global phase variable during each update; a waveform generation module configured to generate corresponding waveform data based on the phase variable and configuration parameters, wherein: triangular wave data uses a piecewise linear function to generate periodic rising and falling waveforms, square wave data uses a sine wave sign to generate a high / low level switching signal, and sawtooth wave data uses linearly increasing phase to generate a unidirectional cyclic waveform; and a data type conversion module configured to securely convert the generated waveform data to the target node's data type and perform numerical range constraints and anomaly handling.
[0005] Furthermore, the waveform definition module supports multiple waveform generation modes through predefined enumeration types, covering sine waves, triangle waves, square waves, sawtooth waves, random values, and timestamp modes, providing a rich waveform foundation for the system. The node management module uses a dictionary structure to dynamically store OPC UA nodes and their associated waveform configuration parameters. These parameters include waveform type, data range, and phase offset, and it has a dynamic node registration interface to receive externally input node information and user-defined waveform parameters. The configuration verification unit, when the user does not specify waveform parameters, calls the intelligent adaptation module to allocate default configurations and generate log records, achieving efficient node management. The intelligent adaptation module can automatically allocate default waveform modes based on node data type. For example, integer nodes are associated with a random value mode and a limited value range; floating-point nodes are associated with a sine wave mode and amplitude parameters are configured; and string nodes are associated with a timestamp mode and a time format is defined, improving the automation of configuration. The timing control module triggers data updates via an adjustable period timer, with the timer period dynamically adjustable from 50ms to 10s. An independent thread ensures timing accuracy. Simultaneously, it incrementally accumulates and periodically resets the global phase variable with each update. The increment step of the phase variable is related to the timing period, ensuring waveform frequency synchronization and enabling real-time dynamic data updates. The waveform generation module generates corresponding waveform data based on phase variables and configuration parameters. For example, triangular wave data uses a piecewise linear function to generate periodic rising and falling waveforms; square wave data uses sine wave sign determination to generate high / low level switching signals; and sawtooth wave data uses linear phase increments to generate unidirectional cyclic waveforms. Additionally, a waveform combination unit and a noise injection unit are included to generate composite waveform data and simulate industrial environment interference. The data type conversion module securely converts the generated waveform data to the target node's data type. Dedicated converters are provided for different data types. For example, a floating-point converter saturates values exceeding the target type's range; a string converter formats timestamp data into strings conforming to the ISO 8601 standard; and a Boolean converter converts values to high / low levels through dynamic threshold comparison.
[0006] In one embodiment, a node dynamic registration interface is used to receive externally input node identifiers, data types, and user-defined waveform parameters; a configuration verification unit is used to call the intelligent adaptation module to allocate default configurations and generate log records when the user does not specify waveform parameters.
[0007] In one embodiment, the timing control module includes: a timer period that supports dynamic adjustment from 50ms to 10s, and timing accuracy that is ensured by an independent thread; and an increment step of the phase variable that is associated with the timing period to ensure that the waveform frequency is synchronized with the timing period.
[0008] In one embodiment, the waveform generation module further includes: a waveform combination unit configured to superimpose multiple waveform parameters on the same node to generate composite waveform data; and a noise injection unit that superimposes Gaussian white noise during data generation to simulate industrial environment interference.
[0009] In one embodiment, the data type conversion module includes: a floating-point converter configured to saturate values that exceed the target type range; a string converter to format timestamp pattern data into a string conforming to the ISO8601 standard; and a Boolean converter to convert values to high or low level states through dynamic threshold comparison.
[0010] In one embodiment, the system further includes: an extension interface module that allows users to add custom waveform generators by inheriting a predefined base class; and a dynamic loading unit that loads a plugin library containing new waveform algorithms and updates the waveform enumeration type at runtime.
[0011] In one embodiment, the custom waveform generator needs to implement: a phase parameter input interface to receive global phase variable values; a configuration parameter parsing interface to read user-defined waveform parameters; and a data generation interface to return waveform data compatible with the target data type.
[0012] In one embodiment, the system implements resource management through the following mechanisms: a timer resource release unit that destroys timer instances when the simulation stops or the system is shut down; a node state snapshot unit that stores and restores the initial values of nodes during a reset operation; and a memory optimization mechanism that suspends waveform calculations for inactive nodes until they are reactivated.
[0013] Furthermore, the intelligent adaptation module also includes: a semantic analysis unit, which parses node name keywords and associates them with specific waveform patterns, including: automatically associating nodes containing the "Temperature" field with a sine wave pattern, and forcibly associating nodes containing the "Status" field with a square wave pattern; and a historical data learning unit, which recommends waveform parameters based on the distribution characteristics of node historical data.
[0014] In one embodiment, the system integrates an anomaly recovery mechanism: a data generation timeout monitoring unit that skips node updates when the computation time for a single node exceeds a threshold; a disconnection reconnection unit that automatically rebuilds node subscription relationships after an abnormal interruption of an OPC UA session; and a phase synchronization unit that restores phase variable values from persistent storage when the system restarts.
[0015] This invention also provides an embodiment, including an OPC UA-based industrial data mapping and conversion method, applied to any of the OPC UA-based industrial data mapping and conversion systems, comprising the following steps: server initialization, creating an OPC UA server instance and initializing the address space; loading a predefined set of waveform types, wherein the waveform types include at least sine wave, triangle wave, square wave, and sawtooth wave; dynamic node registration, receiving externally input node registration requests, parsing node identifiers, data types, and configuration parameters; performing intelligent waveform allocation according to data type: automatically allocating sine wave mode and setting amplitude parameters for floating-point nodes; automatically allocating random value mode and limiting the value range for integer nodes; forcibly allocating square wave mode for Boolean nodes; timed control startup, preset timer period, and starting global phase variable accumulation; waveform data generation. Upon each timed trigger, the following operations are performed based on the phase variable: For triangular wave mode nodes, a piecewise linearly varying rising and falling waveform is generated; for square wave mode nodes, a high-low level switching signal is generated based on the sine phase sign; for sawtooth wave mode nodes, a unidirectional cyclic waveform with linearly increasing phase is generated; data type safe conversion is performed, converting the generated waveform data into the target node data type, including: performing saturation truncation on floating-point data; performing rounding on integer data; generating a status value for Boolean data through dynamic threshold comparison; node update notification, writing the converted data to the corresponding OPCUA node; and triggering data change notification, publishing the updated node value to subscribing clients.
[0016] Beneficial effects
[0017] This invention presents an OPC UA-based industrial data mapping and conversion system and method, which effectively solves the problems existing in the prior art through the collaborative work of multiple modules and a sound mechanism design. The waveform definition module provides rich waveform generation modes; the node management module enables efficient management of nodes and their configuration parameters; the intelligent adaptation module improves the automation of configuration; the timing control module ensures real-time dynamic data updates; the waveform generation module can generate various waveform data and supports waveform combination and noise injection; the data type conversion module ensures safe data type conversion; the extended interface module and dynamic loading unit enhance the system's scalability; and the resource management mechanism and anomaly recovery mechanism ensure stable system operation and rational resource utilization. Compared with the prior art, this invention can support the generation of various complex waveforms to meet the simulation needs of different industrial scenarios; it can automatically allocate waveforms according to data type, improving configuration flexibility; it achieves true real-time data updates through adjustable period timers and phase variable control; it allows users to customize waveform generators, enhancing system scalability; it supports the simulation of multiple data types, including composite data types; and it has waveform combination capabilities, making it suitable for complex industrial scenarios. In the process of industrial system development, testing and verification, this invention can provide more realistic and reliable industrial signal simulation data, which helps to improve the development efficiency and quality of industrial systems, and has significant economic benefits and broad application prospects. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the structures shown in these drawings without creative effort.
[0019] Figure 1 A system block diagram provided for an embodiment of the present invention;
[0020] Figure 2 The training process of the autoencoder anomaly detection model G provided in this embodiment of the invention;
[0021] Figure 3 Provided for embodiments of the present invention;
[0022] Figure 4 A flowchart illustrating the working steps of another embodiment of the present invention. Detailed Implementation
[0023] 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 only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0024] It should be noted that if the embodiments of the present invention involve directional indications (such as up, down, left, right, front, back, etc.), the directional indications are only used to explain the relative positional relationship and movement of the components in a specific posture. If the specific posture changes, the directional indications will also change accordingly.
[0025] Furthermore, if the embodiments of this invention involve descriptions such as "first" or "second," these descriptions are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined with "first" or "second" may explicitly or implicitly include at least one of those features. Additionally, the use of "and / or" or "and / or" throughout the text includes three parallel solutions. For example, "A and / or B" includes solution A, solution B, or a solution where both A and B are satisfied simultaneously. Furthermore, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed by this invention.
[0026] Example 1
[0027] refer to Figures 1-3 This invention provides an industrial data mapping and conversion system based on OPC UA, including a waveform definition module, a node management module, an intelligent adaptation module, a timing control module, a waveform generation module, and a data type conversion module. It also includes auxiliary modules such as an extension interface module and a dynamic loading unit, and has resource management and anomaly recovery mechanisms.
[0028] The waveform definition module supports multiple waveform generation modes through predefined enumeration types, covering sine waves, triangle waves, square waves, sawtooth waves, random values, and timestamp modes, providing a rich waveform foundation for the system. The node management module uses a dictionary structure to dynamically store OPC UA nodes and their associated waveform configuration parameters. These parameters include waveform type, data range, and phase offset, and include a dynamic node registration interface to receive externally input node information and user-defined waveform parameters. The configuration verification unit, when the user has not specified waveform parameters, calls the intelligent adaptation module to allocate default configurations and generate log records, achieving efficient node management. The intelligent adaptation module can automatically assign default waveform modes based on node data type. For example, integer nodes are associated with a random value mode and a limited value range; floating-point nodes are associated with a sine wave mode and amplitude parameters are configured; and string nodes are associated with a timestamp mode and a time format is defined, improving the automation of configuration.
[0029] The waveform type definition module meticulously defines seven different waveform types using the SimulationType enumeration, covering None, Random, Sine, Triangle, Square, Sawtooth, and Timestamp. Each waveform type relies on a unique mathematical model to generate data sequences with specific patterns. The dynamic node management module utilizes a Dictionary.<NodeId,BaseDataVariableState> The structure stores all OPC UA nodes that need to be simulated, and uses a dictionary.<NodeId,SimulationType> The structure maintains the mapping relationship between nodes and waveform types, and provides methods such as RegisterVariableForSimulation and AddVariable to support the dynamic addition of simulation nodes, which greatly improves the flexibility of node management.
[0030] The waveform generation and data update module periodically triggers data updates for all registered nodes via the SimulationCallback method. Waveform generation is controlled by the phase variable _simulationPhase, with each callback incrementing by 0.1 radians and the process repeated cyclically. Simultaneously, the UpdateVariableValue method is implemented to generate new values based on the node's data type and simulation type. A multi-data type support mechanism implements dedicated data generation methods for different data types (Int32, Float, Double, String, Boolean). Each data type widely supports multiple waveform modes, such as GenerateIntValue and GenerateFloatValue, fully meeting diverse data simulation needs.
[0031] The timing control module triggers data updates via an adjustable period timer, with the timer period dynamically adjustable from 50ms to 10s. An independent thread ensures timing accuracy. Simultaneously, it incrementally accumulates and periodically resets the global phase variable with each update. The increment step of the phase variable is related to the timing period, ensuring waveform frequency synchronization and enabling real-time dynamic data updates. The waveform generation module generates corresponding waveform data based on phase variables and configuration parameters. For example, triangular wave data uses a piecewise linear function to generate periodic rising and falling waveforms; square wave data uses sine wave sign determination to generate high / low level switching signals; and sawtooth wave data uses linear phase increments to generate unidirectional cyclic waveforms. Additionally, a waveform combination unit and a noise injection unit are included to generate composite waveform data and simulate industrial environment interference. The data type conversion module securely converts the generated waveform data to the target node's data type. Dedicated converters are provided for different data types. For example, a floating-point converter saturates values exceeding the target type's range; a string converter formats timestamp data into strings conforming to the ISO 8601 standard; and a Boolean converter converts values to high / low levels through dynamic threshold comparison.
[0032] The extended interface module allows users to add custom waveform generators by inheriting from a predefined base class. Custom waveform generators must implement phase parameter input interfaces, configuration parameter parsing interfaces, and data generation interfaces. The dynamic loading unit loads plugin libraries containing new waveform algorithms and updates waveform enumeration types at runtime, enhancing the system's scalability. The resource management mechanism includes a timer resource release unit, a node state snapshot unit, and a memory optimization mechanism. These mechanisms destroy timer instances when simulation stops or the system shuts down, store and restore initial node values during reset operations, and pause waveform calculations for inactive nodes until reactivation, ensuring efficient resource utilization. The exception recovery mechanism includes a data generation timeout monitoring unit, a disconnection reconnection unit, and a phase synchronization unit. These mechanisms skip node updates when single-node calculation time exceeds a threshold, automatically rebuild node subscription relationships after an abnormal OPC UA session interruption, and restore phase variable values from persistent storage upon system restart, ensuring stable system operation.
[0033] In some embodiments, such as during automated testing in certain factories, during the server initialization phase, an OPC UA server instance is created and the address space is initialized, loading a predefined set of waveform types such as sine waves, triangle waves, square waves, and sawtooth waves. Then, the dynamic node registration phase begins, receiving node registration requests from external input. For temperature sensor nodes, whose data type is floating-point, the intelligent adaptation module automatically assigns a sine wave mode and sets default amplitude parameters, such as an amplitude of 10, indicating that the temperature fluctuates in a sine wave form within a certain range. For device status sensor nodes, whose data type is boolean, the intelligent adaptation module forcibly assigns a square wave mode. Simultaneously, the node management module's dynamic registration interface receives node identifiers, data types, and other information, storing them in a dictionary structure, and the configuration verification unit confirms the completeness of the configuration information. Next, timing control is initiated, setting the timer period to 500ms and starting the global phase variable accumulation. The waveform generation module begins operation each time the timing is triggered. For temperature sensor nodes, temperature data in sinusoidal form is generated using appropriate calculation methods based on phase variables and sine wave configuration parameters. For device status sensor nodes, a square wave signal with high and low level switching is generated based on the sine phase sign, representing the device's running and stopped states. The generated data enters the data type conversion module. The floating-point converter processes the temperature data; if the generated value exceeds the floating-point target range, saturation processing is performed. The Boolean converter converts the device status value to a high or low level state through dynamic threshold comparison. Finally, the data type conversion module writes the converted data to the corresponding OPC UA node. The node update notification module triggers a data change notification, publishing the updated temperature and device status values to clients subscribed to that node's data, allowing the clients to obtain simulated real-time industrial signal data.
[0034] In some embodiments, such as in a process control test scenario, it is necessary to simulate data from pressure sensors and composite sensors. The pressure sensor data is of floating-point type, and the simulated data is required to have a certain degree of noise interference. Triangular waves and sine waves need to be superimposed to simulate complex pressure changes. The composite sensor contains floating-point temperature data, integer count data, and string-type timestamp data.
[0035] Server initialization follows the same process as described above. During dynamic node registration, for pressure sensor nodes, in addition to the intelligent adaptation module automatically assigning a sine wave mode and setting a default amplitude, the user also inputs custom waveform parameters through the node dynamic registration interface of the node management module, requesting the superposition of a triangular wave and setting noise injection parameters. For composite sensor nodes, the intelligent adaptation module assigns corresponding default waveform modes to their different data type sub-nodes: floating-point temperature data is associated with a sine wave mode, integer count data is associated with a random value mode and its numerical range is limited, and string timestamp data is associated with a timestamp mode and its time format is defined.
[0036] After the timing control is started, the timer period is set to 1 second. During the waveform data generation stage, the waveform generation module, for the pressure sensor node, first generates triangular wave data using a piecewise linear function based on the phase variable and configuration parameters, then generates sine wave data using a sine wave generation algorithm, and then superimposes the two, and adds Gaussian white noise through a noise injection unit to generate pressure simulation data that meets the requirements; for composite sensor nodes, corresponding waveform data is generated based on the phase variable and their respective configuration parameters for sub-nodes of different data types.
[0037] The data type conversion module processes the generated data. The floating-point converter performs saturation truncation on the pressure and temperature data, the integer converter rounds the count data, and the string converter formats the timestamp data into a string conforming to the ISO 8601 standard.
[0038] Finally, the converted data is written to the corresponding OPC UA node, and the node update notification module publishes the updated node value to the subscribing clients. The clients can then obtain simulated complex industrial signal data to meet the needs of process control testing scenarios.
[0039] Example 2
[0040] refer to Figure 4The present invention also provides an embodiment, including an industrial data mapping and conversion method based on OPC UA, applied to any of the aforementioned OPC UA-based industrial data mapping and conversion systems, comprising the following steps: server initialization, creating an OPC UA server instance and initializing the address space; loading a predefined set of waveform types, wherein the waveform types include at least sine wave, triangle wave, square wave, and sawtooth wave; dynamic node registration, receiving externally input node registration requests, parsing node identifiers, data types, and configuration parameters; performing intelligent waveform allocation according to data type: automatically allocating sine wave mode and setting amplitude parameters for floating-point nodes; automatically allocating random value mode and limiting the value range for integer nodes; forcibly allocating square wave mode for Boolean nodes; timed control startup, preset timer period, and starting global phase variable accumulation; waveform data generation; Upon each timed trigger, the following operations are performed based on the phase variable: For triangular wave mode nodes, a piecewise linearly varying rising and falling waveform is generated; for square wave mode nodes, a high-low level switching signal is generated based on the sine phase sign; for sawtooth wave mode nodes, a unidirectional cyclic waveform with linearly increasing phase is generated; data type safe conversion is performed, converting the generated waveform data to the target node data type, including: performing saturation truncation on floating-point data; performing rounding on integer data; generating a status value for Boolean data through dynamic threshold comparison; node update notification, writing the converted data to the corresponding OPC UA node; and triggering data change notification, publishing the updated node value to subscribing clients.
[0041] The industrial data mapping and conversion method based on the above system includes steps such as server initialization, dynamic node registration, timed control startup, waveform data generation, secure data type conversion, and node update notification. During server initialization, an OPC UA server instance is created and the address space is initialized, loading a predefined set of waveform types. During dynamic node registration, external node registration requests are received, node identifiers, data types, and configuration parameters are parsed, and intelligent waveform allocation is performed based on the data type. During timed control startup, a timer period is preset, and global phase variable accumulation is initiated. During waveform data generation, corresponding waveform data is generated based on the phase variable at each timed trigger. Secure data type conversion converts the generated waveform data into the target node data type. Finally, the converted data is written to the corresponding OPC UA node via node update notification, and the updated node value is published to subscribing clients.
[0042] This invention effectively overcomes the technical bottlenecks of dynamic data simulation in industrial automation through innovative multi-waveform generation algorithms and intelligent data adaptation architecture, successfully solving key problems in traditional solutions such as single waveform type, low configuration efficiency, and poor timing consistency. Based on a phase synchronization control engine and a multi-dimensional waveform algorithm library, the system achieves periodic dynamic generation of various industrial standard signals. Combined with an intelligent type matching mechanism, it automatically assigns appropriate waveform features to different data nodes, significantly improving the simulation accuracy of complex scenarios. Through a unique generic safe conversion system, it completes waveform parameter mapping across numerical domains while ensuring data type integrity, eliminating the risks of numerical overflow and type conflicts common in traditional simulation systems. Simultaneously, a modular extension architecture supports seamless integration of user-defined waveform algorithms, providing a technical foundation for in-depth simulation of special industrial scenarios. Dynamic node management mechanisms and resource optimization strategies enable efficient scheduling of large-scale data nodes, maintaining system stability while ensuring real-time data updates. Real-world industrial scenario verification shows that the system can accurately simulate typical operating conditions such as fluctuations in production line equipment status, changes in energy system parameters, and switching of intelligent control signals. This significantly shortens the development and debugging cycle of automation systems, effectively improves the anomaly detection capability of industrial control programs, and provides a high-fidelity, full-element dynamic data environment for the construction of digital twin systems, verification of edge computing nodes, and testing of industrial IoT platforms. It fills the technical gap in the field of standardized data simulation of the OPC UA protocol and has significant industry promotion value.
[0043] The above description is merely a preferred embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural transformations made using the contents of the present invention's specification and drawings under the inventive concept of the present invention, or direct / indirect applications in other related technical fields, are included within the patent protection scope of the present invention.
Claims
1. An industrial data mapping and conversion system based on OPC UA, characterized in that, include: The waveform definition module is configured to support multiple waveform generation modes through predefined enumeration types, including sine wave, triangle wave, square wave, sawtooth wave, random value and timestamp mode; The node management module uses a dictionary structure to dynamically store OPC UA nodes and their associated waveform configuration parameters. Specifically, it utilizes a dictionary...<NodeId, BaseDataVariableState> The structure stores all OPC UA nodes that need to be simulated, and uses a dictionary.<NodeId, SimulationType> The structure maintains the mapping relationship between nodes and waveform types, and supports the dynamic addition of analog nodes. The configuration parameters include waveform type, data range, and phase offset. The intelligent adaptation module is configured to automatically assign default waveform modes based on node data types. Specifically: integer nodes are associated with a random value mode with a defined range; floating-point nodes are associated with a sine wave mode with configured amplitude parameters; and string nodes are associated with a timestamp mode with a defined time format. The intelligent adaptation module also includes: a semantic analysis unit that parses node name keywords and associates them with specific waveform modes, including: nodes containing the "Temperature" field are automatically associated with a sine wave mode, and nodes containing the "Status" field are forcibly associated with a square wave mode; and a historical data learning unit that recommends waveform parameters based on the distribution characteristics of node historical data. The timing control module is configured to trigger data updates via an adjustable periodic timer, and to incrementally accumulate and periodically reset the global phase variable during each update. The waveform generation module is configured to generate corresponding waveform data based on phase variables and configuration parameters. The waveform generation module further includes: a waveform combination unit configured to superimpose multiple waveform parameters on the same node to generate composite waveform data; and a noise injection unit that superimposes Gaussian white noise during data generation to simulate industrial environment interference. Specifically: triangular wave data uses a piecewise linear function to generate periodic rising and falling waveforms; square wave data uses sine wave symbols to generate high and low level switching signals; and sawtooth wave data uses linearly increasing phase to generate a unidirectional cyclic waveform. The data type conversion module is configured to safely convert the generated waveform data into the data type of the target node and perform numerical range constraints and exception handling.
2. The industrial data mapping and conversion system based on OPC UA according to claim 1, characterized in that, The node management module also includes: The node dynamic registration interface is used to receive external inputs such as node identifier, data type, and user-defined waveform parameters. Configure the verification unit. When the user does not specify waveform parameters, call the intelligent adaptation module to allocate the default configuration and generate log records.
3. The industrial data mapping and conversion system based on OPC UA according to claim 1, characterized in that, In the timing control module: The timer period supports dynamic adjustment, and timing accuracy is ensured through an independent thread; the increment step of the phase variable is associated with the timing period and is used to synchronize the waveform frequency with the timing period.
4. The industrial data mapping and conversion system based on OPC UA according to claim 1, characterized in that, The data type conversion module includes: The floating-point converter is configured to saturate values that exceed the range of the target type; the string converter formats timestamp pattern data into strings conforming to the ISO 8601 standard; and the Boolean converter converts values to high or low levels through dynamic threshold comparison.
5. The industrial data mapping and conversion system based on OPC UA according to claim 1, characterized in that, The system also includes: The extension interface module allows users to add custom waveform generators by inheriting from a predefined base class; the dynamic loading unit loads a plugin library containing new waveform algorithms and updates the waveform enumeration type at runtime.
6. The industrial data mapping and conversion system based on OPC UA according to claim 5, characterized in that, The custom waveform generator needs to implement: Phase parameter input interface, receives global phase variable values; Configure the parameter parsing interface to read user-defined waveform parameters; The data generation interface returns waveform data that is compatible with the target data type.
7. The industrial data mapping and conversion system based on OPC UA according to claim 1, characterized in that, The system implements resource management through the following mechanisms: The timer resource release unit destroys the timer instance when the simulation stops or the system shuts down; Node state snapshot unit, which stores and restores the node's initial value during a reset operation; The memory optimization mechanism pauses waveform calculations for inactive nodes until they are reactivated.
8. The industrial data mapping and conversion system based on OPC UA according to claim 1, characterized in that, The system integrates an anomaly recovery mechanism: The data generation timeout monitoring unit skips the update of a node when the calculation time of a single node exceeds a threshold; the disconnection reconnection unit automatically rebuilds the node subscription relationship after an abnormal interruption of the OPC UA session. The phase synchronization unit restores the phase variable values from persistent storage when the system restarts.
9. An industrial data mapping and conversion method based on OPC UA, applied to any of the OPC UA-based industrial data mapping and conversion systems described in claims 1-8, characterized in that, Includes the following steps: Server initialization: Create an OPC UA server instance and initialize the address space; Load a predefined set of waveform types, which includes at least sine wave, triangle wave, square wave, and sawtooth wave; Dynamic node registration receives external node registration requests, parses node identifiers, data types, and configuration parameters; performs intelligent waveform allocation based on data type: automatically assigns sine wave mode and sets amplitude parameters for floating-point nodes; automatically assigns random value mode and limits the value range for integer nodes; and forcibly assigns square wave mode to Boolean nodes. The timed control starts, with a preset timer period, and initiates the global phase variable accumulation. Waveform data generation: At each timed trigger, the following operations are performed based on the phase variable: For the triangular wave mode node, a piecewise linear rising and falling waveform is generated; For square wave mode nodes, a high / low level switching signal is generated based on the sinusoidal phase sign; For sawtooth wave mode nodes, generate a unidirectional cyclic waveform with linearly increasing phase; Data type safe conversion converts the generated waveform data into the target node data type, including: performing saturation truncation on floating-point data; performing rounding on integer data; and generating state values for Boolean data through dynamic threshold comparison. Node update notifications write the transformed data to the corresponding OPC UA node; trigger data change notifications publish the updated node values to subscribing clients.