CN114900563A - Communication method and device, data transmission method and device, gateway equipment and equipment - Google Patents

Communication method and device, data transmission method and device, gateway equipment and equipment Download PDF

Info

Publication number
CN114900563A
CN114900563A CN202210526233.XA CN202210526233A CN114900563A CN 114900563 A CN114900563 A CN 114900563A CN 202210526233 A CN202210526233 A CN 202210526233A CN 114900563 A CN114900563 A CN 114900563A
Authority
CN
China
Prior art keywords
equipment
variable
plc
communication
drive
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210526233.XA
Other languages
Chinese (zh)
Inventor
邬志刚
李忠海
李育杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Yuhang Intelligent Information Technology Co ltd
Original Assignee
Shenzhen Yuhang Intelligent Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Yuhang Intelligent Information Technology Co ltd filed Critical Shenzhen Yuhang Intelligent Information Technology Co ltd
Priority to CN202210526233.XA priority Critical patent/CN114900563A/en
Publication of CN114900563A publication Critical patent/CN114900563A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/08Protocols for interworking; Protocol conversion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2212/00Encapsulation of packets
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a communication method and device, a data transmission method and device, gateway equipment and equipment. The communication method is applied to a gateway device, wherein the gateway device is used for being in communication connection with a PLC device, and the method comprises the following steps: acquiring an interface type of the PLC equipment, and acquiring a driving parameter value according to the interface type; obtaining a first target drive according to the interface type, the drive parameter value and a preset drive library, and carrying out interface drive initialization operation according to the first target drive; performing communication channel connection operation on the PLC equipment; and acquiring the equipment type of the PLC equipment, acquiring a second target drive according to the equipment type and a preset type library, and initializing the equipment drive according to the second target drive so as to realize communication connection with the PLC equipment. The embodiment of the invention can realize automatic identification and access to different PLC devices.

Description

Communication method and device, data transmission method and device, gateway equipment and equipment
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a communication method and apparatus, a data transmission method and apparatus, a gateway device, and a device.
Background
At present, in order to improve the production efficiency of production equipment in the manufacturing industry, the manufacturing industry needs to be digitally transformed. The equipment on the production line is connected with the industrial network, and the equipment on the production line is subjected to linkage allocation production through the industrial network.
In the related art, a Programmable Logic Controller (PLC) is used to perform data monitoring and control operations on a production device. In order to enable the PLC equipment to access the industrial network, different types of gateways are developed aiming at different PLC equipment manufacturer types and access protocols. However, the above method cannot integrate the access standards of all PLC devices, thereby affecting the connection between the PLC devices and the industrial network.
Disclosure of Invention
The present invention is directed to solving at least one of the problems of the prior art. Therefore, the invention provides a communication method and device, a data transmission method and device, gateway equipment and equipment, which can realize automatic identification and access to different PLC (programmable logic controller) equipment.
The communication method according to the embodiment of the first aspect of the present invention is applied to a gateway device, the gateway device being configured to be communicatively connected to a PLC device, and the method includes:
acquiring an interface type of the PLC equipment, and acquiring a driving parameter value according to the interface type;
obtaining a first target drive according to the interface type, the drive parameter value and a preset drive library, and carrying out interface drive initialization operation according to the first target drive;
performing communication channel connection operation on the PLC equipment;
and acquiring the equipment type of the PLC equipment, acquiring a second target drive according to the equipment type and a preset type library, and initializing the equipment drive according to the second target drive so as to realize communication connection with the PLC equipment.
According to the communication method provided by the embodiment of the application, a first target driver capable of initializing the hardware interface driver is obtained by searching the type of the hardware interface of the PLC equipment and a preset driver library; on the basis of communication of the PLC equipment communication channel, a second target driver capable of establishing embedded program drive with the PLC equipment is obtained through searching of the PLC equipment type and the type library, and therefore formal communication with the PLC equipment is achieved. Therefore, the communication method provided by the embodiment of the application realizes automatic identification of the PLC device and establishes communication, avoids the phenomenon of drive selection error caused by manual setting and the manner of adopting different gateway devices for different PLC devices in the related technology, and improves the universality of the gateway device and the accuracy of communication connection.
According to some embodiments of the invention, the interface types include a network port, a serial port, a USB;
the obtaining of the driving parameter value according to the interface type includes:
if the interface type is the serial port, taking a preset parameter value as the driving parameter value;
and if the interface type is the network port or the USB, acquiring a communication port value of the PLC equipment, and taking the communication port value as the driving parameter value.
According to some embodiments of the invention, the performing of the communication channel connection operation on the PLC device includes:
acquiring a response address of the PLC equipment;
setting a target address according to the response address; the target address and the response address are in the same network segment, and the target address is used for establishing communication channel connection with the PLC equipment.
A data transmission method according to an embodiment of a second aspect of the present invention is applied to a gateway device for establishing a communication connection with the PLC device according to the communication method as set forth in the first aspect, the method including:
acquiring variable information of the PLC equipment variable storage area, and setting a variable value associated with the variable information according to the variable information; the variable information comprises a variable address, a variable identifier and a variable annotation;
carrying out classification operation on the variable values to obtain classification groups;
and carrying out data encapsulation operation on the variable values in the classification groups and sending the variable values to a service system.
According to some embodiments of the invention, the method further comprises:
performing data encapsulation operation on the variable value with the change frequency reaching a preset threshold value to form a data packet;
and sending the data packet to the service system.
The communication device according to the third aspect of the present invention is applied to a gateway apparatus, the gateway apparatus being configured to be communicatively connected to the PLC apparatus, and the communication device includes:
the hardware driving configuration module is used for acquiring the interface type of the PLC equipment and obtaining a driving parameter value according to the interface type; obtaining a first target drive according to the interface type, the drive parameter value and a preset drive library, and carrying out interface drive initialization operation according to the first target drive;
the communication channel configuration module is used for performing communication channel connection operation on the PLC equipment;
and the PLC drive configuration module is used for acquiring the equipment type of the PLC equipment, acquiring a second target drive according to the equipment type and a preset type library, and performing equipment drive initialization operation according to the second target drive so as to realize communication connection with the PLC equipment.
According to a fourth aspect of the present invention, there is provided a data transmission apparatus applied to a gateway device for establishing a communication connection with the PLC device according to the communication apparatus of the third aspect, the data transmission apparatus comprising:
the variable mapping module is used for acquiring variable information of the variable storage area of the PLC equipment and setting a variable value associated with the variable information according to the variable information; the variable information comprises a variable address, a variable identifier and a variable annotation;
the data encapsulation module is used for carrying out classification operation on the variable values to obtain classification groups; and carrying out data encapsulation operation on the variable values in the classification groups and sending the variable values to a service system.
The gateway device according to an embodiment of the fifth aspect of the present invention includes:
the communication device of the third aspect;
a data transmission arrangement as claimed in the fourth aspect.
An electronic apparatus according to a sixth aspect of the embodiment of the present invention includes:
at least one memory;
at least one processor;
at least one computer program;
the computer programs are stored in the memory, and the processor executes the at least one computer program to implement:
the method of any one of the first aspect; or
The method of the second aspect.
A computer-readable storage medium according to a seventh embodiment of the present invention, the computer-readable storage medium storing computer-executable instructions for causing a computer to perform:
the method of any one of the first aspect; or
The method of the second aspect.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The invention is further described with reference to the following figures and examples, in which:
FIG. 1 is a flow chart of a communication method according to an embodiment of the invention;
FIG. 2 is another flow chart of a communication method according to an embodiment of the present invention;
FIG. 3 is another flow chart of a communication method according to an embodiment of the invention;
FIG. 4 is a flowchart illustrating a data transmission method according to an embodiment of the invention;
FIG. 5 is a schematic flow chart illustrating a data transmission method according to an embodiment of the present invention;
FIG. 6 is a block diagram of a communication device according to an embodiment of the present invention;
FIG. 7 is a block diagram of a data transmission apparatus according to an embodiment of the present invention;
fig. 8 is a block diagram of a gateway device according to an embodiment of the present invention;
fig. 9 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
It should be noted that although functional blocks are partitioned in a schematic diagram of an apparatus and a logical order is shown in a flowchart, in some cases, the steps shown or described may be performed in a different order than the partitioning of blocks in the apparatus or the order in the flowchart. The terms first, second and the like in the description and in the claims, and the drawings described above, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the present application only and is not intended to be limiting of the application.
First, several terms referred to in the present application are resolved:
gateway (Gateway): also known as internetwork connectors, protocol converters. The gateway realizes network interconnection above a network layer, is a complex network interconnection device and is only used for interconnection of two networks with different high-level protocols. The gateway can be used for interconnection of both wide area networks and local area networks. A gateway is a computer system or device that acts as a switch-master, using two systems that differ in communication protocol, data format or language, and in architecture, to act as a "translator". Unlike bridges which simply convey information, gateways repackage received information to accommodate the needs of the destination system.
Programmable Logic Controller (PLC): an editable logic controller is a digital operation electronic system designed specifically for use in an industrial environment, which employs an editable memory in which instructions for operations such as logic operations, sequence control, timing, calculation, and arithmetic operations are executed, and controls various types of mechanical equipment or production processes through digital or analog inputs and outputs. In the embodiment of the present application, a PLC device is used as an abbreviation of an editable logic controller.
Communication port value: in the network technology, the ports include physical meaning ports and logical meaning ports, wherein the physical meaning ports refer to interfaces such as ADSL modems, hubs, switches, routers and the like used for connecting other network equipment, such as RJ-45 ports, SC ports and the like; a logically meaningful port refers to a port in the TCP/IP protocol, with port numbers ranging from 0 to 65535. In the embodiment of the present application, the communication port refers to the logical meaning port described above, and correspondingly, the communication port value refers to the port number of the corresponding port, that is, the value range of the communication port value is 0 to 65535.
OPC (open Platform communications): refers to a group of software technologies that provide a single, unified interface for controlling various devices and exchanging data. The OPC specification was created with the goal of providing a generic interface for users to control various devices. OPC techniques are used to exchange data between controllers and SCADA systems, but complex systems can also be organized at different levels of the process control system. OPC is formed by OPC customer end and OPC server two parts, OPC server software controls the driver program of the apparatus to poll various apparatuses through the field bus; OPC client software is typically built into the SCADA system, intended to receive data from the OPC server. OPC includes current standards such as OPC DA (data access), OPC HDA (historical data access), OPC AE (alarms and events), OPC Batch, OPC DX, OPC UA (unified architecture), and the like.
The OPC DA server provides data exchange service, and data in the OPC is a label variable with certain attributes, and the variable can be various integer and real number types, Boolean values, character strings, dates, arrays and the like. The attributes include the current value of the variable, the variable type, access rights, OPC server polling frequency, variable description, etc.
OPC UA is a current standard for data transmission in industrial networks, providing secure and reliable communication between devices, while allowing communication between devices of different operating systems, independent of hardware and platform.
Data acquisition and Supervisory Control System (SCADA): the SCADA system is a DCS and electric power automatic monitoring system based on a computer. The method can be applied to data acquisition and monitoring control in the fields of electric power, metallurgy, petroleum, chemical industry, gas, railways and the like, process control and the like.
Serialization: refers to a process of converting state information of an object into a form that can be stored or transmitted. During serialization, an object writes its current state to temporary or persistent storage, from which the state of the object can then be read or deserialized and recreated. The serialization operation includes the following three purposes: first, the custom object is persisted in some form of storage; second, objects are transferred from place to place; third, the procedure is made more maintainable.
In the related art, numerous gateway device manufacturers at home and abroad develop various types of gateway devices aiming at the manufacturer types and communication access protocols of the PLC devices so as to meet the access requirements of the existing diversified PLC devices in order to realize the communication access between the gateway devices and the PLC devices. However, in the above method, the access of all PLC devices cannot be integrated, that is, the gateway device manufactured by the above method is not highly universal, and can only perform communication access operation with a specific PLC device.
Based on this, embodiments of the present application provide a communication method and apparatus, a data transmission method and apparatus, a gateway device, and a device, which can implement communication access with different PLC devices, thereby improving universality of the gateway device. And the gateway equipment can carry out operations such as classification filing, mapping mechanism establishment, splitting and recombination on variable data of the PLC equipment, so that the variable data are converted into reported data required by a service system, data transmission based on communication access with the PLC equipment is further realized, and the rapid conversion effect of a communication protocol of the PLC equipment is achieved.
Referring to fig. 1, an embodiment of the present application provides a communication method, which is applied to a gateway device, where the gateway device is used for being in communication connection with a PLC device. The communication method includes, but is not limited to, steps S110 to S140.
S110, acquiring an interface type of the PLC equipment, and acquiring a driving parameter value according to the interface type;
specifically, the gateway device automatically identifies the type of a hardware interface to which the PLC device is connected, and obtains a driving parameter value corresponding to the type of the hardware interface according to the type of the hardware interface and a preset rule. For example, the hardware interface types include three types, i.e., a network port, a serial port, and a USB, and the gateway device sets different status signals for the three types of hardware interfaces, for example, the status signal I of the network port is 100, the status signal I of the serial port is 010, and the status signal I of the USB is 001. When the PLC equipment is connected with the gateway equipment, the gateway equipment automatically identifies the type of a hardware interface accessed by the PLC equipment according to the state signal I. The drive parameter values refer to hardware drive parameter values initialized when the PLC equipment and the gateway equipment are accessed. It can be understood that the preset rule may be a corresponding mapping rule, that is, a mapping relationship between a type of hardware interface and a driving parameter value is preset, and the corresponding driving parameter value may be found according to the identified type of hardware interface and the mapping relationship, or other preset rules are set, which is not specifically limited in this embodiment of the present application.
It can be understood that, when the gateway device recognizes two different status signals I, for example, when the gateway device recognizes both the status signal I equals 100 and the status signal I equals 010, the gateway device queries the driving parameter values of both the network port and the serial port, that is, initializes the interface driving of both the interfaces. In subsequent operations, the availability of the two interfaces is distinguished by repeatedly judging the validity.
It is understood that different status signals I may be set for different serial port types in order to distinguish between the different serial port types. For example, for a serial port of RS232 model, the status signal I — 011 may be set.
S120, obtaining a first target drive according to the interface type, the drive parameter value and a preset drive library, and initializing interface drive according to the first target drive;
specifically, the gateway device embeds an interface standard driver library, and retrieves the interface standard driver library according to the interface type and the driver parameter value obtained by the method, so as to obtain the corresponding first target driver. And loading the drive parameter value to the first target drive, thereby realizing the drive initialization operation of the hardware interface.
S130, performing communication channel connection operation on the PLC equipment;
it is understood that the driver initialization operation performed in step S120 is the initialization of the hardware driver, that is, the embedded program channel of the gateway device and the PLC device is not actually connected. Therefore, after the hardware interface driver is started, an asynchronous communication mechanism needs to be established with the PLC device, and a communication channel connection operation needs to be realized through operations such as broadcast address setting.
S140, obtaining the equipment type of the PLC equipment, obtaining a second target drive according to the equipment type and a preset type library, and performing equipment drive initialization operation according to the second target drive so as to realize communication connection with the PLC equipment.
It is understood that step S130 implements TCP/IP communication based on the broadcast address bottom layer, but also implements the program software driver on the basis of opening the communication channel. Specifically, on the basis of communication channel connection, type identification is carried out through a PLC device embedded program so as to determine the device type of the PLC device. And searching a preset type library according to the type of the equipment so as to obtain a corresponding second target drive, and realizing formal communication with the PLC equipment according to the second target drive.
For example, if the device type of the PLC device is identified as siemens S7-1200, the PLC device driver (i.e., the second driver) corresponding to the siemens S7-1200 is searched in the preset type library. And loading the PLC equipment according to the second driver, thereby realizing communication with the bottom embedded program of the PLC equipment, namely realizing formal communication with the PLC equipment.
According to the communication method provided by the embodiment of the application, a first target driver capable of initializing the hardware interface driver is obtained by searching the type of the hardware interface of the PLC equipment and a preset driver library; on the basis of communication of the PLC equipment communication channel, a second target drive capable of establishing embedded program drive with the PLC equipment is obtained through searching of the PLC equipment type and the type library, and therefore formal communication with the PLC equipment is achieved. Therefore, the communication method provided by the embodiment of the application realizes automatic identification of the PLC equipment and establishes communication, avoids the phenomenon that different gateway equipment is adopted for different PLC equipment in the related technology and drive selection is wrong due to manual setting, and improves the universality of the gateway equipment and the accuracy of communication connection.
Referring to fig. 2, in some embodiments, the step S110 of "obtaining driving parameter values according to interface types" includes, but is not limited to, substeps S210 to substep S220.
S210, if the interface type is a serial port, taking a preset parameter value as a driving parameter value;
and S220, if the interface type is the internet access or the USB, acquiring a communication port value of the PLC equipment, and taking the communication port value as a driving parameter value.
Specifically, different preset rules are set according to the type of a hardware interface accessed by the PLC device, so as to obtain corresponding driving parameter values. For example, for a serial port, a fixed parameter value is preset, for example, for a hardware interface of a serial port model, a preset parameter value with a baud rate of 8400bps, a data bit of 8 bits, and a parity check of 0 is set. And aiming at the network port and the USB, the gateway equipment automatically searches the accessed PLC equipment, and defaults to use a first value in a searched communication port value list as a driving parameter value.
It is understood that, for the internet port and the USB, after determining the driving parameter value according to the above method, it is further identified whether the driving parameter value (i.e. the communication port value) is used or occupied, if the driving parameter value is used or occupied, the second value in the list is used as the driving parameter value, and the above identification process is repeated until it is confirmed that the current driving parameter value is not used or occupied. If the last value in the list is traversed and the driving parameter value is still identified to be used or occupied, the first value in the list is used as the driving parameter value again, and interface docking is attempted.
Referring to fig. 3, in some embodiments, step S130 includes, but is not limited to, substeps S310 through S320.
S310, acquiring a response address of the PLC equipment;
s320, setting a target address according to the response address; the target address and the response address are in the same network segment, and the target address is used for establishing communication channel connection with the PLC equipment.
Specifically, in order to realize the real connection between the gateway device and the embedded program channel of the PLC device, the gateway device needs to set a broadcast address for its own address when starting the hardware interface driver. Taking the type of the hardware interface as the internet access as an example, according to the OPC DA mechanism matched with the start of the internet access driver, the IP address of the local OPC driver of the gateway device needs to be set, for example, 127.0.0.1, so as to perform the initialization communication with the PLC device. On the basis of initializing communication, checking the message and analyzing the response address of the PLC equipment, the gateway equipment self-sets a target address belonging to the same network segment with the response address according to the response address, and establishes an asynchronous communication mechanism with the PLC equipment again.
For example, the response address of the PLC device is 192.168.3.110, and according to the response address, the address segment of the PLC device is 192.168.3, which is a class C IP address 3 segment, where 110 is the IP address of the PLC device. According to the IP address type and the network segment, the gateway device may set an IP address that is also a class C3 network segment, such as an IP address set to 192.168.3.111, to establish a communication channel connection with the PLC device.
Referring to fig. 4, in some embodiments, the present application further provides a data transmission method, which is applied to a gateway device, where the gateway device has established a communication connection with a PLC device through the communication method described in any one of the above embodiments. The data transmission method includes, but is not limited to, steps S410 to S430.
S410, obtaining variable information of a variable storage area of the PLC equipment, and setting variable values related to the variable information according to the variable information; the variable information comprises a variable address, a variable identifier and a variable annotation;
it can be understood that, after the gateway device establishes the communication connection with the PLC device by using the method described in any of the above embodiments, corresponding data transmission operation may be performed, that is, the PLC device may transmit the data of the monitored industrial device to the gateway device through the established communication channel, and the gateway device sends the data to the service system, so that the service system can obtain the data corresponding to the industrial device in real time, and perform operations such as control or adjustment on the operation of the industrial device according to the data.
Specifically, the gateway device identifies a variable storage area of the embedded program of the PLC device according to the type of the PLC device, and performs global variable retrieval on the variable storage area to obtain variable information in the variable storage area. And creating a variable value corresponding to the variable information in the target storage area to realize the mapping association of the variable value and the variable information in the target storage area.
For example, a point table library is preset in the gateway device, and the point table library includes a variable address, a variable identifier and a variable annotation obtained by performing global variable retrieval on the PLC device, where the variable address includes 0X002 and 0D0001, where the variable identifier corresponding to the variable address 0X002 is temperature, and the variable annotation corresponding to the variable address 0X002 is press-mounting machine pressure surface temperature; the variable identification corresponding to the variable address 0D0001 is the rotational speed, and the scalar corresponding to the variable address 0D0001 is annotated as the press-fit transmission real-time rotational speed. Variable values Temper002 and Speed001 are established in the target memory area, mapping association is established between the variable values and Temper002 and variable addresses 0X002, mapping association is established between the variable values and Speed001 and variable addresses 0D0001, and therefore when the variable addresses 0X002 acquire specific numerical values such as '80', the variable values Temper002 can correspondingly obtain the '80' numerical values.
It can be understood that the variable identifier can be obtained by extracting a keyword from the corresponding variable annotation and retrieving the extracted keyword in a preset identifier library.
S420, carrying out classification operation on the variable values to obtain classification groups;
and S430, performing data encapsulation operation on the variable values in the classification groups, and sending the variable values to a service system.
It is understood that the variable values are classified according to the variable information associated with the variable values, for example, the variable information may be classified into equipment state information, equipment process parameter information, equipment quality information, equipment alarm parameter information, equipment process parameter information, equipment result parameter information, and the like. According to the service function of the service system, a plurality of variable values belonging to the same type are filed and combined to form a classification group, and the classification group is uploaded to the service system through a uniform interface, so that the data transmission function is realized, namely, the rapid conversion of the communication protocol of the PLC equipment is realized.
Referring to fig. 5, in some embodiments, the data transmission method further includes, but is not limited to, steps S510 to S520.
S510, performing data encapsulation operation on the variable value with the change frequency reaching a preset threshold value to form a data packet;
s520, the data packet is sent to the service system.
Specifically, a data change frequency threshold (i.e., a preset threshold) is preset, the variable values meeting the preset conditions are split from the classification groups, and recombination and data encapsulation operations are performed with the variable values meeting other preset conditions to form the data packet. The method comprises the steps of filing and serializing a plurality of change values meeting preset conditions to form a standard protocol in butt joint with a service system, and subscribing and pushing the service system through the standard protocol. Wherein the preset condition is that the change frequency of the variable value reaches a preset threshold value.
For example, when the classification group is the device state information, when the PLC device monitors that the industrial device changes from device start to device stop, the corresponding first sub-variable value changes; and aiming at the classified group as equipment alarm parameter information, when the PLC equipment monitors the industrial equipment to generate an alarm event, the corresponding second sub-variable value is changed. When the first sub-variable value and the second sub-variable value both meet the preset condition, the gateway device splits the first sub-variable value and the second sub-variable value from the corresponding classification groups respectively, and recombines the first sub-variable value and the second sub-variable value to form a data packet, thereby realizing a rapid data conversion mechanism. And pushing the data packet to a service system in real time according to an OPC UA subscription mechanism. It is understood that the preset threshold may be set to 0 or other values, and the embodiment of the present application is not particularly limited thereto. When the preset threshold value is set to 0, the splitting and recombining operation is carried out as long as the variable value is changed, so that the data fast conversion mechanism is realized.
Referring to fig. 6, an embodiment of the present application further provides a communication apparatus, where the communication apparatus is applied to a gateway device, and the gateway device is configured to be in communication connection with a PLC device. The communication device includes:
the hardware driving configuration module 601 is configured to obtain an interface type of the PLC device, and obtain a driving parameter value according to the interface type; obtaining a first target drive according to the interface type, the drive parameter value and a preset drive library, and carrying out interface drive initialization operation according to the first target drive;
a communication channel configuration module 602, configured to perform a communication channel connection operation on the PLC device;
the PLC driver configuration module 603 is configured to obtain a device type of the PLC device, obtain a second target driver according to the device type and a preset type library, and perform device driver initialization operation according to the second target driver, so as to implement communication connection with the PLC device.
It can be seen that the contents in the foregoing communication method embodiments are all applicable to the embodiments of the present communication apparatus, the functions specifically implemented by the embodiments of the present communication apparatus are the same as those in the foregoing communication method embodiments, and the advantageous effects achieved by the embodiments of the present communication apparatus are also the same as those achieved by the foregoing communication method embodiments.
Referring to fig. 7, an embodiment of the present application further provides a data transmission apparatus, where the data transmission apparatus is applied to a gateway device, the gateway device is configured to establish a communication connection with a PLC device according to the communication apparatus described in the foregoing embodiment, and the data transmission apparatus includes:
the variable mapping module 701 is used for acquiring variable information of a variable storage area of the PLC equipment and setting a variable value associated with the variable information according to the variable information; the variable information comprises a variable address, a variable identifier and a variable annotation;
a data encapsulation module 702, configured to perform a classification operation on the variable values to obtain classification groups; and carrying out data encapsulation operation on the variable values in the classification groups and sending the variable values to the service system.
It can be seen that the contents in the foregoing data transmission method embodiments are all applicable to the embodiments of the data transmission device, the functions specifically implemented by the embodiments of the data transmission device are the same as those in the foregoing data transmission method embodiments, and the beneficial effects achieved by the embodiments of the data transmission method are also the same as those achieved by the foregoing data transmission method embodiments.
Referring to fig. 8, an embodiment of the present application further provides a gateway device, where the gateway device includes the communication apparatus described in the foregoing embodiment and the data transmission apparatus described in the foregoing embodiment.
An embodiment of the present application further provides an electronic device, including:
at least one memory;
at least one processor;
at least one program;
the programs are stored in the memory, and the processor executes at least one of the programs to implement the present disclosure to implement the communication method or the data transmission method described above.
The electronic device according to the embodiment of the present application will be described in detail with reference to fig. 9.
Referring to fig. 9, fig. 9 illustrates a hardware structure of an electronic apparatus of another embodiment, the electronic apparatus including:
the processor 901 may be implemented by a general Central Processing Unit (CPU), a microprocessor, an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits, and is configured to execute related programs to implement the technical solution provided by the embodiment of the present disclosure;
the Memory 902 may be implemented in the form of a Read Only Memory (ROM), a static storage device, a dynamic storage device, or a Random Access Memory (RAM). The memory 902 may store an operating system and other application programs, and when the technical solution provided by the embodiments of the present disclosure is implemented by software or firmware, the relevant program codes are stored in the memory 902 and called by the processor 901 to execute the communication method or the data transmission method of the embodiments of the present disclosure;
an input/output interface 903 for implementing information input and output;
a communication interface 904, configured to implement communication interaction between the device and another device, where communication may be implemented in a wired manner (e.g., USB, network cable, etc.), and communication may also be implemented in a wireless manner (e.g., mobile network, WIFI, bluetooth, etc.);
a bus 905 that transfers information between various components of the device (e.g., the processor 901, the memory 902, the input/output interface 903, and the communication interface 904);
wherein the processor 901, the memory 902, the input/output interface 903 and the communication interface 904 enable a communication connection within the device with each other through a bus 905.
The disclosed embodiment also provides a storage medium which is a computer-readable storage medium storing computer-executable instructions for causing a computer to execute the above communication method or data transmission method.
The memory, which is a non-transitory computer readable storage medium, may be used to store non-transitory software programs as well as non-transitory computer executable programs. Further, the memory may include high speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory optionally includes memory located remotely from the processor, and these remote memories may be connected to the processor through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The embodiments described in the embodiments of the present disclosure are for more clearly illustrating the technical solutions of the embodiments of the present disclosure, and do not constitute a limitation to the technical solutions provided in the embodiments of the present disclosure, and it is obvious to those skilled in the art that the technical solutions provided in the embodiments of the present disclosure are also applicable to similar technical problems with the evolution of technology and the emergence of new application scenarios.
Those skilled in the art will appreciate that the solutions shown in the figures are not intended to limit embodiments of the present disclosure, and may include more or less steps than those shown, or some of the steps may be combined, or different steps.
The above-described embodiments of the apparatus are merely illustrative, wherein the units illustrated as separate components may or may not be physically separate, i.e. may be located in one place, or may also be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
One of ordinary skill in the art will appreciate that all or some of the steps of the methods, systems, functional modules/units in the devices disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof.
The terms "first," "second," "third," "fourth," and the like in the description of the application and the above-described figures, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be understood that in the present application, "at least one" means one or more, "a plurality" means two or more. "and/or" for describing an association relationship of associated objects, indicating that there may be three relationships, e.g., "a and/or B" may indicate: only A, only B and both A and B are present, wherein A and B may be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" or similar expressions refer to any combination of these items, including any combination of single item(s) or plural items. For example, at least one (one) of a, b, or c, may represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b, c may be single or plural.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes multiple instructions for enabling an electronic device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method of the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing programs, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The preferred embodiments of the present disclosure have been described above with reference to the accompanying drawings, and therefore do not limit the scope of the claims of the embodiments of the present disclosure. Any modifications, equivalents and improvements within the scope and spirit of the embodiments of the present disclosure should be considered within the scope of the claims of the embodiments of the present disclosure by those skilled in the art.

Claims (10)

1. The communication method is applied to a gateway device, and the gateway device is used for being in communication connection with a PLC device, and is characterized by comprising the following steps:
acquiring an interface type of the PLC equipment, and acquiring a driving parameter value according to the interface type;
obtaining a first target drive according to the interface type, the drive parameter value and a preset drive library, and carrying out interface drive initialization operation according to the first target drive;
performing communication channel connection operation on the PLC equipment;
and acquiring the equipment type of the PLC equipment, acquiring a second target drive according to the equipment type and a preset type library, and initializing the equipment drive according to the second target drive so as to realize communication connection with the PLC equipment.
2. The communication method according to claim 1, wherein the interface types include a network port, a serial port, a USB;
the obtaining of the driving parameter value according to the interface type includes:
if the interface type is the serial port, taking a preset parameter value as the driving parameter value;
and if the interface type is the internet access or the USB, acquiring a communication port value of the PLC equipment, and taking the communication port value as the driving parameter value.
3. The communication method according to claim 1, wherein the performing of the communication channel connection operation on the PLC device includes:
acquiring a response address of the PLC equipment;
setting a target address according to the response address; the target address and the response address are in the same network segment, and the target address is used for establishing communication channel connection with the PLC equipment.
4. A data transmission method applied to a gateway device for establishing a communication connection with the PLC device according to the communication method of any one of claims 1 to 3, the method including:
acquiring variable information of the PLC equipment variable storage area, and setting a variable value associated with the variable information according to the variable information; the variable information comprises a variable address, a variable identifier and a variable annotation;
carrying out classification operation on the variable values to obtain classification groups;
and carrying out data encapsulation operation on the variable values in the classification groups and sending the variable values to a service system.
5. The data transmission method of claim 4, wherein the method further comprises:
performing data encapsulation operation on the variable value with the change frequency reaching a preset threshold value to form a data packet;
and sending the data packet to the service system.
6. Communication device, be applied to gateway equipment, gateway equipment is used for with PLC equipment communication connection, its characterized in that, communication device includes:
the hardware driving configuration module is used for acquiring the interface type of the PLC equipment and obtaining a driving parameter value according to the interface type; obtaining a first target drive according to the interface type, the drive parameter value and a preset drive library, and carrying out interface drive initialization operation according to the first target drive;
the communication channel configuration module is used for performing communication channel connection operation on the PLC equipment;
and the PLC drive configuration module is used for acquiring the equipment type of the PLC equipment, acquiring a second target drive according to the equipment type and a preset type library, and performing equipment drive initialization operation according to the second target drive so as to realize communication connection with the PLC equipment.
7. Data transmission apparatus, characterized in that, the data transmission apparatus is applied to a gateway device, the gateway device is used for establishing communication connection with the PLC device according to the communication apparatus of claim 6, the data transmission apparatus includes:
the variable mapping module is used for acquiring variable information of the variable storage area of the PLC equipment and setting a variable value associated with the variable information according to the variable information; the variable information comprises a variable address, a variable identifier and a variable annotation;
the data encapsulation module is used for carrying out classification operation on the variable values to obtain classification groups; and carrying out data encapsulation operation on the variable values in the classification groups and sending the variable values to a service system.
8. A gateway device, comprising:
the communication device of claim 6;
the data transmission apparatus of claim 7.
9. An electronic device, comprising:
at least one memory;
at least one processor;
at least one computer program;
the computer programs are stored in the memory, and the processor executes the at least one computer program to implement:
the method of any one of claims 1 to 3; or
The method of claim 4 or 5.
10. A computer-readable storage medium having computer-executable instructions stored thereon for causing a computer to perform:
the method of any one of claims 1 to 3; or
The method of claim 4 or 5.
CN202210526233.XA 2022-05-16 2022-05-16 Communication method and device, data transmission method and device, gateway equipment and equipment Pending CN114900563A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210526233.XA CN114900563A (en) 2022-05-16 2022-05-16 Communication method and device, data transmission method and device, gateway equipment and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210526233.XA CN114900563A (en) 2022-05-16 2022-05-16 Communication method and device, data transmission method and device, gateway equipment and equipment

Publications (1)

Publication Number Publication Date
CN114900563A true CN114900563A (en) 2022-08-12

Family

ID=82724531

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210526233.XA Pending CN114900563A (en) 2022-05-16 2022-05-16 Communication method and device, data transmission method and device, gateway equipment and equipment

Country Status (1)

Country Link
CN (1) CN114900563A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102447684A (en) * 2010-10-14 2012-05-09 工业和信息化部软件与集成电路促进中心 Data processing method and equipment
US20150281356A1 (en) * 2014-03-26 2015-10-01 Rockwell Automation Technologies, Inc. Unified data ingestion adapter for migration of industrial data to a cloud platform
CN107613020A (en) * 2017-10-16 2018-01-19 北京东土科技股份有限公司 A kind of device management method and device
CN107819615A (en) * 2017-10-27 2018-03-20 京信通信系统(中国)有限公司 A kind of apparatus self-adaptation cut-in method, device and main control device
CN110096314A (en) * 2019-05-07 2019-08-06 苏州浪潮智能科技有限公司 A kind of interface initialization method, apparatus, equipment and computer readable storage medium
CN110708240A (en) * 2019-09-26 2020-01-17 机械工业仪器仪表综合技术经济研究所 Internet of things universal gateway based on OPC UA

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102447684A (en) * 2010-10-14 2012-05-09 工业和信息化部软件与集成电路促进中心 Data processing method and equipment
US20150281356A1 (en) * 2014-03-26 2015-10-01 Rockwell Automation Technologies, Inc. Unified data ingestion adapter for migration of industrial data to a cloud platform
CN107613020A (en) * 2017-10-16 2018-01-19 北京东土科技股份有限公司 A kind of device management method and device
CN107819615A (en) * 2017-10-27 2018-03-20 京信通信系统(中国)有限公司 A kind of apparatus self-adaptation cut-in method, device and main control device
CN110096314A (en) * 2019-05-07 2019-08-06 苏州浪潮智能科技有限公司 A kind of interface initialization method, apparatus, equipment and computer readable storage medium
CN110708240A (en) * 2019-09-26 2020-01-17 机械工业仪器仪表综合技术经济研究所 Internet of things universal gateway based on OPC UA

Similar Documents

Publication Publication Date Title
KR100615806B1 (en) Data receiving method for data link layer
CN111031034A (en) Multi-protocol convergence edge computing gateway
EP2460258B1 (en) Method and device for auto-generating goose signal connection topology from substation level
US10552144B2 (en) Method for updating firmware of devices
CN109257208A (en) A kind of information integrated system and method based on OPC UA
CN107959620B (en) Fully mechanized mining equipment identification method, device, system, gateway and storage medium
CN102597974B (en) Control devices, client device, apparatus control method and apparatus control system
CN105812444A (en) Method for making Internet-of-Things cloud gateway compatible with multiple protocols and Internet-of-Things cloud gateway
CN112423322A (en) Model information sending method, device, storage medium and electronic device
US20160161934A1 (en) System for use in Automation Technology
EP3543815B1 (en) Gateway system for heterogeneous fieldbus
Shu et al. Novel modbus adaptation method for IoT gateway
CN113905107A (en) Method and device for acquiring point list data of industrial equipment and gateway
CN114900563A (en) Communication method and device, data transmission method and device, gateway equipment and equipment
JP6566122B2 (en) Data regenerator for plant monitoring and control system
CN106992961A (en) The transmission of the specification information of commercial plant
CN110603799B (en) Method, switching unit, device and system for transmitting data from a device to a data management device
CN101707585A (en) Communication method for nonstandard communication protocol
CN110573974A (en) Device, field bus access unit and method for monitoring an automation system
US11973652B2 (en) Field detection device for a fieldbus network
CN114253210A (en) Json-RPC-based PLC communication system and method
KR101950374B1 (en) Non-standard protocol reverse engineering analysis apparatus
CN214670231U (en) Real-time monitoring system based on internet of things distributed architecture
CN114697293B (en) Data transmission method, lower computer and controller
CN113783902B (en) Communication conversion method and device suitable for communication among different devices

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination