Method, device and equipment for collecting MODBUS equipment data based on Internet of Things platform and medium

By obtaining point table information of MODBUS devices, configuring data acquisition channels and point information, creating products and device models on the Internet of Things platform, and performing data mapping and conversion, the protocol conversion problem of MODBUS devices when connecting to the Internet of Things platform is solved. , realizes efficient and accurate data conversion and storage, reducing development difficulty and cost.

CN119484658AActive Publication Date: 2025-02-18山东浪潮智能生产技术有限公司

Patent Information

Application Number
CN202411532743.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-02-18
Estimated Expiration
2044-10-30

AI Technical Summary

Technical Problem

When connecting MODBUS devices to the IoT platform, protocol conversion is required. The existing methods rely on manual operations or automation tools, resulting in the conversion process taking time, low efficiency, high development difficulty, high time cost, and a lot of customized development work required .

Method used

By obtaining the point table information of the target MODBUS device, configuring the MODBUS channel information and point information collected by data, creating products, equipment and objects models on the Internet of Things platform, and mapping relationships with the point information of the MODBUS device, read The data is taken and stored according to the storage policy, and ultimately converting the data into standard data that can be identified by the IoT platform.

Benefits of technology

It realizes the rapid and efficient conversion of MODBUS data into IoT standard data, reduces unnecessary intermediate links, shortens conversion time, ensures data accuracy and consistency, reduces project implementation costs and development difficulties, and The intelligent transformation of old equipment provides cost-effective solutions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119484658A_ABST
    Figure CN119484658A_ABST
Patent Text Reader

Abstract

The invention provides a method, system and device for collecting MODBUS device data based on an Internet of Things platform and a medium, and belongs to the technical field of data conversion, and the method comprises the following steps: obtaining point table information of a target MODBUS device, MODBUS channel information for data collection of the target MODBUS device, and point position information configuration; creating a product model, a device model and an object model for the target MODBUS device on the Internet of Things platform, and carrying out mapping relation binding with point location information of data acquisition of the target MODBUS device; reading data from the target MODBUS equipment according to the bound mapping relation, and storing the data according to a preset storage strategy; and converting the read target MODBUS equipment data into standard data which can be identified by the Internet of Things platform. The MODBUS equipment data is efficiently converted into the Internet of Things standard data, the cost period is shortened, and the method is compatible with a multi-equipment platform.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of data conversion, and in particular relates to a method, device, equipment and medium for collecting MODBUS device data based on an Internet of Things platform. Background Art

[0002] MODBUS is one of the widely used communication protocols in the industrial field. Due to its simplicity, openness and flexibility, it is widely used in data exchange and control between PLCs, sensors, actuators and other devices in various industrial automation systems. The MODBUS protocol enables these devices to work together efficiently to achieve control and monitoring of automated production lines. With the development of the Internet of Things, the MODBUS protocol has also been widely used in the interconnection of various intelligent devices and systems. Through the Internet of Things technology, the data of MODBUS devices can be integrated into the cloud or remote monitoring system to achieve remote monitoring and control.

[0003] However, IoT platforms usually use different communication protocols from MODBUS, such as MOTT, CoAP, HTTP, etc. Therefore, protocol conversion is required when connecting MODBUS devices to IoT platforms to ensure that MODBUS device data can be correctly transmitted and parsed in the IoT environment. The current method of converting MODBUS devices to IoT standard data relies on manual operation or automated tools. On the one hand, the conversion process is time-consuming and inefficient, resulting in delays in data processing and affecting the real-time performance of the IoT platform. On the other hand, developers need to write data conversion programs from scratch to adapt to different MODBUS devices and IoT platforms, which is difficult to develop and time-consuming. In addition, different MODBUS devices and IoT platforms may have different data formats and communication protocols, resulting in a lot of customized development work when devices are connected to IoT platforms. Summary of the invention

[0004] In a first aspect, an embodiment of the present application provides a method for collecting MODBUS device data based on an Internet of Things platform, comprising the following steps: S1. Obtain the point table information of the target MODBUS device, and configure the MODBUS channel information and point information of the target MODBUS device for data collection according to the point table information of the target MODBUS device; S2. Create product, device and object models for the target MODBUS device on the IoT platform based on the point table information of the target MODBUS device, and bind them to the mapping relationship with the point information of the target MODBUS device for data collection; S3. Read data from the target MODBUS device according to the bound mapping relationship, and then store it according to the pre-set storage strategy; S4. Convert the read target MODBUS device data into standard data recognizable by the IoT platform.

[0005] Furthermore, the specific steps of step S1 are as follows: S11 obtains the point table information of the target MODBUS device from the manufacturer, the point table information includes the register address, data type and scaling factor of the target MODBUS device; S12. Customize the channel name for the target MODBUS device according to the point table information of the target MODBUS device, select the MODBUS protocol, and configure the IP address and port corresponding to the MODBUS host to complete the MODBUS channel information configuration for data collection; S13. According to the point table information of the target MODBUS device, the collector is used to configure the point information for data collection for the target MODBUS device. Through the configuration of MODBUS channel information, the accuracy and reliability of data collection are ensured, laying the foundation for subsequent data transmission and processing.

[0006] Furthermore, the specific steps of step S13 are as follows: S131. Select the MODBUS channel for the target MODBUS device, customize the collector name, select the fault handling method, set the device data timeout, and set the MODBUS slave address; S132. According to the point table information of the target MODBUS device, create a point name, select a function code, enter a point address, set a scaling factor, set an access type, and set a collection frequency. By refining the point information configuration steps, the flexibility and pertinence of data collection are improved, making data collection more in line with actual needs.

[0007] Furthermore, the specific steps of step S2 are as follows: S21. Create a product name for the target MODBUS device, import object model attributes according to the point table information of the target MODBUS device, and then set the storage strategy according to the storage requirements; S22. Create a device name for the target MODBUS and select the product to which it belongs; S23. Create a physical model for the target MODBUS device according to the point table information of the target MODBUS device, and set the data type of the physical model; S24. Establish a binding mapping relationship between the physical model of the target MODBUS device and the point information of the target MODBUS device for data collection. Create product, device and physical models for the target MODBUS device on the IoT platform and bind the mapping relationship, so as to achieve the standardization and normalization management of device data and facilitate subsequent data analysis and application.

[0008] Furthermore, the specific steps of step S3 are as follows: S31 query the storage strategy of the product attributes of the target MODBUS device; S32. According to the mapping relationship between the target MODBUS device's point information and the product, device, and object model binding, and using the configured MODBUS channel information to read data from the target MODBUS device; S33. Save the data of the target MODBUS device according to the storage strategy. Saving the read data according to the storage strategy ensures the integrity and traceability of the data, and provides strong support for data analysis and decision-making.

[0009] Furthermore, the specific steps of step S4 are as follows: S41. Create a JSON object for the target MODBUS device and set the device properties with field values ​​empty for the target MODBUS device in the JSON object; S42.According to the mapping relationship between the point information of the target MODBUS device and the product, device, and object model, the stored data is obtained and filled into the device attributes of the JSON object to complete the collection of MODBUS device data. The JSON object is created and the device attributes are filled, which realizes the conversion of MODBUS device data to the standard data of the Internet of Things platform and improves the readability and usability of the data.

[0010] Furthermore, the specific steps of step S42 are as follows: S421. Obtain the saved data of the target MODBUS device and verify whether it is within a reasonable range after scaling according to the corresponding scaling factor; If yes, go to step S422; If not, record an error log; S422. Fill the scaled data of the target device into the field value of the corresponding device attribute of the JSON object. Scaling and verification before data filling ensures the accuracy and rationality of the data, avoids subsequent problems caused by data errors, and improves the stability and reliability of the system. At the same time, recording error logs also facilitates problem troubleshooting and repair.

[0011] In a second aspect, an embodiment of the present application further provides a device for collecting MODBUS device data based on an Internet of Things platform, including: The MODBUS channel and point configuration module is used to obtain the point table information of the target MODBUS device, and configure the MODBUS channel information and point information of the target MODBUS device for data collection according to the point table information of the target MODBUS device; The MODBUS product, device, and object model creation module is used to create product, device, and object models for the target MODBUS device on the IoT platform according to the point table information of the target MODBUS device, and to map and bind the point information of the target MODBUS device for data collection; The data reading module is used to read data from the target MODBUS device according to the bound mapping relationship, and then store it according to the pre-set storage strategy; The data conversion module is used to convert the read target MODBUS device data into standard data recognizable by the IoT platform.

[0012] In a third aspect, an embodiment of the present application further provides an electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein when the processor executes the program, the steps of the method for collecting MODBUS device data based on an Internet of Things platform as described in the first aspect are implemented.

[0013] In a fourth aspect, an embodiment of the present application further provides a storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method for collecting MODBUS device data based on an Internet of Things platform as described in the first aspect are implemented.

[0014] It can be seen from the above technical solutions that the present invention has the following advantages: In the method, apparatus, device and medium for collecting MODBUS device data based on an Internet of Things platform provided by the present application, the point table information of the target MODBUS device is obtained, the MODBUS channel information and point information for data collection of the target MODBUS device are configured, and a product, device and thing model are created for the target MODBUS device on the Internet of Things platform, and the mapping relationship is bound with the point information for data collection of the target MODBUS device; data is read from the target MODBUS device according to the bound mapping relationship, and then stored according to a pre-set storage strategy; the read target MODBUS device data is converted into standard data recognizable by the Internet of Things platform, and the MODBUS data can be quickly and efficiently converted into Internet of Things standard data, which reduces unnecessary intermediate links and greatly shortens the conversion time. The MODBUS data is strictly parsed and verified to ensure that the converted Internet of Things standard data is consistent with the original data, which can effectively avoid problems such as data loss and erroneous conversion during the conversion process, and the existing MODBUS The device is connected to the Internet of Things platform without large-scale equipment upgrades or redevelopment, which greatly reduces the implementation cost and development difficulty of the project, shortens the project cycle, and also provides a cost-effective solution for the intelligent transformation of old equipment, extending the service life of the equipment. The present invention is also versatile and compatible, and can be applied to different types of MODBUS devices and various Internet of Things platforms, so that different devices and platforms can be seamlessly connected, reducing repeated development and investment caused by incompatibility between devices and platforms. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the technical solution of the present invention, the accompanying drawings required for use in the description will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0016] Figure 1 The present invention is a flow chart of an embodiment of a method for collecting MODBUS device data based on an Internet of Things platform.

[0017] Figure 2 The present invention is a flow chart of another embodiment of a method for collecting MODBUS device data based on an Internet of Things platform.

[0018] Figure 3 This is a schematic diagram of a system for collecting MODBUS device data based on the Internet of Things platform.

[0019] Figure 4 A schematic diagram of an electronic device for storing a method for collecting MODBUS device data based on an Internet of Things platform. DETAILED DESCRIPTION

[0020] In the specific steps of the method for collecting MODBUS device data based on the Internet of Things platform, which will be described in detail below, various embodiments of the present disclosure will be described more comprehensively. The present disclosure may have various embodiments, and adjustments and changes may be made therein. However, it should be understood that there is no intention to limit the various embodiments of the present disclosure to the specific embodiments disclosed herein, but the present disclosure should be understood to cover all adjustments, equivalents and / or alternatives that fall within the spirit and scope of the various embodiments of the present disclosure.

[0021] For example, the MODBUS protocol is widely used in the industrial field to promote efficient collaboration between devices. With the development of the Internet of Things, MODBUS devices need to be connected to the Internet of Things platform, but they face the problem of protocol conversion. The current conversion method relies on manual or automated tools, which has challenges such as long time consumption, low efficiency, high development difficulty, high time cost, and the need for a lot of customized development.

[0022] In view of the above problems, this embodiment provides a method for collecting MODBUS device data based on the Internet of Things platform. By mapping the data in MODBUS with the device attributes of the Internet of Things platform, the MODBUS data is organized into the standard data format of the Internet of Things, and the device data in MODBUS is uploaded to the Internet of Things platform. Each real device can be accurately mapped, solving the problem of difficulty in finding the real source and function of the data. It can improve efficiency, reduce costs, enhance security and promote intelligent management, and provide developers with open interfaces and tools to make innovation easier.

[0023] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only 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 ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0024] See also Figure 1 The figure is a flow chart of a method for collecting MODBUS device data based on an Internet of Things platform in a specific embodiment, and the method includes the following steps: S1. Obtain the point table information of the target MODBUS device, and configure the MODBUS channel information and point information of the target MODBUS device for data collection according to the point table information of the target MODBUS device; Among them, the configuration of MODBUS channel information and point information is usually performed in the data acquisition system or data gateway. The data acquisition system or gateway is responsible for reading data from the MODBUS device. Therefore, it is necessary to configure the data acquisition channel and point according to the point table information provided by the manufacturer; S2. Create product, device and object models for the target MODBUS device on the IoT platform based on the point table information of the target MODBUS device, and bind them to the mapping relationship with the point information of the target MODBUS device for data collection; Among them, creating product, device and object models for the target MODBUS device, as well as binding mapping relationships, and establishing associations are carried out in the background management system of the IoT platform or a special configuration tool. The IoT platform needs to understand the characteristics and data format of the MODBUS device in order to correctly display and control these devices on the platform. Therefore, it is necessary to build corresponding product, device and object model information on the IoT platform based on the MODBUS point table information; and by binding the product, device and object model information on the IoT platform with the data collection points, it can be ensured that the data read from the MODBUS device can be correctly mapped to the device model on the IoT platform; S3. Read data from the target MODBUS device according to the bound mapping relationship, and then store it according to the pre-set storage strategy; Among them, the storage of data involves the data storage component of the IoT platform or an external database system. The IoT platform needs to store the data read and converted from the target MODBUS device for subsequent analysis, processing and display. The database system for storing data can be the IoT platform itself or externally integrated. S4. Convert the read target MODBUS device data into standard data recognizable by the IoT platform; Among them, data conversion is carried out in the data acquisition system, data gateway or data processing component of the Internet of Things platform. The purpose of data conversion is to convert the MODBUS data format into a standard data format that can be recognized by the Internet of Things platform. The converted data can be directly reported to the Internet of Things platform for subsequent use.

[0025] In this embodiment, the device data is collected by the MODBUS protocol and the data in the MODBUS can be converted into a standard data format of the Internet of Things platform, so that the data in the standard format is reported to the cloud platform.

[0026] Further, as a refinement and extension of the specific implementation of the above embodiment, in order to fully illustrate the specific implementation process in this embodiment, another method for collecting MODBUS device data based on the Internet of Things platform is provided, such as Figure 2 As shown, the method comprises the following steps: The specific steps of step S1 are as follows: S11 obtains the point table information of the target MODBUS device from the manufacturer, the point table information includes the register address, data type and scaling factor of the target MODBUS device; For example, take a temperature and humidity sensor using the MODBUS protocol as an example, and its data needs to be connected to an IoT platform. The MODBUS point table information of the sensor is as follows: Temperature (register address: 40001, data type: 16-bit integer, scaling factor: 0.1); Humidity (register address: 40002, data type: 16-bit integer, scaling factor: 0.1); S12. Customize the channel name for the target MODBUS device according to the point table information of the target MODBUS device, select the MODBUS protocol, and configure the IP address and port corresponding to the MODBUS host to complete the MODBUS channel information configuration for data collection; Exemplarily, the following steps are used to configure the MODBUS channel information for the temperature and humidity sensor using the MODBUS protocol: Custom channel name: temperature and humidity sensor channel; Select MODBUS protocol; Configure the MODBUS host IP address: 192.168.1.100, port: 502; S13. Use the collector to configure the target MODBUS device for data collection based on the point table information of the target MODBUS device; The specific steps of step S2 are as follows: S21. Create a product name for the target MODBUS device, import object model attributes according to the point table information of the target MODBUS device, and then set the storage strategy according to the storage requirements; For example, create a product name for a temperature and humidity sensor using the MODBUS protocol: Create product name: Temperature and humidity sensor product; Import object model attributes: temperature (data type float), humidity (data type float); Set storage strategy: store at time intervals, with an interval of 1 minute; S22. Create a device name for the target MODBUS and select the product to which it belongs; For example, create a device name for a temperature and humidity sensor using the MODBUS protocol: Create device name: Temperature and humidity sensor device 1 Select the product: Temperature and humidity sensor products S23. Create a physical model for the target MODBUS device according to the point table information of the target MODBUS device, and set the data type of the physical model; S24. Establish a binding mapping relationship between the physical model of the target MODBUS device and the point information of the target MODBUS device for data collection; For example, create an object model for a temperature and humidity sensor using the MODBUS protocol and bind the mapping relationship: Combined with the point table information of the target MODBUS device, enrich the object model information: temperature (float), humidity (float); Binding mapping relationship: Temperature (physical model attribute) -> Temperature (collector point); Humidity (object model attribute) -> Humidity (collector point); The specific steps of step S3 are as follows: S31 query the storage strategy of the product attributes of the target MODBUS device; S32. According to the mapping relationship between the target MODBUS device's point information and the product, device, and object model binding, and using the configured MODBUS channel information to read data from the target MODBUS device; S33. The data of the target MODBUS device read is saved according to the storage strategy; Exemplarily, save the target MODBUS device data to internal storage: Query the storage scheme configured: store at time intervals, with an interval of 1 minute; Store device data according to the storage plan: store temperature and humidity data every 1 minute; The specific steps of step S4 are as follows: S41. Create a JSON object for the target MODBUS device and set the device properties with field values ​​empty for the target MODBUS device in the JSON object; For example, construct an empty JSON object for a temperature and humidity sensor using the MODBUS protocol: json { "temperature": null, "humidity": null }; S42. Obtain the stored data according to the mapping relationship between the target MODBUS device's point information and the product, device, and object model binding, fill it into the device properties of the JSON object, and complete the MODBUS device data collection; According to the binding mapping relationship, fill the corresponding data into the JSON object position: Assuming that the original temperature value read from the MODBUS device is 2500 (16-bit integer) and the original humidity value is 5000 (16-bit integer), the converted data is: json { "temperature": 250.0, / / 2500 * 0.1 = 250.0 "humidity": 500.0 / / 5000 * 0.1 = 500.0 }.

[0027] Through the implementation of the above steps, the temperature and humidity sensor data using the MODBUS protocol is converted into the standard book required by the Internet of Things platform, and the data reporting and storage are realized.

[0028] In an embodiment of the present invention, based on S13, a possible embodiment will be given below to illustrate its specific implementation scheme in a non-limiting manner.

[0029] The specific steps of step S13 are as follows: S131. Select the MODBUS channel for the target MODBUS device, customize the collector name, select the fault handling method, set the device data timeout, and set the MODBUS slave address; S132. According to the point table information of the target MODBUS device, create a point name, select a function code, enter the point address, set the scaling factor, set the access type, and set the acquisition frequency; For example, configure the point information for the temperature and humidity sensor using the MODBUS protocol: Select the channel information: temperature and humidity sensor channel; Custom collector name: temperature and humidity collector; Select the fault handling method: Retry; Set device data timeout: 10 seconds; Set slave address: 1; Create point information: Temperature: function code 03, register address 40001, scaling factor 0.1, access type read, acquisition frequency 10 seconds; Humidity: Function code 03, register address 40002, scaling factor 0.1, access type read, acquisition frequency 10 seconds.

[0030] In an embodiment of the present invention, based on step S42, a possible embodiment is given below to illustrate its specific implementation scheme in a non-limiting manner.

[0031] The specific steps of step S42 are as follows: S421. Obtain the saved data of the target MODBUS device and verify whether it is within a reasonable range after scaling according to the corresponding scaling factor; If yes, go to step S422; If not, record an error log; S422. Fill the target device scaled data into the field value of the corresponding device attribute of the JSON object; For example, a temperature and humidity sensor with a switch provides the following data points: Temperature (register address: 40001, data type: int16, scaling factor: 0.1) Humidity (register address: 40002, data type: uint8, no scaling required) Device status (register address: 40003, data type: bit, indicating on / off); Create a physical model with the following properties on the IoT platform: temperature (temperature, data type: float) humidity (data type: int) status (status, data type: boolean) The specific data reading process is as follows: Read the value of register 40001 from the MODBUS device. Assume that the original value read is 1234 (int16). Read the value of register 40002 from the MODBUS device, assuming the original value read is 50 (uint8); Read the value of register 40003 from the MODBUS device, assuming that the original value read is 1 (bit, 1 means on); The data parsing and verification process is as follows: Parse and validate the temperature value: Multiply 1234 (int16) by the scaling factor 0.1 to get 123.4. Verify that the value is within a reasonable range (for example, between -50 and 150). Parse and verify the humidity value: Use 50 (uint8) directly and verify that the value is within a reasonable range (for example, between 0 and 100); Parse and verify the status value: parse 1 (bit) as true (indicates on); Data formatting: json { "temperature": 123.4, / / Multiply 1234 (int16) by 0.1 to get 123.4 and fill it into the temperature field "humidity": 50, / / Use 50 (uint8) directly and fill it into the humidity field "status": true / / Parse 1 (bit) as true and fill it into the status field } Data reporting: Report the formatted JSON object to the IoT platform.

[0032] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0033] like Figure 3 As shown, the following is an embodiment of the device for collecting MODBUS device data based on an Internet of Things platform provided by the embodiment of the present disclosure. The device and the method for collecting MODBUS device data based on an Internet of Things platform in the above-mentioned embodiments belong to the same inventive concept. For details not fully described in the embodiment of the device for collecting MODBUS device data based on an Internet of Things platform, reference can be made to the embodiment of the method for collecting MODBUS device data based on an Internet of Things platform.

[0034] The device includes: The MODBUS channel and point configuration module is used to obtain the point table information of the target MODBUS device, and configure the MODBUS channel information and point information of the target MODBUS device for data collection according to the point table information of the target MODBUS device; The MODBUS product, device, and object model creation module is used to create product, device, and object models for the target MODBUS device on the IoT platform according to the point table information of the target MODBUS device, and to map and bind the point information of the target MODBUS device for data collection; The data reading module is used to read data from the target MODBUS device according to the bound mapping relationship, and then store it according to the pre-set storage strategy; The data conversion module is used to convert the read target MODBUS device data into standard data recognizable by the IoT platform.

[0035] The device for collecting MODBUS device data based on the Internet of Things platform of the present invention can quickly and efficiently convert MODBUS data into Internet of Things standard data, reduce unnecessary intermediate links, greatly shorten the conversion time, strictly parse and verify the MODBUS data, ensure that the converted Internet of Things standard data is consistent with the original data, and effectively avoid problems such as data loss and erroneous conversion during the conversion process. Existing MODBUS devices can be directly connected to the Internet of Things platform without large-scale equipment upgrades or redevelopment, which greatly reduces the implementation cost and development difficulty of the project and shortens the project cycle. At the same time, it also provides an economical and effective solution for the intelligent transformation of old equipment and prolongs the service life of the equipment. The present invention also has versatility and compatibility, and can be applied to different types of MODBUS devices and various Internet of Things platforms, so that different devices and platforms can be seamlessly connected, reducing repeated development and investment caused by incompatibility between devices and platforms.

[0036] Figure 4 A schematic diagram of the hardware structure of an electronic device for implementing various embodiments of the present invention.

[0037] The method for collecting MODBUS device data based on the Internet of Things platform provided in the embodiment of the present application can be applied to electronic devices. Those skilled in the art can understand that the electronic device structure involved in the embodiment of the present invention does not constitute a limitation on the electronic device, and the electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. In the embodiment of the present invention, The electronic device may include a processor, an external memory interface, an internal memory, a universal serial bus (USB) interface, a charging management module, a power management module, a battery, a wireless communication module, an audio module, a speaker, a microphone, a sensor module, buttons, a camera, a display, and a SIM card interface, etc.

[0038] It is to be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0039] The processor may include one or more processing units, for example, the processor may include a central processing unit (CPU), an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated into one or more processors.

[0040] The above electronic device implements the method of collecting MODBUS device data based on the Internet of Things platform of this application, obtains the point table information of the target MODBUS device, and configures the MODBUS channel information and point information of the target MODBUS device for data collection according to the point table information of the target MODBUS device, creates products, equipment and object models for the target MODBUS device on the Internet of Things platform according to the point table information of the target MODBUS device, and binds the mapping relationship with the point information of the target MODBUS device for data collection, reads data from the target MODBUS device according to the bound mapping relationship, and then stores it according to the pre-set storage strategy, S4. Converts the read target MODBUS device data into standard data recognizable by the Internet of Things platform, and achieves the ability to quickly and efficiently convert MODBUS data into Internet of Things standard data, reduces intermediate links, ensures data consistency, and avoids data loss or errors. It can directly connect existing MODBUS devices to the Internet of Things platform, reduce implementation costs, development difficulties and project cycles, and provide an economic solution for the intelligent transformation of old equipment. At the same time, it has universality and compatibility, realizes seamless docking between different devices and platforms, and reduces the beneficial effects of repeated development.

[0041] The storage medium provided in the present application stores a program product that can implement a method for collecting MODBUS device data based on an Internet of Things platform.

[0042] The method for collecting MODBUS device data based on an Internet of Things platform includes the following steps: obtaining point table information of a target MODBUS device, and configuring MODBUS channel information and point information for data collection of the target MODBUS device according to the point table information of the target MODBUS device; creating a product, device and object model for the target MODBUS device on the Internet of Things platform according to the point table information of the target MODBUS device, and binding them with the point information for data collection of the target MODBUS device through a mapping relationship; reading data from the target MODBUS device according to the bound mapping relationship, and then storing the data according to a pre-set storage strategy; and converting the read target MODBUS device data into standard data recognizable by the Internet of Things platform.

[0043] In some possible implementations, the method for collecting MODBUS device data based on an Internet of Things platform disclosed in the present invention can be implemented in the form of a program product, which includes a program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps described in the above "Exemplary Method" section of this specification according to various exemplary implementations of the present disclosure.

[0044] The storage medium of the present disclosure can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable 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 above.

[0045] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for collecting MODBUS device data based on an Internet of Things platform, characterized in that: The steps include: S1. Obtain the point table information of the target MODBUS device, and configure the MODBUS channel information and point information of the target MODBUS device for data collection according to the point table information of the target MODBUS device; S2. Create product, device and object models for the target MODBUS device on the IoT platform based on the point table information of the target MODBUS device, and bind them to the mapping relationship with the point information of the target MODBUS device for data collection; S3. Read data from the target MODBUS device according to the bound mapping relationship, and then store it according to the pre-set storage strategy; S4. Convert the read target MODBUS device data into standard data recognizable by the IoT platform.

2. The method for collecting MODBUS device data based on the Internet of Things platform as claimed in claim 1, characterized in that: The specific steps of step S1 are as follows: S11. Obtain the point table information of the target MODBUS device from the manufacturer, wherein the point table information includes the register address, data type and scaling factor of the target MODBUS device; S12. Customize the channel name for the target MODBUS device according to the point table information of the target MODBUS device, select the MODBUS protocol, and configure the IP address and port corresponding to the MODBUS host to complete the MODBUS channel information configuration for data collection; S13. Use the collector to configure the point information for data collection for the target MODBUS device according to the point table information of the target MODBUS device.

3. The method for collecting MODBUS device data based on the Internet of Things platform as claimed in claim 2, characterized in that: The specific steps of step S13 are as follows: S131. Select the MODBUS channel for the target MODBUS device, customize the collector name, select the fault handling method, set the device data timeout, and set the MODBUS slave address; S132. According to the point table information of the target MODBUS device, create a point name, select a function code, enter a point address, set a scaling factor, set an access type, and set an acquisition frequency.

4. The method for collecting MODBUS device data based on the Internet of Things platform as claimed in claim 2, characterized in that: The specific steps of step S2 are as follows: S21. Create a product name for the target MODBUS device, import object model attributes according to the point table information of the target MODBUS device, and then set the storage strategy according to the storage requirements; S22. Create a device name for the target MODBUS and select the product to which it belongs; S23. Create a physical model for the target MODBUS device according to the point table information of the target MODBUS device, and set the data type of the physical model; S24. Establish a binding mapping relationship between the physical model of the target MODBUS device and the point information of data collection of the target MODBUS device.

5. The method for collecting MODBUS device data based on the Internet of Things platform as claimed in claim 4, characterized in that: The specific steps of step S3 are as follows: S31 query the storage strategy of the product attributes of the target MODBUS device; S32. According to the mapping relationship between the target MODBUS device's point information and the product, device, and object model binding, and using the configured MODBUS channel information to read data from the target MODBUS device; S33. Save the data of the target MODBUS device read according to the storage strategy.

6. The method for collecting MODBUS device data based on the Internet of Things platform as claimed in claim 5, characterized in that: The specific steps of step S4 are as follows: S41. Create a JSON object for the target MODBUS device and set the device properties with field values ​​empty for the target MODBUS device in the JSON object; S42. Obtain the stored data according to the mapping relationship between the point information of the target MODBUS device and the product, device, and object model binding, fill it into the device attributes of the JSON object, and complete the collection of MODBUS device data.

7. The method for collecting MODBUS device data based on the Internet of Things platform as claimed in claim 6, characterized in that: The specific steps of step S42 are as follows: S421. Obtain the saved data of the target MODBUS device and verify whether it is within a reasonable range after scaling according to the corresponding scaling factor; If yes, go to step S422; If not, record an error log; S422. Fill the scaled data of the target device into the field value of the corresponding device attribute of the JSON object.

8. A device for collecting MODBUS device data based on an Internet of Things platform, characterized in that: include: The MODBUS channel and point configuration module is used to obtain the point table information of the target MODBUS device, and configure the MODBUS channel information and point information of the target MODBUS device for data collection according to the point table information of the target MODBUS device; The MODBUS product, device, and object model creation module is used to create product, device, and object models for the target MODBUS device on the IoT platform according to the point table information of the target MODBUS device, and to map and bind the point information of the target MODBUS device for data collection; The data reading module is used to read data from the target MODBUS device according to the bound mapping relationship, and then store it according to the pre-set storage strategy; The data conversion module is used to convert the read target MODBUS device data into standard data recognizable by the IoT platform.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the method for collecting MODBUS device data based on the Internet of Things platform as described in any one of claims 1 to 7 are implemented.

10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for collecting MODBUS device data based on an Internet of Things platform as described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Modbus data monitoring method and system based on cloud platform deployment object model

    CN114520749A

  • Equipment data acquisition method and device, equipment data analysis method and device and computer equipment

    CN116743790A

  • Data acquisition method and system based on Internet of Things platform

    CN117991686A

  • Automated discovery of security policy from design data

    US20200120143A1

Cited By

  • Equipment data collection method, device and system based on multi-source heterogeneity and storage medium

    CN119782404A

  • Automatic website building method and system, electronic equipment and computer readable storage medium

    CN120567665A