Data processing method and device, equipment, storage medium and program product
By identifying OPC UA identifiers in Modbus TCP data frames and integrating protocols, the problem of high hardware equipment costs is solved, real-time data transmission and flexibility between Modbus TCP and OPC UA protocols is realized, and management costs are reduced.
Patent Information
- Application Number
- CN202411179672.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2024-12-13
Smart Images

Figure CN119135779A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of data communication technology, and in particular, relates to a data processing method, device, equipment, storage medium and program product. Background Art
[0002] The Modbus communication protocol is a communication protocol widely used in the industrial equipment layer. The Object Linking and Embedding for Process Control Unified Architecture (OPCUA) is a cross-platform, cross-vendor communication protocol that provides a standardized, secure and interoperable communication method between industrial equipment and systems. In the related art, a mapping method based on static semantics or a mapping method based on dynamic semantics can be used to achieve the conversion between the Modbus Transmission Control Protocol (TCP) and the OPC UA protocol. However, the architecture that integrates the Modbus TCP and OPC UA protocols proposed in the related art requires the separate deployment of hardware devices that carry the information model mapping of Modbus TCP and OPC UA, which increases the cost of hardware devices. Summary of the invention
[0003] In order to solve the problem of high hardware equipment cost in the related art, the embodiments of the present application propose a data processing method, apparatus, device, storage medium and program product.
[0004] The present application provides a data processing method, the method comprising:
[0005] Receiving an Ethernet frame, wherein the Ethernet frame encapsulates a Modbus TCP data frame, wherein the Modbus TCP data frame includes an OPC UA identifier, wherein the OPC UA identifier is used to indicate whether a payload of the data frame includes a Unified Architecture Datagram Protocol (UADP) message;
[0006] Determine the OPC UA identifier by parsing the data frame;
[0007] In the case where the OPC UA identifier indicates that the payload includes the UADP message, the payload is parsed in a UADP encoding manner to obtain the UADP message.
[0008] In some embodiments, when the OPC UA identifier indicates that the payload includes the UADP message, the method further includes: obtaining the payload from an application data unit (ADU) of the data frame.
[0009] In some embodiments, the method further includes: when the OPC UA identifier indicates that the payload does not include the UADP message, stopping parsing the data frame, and sending the parsed data frame to a receiver of the data frame.
[0010] In some embodiments, determining the OPC UA identifier by parsing the data frame includes: parsing the data frame using a pre-deployed protocol stack to determine the OPC UA identifier; the protocol stack is used to implement adding the UADP message to the payload of the Modbus TCP data frame, and parsing the Modbus TCP data frame with the UADP message added; parsing the payload in UADP encoding includes: using the pre-deployed protocol stack and parsing the payload in UADP encoding.
[0011] In some embodiments, the protocol stack is deployed in a container-based virtualization deployment manner.
[0012] In some embodiments, the protocol stack is deployed by means of hardware burning.
[0013] The present application also provides a data processing device, the device comprising:
[0014] A receiving module, configured to receive an Ethernet frame, wherein the Ethernet frame encapsulates a Modbus TCP data frame, wherein the Modbus TCP data frame includes an OPC UA identifier, and wherein the OPC UA identifier is used to indicate whether a payload of the data frame includes a UADP message;
[0015] A parsing module, configured to determine the OPC UA identifier by parsing the data frame;
[0016] The processing module is configured to parse the payload in a UADP encoding manner to obtain the UADP message when the OPC UA identifier indicates that the payload includes the UADP message.
[0017] An embodiment of the present application also provides an electronic device, comprising a processor and a memory for storing a computer program that can be run on the processor; wherein the processor is used to run the computer program to execute any one of the above-mentioned data processing methods.
[0018] An embodiment of the present application further provides a computer storage medium on which a computer program is stored. When the computer program is executed by a processor, any one of the above-mentioned data processing methods is implemented.
[0019] An embodiment of the present application further provides a computer program product, including a computer program, which implements any of the above-mentioned data processing methods when executed by a processor.
[0020] It can be seen that in the embodiment of the present application, the OPC UA identifier can be determined in the Modbus TCP data frame, and whether the payload of the data frame contains a UADP message can be determined according to the OPC UA identifier; since the UADP message is a message generated through the OPC UA subscription mode or the OPC UA publishing communication mode, the UADP message is included in the payload of the data frame, and data fusion of the Modbus TCP and OPC UA protocols can be achieved in the same data frame, that is, the Modbus TCP and OPC UA protocols can be closely integrated in the protocol architecture dimension, without the need to deploy hardware devices that carry the information model mapping of Modbus TCP and OPC UA, which is conducive to reducing the cost of hardware devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 The architecture diagram of the conversion between Modbus TCP and OPC UA protocols using a mapping method based on static semantics in related technologies;
[0022] Figure 2 The architecture diagram of the conversion between Modbus TCP and OPC UA protocols using a mapping method based on dynamic semantics in related technologies;
[0023] Figure 3 A flowchart of a data processing method according to an embodiment of the present application;
[0024] Figure 4 A flowchart of parsing a Modbus TCP data frame provided in an embodiment of the present application;
[0025] Figure 5 A schematic diagram of deploying a protocol stack in a device provided in an embodiment of the present application;
[0026] Figure 6 A schematic diagram of an exemplary communication system architecture of an industrial control system provided in an embodiment of the present application;
[0027] Figure 7 A schematic diagram of the architecture of another exemplary communication system of the industrial control system provided in the application embodiment;
[0028] Figure 8 A schematic diagram of the structure of a data processing device according to an embodiment of the present application;
[0029] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0030] Industrial field protocols are an important part of industrial control systems. In the past few decades, automation equipment manufacturers have gradually begun to use Ethernet as a field network transmission medium. For example, industrial field protocols can be EtherCAT, Modbus TCP, SercosⅢ, etc. Among them, the Modbus communication protocol is a communication protocol widely used in the industrial equipment layer. Most programmable logic controllers (PLC), distributed control systems (DCS), data acquisition modules and control devices use the Modbus communication protocol. Since the Ethernet systems between companies are independent of each other and cannot communicate effectively, the problem of information islands is serious, which reduces industrial production efficiency. Therefore, OPC UA provides an industrial data exchange specification. Through OPC UA, different types of devices and systems can seamlessly exchange and communicate data, realize interconnection between devices, and lay the foundation for the development of the industrial Internet of Things. However, OPC UA is mostly used for unified data modeling and transmission of information technology (IT) systems. With the continuous integration and innovation of new information and communication technologies (ICT) such as the fifth generation mobile communication technology (5G), big models, operation transformation (OT) control theory and industrial edge devices, data management and analysis on the industrial edge have become an important entry point for ICT to empower OT. Among them, OPC UA achieves information aggregation and conversion of field equipment through protocol conversion with industrial fieldbus. In related technologies, there are solutions for protocol conversion between Modbus TCP and OPC UA protocols to achieve the unification of information models of field-level devices, but there is no solution to closely integrate OPC UA protocol and Modbus protocol in the protocol architecture dimension.
[0031] In the related art, a mapping method based on static semantics or a mapping method based on dynamic semantics can be used to realize the conversion between Modbus TCP and OPC UA protocols; Figure 1 This is an architecture diagram of the conversion between Modbus TCP and OPC UA protocols using a static semantics-based mapping method in the related technology. Figure 1 , field device_1 to field device_n represent n different field devices, and field device_1 to field device_n can use Modbus TCP to communicate with PLC. The information model for converting Modbus TCP to OPC UA protocol can be preset in the protocol conversion server, so that the information model and service function of the ModbusTCP field bus can be mapped to the OPC UA server (Server).
[0032] Figure 2 This is an architecture diagram of the conversion between Modbus TCP and OPC UA protocols using a mapping method based on dynamic semantics in related technologies. Figure 2 , field device_1` to field device_n represent n different field devices, and field device_1` to field device_n can communicate with PLC using Modbus TCP. In practical applications, a customized mapping rule can be assigned to each field device, and the mapping rule is used to implement a configurable semantic mapping between Modbus TCP and OPC UA protocol for the corresponding field device; refer to Figure 2 , the mapping rules can be sent to the protocol conversion server, for example, mapping rule 1 is the mapping rule corresponding to field device_1, and mapping rule 2 is the mapping rule corresponding to field device_2. In actual scenarios, the mapping relationship can be dynamically updated as needed; for example, when the configuration of the field device changes or a new field device needs to be added, the mapping relationship can be dynamically updated to ensure the flexibility and scalability of the system.
[0033] The methods of combining Modbus TCP with OPC UA protocols in related technologies all use semantic mapping to enable OPC UA servers to access field devices through Modbus TCP, but fail to enable OPC UA communication protocols to penetrate the field device layer to obtain real-time communication capabilities.
[0034] In the conversion scheme of Modbus TCP and OPC UA protocols using a static semantics-based mapping method, the rules for protocol conversion are usually fixed, which makes it difficult to make adaptive adjustments when faced with new or atypical data. At the same time, after the data is collected, further protocol conversion is required, which lacks real-time performance. In addition, the solution requires the separate deployment of carriers or hardware devices that carry the information model mapping of Modbus TCP and OPC UA, which leads to bloated network layers and increased hardware device costs.
[0035] In the conversion scheme of Modbus TCP and OPC UA protocols using a mapping method based on dynamic semantics, it is necessary to regularly maintain the mapping rules to adapt to the equipment updates on site. The mapping rules need to be uniformly managed and updated by an independent platform, which increases the management cost. At the same time, after the data is collected, further protocol conversion is required, which lacks real-time performance. In addition, the scheme requires the separate deployment of carriers or hardware devices that carry the information model mapping of Modbus TCP and OPC UA, which leads to bloated network layers and increased hardware equipment costs.
[0036] In order to solve the above technical problems, a technical solution of the embodiment of the present application is proposed.
[0037] The following is a further detailed description of the embodiments of the present application in conjunction with the accompanying drawings and examples. It should be understood that the embodiments provided herein are only used to explain the embodiments of the present application and are not intended to limit the embodiments of the present application. In addition, the embodiments provided below are partial embodiments for implementing the present application, rather than providing all embodiments for implementing the present application. In the absence of conflict, the technical solutions recorded in the embodiments of the present application can be implemented in any combination.
[0038] It should be noted that, in the embodiments of the present application, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a method or device including a series of elements includes not only the elements explicitly recorded, but also includes other elements not explicitly listed, or also includes elements inherent to the implementation of the method or device. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the presence of other related elements (such as steps in a method or units in a device, for example, a unit may be a part of a circuit, a part of a processor, a part of a program or software, etc.) in the method or device including the element.
[0039] The data processing method provided in the embodiment of the present application includes a series of steps, but the data processing method provided in the embodiment of the present application is not limited to the recorded steps. Similarly, the data processing device provided in the embodiment of the present application includes a series of modules, but the device provided in the embodiment of the present application is not limited to including the modules explicitly recorded, and may also include modules required to obtain relevant information or perform processing based on information.
[0040] Figure 3 is a flow chart of a data processing method according to an embodiment of the present application, such as Figure 3 As shown, the process may include:
[0041] Step 301: Receive an Ethernet frame, the Ethernet frame encapsulating a Modbus TCP data frame, the Modbus TCP data frame including an OPC UA identifier, and the OPC UA identifier is used to indicate whether the payload of the data frame includes a UADP message.
[0042] In actual scenarios, field devices such as controllers, PLCs, and gateways can use Modbus TCP to receive Ethernet frames.
[0043] In some embodiments, the starting position of the payload of the data frame is the 14th byte of the data frame.
[0044] In some embodiments, the OPC UA identifier may be located at a preset position of the Modbus TCP data frame. For example, the OPC UA identifier is located at the 22nd byte of the Modbus TCP data frame.
[0045] The OPC UA identifier can be set according to actual needs; illustratively, when the OPC UA identifier is 1, it means that the payload of the data frame includes a UADP message; when the OPC UA identifier is 1, it means that the payload of the data frame does not include a UADP message.
[0046] In the embodiment of the present application, the UADP message is a message generated in the OPC UA subscription mode or the OPC UA publishing communication mode.
[0047] Step 302: Determine the OPC UA identifier by parsing the data frame.
[0048] Step 303: When the OPC UA identifier represents that the payload includes a UADP message, the payload is parsed in a UADP encoding manner to obtain the UADP message.
[0049] In practical applications, steps 301 to 303 can be implemented based on a processor, and the processor can be at least one of an application specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a central processing unit (CPU), a controller, a microcontroller, and a microprocessor.
[0050] It can be seen that in the embodiment of the present application, the OPC UA identifier can be determined in the Modbus TCP data frame, and whether the payload of the data frame contains a UADP message can be determined according to the OPC UA identifier; since the UADP message is a message generated through the OPC UA subscription mode or the OPC UA publishing communication mode, the UADP message is included in the payload of the data frame, and data fusion of the Modbus TCP and OPC UA protocols can be achieved in the same data frame, that is, the Modbus TCP and OPC UA protocols can be closely integrated in the protocol architecture dimension, without the need to deploy hardware devices that carry the information model mapping of Modbus TCP and OPC UA, which is conducive to reducing the cost of hardware equipment and realizing real-time transmission based on a unified data information model.
[0051] In some embodiments of the present application, when the OPC UA identifier represents that the payload includes a UADP message, the method further includes: acquiring the payload from an ADU of a data frame.
[0052] In practical applications, UADP messages can be added as payloads to the ADU of Modbus TCP data frames, thereby achieving real-time communication at the field device layer based on a consistent information model.
[0053] In some embodiments, both Modbus TCP data frames and UADP messages are encapsulated in Ethernet II frames.
[0054] Table 1 is a format table of the data frame of Modbus TCP in the related art. Referring to Table 1, bytes 0 to 13 of the data frame of Modbus TCP are standard Ethernet frame headers, bytes 14 to n of the data frame of Modbus TCP are ADU parts of the data frame of Modbus TCP, and n is an integer greater than 22; bytes n+1 to n+4 of the data frame of Modbus TCP are CRC32 check codes.
[0055] Table 1
[0056]
[0057] Table 2 is a format table of the OPC UA data frame in the related art. Referring to Table 2, the 0th to 13th bytes of the OPC UA data frame are the standard Ethernet frame header, the 14th to the mth bytes of the OPC UA data frame are the UADP message, and m is an integer greater than 14; the m+1th to the m+4th bytes of the OPC UA data frame are the CRC32 check code.
[0058] After the UADP message in Table 2 is added as a payload to the ADU of the Modbus TCP data frame, the Modbus TCP data frame shown in Table 3 can be obtained;
[0059] Table 2
[0060]
[0061] Table 3
[0062]
[0063] In Table 3, bytes 0 to 13 are standard Ethernet frame headers, B in the 22nd byte indicates the OPC UA identifier, r in the 22nd byte indicates a reserved field, and bytes 23 to k are UADP messages, where k is an integer greater than 23.
[0064] In the standard Ethernet frame header, the 12th and 13th bytes represent the Ethernet frame type, which is used to specify the high-level protocol type of the received data. When using the Modbus TCP protocol stack to send and receive data frames, the Ethernet type (bytes 12 to 13) of the data frame shown in Table 3 is the Modbus TCP protocol. In the embodiment of the present application, the data frame shown in Table 3 can be recorded as a Modbus_opc data frame.
[0065] In some embodiments of the present application, the method further includes: when the OPC UA identifier representation payload does not include a UADP message, stopping parsing the data frame, and sending the parsed data frame to a receiver of the data frame.
[0066] It can be seen that when the OPC UA identifier represents that the payload does not contain a UADP message, it can be considered that the payload part of the Modbus TCP data frame does not contain the relevant data of the OPC UA protocol. Therefore, the parsing result of the data frame can be obtained without using the UADP encoding method to parse the payload.
[0067] Figure 4 A flowchart of parsing a Modbus TCP data frame provided in an embodiment of the present application is shown in FIG. Figure 4 As shown, when a message carrying a Modbus TCP data frame is received, the data link layer can trigger the processing function of the Modbus data frame according to the message type (MessageType) in the message, and when the 22nd byte of the Modbus TCP data frame is parsed, it can be determined whether the received data frame is a Modbus_opc data frame according to the content in the 22nd byte, that is, whether the received data frame contains OPC UA protocol content, and the data frame is forwarded to the application layer processing module of the corresponding protocol according to the judgment result.
[0068] If the received data frame is a Modbus_opc data frame, the OPC UA server analyzes the payload in the frame in UADP encoding to obtain the UADP message, and then executes the interrupt exit process. If the received data frame is not a Modbus_opc data frame, the parsing of the received data frame is stopped, and the interrupt exit process is executed. After executing the interrupt exit process, the parsed data frame content can be sent to the application recipient of the Modbus protocol.
[0069] In the embodiment of the present application, the UADP message can be added to the payload of the Modbus TCP data frame, and the Modbus TCP data frame to which the UADP message is added can be parsed through a pre-deployed protocol stack.
[0070] In practical applications, the deployment method of the protocol stack can be determined according to the actual needs of users.
[0071] In some embodiments, the process of determining the OPC UA identifier by parsing the data frame includes: parsing the data frame using a pre-deployed protocol stack to determine the OPC UA identifier. The process of parsing the payload in UADP encoding includes: using the pre-deployed protocol stack and parsing the payload in UADP encoding.
[0072] In some embodiments, the above protocol stack is deployed based on the container virtualization deployment mode, so that lightweight and portable protocol stack deployment can be achieved. Figure 5 By means of container virtualization, the protocol stack can be deployed in field devices such as PLCs and gateways; illustratively, the protocol stack can also be deployed in devices such as controllers by means of container virtualization.
[0073] The above-mentioned virtualization deployment method belongs to the software deployment method, which is implemented based on virtualization methods such as containers and virtual machines, and does not need to rely on specific hardware. The use of virtualization deployment methods can reduce costs and provide flexibility, allowing network functions to be configured and adjusted through network software without changing physical hardware. Exemplarily, using technologies such as the Data Plane Development Kit (DPDK), the network card can be bound to the driver after the system loads the corresponding driver, thereby creating a virtual device in the / dev directory, thereby realizing the virtualization deployment of the protocol stack. The deployment of the protocol stack using a virtualization deployment method can improve the performance of data processing and allow more efficient network data packet processing.
[0074] In some embodiments, the protocol stack is deployed by hardware burning, for example, the protocol stack can be burned into Flash memory. The solution of deploying the protocol stack by hardware burning can be applied to scenarios with extremely high performance requirements, because the solution can reduce the overhead caused by software operation.
[0075] Figure 6 The following is a schematic diagram of an exemplary communication system architecture of an industrial control system provided in an embodiment of the present application. Figure 7 Another exemplary communication system architecture diagram of an industrial control system provided in an embodiment of the application, referring to Figure 6 and Figure 7 The data management platform of the cloud data management layer may include a database and an OPC UA client (Client), the sensor of the field device layer may include an OPC UA client and a data acquisition module, the sensor may use the Modbus_opc protocol to exchange data with the PLC of the edge control layer, and the different PLCs of the edge control layer may use the Modbus_opc protocol to exchange data. Here, the Modbus_opc protocol is a protocol for transmitting Modbus TCP data frames with UADP messages added, and the Modbus_opc protocol can also be used to parse Modbus TCP data frames with UADP messages added.
[0076] Reference Figure 6The edge control layer includes the PLC runtime and the OPC UA server. The edge control layer can use 5G or wifi communication to interact with the cloud data management layer. Figure 7 , the OPC UA server can use 5G or wifi communication to interact with the PLC for data, and the OPC UA server can use 5G or wifi communication to interact with the data management platform for data.
[0077] In the embodiment of the present application, the Modbus_opc communication system composed of the PLC and the field device layer mainly completes the data acquisition and real-time transmission between the PLC and the field device, and supports asynchronous communication between the PLCs; the OPC UA server is responsible for providing the cloud data management layer with acquisition information, and at the same time performs asynchronous data exchange of Modbus_opc Pub / Sub communication for the PLC. In the field device layer, Modbus_opc communication or industrial field bus can be used to connect the field devices. The field device includes a data acquisition module, a control execution module, a Modbus_opc Pub communication module and a Modbus_opc Sub communication module, wherein the Modbus_opc Sub communication module is used to collect the control signal issued by the PLC, and the Modbus_opc Pub communication module is used to publish the collected data to the PLC or other field devices. The entire communication system adopts a modular design, which reduces the coupling between the OPC UA server and the original program. While ensuring stability, the communication system can adapt to different industrial field environments. Through the Modbus_opc Pub communication module and the Modbus_opc Sub communication module, data and control synchronization between industrial field devices is achieved, and real-time PLC data collection and control signal transmission of field equipment are realized, completing the mutual transmission of OPC UA data between different automation levels.
[0078] In summary, the embodiment of the present application proposes a transmission protocol architecture integrating Modbus and OPC UA, and a transmission method based on the transmission protocol architecture integrating Modbus and OPC UA, which can solve the problem of lack of real-time performance of OPC UA-based communication between PLC and field devices, and between controllers. On the basis of the Modbus TCP protocol, the OPC UA subscription and publishing frame format is integrated to support OPC UA communication on the Modbus TCP network, so as to realize real-time communication of industrial field devices based on a consistent information model.
[0079] The embodiments of the present application innovatively integrate the OPC UA protocol and the Modbus protocol in the protocol architecture dimension, lighten the protocol stack deployment method, simplify the field network hierarchy, reduce the cost of deploying hardware equipment, and realize real-time transmission based on a unified data information model.
[0080] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.
[0081] Figure 8 Schematic diagram of the structure of the data processing device of the embodiment of the present application, such as Figure 8 As shown, the device comprises:
[0082] A receiving module 801 is used to receive an Ethernet frame, wherein the Ethernet frame encapsulates a Modbus TCP data frame, wherein the Modbus TCP data frame includes an OPC UA identifier, and the OPC UA identifier is used to indicate whether a payload of the data frame includes a UADP message;
[0083] A parsing module 802, configured to determine the OPC UA identifier by parsing the data frame;
[0084] The processing module 803 is configured to parse the payload in a UADP encoding manner to obtain the UADP message when the OPC UA identifier indicates that the payload includes the UADP message.
[0085] In some embodiments, the processing module 803 is further configured to obtain the payload from the ADU of the data frame when the OPC UA identifier indicates that the payload includes the UADP message.
[0086] In some embodiments, the processing module 803 is further configured to stop parsing the data frame and send the parsed data frame to a receiver of the data frame when the OPC UA identifier indicates that the payload does not include the UADP message.
[0087] In some embodiments, the parsing module 802 is specifically used to parse the data frame using a pre-deployed protocol stack to determine the OPC UA identifier; the protocol stack is used to implement adding the UADP message to the payload of the Modbus TCP data frame, and parsing the Modbus TCP data frame with the UADP message added;
[0088] The processing module 803 is specifically configured to use the pre-deployed protocol stack to parse the payload in a UADP encoding manner.
[0089] In some embodiments, the protocol stack is deployed in a container-based virtualization deployment manner.
[0090] In some embodiments, the protocol stack is deployed by means of hardware burning.
[0091] In practical applications, the receiving module 801, the parsing module 802 and the processing module 803 can be implemented based on a processor and a communication device.
[0092] It should be noted that the description of the above device embodiment is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the device embodiment of the present application, please refer to the description of the method embodiment of the present application for understanding.
[0093] It should be noted that in the embodiments of the present application, if the above method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium, including a number of instructions to enable a computer device (which can be a terminal, a server, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a disk or an optical disk. In this way, the embodiments of the present application are not limited to any specific combination of hardware and software.
[0094] Correspondingly, an embodiment of the present application further provides a computer program product, which includes computer executable instructions, and the computer executable instructions are used to implement any data processing method provided in the embodiment of the present application.
[0095] Accordingly, an embodiment of the present application further provides a computer storage medium, on which computer executable instructions are stored, and the computer executable instructions are used to implement any one of the data processing methods provided in the above embodiments.
[0096] An embodiment of the present application also provides an electronic device. Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown in FIG. Fig. 9 As shown, the electronic device 90 may include:
[0097] Memory 901, used to store executable instructions;
[0098] The processor 902 is used to implement any of the above-mentioned data processing methods when executing the executable instructions stored in the memory 901.
[0099] The processor 902 may be at least one of an ASIC, a DSP, a DSPD, a PLD, a FPGA, a CPU, a controller, a microcontroller, and a microprocessor.
[0100] The above-mentioned computer-readable storage medium and memory 902 can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory (Flash Memory), a magnetic surface memory, an optical disk, or a compact disc read-only memory (CD-ROM) and other memories; it can also be various terminals including one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.
[0101] In some embodiments, the functions or modules included in the device provided in the embodiments of the present application can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments. For the sake of brevity, it will not be repeated here.
[0102] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.
[0103] The methods disclosed in the various method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
[0104] The features disclosed in the various product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0105] The features disclosed in the various method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.
[0106] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0107] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A data processing method, characterized in that: The method comprises: Receiving an Ethernet frame, wherein the Ethernet frame encapsulates a data frame of a Modbus transmission control protocol TCP, wherein the data frame of the Modbus TCP includes an identifier of an Open Production Control and Unified Architecture (OPC UA), wherein the identifier of the OPC UA is used to indicate whether a payload of the data frame includes a Unified Architecture Datagram Protocol (UADP) message; Determine the OPC UA identifier by parsing the data frame; In the case where the OPC UA identifier indicates that the payload includes the UADP message, the payload is parsed in a UADP encoding manner to obtain the UADP message.
2. The method according to claim 1, characterized in that In a case where the OPC UA identifier indicates that the payload includes the UADP message, the method further includes: acquiring the payload from an application data unit ADU of the data frame.
3. The method according to claim 1, characterized in that The method further includes: when the OPC UA identifier indicates that the payload does not include the UADP message, stopping parsing the data frame, and sending the parsed data frame to a receiver of the data frame.
4. The method according to any one of claims 1 to 3, characterized in that: Determining the OPC UA identifier by parsing the data frame includes: parsing the data frame using a pre-deployed protocol stack to determine the OPC UA identifier; the protocol stack is used to implement adding the UADP message to the payload of the Modbus TCP data frame, and parsing the Modbus TCP data frame to which the UADP message is added; The parsing the payload in the UADP encoding manner includes: using the pre-deployed protocol stack and parsing the payload in the UADP encoding manner.
5. The method according to claim 4, characterized in that The protocol stack is deployed in a container-based virtualization deployment manner.
6. The method according to claim 4, characterized in that The protocol stack is deployed by means of hardware burning.
7. A data processing device, characterized in that: The device comprises: A receiving module, configured to receive an Ethernet frame, wherein the Ethernet frame encapsulates a data frame of a Modbus transmission control protocol TCP, wherein the data frame of the Modbus TCP includes an identifier of an open production control and unified architecture OPC UA, wherein the identifier of the OPC UA is used to indicate whether a payload of the data frame includes a unified architecture datagram protocol UADP message; A parsing module, configured to determine the OPC UA identifier by parsing the data frame; The processing module is configured to parse the payload in a UADP encoding manner to obtain the UADP message when the OPC UA identifier indicates that the payload includes the UADP message.
8. An electronic device, characterized in that: The electronic device comprises a processor and a memory for storing a computer program that can be run on the processor; wherein, The processor is configured to run the computer program to perform the method according to any one of claims 1 to 6.
9. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that The computer program implements the method according to any one of claims 1 to 6 when executed by a processor.
Citation Information
Patent Citations
Data interception and analysis device of DL / T 645 communication protocol electric meter and working method thereof
CN109218173A
Industrial network system based on OPC UA and data processing method thereof
CN109765866A
Method, device and system for sending message in network
CN115699684A
Modbus communication protocol analysis method and device, equipment and storage medium
CN115914435A
Coap-based OPC UA message transmission method, and server
WO2020114186A1
