Mine equipment data acquisition method based on Apache PLC4X, electronic equipment and medium
By using Apache PLC4X -based distributed architecture in the collection of mining equipment, the problem of low data collection speed and efficiency in existing technologies is solved, and efficient data collection and storage are realized, and data fusion sharing of intelligent mines is suitable for intelligent mines.
Patent Information
- Application Number
- CN202411359891.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-01-21
AI Technical Summary
In the prior art, the speed and efficiency of mining equipment data collection are low, making it difficult to meet the requirements of intelligent mining data fusion and sharing specifications.
A distributed architecture based on the Apache PLC4X is adopted, and the distributed collection and centralized convergence storage is achieved through the separation design of the mesh side and the platform side. The gateway is based on the Apache PLC4X collection framework. It is driven to transfer the collected data to the centralized management platform through MQTT.
The speed and efficiency of data collection have been improved, and multi -protocol support of lightweight and soft gateway has been achieved. It can collect multiple data protocols at the same time, which improves the collection speed and efficiency.
Smart Images

Figure CN119342067A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of mining, and in particular relates to a mining equipment data acquisition method, an electronic device and a storage medium based on Apache PLC4X. Background Art
[0002] In the construction of intelligent mines, according to the intelligent mine data fusion and sharing specifications, it is necessary to convert the non-industrial Internet of Things devices in use into industrial Internet of Things protocols through a protocol interface conversion gateway.
[0003] In the related technology, mining data collection generally uses commercial data collection software deployed in Windows to collect mining equipment data, and the speed and efficiency of data collection are relatively low. Summary of the invention
[0004] In view of this, the present invention provides a mining equipment data acquisition method, electronic device and storage medium based on Apache PLC4X to solve the problems of low data acquisition speed and efficiency in the prior art.
[0005] In a first aspect, the present invention provides a mining equipment data collection method based on Apache PLC4X, comprising: a gateway configures a driver based on the Apache PLC4X framework to collect mining equipment data in a distributed manner; the driver standardizes the collected mining equipment data and sends it to a platform; the platform filters, manages and stores the standardized mining equipment data.
[0006] In some embodiments, the mining equipment data collection method based on Apache PLC4X also includes: the gateway receives the platform message sent by the platform; extracts hidden information of the subject corresponding to the platform message; according to the hidden information, if it is judged that the source of the platform message is legal, the platform message is parsed to obtain parsed data; according to the parsed data, it is judged whether the object of the platform message is a gateway, a device or a driver.
[0007] In some implementations, the platform message includes configuration and operation instructions issued by the platform.
[0008] In some implementations, the hidden information of the subject corresponding to the platform message includes a gateway ID, a configuration category, and an operation type.
[0009] In some embodiments, the mining equipment data collection method based on Apache PLC4X also includes: the platform receives a gateway message sent by the gateway; extracts hidden information corresponding to a topic of the gateway message; and based on the hidden information, if it is determined that the source of the gateway message is legal, the gateway message is processed according to a data processing rule, and the data of the gateway message is stored.
[0010] In some implementations, the hidden information of the topic corresponding to the gateway message includes: a gateway ID, a gateway token, and a sub-topic.
[0011] In some implementations, the gateway configures a collection device list, and the platform configures a gateway list.
[0012] In some implementations, the mining equipment data is saved to different libraries and different tables of the platform according to configuration, and the mining equipment data includes real-time data and historical data.
[0013] In a second aspect, the present invention also provides an electronic device, comprising: at least one processor; a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can implement: a gateway configures a driver based on the Apache PLC4X framework to collect mining equipment data in a distributed manner; the driver standardizes the collected mining equipment data and sends it to a platform; the platform filters, manages and stores the standardized mining equipment data.
[0014] In a third aspect, the present invention provides a storage medium storing a computer program, wherein when the computer program is executed by a processor, the method for collecting data of mining equipment based on Apache PLC4X described in any one of the above is implemented.
[0015] The beneficial effects of the present invention are:
[0016] The present invention adopts a distributed architecture, which is divided into a gateway side and a platform side, and performs distributed collection and centralized aggregation storage, thereby improving the speed and efficiency of data collection. Among them, the collection is performed through a lightweight soft gateway, and the gateway is driven by the ApachePLC4X collection framework as the basis for the design of the driver, and the driver standardizes the collected data and transmits it to the centralized management platform through MQTT. The collection gateway is distributedly deployed, and supports the collection of different data by installing the driver, including but not limited to: files, OPC UA, Modbus TCP, IEC104, MQTT, etc. A gateway can collect one or more types of data, thereby improving the collection speed and efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 This is a flow chart of a mining equipment data collection method based on Apache PLC4X according to an embodiment of the present invention;
[0019] Figure 2 A diagram showing the relationship between a gateway and a driver of a mining equipment data collection method based on Apache PLC4X according to an embodiment of the present invention;
[0020] Figure 3 A diagram showing the relationship between the platform, gateway and equipment of a mining equipment data collection method based on Apache PLC4X according to an embodiment of the present invention;
[0021] Figure 4 It is a flow chart of a mining equipment data collection method based on Apache PLC4X according to another embodiment of the present invention;
[0022] Figure 5 This is a flow chart of the gateway side of a mining equipment data collection method based on Apache PLC4X according to an embodiment of the present invention;
[0023] Figure 6 It is a flow chart of the platform side of the mining equipment data collection method based on Apache PLC4X according to an embodiment of the present invention;
[0024] Figure 7 The figure is a block diagram of an electronic device according to an embodiment of the present invention.
[0025] Description of reference numerals:
[0026] 110. Processor;
[0027] 120. Memory. DETAILED DESCRIPTION
[0028] In the related art, Apache PLC4X is a set of libraries for communicating with industrial programmable logic controllers (PLCs) using various protocols but using a shared API, allowing direct communication with industrial hardware without modifying it. PLC4X implements the protocols of the most common industrial communication protocols and uses these protocols to communicate with various types of devices. The difference between PLC4X and most other commercial drivers is that it does not try to implement each protocol to make it a certifiable protocol stack, but focuses on providing a set of core operations in the same way on all drivers; PLC4X generally supports a very limited set of functions, that is, the basic functions supported by PLC include: discovering devices, listing resources in PLCs, reading data, writing data, and subscribing to data. The core concept of PLC4X is that when writing an application, you only need to write software using an API module, which defines all data types and data structures used for communication. For each protocol to be supported, there is a driver that implements the corresponding logic and is fully responsible for mapping the PLC data types of the protocol to standard data types.
[0029] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0030] Combine the following Figures 1 to 7 , describing an embodiment of the present invention.
[0031] like Figure 1 and Figure 4 As shown, according to an embodiment of the present invention, on the one hand, a mining equipment data collection method based on Apache PLC4X is provided, comprising the following steps:
[0032] Step S101: The gateway configures a driver based on the Apache PLC4X framework to collect mining equipment data in a distributed manner.
[0033] Step S103: The driver standardizes the collected mining equipment data and sends it to the platform.
[0034] Step S105: The platform filters, manages and stores the standardized mining equipment data.
[0035] The protocol types involved in the mining equipment data collected by the present invention include but are not limited to: files, OPC UA, Modbus TCP, IEC104, MQTT, S7, etc. Data collection plays a vital role in the construction of intelligent mines and can help mining companies improve production efficiency and safety levels.
[0036] The collected data is in a standardized format, and the data items include: timestamp, mine number, sub-mine number, equipment number and measurement point set, such as measurement point number, data category, and monitoring value.
[0037] In this embodiment, a distributed architecture is adopted, which is divided into the gateway side and the platform side, and distributed collection and centralized aggregation storage are performed to improve the speed and efficiency of data collection. Among them, the collection is performed through a lightweight soft gateway, and the gateway is driven by the Apache PLC4X collection framework. The driver standardizes the collected data and transmits it to the centralized management platform through MQTT. The collection gateway is deployed in a distributed manner, and supports the collection of different data by installing the driver, including but not limited to: files, OPC UA, Modbus TCP, IEC104, MQTT, etc. A gateway can collect one or more types of data, thereby improving the collection speed and efficiency.
[0038] Furthermore, if Figure 5 As shown, the mining equipment data collection method based on Apache PLC4X also includes the following steps:
[0039] Step S201: The gateway receives a platform message sent by the platform.
[0040] Step S203: extracting hidden information corresponding to the subject of the platform message.
[0041] Step S205: if it is determined that the source of the platform message is legal according to the hidden information, the platform message is parsed to obtain parsed data.
[0042] Step S207: judging whether the object of the platform message is a gateway, a device or a driver according to the parsed data.
[0043] Platform messages include configuration and operation instructions issued by the platform.
[0044] In this embodiment, the gateway receives the platform message, reads the configuration and operation instructions issued by the platform, and extracts relevant content from the subject. The hidden information of the subject corresponding to the platform message includes the gateway ID, configuration category and operation type, where the gateway ID can confirm the identity of the sender, the configuration category determines the object of the gateway configuration, and the operation type determines the operation of the gateway. The gateway also verifies the platform identity and legitimacy, parses the message data, and performs configuration data synchronization, gateway start and stop, device start and stop, and driver start and stop according to the configuration object and operation type.
[0045] like Figure 2 and Figure 4 As shown, the gateway is used to collect data, and its main functions include driver loading, data forwarding, and receiving configuration, such as equipment and point tables; driver loading can be hot-swappable.
[0046] The gateway loads the driver by customizing the UrlClassloader and implements bean injection in combination with spring. It needs to implement hot plug-in, automatically uninstall beans and delete plug-in files, and upgrade plug-ins according to the version.
[0047] The Spring event method is used to realize communication and decoupling between different operations. For configuration updates, the ConfigEvent event can be sent to notify the data processing module. After data collection, it is encapsulated into a standard message format and sent to the centralized management platform via MQTT.
[0048] The driver package mainly performs functions such as point table analysis, docking with acquisition devices or files, data acquisition, data analysis, and data packaging.
[0049] The driver is just an ordinary jar package, but it needs to pack the special packages it depends on into the jar package. For spring registered beans, the bean name and class form need to be specified in plugin.properties; plugin.properties also needs to have the plug-in name, which is used to distinguish the plug-in category, and the version, which is used for upgrades.
[0050] Furthermore, if Figure 6 As shown, the mining equipment data collection method based on Apache PLC4X also includes the following steps:
[0051] Step S301: The platform receives a gateway message sent by a gateway.
[0052] Step S303: extracting hidden information corresponding to the subject of the gateway message.
[0053] Step S305: based on the hidden information, if it is determined that the source of the gateway message is legitimate, the gateway message is processed according to the data processing rules, and the data of the gateway message is stored.
[0054] The hidden information of the topic corresponding to the gateway message includes: gateway ID, gateway token and sub-topic. The platform extracts relevant content from the topic, such as gateway ID, gateway token and sub-topic. Gateway ID can confirm the identity of the sender, token can verify the legitimacy, and sub-topic can be used to determine data storage, etc.
[0055] The gateway configuration collects the device list, and the platform configures the gateway list.
[0056] In this embodiment, the platform receives gateway messages, collects all gateway data, verifies the identity and legitimacy of the gateway, parses the message data, and processes the data according to the process rules, such as: judging alarms, deduplication, calculations, etc., judging the data storage table, which library and table to store it in, and can store multiple libraries and tables at the same time, such as: real-time tables and historical tables.
[0057] Mining equipment data is saved to different libraries and tables of the platform according to the configuration. Mining equipment data includes real-time data and historical data.
[0058] The platform mainly provides data filtering, management, and storage, including data storage in different libraries and tables according to configuration. Data is divided into real-time data and historical data. Data rule configuration performs logical processing on data streams, including alarm judgment, data calculation, and data forwarding.
[0059] like Figure 3 and Figure 4 As shown, the main functions of the platform are gateway management, device management, point table management, configuration distribution, data reception, data rule processing, data storage, and data push, which is mainly pushed to other business systems or pages, and also includes data interfaces, etc.
[0060] The platform can configure the gateway list, the gateway can configure the collection device list, the device selects the driver, and the device configures the point table. The configuration information can be sent to the gateway side to update the gateway collection information and driver information. The communication interface can be MQTT or directly call the gateway's REST interface.
[0061] like Figure 7 As shown, according to an embodiment of the present invention, on the other hand, an electronic device is provided, including: at least one processor 110; a memory 120 communicatively connected to the at least one processor, wherein the memory 120 stores instructions executable by the at least one processor 110, and the instructions are executed by the at least one processor 110, so that the at least one processor 110 can perform the following steps:
[0062] Step S101: The gateway configures a driver based on the Apache PLC4X framework to collect mining equipment data in a distributed manner.
[0063] Step S103: The driver standardizes the collected mining equipment data and sends it to the platform.
[0064] Step S105: The platform filters, manages and stores the standardized mining equipment data.
[0065] According to an embodiment of the present invention, on the other hand, a storage medium is provided, storing a computer program, and when the computer program is executed by a processor, any one of the mining equipment data collection methods based on Apache PLC4X is implemented.
[0066] The computer executes the instructions to perform the following steps:
[0067] Step S101: The gateway configures a driver based on the Apache PLC4X framework to collect mining equipment data in a distributed manner.
[0068] Step S103: The driver standardizes the collected mining equipment data and sends it to the platform.
[0069] Step S105: The platform filters, manages and stores the standardized mining equipment data.
[0070] In general, computer programs include routines, programs, libraries, objects, classes, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The functions of the programs can be combined or separated between programs as needed in various embodiments. The machine executable instructions of the programs can be executed in local or distributed devices. In distributed devices, the programs can be located in both local storage media and remote storage media.
[0071] The program code for executing the disclosed method can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer or other programmable data processing device so that the program code enables the function / operation specified in the flow chart and / or block diagram to be realized when the program code is executed by the processor or controller. The program code can be executed completely on the machine, partially on the machine, as an independent software package, partially on the machine and partially on a remote machine, or completely on a remote machine or server.
[0072] The above-mentioned program code can be implemented on a machine-readable medium, which can be any tangible medium that can contain or store a program used by or in conjunction with an instruction execution system, device or equipment. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium can include, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared or semiconductor system, device or equipment, or any suitable combination of the foregoing. More specific examples of machine-readable storage media will include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0073] The present invention relates to a mining equipment data acquisition platform based on Apache PLC4X. The mining equipment includes sensing equipment and field equipment. The data is divided into sensing data, file data and audio and video data. The non-audio and video equipment data is usually transmitted in a variety of data formats and data protocols. The data acquisition work is divided into a gateway side and a platform side. The gateway side uses Apache PLC4X to access, parse, convert and encapsulate industrial protocols into a self-defined message format and push it to the MQT message queue of the platform. The platform side program reads the MQT message and related configurations and stores the data in a database. This platform uses the Java language, is cross-platform, gets rid of the windows operating system restrictions of commercial data acquisition software, adopts a distributed architecture mode, and improves the speed and efficiency of data acquisition.
[0074] Therefore, the main beneficial effects of the present invention are as follows:
[0075] 1. Cross-platform: It is implemented using the Apache PLC4X framework in Java and can run on Windows / Linux / Unix operating systems.
[0076] 2. Strong real-time performance: This platform can realize the real-time collection of mining equipment monitoring data, which is of great significance to mine safety production.
[0077] 3. High collection efficiency: This platform collects data in a distributed manner, and multiple gateways can collect data from different devices at the same time, which can greatly improve data collection efficiency.
[0078] 4. Widely applicable: This platform can be widely used in the field of data collection in coal mines and metal mines, providing support and guarantee for the intelligent and digital construction of mines.
[0079] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment, and non-volatile computer storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0080] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A mining equipment data acquisition method based on Apache PLC4X, characterized in that: include: The gateway is configured based on the Apache PLC4X framework to collect mining equipment data in a distributed manner; The driver standardizes the collected mining equipment data and sends it to the platform; The platform filters, manages and stores the standardized mining equipment data.
2. The mining equipment data acquisition method based on Apache PLC4X according to claim 1 is characterized in that: Also includes: The gateway receives a platform message sent by the platform; Extracting hidden information corresponding to a subject of the platform message; If it is determined that the source of the platform message is legitimate according to the hidden information, the platform message is parsed to obtain parsed data; It is determined according to the parsed data whether the object of the platform message is a gateway, a device or a driver.
3. The mining equipment data acquisition method based on Apache PLC4X according to claim 2 is characterized in that: The platform message includes configuration and operation instructions issued by the platform.
4. The mining equipment data acquisition method based on Apache PLC4X according to claim 2 is characterized in that: The hidden information of the subject corresponding to the platform message includes a gateway ID, a configuration category and an operation type.
5. The mining equipment data acquisition method based on Apache PLC4X according to claim 1 is characterized in that: Also includes: The platform receives a gateway message sent by the gateway; Extracting hidden information corresponding to a subject of the gateway message; According to the hidden information, if it is determined that the source of the gateway message is legal, the gateway message is processed according to data processing rules, and the data of the gateway message is stored.
6. The mining equipment data acquisition method based on Apache PLC4X according to claim 5 is characterized in that: The hidden information of the topic corresponding to the gateway message includes: gateway ID, gateway token and sub-topic.
7. The mining equipment data acquisition method based on Apache PLC4X according to any one of claims 1 to 6, characterized in that: The gateway configuration collects a list of devices, and the platform configures a list of gateways.
8. The mining equipment data acquisition method based on Apache PLC4X according to any one of claims 1 to 6, characterized in that: The mining equipment data is saved to different libraries and different tables of the platform according to the configuration, and the mining equipment data includes real-time data and historical data.
9. An electronic device, characterized in that: include: at least one processor (110); a memory (120) communicatively coupled to the at least one processor (110); The memory (120) stores instructions executable by the at least one processor (110), and the instructions are executed by the at least one processor (110) to enable the at least one processor (110) to: The gateway is configured based on the Apache PLC4X framework to collect mining equipment data in a distributed manner; The driver standardizes the collected mining equipment data and sends it to the platform; The platform filters, manages and stores the standardized mining equipment data.
10. A storage medium, characterized in that: A computer program is stored, and when the computer program is executed by a processor, the mining equipment data collection method based on Apache PLC4X as described in any one of claims 1 to 8 is implemented.