MQTT framework-based centralized data acquisition system and method for resistance welding controller equipment

文档序号:477991 发布日期:2022-01-04 浏览:17次 中文

阅读说明:本技术 基于mqtt框架的电阻焊控制器设备数据集中采集系统及方法 (MQTT framework-based centralized data acquisition system and method for resistance welding controller equipment ) 是由 徐昊 郭悦 路向琨 陈洪杰 尉学森 于 2021-09-30 设计创作,主要内容包括:本发明提供了一种基于MQTT框架的电阻焊控制器设备数据集中采集系统及方法,包括主控单元、上位管理客户端、与主控单元连接的信号采集单元、连接主控单元和上位管理客户端的数据中转单元;同一生产线上多台设备,全部设备均通过交换机与上位管理客户端连接,每台设备对应设置有一个数据中转单元,每个数据中转单元对应设置一个MQTT服务器MQTTBroker,所述数据中转单元和上位管理客户端均设置MQTT客户端与MQTTBroker连接进行主题订阅,实现数据采集和命令转达。本发明所述上位管理客户端与多台设备之间建立内网,保障大量数据传输的可靠性和实时性,实现采集同一条生产线上的多台电阻焊设备相关数据,还能够对电阻焊设备运行状态通过上位机系统进行实时监控。(The invention provides a centralized data acquisition system and a centralized data acquisition method for resistance welding controller equipment based on an MQTT framework, which comprises a main control unit, an upper management client, a signal acquisition unit connected with the main control unit, and a data transfer unit connected with the main control unit and the upper management client; all the devices are connected with an upper management client through a switch, each device is correspondingly provided with a data transfer unit, each data transfer unit is correspondingly provided with an MQTT server MQTTBrocker, and the data transfer unit and the upper management client are respectively provided with the MQTT client to be connected with the MQTTBrocker for topic subscription so as to realize data acquisition and command forwarding. According to the invention, an intranet is established between the upper management client and the plurality of devices, so that the reliability and the real-time performance of mass data transmission are guaranteed, the collection of the related data of the plurality of resistance welding devices on the same production line is realized, and the real-time monitoring of the running state of the resistance welding devices can be realized through an upper computer system.)

1. Resistance welds controller equipment data and gathers system based on MQTT frame, its characterized in that: the system comprises a main control unit, an upper management client, a signal acquisition unit connected with the main control unit, and a data transfer unit connected with the main control unit and the upper management client;

the device comprises a plurality of resistance welding devices on the same production line, wherein all the resistance welding devices are connected with an upper management client through a switch, each resistance welding device is correspondingly provided with a data transfer unit, each data transfer unit is correspondingly provided with an MQTT server MQTT Broker, the data transfer unit and the upper management client are respectively provided with the MQTT client and connected with the MQTT Broker for topic subscription, and data acquisition and command transfer are realized.

2. The centralized data acquisition system for the MQTT framework-based resistance welding controller equipment is characterized in that: the signal acquisition unit comprises a welding clamp signal acquisition unit, a pressure signal acquisition unit, a displacement signal acquisition unit and an external IO input and output acquisition unit, and the acquisition content of the welding clamp signal acquisition unit comprises current, voltage and temperature.

3. The centralized data acquisition system for the MQTT framework-based resistance welding controller equipment is characterized in that: different communication interfaces are arranged between the data transfer unit and the main control unit according to different transmission data types, each communication interface comprises a serial port 1, a serial port 2 and an SPI bus interface, the serial port 1 is responsible for transmitting some external IO quantities and part of simple analog signals and transmits the analog signals according to a Modbus RTU protocol, the main control unit is a master station, and the transfer unit is a slave station; the serial port 2 is responsible for completing uploading and downloading of various welding parameters, configuration options of resistance welding equipment and other contents; the SPI bus interface is responsible for transmitting process data in the welding process, and the process data comprise change waveform curves of physical quantities such as current, voltage, temperature and pressure.

4. The centralized data acquisition system for the MQTT framework-based resistance welding controller equipment is characterized in that: the data transfer unit sets an MQTT client side I to be connected with a corresponding MQTT Broker to initiate subscription, the subscription theme is Device/#, the Device is issued by an upper computer, all resistance welding equipment can subscribe a corresponding theme at the beginning of the Device, and the # is a wildcard;

the upper management client side simultaneously generates a plurality of MQTT client sides II which are respectively connected with MQTT brokers of a plurality of resistance welding devices to initiate subscription, one MQTT client side II corresponds to the MQTT Broker of one resistance welding device to initiate subscription, and the subscription theme is User/#; the User refers to MQTT Broker release of a plurality of resistance welding devices, the upper management client subscribes a corresponding theme at the beginning of the device, and the # refers to a wildcard character.

5. The centralized data acquisition system for the MQTT framework-based resistance welding controller equipment is characterized in that: the data transfer unit also comprises a message middleware ActiveMQ and an SQLite database, wherein the message middleware ActiveMQ realizes the directional distribution or broadcast of the published content, and the data traffic format of the message middleware ActiveMQ is a JSON data format;

the data transfer unit is used for storing the welding spot process data of a certain number of times to the SQLite database while transferring the process data;

the data transfer unit is used for periodically backing up the data in the main control unit and storing the data in the SQLite database so as to be ready for the calling or restoring operation of an upper system;

and the data transfer unit records the data transfer process and the running condition log and stores the data transfer process and the running condition log into the SQLite database.

6. The centralized data acquisition system for the MQTT framework-based resistance welding controller equipment is characterized in that: the upper management client comprises a visual interface, an upper database and an acquisition data port, wherein the upper database is used for storing real-time welding data, and the visual interface is used for presenting the processed data to a user; the upper database comprises a Redis cache database and a MySQL persistent storage database;

the port for acquiring the data comprises a Restful interface based on an http protocol, and the Restful data interface is used for real-time access of a third-party system or software to the data or batch access to historical welding records;

when real-time data needs to be acquired in a polling mode, a Redis cache database is connected through a restful interface to acquire the data; when the batch historical data needs to be acquired, the MySQL persistent storage database is connected through a restful interface to acquire the data.

7. The MQTT frame-based electric resistance welding controller device data centralized acquisition method of the MQTT frame-based electric resistance welding controller device data centralized acquisition system based on any one of the claims 1 to 6 is characterized by comprising the following steps of:

s1, the upper management client side is connected with resistance welding equipment supporting the MQTT communication mode;

s2, the resistance welding equipment and the upper management client communicate according to communication data types, wherein the communication data types comprise parameter reading and writing data and monitoring data;

the method for communicating the parameter read-write data comprises the steps that an upper client actively sends a read-write command and waits for corresponding read-write contents returned by resistance welding equipment, wherein the read-write contents comprise read-write welding specifications, grinding specifications, modification configuration information and calibration coefficients;

the method for communicating the monitoring data is that the main control unit uploads the welding monitoring related data in real time in the welding process, and the welding monitoring related data comprises welding process data and welding overview data.

8. The method for centrally collecting data of a resistance welding controller device based on an MQTT frame according to claim 7, wherein in step S1, the upper management client establishes a connection with a resistance welding device supporting an MQTT communication mode, and the specific steps are as follows:

s101, starting an upper management client;

s102, the upper management client sends broadcast data to all resistance welding devices in the subnet through a UDP (user Datagram protocol), and after receiving the broadcast data, the resistance welding devices send data codes representing the types of the resistance welding devices to the upper management client;

s103, after receiving the data codes of the type of the resistance welding equipment, the upper system confirms whether the resistance welding equipment supports the MQTT communication mode, if not, connection is ended, if so, the upper management client generates a corresponding MQTT client II, and a connection request carrying a user name and a password is sent to a corresponding MQTT Broker;

s104, the MQTT Broker verifies the user name and the password of the connection request, and if the verification is successful, the upper management client and the resistance welding equipment are successfully connected;

and S105, the upper client adds the resistance welding equipment into the monitoring list and subscribes a theme User/#tothe resistance welding equipment, so that the communication connection is established.

9. The method for centrally collecting data of the MQTT-frame-based resistance welding controller device according to the claim 7, wherein the read-write data communication process comprises the following specific steps:

s201, a user issues a read-write command by operating an upper management client, the upper management client immediately pushes data content I to an MQTT Broker of a data transfer unit in a JSON character string format through an MQTT client, the pushing topic is Device/< ClientID >/XXX,

the XXX represents a corresponding command type, and the data content comprises an MQTT client ID ClientID and data content needing to be communicated;

s202, the MQTT Broker of the data transfer unit publishes the data content I to an MQTT client I of the data transfer unit subscribed with a corresponding theme;

s203, caching the ClientID after the first transfer unit MQTT client receives the first data content, converting the data into a corresponding private control protocol, and sending the private control protocol to the main control unit through the serial port;

s204, after the processing of the main control unit is finished, the data result is returned to the transfer unit through the serial port in a private protocol form;

s205, the transfer unit analyzes the data result and generates a corresponding JSON data format, and the data result is issued to an MQTT Broker through an MQTT client, wherein the issue topic is User/< ClientID >/XXX;

s206, the self-defined distribution strategy of the MQTT Broker can perform self-defined distribution aiming at topic at the beginning of all users, analyze the ClientID in the topic, and distribute the data to the client corresponding to the ClientID, thereby realizing complete point-to-point control command communication.

10. The method for centrally collecting data of the electric resistance welding controller device based on the MQTT frame according to claim 7, wherein the monitoring-type data communication process comprises the following specific steps:

s211, receiving monitoring data acquired by a sensor in the welding process by a main control unit;

s212, the main control unit packs various real-time monitoring data according to a private data format and transmits the various real-time monitoring data to the data transfer unit in real time through the SPI bus;

s213, the data transfer unit analyzes the data content after receiving the monitoring data and generates corresponding JSON data;

and S214, releasing monitoring data to the MQTT Broker, analyzing the Topic by the MQTT Broker, maintaining the original MQTT broadcasting mechanism when the ClientID does not exist, and sending the monitoring result to all upper computer clients subscribing the corresponding theme.

Technical Field

The invention belongs to the field of resistance welding control systems, and particularly relates to a centralized data acquisition system and method for resistance welding controller equipment based on an MQTT framework.

Background

With the rapid development of communication technology and intelligent manufacturing technology, the automation degree of the automobile manufacturing industry is increased day by day, and the requirements on the intelligence degree and data management capability of the production resistance welding equipment involved in the manufacturing process are also increased day by day. For a very important part in the automobile manufacturing process, the quality of resistance spot welding resistance welding equipment and a technological process directly determines the strength and the quality of an automobile body. In recent years, experts in the field find that the quality of welding quality is closely related to the change of various physical quantities (such as current, resistance, pressure, displacement, heat and the like) in the welding process through research, and can well realize online quality evaluation or quality prediction of the welding process by means of time-and-heat data mining, machine learning and the like. Furthermore, for an automatic welding production line, if a large amount of process data of a plurality of resistance welding devices on the same production line can be analyzed and compared in a centralized manner, the method has important significance for realizing the functions of stability analysis of the welding process, life cycle management of the resistance welding devices and the like. In a word, if all physical variation in the welding process can be collected and analyzed in a centralized manner by a sensor or other devices, the intelligent level of the welding manufacturing process can be greatly improved.

For a main automobile factory in China, more than 50 resistance welding devices can work simultaneously on a typical automatic welding production line, the interval of each welding process of each resistance welding device is about 2-3 seconds, the single welding process is generally 200-1000 ms, in order to realize real-time tracking of physical quantity changes of various welding processes, the sampling frequency at least reaches more than 1kHz, and in order to realize the data analysis and quality evaluation functions, all process data of each welding process of all resistance welding devices must be ensured to be transmitted to an upper computing processing system or a transit system in real time and reliably. However, most domestic resistance welding devices do not have the data transmission capability. The data communication architecture of the existing resistance welding equipment with data uploading capability is basically based on the traditional communication modes such as the traditional industrial field bus protocol (such as a CAN bus, a Modbus and the like) or socket connection and the like, some of the data transmission modes have insufficient concurrency throughput capability, some of the data transmission modes have high expense, low safety, too slow response time and low real-time performance, and each mode has more or less problems and cannot adapt to the requirements of automation and intelligent application of a resistance welding assembly production line.

Disclosure of Invention

In view of the above, the present invention aims to provide a centralized data collection system and method for a resistance welding controller device based on MQTT framework, so as to solve the problems of the existing resistance welding device, such as lack of data transmission capability, insufficient concurrent throughput capability of data transmission mode, low security, and poor real-time performance.

In order to achieve the purpose, the technical scheme of the invention is realized as follows:

on one hand, the centralized data acquisition system of the resistance welding controller device based on the MQTT framework comprises a main control unit, an upper management client, a signal acquisition unit connected with the main control unit, and a data transfer unit connected with the main control unit and the upper management client;

the device comprises a plurality of resistance welding devices on the same production line, wherein all the resistance welding devices are connected with an upper management client through a switch, each resistance welding device is correspondingly provided with a data transfer unit, each data transfer unit is correspondingly provided with an MQTT server MQTT Broker, the data transfer unit and the upper management client are respectively provided with the MQTT client and connected with the MQTT Broker for topic subscription, and data acquisition and command transfer are realized.

Furthermore, the signal acquisition unit comprises a welding clamp signal acquisition unit, a pressure signal acquisition unit, a displacement signal acquisition unit and an external IO input and output acquisition unit, and the acquisition content of the welding clamp signal acquisition unit comprises current, voltage and temperature.

Furthermore, different communication interfaces are arranged between the data transfer unit and the main control unit according to different transmission data types, each communication interface comprises a serial port 1, a serial port 2 and an SPI bus interface, the serial port 1 is responsible for transmitting some external IO quantities and part of simple analog signals and transmits the analog signals according to a Modbus RTU protocol, the main control unit is a master station, and the transfer unit is a slave station; the serial port 2 is responsible for completing uploading and downloading of various welding parameters, configuration options of resistance welding equipment and other contents; the SPI bus interface is responsible for transmitting process data in the welding process, and the process data comprise change waveform curves of physical quantities such as current, voltage, temperature and pressure.

Further, the data transfer unit sets an MQTT client side I to be connected with a corresponding MQTT Broker to initiate subscription, the subscription theme is Device/#, the Device is issued by an upper computer, all resistance welding equipment can subscribe a corresponding theme at the beginning of the Device, and the # is a wildcard;

the upper management client side simultaneously generates a plurality of MQTT client sides II which are respectively connected with MQTT brokers of a plurality of resistance welding devices to initiate subscription, one MQTT client side II corresponds to the MQTT Broker of one resistance welding device to initiate subscription, and the subscription theme is User/#; the User refers to MQTT Broker release of a plurality of resistance welding devices, the upper management client subscribes to a corresponding theme at the beginning of the device, and the # refers to a wildcard character.

Further, the data transfer unit further comprises a message middleware ActiveMQ and an SQLite database, the message middleware ActiveMQ realizes directional distribution or broadcast of the published content, and the data traffic format of the message middleware ActiveMQ is a JSON data format;

the data transfer unit is used for storing the welding spot process data of a certain number of times to the SQLite database while transferring the process data;

the data transfer unit is used for periodically backing up the data in the main control unit and storing the data in the SQLite database so as to be ready for the calling or restoring operation of an upper system;

and the data transfer unit records the data transfer process and the running condition log and stores the data transfer process and the running condition log into the SQLite database.

Further, the upper management client comprises a visual interface, an upper database for storing real-time welding data and an acquisition data port, wherein the visual interface is used for presenting the processed data to a user; the upper database comprises a Redis cache database and a MySQL persistent storage database;

the port for acquiring the data comprises a Restful interface based on an http protocol, and the Restful data interface is used for real-time access of a third-party system or software to the data or batch access to historical welding records;

when real-time data needs to be acquired in a polling mode, a Redis cache database is connected through a restful interface to acquire the data; when the batch historical data needs to be acquired, the MySQL persistent storage database is connected through a restful interface to acquire the data.

On the other hand, a method for a centralized data acquisition system of the resistance welding controller equipment based on the MQTT frame is provided, which comprises the following steps:

s1, the upper management client side is connected with resistance welding equipment supporting the MQTT communication mode;

s2, the resistance welding equipment and the upper management client communicate according to communication data types, wherein the communication data types comprise parameter reading and writing data and monitoring data;

the method for communicating the parameter read-write data comprises the steps that an upper client actively sends a read-write command and waits for corresponding read-write contents returned by resistance welding equipment, wherein the read-write contents comprise read-write welding specifications, grinding specifications, modification configuration information and calibration coefficients;

the method for communicating the monitoring data is that the main control unit uploads the welding monitoring related data in real time in the welding process, and the welding monitoring related data comprises welding process data and welding overview data.

Further, in step S1, the upper management client establishes a connection with the resistance welding device supporting the MQTT communication mode, and the specific steps are as follows:

s101, starting an upper management client;

s102, the upper management client sends broadcast data to all resistance welding devices in the subnet through a UDP (user Datagram protocol), and after receiving the broadcast data, the resistance welding devices send data codes representing the types of the resistance welding devices to the upper management client;

s103, after receiving the data codes of the type of the resistance welding equipment, the upper system confirms whether the resistance welding equipment supports the MQTT communication mode, if not, connection is ended, if so, the upper management client generates a corresponding MQTT client II, and a connection request carrying a user name and a password is sent to a corresponding MQTT Broker;

s104, the MQTT Broker verifies the user name and the password of the connection request, and if the verification is successful, the upper management client and the resistance welding equipment are successfully connected;

and S105, the upper client adds the resistance welding equipment into the monitoring list and subscribes a theme User/#tothe resistance welding equipment, so that the communication connection is established.

Further, the read-write data communication process specifically comprises the following steps:

s201, a user issues a read-write command by operating an upper management client, the upper management client immediately pushes data content I to an MQTT Broker of a data transfer unit in a JSON character string format through an MQTT client, the pushing topic is Device/< ClientID >/XXX,

the XXX represents a corresponding command type, and the data content comprises an MQTT client ID ClientID and data content needing to be communicated;

s202, the MQTT Broker of the data transfer unit publishes the data content I to an MQTT client I of the data transfer unit subscribed with a corresponding theme;

s203, caching the ClientID after the first transfer unit MQTT client receives the first data content, converting the data into a corresponding private control protocol, and sending the private control protocol to the main control unit through the serial port;

s204, after the processing of the main control unit is finished, the data result is returned to the transfer unit through the serial port in a private protocol form;

s205, the transfer unit analyzes the data result and generates a corresponding JSON data format, and the data result is issued to an MQTT Broker through an MQTT client, wherein the issue topic is User/< ClientID >/XXX;

s206, the self-defined distribution strategy of the MQTT Broker can carry out self-defined distribution on topic at the beginning of all users, analyze the ClientID in the topic, and only distribute the message to the corresponding client, thereby realizing complete point-to-point control command communication.

Further, the monitoring type data communication process specifically comprises the following steps:

s211, receiving monitoring data acquired by a sensor in the welding process by a main control unit;

s212, the main control unit packs various real-time monitoring data according to a private data format and transmits the various real-time monitoring data to the data transfer unit in real time through the SPI bus;

s213, the data transfer unit analyzes the data content after receiving the monitoring data and generates corresponding JSON data;

and S214, releasing monitoring data to the MQTT Broker, analyzing the Topic by the MQTT Broker, maintaining the original MQTT broadcasting mechanism when the ClientID does not exist, and sending the monitoring result to all upper computer clients subscribing the corresponding theme.

Compared with the prior art, the MQTT framework-based system and the method for collecting the data of the resistance welding controller device in a centralized manner have the following beneficial effects:

(1) the centralized data acquisition system and the centralized data acquisition method for the resistance welding controller based on the MQTT frame are characterized in that an internal network is established between an upper management client and a plurality of resistance welding devices, so that the reliability and the real-time performance of mass data transmission can be guaranteed, the reliable acquisition of process data and other data of the plurality of resistance welding devices on the same production line can be realized, and the running state of the resistance welding devices can be monitored in real time through an upper computer system.

(2) The centralized data acquisition system of the resistance welding controller device based on the MQTT framework does not need to rely on the Internet, thereby greatly reducing the burden of the whole system on the connection and transmission management of the resistance welding device and the occupation of network bandwidth.

Drawings

The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate an embodiment of the invention and, together with the description, serve to explain the invention and not to limit the invention. In the drawings:

FIG. 1 is a schematic diagram of a centralized data acquisition system and method for an MQTT-based resistance welding controller device according to an embodiment of the invention;

fig. 2 is a flowchart illustrating a connection between an upper management client and a resistance welding device according to an embodiment of the present invention;

FIG. 3 is a flowchart illustrating communication of parameter read-write type data according to an embodiment of the present invention;

fig. 4 is a flow chart of monitoring class data communication according to an embodiment of the present invention.

Detailed Description

It should be noted that the embodiments and features of the embodiments may be combined with each other without conflict.

In the description of the present invention, it is to be understood that the terms "center", "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", and the like, indicate orientations or positional relationships based on those shown in the drawings, and are used only for convenience in describing the present invention and for simplicity in description, and do not indicate or imply that the referenced devices or elements must have a particular orientation, be constructed and operated in a particular orientation, and thus, are not to be construed as limiting the present invention. Furthermore, the terms "first", "second", etc. are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first," "second," etc. may explicitly or implicitly include one or more of that feature. In the description of the present invention, "a plurality" means two or more unless otherwise specified.

In the description of the present invention, it should be noted that, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meaning of the above terms in the present invention can be understood by those of ordinary skill in the art through specific situations.

The present invention will be described in detail below with reference to the embodiments with reference to the attached drawings.

As shown in fig. 1, on one hand, the present application provides a centralized data acquisition system for a resistance welding controller device based on an MQTT framework, which includes a main control unit, an upper management client, a signal acquisition unit connected to the main control unit, and a data transfer unit connected to the main control unit and the upper management client;

the device comprises a plurality of resistance welding devices on the same production line, wherein all the resistance welding devices are connected with an upper management client through a switch, each resistance welding device is correspondingly provided with a data transfer unit, each data transfer unit is correspondingly provided with an MQTT server MQTT Broker, the data transfer unit and the upper management client are respectively provided with the MQTT client and connected with the MQTT Broker for topic subscription, and data acquisition and command transfer are realized.

As shown in fig. 1, the signal acquisition unit includes a soldering turret signal acquisition unit, a pressure signal acquisition unit, a displacement signal acquisition unit and an external IO input/output acquisition unit, and the acquisition content of the soldering turret signal acquisition unit includes current, voltage and temperature.

The signal acquisition unit acquires the change condition of each associated physical quantity in the welding process through various sensors, performs filtering processing on the acquired signals, and is also responsible for acquiring some IO variable quantities.

As shown in fig. 1, different communication interfaces are arranged between the data transfer unit and the main control unit according to different transmission data types, each communication interface includes a serial port 1, a serial port 2 and an SPI bus interface, the serial port 1 is responsible for transmitting some external IO quantities and part of simple analog signals, and transmits according to a Modbus RTU protocol, the main control unit is a master station, and the transfer unit is a slave station; the serial port 2 is responsible for completing uploading and downloading of various welding parameters, configuration options of resistance welding equipment and other contents; the SPI bus interface is responsible for transmitting process data in the welding process, and the process data comprise change waveform curves of physical quantities such as current, voltage, temperature and pressure.

The maximum transmission rate of the SPI bus interface can reach more than 1Mb/s, and real-time uploading of process data is guaranteed. The serial port 2 and the SPI bus are transmitted and analyzed in a self-defined private protocol format of resistance welding equipment. The main control unit is a single chip microcomputer control circuit based on STM32 series and is responsible for executing specified welding programs and completing other related welding control logic services.

As shown in fig. 1, the data transfer unit sets an MQTT client to connect with a corresponding MQTT Broker to initiate subscription, a subscription theme is Device/#, the Device is issued by an upper computer, all resistance welding devices subscribe to a corresponding theme at the beginning of Device, and # is a wildcard;

the upper management client side simultaneously generates a plurality of MQTT client sides II which are respectively connected with MQTT brokers of a plurality of resistance welding devices to initiate subscription, one MQTT client side II corresponds to the MQTT Broker of one resistance welding device to initiate subscription, and the subscription theme is User/#; the User refers to MQTT Broker release of a plurality of resistance welding devices, the upper management client subscribes to a corresponding theme at the beginning of the device, and the # refers to a wildcard character.

As shown in fig. 1, the data transfer unit further includes a message middleware ActiveMQ and an SQLite database, where the message middleware ActiveMQ implements directional distribution or broadcast of published content, and the data passing format of the message middleware ActiveMQ is a JSON data format;

the data transfer unit is used for storing the welding spot process data of a certain number of times to the SQLite database while transferring the process data;

the data transfer unit is used for periodically backing up the data in the main control unit and storing the data in the SQLite database so as to be ready for the calling or restoring operation of an upper system;

and the data transfer unit records the data transfer process and the running condition log and stores the data transfer process and the running condition log into the SQLite database.

The data transfer unit is an embedded control circuit system based on a dual-core ARM Cortex-A72 and adopts a Linux inner core.

As shown in fig. 1, the upper management client includes a visual interface, an upper database for storing real-time welding data, and an acquisition data port, where the visual interface is used to present the processed data to a user; the upper database comprises a Redis cache database and a MySQL persistent storage database;

the port for acquiring the data comprises a Restful interface based on an http protocol, and the Restful data interface is used for real-time access of a third-party system or software to the data or batch access to historical welding records;

when real-time data needs to be acquired in a polling mode, a Redis cache database is connected through a restful interface to acquire the data; when the batch historical data needs to be acquired, the MySQL persistent storage database is connected through a restful interface to acquire the data.

The upper management client is an upper desktop application program developed based on a WPF framework, after the program is started, an MQTT client is established, topics are subscribed to MQTT servers of all resistance welding devices in a network, and data communication is achieved.

On the other hand, the application provides a method for a centralized data acquisition system of a resistance welding controller device based on an MQTT frame, which comprises the following steps:

s1, the upper management client side is connected with resistance welding equipment supporting the MQTT communication mode;

s2, the resistance welding equipment and the upper management client communicate according to communication data types, wherein the communication data types comprise parameter reading and writing data and monitoring data;

the method for communicating the parameter read-write data comprises the steps that an upper client actively sends a read-write command and waits for corresponding read-write contents returned by resistance welding equipment, wherein the read-write contents comprise read-write welding specifications, grinding specifications, modification configuration information and calibration coefficients;

the method for communicating the monitoring data is that the main control unit uploads the welding monitoring related data in real time in the welding process, and the welding monitoring related data comprises welding process data and welding overview data.

As shown in fig. 2, in step S1, the upper management client establishes a connection with the resistance welding device supporting the MQTT communication mode, and the specific steps are as follows:

s101, starting an upper management client;

s102, the upper management client sends broadcast data to all resistance welding devices in the subnet through a UDP (user Datagram protocol), and after receiving the broadcast data, the resistance welding devices send data codes representing the types of the resistance welding devices to the upper management client;

s103, after receiving the data codes of the type of the resistance welding equipment, the upper system confirms whether the resistance welding equipment supports the MQTT communication mode, if not, connection is ended, if so, the upper management client generates a corresponding MQTT client II, and a connection request carrying a user name and a password is sent to a corresponding MQTT Broker;

s104, the MQTT Broker verifies the user name and the password of the connection request, and if the verification is successful, the upper management client and the resistance welding equipment are successfully connected;

and S105, the upper client adds the resistance welding equipment into the monitoring list and subscribes a theme User/#tothe resistance welding equipment, so that the communication connection is established.

As shown in fig. 3, the read-write data communication process specifically includes the following steps:

s201, a user issues a read-write command by operating an upper management client, the upper management client immediately pushes data content I to an MQTT Broker of a data transfer unit in a JSON character string format through an MQTT client, the pushing topic is Device/< ClientID >/XXX,

the XXX represents a corresponding command type, and the data content comprises an MQTT client ID ClientID and data content needing to be communicated;

s202, the MQTT Broker of the data transfer unit publishes the data content I to an MQTT client I of the data transfer unit subscribed with a corresponding theme;

s203, caching the ClientID after the first transfer unit MQTT client receives the first data content, converting the data into a corresponding private control protocol, and sending the private control protocol to the main control unit through the serial port;

s204, after the processing of the main control unit is finished, the data result is returned to the transfer unit through the serial port in a private protocol form;

s205, the transfer unit analyzes the data result and generates a corresponding JSON data format, and the data result is issued to an MQTT Broker through an MQTT client, wherein the issue topic is User/< ClientID >/XXX;

s206, the self-defined distribution strategy of the MQTT Broker can carry out self-defined distribution on topic at the beginning of all users, analyze the ClientID in the topic, and only distribute the message to the corresponding client, thereby realizing complete point-to-point control command communication.

The Client ID is an ID number which is generated when the Client is connected with the MQTT Broker and is used for uniquely identifying the Client, and the ID number is determined by the upper Client according to the IP address of the Client and the type of the target resistance welding equipment when the MQTT Client is established.

As shown in fig. 4, the monitoring data communication process specifically includes the following steps:

s211, receiving monitoring data acquired by a sensor in the welding process by a main control unit;

s212, the main control unit packs various real-time monitoring data according to a private data format and transmits the various real-time monitoring data to the data transfer unit in real time through the SPI bus;

s213, the data transfer unit analyzes the data content after receiving the monitoring data and generates corresponding JSON data;

and S214, releasing monitoring data to the MQTT Broker, analyzing the Topic by the MQTT Broker, maintaining the original MQTT broadcasting mechanism when the ClientID does not exist, and sending the monitoring result to all upper computer clients subscribing the corresponding theme.

This application can realize the reliable collection to the process data and other data of many resistance welding equipment on the same production line, can also carry out real time monitoring through host computer system to resistance welding equipment running state, and the system design based on MQTT agreement can greatly alleviate entire system to resistance welding equipment connection and transmission management's burden and to the occupation of network bandwidth when guaranteeing a large amount of data transmission's reliability and real-time.

The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

15页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种高频焊接机

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!